diff --git a/CompileJS.bat b/CompileJS.bat new file mode 100755 index 00000000..f30005da --- /dev/null +++ b/CompileJS.bat @@ -0,0 +1,4 @@ +@echo off +title gradlew generateJavascript +gradlew generateJavascript +pause \ No newline at end of file diff --git a/CompileJS.sh b/CompileJS.sh new file mode 100755 index 00000000..83abaccb --- /dev/null +++ b/CompileJS.sh @@ -0,0 +1,3 @@ +#!/bin/sh +chmod +x gradlew +./gradlew generateJavascript \ No newline at end of file diff --git a/desktopRuntime/resources/assets/eagler/glsl/deferred/deferred_core.vsh b/desktopRuntime/resources/assets/eagler/glsl/deferred/deferred_core.vsh index e0610aa9..30ebf7ca 100755 --- a/desktopRuntime/resources/assets/eagler/glsl/deferred/deferred_core.vsh +++ b/desktopRuntime/resources/assets/eagler/glsl/deferred/deferred_core.vsh @@ -1,116 +1,116 @@ -#line 2 - -/* - * Copyright (c) 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. - * - */ - -in vec3 a_position3f; - -#ifdef COMPILE_TEXTURE_ATTRIB -in vec2 a_texture2f; -out vec2 v_texture2f; -uniform mat4 u_textureMat4f01; -#endif - -#ifdef COMPILE_COLOR_ATTRIB -in vec4 a_color4f; -out vec4 v_color4f; -#endif - -#ifdef COMPILE_NORMAL_ATTRIB -in vec4 a_normal4f; -out vec3 v_normal3f; -out float v_block1f; -#endif - -#ifdef COMPILE_STATE_WAVING_BLOCKS -uniform mat4 u_modelMatrix4f; -uniform mat4 u_viewMatrix4f; -uniform vec3 u_wavingBlockOffset3f; -uniform vec4 u_wavingBlockParam4f; -#ifndef COMPILE_NORMAL_ATTRIB -uniform float u_blockConstant1f; -#endif -#define DO_COMPILE_STATE_WAVING_BLOCKS -#define FAKE_SIN(valueIn, valueOut)\ - valueOut = abs(1.0 - fract(valueIn * 0.159155) * 2.0);\ - valueOut = valueOut * valueOut * (3.0 - 2.0 * valueOut) * 2.0 - 1.0; -#define LIB_INCLUDE_WAVING_BLOCKS_FUNCTION -#endif - -#EAGLER INCLUDE (2) "eagler:glsl/deferred/lib/waving_blocks.glsl" - -#ifdef COMPILE_NORMAL_MATERIAL_TEXTURE -out vec3 v_viewdir3f; -#endif - -#ifdef COMPILE_LIGHTMAP_ATTRIB -in vec2 a_lightmap2f; -out vec2 v_lightmap2f; -uniform mat4 u_textureMat4f02; -#endif - -uniform mat4 u_modelviewMat4f; -uniform mat4 u_projectionMat4f; - -#define TEX_MAT3(mat4In) mat3(mat4In[0].xyw,mat4In[1].xyw,mat4In[3].xyw) - -void main() { - -#ifdef COMPILE_TEXTURE_ATTRIB - vec3 v_textureTmp3f = TEX_MAT3(u_textureMat4f01) * vec3(a_texture2f, 1.0); - v_texture2f = v_textureTmp3f.xy / v_textureTmp3f.z; -#endif - -#ifdef COMPILE_COLOR_ATTRIB - v_color4f = a_color4f; -#endif - -#ifdef COMPILE_NORMAL_ATTRIB - v_normal3f = normalize(mat3(u_modelviewMat4f) * a_normal4f.xyz); - float blockId = v_block1f = floor((a_normal4f.w + 1.0) * 127.0 + 0.5); -#endif - -#ifdef COMPILE_LIGHTMAP_ATTRIB - vec3 v_lightmapTmp3f = TEX_MAT3(u_textureMat4f02) * vec3(a_lightmap2f, 1.0); - v_lightmap2f = v_lightmapTmp3f.xy / v_lightmapTmp3f.z; -#endif - - vec4 pos = vec4(a_position3f, 1.0); - -#ifdef DO_COMPILE_STATE_WAVING_BLOCKS -#ifndef COMPILE_NORMAL_ATTRIB - float blockId = u_blockConstant1f; -#endif -#ifdef COMPILE_LIGHTMAP_ATTRIB - if(v_lightmap2f.y > 0.33) { - COMPUTE_WAVING_BLOCKS(pos, min(v_lightmap2f.y * 3.0 - 1.0, 1.0), 24.0, blockId, u_modelMatrix4f, u_viewMatrix4f, u_modelviewMat4f, u_wavingBlockOffset3f, u_wavingBlockParam4f) - }else { - pos = u_modelviewMat4f * pos; - } -#else - COMPUTE_WAVING_BLOCKS(pos, 1.0, 32.0, blockId, u_modelMatrix4f, u_viewMatrix4f, u_modelviewMat4f, u_wavingBlockOffset3f, u_wavingBlockParam4f) -#endif -#else - pos = u_modelviewMat4f * pos; -#endif - -#ifdef COMPILE_NORMAL_MATERIAL_TEXTURE - v_viewdir3f = pos.xyz / pos.w; -#endif - - gl_Position = u_projectionMat4f * pos; - -} +#line 2 + +/* + * Copyright (c) 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. + * + */ + +in vec3 a_position3f; + +#ifdef COMPILE_TEXTURE_ATTRIB +in vec2 a_texture2f; +out vec2 v_texture2f; +uniform mat4 u_textureMat4f01; +#endif + +#ifdef COMPILE_COLOR_ATTRIB +in vec4 a_color4f; +out vec4 v_color4f; +#endif + +#ifdef COMPILE_NORMAL_ATTRIB +in vec4 a_normal4f; +out vec3 v_normal3f; +out float v_block1f; +#endif + +#ifdef COMPILE_STATE_WAVING_BLOCKS +uniform mat4 u_modelMatrix4f; +uniform mat4 u_viewMatrix4f; +uniform vec3 u_wavingBlockOffset3f; +uniform vec4 u_wavingBlockParam4f; +#ifndef COMPILE_NORMAL_ATTRIB +uniform float u_blockConstant1f; +#endif +#define DO_COMPILE_STATE_WAVING_BLOCKS +#define FAKE_SIN(valueIn, valueOut)\ + valueOut = abs(1.0 - fract(valueIn * 0.159155) * 2.0);\ + valueOut = valueOut * valueOut * (3.0 - 2.0 * valueOut) * 2.0 - 1.0; +#define LIB_INCLUDE_WAVING_BLOCKS_FUNCTION +#endif + +#EAGLER INCLUDE (2) "eagler:glsl/deferred/lib/waving_blocks.glsl" + +#ifdef COMPILE_NORMAL_MATERIAL_TEXTURE +out vec3 v_viewdir3f; +#endif + +#ifdef COMPILE_LIGHTMAP_ATTRIB +in vec2 a_lightmap2f; +out vec2 v_lightmap2f; +uniform mat4 u_textureMat4f02; +#endif + +uniform mat4 u_modelviewMat4f; +uniform mat4 u_projectionMat4f; + +#define TEX_MAT3(mat4In) mat3(mat4In[0].xyw,mat4In[1].xyw,mat4In[3].xyw) + +void main() { + +#ifdef COMPILE_TEXTURE_ATTRIB + vec3 v_textureTmp3f = TEX_MAT3(u_textureMat4f01) * vec3(a_texture2f, 1.0); + v_texture2f = v_textureTmp3f.xy / v_textureTmp3f.z; +#endif + +#ifdef COMPILE_COLOR_ATTRIB + v_color4f = a_color4f; +#endif + +#ifdef COMPILE_NORMAL_ATTRIB + v_normal3f = normalize(mat3(u_modelviewMat4f) * a_normal4f.xyz); + float blockId = v_block1f = floor((a_normal4f.w + 1.0) * 127.0 + 0.5); +#endif + +#ifdef COMPILE_LIGHTMAP_ATTRIB + vec3 v_lightmapTmp3f = TEX_MAT3(u_textureMat4f02) * vec3(a_lightmap2f, 1.0); + v_lightmap2f = v_lightmapTmp3f.xy / v_lightmapTmp3f.z; +#endif + + vec4 pos = vec4(a_position3f, 1.0); + +#ifdef DO_COMPILE_STATE_WAVING_BLOCKS +#ifndef COMPILE_NORMAL_ATTRIB + float blockId = u_blockConstant1f; +#endif +#ifdef COMPILE_LIGHTMAP_ATTRIB + if(v_lightmap2f.y > 0.33) { + COMPUTE_WAVING_BLOCKS(pos, min(v_lightmap2f.y * 3.0 - 1.0, 1.0), 24.0, blockId, u_modelMatrix4f, u_viewMatrix4f, u_modelviewMat4f, u_wavingBlockOffset3f, u_wavingBlockParam4f) + }else { + pos = u_modelviewMat4f * pos; + } +#else + COMPUTE_WAVING_BLOCKS(pos, 1.0, 32.0, blockId, u_modelMatrix4f, u_viewMatrix4f, u_modelviewMat4f, u_wavingBlockOffset3f, u_wavingBlockParam4f) +#endif +#else + pos = u_modelviewMat4f * pos; +#endif + +#ifdef COMPILE_NORMAL_MATERIAL_TEXTURE + v_viewdir3f = pos.xyz / pos.w; +#endif + + gl_Position = u_projectionMat4f * pos; + +} diff --git a/desktopRuntime/resources/assets/eagler/glsl/deferred/skybox_render_end.fsh b/desktopRuntime/resources/assets/eagler/glsl/deferred/skybox_render_end.fsh index 16b32bd6..b4e0cdc7 100755 --- a/desktopRuntime/resources/assets/eagler/glsl/deferred/skybox_render_end.fsh +++ b/desktopRuntime/resources/assets/eagler/glsl/deferred/skybox_render_end.fsh @@ -24,7 +24,7 @@ in vec3 v_position3f; layout(location = 0) out vec4 output4f; -#define SKY_BRIGHTNESS 0.015 +#define SKY_BRIGHTNESS 0.05 uniform sampler2D u_skyTexture; diff --git a/gradle.properties b/gradle.properties new file mode 100755 index 00000000..a36eb1cc --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +org.gradle.jvmargs=-Xmx2G -Xms2G \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3c309a13..6b932e82 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists 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 index 6ed61b81..acb6ec20 100755 --- 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 @@ -7,7 +7,6 @@ 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; /** @@ -29,7 +28,6 @@ public class ServerPlatformSingleplayer { public static void initializeContext() { PlatformFilesystem.initialize(); - EaglerServerBootstrap.staticInit(); } public static void sendPacket(IPCPacketData packet) { 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 2652b30c..bcf3e615 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java @@ -10,22 +10,17 @@ public class EaglercraftVersion { /// Customize these to fit your fork: public static final String projectForkName = "EaglercraftX"; - public static final String projectForkVersion = "u22"; + public static final String projectForkVersion = "u23"; public static final String projectForkVendor = "lax1dude"; public static final String projectForkURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; ////////////////////////////////////////////////////////////////////// - - - // Do not change these, they must stay as credit to lax1dude's - // original repository for maintaining the project: - 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 projectOriginVersion = "u23"; public static final String projectOriginURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; // rest in peace @@ -36,7 +31,7 @@ public class EaglercraftVersion { 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 int updateBundlePackageVersionInt = 23; public static final String updateLatestLocalStorageKey = "latestUpdate_" + updateBundlePackageName; 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 b941b5ac..2c452b44 100755 --- 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,7 +17,7 @@ import net.lax1dude.eaglercraft.v1_8.opengl.FixedFunctionShader.FixedFunctionCon import net.lax1dude.eaglercraft.v1_8.vector.Matrix4f; /** - * Copyright (c) 2023 lax1dude. All Rights Reserved. + * 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 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 e7d01c2f..f59144dd 100755 --- 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 @@ -1620,6 +1620,24 @@ public class EaglerDeferredPipeline { DeferredStateManager.checkGLError("combineGBuffersAndIlluminate(): NETHER SKY IRRADIANCE MAP"); + }else if(dim == 1) { + + // =============== END SKY REFLECTION MAP ================ // + + _wglBindFramebuffer(_GL_FRAMEBUFFER, envMapSkyFramebuffer); + GlStateManager.clearColor(0.1f, 0.06f, 0.19f, 1.0f); + GlStateManager.clear(GL_COLOR_BUFFER_BIT); + + DeferredStateManager.checkGLError("combineGBuffersAndIlluminate(): END SKY REFLECTION MAP"); + + // =============== END SKY IRRADIANCE MAP ================ // + + _wglBindFramebuffer(_GL_FRAMEBUFFER, skyIrradianceFramebuffer); + GlStateManager.clearColor(0.05f, 0.03f, 0.09f, 1.0f); + GlStateManager.clear(GL_COLOR_BUFFER_BIT); + + DeferredStateManager.checkGLError("combineGBuffersAndIlluminate(): END SKY IRRADIANCE MAP"); + } } 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 index f5305b68..0c1874a9 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/SingleplayerServerController.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/SingleplayerServerController.java @@ -12,16 +12,20 @@ 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.EaglercraftSoundManager; 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.socket.EaglercraftNetworkManager; 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.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.nbt.NBTTagCompound; import net.minecraft.util.IProgressUpdate; import net.minecraft.util.StringTranslate; @@ -528,9 +532,10 @@ public class SingleplayerServerController implements ISaveFormat { } @Override - public void renameWorld(String var1, String var2) { + public boolean renameWorld(String var1, String var2) { sendIPCPacket(new IPCPacket06RenameWorldNBT(var1, var2, false)); statusState = IntegratedServerState.WORLD_RENAMING; + return true; } public static void duplicateWorld(String var1, String var2) { @@ -583,4 +588,9 @@ public class SingleplayerServerController implements ISaveFormat { public static void configureLAN(net.minecraft.world.WorldSettings.GameType enumGameType, boolean allowCommands) { sendIPCPacket(new IPCPacket17ConfigureLAN(enumGameType.getID(), allowCommands, LANServerController.currentICEServers)); } + + public static boolean isClientInEaglerSingleplayerOrLAN() { + Minecraft mc = Minecraft.getMinecraft(); + return mc != null && mc.thePlayer != null && mc.thePlayer.sendQueue.isClientInEaglerSingleplayerOrLAN(); + } } 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 index 4c762ac3..48ab887d 100755 --- 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 @@ -1,9 +1,9 @@ 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.ChatComponentTranslation; /** * Copyright (c) 2024 lax1dude. All Rights Reserved. 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 deleted file mode 100755 index 060a77b2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/CrashReportHelper.java +++ /dev/null @@ -1,71 +0,0 @@ -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 index 9cdb8089..b376ac4a 100755 --- 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 @@ -7,11 +7,11 @@ import java.io.OutputStream; 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.world.ChunkCoordIntPair; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.storage.AnvilChunkLoader; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; 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 index e08fe784..76760169 100755 --- 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 @@ -18,15 +18,15 @@ 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.minecraft.network.EnumConnectionState; +import net.minecraft.server.network.NetHandlerLoginServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ReportedException; +import net.minecraft.util.StringTranslate; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldSettings.GameType; +import 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; @@ -341,7 +341,7 @@ public class EaglerIntegratedServerWorker { IPCPacket14StringList pkt = (IPCPacket14StringList)ipc; switch(pkt.opCode) { case IPCPacket14StringList.LOCALE: - StringTranslate.init(pkt.stringList); + StringTranslate.initServer(pkt.stringList); break; //case IPCPacket14StringList.STAT_GUID: // AchievementMap.init(pkt.stringList); 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 index ee6f447f..9f8aad91 100755 --- 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 @@ -8,14 +8,14 @@ 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.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Bootstrap; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldSettings.GameType; import net.lax1dude.eaglercraft.v1_8.sp.server.skins.IntegratedSkinService; /** 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 index c82de973..5dad6d0d 100755 --- 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 @@ -1,8 +1,8 @@ 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.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.ServerConfigurationManager; import net.minecraft.nbt.NBTTagCompound; /** 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 index cf8e595c..4f7afa80 100755 --- 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 @@ -8,10 +8,10 @@ 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; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.SaveFormatComparator; +import net.minecraft.world.storage.SaveFormatOld; +import net.minecraft.world.storage.WorldInfo; /** * Copyright (c) 2023-2024 lax1dude. All Rights Reserved. @@ -62,7 +62,7 @@ public class EaglerSaveFormat extends SaveFormatOld { arraylist.add(new SaveFormatComparator(s, s1, worldinfo.getLastTimePlayed(), 0l, worldinfo.getGameType(), flag, worldinfo.isHardcoreModeEnabled(), - worldinfo.areCommandsAllowed())); + worldinfo.areCommandsAllowed(), null)); } } } 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 index ba1945f6..55dfc9fc 100755 --- 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 @@ -1,10 +1,10 @@ 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.world.WorldProvider; +import net.minecraft.world.chunk.storage.IChunkLoader; +import net.minecraft.world.storage.SaveHandler; +import net.minecraft.world.storage.WorldInfo; import net.minecraft.nbt.NBTTagCompound; /** 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 deleted file mode 100755 index 974ca0ae..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/ContextUtil.java +++ /dev/null @@ -1,47 +0,0 @@ -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 deleted file mode 100755 index e1bb97e8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/EaglerServerBootstrap.java +++ /dev/null @@ -1,41 +0,0 @@ -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 deleted file mode 100755 index 3406af05..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/IllegalContextAccessException.java +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100755 index cf0b075d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/Block.java +++ /dev/null @@ -1,1796 +0,0 @@ -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 deleted file mode 100755 index a2ff70b4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockAir.java +++ /dev/null @@ -1,79 +0,0 @@ -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 deleted file mode 100755 index 50884898..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockAnvil.java +++ /dev/null @@ -1,200 +0,0 @@ -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 deleted file mode 100755 index b1a91be7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBanner.java +++ /dev/null @@ -1,244 +0,0 @@ -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 deleted file mode 100755 index 1e248865..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBarrier.java +++ /dev/null @@ -1,74 +0,0 @@ -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 deleted file mode 100755 index 8ce41afb..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBasePressurePlate.java +++ /dev/null @@ -1,238 +0,0 @@ -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 deleted file mode 100755 index 7c6aee57..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBeacon.java +++ /dev/null @@ -1,152 +0,0 @@ -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 deleted file mode 100755 index bf8377b8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBed.java +++ /dev/null @@ -1,327 +0,0 @@ -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 deleted file mode 100755 index 21ca2b8d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBookshelf.java +++ /dev/null @@ -1,57 +0,0 @@ -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 deleted file mode 100755 index 5d81824c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBreakable.java +++ /dev/null @@ -1,75 +0,0 @@ -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 deleted file mode 100755 index 1d811e1e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBrewingStand.java +++ /dev/null @@ -1,220 +0,0 @@ -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 deleted file mode 100755 index 3af21911..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockBush.java +++ /dev/null @@ -1,114 +0,0 @@ -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 deleted file mode 100755 index b1597e85..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockButton.java +++ /dev/null @@ -1,365 +0,0 @@ -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 deleted file mode 100755 index 05f5473f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockButtonStone.java +++ /dev/null @@ -1,36 +0,0 @@ -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 deleted file mode 100755 index 63281ac2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockButtonWood.java +++ /dev/null @@ -1,36 +0,0 @@ -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 deleted file mode 100755 index 75c00273..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCactus.java +++ /dev/null @@ -1,159 +0,0 @@ -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 deleted file mode 100755 index e81bc9d5..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCake.java +++ /dev/null @@ -1,188 +0,0 @@ -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 deleted file mode 100755 index c938976e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCarpet.java +++ /dev/null @@ -1,180 +0,0 @@ -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 deleted file mode 100755 index 3ebb6d74..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCarrot.java +++ /dev/null @@ -1,42 +0,0 @@ -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 deleted file mode 100755 index 1d2bbc33..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCauldron.java +++ /dev/null @@ -1,260 +0,0 @@ -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 deleted file mode 100755 index 951a5c97..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockChest.java +++ /dev/null @@ -1,504 +0,0 @@ -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 deleted file mode 100755 index 1dab2f6f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockClay.java +++ /dev/null @@ -1,57 +0,0 @@ -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 deleted file mode 100755 index 092f2ea5..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCocoa.java +++ /dev/null @@ -1,237 +0,0 @@ -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 deleted file mode 100755 index 13c6fbdd..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockColored.java +++ /dev/null @@ -1,98 +0,0 @@ -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 deleted file mode 100755 index d7c7279b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCommandBlock.java +++ /dev/null @@ -1,181 +0,0 @@ -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 deleted file mode 100755 index fc6e8720..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCompressedPowered.java +++ /dev/null @@ -1,54 +0,0 @@ -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 deleted file mode 100755 index fcd47190..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockContainer.java +++ /dev/null @@ -1,83 +0,0 @@ -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 deleted file mode 100755 index 8e24312e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockCrops.java +++ /dev/null @@ -1,213 +0,0 @@ -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 deleted file mode 100755 index b8f57675..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDaylightDetector.java +++ /dev/null @@ -1,192 +0,0 @@ -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 deleted file mode 100755 index 7700b07e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDeadBush.java +++ /dev/null @@ -1,94 +0,0 @@ -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 deleted file mode 100755 index a023b102..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDirectional.java +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100755 index 01bd023e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDirt.java +++ /dev/null @@ -1,189 +0,0 @@ -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 deleted file mode 100755 index 8cc19aa4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDispenser.java +++ /dev/null @@ -1,286 +0,0 @@ -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 deleted file mode 100755 index 9597919b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoor.java +++ /dev/null @@ -1,423 +0,0 @@ -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 deleted file mode 100755 index b2171740..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoublePlant.java +++ /dev/null @@ -1,392 +0,0 @@ -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 deleted file mode 100755 index f5be18f5..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoubleStoneSlab.java +++ /dev/null @@ -1,36 +0,0 @@ -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 deleted file mode 100755 index 8479c6e8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoubleStoneSlabNew.java +++ /dev/null @@ -1,36 +0,0 @@ -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 deleted file mode 100755 index d8b06917..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDoubleWoodSlab.java +++ /dev/null @@ -1,36 +0,0 @@ -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 deleted file mode 100755 index 660a3fce..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDragonEgg.java +++ /dev/null @@ -1,142 +0,0 @@ -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 deleted file mode 100755 index 04a42374..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDropper.java +++ /dev/null @@ -1,97 +0,0 @@ -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 deleted file mode 100755 index f197ef70..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockDynamicLiquid.java +++ /dev/null @@ -1,262 +0,0 @@ -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 deleted file mode 100755 index e268d831..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEnchantmentTable.java +++ /dev/null @@ -1,140 +0,0 @@ -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 deleted file mode 100755 index 69c4b202..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEndPortal.java +++ /dev/null @@ -1,127 +0,0 @@ -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 deleted file mode 100755 index cafe9858..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEndPortalFrame.java +++ /dev/null @@ -1,138 +0,0 @@ -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 deleted file mode 100755 index 97cb7759..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEnderChest.java +++ /dev/null @@ -1,182 +0,0 @@ -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 deleted file mode 100755 index 4937c870..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockEventData.java +++ /dev/null @@ -1,79 +0,0 @@ -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 deleted file mode 100755 index 99082ad9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFalling.java +++ /dev/null @@ -1,113 +0,0 @@ -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 deleted file mode 100755 index d00f1772..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFarmland.java +++ /dev/null @@ -1,181 +0,0 @@ -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 deleted file mode 100755 index 0f30de31..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFence.java +++ /dev/null @@ -1,219 +0,0 @@ -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 deleted file mode 100755 index 1442e074..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFenceGate.java +++ /dev/null @@ -1,214 +0,0 @@ -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 deleted file mode 100755 index 827af30a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFire.java +++ /dev/null @@ -1,463 +0,0 @@ -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 deleted file mode 100755 index 0ae1e14a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFlower.java +++ /dev/null @@ -1,209 +0,0 @@ -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 deleted file mode 100755 index 9b1c9eb7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFlowerPot.java +++ /dev/null @@ -1,424 +0,0 @@ -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 deleted file mode 100755 index 6d648f0c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockFurnace.java +++ /dev/null @@ -1,258 +0,0 @@ -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 deleted file mode 100755 index 33c9f4fa..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockGlass.java +++ /dev/null @@ -1,60 +0,0 @@ -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 deleted file mode 100755 index c655d2f4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockGlowstone.java +++ /dev/null @@ -1,73 +0,0 @@ -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 deleted file mode 100755 index 0252ee53..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockGrass.java +++ /dev/null @@ -1,182 +0,0 @@ -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 deleted file mode 100755 index 49309c3b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockGravel.java +++ /dev/null @@ -1,55 +0,0 @@ -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 deleted file mode 100755 index 7b5a2750..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHalfStoneSlab.java +++ /dev/null @@ -1,36 +0,0 @@ -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 deleted file mode 100755 index 694a0cdd..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHalfStoneSlabNew.java +++ /dev/null @@ -1,36 +0,0 @@ -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 deleted file mode 100755 index 51022ea9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHalfWoodSlab.java +++ /dev/null @@ -1,36 +0,0 @@ -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 deleted file mode 100755 index afd2cf2a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHardenedClay.java +++ /dev/null @@ -1,48 +0,0 @@ -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 deleted file mode 100755 index 06adeb91..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHay.java +++ /dev/null @@ -1,98 +0,0 @@ -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 deleted file mode 100755 index aacea733..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHopper.java +++ /dev/null @@ -1,251 +0,0 @@ -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 deleted file mode 100755 index 02214234..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockHugeMushroom.java +++ /dev/null @@ -1,164 +0,0 @@ -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 deleted file mode 100755 index 889e9452..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockIce.java +++ /dev/null @@ -1,105 +0,0 @@ -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 deleted file mode 100755 index 55e272b0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockJukebox.java +++ /dev/null @@ -1,197 +0,0 @@ -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 deleted file mode 100755 index 2b925d90..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLadder.java +++ /dev/null @@ -1,167 +0,0 @@ -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 deleted file mode 100755 index 14126280..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLeaves.java +++ /dev/null @@ -1,278 +0,0 @@ -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 deleted file mode 100755 index 0e7e132f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLeavesBase.java +++ /dev/null @@ -1,56 +0,0 @@ -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 deleted file mode 100755 index 0547cc90..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLever.java +++ /dev/null @@ -1,345 +0,0 @@ -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 deleted file mode 100755 index 46090de3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLilyPad.java +++ /dev/null @@ -1,106 +0,0 @@ -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 deleted file mode 100755 index a9d1beeb..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLiquid.java +++ /dev/null @@ -1,382 +0,0 @@ -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 deleted file mode 100755 index f421924b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockLog.java +++ /dev/null @@ -1,112 +0,0 @@ -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 deleted file mode 100755 index ecb9f34c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockMelon.java +++ /dev/null @@ -1,65 +0,0 @@ -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 deleted file mode 100755 index d70988a2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockMobSpawner.java +++ /dev/null @@ -1,100 +0,0 @@ -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 deleted file mode 100755 index c90ba373..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockMushroom.java +++ /dev/null @@ -1,135 +0,0 @@ -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 deleted file mode 100755 index 0511e9af..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockMycelium.java +++ /dev/null @@ -1,119 +0,0 @@ -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 deleted file mode 100755 index f42bb228..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNetherBrick.java +++ /dev/null @@ -1,48 +0,0 @@ -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 deleted file mode 100755 index db00492e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNetherWart.java +++ /dev/null @@ -1,134 +0,0 @@ -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 deleted file mode 100755 index 3f51bec5..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNetherrack.java +++ /dev/null @@ -1,48 +0,0 @@ -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 deleted file mode 100755 index 9356baa0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNewLeaf.java +++ /dev/null @@ -1,145 +0,0 @@ -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 deleted file mode 100755 index 9eacb763..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNewLog.java +++ /dev/null @@ -1,151 +0,0 @@ -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 deleted file mode 100755 index c823a22c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockNote.java +++ /dev/null @@ -1,135 +0,0 @@ -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 deleted file mode 100755 index 820a2f48..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockObsidian.java +++ /dev/null @@ -1,58 +0,0 @@ -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 deleted file mode 100755 index d01f2da2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockOldLeaf.java +++ /dev/null @@ -1,177 +0,0 @@ -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 deleted file mode 100755 index b51aaa98..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockOldLog.java +++ /dev/null @@ -1,157 +0,0 @@ -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 deleted file mode 100755 index 81f9c5c9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockOre.java +++ /dev/null @@ -1,126 +0,0 @@ -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 deleted file mode 100755 index 7b7e3a0b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPackedIce.java +++ /dev/null @@ -1,48 +0,0 @@ -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 deleted file mode 100755 index 8fb597f2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPane.java +++ /dev/null @@ -1,211 +0,0 @@ -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 deleted file mode 100755 index 4a2ed80e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPistonBase.java +++ /dev/null @@ -1,445 +0,0 @@ -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 deleted file mode 100755 index 6e0a64c3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPistonExtension.java +++ /dev/null @@ -1,273 +0,0 @@ -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 deleted file mode 100755 index dfa79cb2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPistonMoving.java +++ /dev/null @@ -1,290 +0,0 @@ -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 deleted file mode 100755 index 94fd7b3b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPlanks.java +++ /dev/null @@ -1,159 +0,0 @@ -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 deleted file mode 100755 index aa6fa04d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPortal.java +++ /dev/null @@ -1,439 +0,0 @@ -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 deleted file mode 100755 index ac10589f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPotato.java +++ /dev/null @@ -1,58 +0,0 @@ -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 deleted file mode 100755 index 3aa26a64..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPressurePlate.java +++ /dev/null @@ -1,107 +0,0 @@ -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 deleted file mode 100755 index e31cdc3e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPressurePlateWeighted.java +++ /dev/null @@ -1,99 +0,0 @@ -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 deleted file mode 100755 index 89c63efb..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPrismarine.java +++ /dev/null @@ -1,160 +0,0 @@ -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 deleted file mode 100755 index 0dcb9cfb..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockPumpkin.java +++ /dev/null @@ -1,207 +0,0 @@ -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 deleted file mode 100755 index 8269f51e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockQuartz.java +++ /dev/null @@ -1,180 +0,0 @@ -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 deleted file mode 100755 index 40cad23b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRail.java +++ /dev/null @@ -1,81 +0,0 @@ -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 deleted file mode 100755 index f646d75e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRailBase.java +++ /dev/null @@ -1,571 +0,0 @@ -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 deleted file mode 100755 index 8f92c370..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRailDetector.java +++ /dev/null @@ -1,218 +0,0 @@ -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 deleted file mode 100755 index 7008adda..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRailPowered.java +++ /dev/null @@ -1,209 +0,0 @@ -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 deleted file mode 100755 index bbd67875..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedFlower.java +++ /dev/null @@ -1,39 +0,0 @@ -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 deleted file mode 100755 index d7bb07aa..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedSandstone.java +++ /dev/null @@ -1,141 +0,0 @@ -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 deleted file mode 100755 index d00fbcad..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneComparator.java +++ /dev/null @@ -1,330 +0,0 @@ -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 deleted file mode 100755 index 83e94ec9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneDiode.java +++ /dev/null @@ -1,289 +0,0 @@ -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 deleted file mode 100755 index 8f99bd5b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneLight.java +++ /dev/null @@ -1,97 +0,0 @@ -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 deleted file mode 100755 index f2198a6a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneOre.java +++ /dev/null @@ -1,182 +0,0 @@ -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 deleted file mode 100755 index c8bbf92d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneRepeater.java +++ /dev/null @@ -1,169 +0,0 @@ -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 deleted file mode 100755 index 6ed7090f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneTorch.java +++ /dev/null @@ -1,225 +0,0 @@ -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 deleted file mode 100755 index 1b706b3d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRedstoneWire.java +++ /dev/null @@ -1,468 +0,0 @@ -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 deleted file mode 100755 index 5b330366..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockReed.java +++ /dev/null @@ -1,172 +0,0 @@ -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 deleted file mode 100755 index f5a525d1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockRotatedPillar.java +++ /dev/null @@ -1,47 +0,0 @@ -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 deleted file mode 100755 index 00be318f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSand.java +++ /dev/null @@ -1,153 +0,0 @@ -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 deleted file mode 100755 index ef03e819..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSandStone.java +++ /dev/null @@ -1,148 +0,0 @@ -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 deleted file mode 100755 index 7843fc0a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSapling.java +++ /dev/null @@ -1,269 +0,0 @@ -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 deleted file mode 100755 index d53e6071..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSeaLantern.java +++ /dev/null @@ -1,77 +0,0 @@ -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 deleted file mode 100755 index 50b04415..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSign.java +++ /dev/null @@ -1,113 +0,0 @@ -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 deleted file mode 100755 index 1d134476..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSilverfish.java +++ /dev/null @@ -1,235 +0,0 @@ -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 deleted file mode 100755 index 97bc5309..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSkull.java +++ /dev/null @@ -1,306 +0,0 @@ -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 deleted file mode 100755 index 5fef7caf..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSlab.java +++ /dev/null @@ -1,214 +0,0 @@ -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 deleted file mode 100755 index 35cc6e27..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSlime.java +++ /dev/null @@ -1,88 +0,0 @@ -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 deleted file mode 100755 index 05cac07c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSnow.java +++ /dev/null @@ -1,189 +0,0 @@ -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 deleted file mode 100755 index 6a6e61e5..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSnowBlock.java +++ /dev/null @@ -1,69 +0,0 @@ -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 deleted file mode 100755 index fcfd4809..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSoulSand.java +++ /dev/null @@ -1,60 +0,0 @@ -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 deleted file mode 100755 index d8a10650..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSourceImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -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 deleted file mode 100755 index 6df8b3dd..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockSponge.java +++ /dev/null @@ -1,196 +0,0 @@ -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 deleted file mode 100755 index b81f1c85..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStainedGlass.java +++ /dev/null @@ -1,130 +0,0 @@ -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 deleted file mode 100755 index 02984e67..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStainedGlassPane.java +++ /dev/null @@ -1,116 +0,0 @@ -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 deleted file mode 100755 index da17f3db..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStairs.java +++ /dev/null @@ -1,713 +0,0 @@ -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 deleted file mode 100755 index cdc49e74..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStandingSign.java +++ /dev/null @@ -1,75 +0,0 @@ -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 deleted file mode 100755 index 8be6622a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStaticLiquid.java +++ /dev/null @@ -1,112 +0,0 @@ -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 deleted file mode 100755 index ce4063ed..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStem.java +++ /dev/null @@ -1,230 +0,0 @@ -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 deleted file mode 100755 index 5e082993..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStone.java +++ /dev/null @@ -1,182 +0,0 @@ -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 deleted file mode 100755 index 11054e8c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStoneBrick.java +++ /dev/null @@ -1,144 +0,0 @@ -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 deleted file mode 100755 index d09555a9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStoneSlab.java +++ /dev/null @@ -1,227 +0,0 @@ -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 deleted file mode 100755 index f9613d4a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockStoneSlabNew.java +++ /dev/null @@ -1,225 +0,0 @@ -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 deleted file mode 100755 index 599e81af..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTNT.java +++ /dev/null @@ -1,171 +0,0 @@ -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 deleted file mode 100755 index cb8ab714..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTallGrass.java +++ /dev/null @@ -1,230 +0,0 @@ -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 deleted file mode 100755 index 737d13dd..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTorch.java +++ /dev/null @@ -1,278 +0,0 @@ -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 deleted file mode 100755 index 9b17030f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTrapDoor.java +++ /dev/null @@ -1,296 +0,0 @@ -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 deleted file mode 100755 index 9b2f3d0b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTripWire.java +++ /dev/null @@ -1,294 +0,0 @@ -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 deleted file mode 100755 index d2efcd84..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockTripWireHook.java +++ /dev/null @@ -1,352 +0,0 @@ -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 deleted file mode 100755 index 115c742f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockVine.java +++ /dev/null @@ -1,477 +0,0 @@ -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 deleted file mode 100755 index d1349c46..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWall.java +++ /dev/null @@ -1,255 +0,0 @@ -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 deleted file mode 100755 index 55fcad83..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWallSign.java +++ /dev/null @@ -1,107 +0,0 @@ -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 deleted file mode 100755 index d12dfddf..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWeb.java +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100755 index a69a8c1b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWoodSlab.java +++ /dev/null @@ -1,151 +0,0 @@ -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 deleted file mode 100755 index 92bdbb9c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockWorkbench.java +++ /dev/null @@ -1,91 +0,0 @@ -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 deleted file mode 100755 index 996fb799..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/BlockYellowFlower.java +++ /dev/null @@ -1,39 +0,0 @@ -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 deleted file mode 100755 index e0bec531..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/IGrowable.java +++ /dev/null @@ -1,37 +0,0 @@ -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 deleted file mode 100755 index 947b7d50..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/ITileEntityProvider.java +++ /dev/null @@ -1,32 +0,0 @@ -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 deleted file mode 100755 index 869ac5a7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MapColor.java +++ /dev/null @@ -1,108 +0,0 @@ -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 deleted file mode 100755 index 03a46ea2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/Material.java +++ /dev/null @@ -1,239 +0,0 @@ -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 deleted file mode 100755 index 40867455..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MaterialLiquid.java +++ /dev/null @@ -1,61 +0,0 @@ -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 deleted file mode 100755 index 84c16cb1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MaterialLogic.java +++ /dev/null @@ -1,61 +0,0 @@ -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 deleted file mode 100755 index 5b12becf..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MaterialPortal.java +++ /dev/null @@ -1,60 +0,0 @@ -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 deleted file mode 100755 index 22e0d118..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/material/MaterialTransparent.java +++ /dev/null @@ -1,61 +0,0 @@ -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 deleted file mode 100755 index f1f6ec6b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/IProperty.java +++ /dev/null @@ -1,42 +0,0 @@ -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 deleted file mode 100755 index 6ec24883..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyBool.java +++ /dev/null @@ -1,55 +0,0 @@ -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 deleted file mode 100755 index 20db36d4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyDirection.java +++ /dev/null @@ -1,69 +0,0 @@ -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 deleted file mode 100755 index ccfdef95..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyEnum.java +++ /dev/null @@ -1,101 +0,0 @@ -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 deleted file mode 100755 index 8c12ab76..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyHelper.java +++ /dev/null @@ -1,72 +0,0 @@ -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 deleted file mode 100755 index f8a3797b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/properties/PropertyInteger.java +++ /dev/null @@ -1,91 +0,0 @@ -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 deleted file mode 100755 index e9683857..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/BlockPistonStructureHelper.java +++ /dev/null @@ -1,218 +0,0 @@ -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 deleted file mode 100755 index ffb10cc8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/BlockState.java +++ /dev/null @@ -1,202 +0,0 @@ -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 deleted file mode 100755 index 9be2448a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/BlockStateBase.java +++ /dev/null @@ -1,86 +0,0 @@ -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()); - } - } - }; - - 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 deleted file mode 100755 index 7eea4449..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/BlockWorldState.java +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100755 index 723c1eff..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/IBlockState.java +++ /dev/null @@ -1,43 +0,0 @@ -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 deleted file mode 100755 index 2f7e1a1a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/pattern/BlockHelper.java +++ /dev/null @@ -1,48 +0,0 @@ -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 deleted file mode 100755 index 5bc4819d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/pattern/BlockPattern.java +++ /dev/null @@ -1,213 +0,0 @@ -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 deleted file mode 100755 index 89f65367..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/pattern/BlockStateHelper.java +++ /dev/null @@ -1,74 +0,0 @@ -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 deleted file mode 100755 index 08b1d4e2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/block/state/pattern/FactoryBlockPattern.java +++ /dev/null @@ -1,129 +0,0 @@ -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/CommandException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandException.java deleted file mode 100755 index 3ee09e33..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandException.java +++ /dev/null @@ -1,41 +0,0 @@ -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/EntityNotFoundException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/EntityNotFoundException.java deleted file mode 100755 index 851482e4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/EntityNotFoundException.java +++ /dev/null @@ -1,40 +0,0 @@ -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/ICommandSender.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommandSender.java deleted file mode 100755 index 5ac03e2a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommandSender.java +++ /dev/null @@ -1,88 +0,0 @@ -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/PlayerNotFoundException.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/PlayerNotFoundException.java deleted file mode 100755 index 98f782c9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/PlayerNotFoundException.java +++ /dev/null @@ -1,40 +0,0 @@ -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 deleted file mode 100755 index ff035e5b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/PlayerSelector.java +++ /dev/null @@ -1,619 +0,0 @@ -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/server/CommandBlockLogic.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandBlockLogic.java deleted file mode 100755 index 52dd0ae6..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandBlockLogic.java +++ /dev/null @@ -1,247 +0,0 @@ -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/creativetab/CreativeTabs.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/creativetab/CreativeTabs.java deleted file mode 100755 index 3e316eee..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/creativetab/CreativeTabs.java +++ /dev/null @@ -1,269 +0,0 @@ -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 deleted file mode 100755 index c39124f6..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java +++ /dev/null @@ -1,101 +0,0 @@ -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 deleted file mode 100755 index f839db5e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/BehaviorProjectileDispense.java +++ /dev/null @@ -1,74 +0,0 @@ -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 deleted file mode 100755 index 02876f90..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/IBehaviorDispenseItem.java +++ /dev/null @@ -1,40 +0,0 @@ -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 deleted file mode 100755 index 6c1fe64b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/IBlockSource.java +++ /dev/null @@ -1,39 +0,0 @@ -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 deleted file mode 100755 index d4ebe420..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/ILocatableSource.java +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100755 index 431b379e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/ILocation.java +++ /dev/null @@ -1,28 +0,0 @@ -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 deleted file mode 100755 index 85be66fc..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/IPosition.java +++ /dev/null @@ -1,29 +0,0 @@ -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 deleted file mode 100755 index 3c06004e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/dispenser/PositionImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -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 deleted file mode 100755 index 172b983b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/Enchantment.java +++ /dev/null @@ -1,306 +0,0 @@ -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 deleted file mode 100755 index 6c24c2ec..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentArrowDamage.java +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100755 index 8d29dbe9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentArrowFire.java +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100755 index c6acd294..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentArrowInfinite.java +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100755 index 407dd999..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentArrowKnockback.java +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100755 index 459c7823..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentDamage.java +++ /dev/null @@ -1,143 +0,0 @@ -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 deleted file mode 100755 index 7550ec03..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentData.java +++ /dev/null @@ -1,42 +0,0 @@ -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 deleted file mode 100755 index 6efc45db..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentDigging.java +++ /dev/null @@ -1,72 +0,0 @@ -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 deleted file mode 100755 index c85d5000..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentDurability.java +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100755 index 744c47bf..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentFireAspect.java +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100755 index edc1a1bd..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentFishingSpeed.java +++ /dev/null @@ -1,63 +0,0 @@ -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 deleted file mode 100755 index 98809a54..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentHelper.java +++ /dev/null @@ -1,557 +0,0 @@ -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 deleted file mode 100755 index e22c30d5..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentKnockback.java +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100755 index 46642f58..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentLootBonus.java +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100755 index ee075f7f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentOxygen.java +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100755 index e39e8514..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentProtection.java +++ /dev/null @@ -1,157 +0,0 @@ -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 deleted file mode 100755 index 3b8e7db3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentThorns.java +++ /dev/null @@ -1,108 +0,0 @@ -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 deleted file mode 100755 index 74e582a3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentUntouching.java +++ /dev/null @@ -1,80 +0,0 @@ -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 deleted file mode 100755 index 8306f0ae..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentWaterWalker.java +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100755 index de7cccce..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnchantmentWaterWorker.java +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100755 index f1d34f42..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/enchantment/EnumEnchantmentType.java +++ /dev/null @@ -1,65 +0,0 @@ -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 deleted file mode 100755 index b7cfd6c2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/DataWatcher.java +++ /dev/null @@ -1,413 +0,0 @@ -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 deleted file mode 100755 index d46b665f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/Entity.java +++ /dev/null @@ -1,2378 +0,0 @@ -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 deleted file mode 100755 index a5530865..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityAgeable.java +++ /dev/null @@ -1,232 +0,0 @@ -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 deleted file mode 100755 index 2c03ec98..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityBodyHelper.java +++ /dev/null @@ -1,89 +0,0 @@ -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 deleted file mode 100755 index bc79bb4c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityConstructor.java +++ /dev/null @@ -1,24 +0,0 @@ -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 deleted file mode 100755 index f2cf4741..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityCreature.java +++ /dev/null @@ -1,173 +0,0 @@ -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 deleted file mode 100755 index 36ac772d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityFlying.java +++ /dev/null @@ -1,105 +0,0 @@ -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 deleted file mode 100755 index 6e7dfcb1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityHanging.java +++ /dev/null @@ -1,285 +0,0 @@ -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 deleted file mode 100755 index f5926d42..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityLeashKnot.java +++ /dev/null @@ -1,186 +0,0 @@ -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 deleted file mode 100755 index 09a7218f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityList.java +++ /dev/null @@ -1,412 +0,0 @@ -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 deleted file mode 100755 index 1fe63f3c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityLiving.java +++ /dev/null @@ -1,1078 +0,0 @@ -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 deleted file mode 100755 index f28b1589..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityLivingBase.java +++ /dev/null @@ -1,1890 +0,0 @@ -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 deleted file mode 100755 index fa803f3a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityMinecartCommandBlock.java +++ /dev/null @@ -1,163 +0,0 @@ -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 deleted file mode 100755 index ec43efc0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntitySpawnPlacementRegistry.java +++ /dev/null @@ -1,107 +0,0 @@ -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/EnumCreatureAttribute.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EnumCreatureAttribute.java deleted file mode 100755 index 244d78fd..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EnumCreatureAttribute.java +++ /dev/null @@ -1,32 +0,0 @@ -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 deleted file mode 100755 index a25b8a71..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EnumCreatureType.java +++ /dev/null @@ -1,77 +0,0 @@ -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 deleted file mode 100755 index 2f105ba1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IEntityLivingData.java +++ /dev/null @@ -1,24 +0,0 @@ -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 deleted file mode 100755 index 5ae0eb0b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IEntityMultiPart.java +++ /dev/null @@ -1,31 +0,0 @@ -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 deleted file mode 100755 index 8dd6fe4b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IEntityOwnable.java +++ /dev/null @@ -1,29 +0,0 @@ -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 deleted file mode 100755 index 59660a27..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IMerchant.java +++ /dev/null @@ -1,52 +0,0 @@ -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 deleted file mode 100755 index a26c7831..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/INpc.java +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100755 index 4775283b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IProjectile.java +++ /dev/null @@ -1,29 +0,0 @@ -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 deleted file mode 100755 index 8094ad7c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/IRangedAttackMob.java +++ /dev/null @@ -1,30 +0,0 @@ -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 deleted file mode 100755 index e2815b06..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/NpcMerchant.java +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100755 index 50a0ef5e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/SharedMonsterAttributes.java +++ /dev/null @@ -1,157 +0,0 @@ -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/EntityMinecartMobSpawner.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityMinecartMobSpawner.java deleted file mode 100755 index 10de4144..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityMinecartMobSpawner.java +++ /dev/null @@ -1,105 +0,0 @@ -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/attributes/AttributeModifier.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/AttributeModifier.java deleted file mode 100755 index 3e3812dd..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/AttributeModifier.java +++ /dev/null @@ -1,114 +0,0 @@ -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 deleted file mode 100755 index 4308539e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/BaseAttribute.java +++ /dev/null @@ -1,76 +0,0 @@ -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 deleted file mode 100755 index 9a04a830..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/BaseAttributeMap.java +++ /dev/null @@ -1,105 +0,0 @@ -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 deleted file mode 100755 index f7a6d2bf..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/IAttribute.java +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100755 index f975e3e3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/IAttributeInstance.java +++ /dev/null @@ -1,56 +0,0 @@ -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 deleted file mode 100755 index 3a3f54ff..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java +++ /dev/null @@ -1,198 +0,0 @@ -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 deleted file mode 100755 index 63306a8e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/RangedAttribute.java +++ /dev/null @@ -1,66 +0,0 @@ -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 deleted file mode 100755 index dd5e3116..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java +++ /dev/null @@ -1,106 +0,0 @@ -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 deleted file mode 100755 index c50ce86c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/BossStatus.java +++ /dev/null @@ -1,44 +0,0 @@ -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 deleted file mode 100755 index 3c85781f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/EntityDragon.java +++ /dev/null @@ -1,698 +0,0 @@ -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 deleted file mode 100755 index e71816ce..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/EntityDragonPart.java +++ /dev/null @@ -1,85 +0,0 @@ -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 deleted file mode 100755 index 0eafb297..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/EntityWither.java +++ /dev/null @@ -1,600 +0,0 @@ -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 deleted file mode 100755 index cf7e3b5d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/boss/IBossDisplayData.java +++ /dev/null @@ -1,35 +0,0 @@ -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 deleted file mode 100755 index 70495447..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/effect/EntityLightningBolt.java +++ /dev/null @@ -1,133 +0,0 @@ -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 deleted file mode 100755 index a7f5d2f5..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/effect/EntityWeatherEffect.java +++ /dev/null @@ -1,37 +0,0 @@ -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 deleted file mode 100755 index 5c3b9dba..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityArmorStand.java +++ /dev/null @@ -1,796 +0,0 @@ -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 deleted file mode 100755 index 6bfc91df..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityBoat.java +++ /dev/null @@ -1,520 +0,0 @@ -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 deleted file mode 100755 index 82644530..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityEnderCrystal.java +++ /dev/null @@ -1,128 +0,0 @@ -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 deleted file mode 100755 index 460a9dc2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityEnderEye.java +++ /dev/null @@ -1,232 +0,0 @@ -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 deleted file mode 100755 index 197c42ea..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityEnderPearl.java +++ /dev/null @@ -1,118 +0,0 @@ -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 deleted file mode 100755 index e02c3bb1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityExpBottle.java +++ /dev/null @@ -1,83 +0,0 @@ -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 deleted file mode 100755 index f0be37d5..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityFallingBlock.java +++ /dev/null @@ -1,293 +0,0 @@ -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 deleted file mode 100755 index a3185b6d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityFireworkRocket.java +++ /dev/null @@ -1,191 +0,0 @@ -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 deleted file mode 100755 index eb7ede3a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityItem.java +++ /dev/null @@ -1,466 +0,0 @@ -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 deleted file mode 100755 index 999e63ae..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityItemFrame.java +++ /dev/null @@ -1,252 +0,0 @@ -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 deleted file mode 100755 index fb911db4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecart.java +++ /dev/null @@ -1,1006 +0,0 @@ -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 deleted file mode 100755 index f1ba1c26..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartChest.java +++ /dev/null @@ -1,87 +0,0 @@ -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 deleted file mode 100755 index 6a536ac1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartContainer.java +++ /dev/null @@ -1,274 +0,0 @@ -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 deleted file mode 100755 index 6fe22349..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartEmpty.java +++ /dev/null @@ -1,85 +0,0 @@ -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 deleted file mode 100755 index cb682f12..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartFurnace.java +++ /dev/null @@ -1,200 +0,0 @@ -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 deleted file mode 100755 index b87d21b8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartHopper.java +++ /dev/null @@ -1,239 +0,0 @@ -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 deleted file mode 100755 index d3ca2192..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityMinecartTNT.java +++ /dev/null @@ -1,226 +0,0 @@ -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 deleted file mode 100755 index 62136a5c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityPainting.java +++ /dev/null @@ -1,176 +0,0 @@ -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 deleted file mode 100755 index a7ec958d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityTNTPrimed.java +++ /dev/null @@ -1,143 +0,0 @@ -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 deleted file mode 100755 index 6a5a84dd..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/item/EntityXPOrb.java +++ /dev/null @@ -1,284 +0,0 @@ -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 deleted file mode 100755 index 04f91f51..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityBlaze.java +++ /dev/null @@ -1,278 +0,0 @@ -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 deleted file mode 100755 index d9715e5b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityCaveSpider.java +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100755 index 88481ec3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityCreeper.java +++ /dev/null @@ -1,300 +0,0 @@ -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 deleted file mode 100755 index 2e3c127e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityEnderman.java +++ /dev/null @@ -1,556 +0,0 @@ -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 deleted file mode 100755 index 274d5faa..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityEndermite.java +++ /dev/null @@ -1,198 +0,0 @@ -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 deleted file mode 100755 index 5d76294b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityGhast.java +++ /dev/null @@ -1,378 +0,0 @@ -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 deleted file mode 100755 index c8911851..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityGiantZombie.java +++ /dev/null @@ -1,55 +0,0 @@ -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 deleted file mode 100755 index b479d99f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityGolem.java +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100755 index 766f002a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityGuardian.java +++ /dev/null @@ -1,589 +0,0 @@ -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 deleted file mode 100755 index 6d1cf6d0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityIronGolem.java +++ /dev/null @@ -1,335 +0,0 @@ -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 deleted file mode 100755 index bced7034..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityMagmaCube.java +++ /dev/null @@ -1,182 +0,0 @@ -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 deleted file mode 100755 index ad852542..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityMob.java +++ /dev/null @@ -1,191 +0,0 @@ -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 deleted file mode 100755 index c63ca04a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityPigZombie.java +++ /dev/null @@ -1,302 +0,0 @@ -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 deleted file mode 100755 index 4f92054e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySilverfish.java +++ /dev/null @@ -1,287 +0,0 @@ -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 deleted file mode 100755 index 75b7e54b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySkeleton.java +++ /dev/null @@ -1,406 +0,0 @@ -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 deleted file mode 100755 index fde5c62c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySlime.java +++ /dev/null @@ -1,551 +0,0 @@ -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 deleted file mode 100755 index ef61c4b8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySnowman.java +++ /dev/null @@ -1,142 +0,0 @@ -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 deleted file mode 100755 index ccfff47d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntitySpider.java +++ /dev/null @@ -1,288 +0,0 @@ -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 deleted file mode 100755 index a3722a66..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityWitch.java +++ /dev/null @@ -1,269 +0,0 @@ -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 deleted file mode 100755 index ade12003..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/EntityZombie.java +++ /dev/null @@ -1,750 +0,0 @@ -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 deleted file mode 100755 index 889aec1b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/monster/IMob.java +++ /dev/null @@ -1,38 +0,0 @@ -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 deleted file mode 100755 index 0af80a55..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityAmbientCreature.java +++ /dev/null @@ -1,51 +0,0 @@ -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 deleted file mode 100755 index 9615530f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityAnimal.java +++ /dev/null @@ -1,251 +0,0 @@ -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 deleted file mode 100755 index e2822d77..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityBat.java +++ /dev/null @@ -1,273 +0,0 @@ -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 deleted file mode 100755 index 15bda073..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityChicken.java +++ /dev/null @@ -1,244 +0,0 @@ -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 deleted file mode 100755 index b1a39b09..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityCow.java +++ /dev/null @@ -1,157 +0,0 @@ -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 deleted file mode 100755 index 67861e56..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityHorse.java +++ /dev/null @@ -1,1556 +0,0 @@ -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 deleted file mode 100755 index bd5e2dd9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityMooshroom.java +++ /dev/null @@ -1,100 +0,0 @@ -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 deleted file mode 100755 index efa516d9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityOcelot.java +++ /dev/null @@ -1,361 +0,0 @@ -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 deleted file mode 100755 index 2272dcf5..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityPig.java +++ /dev/null @@ -1,242 +0,0 @@ -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 deleted file mode 100755 index 7c62f815..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityRabbit.java +++ /dev/null @@ -1,666 +0,0 @@ -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 deleted file mode 100755 index 2e6ade07..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntitySheep.java +++ /dev/null @@ -1,362 +0,0 @@ -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 deleted file mode 100755 index 40dfac9c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntitySquid.java +++ /dev/null @@ -1,262 +0,0 @@ -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 deleted file mode 100755 index a5423ce7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityTameable.java +++ /dev/null @@ -1,226 +0,0 @@ -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 deleted file mode 100755 index 750606b3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityVillager.java +++ /dev/null @@ -1,1060 +0,0 @@ -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 deleted file mode 100755 index 9dfce23c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityWaterMob.java +++ /dev/null @@ -1,106 +0,0 @@ -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 deleted file mode 100755 index caaab4f7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/EntityWolf.java +++ /dev/null @@ -1,568 +0,0 @@ -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 deleted file mode 100755 index f96517e8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/passive/IAnimals.java +++ /dev/null @@ -1,24 +0,0 @@ -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 deleted file mode 100755 index 598ec258..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/EntityPlayer.java +++ /dev/null @@ -1,2085 +0,0 @@ -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/EnumPlayerModelParts.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/EnumPlayerModelParts.java deleted file mode 100755 index c2e1586e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/EnumPlayerModelParts.java +++ /dev/null @@ -1,63 +0,0 @@ -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 deleted file mode 100755 index ece0fda0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/InventoryPlayer.java +++ /dev/null @@ -1,756 +0,0 @@ -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 deleted file mode 100755 index fe71a6da..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/PlayerCapabilities.java +++ /dev/null @@ -1,91 +0,0 @@ -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 deleted file mode 100755 index 06b8d1d3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityArrow.java +++ /dev/null @@ -1,570 +0,0 @@ -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 deleted file mode 100755 index 57450e60..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityEgg.java +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100755 index 5d16a252..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityFireball.java +++ /dev/null @@ -1,335 +0,0 @@ -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 deleted file mode 100755 index fe4e9000..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityFishHook.java +++ /dev/null @@ -1,598 +0,0 @@ -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 deleted file mode 100755 index 2bcc7481..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityLargeFireball.java +++ /dev/null @@ -1,93 +0,0 @@ -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 deleted file mode 100755 index da0adda2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityPotion.java +++ /dev/null @@ -1,178 +0,0 @@ -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 deleted file mode 100755 index 943e09f0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntitySmallFireball.java +++ /dev/null @@ -1,103 +0,0 @@ -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 deleted file mode 100755 index 98518d66..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntitySnowball.java +++ /dev/null @@ -1,72 +0,0 @@ -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 deleted file mode 100755 index 820ea59e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityThrowable.java +++ /dev/null @@ -1,362 +0,0 @@ -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 deleted file mode 100755 index 49a117c8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/projectile/EntityWitherSkull.java +++ /dev/null @@ -1,164 +0,0 @@ -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 deleted file mode 100755 index 75fa0328..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/event/ClickEvent.java +++ /dev/null @@ -1,124 +0,0 @@ -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 deleted file mode 100755 index 65f369cf..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/event/HoverEvent.java +++ /dev/null @@ -1,124 +0,0 @@ -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 deleted file mode 100755 index 80e4dbb8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/init/Blocks.java +++ /dev/null @@ -1,477 +0,0 @@ -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 deleted file mode 100755 index c5f85793..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/init/Bootstrap.java +++ /dev/null @@ -1,493 +0,0 @@ -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 deleted file mode 100755 index 2694a09b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/init/Items.java +++ /dev/null @@ -1,429 +0,0 @@ -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 deleted file mode 100755 index 1308f6e2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/AnimalChest.java +++ /dev/null @@ -1,41 +0,0 @@ -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 deleted file mode 100755 index 403a0c5a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/Container.java +++ /dev/null @@ -1,689 +0,0 @@ -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 deleted file mode 100755 index c8d632f2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerBeacon.java +++ /dev/null @@ -1,154 +0,0 @@ -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 deleted file mode 100755 index be58f886..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerBrewingStand.java +++ /dev/null @@ -1,193 +0,0 @@ -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 deleted file mode 100755 index 2e3fb5b8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerChest.java +++ /dev/null @@ -1,109 +0,0 @@ -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 deleted file mode 100755 index f13df751..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerDispenser.java +++ /dev/null @@ -1,96 +0,0 @@ -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 deleted file mode 100755 index b5344f33..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerEnchantment.java +++ /dev/null @@ -1,374 +0,0 @@ -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 deleted file mode 100755 index c1361c22..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerFurnace.java +++ /dev/null @@ -1,162 +0,0 @@ -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 deleted file mode 100755 index 3e2da9fa..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerHopper.java +++ /dev/null @@ -1,100 +0,0 @@ -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 deleted file mode 100755 index bc1f344c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerHorseInventory.java +++ /dev/null @@ -1,133 +0,0 @@ -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 deleted file mode 100755 index 4656d553..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerMerchant.java +++ /dev/null @@ -1,165 +0,0 @@ -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 deleted file mode 100755 index ed54bd3e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerPlayer.java +++ /dev/null @@ -1,195 +0,0 @@ -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 deleted file mode 100755 index 782d0c0e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerRepair.java +++ /dev/null @@ -1,431 +0,0 @@ -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 deleted file mode 100755 index 5dae5cb7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ContainerWorkbench.java +++ /dev/null @@ -1,158 +0,0 @@ -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 deleted file mode 100755 index b0652582..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ICrafting.java +++ /dev/null @@ -1,52 +0,0 @@ -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 deleted file mode 100755 index 53e32244..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/IInvBasic.java +++ /dev/null @@ -1,31 +0,0 @@ -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 deleted file mode 100755 index 2eaf5eef..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/IInventory.java +++ /dev/null @@ -1,91 +0,0 @@ -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 deleted file mode 100755 index facaad8f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/ISidedInventory.java +++ /dev/null @@ -1,41 +0,0 @@ -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 deleted file mode 100755 index ead19107..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryBasic.java +++ /dev/null @@ -1,261 +0,0 @@ -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 deleted file mode 100755 index 1a1137a0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryCraftResult.java +++ /dev/null @@ -1,172 +0,0 @@ -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 deleted file mode 100755 index 740c6734..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryCrafting.java +++ /dev/null @@ -1,210 +0,0 @@ -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 deleted file mode 100755 index b89a5fdb..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryEnderChest.java +++ /dev/null @@ -1,104 +0,0 @@ -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 deleted file mode 100755 index 70fb1f32..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryHelper.java +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100755 index bf83b966..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryLargeChest.java +++ /dev/null @@ -1,228 +0,0 @@ -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 deleted file mode 100755 index 764b8669..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/InventoryMerchant.java +++ /dev/null @@ -1,263 +0,0 @@ -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 deleted file mode 100755 index 2f01f827..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/Slot.java +++ /dev/null @@ -1,170 +0,0 @@ -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 deleted file mode 100755 index a780d443..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/SlotCrafting.java +++ /dev/null @@ -1,165 +0,0 @@ -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 deleted file mode 100755 index b5a201a2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/SlotFurnaceFuel.java +++ /dev/null @@ -1,56 +0,0 @@ -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 deleted file mode 100755 index 83d95912..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/SlotFurnaceOutput.java +++ /dev/null @@ -1,124 +0,0 @@ -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 deleted file mode 100755 index 9910655d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/inventory/SlotMerchantResult.java +++ /dev/null @@ -1,135 +0,0 @@ -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 deleted file mode 100755 index 6e004c70..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/EnumAction.java +++ /dev/null @@ -1,32 +0,0 @@ -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 deleted file mode 100755 index ab534eba..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/EnumDyeColor.java +++ /dev/null @@ -1,117 +0,0 @@ -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 deleted file mode 100755 index ee4b7cdc..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/EnumRarity.java +++ /dev/null @@ -1,42 +0,0 @@ -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 deleted file mode 100755 index 83c95be5..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/Item.java +++ /dev/null @@ -1,1189 +0,0 @@ -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 deleted file mode 100755 index 3b47d07a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemAnvilBlock.java +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100755 index 3fd8ba3a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemAppleGold.java +++ /dev/null @@ -1,81 +0,0 @@ -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 deleted file mode 100755 index ddae6556..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemArmor.java +++ /dev/null @@ -1,260 +0,0 @@ -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 deleted file mode 100755 index 033556ee..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemArmorStand.java +++ /dev/null @@ -1,120 +0,0 @@ -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 deleted file mode 100755 index 51f26e68..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemAxe.java +++ /dev/null @@ -1,56 +0,0 @@ -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 deleted file mode 100755 index 90bceeb2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBanner.java +++ /dev/null @@ -1,171 +0,0 @@ -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 deleted file mode 100755 index 58a228bf..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBed.java +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100755 index 8f360c66..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBlock.java +++ /dev/null @@ -1,179 +0,0 @@ -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 deleted file mode 100755 index f5345644..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBoat.java +++ /dev/null @@ -1,128 +0,0 @@ -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 deleted file mode 100755 index 6627f896..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBook.java +++ /dev/null @@ -1,48 +0,0 @@ -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 deleted file mode 100755 index 98464512..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBow.java +++ /dev/null @@ -1,147 +0,0 @@ -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 deleted file mode 100755 index e8510159..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBucket.java +++ /dev/null @@ -1,160 +0,0 @@ -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 deleted file mode 100755 index d4cd706e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemBucketMilk.java +++ /dev/null @@ -1,84 +0,0 @@ -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 deleted file mode 100755 index 63eb0ee8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemCarrotOnAStick.java +++ /dev/null @@ -1,83 +0,0 @@ -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 deleted file mode 100755 index f4fea37f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemCloth.java +++ /dev/null @@ -1,59 +0,0 @@ -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 deleted file mode 100755 index e7bc5a5f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemCoal.java +++ /dev/null @@ -1,59 +0,0 @@ -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 deleted file mode 100755 index 07c9aa04..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemColored.java +++ /dev/null @@ -1,81 +0,0 @@ -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 deleted file mode 100755 index 1187fad1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemDoor.java +++ /dev/null @@ -1,99 +0,0 @@ -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 deleted file mode 100755 index 29f49165..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemDoublePlant.java +++ /dev/null @@ -1,50 +0,0 @@ -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 deleted file mode 100755 index c51c7f69..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemDye.java +++ /dev/null @@ -1,184 +0,0 @@ -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 deleted file mode 100755 index 6d6d7341..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEditableBook.java +++ /dev/null @@ -1,155 +0,0 @@ -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 deleted file mode 100755 index ca22655e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEgg.java +++ /dev/null @@ -1,59 +0,0 @@ -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 deleted file mode 100755 index f113b1c8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEmptyMap.java +++ /dev/null @@ -1,70 +0,0 @@ -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 deleted file mode 100755 index 015996a4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEnchantedBook.java +++ /dev/null @@ -1,147 +0,0 @@ -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 deleted file mode 100755 index e60dcdda..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEnderEye.java +++ /dev/null @@ -1,177 +0,0 @@ -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 deleted file mode 100755 index 1657caf2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemEnderPearl.java +++ /dev/null @@ -1,60 +0,0 @@ -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 deleted file mode 100755 index f98bc575..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemExpBottle.java +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100755 index 43924245..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFireball.java +++ /dev/null @@ -1,70 +0,0 @@ -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 deleted file mode 100755 index f97a2dc9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFirework.java +++ /dev/null @@ -1,96 +0,0 @@ -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 deleted file mode 100755 index 1b51ba50..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFireworkCharge.java +++ /dev/null @@ -1,178 +0,0 @@ -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 deleted file mode 100755 index 80ab18c0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFishFood.java +++ /dev/null @@ -1,188 +0,0 @@ -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 deleted file mode 100755 index a6d02722..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFishingRod.java +++ /dev/null @@ -1,94 +0,0 @@ -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 deleted file mode 100755 index 2f206d8c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFlintAndSteel.java +++ /dev/null @@ -1,66 +0,0 @@ -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 deleted file mode 100755 index f13cd4fa..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemFood.java +++ /dev/null @@ -1,148 +0,0 @@ -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 deleted file mode 100755 index 23cb9392..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemGlassBottle.java +++ /dev/null @@ -1,82 +0,0 @@ -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 deleted file mode 100755 index 0f40a8ec..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemHangingEntity.java +++ /dev/null @@ -1,80 +0,0 @@ -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 deleted file mode 100755 index 22e2d59f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemHoe.java +++ /dev/null @@ -1,112 +0,0 @@ -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 deleted file mode 100755 index 4331528a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemLead.java +++ /dev/null @@ -1,87 +0,0 @@ -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 deleted file mode 100755 index 3297f8e1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemLeaves.java +++ /dev/null @@ -1,65 +0,0 @@ -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 deleted file mode 100755 index c3ba7bbf..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemLilyPad.java +++ /dev/null @@ -1,90 +0,0 @@ -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 deleted file mode 100755 index b11eddf9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMap.java +++ /dev/null @@ -1,282 +0,0 @@ -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 deleted file mode 100755 index bbdfd9ce..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMapBase.java +++ /dev/null @@ -1,47 +0,0 @@ -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 deleted file mode 100755 index 6dd1cde1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMinecart.java +++ /dev/null @@ -1,146 +0,0 @@ -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 deleted file mode 100755 index 70cd0f36..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMonsterPlacer.java +++ /dev/null @@ -1,208 +0,0 @@ -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 deleted file mode 100755 index 9a764dfb..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemMultiTexture.java +++ /dev/null @@ -1,77 +0,0 @@ -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 deleted file mode 100755 index a46c8f35..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemNameTag.java +++ /dev/null @@ -1,59 +0,0 @@ -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 deleted file mode 100755 index 76592bf8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemPickaxe.java +++ /dev/null @@ -1,82 +0,0 @@ -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 deleted file mode 100755 index 16f43362..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemPiston.java +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100755 index 223f98ab..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemPotion.java +++ /dev/null @@ -1,356 +0,0 @@ -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 deleted file mode 100755 index bda8723a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemRecord.java +++ /dev/null @@ -1,103 +0,0 @@ -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 deleted file mode 100755 index c140021d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemRedstone.java +++ /dev/null @@ -1,68 +0,0 @@ -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 deleted file mode 100755 index 4ec149cf..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemReed.java +++ /dev/null @@ -1,90 +0,0 @@ -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 deleted file mode 100755 index 7d484be0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSaddle.java +++ /dev/null @@ -1,71 +0,0 @@ -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 deleted file mode 100755 index 9efeaa3f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSeedFood.java +++ /dev/null @@ -1,65 +0,0 @@ -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 deleted file mode 100755 index 232d26cf..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSeeds.java +++ /dev/null @@ -1,66 +0,0 @@ -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 deleted file mode 100755 index fece66a4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemShears.java +++ /dev/null @@ -1,74 +0,0 @@ -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 deleted file mode 100755 index aa50646c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSign.java +++ /dev/null @@ -1,88 +0,0 @@ -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 deleted file mode 100755 index 4c6b4411..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSimpleFoiled.java +++ /dev/null @@ -1,37 +0,0 @@ -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 deleted file mode 100755 index 520e156a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSkull.java +++ /dev/null @@ -1,194 +0,0 @@ -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 deleted file mode 100755 index 9da1be6a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSlab.java +++ /dev/null @@ -1,154 +0,0 @@ -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 deleted file mode 100755 index 4c3b0250..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSnow.java +++ /dev/null @@ -1,96 +0,0 @@ -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 deleted file mode 100755 index ea522702..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSnowball.java +++ /dev/null @@ -1,59 +0,0 @@ -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 deleted file mode 100755 index 5b62411e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSoup.java +++ /dev/null @@ -1,51 +0,0 @@ -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 deleted file mode 100755 index df1724b3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSpade.java +++ /dev/null @@ -1,55 +0,0 @@ -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 deleted file mode 100755 index cf3291c7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemStack.java +++ /dev/null @@ -1,949 +0,0 @@ -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 deleted file mode 100755 index 13dd2ade..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemSword.java +++ /dev/null @@ -1,164 +0,0 @@ -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 deleted file mode 100755 index 3e6b5e4e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemTool.java +++ /dev/null @@ -1,125 +0,0 @@ -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 deleted file mode 100755 index 25067cd2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/ItemWritableBook.java +++ /dev/null @@ -1,79 +0,0 @@ -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 deleted file mode 100755 index 7b35361a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/CraftingManager.java +++ /dev/null @@ -1,530 +0,0 @@ -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 deleted file mode 100755 index 2043b762..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/FurnaceRecipes.java +++ /dev/null @@ -1,151 +0,0 @@ -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 deleted file mode 100755 index 371341a8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/IRecipe.java +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100755 index 72f244f4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipeBookCloning.java +++ /dev/null @@ -1,132 +0,0 @@ -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 deleted file mode 100755 index 933a6361..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipeFireworks.java +++ /dev/null @@ -1,220 +0,0 @@ -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 deleted file mode 100755 index cde0eea2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipeRepairItem.java +++ /dev/null @@ -1,126 +0,0 @@ -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 deleted file mode 100755 index b4e81cbd..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesArmor.java +++ /dev/null @@ -1,59 +0,0 @@ -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 deleted file mode 100755 index 1d7e1bc4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesArmorDyes.java +++ /dev/null @@ -1,163 +0,0 @@ -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 deleted file mode 100755 index 81c08edc..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesBanners.java +++ /dev/null @@ -1,321 +0,0 @@ -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 deleted file mode 100755 index 9884a92f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesCrafting.java +++ /dev/null @@ -1,138 +0,0 @@ -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 deleted file mode 100755 index 261eecf2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesDyes.java +++ /dev/null @@ -1,139 +0,0 @@ -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 deleted file mode 100755 index ee3c8786..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesFood.java +++ /dev/null @@ -1,67 +0,0 @@ -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 deleted file mode 100755 index 651fd448..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesIngots.java +++ /dev/null @@ -1,64 +0,0 @@ -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 deleted file mode 100755 index 7332032e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesMapCloning.java +++ /dev/null @@ -1,127 +0,0 @@ -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 deleted file mode 100755 index 9d270718..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesMapExtending.java +++ /dev/null @@ -1,95 +0,0 @@ -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 deleted file mode 100755 index 483985e6..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesTools.java +++ /dev/null @@ -1,64 +0,0 @@ -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 deleted file mode 100755 index f6709510..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/RecipesWeapons.java +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100755 index 7fe3ef15..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/ShapedRecipes.java +++ /dev/null @@ -1,147 +0,0 @@ -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 deleted file mode 100755 index 41f94c96..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/item/crafting/ShapelessRecipes.java +++ /dev/null @@ -1,108 +0,0 @@ -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 deleted file mode 100755 index 3e1601c6..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/EnumConnectionState.java +++ /dev/null @@ -1,343 +0,0 @@ -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 deleted file mode 100755 index 8d73a42b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/EnumPacketDirection.java +++ /dev/null @@ -1,32 +0,0 @@ -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 deleted file mode 100755 index bf934d6f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/INetHandler.java +++ /dev/null @@ -1,31 +0,0 @@ -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/Packet.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/Packet.java deleted file mode 100755 index bd0eab0d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/Packet.java +++ /dev/null @@ -1,42 +0,0 @@ -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 deleted file mode 100755 index 3d0696b1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/PacketBuffer.java +++ /dev/null @@ -1,90 +0,0 @@ -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 deleted file mode 100755 index e01d9733..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/handshake/INetHandlerHandshakeServer.java +++ /dev/null @@ -1,35 +0,0 @@ -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 deleted file mode 100755 index c9f051ad..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/handshake/client/C00Handshake.java +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100755 index a60477b1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/INetHandlerLoginClient.java +++ /dev/null @@ -1,37 +0,0 @@ -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 deleted file mode 100755 index 9515efbb..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/INetHandlerLoginServer.java +++ /dev/null @@ -1,31 +0,0 @@ -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 deleted file mode 100755 index d8e1b68a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/client/C00PacketLoginStart.java +++ /dev/null @@ -1,79 +0,0 @@ -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 deleted file mode 100755 index bb7ba37e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/client/C01PacketEncryptionResponse.java +++ /dev/null @@ -1,61 +0,0 @@ -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 deleted file mode 100755 index ce53a903..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/server/S00PacketDisconnect.java +++ /dev/null @@ -1,70 +0,0 @@ -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 deleted file mode 100755 index fd95e6f6..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/server/S01PacketEncryptionRequest.java +++ /dev/null @@ -1,74 +0,0 @@ -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 deleted file mode 100755 index 9a3e14eb..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/server/S02PacketLoginSuccess.java +++ /dev/null @@ -1,76 +0,0 @@ -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 deleted file mode 100755 index e7485c2a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/login/server/S03PacketEnableCompression.java +++ /dev/null @@ -1,69 +0,0 @@ -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 deleted file mode 100755 index bb89f101..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/INetHandlerPlayClient.java +++ /dev/null @@ -1,452 +0,0 @@ -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 deleted file mode 100755 index 6a59b75a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/INetHandlerPlayServer.java +++ /dev/null @@ -1,179 +0,0 @@ -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 deleted file mode 100755 index d42caca7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C00PacketKeepAlive.java +++ /dev/null @@ -1,69 +0,0 @@ -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 deleted file mode 100755 index e5b91b3e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C01PacketChatMessage.java +++ /dev/null @@ -1,73 +0,0 @@ -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 deleted file mode 100755 index ede84c22..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C02PacketUseEntity.java +++ /dev/null @@ -1,105 +0,0 @@ -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 deleted file mode 100755 index c1d952b8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C03PacketPlayer.java +++ /dev/null @@ -1,216 +0,0 @@ -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 deleted file mode 100755 index 894273ed..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C07PacketPlayerDigging.java +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100755 index ae47c0aa..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java +++ /dev/null @@ -1,129 +0,0 @@ -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 deleted file mode 100755 index 464f72c7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C09PacketHeldItemChange.java +++ /dev/null @@ -1,69 +0,0 @@ -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 deleted file mode 100755 index bb4c3bfc..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0APacketAnimation.java +++ /dev/null @@ -1,54 +0,0 @@ -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 deleted file mode 100755 index 381a5f57..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0BPacketEntityAction.java +++ /dev/null @@ -1,90 +0,0 @@ -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 deleted file mode 100755 index 6d144cc1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0CPacketInput.java +++ /dev/null @@ -1,102 +0,0 @@ -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 deleted file mode 100755 index 64dec477..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0DPacketCloseWindow.java +++ /dev/null @@ -1,65 +0,0 @@ -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 deleted file mode 100755 index 9e82dc34..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0EPacketClickWindow.java +++ /dev/null @@ -1,111 +0,0 @@ -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 deleted file mode 100755 index 238a229c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java +++ /dev/null @@ -1,81 +0,0 @@ -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 deleted file mode 100755 index 2de8f248..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100755 index 51493e82..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C11PacketEnchantItem.java +++ /dev/null @@ -1,77 +0,0 @@ -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 deleted file mode 100755 index c057d547..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C12PacketUpdateSign.java +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100755 index 3ae7a2cb..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C13PacketPlayerAbilities.java +++ /dev/null @@ -1,141 +0,0 @@ -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 deleted file mode 100755 index a3b6d7cc..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C14PacketTabComplete.java +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100755 index e6f33265..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C15PacketClientSettings.java +++ /dev/null @@ -1,103 +0,0 @@ -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 deleted file mode 100755 index 4a82bf05..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C16PacketClientStatus.java +++ /dev/null @@ -1,74 +0,0 @@ -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 deleted file mode 100755 index e54e5c01..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C17PacketCustomPayload.java +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100755 index 209d00fb..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C18PacketSpectate.java +++ /dev/null @@ -1,72 +0,0 @@ -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 deleted file mode 100755 index d88bb07d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/client/C19PacketResourcePackStatus.java +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100755 index 77f6cab0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S00PacketKeepAlive.java +++ /dev/null @@ -1,69 +0,0 @@ -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 deleted file mode 100755 index 703d82e6..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S01PacketJoinGame.java +++ /dev/null @@ -1,139 +0,0 @@ -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 deleted file mode 100755 index ecaf3115..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S02PacketChat.java +++ /dev/null @@ -1,90 +0,0 @@ -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 deleted file mode 100755 index 44cc5a59..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S03PacketTimeUpdate.java +++ /dev/null @@ -1,84 +0,0 @@ -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 deleted file mode 100755 index 2ec41fe9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S04PacketEntityEquipment.java +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100755 index 914671c8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S05PacketSpawnPosition.java +++ /dev/null @@ -1,70 +0,0 @@ -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 deleted file mode 100755 index a11fd7e5..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S06PacketUpdateHealth.java +++ /dev/null @@ -1,85 +0,0 @@ -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 deleted file mode 100755 index a617bbef..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S07PacketRespawn.java +++ /dev/null @@ -1,101 +0,0 @@ -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 deleted file mode 100755 index 2547d2a3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S08PacketPlayerPosLook.java +++ /dev/null @@ -1,152 +0,0 @@ -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 deleted file mode 100755 index f09196ec..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S09PacketHeldItemChange.java +++ /dev/null @@ -1,69 +0,0 @@ -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 deleted file mode 100755 index 0ac799a7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0APacketUseBed.java +++ /dev/null @@ -1,80 +0,0 @@ -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 deleted file mode 100755 index 062c738a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0BPacketAnimation.java +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100755 index 304b3e38..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java +++ /dev/null @@ -1,146 +0,0 @@ -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 deleted file mode 100755 index 0652115e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0DPacketCollectItem.java +++ /dev/null @@ -1,77 +0,0 @@ -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 deleted file mode 100755 index 24d6aa32..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0EPacketSpawnObject.java +++ /dev/null @@ -1,220 +0,0 @@ -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 deleted file mode 100755 index 77a9a4c0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S0FPacketSpawnMob.java +++ /dev/null @@ -1,195 +0,0 @@ -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 deleted file mode 100755 index f381da5c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S10PacketSpawnPainting.java +++ /dev/null @@ -1,96 +0,0 @@ -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 deleted file mode 100755 index bd459013..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java +++ /dev/null @@ -1,103 +0,0 @@ -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 deleted file mode 100755 index f0d7020b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S12PacketEntityVelocity.java +++ /dev/null @@ -1,123 +0,0 @@ -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 deleted file mode 100755 index c83b0471..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S13PacketDestroyEntities.java +++ /dev/null @@ -1,79 +0,0 @@ -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 deleted file mode 100755 index 95eca467..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S14PacketEntity.java +++ /dev/null @@ -1,223 +0,0 @@ -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 deleted file mode 100755 index dc440783..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S18PacketEntityTeleport.java +++ /dev/null @@ -1,130 +0,0 @@ -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 deleted file mode 100755 index 57b2e5f3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S19PacketEntityHeadLook.java +++ /dev/null @@ -1,79 +0,0 @@ -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 deleted file mode 100755 index ed68c938..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S19PacketEntityStatus.java +++ /dev/null @@ -1,79 +0,0 @@ -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 deleted file mode 100755 index f4d4eea8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1BPacketEntityAttach.java +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100755 index 2d9f49c1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1CPacketEntityMetadata.java +++ /dev/null @@ -1,84 +0,0 @@ -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 deleted file mode 100755 index 6ee76115..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1DPacketEntityEffect.java +++ /dev/null @@ -1,111 +0,0 @@ -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 deleted file mode 100755 index 6089549d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100755 index 799fc928..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S1FPacketSetExperience.java +++ /dev/null @@ -1,85 +0,0 @@ -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 deleted file mode 100755 index 41c8f5b9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S20PacketEntityProperties.java +++ /dev/null @@ -1,143 +0,0 @@ -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 deleted file mode 100755 index 8727bb6d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S21PacketChunkData.java +++ /dev/null @@ -1,169 +0,0 @@ -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 deleted file mode 100755 index 5549f986..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S22PacketMultiBlockChange.java +++ /dev/null @@ -1,125 +0,0 @@ -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 deleted file mode 100755 index 0546cf5c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S23PacketBlockChange.java +++ /dev/null @@ -1,81 +0,0 @@ -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 deleted file mode 100755 index 77961b2e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S24PacketBlockAction.java +++ /dev/null @@ -1,101 +0,0 @@ -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 deleted file mode 100755 index 92272e7a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100755 index 2a601986..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S26PacketMapChunkBulk.java +++ /dev/null @@ -1,135 +0,0 @@ -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 deleted file mode 100755 index dbe79f31..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S27PacketExplosion.java +++ /dev/null @@ -1,158 +0,0 @@ -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 deleted file mode 100755 index 2b2fb811..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S28PacketEffect.java +++ /dev/null @@ -1,94 +0,0 @@ -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 deleted file mode 100755 index 032ed344..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S29PacketSoundEffect.java +++ /dev/null @@ -1,114 +0,0 @@ -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 deleted file mode 100755 index 9cde245a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2APacketParticles.java +++ /dev/null @@ -1,200 +0,0 @@ -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 deleted file mode 100755 index 3b8e28ff..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2BPacketChangeGameState.java +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100755 index 602959a3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java +++ /dev/null @@ -1,107 +0,0 @@ -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 deleted file mode 100755 index 87d4dbef..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2DPacketOpenWindow.java +++ /dev/null @@ -1,121 +0,0 @@ -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 deleted file mode 100755 index c4ebac97..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2EPacketCloseWindow.java +++ /dev/null @@ -1,65 +0,0 @@ -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 deleted file mode 100755 index 148361ca..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S2FPacketSetSlot.java +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100755 index 18699d1e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S30PacketWindowItems.java +++ /dev/null @@ -1,96 +0,0 @@ -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 deleted file mode 100755 index e70951e0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S31PacketWindowProperty.java +++ /dev/null @@ -1,85 +0,0 @@ -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 deleted file mode 100755 index 8e712a68..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S32PacketConfirmTransaction.java +++ /dev/null @@ -1,85 +0,0 @@ -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 deleted file mode 100755 index d41fff25..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S33PacketUpdateSign.java +++ /dev/null @@ -1,91 +0,0 @@ -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 deleted file mode 100755 index 859509ff..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S34PacketMaps.java +++ /dev/null @@ -1,148 +0,0 @@ -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 deleted file mode 100755 index d731da44..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java +++ /dev/null @@ -1,87 +0,0 @@ -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 deleted file mode 100755 index cb5457e6..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S36PacketSignEditorOpen.java +++ /dev/null @@ -1,70 +0,0 @@ -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 deleted file mode 100755 index e06d864a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S37PacketStatistics.java +++ /dev/null @@ -1,90 +0,0 @@ -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 deleted file mode 100755 index a22c5261..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S38PacketPlayerListItem.java +++ /dev/null @@ -1,251 +0,0 @@ -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 deleted file mode 100755 index eb4985fd..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S39PacketPlayerAbilities.java +++ /dev/null @@ -1,149 +0,0 @@ -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 deleted file mode 100755 index b605dc4b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3APacketTabComplete.java +++ /dev/null @@ -1,79 +0,0 @@ -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 deleted file mode 100755 index 5c14599a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java +++ /dev/null @@ -1,101 +0,0 @@ -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 deleted file mode 100755 index ac7e70af..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3CPacketUpdateScore.java +++ /dev/null @@ -1,119 +0,0 @@ -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 deleted file mode 100755 index 3c7b945a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java +++ /dev/null @@ -1,83 +0,0 @@ -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 deleted file mode 100755 index a0c02dc0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3EPacketTeams.java +++ /dev/null @@ -1,184 +0,0 @@ -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 deleted file mode 100755 index 00b0df45..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S3FPacketCustomPayload.java +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100755 index a9ed30a7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S40PacketDisconnect.java +++ /dev/null @@ -1,70 +0,0 @@ -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 deleted file mode 100755 index cb0f38b7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S41PacketServerDifficulty.java +++ /dev/null @@ -1,76 +0,0 @@ -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 deleted file mode 100755 index cf509a5f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S42PacketCombatEvent.java +++ /dev/null @@ -1,105 +0,0 @@ -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 deleted file mode 100755 index 5e530656..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S43PacketCamera.java +++ /dev/null @@ -1,71 +0,0 @@ -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 deleted file mode 100755 index 8cbe8d44..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S44PacketWorldBorder.java +++ /dev/null @@ -1,178 +0,0 @@ -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 deleted file mode 100755 index e4378380..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S45PacketTitle.java +++ /dev/null @@ -1,148 +0,0 @@ -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 deleted file mode 100755 index a8780c97..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S46PacketSetCompressionLevel.java +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100755 index bc8b5047..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S47PacketPlayerListHeaderFooter.java +++ /dev/null @@ -1,77 +0,0 @@ -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 deleted file mode 100755 index 62860a37..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S48PacketResourcePackSend.java +++ /dev/null @@ -1,80 +0,0 @@ -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 deleted file mode 100755 index 6e7cb109..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/play/server/S49PacketUpdateEntityNBT.java +++ /dev/null @@ -1,80 +0,0 @@ -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/potion/Potion.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/Potion.java deleted file mode 100755 index 07b232bf..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/Potion.java +++ /dev/null @@ -1,398 +0,0 @@ -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 deleted file mode 100755 index 87f5aaf0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionAbsorption.java +++ /dev/null @@ -1,51 +0,0 @@ -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 deleted file mode 100755 index d88f3bd5..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionAttackDamage.java +++ /dev/null @@ -1,43 +0,0 @@ -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 deleted file mode 100755 index ee289f4a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionEffect.java +++ /dev/null @@ -1,228 +0,0 @@ -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 deleted file mode 100755 index a9bd9153..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionHealth.java +++ /dev/null @@ -1,52 +0,0 @@ -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 deleted file mode 100755 index 1fa8540d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionHealthBoost.java +++ /dev/null @@ -1,48 +0,0 @@ -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 deleted file mode 100755 index 5bf1f478..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/potion/PotionHelper.java +++ /dev/null @@ -1,526 +0,0 @@ -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.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(); - - 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 { - 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); - } - - 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 deleted file mode 100755 index 99ed9c3d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/profiler/Profiler.java +++ /dev/null @@ -1,199 +0,0 @@ -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.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(); - - /**+ - * Clear profiling. - */ - public void clearProfiling() { - this.profilingMap.clear(); - this.profilingSection = ""; - this.sectionList.clear(); - } - - /**+ - * Start section - */ - public void startSection(String name) { - 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 deleted file mode 100755 index 6deb9fb7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/GoalColor.java +++ /dev/null @@ -1,58 +0,0 @@ -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 deleted file mode 100755 index dc20fcc2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/IScoreObjectiveCriteria.java +++ /dev/null @@ -1,108 +0,0 @@ -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 deleted file mode 100755 index 662befb1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/Score.java +++ /dev/null @@ -1,125 +0,0 @@ -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 deleted file mode 100755 index 671088d3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScoreDummyCriteria.java +++ /dev/null @@ -1,57 +0,0 @@ -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 deleted file mode 100755 index 11a29d2f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScoreHealthCriteria.java +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100755 index 09f7471d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScoreObjective.java +++ /dev/null @@ -1,77 +0,0 @@ -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 deleted file mode 100755 index e574e63f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScorePlayerTeam.java +++ /dev/null @@ -1,185 +0,0 @@ -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 deleted file mode 100755 index 0ac2a6a0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/Scoreboard.java +++ /dev/null @@ -1,452 +0,0 @@ -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 deleted file mode 100755 index ca4b396d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ScoreboardSaveData.java +++ /dev/null @@ -1,288 +0,0 @@ -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/Team.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/Team.java deleted file mode 100755 index f9289322..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/Team.java +++ /dev/null @@ -1,85 +0,0 @@ -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/management/LowerStringMap.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/LowerStringMap.java deleted file mode 100755 index 9599568d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/LowerStringMap.java +++ /dev/null @@ -1,89 +0,0 @@ -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/stats/Achievement.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/Achievement.java deleted file mode 100755 index 2c51724e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/Achievement.java +++ /dev/null @@ -1,157 +0,0 @@ -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 deleted file mode 100755 index 67b76037..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/AchievementList.java +++ /dev/null @@ -1,215 +0,0 @@ -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 deleted file mode 100755 index 89283d6e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/IStatStringFormat.java +++ /dev/null @@ -1,28 +0,0 @@ -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 deleted file mode 100755 index 0b3da887..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/IStatType.java +++ /dev/null @@ -1,28 +0,0 @@ -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 deleted file mode 100755 index 53335030..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/ObjectiveStat.java +++ /dev/null @@ -1,40 +0,0 @@ -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 deleted file mode 100755 index 15742243..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatBase.java +++ /dev/null @@ -1,180 +0,0 @@ -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 deleted file mode 100755 index 53043ad8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatBasic.java +++ /dev/null @@ -1,52 +0,0 @@ -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 deleted file mode 100755 index abba14fa..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatCrafting.java +++ /dev/null @@ -1,51 +0,0 @@ -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 deleted file mode 100755 index e84ef453..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatFileWriter.java +++ /dev/null @@ -1,116 +0,0 @@ -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 deleted file mode 100755 index f3e342ff..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatList.java +++ /dev/null @@ -1,403 +0,0 @@ -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/tileentity/IHopper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/IHopper.java deleted file mode 100755 index 96082658..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/IHopper.java +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100755 index 6153ad65..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/MobSpawnerBaseLogic.java +++ /dev/null @@ -1,387 +0,0 @@ -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 deleted file mode 100755 index be6dbee2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntity.java +++ /dev/null @@ -1,320 +0,0 @@ -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 deleted file mode 100755 index b91a3591..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityBanner.java +++ /dev/null @@ -1,304 +0,0 @@ -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 deleted file mode 100755 index 3495634e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityBeacon.java +++ /dev/null @@ -1,463 +0,0 @@ -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 deleted file mode 100755 index 45d5fc3f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityBrewingStand.java +++ /dev/null @@ -1,399 +0,0 @@ -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 deleted file mode 100755 index 773a7b3e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityChest.java +++ /dev/null @@ -1,448 +0,0 @@ -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 deleted file mode 100755 index 4dcda089..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityCommandBlock.java +++ /dev/null @@ -1,115 +0,0 @@ -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 deleted file mode 100755 index e8f34085..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityComparator.java +++ /dev/null @@ -1,53 +0,0 @@ -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 deleted file mode 100755 index 177bb4fe..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityDaylightDetector.java +++ /dev/null @@ -1,47 +0,0 @@ -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 deleted file mode 100755 index e6fde65b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityDispenser.java +++ /dev/null @@ -1,254 +0,0 @@ -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 deleted file mode 100755 index 5425fd4a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityDropper.java +++ /dev/null @@ -1,44 +0,0 @@ -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 deleted file mode 100755 index 3c8cdffe..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityEnchantmentTable.java +++ /dev/null @@ -1,173 +0,0 @@ -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 deleted file mode 100755 index c41533b8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityEndPortal.java +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100755 index 4085f003..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityEnderChest.java +++ /dev/null @@ -1,120 +0,0 @@ -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 deleted file mode 100755 index 9fe5c397..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityFlowerPot.java +++ /dev/null @@ -1,93 +0,0 @@ -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 deleted file mode 100755 index b5539384..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityFurnace.java +++ /dev/null @@ -1,476 +0,0 @@ -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 deleted file mode 100755 index f8d81052..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityHopper.java +++ /dev/null @@ -1,664 +0,0 @@ -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 deleted file mode 100755 index 6c5ed6e0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityLockable.java +++ /dev/null @@ -1,75 +0,0 @@ -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 deleted file mode 100755 index b3cc7d30..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityMobSpawner.java +++ /dev/null @@ -1,105 +0,0 @@ -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 deleted file mode 100755 index 7f8034c1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityNote.java +++ /dev/null @@ -1,84 +0,0 @@ -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 deleted file mode 100755 index 8b7be1f5..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntityPiston.java +++ /dev/null @@ -1,213 +0,0 @@ -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 deleted file mode 100755 index a38ebc24..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntitySign.java +++ /dev/null @@ -1,246 +0,0 @@ -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 deleted file mode 100755 index fc9f9fdc..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/tileentity/TileEntitySkull.java +++ /dev/null @@ -1,124 +0,0 @@ -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 deleted file mode 100755 index 395273b6..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/AxisAlignedBB.java +++ /dev/null @@ -1,382 +0,0 @@ -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 deleted file mode 100755 index 4fcfd861..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/BlockPos.java +++ /dev/null @@ -1,358 +0,0 @@ -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 deleted file mode 100755 index fe1b3f8d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Cartesian.java +++ /dev/null @@ -1,173 +0,0 @@ -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 deleted file mode 100755 index 6c71f722..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatAllowedCharacters.java +++ /dev/null @@ -1,57 +0,0 @@ -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 deleted file mode 100755 index 01974826..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentProcessor.java +++ /dev/null @@ -1,99 +0,0 @@ -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 deleted file mode 100755 index e91853db..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentScore.java +++ /dev/null @@ -1,121 +0,0 @@ -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 deleted file mode 100755 index ebca56c1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentSelector.java +++ /dev/null @@ -1,86 +0,0 @@ -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 deleted file mode 100755 index 3b8b6969..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentStyle.java +++ /dev/null @@ -1,172 +0,0 @@ -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 deleted file mode 100755 index 57ffd96d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentText.java +++ /dev/null @@ -1,89 +0,0 @@ -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 deleted file mode 100755 index 255310e8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentTranslation.java +++ /dev/null @@ -1,261 +0,0 @@ -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 deleted file mode 100755 index 1a9c44c0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatComponentTranslationFormatException.java +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100755 index 57604698..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ChatStyle.java +++ /dev/null @@ -1,683 +0,0 @@ -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 deleted file mode 100755 index b850764a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ClassInheritanceMultiMap.java +++ /dev/null @@ -1,145 +0,0 @@ -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 deleted file mode 100755 index c80debbe..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/CombatEntry.java +++ /dev/null @@ -1,83 +0,0 @@ -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 deleted file mode 100755 index 372a2a43..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/CombatTracker.java +++ /dev/null @@ -1,253 +0,0 @@ -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 deleted file mode 100755 index 842f1865..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/DamageSource.java +++ /dev/null @@ -1,272 +0,0 @@ -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 deleted file mode 100755 index a28b4e34..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnchantmentNameParts.java +++ /dev/null @@ -1,68 +0,0 @@ -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 deleted file mode 100755 index 16a1e3a2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EntityDamageSource.java +++ /dev/null @@ -1,93 +0,0 @@ -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 deleted file mode 100755 index e69d4c38..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EntityDamageSourceIndirect.java +++ /dev/null @@ -1,71 +0,0 @@ -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 deleted file mode 100755 index a00d66df..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EntitySelectors.java +++ /dev/null @@ -1,90 +0,0 @@ -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 deleted file mode 100755 index dab78717..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnumChatFormatting.java +++ /dev/null @@ -1,167 +0,0 @@ -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 deleted file mode 100755 index f52bcdc0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnumFacing.java +++ /dev/null @@ -1,454 +0,0 @@ -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 - */ - private 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 deleted file mode 100755 index 7f59a4e2..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnumParticleTypes.java +++ /dev/null @@ -1,113 +0,0 @@ -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 deleted file mode 100755 index 0210b23c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/EnumWorldBlockLayer.java +++ /dev/null @@ -1,41 +0,0 @@ -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 deleted file mode 100755 index b18fc80d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/FoodStats.java +++ /dev/null @@ -1,167 +0,0 @@ -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 deleted file mode 100755 index 8d61a735..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/FrameTimer.java +++ /dev/null @@ -1,72 +0,0 @@ -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 deleted file mode 100755 index 80583ee1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IChatComponent.java +++ /dev/null @@ -1,269 +0,0 @@ -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 deleted file mode 100755 index f7dd8f1c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IJsonSerializable.java +++ /dev/null @@ -1,30 +0,0 @@ -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 deleted file mode 100755 index 6f4297b7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IObjectIntIterable.java +++ /dev/null @@ -1,24 +0,0 @@ -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 deleted file mode 100755 index 7c13f0ee..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IProgressUpdate.java +++ /dev/null @@ -1,49 +0,0 @@ -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 deleted file mode 100755 index a899c7f6..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IRegistry.java +++ /dev/null @@ -1,30 +0,0 @@ -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 deleted file mode 100755 index 3e363c4b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IStringSerializable.java +++ /dev/null @@ -1,25 +0,0 @@ -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 deleted file mode 100755 index 8c1e76d8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IThreadListener.java +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100755 index d6ffeec9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ITickable.java +++ /dev/null @@ -1,28 +0,0 @@ -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 deleted file mode 100755 index 7a2200da..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IntHashMap.java +++ /dev/null @@ -1,272 +0,0 @@ -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 deleted file mode 100755 index ab6120cd..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/IntegerCache.java +++ /dev/null @@ -1,45 +0,0 @@ -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 deleted file mode 100755 index 077d97f0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/JsonSerializableSet.java +++ /dev/null @@ -1,71 +0,0 @@ -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 deleted file mode 100755 index 0861b4c7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/LazyLoadBase.java +++ /dev/null @@ -1,37 +0,0 @@ -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 deleted file mode 100755 index b7bfd2a4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/LongHashMap.java +++ /dev/null @@ -1,276 +0,0 @@ -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 deleted file mode 100755 index ca6160a9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/MapPopulator.java +++ /dev/null @@ -1,56 +0,0 @@ -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 deleted file mode 100755 index d29e51c6..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/MathHelper.java +++ /dev/null @@ -1,518 +0,0 @@ -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 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 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 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 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 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); - } - - 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 deleted file mode 100755 index e1fde642..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/MovementInput.java +++ /dev/null @@ -1,38 +0,0 @@ -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 deleted file mode 100755 index 72bf69cb..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/MovingObjectPosition.java +++ /dev/null @@ -1,80 +0,0 @@ -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 deleted file mode 100755 index 5daf50c4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ObjectIntIdentityMap.java +++ /dev/null @@ -1,64 +0,0 @@ -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 deleted file mode 100755 index 236ca957..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/RegistryDefaulted.java +++ /dev/null @@ -1,43 +0,0 @@ -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 deleted file mode 100755 index d0fab6ab..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/RegistryNamespaced.java +++ /dev/null @@ -1,93 +0,0 @@ -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 deleted file mode 100755 index 6d8a17cc..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/RegistryNamespacedDefaultedByKey.java +++ /dev/null @@ -1,68 +0,0 @@ -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 deleted file mode 100755 index 91a0d7a1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/RegistrySimple.java +++ /dev/null @@ -1,82 +0,0 @@ -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 deleted file mode 100755 index 842f133f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ReportedException.java +++ /dev/null @@ -1,53 +0,0 @@ -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 deleted file mode 100755 index 33a88529..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/ResourceLocation.java +++ /dev/null @@ -1,97 +0,0 @@ -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 deleted file mode 100755 index 6d87fdc9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Rotations.java +++ /dev/null @@ -1,87 +0,0 @@ -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 deleted file mode 100755 index 8a1a1148..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/StatCollector.java +++ /dev/null @@ -1,73 +0,0 @@ -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 deleted file mode 100755 index 00e35135..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/StringTranslate.java +++ /dev/null @@ -1,145 +0,0 @@ -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 deleted file mode 100755 index 19c9c914..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/StringUtils.java +++ /dev/null @@ -1,63 +0,0 @@ -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 deleted file mode 100755 index 885d806a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Tuple.java +++ /dev/null @@ -1,52 +0,0 @@ -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 deleted file mode 100755 index 72317cae..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/TupleIntJsonSerializable.java +++ /dev/null @@ -1,60 +0,0 @@ -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 deleted file mode 100755 index 23e53fd9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Util.java +++ /dev/null @@ -1,62 +0,0 @@ -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 deleted file mode 100755 index 1ac4f073..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Vec3.java +++ /dev/null @@ -1,221 +0,0 @@ -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 deleted file mode 100755 index 37c77575..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Vec3i.java +++ /dev/null @@ -1,136 +0,0 @@ -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 deleted file mode 100755 index 32f1454f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Vec4b.java +++ /dev/null @@ -1,87 +0,0 @@ -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 deleted file mode 100755 index 648c9970..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/Vector3d.java +++ /dev/null @@ -1,38 +0,0 @@ -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 deleted file mode 100755 index 70272b2a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/WeightedRandom.java +++ /dev/null @@ -1,85 +0,0 @@ -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 deleted file mode 100755 index 3a597d22..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/WeightedRandomChestContent.java +++ /dev/null @@ -1,111 +0,0 @@ -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 deleted file mode 100755 index 708a5ee4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/util/WeightedRandomFishable.java +++ /dev/null @@ -1,77 +0,0 @@ -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 deleted file mode 100755 index 4aa464c4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/MerchantRecipe.java +++ /dev/null @@ -1,169 +0,0 @@ -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 deleted file mode 100755 index a99e1d82..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/MerchantRecipeList.java +++ /dev/null @@ -1,152 +0,0 @@ -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/world/ChunkCache.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ChunkCache.java deleted file mode 100755 index b3ef6259..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ChunkCache.java +++ /dev/null @@ -1,175 +0,0 @@ -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 deleted file mode 100755 index 4b786062..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ChunkCoordIntPair.java +++ /dev/null @@ -1,121 +0,0 @@ -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 deleted file mode 100755 index 8f1a2f12..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ColorizerFoliage.java +++ /dev/null @@ -1,68 +0,0 @@ -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 deleted file mode 100755 index 0c60e22c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ColorizerGrass.java +++ /dev/null @@ -1,51 +0,0 @@ -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 deleted file mode 100755 index ca381d4f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/DifficultyInstance.java +++ /dev/null @@ -1,74 +0,0 @@ -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 deleted file mode 100755 index 042ab5b4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/EnumDifficulty.java +++ /dev/null @@ -1,60 +0,0 @@ -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 deleted file mode 100755 index adfc8f5b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/EnumSkyBlock.java +++ /dev/null @@ -1,37 +0,0 @@ -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 deleted file mode 100755 index 3cece965..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/Explosion.java +++ /dev/null @@ -1,269 +0,0 @@ -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 deleted file mode 100755 index e8aa3fad..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/GameRules.java +++ /dev/null @@ -1,199 +0,0 @@ -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 deleted file mode 100755 index 4c70db88..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/IBlockAccess.java +++ /dev/null @@ -1,55 +0,0 @@ -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 deleted file mode 100755 index 51ef1c02..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/IInteractionObject.java +++ /dev/null @@ -1,32 +0,0 @@ -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 deleted file mode 100755 index cb712340..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/ILockableContainer.java +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100755 index 6a921553..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/IWorldAccess.java +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100755 index 74f701f4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/IWorldNameable.java +++ /dev/null @@ -1,42 +0,0 @@ -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 deleted file mode 100755 index 01b83753..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/LockCode.java +++ /dev/null @@ -1,60 +0,0 @@ -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 deleted file mode 100755 index dc1c6ccc..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/MinecraftException.java +++ /dev/null @@ -1,34 +0,0 @@ -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 deleted file mode 100755 index 7a877cea..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/NextTickListEntry.java +++ /dev/null @@ -1,90 +0,0 @@ -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/World.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/World.java deleted file mode 100755 index 1f2bec3b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/World.java +++ /dev/null @@ -1,3225 +0,0 @@ -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/WorldProvider.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProvider.java deleted file mode 100755 index 60c95ce4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProvider.java +++ /dev/null @@ -1,283 +0,0 @@ -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 deleted file mode 100755 index 8accb7ad..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProviderEnd.java +++ /dev/null @@ -1,150 +0,0 @@ -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; - -/**+ - * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. - * - * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" - * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team - * - * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 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; - 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 deleted file mode 100755 index a4efc313..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProviderHell.java +++ /dev/null @@ -1,141 +0,0 @@ -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; - -/**+ - * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. - * - * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" - * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team - * - * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 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; - } - - /**+ - * 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 deleted file mode 100755 index 8cc85422..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldProviderSurface.java +++ /dev/null @@ -1,44 +0,0 @@ -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; - -/**+ - * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. - * - * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" - * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team - * - * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 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"); - } - - /**+ - * 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 deleted file mode 100755 index 8af697a1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldSavedData.java +++ /dev/null @@ -1,66 +0,0 @@ -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/WorldSettings.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldSettings.java deleted file mode 100755 index cf704af8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldSettings.java +++ /dev/null @@ -1,210 +0,0 @@ -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 deleted file mode 100755 index a334d2bb..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldType.java +++ /dev/null @@ -1,164 +0,0 @@ -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/BiomeColorHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeColorHelper.java deleted file mode 100755 index 470bb0a1..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeColorHelper.java +++ /dev/null @@ -1,84 +0,0 @@ -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/BiomeGenBase.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenBase.java deleted file mode 100755 index d2085251..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenBase.java +++ /dev/null @@ -1,700 +0,0 @@ -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 deleted file mode 100755 index f8ab29c3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenBeach.java +++ /dev/null @@ -1,44 +0,0 @@ -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 deleted file mode 100755 index 884621e5..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenDesert.java +++ /dev/null @@ -1,60 +0,0 @@ -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 deleted file mode 100755 index 1a759521..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenEnd.java +++ /dev/null @@ -1,54 +0,0 @@ -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 deleted file mode 100755 index 672ab745..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenForest.java +++ /dev/null @@ -1,190 +0,0 @@ -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 deleted file mode 100755 index d5e5441e..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenHell.java +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100755 index dd121992..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenHills.java +++ /dev/null @@ -1,119 +0,0 @@ -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 deleted file mode 100755 index 250dd6ef..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenJungle.java +++ /dev/null @@ -1,114 +0,0 @@ -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 deleted file mode 100755 index e0b89f80..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenMesa.java +++ /dev/null @@ -1,302 +0,0 @@ -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 deleted file mode 100755 index 3e4754a6..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenMushroomIsland.java +++ /dev/null @@ -1,48 +0,0 @@ -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 deleted file mode 100755 index 21ed8a18..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenMutated.java +++ /dev/null @@ -1,108 +0,0 @@ -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 deleted file mode 100755 index c0abacc8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenOcean.java +++ /dev/null @@ -1,49 +0,0 @@ -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 deleted file mode 100755 index b3be09f9..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenPlains.java +++ /dev/null @@ -1,117 +0,0 @@ -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 deleted file mode 100755 index 263ad01c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenRiver.java +++ /dev/null @@ -1,37 +0,0 @@ -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 deleted file mode 100755 index dc31e4e4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenSavanna.java +++ /dev/null @@ -1,106 +0,0 @@ -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 deleted file mode 100755 index 06c5002d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenSnow.java +++ /dev/null @@ -1,85 +0,0 @@ -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 deleted file mode 100755 index dbf14a3f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenStoneBeach.java +++ /dev/null @@ -1,44 +0,0 @@ -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 deleted file mode 100755 index cd45d091..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenSwamp.java +++ /dev/null @@ -1,98 +0,0 @@ -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 deleted file mode 100755 index 359a2837..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeGenTaiga.java +++ /dev/null @@ -1,133 +0,0 @@ -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/border/EnumBorderStatus.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/border/EnumBorderStatus.java deleted file mode 100755 index 7bf018c0..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/border/EnumBorderStatus.java +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100755 index 8767579f..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/border/IBorderListener.java +++ /dev/null @@ -1,39 +0,0 @@ -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 deleted file mode 100755 index cc10c2d7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/border/WorldBorder.java +++ /dev/null @@ -1,267 +0,0 @@ -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 deleted file mode 100755 index 14d279b3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/Chunk.java +++ /dev/null @@ -1,1380 +0,0 @@ -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 deleted file mode 100755 index a53a25e6..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/ChunkPrimer.java +++ /dev/null @@ -1,64 +0,0 @@ -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; - -/**+ - * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. - * - * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" - * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team - * - * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 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 short[] data = new short[65536]; - 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.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"); - } - } - - 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.length) { - this.data[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 deleted file mode 100755 index 0645b93a..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/EmptyChunk.java +++ /dev/null @@ -1,189 +0,0 @@ -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 deleted file mode 100755 index 3576e981..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/IChunkProvider.java +++ /dev/null @@ -1,95 +0,0 @@ -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 deleted file mode 100755 index 58e3d3d4..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/NibbleArray.java +++ /dev/null @@ -1,90 +0,0 @@ -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/ExtendedBlockStorage.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java deleted file mode 100755 index 2ccef13c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java +++ /dev/null @@ -1,211 +0,0 @@ -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/NibbleArrayReader.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/NibbleArrayReader.java deleted file mode 100755 index 3498d7f3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/NibbleArrayReader.java +++ /dev/null @@ -1,47 +0,0 @@ -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/demo/DemoWorldServer.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/demo/DemoWorldServer.java deleted file mode 100755 index 20f32ed3..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/demo/DemoWorldServer.java +++ /dev/null @@ -1,50 +0,0 @@ -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/ChunkProviderSettings.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderSettings.java deleted file mode 100755 index 83d5f67c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderSettings.java +++ /dev/null @@ -1,918 +0,0 @@ -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 deleted file mode 100755 index d1957d9d..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/FlatGeneratorInfo.java +++ /dev/null @@ -1,285 +0,0 @@ -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 deleted file mode 100755 index 14985176..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/FlatLayerInfo.java +++ /dev/null @@ -1,116 +0,0 @@ -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/NoiseGenerator.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGenerator.java deleted file mode 100755 index a3947616..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGenerator.java +++ /dev/null @@ -1,31 +0,0 @@ -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 deleted file mode 100755 index 3ffa4c28..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGeneratorImproved.java +++ /dev/null @@ -1,216 +0,0 @@ -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 deleted file mode 100755 index c2f20f3b..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGeneratorOctaves.java +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100755 index eb73933c..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGeneratorPerlin.java +++ /dev/null @@ -1,88 +0,0 @@ -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 deleted file mode 100755 index 8f268b07..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/NoiseGeneratorSimplex.java +++ /dev/null @@ -1,205 +0,0 @@ -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/storage/IPlayerFileData.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/IPlayerFileData.java deleted file mode 100755 index 31b94236..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/IPlayerFileData.java +++ /dev/null @@ -1,44 +0,0 @@ -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 deleted file mode 100755 index ca1bfd11..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/ISaveFormat.java +++ /dev/null @@ -1,81 +0,0 @@ -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 deleted file mode 100755 index 8d6534d7..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/ISaveHandler.java +++ /dev/null @@ -1,83 +0,0 @@ -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 deleted file mode 100755 index d9c3e256..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/MapData.java +++ /dev/null @@ -1,290 +0,0 @@ -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 deleted file mode 100755 index 5e3330f8..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/MapStorage.java +++ /dev/null @@ -1,238 +0,0 @@ -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 deleted file mode 100755 index a065ef47..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveDataMemoryStorage.java +++ /dev/null @@ -1,70 +0,0 @@ -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 deleted file mode 100755 index 71b7a8ab..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveFormatComparator.java +++ /dev/null @@ -1,104 +0,0 @@ -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/WorldInfo.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/WorldInfo.java deleted file mode 100755 index 58eb4e52..00000000 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/WorldInfo.java +++ /dev/null @@ -1,796 +0,0 @@ -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/WorldConverterMCA.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/export/WorldConverterMCA.java index 1edfab60..4143440e 100755 --- 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 @@ -19,7 +19,7 @@ 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.world.chunk.storage.RegionFile; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; 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 index 7db2af6a..673c9c3d 100755 --- 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 @@ -3,7 +3,7 @@ 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; +import net.minecraft.entity.player.EntityPlayerMP; /** * Copyright (c) 2022-2024 lax1dude. All Rights Reserved. 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 index 9d65e9fe..5c7e7aae 100755 --- 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 @@ -13,13 +13,13 @@ 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.entity.player.EntityPlayerMP; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagString; 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 index bb7b14e7..38e97b97 100755 --- 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 @@ -17,14 +17,14 @@ 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.minecraft.network.EnumConnectionState; +import net.minecraft.network.EnumPacketDirection; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ITickable; import net.lax1dude.eaglercraft.v1_8.sp.server.internal.ServerPlatformSingleplayer; /** 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 index 3cbdfdff..85115b5e 100755 --- 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 @@ -1,10 +1,10 @@ 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; +import net.minecraft.network.handshake.INetHandlerHandshakeServer; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.server.network.NetHandlerLoginServer; +import net.minecraft.util.IChatComponent; /** * Copyright (c) 2023-2024 lax1dude. All Rights Reserved. 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 index 97a21711..70c2543d 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateCheckerOverlay.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateCheckerOverlay.java @@ -1,9 +1,10 @@ package net.lax1dude.eaglercraft.v1_8.update; +import net.lax1dude.eaglercraft.v1_8.EagRuntime; 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.util.EnumChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiButton; @@ -55,6 +56,9 @@ public class GuiUpdateCheckerOverlay extends Gui { } public void setResolution(Minecraft mc, int w, int h) { + if(!UpdateService.supported()) { + return; + } this.mc = mc; this.width = w; this.height = h; @@ -65,6 +69,9 @@ public class GuiUpdateCheckerOverlay extends Gui { } public void drawScreen(int mx, int my, float partialTicks) { + if(!UpdateService.supported()) { + return; + } UpdateProgressStruct progressState = UpdateService.getUpdatingStatus(); if(progressState.isBusy) { drawScreenBusy(mx, my, partialTicks, progressState); @@ -159,6 +166,9 @@ public class GuiUpdateCheckerOverlay extends Gui { } public void drawScreenBusy(int mx, int my, float partialTicks, UpdateProgressStruct progressState) { + if(!UpdateService.supported()) { + return; + } checkForUpdatesButton.visible = false; startDownloadButton.visible = false; viewAllUpdatesButton.visible = false; @@ -207,6 +217,9 @@ public class GuiUpdateCheckerOverlay extends Gui { } public void mouseClicked(int mx, int my, int btn) { + if(!UpdateService.supported()) { + return; + } if (btn == 0) { if(checkForUpdatesButton.mousePressed(mc, mx, my)) { mc.gameSettings.enableUpdateSvc = !mc.gameSettings.enableUpdateSvc; 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 index 743ec4a5..5dfa330e 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateVersionSlot.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/update/GuiUpdateVersionSlot.java @@ -12,7 +12,7 @@ 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.util.EnumChatFormatting; import net.minecraft.client.gui.GuiSlot; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/net/minecraft/block/Block.java b/src/main/java/net/minecraft/block/Block.java index ad4fe7e3..a5ea75cf 100755 --- a/src/main/java/net/minecraft/block/Block.java +++ b/src/main/java/net/minecraft/block/Block.java @@ -12,6 +12,8 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; @@ -548,7 +550,18 @@ public class Block { * Spawns this Block's drops into the World as EntityItems. */ public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float f, int i) { + if (!world.isRemote) { + 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))); + } + } + } + } } /**+ @@ -556,7 +569,16 @@ public class Block { * the given position */ public static void spawnAsEntity(World worldIn, BlockPos pos, ItemStack stack) { - + if (!worldIn.isRemote && 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); + } } /**+ @@ -564,7 +586,14 @@ public class Block { * orb entities */ protected void dropXpOnBlockBreak(World worldIn, BlockPos pos, int amount) { - + if (!worldIn.isRemote) { + 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)); + } + } } /**+ diff --git a/src/main/java/net/minecraft/block/BlockAnvil.java b/src/main/java/net/minecraft/block/BlockAnvil.java index 7d05b2c4..30d6bb33 100755 --- a/src/main/java/net/minecraft/block/BlockAnvil.java +++ b/src/main/java/net/minecraft/block/BlockAnvil.java @@ -81,6 +81,14 @@ public class BlockAnvil extends BlockFalling { .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) { + if (!worldIn.isRemote) { + 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 @@ -139,11 +147,6 @@ public class BlockAnvil extends BlockFalling { Integer.valueOf((meta & 15) >> 2)); } - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, - EnumFacing side, float hitX, float hitY, float hitZ) { - return true; - } - /**+ * Convert the BlockState into the correct metadata value */ diff --git a/src/main/java/net/minecraft/block/BlockBasePressurePlate.java b/src/main/java/net/minecraft/block/BlockBasePressurePlate.java index 946a1c8c..fd83e1f1 100755 --- a/src/main/java/net/minecraft/block/BlockBasePressurePlate.java +++ b/src/main/java/net/minecraft/block/BlockBasePressurePlate.java @@ -6,6 +6,7 @@ import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; @@ -117,7 +118,24 @@ public abstract class BlockBasePressurePlate extends Block { } public void updateTick(World worldIn, BlockPos pos, IBlockState state, EaglercraftRandom rand) { + if (!worldIn.isRemote) { + 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) { + if (!worldIn.isRemote) { + int i = this.getRedstoneStrength(state); + if (i == 0) { + this.updateState(worldIn, pos, state, i); + } + } } /**+ diff --git a/src/main/java/net/minecraft/block/BlockBeacon.java b/src/main/java/net/minecraft/block/BlockBeacon.java index 3fb4dc26..d66465b9 100755 --- a/src/main/java/net/minecraft/block/BlockBeacon.java +++ b/src/main/java/net/minecraft/block/BlockBeacon.java @@ -6,13 +6,17 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityBeacon; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumWorldBlockLayer; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -51,6 +55,13 @@ public class BlockBeacon extends BlockContainer { public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, EnumFacing var5, float var6, float var7, float var8) { + if (!world.isRemote) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityBeacon) { + entityplayer.displayGUIChest((TileEntityBeacon) tileentity); + entityplayer.triggerAchievement(StatList.field_181730_N); + } + } return true; } @@ -106,4 +117,27 @@ public class BlockBeacon extends BlockContainer { 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/minecraft/block/BlockBed.java b/src/main/java/net/minecraft/block/BlockBed.java index d98ae6aa..1e54be7e 100755 --- a/src/main/java/net/minecraft/block/BlockBed.java +++ b/src/main/java/net/minecraft/block/BlockBed.java @@ -8,15 +8,19 @@ import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.server.MinecraftServer; import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumWorldBlockLayer; import net.minecraft.util.IStringSerializable; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -55,7 +59,83 @@ public class BlockBed extends BlockDirectional { public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer, EnumFacing var5, float var6, float var7, float var8) { - return true; + if (world.isRemote) { + return true; + } else { + 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() { @@ -85,6 +165,9 @@ public class BlockBed extends BlockDirectional { } } else if (world.getBlockState(blockpos.offset(enumfacing)).getBlock() != this) { world.setBlockToAir(blockpos); + if (!world.isRemote) { + this.dropBlockAsItem(world, blockpos, iblockstate, 0); + } } } diff --git a/src/main/java/net/minecraft/block/BlockBrewingStand.java b/src/main/java/net/minecraft/block/BlockBrewingStand.java index 366e2234..2a4d3fae 100755 --- a/src/main/java/net/minecraft/block/BlockBrewingStand.java +++ b/src/main/java/net/minecraft/block/BlockBrewingStand.java @@ -16,6 +16,7 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityBrewingStand; import net.minecraft.util.AxisAlignedBB; @@ -114,6 +115,13 @@ public class BlockBrewingStand extends BlockContainer { public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, EnumFacing var5, float var6, float var7, float var8) { + if (!world.isRemote) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityBrewingStand) { + entityplayer.displayGUIChest((TileEntityBrewingStand) tileentity); + entityplayer.triggerAchievement(StatList.field_181729_M); + } + } return true; } diff --git a/src/main/java/net/minecraft/block/BlockButton.java b/src/main/java/net/minecraft/block/BlockButton.java index b84c1e14..a5cd1dbc 100755 --- a/src/main/java/net/minecraft/block/BlockButton.java +++ b/src/main/java/net/minecraft/block/BlockButton.java @@ -1,5 +1,7 @@ package net.minecraft.block; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyBool; @@ -7,8 +9,10 @@ import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; @@ -203,6 +207,29 @@ public abstract class BlockButton extends Block { 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 (!world.isRemote) { + 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 */ @@ -213,6 +240,49 @@ public abstract class BlockButton extends Block { 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 (!world.isRemote) { + 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); diff --git a/src/main/java/net/minecraft/block/BlockCarpet.java b/src/main/java/net/minecraft/block/BlockCarpet.java index ff9b8290..41902e35 100755 --- a/src/main/java/net/minecraft/block/BlockCarpet.java +++ b/src/main/java/net/minecraft/block/BlockCarpet.java @@ -9,9 +9,12 @@ import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.server.MinecraftServer; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.IBlockAccess; @@ -153,4 +156,18 @@ public class BlockCarpet extends Block { 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 (!world.isRemote && 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/minecraft/block/BlockCauldron.java b/src/main/java/net/minecraft/block/BlockCauldron.java index 998a29a3..24fde302 100755 --- a/src/main/java/net/minecraft/block/BlockCauldron.java +++ b/src/main/java/net/minecraft/block/BlockCauldron.java @@ -10,9 +10,16 @@ import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemBanner; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntityBanner; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; @@ -86,9 +93,109 @@ public class BlockCauldron extends Block { 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 (!world.isRemote && 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) { - return true; + if (!world.isRemote) { + 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; + } + } + } + } else { + return true; + } } public void setWaterLevel(World worldIn, BlockPos pos, IBlockState state, int level) { diff --git a/src/main/java/net/minecraft/block/BlockChest.java b/src/main/java/net/minecraft/block/BlockChest.java index 5caa1595..feeec8fc 100755 --- a/src/main/java/net/minecraft/block/BlockChest.java +++ b/src/main/java/net/minecraft/block/BlockChest.java @@ -15,6 +15,7 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryHelper; import net.minecraft.inventory.InventoryLargeChest; import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.AxisAlignedBB; @@ -165,6 +166,75 @@ public class BlockChest extends BlockContainer { } public IBlockState checkForSurroundingChests(World worldIn, BlockPos pos, IBlockState state) { + if (!worldIn.isRemote) { + 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; } @@ -286,7 +356,19 @@ public class BlockChest extends BlockContainer { public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, EnumFacing var5, float var6, float var7, float var8) { - return true; + { + 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) { diff --git a/src/main/java/net/minecraft/block/BlockCommandBlock.java b/src/main/java/net/minecraft/block/BlockCommandBlock.java index 981c98fd..9b1de4d0 100755 --- a/src/main/java/net/minecraft/block/BlockCommandBlock.java +++ b/src/main/java/net/minecraft/block/BlockCommandBlock.java @@ -54,6 +54,22 @@ public class BlockCommandBlock extends BlockContainer { return new TileEntityCommandBlock(); } + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + if (!world.isRemote) { + 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) { @@ -102,6 +118,9 @@ public class BlockCommandBlock extends BlockContainer { commandblocklogic.setName(itemstack.getDisplayName()); } + if (!world.isRemote) { + commandblocklogic.setTrackOutput(world.getGameRules().getBoolean("sendCommandFeedback")); + } } } diff --git a/src/main/java/net/minecraft/block/BlockCrops.java b/src/main/java/net/minecraft/block/BlockCrops.java index f943aec1..fed0ab42 100755 --- a/src/main/java/net/minecraft/block/BlockCrops.java +++ b/src/main/java/net/minecraft/block/BlockCrops.java @@ -10,6 +10,7 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.MathHelper; import net.minecraft.world.World; @@ -137,6 +138,25 @@ public class BlockCrops extends BlockBush implements IGrowable { 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); + if (!world.isRemote) { + 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. */ diff --git a/src/main/java/net/minecraft/block/BlockDaylightDetector.java b/src/main/java/net/minecraft/block/BlockDaylightDetector.java index 56bcb331..4b0d8ba0 100755 --- a/src/main/java/net/minecraft/block/BlockDaylightDetector.java +++ b/src/main/java/net/minecraft/block/BlockDaylightDetector.java @@ -88,6 +88,18 @@ public class BlockDaylightDetector extends BlockContainer { public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer, EnumFacing enumfacing, float f, float f1, float f2) { if (entityplayer.isAllowEdit()) { + if (!world.isRemote) { + 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); diff --git a/src/main/java/net/minecraft/block/BlockDeadBush.java b/src/main/java/net/minecraft/block/BlockDeadBush.java index 138f8fbc..8727792e 100755 --- a/src/main/java/net/minecraft/block/BlockDeadBush.java +++ b/src/main/java/net/minecraft/block/BlockDeadBush.java @@ -5,8 +5,13 @@ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.world.World; @@ -67,4 +72,15 @@ public class BlockDeadBush extends BlockBush { return null; } + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, + TileEntity tileentity) { + if (!world.isRemote && 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/minecraft/block/BlockDispenser.java b/src/main/java/net/minecraft/block/BlockDispenser.java index 90abe795..934f7611 100755 --- a/src/main/java/net/minecraft/block/BlockDispenser.java +++ b/src/main/java/net/minecraft/block/BlockDispenser.java @@ -20,8 +20,10 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntityDropper; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.RegistryDefaulted; @@ -68,8 +70,48 @@ public class BlockDispenser extends BlockContainer { 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) { + if (!worldIn.isRemote) { + 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) { + if (!world.isRemote) { + 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; } @@ -111,6 +153,12 @@ public class BlockDispenser extends BlockContainer { } + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom var4) { + if (!world.isRemote) { + this.dispense(world, blockpos); + } + } + /**+ * Returns a new instance of a block's tile entity class. Called * on placing the block. diff --git a/src/main/java/net/minecraft/block/BlockDoor.java b/src/main/java/net/minecraft/block/BlockDoor.java index 78b3327f..0a6e868e 100755 --- a/src/main/java/net/minecraft/block/BlockDoor.java +++ b/src/main/java/net/minecraft/block/BlockDoor.java @@ -209,7 +209,11 @@ public class BlockDoor extends Block { } } - if (!flag1) { + if (flag1) { + if (!world.isRemote) { + 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()) { diff --git a/src/main/java/net/minecraft/block/BlockDoublePlant.java b/src/main/java/net/minecraft/block/BlockDoublePlant.java index 0a6af7d1..3f64527d 100755 --- a/src/main/java/net/minecraft/block/BlockDoublePlant.java +++ b/src/main/java/net/minecraft/block/BlockDoublePlant.java @@ -15,6 +15,8 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.IStringSerializable; @@ -180,6 +182,16 @@ public class BlockDoublePlant extends BlockBush implements IGrowable { this.getDefaultState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.UPPER), 2); } + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, + TileEntity tileentity) { + if (world.isRemote || 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) { @@ -190,6 +202,14 @@ public class BlockDoublePlant extends BlockBush implements IGrowable { if (blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.FERN && blockdoubleplant$enumplanttype != BlockDoublePlant.EnumPlantType.GRASS) { world.destroyBlock(blockpos.down(), true); + } else if (!world.isRemote) { + 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()); } @@ -204,6 +224,22 @@ public class BlockDoublePlant extends BlockBush implements IGrowable { 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) diff --git a/src/main/java/net/minecraft/block/BlockDragonEgg.java b/src/main/java/net/minecraft/block/BlockDragonEgg.java index 4f59f763..6d887490 100755 --- a/src/main/java/net/minecraft/block/BlockDragonEgg.java +++ b/src/main/java/net/minecraft/block/BlockDragonEgg.java @@ -96,20 +96,26 @@ public class BlockDragonEgg extends Block { worldIn.rand.nextInt(8) - worldIn.rand.nextInt(8), worldIn.rand.nextInt(16) - worldIn.rand.nextInt(16)); if (worldIn.getBlockState(blockpos).getBlock().blockMaterial == Material.air) { - for (int j = 0; j < 128; ++j) { - double d0 = worldIn.rand.nextDouble(); - float f = (worldIn.rand.nextFloat() - 0.5F) * 0.2F; - float f1 = (worldIn.rand.nextFloat() - 0.5F) * 0.2F; - float f2 = (worldIn.rand.nextFloat() - 0.5F) * 0.2F; - double d1 = (double) blockpos.getX() + (double) (pos.getX() - blockpos.getX()) * d0 - + (worldIn.rand.nextDouble() - 0.5D) * 1.0D + 0.5D; - double d2 = (double) blockpos.getY() + (double) (pos.getY() - blockpos.getY()) * d0 - + worldIn.rand.nextDouble() * 1.0D - 0.5D; - double d3 = (double) blockpos.getZ() + (double) (pos.getZ() - blockpos.getZ()) * d0 - + (worldIn.rand.nextDouble() - 0.5D) * 1.0D + 0.5D; - worldIn.spawnParticle(EnumParticleTypes.PORTAL, d1, d2, d3, (double) f, (double) f1, - (double) f2, new int[0]); + if (worldIn.isRemote) { + for (int j = 0; j < 128; ++j) { + double d0 = worldIn.rand.nextDouble(); + float f = (worldIn.rand.nextFloat() - 0.5F) * 0.2F; + float f1 = (worldIn.rand.nextFloat() - 0.5F) * 0.2F; + float f2 = (worldIn.rand.nextFloat() - 0.5F) * 0.2F; + double d1 = (double) blockpos.getX() + (double) (pos.getX() - blockpos.getX()) * d0 + + (worldIn.rand.nextDouble() - 0.5D) * 1.0D + 0.5D; + double d2 = (double) blockpos.getY() + (double) (pos.getY() - blockpos.getY()) * d0 + + worldIn.rand.nextDouble() * 1.0D - 0.5D; + double d3 = (double) blockpos.getZ() + (double) (pos.getZ() - blockpos.getZ()) * d0 + + (worldIn.rand.nextDouble() - 0.5D) * 1.0D + 0.5D; + worldIn.spawnParticle(EnumParticleTypes.PORTAL, d1, d2, d3, (double) f, (double) f1, + (double) f2, new int[0]); + } + } else { + worldIn.setBlockState(blockpos, iblockstate, 2); + worldIn.setBlockToAir(pos); } + return; } } diff --git a/src/main/java/net/minecraft/block/BlockEnchantmentTable.java b/src/main/java/net/minecraft/block/BlockEnchantmentTable.java index f0e82b5e..8f89ec4d 100755 --- a/src/main/java/net/minecraft/block/BlockEnchantmentTable.java +++ b/src/main/java/net/minecraft/block/BlockEnchantmentTable.java @@ -105,6 +105,12 @@ public class BlockEnchantmentTable extends BlockContainer { public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, EnumFacing var5, float var6, float var7, float var8) { + if (!world.isRemote) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityEnchantmentTable) { + entityplayer.displayGui((TileEntityEnchantmentTable) tileentity); + } + } return true; } diff --git a/src/main/java/net/minecraft/block/BlockEndPortal.java b/src/main/java/net/minecraft/block/BlockEndPortal.java index 075c056e..9b1d06f5 100755 --- a/src/main/java/net/minecraft/block/BlockEndPortal.java +++ b/src/main/java/net/minecraft/block/BlockEndPortal.java @@ -87,6 +87,16 @@ public class BlockEndPortal extends BlockContainer { 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 && !world.isRemote) { + 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); diff --git a/src/main/java/net/minecraft/block/BlockEnderChest.java b/src/main/java/net/minecraft/block/BlockEnderChest.java index e46f1e12..76ca86e5 100755 --- a/src/main/java/net/minecraft/block/BlockEnderChest.java +++ b/src/main/java/net/minecraft/block/BlockEnderChest.java @@ -11,8 +11,10 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.inventory.InventoryEnderChest; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityEnderChest; import net.minecraft.util.BlockPos; @@ -109,7 +111,22 @@ public class BlockEnderChest extends BlockContainer { public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, EnumFacing var5, float var6, float var7, float var8) { - return true; + 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 if (world.isRemote) { + return true; + } else { + inventoryenderchest.setChestTileEntity((TileEntityEnderChest) tileentity); + entityplayer.displayGUIChest(inventoryenderchest); + entityplayer.triggerAchievement(StatList.field_181738_V); + return true; + } + } else { + return true; + } } /**+ diff --git a/src/main/java/net/minecraft/block/BlockFalling.java b/src/main/java/net/minecraft/block/BlockFalling.java index f52a05f6..8f80daa6 100755 --- a/src/main/java/net/minecraft/block/BlockFalling.java +++ b/src/main/java/net/minecraft/block/BlockFalling.java @@ -1,5 +1,6 @@ package net.minecraft.block; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; @@ -51,6 +52,37 @@ public class BlockFalling extends Block { world.scheduleUpdate(blockpos, this, this.tickRate(world)); } + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom var4) { + if (!world.isRemote) { + 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) { } diff --git a/src/main/java/net/minecraft/block/BlockFarmland.java b/src/main/java/net/minecraft/block/BlockFarmland.java index 981f3cdc..e5036e2a 100755 --- a/src/main/java/net/minecraft/block/BlockFarmland.java +++ b/src/main/java/net/minecraft/block/BlockFarmland.java @@ -9,6 +9,7 @@ import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.util.AxisAlignedBB; @@ -84,6 +85,14 @@ public class BlockFarmland extends Block { */ public void onFallenUpon(World world, BlockPos blockpos, Entity entity, float f) { if (entity instanceof EntityLivingBase) { + if (!world.isRemote && 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); } } diff --git a/src/main/java/net/minecraft/block/BlockFence.java b/src/main/java/net/minecraft/block/BlockFence.java index e2385825..f9b42448 100755 --- a/src/main/java/net/minecraft/block/BlockFence.java +++ b/src/main/java/net/minecraft/block/BlockFence.java @@ -12,6 +12,7 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.item.ItemLead; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; @@ -182,7 +183,7 @@ public class BlockFence extends Block { public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, EnumFacing var5, float var6, float var7, float var8) { - return true; + return world.isRemote ? true : ItemLead.attachToFence(entityplayer, world, blockpos); } /**+ diff --git a/src/main/java/net/minecraft/block/BlockFenceGate.java b/src/main/java/net/minecraft/block/BlockFenceGate.java index 26ea8468..12f25461 100755 --- a/src/main/java/net/minecraft/block/BlockFenceGate.java +++ b/src/main/java/net/minecraft/block/BlockFenceGate.java @@ -145,6 +145,30 @@ public class BlockFenceGate extends BlockDirectional { return true; } + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + if (!world.isRemote) { + 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; } diff --git a/src/main/java/net/minecraft/block/BlockFurnace.java b/src/main/java/net/minecraft/block/BlockFurnace.java index 1f69d45d..35821986 100755 --- a/src/main/java/net/minecraft/block/BlockFurnace.java +++ b/src/main/java/net/minecraft/block/BlockFurnace.java @@ -14,6 +14,7 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.BlockPos; @@ -59,6 +60,31 @@ public class BlockFurnace extends BlockContainer { 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) { + if (!worldIn.isRemote) { + 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); @@ -90,7 +116,17 @@ public class BlockFurnace extends BlockContainer { public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, EnumFacing var5, float var6, float var7, float var8) { - return true; + if (world.isRemote) { + return true; + } else { + 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) { diff --git a/src/main/java/net/minecraft/block/BlockGrass.java b/src/main/java/net/minecraft/block/BlockGrass.java index 505a042d..b6447a72 100755 --- a/src/main/java/net/minecraft/block/BlockGrass.java +++ b/src/main/java/net/minecraft/block/BlockGrass.java @@ -69,6 +69,29 @@ public class BlockGrass extends Block implements IGrowable { return BiomeColorHelper.getGrassColorAtPos(iblockaccess, blockpos); } + public void updateTick(World world, BlockPos blockpos, IBlockState var3, EaglercraftRandom random) { + if (!world.isRemote) { + 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. */ diff --git a/src/main/java/net/minecraft/block/BlockHopper.java b/src/main/java/net/minecraft/block/BlockHopper.java index e395303a..4874da92 100755 --- a/src/main/java/net/minecraft/block/BlockHopper.java +++ b/src/main/java/net/minecraft/block/BlockHopper.java @@ -18,6 +18,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityHopper; import net.minecraft.util.AxisAlignedBB; @@ -131,7 +132,17 @@ public class BlockHopper extends BlockContainer { public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, EnumFacing var5, float var6, float var7, float var8) { - return true; + if (world.isRemote) { + return true; + } else { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityHopper) { + entityplayer.displayGUIChest((TileEntityHopper) tileentity); + entityplayer.triggerAchievement(StatList.field_181732_P); + } + + return true; + } } /**+ diff --git a/src/main/java/net/minecraft/block/BlockJukebox.java b/src/main/java/net/minecraft/block/BlockJukebox.java index 4b803587..d31df2d4 100755 --- a/src/main/java/net/minecraft/block/BlockJukebox.java +++ b/src/main/java/net/minecraft/block/BlockJukebox.java @@ -7,6 +7,7 @@ import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; @@ -49,6 +50,7 @@ public class BlockJukebox extends BlockContainer { 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; @@ -58,7 +60,52 @@ public class BlockJukebox extends BlockContainer { } public void insertRecord(World worldIn, BlockPos pos, IBlockState state, ItemStack recordStack) { + if (!worldIn.isRemote) { + 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) { + if (!worldIn.isRemote) { + 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) { + if (!world.isRemote) { + super.dropBlockAsItemWithChance(world, blockpos, iblockstate, f, 0); + } } /**+ diff --git a/src/main/java/net/minecraft/block/BlockLeaves.java b/src/main/java/net/minecraft/block/BlockLeaves.java index 223017d3..0682d66f 100755 --- a/src/main/java/net/minecraft/block/BlockLeaves.java +++ b/src/main/java/net/minecraft/block/BlockLeaves.java @@ -8,6 +8,7 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.EnumWorldBlockLayer; @@ -88,6 +89,89 @@ public abstract class BlockLeaves extends BlockLeavesBase { } + public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) { + if (!world.isRemote) { + 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) { @@ -118,6 +202,36 @@ public abstract class BlockLeaves extends BlockLeavesBase { 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) { + if (!world.isRemote) { + 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) { } diff --git a/src/main/java/net/minecraft/block/BlockLever.java b/src/main/java/net/minecraft/block/BlockLever.java index 34299692..777cfbdc 100755 --- a/src/main/java/net/minecraft/block/BlockLever.java +++ b/src/main/java/net/minecraft/block/BlockLever.java @@ -186,7 +186,19 @@ public class BlockLever extends Block { public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer var4, EnumFacing var5, float var6, float var7, float var8) { - return true; + if (world.isRemote) { + return true; + } else { + 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) { diff --git a/src/main/java/net/minecraft/block/BlockMushroom.java b/src/main/java/net/minecraft/block/BlockMushroom.java index d23ed36c..95dcb1d0 100755 --- a/src/main/java/net/minecraft/block/BlockMushroom.java +++ b/src/main/java/net/minecraft/block/BlockMushroom.java @@ -6,6 +6,7 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenBigMushroom; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -90,6 +91,23 @@ public class BlockMushroom extends BlockBush implements IGrowable { } } + 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 */ @@ -100,4 +118,8 @@ public class BlockMushroom extends BlockBush implements IGrowable { 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/minecraft/block/BlockMycelium.java b/src/main/java/net/minecraft/block/BlockMycelium.java index a17bfcbf..c2f6a3de 100755 --- a/src/main/java/net/minecraft/block/BlockMycelium.java +++ b/src/main/java/net/minecraft/block/BlockMycelium.java @@ -56,6 +56,30 @@ public class BlockMycelium extends Block { 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.isRemote) { + 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) { diff --git a/src/main/java/net/minecraft/block/BlockNetherWart.java b/src/main/java/net/minecraft/block/BlockNetherWart.java index 00a620a3..bd2df534 100755 --- a/src/main/java/net/minecraft/block/BlockNetherWart.java +++ b/src/main/java/net/minecraft/block/BlockNetherWart.java @@ -12,6 +12,7 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.world.World; @@ -68,6 +69,25 @@ public class BlockNetherWart extends BlockBush { 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) { + if (!world.isRemote) { + 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. */ diff --git a/src/main/java/net/minecraft/block/BlockNewLeaf.java b/src/main/java/net/minecraft/block/BlockNewLeaf.java index 7d53c410..c39a36c8 100755 --- a/src/main/java/net/minecraft/block/BlockNewLeaf.java +++ b/src/main/java/net/minecraft/block/BlockNewLeaf.java @@ -9,9 +9,12 @@ import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.world.World; @@ -55,7 +58,6 @@ public class BlockNewLeaf extends BlockLeaves { if (iblockstate.getValue(VARIANT) == BlockPlanks.EnumType.DARK_OAK && world.rand.nextInt(i) == 0) { spawnAsEntity(world, blockpos, new ItemStack(Items.apple, 1, 0)); } - } /**+ @@ -121,4 +123,15 @@ public class BlockNewLeaf extends BlockLeaves { return new BlockState(this, new IProperty[] { VARIANT, CHECK_DECAY, DECAYABLE }); } + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, + TileEntity tileentity) { + if (!world.isRemote && 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/minecraft/block/BlockNote.java b/src/main/java/net/minecraft/block/BlockNote.java index 0d382de0..00886e87 100755 --- a/src/main/java/net/minecraft/block/BlockNote.java +++ b/src/main/java/net/minecraft/block/BlockNote.java @@ -8,6 +8,7 @@ import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.stats.StatList; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityNote; import net.minecraft.util.BlockPos; @@ -65,7 +66,29 @@ public class BlockNote extends BlockContainer { public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, EnumFacing var5, float var6, float var7, float var8) { - return true; + if (world.isRemote) { + return true; + } else { + 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) { + if (!world.isRemote) { + TileEntity tileentity = world.getTileEntity(blockpos); + if (tileentity instanceof TileEntityNote) { + ((TileEntityNote) tileentity).triggerNote(world, blockpos); + entityplayer.triggerAchievement(StatList.field_181734_R); + } + } } /**+ diff --git a/src/main/java/net/minecraft/block/BlockOldLeaf.java b/src/main/java/net/minecraft/block/BlockOldLeaf.java index 6fac616c..3634f38a 100755 --- a/src/main/java/net/minecraft/block/BlockOldLeaf.java +++ b/src/main/java/net/minecraft/block/BlockOldLeaf.java @@ -9,9 +9,12 @@ import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.world.ColorizerFoliage; import net.minecraft.world.IBlockAccess; @@ -152,4 +155,15 @@ public class BlockOldLeaf extends BlockLeaves { return ((BlockPlanks.EnumType) iblockstate.getValue(VARIANT)).getMetadata(); } + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, + TileEntity tileentity) { + if (!world.isRemote && 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/minecraft/block/BlockPistonBase.java b/src/main/java/net/minecraft/block/BlockPistonBase.java index 307096ec..4737d239 100755 --- a/src/main/java/net/minecraft/block/BlockPistonBase.java +++ b/src/main/java/net/minecraft/block/BlockPistonBase.java @@ -74,6 +74,27 @@ public class BlockPistonBase extends Block { EntityLivingBase entitylivingbase, ItemStack var5) { world.setBlockState(blockpos, iblockstate.withProperty(FACING, getFacingFromEntity(world, blockpos, entitylivingbase)), 2); + if (!world.isRemote) { + this.checkForMove(world, blockpos, iblockstate); + } + + } + + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + if (!world.isRemote) { + this.checkForMove(world, blockpos, iblockstate); + } + + } + + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + if (!world.isRemote && world.getTileEntity(blockpos) == null) { + this.checkForMove(world, blockpos, iblockstate); + } + } /**+ @@ -129,6 +150,18 @@ public class BlockPistonBase extends Block { */ public boolean onBlockEventReceived(World world, BlockPos blockpos, IBlockState iblockstate, int i, int j) { EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); + if (!world.isRemote) { + 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; diff --git a/src/main/java/net/minecraft/block/BlockPistonMoving.java b/src/main/java/net/minecraft/block/BlockPistonMoving.java index bfa8f11a..bdf1f057 100755 --- a/src/main/java/net/minecraft/block/BlockPistonMoving.java +++ b/src/main/java/net/minecraft/block/BlockPistonMoving.java @@ -8,6 +8,7 @@ import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; @@ -114,6 +115,16 @@ public class BlockPistonMoving extends BlockContainer { return false; } + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer var4, + EnumFacing var5, float var6, float var7, float var8) { + if (!world.isRemote && world.getTileEntity(blockpos) == null) { + world.setBlockToAir(blockpos); + return true; + } else { + return false; + } + } + /**+ * Get the Item that this Block should drop when harvested. */ @@ -121,6 +132,19 @@ public class BlockPistonMoving extends BlockContainer { 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) { + if (!world.isRemote) { + 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. @@ -129,6 +153,15 @@ public class BlockPistonMoving extends BlockContainer { return null; } + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState var3, Block var4) { + if (!world.isRemote) { + world.getTileEntity(blockpos); + } + } + public AxisAlignedBB getCollisionBoundingBox(World world, BlockPos blockpos, IBlockState var3) { TileEntityPiston tileentitypiston = this.getTileEntity(world, blockpos); if (tileentitypiston == null) { diff --git a/src/main/java/net/minecraft/block/BlockPotato.java b/src/main/java/net/minecraft/block/BlockPotato.java index d0e545ee..b6ebed95 100755 --- a/src/main/java/net/minecraft/block/BlockPotato.java +++ b/src/main/java/net/minecraft/block/BlockPotato.java @@ -1,7 +1,11 @@ package net.minecraft.block; +import net.minecraft.block.state.IBlockState; import net.minecraft.init.Items; import net.minecraft.item.Item; +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. @@ -32,4 +36,15 @@ public class BlockPotato extends BlockCrops { 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 (!world.isRemote) { + 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/minecraft/block/BlockRailBase.java b/src/main/java/net/minecraft/block/BlockRailBase.java index f17ccf49..332a836b 100755 --- a/src/main/java/net/minecraft/block/BlockRailBase.java +++ b/src/main/java/net/minecraft/block/BlockRailBase.java @@ -101,12 +101,58 @@ public abstract class BlockRailBase extends Block { return World.doesBlockHaveSolidTopSurface(world, blockpos.down()); } + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { + if (!worldIn.isRemote) { + 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) { + if (!world.isRemote) { + 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 parIBlockState; + return worldIn.isRemote ? parIBlockState + : (new BlockRailBase.Rail(worldIn, parBlockPos, parIBlockState)) + .func_180364_a(worldIn.isBlockPowered(parBlockPos), parFlag).getBlockState(); } public int getMobilityFlag() { diff --git a/src/main/java/net/minecraft/block/BlockRailDetector.java b/src/main/java/net/minecraft/block/BlockRailDetector.java index 2c6fd117..431af123 100755 --- a/src/main/java/net/minecraft/block/BlockRailDetector.java +++ b/src/main/java/net/minecraft/block/BlockRailDetector.java @@ -4,6 +4,7 @@ import java.util.List; import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyEnum; @@ -42,6 +43,7 @@ import net.minecraft.world.World; * */ public class BlockRailDetector extends BlockRailBase { + public static PropertyEnum SHAPE; public static final PropertyBool POWERED = PropertyBool.create("powered"); @@ -79,6 +81,30 @@ public class BlockRailDetector extends BlockRailBase { return true; } + /**+ + * Called When an Entity Collided with the Block + */ + public void onEntityCollidedWithBlock(World world, BlockPos blockpos, IBlockState iblockstate, Entity var4) { + if (!world.isRemote) { + 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 (!world.isRemote && ((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; } diff --git a/src/main/java/net/minecraft/block/BlockRedstoneLight.java b/src/main/java/net/minecraft/block/BlockRedstoneLight.java index 3aed25a2..041eee05 100755 --- a/src/main/java/net/minecraft/block/BlockRedstoneLight.java +++ b/src/main/java/net/minecraft/block/BlockRedstoneLight.java @@ -42,6 +42,37 @@ public class BlockRedstoneLight extends Block { } + public void onBlockAdded(World world, BlockPos blockpos, IBlockState var3) { + if (!world.isRemote) { + 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 (!world.isRemote) { + 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 (!world.isRemote) { + if (this.isOn && !world.isBlockPowered(blockpos)) { + world.setBlockState(blockpos, Blocks.redstone_lamp.getDefaultState(), 2); + } + } + } + /**+ * Get the Item that this Block should drop when harvested. */ diff --git a/src/main/java/net/minecraft/block/BlockRedstoneWire.java b/src/main/java/net/minecraft/block/BlockRedstoneWire.java index 5c6bd3a8..8270571e 100755 --- a/src/main/java/net/minecraft/block/BlockRedstoneWire.java +++ b/src/main/java/net/minecraft/block/BlockRedstoneWire.java @@ -224,6 +224,53 @@ public class BlockRedstoneWire extends Block { } } + public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) { + if (!world.isRemote) { + 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); + if (!world.isRemote) { + 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; @@ -233,6 +280,20 @@ public class BlockRedstoneWire extends Block { } } + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + if (!world.isRemote) { + 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. */ diff --git a/src/main/java/net/minecraft/block/BlockSapling.java b/src/main/java/net/minecraft/block/BlockSapling.java index 8df08512..a8af96cc 100755 --- a/src/main/java/net/minecraft/block/BlockSapling.java +++ b/src/main/java/net/minecraft/block/BlockSapling.java @@ -9,11 +9,21 @@ import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenBigTree; +import net.minecraft.world.gen.feature.WorldGenCanopyTree; +import net.minecraft.world.gen.feature.WorldGenForest; +import net.minecraft.world.gen.feature.WorldGenMegaJungle; +import net.minecraft.world.gen.feature.WorldGenMegaPineTree; +import net.minecraft.world.gen.feature.WorldGenSavannaTree; +import net.minecraft.world.gen.feature.WorldGenTaiga2; +import net.minecraft.world.gen.feature.WorldGenTrees; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -61,6 +71,113 @@ public class BlockSapling extends BlockBush implements IGrowable { } public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) { + if (!world.isRemote) { + 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, @@ -112,6 +229,10 @@ public class BlockSapling extends BlockBush implements IGrowable { 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 */ diff --git a/src/main/java/net/minecraft/block/BlockSign.java b/src/main/java/net/minecraft/block/BlockSign.java index be051671..d5498ac7 100755 --- a/src/main/java/net/minecraft/block/BlockSign.java +++ b/src/main/java/net/minecraft/block/BlockSign.java @@ -93,7 +93,13 @@ public class BlockSign extends BlockContainer { public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, EnumFacing var5, float var6, float var7, float var8) { - return true; + if (world.isRemote) { + return true; + } else { + TileEntity tileentity = world.getTileEntity(blockpos); + return tileentity instanceof TileEntitySign ? ((TileEntitySign) tileentity).executeCommand(entityplayer) + : false; + } } public boolean canPlaceBlockAt(World world, BlockPos blockpos) { diff --git a/src/main/java/net/minecraft/block/BlockSilverfish.java b/src/main/java/net/minecraft/block/BlockSilverfish.java index 48d23542..0a3f10bd 100755 --- a/src/main/java/net/minecraft/block/BlockSilverfish.java +++ b/src/main/java/net/minecraft/block/BlockSilverfish.java @@ -9,6 +9,7 @@ import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.monster.EntitySilverfish; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -80,6 +81,20 @@ public class BlockSilverfish extends Block { } } + /**+ + * 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.isRemote && 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); diff --git a/src/main/java/net/minecraft/block/BlockSkull.java b/src/main/java/net/minecraft/block/BlockSkull.java index b3e3d483..b3ddc9ff 100755 --- a/src/main/java/net/minecraft/block/BlockSkull.java +++ b/src/main/java/net/minecraft/block/BlockSkull.java @@ -15,17 +15,23 @@ import net.minecraft.block.state.pattern.BlockPattern; import net.minecraft.block.state.pattern.BlockStateHelper; import net.minecraft.block.state.pattern.FactoryBlockPattern; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.EntityWither; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.stats.AchievementList; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntitySkull; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.StatCollector; +import net.minecraft.world.EnumDifficulty; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -159,7 +165,25 @@ public class BlockSkull extends BlockContainer { } public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) { + if (!world.isRemote) { + 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); + } } /**+ @@ -170,11 +194,63 @@ public class BlockSkull extends BlockContainer { } public boolean canDispenserPlace(World worldIn, BlockPos pos, ItemStack stack) { - return false; + return stack.getMetadata() == 1 && pos.getY() >= 2 && worldIn.getDifficulty() != EnumDifficulty.PEACEFUL + && !worldIn.isRemote ? this.getWitherBasePattern().match(worldIn, pos) != null : false; } public void checkWitherSpawn(World worldIn, BlockPos pos, TileEntitySkull te) { + if (te.getSkullType() == 1 && pos.getY() >= 2 && worldIn.getDifficulty() != EnumDifficulty.PEACEFUL + && !worldIn.isRemote) { + 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); + } + } + + } + } } /**+ diff --git a/src/main/java/net/minecraft/block/BlockSlab.java b/src/main/java/net/minecraft/block/BlockSlab.java index d7f1fb2a..83220663 100755 --- a/src/main/java/net/minecraft/block/BlockSlab.java +++ b/src/main/java/net/minecraft/block/BlockSlab.java @@ -9,8 +9,11 @@ import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.server.MinecraftServer; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; @@ -188,4 +191,17 @@ public abstract class BlockSlab extends Block { return this.name; } } + + public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, + EnumFacing var5, float var6, float var7, float var8) { + if (!world.isRemote && 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/minecraft/block/BlockStainedGlass.java b/src/main/java/net/minecraft/block/BlockStainedGlass.java index 4ddfe330..c4369022 100755 --- a/src/main/java/net/minecraft/block/BlockStainedGlass.java +++ b/src/main/java/net/minecraft/block/BlockStainedGlass.java @@ -102,11 +102,15 @@ public class BlockStainedGlass extends BlockBreakable { } public void onBlockAdded(World world, BlockPos blockpos, IBlockState var3) { - + if (!world.isRemote) { + BlockBeacon.updateColorAsync(world, blockpos); + } } public void breakBlock(World world, BlockPos blockpos, IBlockState var3) { - + if (!world.isRemote) { + BlockBeacon.updateColorAsync(world, blockpos); + } } /**+ diff --git a/src/main/java/net/minecraft/block/BlockStainedGlassPane.java b/src/main/java/net/minecraft/block/BlockStainedGlassPane.java index 36f92dc4..2a2c4f28 100755 --- a/src/main/java/net/minecraft/block/BlockStainedGlassPane.java +++ b/src/main/java/net/minecraft/block/BlockStainedGlassPane.java @@ -99,10 +99,14 @@ public class BlockStainedGlassPane extends BlockPane { } public void onBlockAdded(World world, BlockPos blockpos, IBlockState var3) { - + if (!world.isRemote) { + BlockBeacon.updateColorAsync(world, blockpos); + } } public void breakBlock(World world, BlockPos blockpos, IBlockState var3) { - + if (!world.isRemote) { + BlockBeacon.updateColorAsync(world, blockpos); + } } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/block/BlockStairs.java b/src/main/java/net/minecraft/block/BlockStairs.java index 804966ee..a14b9447 100755 --- a/src/main/java/net/minecraft/block/BlockStairs.java +++ b/src/main/java/net/minecraft/block/BlockStairs.java @@ -14,7 +14,9 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Blocks; +import net.minecraft.server.MinecraftServer; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; @@ -526,6 +528,14 @@ public class BlockStairs extends Block { public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, EnumFacing var5, float var6, float var7, float var8) { + if (!world.isRemote && 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); } diff --git a/src/main/java/net/minecraft/block/BlockStem.java b/src/main/java/net/minecraft/block/BlockStem.java index 095b0483..8e6f2bc6 100755 --- a/src/main/java/net/minecraft/block/BlockStem.java +++ b/src/main/java/net/minecraft/block/BlockStem.java @@ -14,6 +14,7 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.MathHelper; @@ -148,6 +149,26 @@ public class BlockStem extends BlockBush implements IGrowable { 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); + if (!world.isRemote) { + 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); diff --git a/src/main/java/net/minecraft/block/BlockTNT.java b/src/main/java/net/minecraft/block/BlockTNT.java index 2a4faed4..e2088d14 100755 --- a/src/main/java/net/minecraft/block/BlockTNT.java +++ b/src/main/java/net/minecraft/block/BlockTNT.java @@ -6,8 +6,11 @@ import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityTNTPrimed; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.util.BlockPos; @@ -64,6 +67,19 @@ public class BlockTNT extends Block { } + /**+ + * Called when this Block is destroyed by an Explosion + */ + public void onBlockDestroyedByExplosion(World world, BlockPos blockpos, Explosion explosion) { + if (!world.isRemote) { + 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 */ @@ -72,7 +88,14 @@ public class BlockTNT extends Block { } public void explode(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase igniter) { - + if (!worldIn.isRemote) { + 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, @@ -95,6 +118,24 @@ public class BlockTNT extends Block { 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 (!world.isRemote && 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. */ diff --git a/src/main/java/net/minecraft/block/BlockTallGrass.java b/src/main/java/net/minecraft/block/BlockTallGrass.java index 8637b51c..494a343a 100755 --- a/src/main/java/net/minecraft/block/BlockTallGrass.java +++ b/src/main/java/net/minecraft/block/BlockTallGrass.java @@ -9,10 +9,13 @@ import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.IStringSerializable; import net.minecraft.world.ColorizerGrass; @@ -97,6 +100,19 @@ public class BlockTallGrass extends BlockBush implements IGrowable { return 1 + random.nextInt(i * 2 + 1); } + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, + TileEntity tileentity) { + if (!world.isRemote && 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); diff --git a/src/main/java/net/minecraft/block/BlockTrapDoor.java b/src/main/java/net/minecraft/block/BlockTrapDoor.java index 24686a73..77f4a73f 100755 --- a/src/main/java/net/minecraft/block/BlockTrapDoor.java +++ b/src/main/java/net/minecraft/block/BlockTrapDoor.java @@ -144,6 +144,28 @@ public class BlockTrapDoor extends Block { } } + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block block) { + if (!world.isRemote) { + 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. diff --git a/src/main/java/net/minecraft/block/BlockTripWire.java b/src/main/java/net/minecraft/block/BlockTripWire.java index 0a53b051..c4e8d31f 100755 --- a/src/main/java/net/minecraft/block/BlockTripWire.java +++ b/src/main/java/net/minecraft/block/BlockTripWire.java @@ -1,5 +1,6 @@ package net.minecraft.block; +import java.util.List; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.minecraft.block.material.Material; @@ -7,6 +8,8 @@ import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; @@ -144,6 +147,15 @@ public class BlockTripWire extends Block { this.notifyHook(world, blockpos, iblockstate.withProperty(POWERED, Boolean.valueOf(true))); } + public void onBlockHarvested(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer) { + if (!world.isRemote) { + 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) { @@ -164,6 +176,61 @@ public class BlockTripWire extends Block { } + /**+ + * Called When an Entity Collided with the Block + */ + public void onEntityCollidedWithBlock(World world, BlockPos blockpos, IBlockState iblockstate, Entity var4) { + if (!world.isRemote) { + 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 (!world.isRemote) { + 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); diff --git a/src/main/java/net/minecraft/block/BlockVine.java b/src/main/java/net/minecraft/block/BlockVine.java index 8b0ebe3d..5e74e2c7 100755 --- a/src/main/java/net/minecraft/block/BlockVine.java +++ b/src/main/java/net/minecraft/block/BlockVine.java @@ -9,7 +9,13 @@ import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; @@ -216,6 +222,142 @@ public class BlockVine extends Block { return iblockaccess.getBiomeGenForCoords(blockpos).getFoliageColorAtPos(blockpos); } + /**+ + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World world, BlockPos blockpos, IBlockState iblockstate, Block var4) { + if (!world.isRemote && !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.isRemote) { + 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 @@ -244,6 +386,18 @@ public class BlockVine extends Block { return 0; } + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, + TileEntity tileentity) { + if (!world.isRemote && 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; } diff --git a/src/main/java/net/minecraft/block/BlockWorkbench.java b/src/main/java/net/minecraft/block/BlockWorkbench.java index 20a5886a..8915cf22 100755 --- a/src/main/java/net/minecraft/block/BlockWorkbench.java +++ b/src/main/java/net/minecraft/block/BlockWorkbench.java @@ -8,6 +8,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Blocks; import net.minecraft.inventory.Container; import net.minecraft.inventory.ContainerWorkbench; +import net.minecraft.stats.StatList; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumFacing; @@ -43,7 +44,13 @@ public class BlockWorkbench extends Block { public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState var3, EntityPlayer entityplayer, EnumFacing var5, float var6, float var7, float var8) { - return true; + if (world.isRemote) { + return true; + } else { + entityplayer.displayGui(new BlockWorkbench.InterfaceCraftingTable(world, blockpos)); + entityplayer.triggerAchievement(StatList.field_181742_Z); + return true; + } } public static class InterfaceCraftingTable implements IInteractionObject { diff --git a/src/main/java/net/minecraft/block/IGrowable.java b/src/main/java/net/minecraft/block/IGrowable.java index 13dd6219..7bd9898f 100755 --- a/src/main/java/net/minecraft/block/IGrowable.java +++ b/src/main/java/net/minecraft/block/IGrowable.java @@ -33,4 +33,6 @@ public interface IGrowable { 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/minecraft/block/state/pattern/FactoryBlockPattern.java b/src/main/java/net/minecraft/block/state/pattern/FactoryBlockPattern.java index 25e23af9..df42006a 100755 --- a/src/main/java/net/minecraft/block/state/pattern/FactoryBlockPattern.java +++ b/src/main/java/net/minecraft/block/state/pattern/FactoryBlockPattern.java @@ -48,7 +48,7 @@ public class FactoryBlockPattern { } public FactoryBlockPattern aisle(String... aisle) { - if (aisle.length > 0 && !StringUtils.isEmpty(aisle[0])) { + if (!(aisle == null || aisle.length <= 0) && !StringUtils.isEmpty(aisle[0])) { if (this.depth.isEmpty()) { this.aisleHeight = aisle.length; this.rowWidth = aisle[0].length(); @@ -67,7 +67,7 @@ public class FactoryBlockPattern { for (char c0 : s.toCharArray()) { if (!this.symbolMap.containsKey(Character.valueOf(c0))) { - this.symbolMap.put(Character.valueOf(c0), (Predicate) null); + this.symbolMap.put(Character.valueOf(c0), null); } } } @@ -95,8 +95,7 @@ public class FactoryBlockPattern { private Predicate[][][] makePredicateArray() { this.checkMissingPredicates(); - Predicate[][][] apredicate = (Predicate[][][]) ((Predicate[][][]) Array.newInstance(Predicate.class, - new int[] { this.depth.size(), this.aisleHeight, this.rowWidth })); + 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) { diff --git a/src/main/java/net/minecraft/client/Minecraft.java b/src/main/java/net/minecraft/client/Minecraft.java index fce9eb63..1b447dbc 100755 --- a/src/main/java/net/minecraft/client/Minecraft.java +++ b/src/main/java/net/minecraft/client/Minecraft.java @@ -306,7 +306,7 @@ public class Minecraft implements IThreadListener { public Minecraft(GameConfiguration gameConfig) { theMinecraft = this; - StringTranslate.doCLINIT(); + StringTranslate.initClient(); this.launchedVersion = gameConfig.gameInfo.version; this.mcDefaultResourcePack = new DefaultResourcePack(); this.session = gameConfig.userInfo.session; @@ -2054,7 +2054,7 @@ public class Minecraft implements IThreadListener { } public ListenableFuture scheduleResourcesRefresh() { - return this.addScheduledTask(new Runnable() { + return this.addScheduledTaskFuture(new Runnable() { public void run() { Minecraft.this.loadingScreen.eaglerShow(I18n.format("resourcePack.load.refreshing"), I18n.format("resourcePack.load.pleaseWait")); @@ -2186,7 +2186,7 @@ public class Minecraft implements IThreadListener { this.entityRenderer.loadEntityShader(viewingEntity); } - public ListenableFuture addScheduledTask(Callable callableToSchedule) { + public ListenableFuture addScheduledTaskFuture(Callable callableToSchedule) { Validate.notNull(callableToSchedule); ListenableFutureTask listenablefuturetask = ListenableFutureTask.create(callableToSchedule); synchronized (this.scheduledTasks) { @@ -2195,9 +2195,13 @@ public class Minecraft implements IThreadListener { } } - public ListenableFuture addScheduledTask(Runnable runnableToSchedule) { + public ListenableFuture addScheduledTaskFuture(Runnable runnableToSchedule) { Validate.notNull(runnableToSchedule); - return this.addScheduledTask(Executors.callable(runnableToSchedule)); + return this.addScheduledTaskFuture(Executors.callable(runnableToSchedule)); + } + + public void addScheduledTask(Runnable runnableToSchedule) { + this.addScheduledTaskFuture(Executors.callable(runnableToSchedule)); } public BlockRendererDispatcher getBlockRendererDispatcher() { diff --git a/src/main/java/net/minecraft/client/gui/GuiOverlayDebug.java b/src/main/java/net/minecraft/client/gui/GuiOverlayDebug.java index 732e8070..eeec6fdc 100755 --- a/src/main/java/net/minecraft/client/gui/GuiOverlayDebug.java +++ b/src/main/java/net/minecraft/client/gui/GuiOverlayDebug.java @@ -399,7 +399,7 @@ public class GuiOverlayDebug extends Gui { Float.valueOf(MathHelper.wrapAngleTo180_float(entity.rotationPitch)) }) }); if (this.mc.theWorld != null && this.mc.theWorld.isBlockLoaded(blockpos)) { Chunk chunk = this.mc.theWorld.getChunkFromBlockCoords(blockpos); - arraylist.add("Biome: " + chunk.getBiome(blockpos).biomeName); + arraylist.add("Biome: " + chunk.getBiome(blockpos, null).biomeName); arraylist.add("Light: " + chunk.getLightSubtracted(blockpos, 0) + " (" + chunk.getLightFor(EnumSkyBlock.SKY, blockpos) + " sky, " + chunk.getLightFor(EnumSkyBlock.BLOCK, blockpos) + " block)"); diff --git a/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java b/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java index a93891ab..fb80bf41 100755 --- a/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java +++ b/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java @@ -16,6 +16,8 @@ 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.sp.lan.LANClientNetworkManager; +import net.lax1dude.eaglercraft.v1_8.sp.socket.ClientIntegratedServerNetworkManager; import net.lax1dude.eaglercraft.v1_8.update.UpdateService; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; @@ -239,6 +241,7 @@ public class NetHandlerPlayClient implements INetHandlerPlayClient { private final Map playerInfoMap = Maps.newHashMap(); public int currentServerMaxPlayers = 20; private boolean field_147308_k = false; + private boolean isIntegratedServer = false; /**+ * Just an ordinary random number generator, used to randomize * audio pitch of item/orb pickup and randomize both @@ -254,6 +257,8 @@ public class NetHandlerPlayClient implements INetHandlerPlayClient { this.netManager = parNetworkManager; this.profile = parGameProfile; this.skinCache = new ServerSkinCache(parNetworkManager, mcIn.getTextureManager()); + this.isIntegratedServer = (parNetworkManager instanceof ClientIntegratedServerNetworkManager) + || (parNetworkManager instanceof LANClientNetworkManager); } /**+ @@ -1769,4 +1774,8 @@ public class NetHandlerPlayClient implements INetHandlerPlayClient { public GameProfile getGameProfile() { return this.profile; } + + public boolean isClientInEaglerSingleplayerOrLAN() { + return isIntegratedServer; + } } \ No newline at end of file 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 57c08a22..2ae1077d 100755 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderSnowball.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderSnowball.java @@ -1,6 +1,8 @@ package net.minecraft.client.renderer.entity; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DynamicLightManager; +import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.texture.EmissiveItems; import net.minecraft.client.renderer.block.model.ItemCameraTransforms; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; @@ -55,9 +57,18 @@ public class RenderSnowball extends Render { GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); this.bindTexture(TextureMap.locationBlocksTexture); - this.field_177083_e.func_181564_a(this.func_177082_d(entity), ItemCameraTransforms.TransformType.GROUND); + ItemStack itm = this.func_177082_d(entity); + this.field_177083_e.func_181564_a(itm, ItemCameraTransforms.TransformType.GROUND); GlStateManager.disableRescaleNormal(); GlStateManager.popMatrix(); + if (DynamicLightManager.isRenderingLights()) { + float[] emission = EmissiveItems.getItemEmission(itm); + if (emission != null) { + float mag = 0.1f; + DynamicLightManager.renderDynamicLight("entity_" + entity.getEntityId() + "_item_throw", d0, d1, d2, + emission[0] * mag, emission[1] * mag, emission[2] * mag, false); + } + } super.doRender(entity, d0, d1, d2, f, f1); } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandBase.java b/src/main/java/net/minecraft/command/CommandBase.java similarity index 89% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandBase.java rename to src/main/java/net/minecraft/command/CommandBase.java index bb933e0c..63074672 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandBase.java +++ b/src/main/java/net/minecraft/command/CommandBase.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package net.minecraft.command; import com.google.common.base.Functions; import com.google.common.collect.Iterables; @@ -11,25 +11,23 @@ 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; +import net.minecraft.block.Block; +import net.minecraft.command.CommandException; +import net.minecraft.command.EntityNotFoundException; +import net.minecraft.command.IAdminCommand; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.NumberInvalidException; +import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.command.PlayerSelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ResourceLocation; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -53,10 +51,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public abstract class CommandBase implements ICommand { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandBase"); - } - private static IAdminCommand theAdmin; /**+ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandBlockData.java b/src/main/java/net/minecraft/command/CommandBlockData.java similarity index 78% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandBlockData.java rename to src/main/java/net/minecraft/command/CommandBlockData.java index fb84a413..0310c2e7 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandBlockData.java +++ b/src/main/java/net/minecraft/command/CommandBlockData.java @@ -1,19 +1,17 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import 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; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -37,10 +35,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandBlockData extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandBlockData"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandClearInventory.java b/src/main/java/net/minecraft/command/CommandClearInventory.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandClearInventory.java rename to src/main/java/net/minecraft/command/CommandClearInventory.java index e7550644..cec6d619 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandClearInventory.java +++ b/src/main/java/net/minecraft/command/CommandClearInventory.java @@ -1,20 +1,18 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayerMP; +import 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; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -38,10 +36,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandClearInventory extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandClearInventory"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandClone.java b/src/main/java/net/minecraft/command/CommandClone.java similarity index 86% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandClone.java rename to src/main/java/net/minecraft/command/CommandClone.java index 4bd053cc..aacbdd23 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandClone.java +++ b/src/main/java/net/minecraft/command/CommandClone.java @@ -1,26 +1,24 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.init.Blocks; +import 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; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.NextTickListEntry; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -44,10 +42,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandClone extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandClone"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandCompare.java b/src/main/java/net/minecraft/command/CommandCompare.java similarity index 81% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandCompare.java rename to src/main/java/net/minecraft/command/CommandCompare.java index a97f7013..b3cb28a3 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandCompare.java +++ b/src/main/java/net/minecraft/command/CommandCompare.java @@ -1,20 +1,18 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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.block.state.IBlockState; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import 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; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -38,10 +36,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandCompare extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandCompare"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandDefaultGameMode.java b/src/main/java/net/minecraft/command/CommandDefaultGameMode.java similarity index 69% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandDefaultGameMode.java rename to src/main/java/net/minecraft/command/CommandDefaultGameMode.java index 3d787f99..3695aabe 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandDefaultGameMode.java +++ b/src/main/java/net/minecraft/command/CommandDefaultGameMode.java @@ -1,15 +1,13 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandGameMode; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.WorldSettings; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -33,10 +31,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandDefaultGameMode extends CommandGameMode { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandDefaultGameMode"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandDifficulty.java b/src/main/java/net/minecraft/command/CommandDifficulty.java similarity index 72% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandDifficulty.java rename to src/main/java/net/minecraft/command/CommandDifficulty.java index 94280b18..a640e021 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandDifficulty.java +++ b/src/main/java/net/minecraft/command/CommandDifficulty.java @@ -1,17 +1,15 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.NumberInvalidException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.EnumDifficulty; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -35,10 +33,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandDifficulty extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandDifficulty"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEffect.java b/src/main/java/net/minecraft/command/CommandEffect.java similarity index 78% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEffect.java rename to src/main/java/net/minecraft/command/CommandEffect.java index 4b62d043..48a43a6f 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEffect.java +++ b/src/main/java/net/minecraft/command/CommandEffect.java @@ -1,19 +1,17 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.NumberInvalidException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -37,10 +35,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandEffect extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandEffect"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEnchant.java b/src/main/java/net/minecraft/command/CommandEnchant.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEnchant.java rename to src/main/java/net/minecraft/command/CommandEnchant.java index 19ff3c6c..5ec34de8 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEnchant.java +++ b/src/main/java/net/minecraft/command/CommandEnchant.java @@ -1,20 +1,18 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.NumberInvalidException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.player.EntityPlayerMP; +import 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; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -38,10 +36,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandEnchant extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandEnchant"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEntityData.java b/src/main/java/net/minecraft/command/CommandEntityData.java similarity index 78% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEntityData.java rename to src/main/java/net/minecraft/command/CommandEntityData.java index b219ff82..30c53c85 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandEntityData.java +++ b/src/main/java/net/minecraft/command/CommandEntityData.java @@ -1,17 +1,15 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import 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. * @@ -34,10 +32,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandEntityData extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandEntityData"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandExecuteAt.java b/src/main/java/net/minecraft/command/CommandExecuteAt.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandExecuteAt.java rename to src/main/java/net/minecraft/command/CommandExecuteAt.java index 107652a9..32c0636f 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandExecuteAt.java +++ b/src/main/java/net/minecraft/command/CommandExecuteAt.java @@ -1,22 +1,20 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandManager; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -40,10 +38,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandExecuteAt extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandExecuteAt"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandFill.java b/src/main/java/net/minecraft/command/CommandFill.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandFill.java rename to src/main/java/net/minecraft/command/CommandFill.java index c1364aea..d1fb5924 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandFill.java +++ b/src/main/java/net/minecraft/command/CommandFill.java @@ -1,25 +1,23 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.init.Blocks; +import 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; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -43,10 +41,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandFill extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandFill"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGameMode.java b/src/main/java/net/minecraft/command/CommandGameMode.java similarity index 78% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGameMode.java rename to src/main/java/net/minecraft/command/CommandGameMode.java index db725b6d..a7304501 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGameMode.java +++ b/src/main/java/net/minecraft/command/CommandGameMode.java @@ -1,18 +1,16 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.NumberInvalidException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.WorldSettings; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -36,10 +34,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandGameMode extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandGameMode"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGameRule.java b/src/main/java/net/minecraft/command/CommandGameRule.java similarity index 75% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGameRule.java rename to src/main/java/net/minecraft/command/CommandGameRule.java index 4b0d3967..6f6048b3 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGameRule.java +++ b/src/main/java/net/minecraft/command/CommandGameRule.java @@ -1,18 +1,16 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.GameRules; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -36,10 +34,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandGameRule extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandGameRule"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGive.java b/src/main/java/net/minecraft/command/CommandGive.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGive.java rename to src/main/java/net/minecraft/command/CommandGive.java index baa65456..033ac53f 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandGive.java +++ b/src/main/java/net/minecraft/command/CommandGive.java @@ -1,21 +1,19 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import 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; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -39,10 +37,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandGive extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandGive"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandHandler.java b/src/main/java/net/minecraft/command/CommandHandler.java similarity index 81% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandHandler.java rename to src/main/java/net/minecraft/command/CommandHandler.java index 4f2d035d..3b815a2c 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandHandler.java +++ b/src/main/java/net/minecraft/command/CommandHandler.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package net.minecraft.command; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -8,23 +8,21 @@ 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.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandManager; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.PlayerSelector; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import 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. * @@ -47,10 +45,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandHandler implements ICommandManager { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandHandler"); - } - private static final Logger logger = LogManager.getLogger(); private final Map commandMap = Maps.newHashMap(); /**+ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandHelp.java b/src/main/java/net/minecraft/command/CommandHelp.java similarity index 72% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandHelp.java rename to src/main/java/net/minecraft/command/CommandHelp.java index 930cf920..32d01854 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandHelp.java +++ b/src/main/java/net/minecraft/command/CommandHelp.java @@ -1,26 +1,24 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandNotFoundException; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.NumberInvalidException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.ClickEvent; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -44,10 +42,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandHelp extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandHelp"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandKill.java b/src/main/java/net/minecraft/command/CommandKill.java similarity index 73% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandKill.java rename to src/main/java/net/minecraft/command/CommandKill.java index df6715ba..a4a2eeca 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandKill.java +++ b/src/main/java/net/minecraft/command/CommandKill.java @@ -1,15 +1,13 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -33,10 +31,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandKill extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandKill"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandNotFoundException.java b/src/main/java/net/minecraft/command/CommandNotFoundException.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandNotFoundException.java rename to src/main/java/net/minecraft/command/CommandNotFoundException.java index cd2bfdb2..6cd612a9 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandNotFoundException.java +++ b/src/main/java/net/minecraft/command/CommandNotFoundException.java @@ -1,8 +1,6 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandException; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -26,10 +24,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandNotFoundException extends CommandException { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandNotFoundException"); - } - public CommandNotFoundException() { this("commands.generic.notFound", new Object[0]); } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandParticle.java b/src/main/java/net/minecraft/command/CommandParticle.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandParticle.java rename to src/main/java/net/minecraft/command/CommandParticle.java index 46361461..83160fc7 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandParticle.java +++ b/src/main/java/net/minecraft/command/CommandParticle.java @@ -1,17 +1,15 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -35,10 +33,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandParticle extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandParticle"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandPlaySound.java b/src/main/java/net/minecraft/command/CommandPlaySound.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandPlaySound.java rename to src/main/java/net/minecraft/command/CommandPlaySound.java index 08363420..087de162 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandPlaySound.java +++ b/src/main/java/net/minecraft/command/CommandPlaySound.java @@ -1,17 +1,15 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -35,10 +33,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandPlaySound extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandPlaySound"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandReplaceItem.java b/src/main/java/net/minecraft/command/CommandReplaceItem.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandReplaceItem.java rename to src/main/java/net/minecraft/command/CommandReplaceItem.java index 15261d00..8e713432 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandReplaceItem.java +++ b/src/main/java/net/minecraft/command/CommandReplaceItem.java @@ -1,29 +1,27 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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.block.Block; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.NumberInvalidException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import 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; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -47,10 +45,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandReplaceItem extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandReplaceItem"); - } - private static final Map SHORTCUTS = Maps.newHashMap(); /**+ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandResultStats.java b/src/main/java/net/minecraft/command/CommandResultStats.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandResultStats.java rename to src/main/java/net/minecraft/command/CommandResultStats.java index fba40c7f..fbb97bb7 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandResultStats.java +++ b/src/main/java/net/minecraft/command/CommandResultStats.java @@ -1,19 +1,17 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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.command.CommandBase; +import net.minecraft.command.EntityNotFoundException; +import net.minecraft.command.ICommandSender; +import 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; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -37,10 +35,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandResultStats { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandResultStats"); - } - /**+ * The number of result command result types that are possible. */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandServerKick.java b/src/main/java/net/minecraft/command/CommandServerKick.java similarity index 72% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandServerKick.java rename to src/main/java/net/minecraft/command/CommandServerKick.java index 5dcacabd..63c62bcd 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandServerKick.java +++ b/src/main/java/net/minecraft/command/CommandServerKick.java @@ -1,17 +1,15 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.StringUtils; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -35,10 +33,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandServerKick extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandServerKick"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSetPlayerTimeout.java b/src/main/java/net/minecraft/command/CommandSetPlayerTimeout.java similarity index 72% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSetPlayerTimeout.java rename to src/main/java/net/minecraft/command/CommandSetPlayerTimeout.java index eb39db7e..a15c44cb 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSetPlayerTimeout.java +++ b/src/main/java/net/minecraft/command/CommandSetPlayerTimeout.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandSetPlayerTimeout extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandSetPlayerTimeout"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSetSpawnpoint.java b/src/main/java/net/minecraft/command/CommandSetSpawnpoint.java similarity index 75% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSetSpawnpoint.java rename to src/main/java/net/minecraft/command/CommandSetSpawnpoint.java index 79d6cac3..cf5ae8bb 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSetSpawnpoint.java +++ b/src/main/java/net/minecraft/command/CommandSetSpawnpoint.java @@ -1,15 +1,13 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -33,10 +31,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandSetSpawnpoint extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandSetSpawnpoint"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandShowSeed.java b/src/main/java/net/minecraft/command/CommandShowSeed.java similarity index 69% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandShowSeed.java rename to src/main/java/net/minecraft/command/CommandShowSeed.java index 46909ffd..42962596 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandShowSeed.java +++ b/src/main/java/net/minecraft/command/CommandShowSeed.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandShowSeed extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandShowSeed"); - } - /**+ * Returns true if the given command sender is allowed to use * this command. diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSpreadPlayers.java b/src/main/java/net/minecraft/command/CommandSpreadPlayers.java similarity index 85% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSpreadPlayers.java rename to src/main/java/net/minecraft/command/CommandSpreadPlayers.java index e655a5b6..88de0d9a 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandSpreadPlayers.java +++ b/src/main/java/net/minecraft/command/CommandSpreadPlayers.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package net.minecraft.command; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -9,26 +9,24 @@ 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; +import net.minecraft.block.material.Material; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.EntityNotFoundException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.command.PlayerSelector; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -52,10 +50,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandSpreadPlayers extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandSpreadPlayers"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandStats.java b/src/main/java/net/minecraft/command/CommandStats.java similarity index 81% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandStats.java rename to src/main/java/net/minecraft/command/CommandStats.java index 5a0b3ccb..9c1f4ef7 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandStats.java +++ b/src/main/java/net/minecraft/command/CommandStats.java @@ -1,24 +1,22 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityCommandBlock; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -42,10 +40,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandStats extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandStats"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTime.java b/src/main/java/net/minecraft/command/CommandTime.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTime.java rename to src/main/java/net/minecraft/command/CommandTime.java index ae10156b..373a71d2 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTime.java +++ b/src/main/java/net/minecraft/command/CommandTime.java @@ -1,16 +1,14 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.world.WorldServer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -34,10 +32,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandTime extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandTime"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTitle.java b/src/main/java/net/minecraft/command/CommandTitle.java similarity index 78% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTitle.java rename to src/main/java/net/minecraft/command/CommandTitle.java index b6cbaa19..5f4a6219 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTitle.java +++ b/src/main/java/net/minecraft/command/CommandTitle.java @@ -1,26 +1,24 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.SyntaxErrorException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S45PacketTitle; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentProcessor; +import 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. * @@ -43,10 +41,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandTitle extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandTitle"); - } - private static final Logger LOGGER = LogManager.getLogger(); /**+ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandToggleDownfall.java b/src/main/java/net/minecraft/command/CommandToggleDownfall.java similarity index 71% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandToggleDownfall.java rename to src/main/java/net/minecraft/command/CommandToggleDownfall.java index 4e724e24..6332d0be 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandToggleDownfall.java +++ b/src/main/java/net/minecraft/command/CommandToggleDownfall.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.storage.WorldInfo; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandToggleDownfall extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandToggleDownfall"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTrigger.java b/src/main/java/net/minecraft/command/CommandTrigger.java similarity index 75% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTrigger.java rename to src/main/java/net/minecraft/command/CommandTrigger.java index d3d30587..49dc9872 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandTrigger.java +++ b/src/main/java/net/minecraft/command/CommandTrigger.java @@ -1,22 +1,20 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -40,10 +38,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandTrigger extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandTrigger"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandWeather.java b/src/main/java/net/minecraft/command/CommandWeather.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandWeather.java rename to src/main/java/net/minecraft/command/CommandWeather.java index 68b3970c..281f13af 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandWeather.java +++ b/src/main/java/net/minecraft/command/CommandWeather.java @@ -1,17 +1,15 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.world.WorldServer; +import net.minecraft.world.storage.WorldInfo; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -35,10 +33,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandWeather extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandWeather"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandWorldBorder.java b/src/main/java/net/minecraft/command/CommandWorldBorder.java similarity index 86% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandWorldBorder.java rename to src/main/java/net/minecraft/command/CommandWorldBorder.java index 2a4a8b55..9d2b545f 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandWorldBorder.java +++ b/src/main/java/net/minecraft/command/CommandWorldBorder.java @@ -1,20 +1,18 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.MathHelper; +import net.minecraft.world.border.WorldBorder; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -38,10 +36,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandWorldBorder extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandWorldBorder"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandXP.java b/src/main/java/net/minecraft/command/CommandXP.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandXP.java rename to src/main/java/net/minecraft/command/CommandXP.java index 9e7db298..6515a176 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/CommandXP.java +++ b/src/main/java/net/minecraft/command/CommandXP.java @@ -1,16 +1,14 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -34,10 +32,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandXP extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/CommandXP"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/IAdminCommand.java b/src/main/java/net/minecraft/command/IAdminCommand.java similarity index 82% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/IAdminCommand.java rename to src/main/java/net/minecraft/command/IAdminCommand.java index 128bd799..51bc6726 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/IAdminCommand.java +++ b/src/main/java/net/minecraft/command/IAdminCommand.java @@ -1,7 +1,7 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommand.java b/src/main/java/net/minecraft/command/ICommand.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommand.java rename to src/main/java/net/minecraft/command/ICommand.java index 381150e4..72c71f1a 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommand.java +++ b/src/main/java/net/minecraft/command/ICommand.java @@ -1,9 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.BlockPos; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommandManager.java b/src/main/java/net/minecraft/command/ICommandManager.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommandManager.java rename to src/main/java/net/minecraft/command/ICommandManager.java index 5d9df962..b1c0670b 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ICommandManager.java +++ b/src/main/java/net/minecraft/command/ICommandManager.java @@ -1,10 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.BlockPos; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. diff --git a/src/main/java/net/minecraft/command/ICommandSender.java b/src/main/java/net/minecraft/command/ICommandSender.java index 6e4ad1e4..3ea9d286 100755 --- a/src/main/java/net/minecraft/command/ICommandSender.java +++ b/src/main/java/net/minecraft/command/ICommandSender.java @@ -1,5 +1,6 @@ package net.minecraft.command; +import net.minecraft.command.CommandResultStats; import net.minecraft.entity.Entity; import net.minecraft.util.BlockPos; import net.minecraft.util.IChatComponent; @@ -83,4 +84,5 @@ public interface ICommandSender { */ 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/minecraft/command/NumberInvalidException.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/NumberInvalidException.java rename to src/main/java/net/minecraft/command/NumberInvalidException.java index 68745e11..215e6d09 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/NumberInvalidException.java +++ b/src/main/java/net/minecraft/command/NumberInvalidException.java @@ -1,8 +1,6 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandException; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -26,10 +24,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class NumberInvalidException extends CommandException { - static { - __checkIntegratedContextValid("net/minecraft/command/NumberInvalidException"); - } - public NumberInvalidException() { this("commands.generic.num.invalid", new Object[0]); } diff --git a/src/main/java/net/minecraft/command/PlayerSelector.java b/src/main/java/net/minecraft/command/PlayerSelector.java index 26531d93..00dd3235 100755 --- a/src/main/java/net/minecraft/command/PlayerSelector.java +++ b/src/main/java/net/minecraft/command/PlayerSelector.java @@ -1,32 +1,33 @@ package net.minecraft.command; -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.Map.Entry; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - 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 net.minecraft.client.Minecraft; +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.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.scoreboard.Score; import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.scoreboard.Scoreboard; import net.minecraft.scoreboard.Team; +import net.minecraft.server.MinecraftServer; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentTranslation; @@ -80,6 +81,14 @@ public class PlayerSelector { 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); @@ -93,11 +102,11 @@ public class PlayerSelector { } else { ArrayList arraylist = Lists.newArrayList(); - for (Entity entity : (List) list) { + for (Entity entity : (ArrayList) list) { arraylist.add(entity.getDisplayName()); } - return IChatComponent.join(arraylist); + return CommandBase.join(arraylist); } } @@ -114,7 +123,7 @@ public class PlayerSelector { List list = getWorlds(sender, map); ArrayList arraylist = Lists.newArrayList(); - for (World world : (List) list) { + for (World world : (ArrayList) list) { if (world != null) { ArrayList arraylist1 = Lists.newArrayList(); arraylist1.addAll(func_179663_a(map, s)); @@ -147,10 +156,7 @@ public class PlayerSelector { if (func_179665_h(argumentMap)) { arraylist.add(sender.getEntityWorld()); } else { - Minecraft mc = Minecraft.getMinecraft(); - if (mc.theWorld != null) { - arraylist.add(mc.thePlayer); - } + Collections.addAll(arraylist, MinecraftServer.getServer().worldServers); } return arraylist; @@ -173,12 +179,11 @@ public class PlayerSelector { private static List> func_179663_a(Map parMap, String parString1) { ArrayList arraylist = Lists.newArrayList(); - String ss = func_179651_b(parMap, "type"); - final boolean flag = ss != null && ss.startsWith("!"); + String s = func_179651_b(parMap, "type"); + final boolean flag = s != null && s.startsWith("!"); if (flag) { - ss = ss.substring(1); + s = s.substring(1); } - final String s = ss; boolean flag1 = !parString1.equals("e"); boolean flag2 = parString1.equals("r") && s != null; @@ -191,9 +196,10 @@ public class PlayerSelector { }); } } else { + final String ss = s; arraylist.add(new Predicate() { public boolean apply(Entity entity) { - return EntityList.isStringEntityName(entity, s) != flag; + return EntityList.isStringEntityName(entity, ss) != flag; } }); } @@ -208,7 +214,13 @@ public class PlayerSelector { if (i > -1 || j > -1) { arraylist.add(new Predicate() { public boolean apply(Entity entity) { - return false; + if (!(entity instanceof EntityPlayerMP)) { + return false; + } else { + EntityPlayerMP entityplayermp = (EntityPlayerMP) entity; + return (i <= -1 || entityplayermp.experienceLevel >= i) + && (j <= -1 || entityplayermp.experienceLevel <= j); + } } }); } @@ -222,7 +234,12 @@ public class PlayerSelector { if (i != WorldSettings.GameType.NOT_SET.getID()) { arraylist.add(new Predicate() { public boolean apply(Entity entity) { - return false; + if (!(entity instanceof EntityPlayerMP)) { + return false; + } else { + EntityPlayerMP entityplayermp = (EntityPlayerMP) entity; + return entityplayermp.theItemInWorldManager.getGameType().getID() == i; + } } }); } @@ -232,14 +249,14 @@ public class PlayerSelector { private static List> func_179659_d(Map parMap) { ArrayList arraylist = Lists.newArrayList(); - String ss = func_179651_b(parMap, "team"); - final boolean flag = ss != null && ss.startsWith("!"); + String s = func_179651_b(parMap, "team"); + final boolean flag = s != null && s.startsWith("!"); if (flag) { - ss = ss.substring(1); + s = s.substring(1); } - final String s = ss; if (s != null) { + final String ss = s; arraylist.add(new Predicate() { public boolean apply(Entity entity) { if (!(entity instanceof EntityLivingBase)) { @@ -248,7 +265,7 @@ public class PlayerSelector { EntityLivingBase entitylivingbase = (EntityLivingBase) entity; Team team = entitylivingbase.getTeam(); String s1 = team == null ? "" : team.getRegisteredName(); - return s1.equals(s) != flag; + return s1.equals(ss) != flag; } } }); @@ -259,13 +276,13 @@ public class PlayerSelector { private static List> func_179657_e(Map parMap) { ArrayList arraylist = Lists.newArrayList(); - final Map map = func_96560_a(parMap); + final Map map = func_96560_a(parMap); if (map != null && map.size() > 0) { arraylist.add(new Predicate() { public boolean apply(Entity entity) { - Scoreboard scoreboard = Minecraft.getMinecraft().theWorld.getScoreboard(); + Scoreboard scoreboard = MinecraftServer.getServer().worldServerForDimension(0).getScoreboard(); - for (Entry entry : map.entrySet()) { + for (Entry entry : (Set) map.entrySet()) { String s = (String) entry.getKey(); boolean flag = false; if (s.endsWith("_min") && s.length() > 4) { @@ -278,7 +295,8 @@ public class PlayerSelector { return false; } - String s1 = entity instanceof EntityPlayer ? entity.getName() : entity.getUniqueID().toString(); + String s1 = entity instanceof EntityPlayerMP ? entity.getName() + : entity.getUniqueID().toString(); if (!scoreboard.entityHasObjective(s1, scoreobjective)) { return false; } @@ -304,17 +322,17 @@ public class PlayerSelector { private static List> func_179647_f(Map parMap) { ArrayList arraylist = Lists.newArrayList(); - String ss = func_179651_b(parMap, "name"); - final boolean flag = ss != null && ss.startsWith("!"); + String s = func_179651_b(parMap, "name"); + final boolean flag = s != null && s.startsWith("!"); if (flag) { - ss = ss.substring(1); + s = s.substring(1); } - final String s = ss; if (s != null) { + final String ss = s; arraylist.add(new Predicate() { public boolean apply(Entity entity) { - return entity.getName().equals(s) != flag; + return entity.getName().equals(ss) != flag; } }); } @@ -450,7 +468,7 @@ public class PlayerSelector { Entity entity = parICommandSender.getCommandSenderEntity(); if (entity != null && parClass1.isAssignableFrom(entity.getClass()) && i == 1 && ((List) parList).contains(entity) && !"r".equals(parString1)) { - parList = (List) Lists.newArrayList(new Entity[] { entity }); + parList = (List) Lists.newArrayList(entity); } if (i != 0) { @@ -591,5 +609,4 @@ public class PlayerSelector { 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/minecraft/command/ServerCommandManager.java similarity index 69% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ServerCommandManager.java rename to src/main/java/net/minecraft/command/ServerCommandManager.java index 27e764f5..fac1602b 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/ServerCommandManager.java +++ b/src/main/java/net/minecraft/command/ServerCommandManager.java @@ -1,25 +1,23 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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.minecraft.command.server.CommandAchievement; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.command.server.CommandBroadcast; +import net.minecraft.command.server.CommandEmote; +import net.minecraft.command.server.CommandListPlayers; +import net.minecraft.command.server.CommandMessage; +import net.minecraft.command.server.CommandMessageRaw; +import net.minecraft.command.server.CommandScoreboard; +import net.minecraft.command.server.CommandSetBlock; +import net.minecraft.command.server.CommandSetDefaultSpawnpoint; +import net.minecraft.command.server.CommandSummon; +import net.minecraft.command.server.CommandTeleport; +import net.minecraft.command.server.CommandTestFor; +import net.minecraft.command.server.CommandTestForBlock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; import net.lax1dude.eaglercraft.v1_8.sp.server.ClientCommandDummy; @@ -45,10 +43,6 @@ import net.lax1dude.eaglercraft.v1_8.sp.server.ClientCommandDummy; */ public class ServerCommandManager extends CommandHandler implements IAdminCommand { - static { - __checkIntegratedContextValid("net/minecraft/command/ServerCommandManager"); - } - public ServerCommandManager() { this.registerCommand(new CommandTime()); this.registerCommand(new CommandGameMode()); diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/SyntaxErrorException.java b/src/main/java/net/minecraft/command/SyntaxErrorException.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/SyntaxErrorException.java rename to src/main/java/net/minecraft/command/SyntaxErrorException.java index 2ff61ac6..49e64ba0 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/SyntaxErrorException.java +++ b/src/main/java/net/minecraft/command/SyntaxErrorException.java @@ -1,8 +1,6 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.CommandException; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -26,10 +24,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class SyntaxErrorException extends CommandException { - static { - __checkIntegratedContextValid("net/minecraft/command/SyntaxErrorException"); - } - public SyntaxErrorException() { this("commands.generic.snytax", new Object[0]); } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/WrongUsageException.java b/src/main/java/net/minecraft/command/WrongUsageException.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/WrongUsageException.java rename to src/main/java/net/minecraft/command/WrongUsageException.java index fd30d9ce..a09e29eb 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/WrongUsageException.java +++ b/src/main/java/net/minecraft/command/WrongUsageException.java @@ -1,8 +1,6 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command; +package 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; +import net.minecraft.command.SyntaxErrorException; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -26,10 +24,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WrongUsageException extends SyntaxErrorException { - static { - __checkIntegratedContextValid("net/minecraft/command/WrongUsageException"); - } - public WrongUsageException(String message, Object... replacements) { super(message, replacements); } 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/minecraft/command/server/CommandAchievement.java similarity index 82% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandAchievement.java rename to src/main/java/net/minecraft/command/server/CommandAchievement.java index 410892bd..8e50d420 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandAchievement.java +++ b/src/main/java/net/minecraft/command/server/CommandAchievement.java @@ -1,23 +1,21 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.util.BlockPos; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -41,10 +39,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandAchievement extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/server/CommandAchievement"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/minecraft/command/server/CommandBlockLogic.java b/src/main/java/net/minecraft/command/server/CommandBlockLogic.java index adf4e229..c76af433 100755 --- a/src/main/java/net/minecraft/command/server/CommandBlockLogic.java +++ b/src/main/java/net/minecraft/command/server/CommandBlockLogic.java @@ -1,13 +1,22 @@ 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 java.text.SimpleDateFormat; +import java.util.Date; +import java.util.concurrent.Callable; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandManager; +import net.minecraft.command.ICommandSender; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; +import net.minecraft.util.ReportedException; import net.minecraft.world.World; /**+ @@ -30,11 +39,11 @@ import net.minecraft.world.World; * POSSIBILITY OF SUCH DAMAGE. * */ -public abstract class CommandBlockLogic { +public abstract class CommandBlockLogic implements ICommandSender { /**+ * The formatting for the timestamp on commands run. */ - private static final SimpleDateFormat timestampFormat = EagRuntime.fixDateFormat(new SimpleDateFormat("HH:mm:ss")); + private static final SimpleDateFormat timestampFormat = new SimpleDateFormat("HH:mm:ss"); private int successCount; private boolean trackOutput = true; /**+ @@ -49,6 +58,7 @@ public abstract class CommandBlockLogic { * The custom name of the command block. (defaults to "@") */ private String customName = "@"; + private final CommandResultStats resultStats = new CommandResultStats(); /**+ * returns the successCount int. @@ -75,6 +85,8 @@ public abstract class CommandBlockLogic { if (this.lastOutput != null && this.trackOutput) { tagCompound.setString("LastOutput", IChatComponent.Serializer.componentToJson(this.lastOutput)); } + + this.resultStats.writeStatsToNBT(tagCompound); } /**+ @@ -94,6 +106,8 @@ public abstract class CommandBlockLogic { if (nbt.hasKey("LastOutput", 8) && this.trackOutput) { this.lastOutput = IChatComponent.Serializer.jsonToComponent(nbt.getString("LastOutput")); } + + this.resultStats.readStatsFromNBT(nbt); } /**+ @@ -120,6 +134,35 @@ public abstract class CommandBlockLogic { } public void trigger(World worldIn) { + if (worldIn.isRemote) { + this.successCount = 0; + } + + 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; + } } @@ -147,6 +190,11 @@ public abstract class CommandBlockLogic { * Send a chat message to the CommandSender */ public void addChatMessage(IChatComponent ichatcomponent) { + if (this.trackOutput && this.getEntityWorld() != null && !this.getEntityWorld().isRemote) { + this.lastOutput = (new ChatComponentText("[" + timestampFormat.format(new Date()) + "] ")) + .appendSibling(ichatcomponent); + this.updateCommand(); + } } @@ -155,7 +203,13 @@ public abstract class CommandBlockLogic { * about executed commands */ public boolean sendCommandFeedback() { - return true; + 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(); @@ -180,8 +234,15 @@ public abstract class CommandBlockLogic { if (!playerIn.capabilities.isCreativeMode) { return false; } else { - playerIn.openEditCommandBlock(this); + if (playerIn.getEntityWorld().isRemote) { + playerIn.openEditCommandBlock(this); + } + 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/minecraft/command/server/CommandBroadcast.java similarity index 68% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandBroadcast.java rename to src/main/java/net/minecraft/command/server/CommandBroadcast.java index a80fe56b..d54f349d 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandBroadcast.java +++ b/src/main/java/net/minecraft/command/server/CommandBroadcast.java @@ -1,18 +1,16 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.StringUtils; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -36,10 +34,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandBroadcast extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/server/CommandBroadcast"); - } - /**+ * Gets the name of the command */ 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/minecraft/command/server/CommandEmote.java similarity index 65% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandEmote.java rename to src/main/java/net/minecraft/command/server/CommandEmote.java index 44dadece..6d55a2da 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandEmote.java +++ b/src/main/java/net/minecraft/command/server/CommandEmote.java @@ -1,19 +1,17 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.StringUtils; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -37,10 +35,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandEmote extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/server/CommandEmote"); - } - /**+ * Gets the name of the command */ 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/minecraft/command/server/CommandListPlayers.java similarity index 69% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandListPlayers.java rename to src/main/java/net/minecraft/command/server/CommandListPlayers.java index 6f976ad0..177cb579 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandListPlayers.java +++ b/src/main/java/net/minecraft/command/server/CommandListPlayers.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandListPlayers extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/server/CommandListPlayers"); - } - /**+ * Gets the name of the command */ 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/minecraft/command/server/CommandMessage.java similarity index 69% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandMessage.java rename to src/main/java/net/minecraft/command/server/CommandMessage.java index b57c6a9e..a7b1ef71 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandMessage.java +++ b/src/main/java/net/minecraft/command/server/CommandMessage.java @@ -1,23 +1,21 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.StringUtils; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -41,10 +39,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandMessage extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/server/CommandMessage"); - } - /**+ * Gets a list of aliases for this command */ 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/minecraft/command/server/CommandMessageRaw.java similarity index 69% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandMessageRaw.java rename to src/main/java/net/minecraft/command/server/CommandMessageRaw.java index 4be197af..e7ed145b 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandMessageRaw.java +++ b/src/main/java/net/minecraft/command/server/CommandMessageRaw.java @@ -1,22 +1,20 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.SyntaxErrorException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentProcessor; +import net.minecraft.util.IChatComponent; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -40,10 +38,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandMessageRaw extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/server/CommandMessageRaw"); - } - /**+ * Gets the name of the command */ 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/minecraft/command/server/CommandScoreboard.java similarity index 93% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandScoreboard.java rename to src/main/java/net/minecraft/command/server/CommandScoreboard.java index b2f058c7..6a4196f1 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandScoreboard.java +++ b/src/main/java/net/minecraft/command/server/CommandScoreboard.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; +package net.minecraft.command.server; import com.google.common.collect.Lists; import com.google.common.collect.Sets; @@ -9,31 +9,29 @@ 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.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.SyntaxErrorException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import 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; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -57,10 +55,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandScoreboard extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/server/CommandScoreboard"); - } - /**+ * Gets the name of the command */ 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/minecraft/command/server/CommandSetBlock.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandSetBlock.java rename to src/main/java/net/minecraft/command/server/CommandSetBlock.java index 8abcd9aa..92c0b993 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandSetBlock.java +++ b/src/main/java/net/minecraft/command/server/CommandSetBlock.java @@ -1,23 +1,21 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; +package 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.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.init.Blocks; +import 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; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -41,10 +39,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandSetBlock extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/server/CommandSetBlock"); - } - /**+ * Gets the name of the command */ 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/minecraft/command/server/CommandSetDefaultSpawnpoint.java similarity index 72% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandSetDefaultSpawnpoint.java rename to src/main/java/net/minecraft/command/server/CommandSetDefaultSpawnpoint.java index 21763854..da5864b1 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandSetDefaultSpawnpoint.java +++ b/src/main/java/net/minecraft/command/server/CommandSetDefaultSpawnpoint.java @@ -1,15 +1,13 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -33,10 +31,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandSetDefaultSpawnpoint extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/server/CommandSetDefaultSpawnpoint"); - } - /**+ * Gets the name of the command */ 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/minecraft/command/server/CommandSummon.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandSummon.java rename to src/main/java/net/minecraft/command/server/CommandSummon.java index a9d29fdb..63ec8d0d 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandSummon.java +++ b/src/main/java/net/minecraft/command/server/CommandSummon.java @@ -1,24 +1,22 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; +package 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.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.IEntityLivingData; +import 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; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -42,10 +40,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandSummon extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/server/CommandSummon"); - } - /**+ * Gets the name of the command */ 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/minecraft/command/server/CommandTeleport.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandTeleport.java rename to src/main/java/net/minecraft/command/server/CommandTeleport.java index b413a060..154d68d6 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandTeleport.java +++ b/src/main/java/net/minecraft/command/server/CommandTeleport.java @@ -1,19 +1,17 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; +package 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; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -37,10 +35,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandTeleport extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/server/CommandTeleport"); - } - /**+ * Gets the name of the command */ 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/minecraft/command/server/CommandTestFor.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandTestFor.java rename to src/main/java/net/minecraft/command/server/CommandTestFor.java index befd2da6..bfa56ba5 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandTestFor.java +++ b/src/main/java/net/minecraft/command/server/CommandTestFor.java @@ -1,19 +1,17 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; +package 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.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import 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; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -37,10 +35,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandTestFor extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/server/CommandTestFor"); - } - /**+ * Gets the name of the command */ 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/minecraft/command/server/CommandTestForBlock.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandTestForBlock.java rename to src/main/java/net/minecraft/command/server/CommandTestForBlock.java index e901cc1f..e8cc4086 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/command/server/CommandTestForBlock.java +++ b/src/main/java/net/minecraft/command/server/CommandTestForBlock.java @@ -1,23 +1,21 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.command.server; +package 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.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.NumberInvalidException; +import 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; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -41,10 +39,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class CommandTestForBlock extends CommandBase { - static { - __checkIntegratedContextValid("net/minecraft/command/server/CommandTestForBlock"); - } - /**+ * Gets the name of the command */ diff --git a/src/main/java/net/minecraft/entity/Entity.java b/src/main/java/net/minecraft/entity/Entity.java index ec7cb96d..8fee7fee 100755 --- a/src/main/java/net/minecraft/entity/Entity.java +++ b/src/main/java/net/minecraft/entity/Entity.java @@ -15,7 +15,10 @@ import net.minecraft.block.BlockLiquid; import net.minecraft.block.BlockWall; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockPattern; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandSender; import net.minecraft.crash.CrashReport; import net.minecraft.crash.CrashReportCategory; import net.minecraft.enchantment.EnchantmentHelper; @@ -23,6 +26,7 @@ import net.minecraft.enchantment.EnchantmentProtection; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.event.HoverEvent; import net.minecraft.init.Blocks; import net.minecraft.item.Item; @@ -31,6 +35,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagDouble; import net.minecraft.nbt.NBTTagFloat; import net.minecraft.nbt.NBTTagList; +import net.minecraft.server.MinecraftServer; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; @@ -45,6 +50,7 @@ import net.minecraft.util.StatCollector; import net.minecraft.util.Vec3; import net.minecraft.world.Explosion; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -66,7 +72,7 @@ import net.minecraft.world.World; * POSSIBILITY OF SUCH DAMAGE. * */ -public abstract class Entity { +public abstract class Entity implements ICommandSender { 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; @@ -140,6 +146,7 @@ public abstract class Entity { protected EnumFacing field_181018_ap; private boolean invulnerable; protected EaglercraftUUID entityUniqueID; + private final CommandResultStats cmdResultStats; public int getEntityId() { return this.entityId; @@ -167,6 +174,7 @@ public abstract class Entity { 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) { @@ -237,6 +245,9 @@ public abstract class Entity { 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.worldObj.isRemote) { + this.moveEntity((double) (f2 - this.width), 0.0D, (double) (f2 - this.width)); + } } } @@ -301,10 +312,62 @@ public abstract class Entity { this.prevPosZ = this.posZ; this.prevRotationPitch = this.rotationPitch; this.prevRotationYaw = this.rotationYaw; + if (!this.worldObj.isRemote && 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(); - this.fire = 0; + if (this.worldObj.isRemote) { + this.fire = 0; + } else 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(); @@ -315,6 +378,10 @@ public abstract class Entity { this.kill(); } + if (!this.worldObj.isRemote) { + this.setFlag(0, this.fire > 0); + } + this.firstUpdate = false; this.worldObj.theProfiler.endSection(); } @@ -1274,6 +1341,7 @@ public abstract class Entity { tagCompund.setBoolean("CustomNameVisible", this.getAlwaysRenderNameTag()); } + this.cmdResultStats.writeStatsToNBT(tagCompund); if (this.isSilent()) { tagCompund.setBoolean("Silent", this.isSilent()); } @@ -1346,6 +1414,7 @@ public abstract class Entity { } this.setAlwaysRenderNameTag(tagCompund.getBoolean("CustomNameVisible")); + this.cmdResultStats.readStatsFromNBT(tagCompund); this.setSilent(tagCompund.getBoolean("Silent")); this.readEntityFromNBT(tagCompund); if (this.shouldSetPosAfterLoading()) { @@ -1630,6 +1699,27 @@ public abstract class Entity { if (this.timeUntilPortal > 0) { this.timeUntilPortal = this.getPortalCooldown(); } else { + if (!this.worldObj.isRemote && !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; } } @@ -1681,7 +1771,7 @@ public abstract class Entity { * the fire effect on rendering. */ public boolean isBurning() { - boolean flag = this.worldObj != null; + boolean flag = this.worldObj != null && this.worldObj.isRemote; return !this.isImmuneToFire && (this.fire > 0 || flag && this.getFlag(0)); } @@ -1967,6 +2057,40 @@ public abstract class Entity { * number to teleport to */ public void travelToDimension(int i) { + if (!this.worldObj.isRemote && !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(); + } } /**+ @@ -2008,7 +2132,7 @@ public abstract class Entity { public void addEntityCrashInfo(CrashReportCategory category) { category.addCrashSectionCallable("Entity Type", new Callable() { public String call() throws Exception { - return EntityList.getEntityString(Entity.this) + " (" + Entity.this.getClass().getName() + ")"; + return EntityList.getEntityString(Entity.this) + " (" + Entity.this.getClass().getCanonicalName() + ")"; } }); category.addCrashSection("Entity ID", Integer.valueOf(this.entityId)); @@ -2017,12 +2141,12 @@ public abstract class Entity { return Entity.this.getName(); } }); - category.addCrashSection("Entity\'s Exact location", HString.format("%.2f, %.2f, %.2f", + category.addCrashSection("Entity\'s Exact location", String.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[] { + category.addCrashSection("Entity\'s Momentum", String.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 { @@ -2120,6 +2244,10 @@ public abstract class Entity { return new HoverEvent(HoverEvent.Action.SHOW_ENTITY, new ChatComponentText(nbttagcompound.toString())); } + public boolean isSpectatedByPlayer(EntityPlayerMP var1) { + return true; + } + public AxisAlignedBB getEntityBoundingBox() { return this.boundingBox; } @@ -2201,6 +2329,18 @@ public abstract class Entity { 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; } diff --git a/src/main/java/net/minecraft/entity/EntityAgeable.java b/src/main/java/net/minecraft/entity/EntityAgeable.java index 8f1ab6fb..e29afbf8 100755 --- a/src/main/java/net/minecraft/entity/EntityAgeable.java +++ b/src/main/java/net/minecraft/entity/EntityAgeable.java @@ -48,6 +48,29 @@ public abstract class EntityAgeable extends EntityCreature { public boolean interact(EntityPlayer player) { ItemStack itemstack = player.inventory.getCurrentItem(); if (itemstack != null && itemstack.getItem() == Items.spawn_egg) { + if (!this.worldObj.isRemote) { + 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; @@ -67,7 +90,7 @@ public abstract class EntityAgeable extends EntityCreature { * considered a child. */ public int getGrowingAge() { - return this.dataWatcher.getWatchableObjectByte(12); + return this.worldObj.isRemote ? this.dataWatcher.getWatchableObjectByte(12) : this.growingAge; } public void func_175501_a(int parInt1, boolean parFlag) { @@ -144,19 +167,34 @@ public abstract class EntityAgeable extends EntityCreature { */ public void onLivingUpdate() { super.onLivingUpdate(); - if (this.field_175503_c > 0) { - if (this.field_175503_c % 4 == 0) { - this.worldObj.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, - 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[0]); + if (this.worldObj.isRemote) { + if (this.field_175503_c > 0) { + if (this.field_175503_c % 4 == 0) { + this.worldObj.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, + 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[0]); + } + + --this.field_175503_c; } - --this.field_175503_c; + this.setScaleForAge(this.isChild()); + } else { + 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.setScaleForAge(this.isChild()); } /**+ diff --git a/src/main/java/net/minecraft/entity/EntityCreature.java b/src/main/java/net/minecraft/entity/EntityCreature.java index 638efbe4..1531d327 100755 --- a/src/main/java/net/minecraft/entity/EntityCreature.java +++ b/src/main/java/net/minecraft/entity/EntityCreature.java @@ -2,8 +2,11 @@ package net.minecraft.entity; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.pathfinding.PathNavigateGround; import net.minecraft.util.BlockPos; import net.minecraft.world.World; @@ -37,6 +40,7 @@ public abstract class EntityCreature extends EntityLiving { * 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) { @@ -60,7 +64,7 @@ public abstract class EntityCreature extends EntityLiving { * if the entity got a PathEntity it returns true, else false */ public boolean hasPath() { - return false; + return !this.navigator.noPath(); } public boolean isWithinHomeDistanceCurrentPosition() { @@ -119,10 +123,19 @@ public abstract class EntityCreature extends EntityLiving { } 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; @@ -137,6 +150,11 @@ public abstract class EntityCreature extends EntityLiving { } } 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(); } diff --git a/src/main/java/net/minecraft/entity/EntityHanging.java b/src/main/java/net/minecraft/entity/EntityHanging.java index 50cb2ccd..846e8696 100755 --- a/src/main/java/net/minecraft/entity/EntityHanging.java +++ b/src/main/java/net/minecraft/entity/EntityHanging.java @@ -1,7 +1,5 @@ package net.minecraft.entity; -import org.apache.commons.lang3.Validate; - import net.minecraft.block.Block; import net.minecraft.block.BlockRedstoneDiode; import net.minecraft.entity.player.EntityPlayer; @@ -12,6 +10,8 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import org.apache.commons.lang3.Validate; + /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. * @@ -108,7 +108,14 @@ public abstract class EntityHanging extends Entity { this.prevPosX = this.posX; this.prevPosY = this.posY; this.prevPosZ = this.posZ; - this.tickCounter1++; + if (this.tickCounter1++ == 100 && !this.worldObj.isRemote) { + this.tickCounter1 = 0; + if (!this.isDead && !this.onValidSurface()) { + this.setDead(); + this.onBroken((Entity) null); + } + } + } /**+ @@ -166,11 +173,32 @@ public abstract class EntityHanging extends Entity { 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.worldObj.isRemote) { + 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.worldObj.isRemote && !this.isDead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) { + this.setDead(); + this.onBroken((Entity) null); + } } @@ -178,6 +206,10 @@ public abstract class EntityHanging extends Entity { * Adds to the current velocity of the entity. Args: x, y, z */ public void addVelocity(double d0, double d1, double d2) { + if (!this.worldObj.isRemote && !this.isDead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) { + this.setDead(); + this.onBroken((Entity) null); + } } diff --git a/src/main/java/net/minecraft/entity/EntityLeashKnot.java b/src/main/java/net/minecraft/entity/EntityLeashKnot.java index 431818a3..14a31af3 100755 --- a/src/main/java/net/minecraft/entity/EntityLeashKnot.java +++ b/src/main/java/net/minecraft/entity/EntityLeashKnot.java @@ -2,6 +2,8 @@ package net.minecraft.entity; import net.minecraft.block.BlockFence; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; @@ -110,6 +112,35 @@ public class EntityLeashKnot extends EntityHanging { * First layer of player interaction */ public boolean interactFirst(EntityPlayer entityplayer) { + ItemStack itemstack = entityplayer.getHeldItem(); + boolean flag = false; + if (itemstack != null && itemstack.getItem() == Items.lead && !this.worldObj.isRemote) { + 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 (!this.worldObj.isRemote && !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; } diff --git a/src/main/java/net/minecraft/entity/EntityList.java b/src/main/java/net/minecraft/entity/EntityList.java index 7c93e2ff..dc04bfae 100755 --- a/src/main/java/net/minecraft/entity/EntityList.java +++ b/src/main/java/net/minecraft/entity/EntityList.java @@ -106,6 +106,8 @@ public class EntityList { 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(); @@ -130,6 +132,7 @@ public class EntityList { 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)); } } @@ -164,6 +167,29 @@ public class EntityList { 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 */ @@ -301,7 +327,7 @@ public class EntityList { 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(EntityItemFrame.class, (w) -> new EntityItemFrame(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); diff --git a/src/main/java/net/minecraft/entity/EntityLiving.java b/src/main/java/net/minecraft/entity/EntityLiving.java index 9c473a43..36b02ade 100755 --- a/src/main/java/net/minecraft/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/entity/EntityLiving.java @@ -1,8 +1,12 @@ package net.minecraft.entity; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; - import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.ai.EntityAITasks; +import net.minecraft.entity.ai.EntityJumpHelper; +import net.minecraft.entity.ai.EntityLookHelper; +import net.minecraft.entity.ai.EntityMoveHelper; +import net.minecraft.entity.ai.EntitySenses; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntityGhast; @@ -20,6 +24,9 @@ import net.minecraft.item.ItemSword; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagFloat; import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.pathfinding.PathNavigateGround; import net.minecraft.stats.AchievementList; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumParticleTypes; @@ -27,6 +34,7 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -51,8 +59,15 @@ import net.minecraft.world.World; public abstract class EntityLiving extends EntityLivingBase { 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. */ @@ -70,7 +85,20 @@ public abstract class EntityLiving extends EntityLivingBase { 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() { @@ -78,6 +106,36 @@ public abstract class EntityLiving extends EntityLivingBase { 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 */ @@ -170,17 +228,23 @@ public abstract class EntityLiving extends EntityLivingBase { * Spawns an explosion particle around the Entity's location */ public void spawnExplosionParticle() { - for (int i = 0; i < 20; ++i) { - double d0 = this.rand.nextGaussian() * 0.02D; - double d1 = this.rand.nextGaussian() * 0.02D; - double d2 = this.rand.nextGaussian() * 0.02D; - double d3 = 10.0D; - this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, - this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width - d0 * d3, - this.posY + (double) (this.rand.nextFloat() * this.height) - d1 * d3, - this.posZ + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width - d2 * d3, - d0, d1, d2, new int[0]); + if (this.worldObj.isRemote) { + for (int i = 0; i < 20; ++i) { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + double d3 = 10.0D; + this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, + this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width + - d0 * d3, + this.posY + (double) (this.rand.nextFloat() * this.height) - d1 * d3, this.posZ + + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width - d2 * d3, + d0, d1, d2, new int[0]); + } + } else { + this.worldObj.setEntityState(this, (byte) 20); } + } public void handleStatusUpdate(byte b0) { @@ -192,6 +256,17 @@ public abstract class EntityLiving extends EntityLivingBase { } + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + if (!this.worldObj.isRemote) { + this.updateLeashedState(); + } + + } + protected float func_110146_f(float var1, float f) { this.bodyHelper.updateRenderAngles(); return f; @@ -322,6 +397,27 @@ public abstract class EntityLiving extends EntityLivingBase { 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.worldObj.isRemote && 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 @@ -429,6 +525,34 @@ public abstract class EntityLiving extends EntityLivingBase { } 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() { @@ -845,6 +969,14 @@ public abstract class EntityLiving extends EntityLivingBase { if (this.isLeashed) { this.isLeashed = false; this.leashedToEntity = null; + if (!this.worldObj.isRemote && dropLead) { + this.dropItem(Items.lead, 1); + } + + if (!this.worldObj.isRemote && sendPacket && this.worldObj instanceof WorldServer) { + ((WorldServer) this.worldObj).getEntityTracker().sendToAllTrackingEntity(this, + new S1BPacketEntityAttach(1, this, (Entity) null)); + } } } @@ -867,6 +999,11 @@ public abstract class EntityLiving extends EntityLivingBase { public void setLeashedToEntity(Entity entityIn, boolean sendAttachNotification) { this.isLeashed = true; this.leashedToEntity = entityIn; + if (!this.worldObj.isRemote && sendAttachNotification && this.worldObj instanceof WorldServer) { + ((WorldServer) this.worldObj).getEntityTracker().sendToAllTrackingEntity(this, + new S1BPacketEntityAttach(1, this, this.leashedToEntity)); + } + } private void recreateLeash() { diff --git a/src/main/java/net/minecraft/entity/EntityLivingBase.java b/src/main/java/net/minecraft/entity/EntityLivingBase.java index b5ffc904..bce18cd1 100755 --- a/src/main/java/net/minecraft/entity/EntityLivingBase.java +++ b/src/main/java/net/minecraft/entity/EntityLivingBase.java @@ -1,18 +1,18 @@ package 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 com.google.common.base.Predicate; -import com.google.common.base.Predicates; -import com.google.common.collect.Maps; - import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.ai.attributes.AttributeModifier; @@ -20,7 +20,12 @@ import net.minecraft.entity.ai.attributes.BaseAttributeMap; import net.minecraft.entity.ai.attributes.IAttribute; import net.minecraft.entity.ai.attributes.IAttributeInstance; import net.minecraft.entity.ai.attributes.ServersideAttributeMap; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.EntityWolf; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; @@ -30,6 +35,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagFloat; import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagShort; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraft.network.play.server.S0BPacketAnimation; +import net.minecraft.network.play.server.S0DPacketCollectItem; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionHelper; @@ -43,6 +51,7 @@ import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -175,6 +184,23 @@ public abstract class EntityLivingBase extends Entity { this.handleWaterMovement(); } + if (!this.worldObj.isRemote && 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); } @@ -203,7 +229,9 @@ public abstract class EntityLivingBase extends Entity { } } - this.extinguish(); + if (this.isImmuneToFire() || this.worldObj.isRemote) { + this.extinguish(); + } boolean flag1 = flag && ((EntityPlayer) this).capabilities.disableDamage; if (this.isEntityAlive()) { @@ -226,6 +254,9 @@ public abstract class EntityLivingBase extends Entity { } } + if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity instanceof EntityLivingBase) { + this.mountEntity((Entity) null); + } } else { this.setAir(300); } @@ -240,7 +271,7 @@ public abstract class EntityLivingBase extends Entity { --this.hurtTime; } - if (this.hurtResistantTime > 0) { + if (this.hurtResistantTime > 0 && !(this instanceof EntityPlayerMP)) { --this.hurtResistantTime; } @@ -289,6 +320,17 @@ public abstract class EntityLivingBase extends Entity { protected void onDeathUpdate() { ++this.deathTime; if (this.deathTime == 20) { + if (!this.worldObj.isRemote && (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(); @@ -420,6 +462,9 @@ public abstract class EntityLivingBase extends Entity { */ public void readEntityFromNBT(NBTTagCompound nbttagcompound) { this.setAbsorptionAmount(nbttagcompound.getFloat("AbsorptionAmount")); + if (nbttagcompound.hasKey("Attributes", 9) && this.worldObj != null && !this.worldObj.isRemote) { + SharedMonsterAttributes.func_151475_a(this.getAttributeMap(), nbttagcompound.getTagList("Attributes", 10)); + } if (nbttagcompound.hasKey("ActiveEffects", 9)) { NBTTagList nbttaglist = nbttagcompound.getTagList("ActiveEffects", 10); @@ -457,12 +502,23 @@ public abstract class EntityLivingBase extends Entity { while (iterator.hasNext()) { Integer integer = (Integer) iterator.next(); PotionEffect potioneffect = (PotionEffect) this.activePotionsMap.get(integer); - if (potioneffect.onUpdate(this) && potioneffect.getDuration() % 600 == 0) { + if (!potioneffect.onUpdate(this)) { + if (!this.worldObj.isRemote) { + iterator.remove(); + this.onFinishedPotionEffect(potioneffect); + } + } else if (potioneffect.getDuration() % 600 == 0) { this.onChangedPotionEffect(potioneffect, false); } } - this.potionsNeedUpdate = false; + if (this.potionsNeedUpdate) { + if (!this.worldObj.isRemote) { + this.updatePotionMetadata(); + } + + this.potionsNeedUpdate = false; + } int i = this.dataWatcher.getWatchableObjectInt(7); boolean flag1 = this.dataWatcher.getWatchableObjectByte(8) > 0; @@ -519,6 +575,16 @@ public abstract class EntityLivingBase extends Entity { } public void clearActivePotions() { + Iterator iterator = this.activePotionsMap.keySet().iterator(); + + while (iterator.hasNext()) { + Integer integer = (Integer) iterator.next(); + PotionEffect potioneffect = (PotionEffect) this.activePotionsMap.get(integer); + if (!this.worldObj.isRemote) { + iterator.remove(); + this.onFinishedPotionEffect(potioneffect); + } + } } @@ -598,14 +664,31 @@ public abstract class EntityLivingBase extends Entity { protected void onNewPotionEffect(PotionEffect potioneffect) { this.potionsNeedUpdate = true; + if (!this.worldObj.isRemote) { + Potion.potionTypes[potioneffect.getPotionID()].applyAttributesModifiersToEntity(this, + this.getAttributeMap(), potioneffect.getAmplifier()); + } + } protected void onChangedPotionEffect(PotionEffect potioneffect, boolean flag) { this.potionsNeedUpdate = true; + if (flag && !this.worldObj.isRemote) { + 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; + if (!this.worldObj.isRemote) { + Potion.potionTypes[potioneffect.getPotionID()].removeAttributesModifiersFromEntity(this, + this.getAttributeMap(), potioneffect.getAmplifier()); + } + } /**+ @@ -631,7 +714,99 @@ public abstract class EntityLivingBase extends Entity { * Called when the entity is attacked. */ public boolean attackEntityFrom(DamageSource damagesource, float f) { - return false; + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else if (this.worldObj.isRemote) { + 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; + } + } } /**+ @@ -671,6 +846,20 @@ public abstract class EntityLivingBase extends Entity { this.dead = true; this.getCombatTracker().reset(); + if (!this.worldObj.isRemote) { + 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); } @@ -922,6 +1111,10 @@ public abstract class EntityLivingBase extends Entity { || this.swingProgressInt < 0) { this.swingProgressInt = -1; this.isSwingInProgress = true; + if (this.worldObj instanceof WorldServer) { + ((WorldServer) this.worldObj).getEntityTracker().sendToAllTrackingEntity(this, + new S0BPacketAnimation(this, 0)); + } } } @@ -989,6 +1182,7 @@ public abstract class EntityLivingBase extends Entity { if (this.attributeMap == null) { this.attributeMap = new ServersideAttributeMap(); } + return this.attributeMap; } @@ -1171,9 +1365,11 @@ public abstract class EntityLivingBase extends Entity { this.motionY = 0.2D; } - if (!this.worldObj.isBlockLoaded(new BlockPos((int) this.posX, 0, (int) this.posZ)) - || !this.worldObj.getChunkFromBlockCoords(new BlockPos((int) this.posX, 0, (int) this.posZ)) - .isLoaded()) { + if (this.worldObj.isRemote + && (!this.worldObj.isBlockLoaded(new BlockPos((int) this.posX, 0, (int) this.posZ)) + || !this.worldObj + .getChunkFromBlockCoords(new BlockPos((int) this.posX, 0, (int) this.posZ)) + .isLoaded())) { if (this.posY > 0.0D) { this.motionY = -0.1D; } else { @@ -1273,6 +1469,42 @@ public abstract class EntityLivingBase extends Entity { */ public void onUpdate() { super.onUpdate(); + if (!this.worldObj.isRemote) { + 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; @@ -1436,6 +1668,10 @@ public abstract class EntityLivingBase extends Entity { this.moveEntityWithHeading(this.moveStrafing, this.moveForward); this.worldObj.theProfiler.endSection(); this.worldObj.theProfiler.startSection("push"); + if (!this.worldObj.isRemote) { + this.collideWithNearbyEntities(); + } + this.worldObj.theProfiler.endSection(); } @@ -1469,6 +1705,10 @@ public abstract class EntityLivingBase extends Entity { */ public void mountEntity(Entity entity) { if (this.ridingEntity != null && entity == null) { + if (!this.worldObj.isRemote) { + this.dismountEntity(this.ridingEntity); + } + if (this.ridingEntity != null) { this.ridingEntity.riddenByEntity = null; } @@ -1507,6 +1747,23 @@ public abstract class EntityLivingBase extends Entity { * Args: pickedUpEntity, stackSize */ public void onItemPickup(Entity entity, int var2) { + if (!entity.isDead && !this.worldObj.isRemote) { + 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())); + } + } } @@ -1556,7 +1813,7 @@ public abstract class EntityLivingBase extends Entity { * Returns whether the entity is in a server world */ public boolean isServerWorld() { - return false; + return !this.worldObj.isRemote; } /**+ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityTracker.java b/src/main/java/net/minecraft/entity/EntityTracker.java similarity index 73% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityTracker.java rename to src/main/java/net/minecraft/entity/EntityTracker.java index 9145ab58..47b7ae27 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityTracker.java +++ b/src/main/java/net/minecraft/entity/EntityTracker.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; +package net.minecraft.entity; import com.google.common.collect.Lists; import com.google.common.collect.Sets; @@ -7,44 +7,42 @@ 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.minecraft.entity.Entity; +import net.minecraft.entity.EntityHanging; +import net.minecraft.entity.EntityTrackerEntry; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.network.Packet; +import net.minecraft.util.IntHashMap; +import net.minecraft.util.ReportedException; +import net.minecraft.world.WorldServer; +import 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. * @@ -67,10 +65,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityTracker { - static { - __checkIntegratedContextValid("net/minecraft/entity/EntityTracker"); - } - private static final Logger logger = LogManager.getLogger(); private final WorldServer theWorld; /**+ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityTrackerEntry.java b/src/main/java/net/minecraft/entity/EntityTrackerEntry.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityTrackerEntry.java rename to src/main/java/net/minecraft/entity/EntityTrackerEntry.java index 079cb9a6..e8f723a2 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/entity/EntityTrackerEntry.java @@ -1,71 +1,69 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity; +package 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.block.Block; +import net.minecraft.entity.DataWatcher; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLeashKnot; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.attributes.ServersideAttributeMap; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.init.Items; +import net.minecraft.item.ItemMap; +import 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.minecraft.network.Packet; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraft.network.play.server.S0APacketUseBed; +import net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import net.minecraft.network.play.server.S0EPacketSpawnObject; +import net.minecraft.network.play.server.S0FPacketSpawnMob; +import net.minecraft.network.play.server.S10PacketSpawnPainting; +import net.minecraft.network.play.server.S11PacketSpawnExperienceOrb; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.network.play.server.S14PacketEntity; +import net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.minecraft.network.play.server.S19PacketEntityHeadLook; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.network.play.server.S1CPacketEntityMetadata; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S20PacketEntityProperties; +import net.minecraft.network.play.server.S49PacketUpdateEntityNBT; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import 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. * @@ -88,10 +86,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityTrackerEntry { - static { - __checkIntegratedContextValid("net/minecraft/entity/EntityTrackerEntry"); - } - private static final Logger logger = LogManager.getLogger(); public Entity trackedEntity; public int trackingDistanceThreshold; @@ -509,7 +503,8 @@ public class EntityTrackerEntry { s0epacketspawnobject2 = new S0EPacketSpawnObject(this.trackedEntity, b0, ((EntityFireball) this.trackedEntity).shootingEntity.getEntityId()); } else { - s0epacketspawnobject2 = new S0EPacketSpawnObject(this.trackedEntity, b0, 0); + s0epacketspawnobject2 = new S0EPacketSpawnObject(this.trackedEntity, b0, + this.trackedEntity.getEntityId()); } s0epacketspawnobject2.setSpeedX((int) (entityfireball.accelerationX * 8000.0D)); 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/minecraft/entity/ai/EntityAIArrowAttack.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIArrowAttack.java rename to src/main/java/net/minecraft/entity/ai/EntityAIArrowAttack.java index 32e7f9a9..9d8b8863 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIArrowAttack.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIArrowAttack.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.util.MathHelper; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIArrowAttack extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIArrowAttack"); - } - private final EntityLiving entityHost; private final IRangedAttackMob rangedAttackEntityHost; private EntityLivingBase attackTarget; 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/minecraft/entity/ai/EntityAIAttackOnCollide.java similarity index 82% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIAttackOnCollide.java rename to src/main/java/net/minecraft/entity/ai/EntityAIAttackOnCollide.java index c81e4123..f9cc7420 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIAttackOnCollide.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIAttackOnCollide.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIAttackOnCollide extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIAttackOnCollide"); - } - World worldObj; protected EntityCreature attacker; int attackTick; 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/minecraft/entity/ai/EntityAIAvoidEntity.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIAvoidEntity.java rename to src/main/java/net/minecraft/entity/ai/EntityAIAvoidEntity.java index d8bc5153..a45e72a9 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIAvoidEntity.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIAvoidEntity.java @@ -1,18 +1,16 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.RandomPositionGenerator; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.util.EntitySelectors; +import net.minecraft.util.Vec3; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -36,10 +34,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIAvoidEntity extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIAvoidEntity"); - } - private final Predicate canBeSeenSelector; protected EntityCreature theEntity; private double farSpeed; 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/minecraft/entity/ai/EntityAIBase.java similarity index 87% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIBase.java rename to src/main/java/net/minecraft/entity/ai/EntityAIBase.java index 40233bf3..a4ae87dc 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIBase.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIBase.java @@ -1,6 +1,4 @@ -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; +package net.minecraft.entity.ai; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -24,10 +22,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public abstract class EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIBase"); - } - private int mutexBits; public abstract boolean shouldExecute(); 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/minecraft/entity/ai/EntityAIBeg.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIBeg.java rename to src/main/java/net/minecraft/entity/ai/EntityAIBeg.java index f3e9e7df..43c29116 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIBeg.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIBeg.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,10 +29,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIBeg extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIBeg"); - } - private EntityWolf theWolf; private EntityPlayer thePlayer; private World worldObject; 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/minecraft/entity/ai/EntityAIBreakDoor.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIBreakDoor.java rename to src/main/java/net/minecraft/entity/ai/EntityAIBreakDoor.java index 6f3bd1ca..51015774 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIBreakDoor.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIBreakDoor.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoor; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.ai.EntityAIDoorInteract; +import net.minecraft.world.EnumDifficulty; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIBreakDoor extends EntityAIDoorInteract { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIBreakDoor"); - } - private int breakingTime; private int previousBreakProgress = -1; 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/minecraft/entity/ai/EntityAIControlledByPlayer.java similarity index 80% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIControlledByPlayer.java rename to src/main/java/net/minecraft/entity/ai/EntityAIControlledByPlayer.java index f1d8a7a6..5167ee6b 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIControlledByPlayer.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIControlledByPlayer.java @@ -1,20 +1,18 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSlab; +import net.minecraft.block.BlockStairs; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.pathfinder.WalkNodeProcessor; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -38,10 +36,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIControlledByPlayer extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIControlledByPlayer"); - } - private final EntityLiving thisEntity; private final float maxSpeed; private float currentSpeed; 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/minecraft/entity/ai/EntityAICreeperSwell.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAICreeperSwell.java rename to src/main/java/net/minecraft/entity/ai/EntityAICreeperSwell.java index 9a9769d4..c494dc87 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAICreeperSwell.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAICreeperSwell.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.monster.EntityCreeper; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAICreeperSwell extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAICreeperSwell"); - } - EntityCreeper swellingCreeper; EntityLivingBase creeperAttackTarget; 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/minecraft/entity/ai/EntityAIDefendVillage.java similarity index 73% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIDefendVillage.java rename to src/main/java/net/minecraft/entity/ai/EntityAIDefendVillage.java index 9b9f46db..d93ef563 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIDefendVillage.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIDefendVillage.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAITarget; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.village.Village; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIDefendVillage extends EntityAITarget { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIDefendVillage"); - } - EntityIronGolem irongolem; EntityLivingBase villageAgressorTarget; 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/minecraft/entity/ai/EntityAIDoorInteract.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIDoorInteract.java rename to src/main/java/net/minecraft/entity/ai/EntityAIDoorInteract.java index 806e2379..efcfef64 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIDoorInteract.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIDoorInteract.java @@ -1,16 +1,14 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoor; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.BlockPos; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -34,10 +32,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public abstract class EntityAIDoorInteract extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIDoorInteract"); - } - protected EntityLiving theEntity; protected BlockPos doorPosition = BlockPos.ORIGIN; protected BlockDoor doorBlock; 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/minecraft/entity/ai/EntityAIEatGrass.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIEatGrass.java rename to src/main/java/net/minecraft/entity/ai/EntityAIEatGrass.java index 0c1b52c4..baab02ae 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIEatGrass.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIEatGrass.java @@ -1,18 +1,16 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockStateHelper; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -36,10 +34,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/entity/ai/EntityAIFindEntityNearest.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFindEntityNearest.java rename to src/main/java/net/minecraft/entity/ai/EntityAIFindEntityNearest.java index 06fff5a0..9c7351cd 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFindEntityNearest.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIFindEntityNearest.java @@ -1,22 +1,20 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAITarget; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import 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. * @@ -39,10 +37,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.java similarity index 75% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.java rename to src/main/java/net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.java index 25a26c89..5e559035 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIFindEntityNearestPlayer.java @@ -1,25 +1,23 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAITarget; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import 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. * @@ -42,10 +40,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/entity/ai/EntityAIFleeSun.java similarity index 80% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFleeSun.java rename to src/main/java/net/minecraft/entity/ai/EntityAIFleeSun.java index cda53ae7..68fcc53b 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFleeSun.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIFleeSun.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,10 +29,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIFleeSun extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIFleeSun"); - } - private EntityCreature theCreature; private double shelterX; private double shelterY; 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/minecraft/entity/ai/EntityAIFollowGolem.java similarity index 82% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFollowGolem.java rename to src/main/java/net/minecraft/entity/ai/EntityAIFollowGolem.java index 7b384f62..92ebb63e 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFollowGolem.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIFollowGolem.java @@ -1,11 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.passive.EntityVillager; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +27,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIFollowGolem extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIFollowGolem"); - } - private EntityVillager theVillager; private EntityIronGolem theGolem; private int takeGolemRoseTick; 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/minecraft/entity/ai/EntityAIFollowOwner.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFollowOwner.java rename to src/main/java/net/minecraft/entity/ai/EntityAIFollowOwner.java index 99d526c5..e652cf76 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFollowOwner.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIFollowOwner.java @@ -1,19 +1,17 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.pathfinding.PathNavigateGround; +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. @@ -37,10 +35,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIFollowOwner extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIFollowOwner"); - } - private EntityTameable thePet; private EntityLivingBase theOwner; World theWorld; 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/minecraft/entity/ai/EntityAIFollowParent.java similarity index 84% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFollowParent.java rename to src/main/java/net/minecraft/entity/ai/EntityAIFollowParent.java index ebd910c7..6acadd9d 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIFollowParent.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIFollowParent.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.passive.EntityAnimal; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIFollowParent extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIFollowParent"); - } - EntityAnimal childAnimal; EntityAnimal parentAnimal; double moveSpeed; 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/minecraft/entity/ai/EntityAIHarvestFarmland.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIHarvestFarmland.java rename to src/main/java/net/minecraft/entity/ai/EntityAIHarvestFarmland.java index bf2f54be..a1b3aac6 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIHarvestFarmland.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIHarvestFarmland.java @@ -1,18 +1,16 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockCrops; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.ai.EntityAIMoveToBlock; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryBasic; +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. @@ -36,10 +34,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIHarvestFarmland extends EntityAIMoveToBlock { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIHarvestFarmland"); - } - private final EntityVillager theVillager; private boolean hasFarmItem; private boolean field_179503_e; 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/minecraft/entity/ai/EntityAIHurtByTarget.java similarity index 80% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIHurtByTarget.java rename to src/main/java/net/minecraft/entity/ai/EntityAIHurtByTarget.java index 85b1df9c..d5997e86 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIHurtByTarget.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIHurtByTarget.java @@ -1,11 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAITarget; +import net.minecraft.util.AxisAlignedBB; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +27,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIHurtByTarget extends EntityAITarget { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIHurtByTarget"); - } - private boolean entityCallsForHelp; private int revengeTimerOld; private final Class[] targetClasses; 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/minecraft/entity/ai/EntityAILeapAtTarget.java similarity index 78% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILeapAtTarget.java rename to src/main/java/net/minecraft/entity/ai/EntityAILeapAtTarget.java index 3fb9524b..8ad06836 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILeapAtTarget.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAILeapAtTarget.java @@ -1,11 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.util.MathHelper; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +27,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAILeapAtTarget extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAILeapAtTarget"); - } - EntityLiving leaper; EntityLivingBase leapTarget; float leapMotionY; 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/minecraft/entity/ai/EntityAILookAtTradePlayer.java similarity index 72% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILookAtTradePlayer.java rename to src/main/java/net/minecraft/entity/ai/EntityAILookAtTradePlayer.java index 50577e18..ed6d86c2 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILookAtTradePlayer.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAILookAtTradePlayer.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAILookAtTradePlayer extends EntityAIWatchClosest { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAILookAtTradePlayer"); - } - private final EntityVillager theMerchant; public EntityAILookAtTradePlayer(EntityVillager theMerchantIn) { 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/minecraft/entity/ai/EntityAILookAtVillager.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILookAtVillager.java rename to src/main/java/net/minecraft/entity/ai/EntityAILookAtVillager.java index 91cfe81b..f7080dde 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILookAtVillager.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAILookAtVillager.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.passive.EntityVillager; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAILookAtVillager extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAILookAtVillager"); - } - private EntityIronGolem theGolem; private EntityVillager theVillager; private int lookTime; 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/minecraft/entity/ai/EntityAILookIdle.java similarity index 81% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILookIdle.java rename to src/main/java/net/minecraft/entity/ai/EntityAILookIdle.java index 9c165f54..fcb068ca 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAILookIdle.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAILookIdle.java @@ -1,9 +1,7 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.ai.EntityAIBase; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -27,10 +25,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAILookIdle extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAILookIdle"); - } - private EntityLiving idleEntity; private double lookX; private double lookZ; 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/minecraft/entity/ai/EntityAIMate.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMate.java rename to src/main/java/net/minecraft/entity/ai/EntityAIMate.java index e1ff42f2..5e50139d 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMate.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIMate.java @@ -1,19 +1,17 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityCow; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatList; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -37,10 +35,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIMate extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIMate"); - } - private EntityAnimal theAnimal; World theWorld; private EntityAnimal targetMate; 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/minecraft/entity/ai/EntityAIMoveIndoors.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveIndoors.java rename to src/main/java/net/minecraft/entity/ai/EntityAIMoveIndoors.java index cc98305e..4db5fb64 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveIndoors.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIMoveIndoors.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.RandomPositionGenerator; +import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; +import net.minecraft.village.Village; +import net.minecraft.village.VillageDoorInfo; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIMoveIndoors extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIMoveIndoors"); - } - private EntityCreature entityObj; private VillageDoorInfo doorInfo; private int insidePosX = -1; 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/minecraft/entity/ai/EntityAIMoveThroughVillage.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveThroughVillage.java rename to src/main/java/net/minecraft/entity/ai/EntityAIMoveThroughVillage.java index 2711bf90..e878b553 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveThroughVillage.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIMoveThroughVillage.java @@ -1,19 +1,17 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.RandomPositionGenerator; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.village.Village; +import net.minecraft.village.VillageDoorInfo; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -37,10 +35,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIMoveThroughVillage extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIMoveThroughVillage"); - } - private EntityCreature theEntity; private double movementSpeed; private PathEntity entityPathNavigate; 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/minecraft/entity/ai/EntityAIMoveToBlock.java similarity index 85% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveToBlock.java rename to src/main/java/net/minecraft/entity/ai/EntityAIMoveToBlock.java index 4f073082..18ae6b3d 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveToBlock.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIMoveToBlock.java @@ -1,11 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +27,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public abstract class EntityAIMoveToBlock extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIMoveToBlock"); - } - private final EntityCreature theEntity; private final double movementSpeed; protected int runDelay; 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/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java similarity index 75% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java rename to src/main/java/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java index 2d5072f1..d28e996f 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.RandomPositionGenerator; +import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIMoveTowardsRestriction extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIMoveTowardsRestriction"); - } - private EntityCreature theEntity; private double movePosX; private double movePosY; 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/minecraft/entity/ai/EntityAIMoveTowardsTarget.java similarity index 78% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.java rename to src/main/java/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.java index 41b92283..8e9a1c5a 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.RandomPositionGenerator; +import net.minecraft.util.Vec3; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIMoveTowardsTarget extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIMoveTowardsTarget"); - } - private EntityCreature theEntity; private EntityLivingBase targetEntity; private double movePosX; 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/minecraft/entity/ai/EntityAINearestAttackableTarget.java similarity index 82% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java rename to src/main/java/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java index e19ae95b..dc83dd5e 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java @@ -1,18 +1,16 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAITarget; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.EntitySelectors; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -36,10 +34,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/entity/ai/EntityAIOcelotAttack.java similarity index 80% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOcelotAttack.java rename to src/main/java/net/minecraft/entity/ai/EntityAIOcelotAttack.java index 90e1c46f..324e77b8 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOcelotAttack.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIOcelotAttack.java @@ -1,11 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +27,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIOcelotAttack extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIOcelotAttack"); - } - World theWorld; EntityLiving theEntity; EntityLivingBase theVictim; 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/minecraft/entity/ai/EntityAIOcelotSit.java similarity index 70% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOcelotSit.java rename to src/main/java/net/minecraft/entity/ai/EntityAIOcelotSit.java index 94742102..332e0933 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOcelotSit.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIOcelotSit.java @@ -1,17 +1,15 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.ai.EntityAIMoveToBlock; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -35,10 +33,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIOcelotSit extends EntityAIMoveToBlock { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIOcelotSit"); - } - private final EntityOcelot field_151493_a; public EntityAIOcelotSit(EntityOcelot parEntityOcelot, double parDouble1) { 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/minecraft/entity/ai/EntityAIOpenDoor.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOpenDoor.java rename to src/main/java/net/minecraft/entity/ai/EntityAIOpenDoor.java index 9ba23c3b..56f424a0 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOpenDoor.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIOpenDoor.java @@ -1,9 +1,7 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.ai.EntityAIDoorInteract; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -27,10 +25,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIOpenDoor extends EntityAIDoorInteract { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIOpenDoor"); - } - boolean closeDoor; int closeDoorTemporisation; 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/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java rename to src/main/java/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java index 5893d932..270dbffb 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAITarget; +import net.minecraft.entity.passive.EntityTameable; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIOwnerHurtByTarget extends EntityAITarget { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIOwnerHurtByTarget"); - } - EntityTameable theDefendingTameable; EntityLivingBase theOwnerAttacker; private int field_142051_e; 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/minecraft/entity/ai/EntityAIOwnerHurtTarget.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.java rename to src/main/java/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.java index c4400548..6a69d549 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAITarget; +import net.minecraft.entity.passive.EntityTameable; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIOwnerHurtTarget extends EntityAITarget { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIOwnerHurtTarget"); - } - EntityTameable theEntityTameable; EntityLivingBase theTarget; private int field_142050_e; 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/minecraft/entity/ai/EntityAIPanic.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIPanic.java rename to src/main/java/net/minecraft/entity/ai/EntityAIPanic.java index 1fd701b9..22c575b2 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIPanic.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIPanic.java @@ -1,11 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.RandomPositionGenerator; +import net.minecraft.util.Vec3; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +27,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIPanic extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIPanic"); - } - private EntityCreature theEntityCreature; protected double speed; private double randPosX; 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/minecraft/entity/ai/EntityAIPlay.java similarity index 80% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIPlay.java rename to src/main/java/net/minecraft/entity/ai/EntityAIPlay.java index ad37819d..aa7b1d55 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIPlay.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIPlay.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.RandomPositionGenerator; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.util.Vec3; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,10 +29,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIPlay extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIPlay"); - } - private EntityVillager villagerObj; private EntityLivingBase targetVillager; private double speed; 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/minecraft/entity/ai/EntityAIRestrictOpenDoor.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.java rename to src/main/java/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.java index af59fa1a..1d3945ee 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.util.BlockPos; +import net.minecraft.village.Village; +import net.minecraft.village.VillageDoorInfo; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,10 +29,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIRestrictOpenDoor extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIRestrictOpenDoor"); - } - private EntityCreature entityObj; private VillageDoorInfo frontDoor; 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/minecraft/entity/ai/EntityAIRestrictSun.java similarity index 74% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIRestrictSun.java rename to src/main/java/net/minecraft/entity/ai/EntityAIRestrictSun.java index 5596b10f..10faca01 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIRestrictSun.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIRestrictSun.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.pathfinding.PathNavigateGround; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIRestrictSun extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIRestrictSun"); - } - private EntityCreature theEntity; public EntityAIRestrictSun(EntityCreature parEntityCreature) { 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/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java rename to src/main/java/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java index f4bbe873..506c9db1 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.Entity; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.RandomPositionGenerator; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.Vec3; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,10 +29,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIRunAroundLikeCrazy extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy"); - } - private EntityHorse horseHost; private double speed; private double targetX; 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/minecraft/entity/ai/EntityAISit.java similarity index 78% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAISit.java rename to src/main/java/net/minecraft/entity/ai/EntityAISit.java index 8166182c..1e16b8a3 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAISit.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAISit.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.passive.EntityTameable; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAISit extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAISit"); - } - private EntityTameable theEntity; private boolean isSitting; 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/minecraft/entity/ai/EntityAISwimming.java similarity index 73% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAISwimming.java rename to src/main/java/net/minecraft/entity/ai/EntityAISwimming.java index d71b5456..aeff8fa2 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAISwimming.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAISwimming.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.pathfinding.PathNavigateGround; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAISwimming extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAISwimming"); - } - private EntityLiving theEntity; public EntityAISwimming(EntityLiving entitylivingIn) { 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/minecraft/entity/ai/EntityAITarget.java similarity index 78% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITarget.java rename to src/main/java/net/minecraft/entity/ai/EntityAITarget.java index 38f0dae9..aea3dd53 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITarget.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAITarget.java @@ -1,23 +1,21 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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 net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityOwnable; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.scoreboard.Team; +import net.minecraft.util.BlockPos; +import 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. * @@ -40,10 +38,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public abstract class EntityAITarget extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAITarget"); - } - protected final EntityCreature taskOwner; protected boolean shouldCheckSight; private boolean nearbyOnly; 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/minecraft/entity/ai/EntityAITargetNonTamed.java similarity index 73% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITargetNonTamed.java rename to src/main/java/net/minecraft/entity/ai/EntityAITargetNonTamed.java index 97ce9bb7..f1d6f835 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITargetNonTamed.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAITargetNonTamed.java @@ -1,11 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.passive.EntityTameable; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +27,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAITargetNonTamed extends EntityAINearestAttackableTarget { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAITargetNonTamed"); - } - private EntityTameable theTameable; public EntityAITargetNonTamed(EntityTameable entityIn, Class classTarget, boolean checkSight, 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/minecraft/entity/ai/EntityAITasks.java similarity index 90% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITasks.java rename to src/main/java/net/minecraft/entity/ai/EntityAITasks.java index a7195207..f2e2e191 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITasks.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAITasks.java @@ -1,15 +1,13 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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.minecraft.entity.ai.EntityAIBase; +import 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. * @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAITasks { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAITasks"); - } - private static final Logger logger = LogManager.getLogger(); /**+ * A list of EntityAITaskEntrys in EntityAITasks. 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/minecraft/entity/ai/EntityAITempt.java similarity index 82% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITempt.java rename to src/main/java/net/minecraft/entity/ai/EntityAITempt.java index f00ba27d..ea9ec169 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITempt.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAITempt.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.pathfinding.PathNavigateGround; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,10 +29,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAITempt extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAITempt"); - } - private EntityCreature temptedEntity; private double speed; private double targetX; 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/minecraft/entity/ai/EntityAITradePlayer.java similarity index 74% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITradePlayer.java rename to src/main/java/net/minecraft/entity/ai/EntityAITradePlayer.java index 34c5db96..2318cea6 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAITradePlayer.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAITradePlayer.java @@ -1,11 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +27,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAITradePlayer extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAITradePlayer"); - } - private EntityVillager villager; public EntityAITradePlayer(EntityVillager villagerIn) { 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/minecraft/entity/ai/EntityAIVillagerInteract.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIVillagerInteract.java rename to src/main/java/net/minecraft/entity/ai/EntityAIVillagerInteract.java index 03288b61..fdc0360d 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIVillagerInteract.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIVillagerInteract.java @@ -1,15 +1,13 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.ai.EntityAIWatchClosest2; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -33,10 +31,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIVillagerInteract extends EntityAIWatchClosest2 { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIVillagerInteract"); - } - private int interactionDelay; private EntityVillager villager; 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/minecraft/entity/ai/EntityAIVillagerMate.java similarity index 82% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIVillagerMate.java rename to src/main/java/net/minecraft/entity/ai/EntityAIVillagerMate.java index ad94932e..8bc6d250 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIVillagerMate.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIVillagerMate.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.Entity; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.util.BlockPos; +import net.minecraft.village.Village; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,10 +29,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIVillagerMate extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIVillagerMate"); - } - private EntityVillager villagerObj; private EntityVillager mate; private World worldObj; 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/minecraft/entity/ai/EntityAIWander.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIWander.java rename to src/main/java/net/minecraft/entity/ai/EntityAIWander.java index d2410c0d..5a5532b5 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIWander.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIWander.java @@ -1,11 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.RandomPositionGenerator; +import net.minecraft.util.Vec3; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +27,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIWander extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIWander"); - } - private EntityCreature entity; private double xPosition; private double yPosition; 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/minecraft/entity/ai/EntityAIWatchClosest.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIWatchClosest.java rename to src/main/java/net/minecraft/entity/ai/EntityAIWatchClosest.java index 37fa1d84..c5961069 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIWatchClosest.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIWatchClosest.java @@ -1,11 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.player.EntityPlayer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +27,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityAIWatchClosest extends EntityAIBase { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityAIWatchClosest"); - } - protected EntityLiving theWatcher; protected Entity closestEntity; protected float maxDistanceForPlayer; 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/minecraft/entity/ai/EntityAIWatchClosest2.java similarity index 70% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIWatchClosest2.java rename to src/main/java/net/minecraft/entity/ai/EntityAIWatchClosest2.java index 91c27301..d1b36da2 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityAIWatchClosest2.java +++ b/src/main/java/net/minecraft/entity/ai/EntityAIWatchClosest2.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.ai.EntityAIWatchClosest; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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); 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/minecraft/entity/ai/EntityJumpHelper.java similarity index 78% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityJumpHelper.java rename to src/main/java/net/minecraft/entity/ai/EntityJumpHelper.java index 855eff57..ce321681 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityJumpHelper.java +++ b/src/main/java/net/minecraft/entity/ai/EntityJumpHelper.java @@ -1,8 +1,6 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityLiving; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -26,10 +24,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityJumpHelper { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityJumpHelper"); - } - private EntityLiving entity; protected boolean isJumping; 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/minecraft/entity/ai/EntityLookHelper.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityLookHelper.java rename to src/main/java/net/minecraft/entity/ai/EntityLookHelper.java index 485974f1..f6c57298 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityLookHelper.java +++ b/src/main/java/net/minecraft/entity/ai/EntityLookHelper.java @@ -1,11 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +27,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityLookHelper { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityLookHelper"); - } - private EntityLiving entity; private float deltaLookYaw; private float deltaLookPitch; 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/minecraft/entity/ai/EntityMoveHelper.java similarity index 82% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityMoveHelper.java rename to src/main/java/net/minecraft/entity/ai/EntityMoveHelper.java index d0a84758..5019565c 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntityMoveHelper.java +++ b/src/main/java/net/minecraft/entity/ai/EntityMoveHelper.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.util.MathHelper; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntityMoveHelper { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntityMoveHelper"); - } - protected EntityLiving entity; protected double posX; protected double posY; 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/minecraft/entity/ai/EntitySenses.java similarity index 81% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntitySenses.java rename to src/main/java/net/minecraft/entity/ai/EntitySenses.java index 690f5617..17610a0a 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/EntitySenses.java +++ b/src/main/java/net/minecraft/entity/ai/EntitySenses.java @@ -1,11 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +27,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class EntitySenses { - static { - __checkIntegratedContextValid("net/minecraft/entity/ai/EntitySenses"); - } - EntityLiving entityObj; List seenEntities = Lists.newArrayList(); List unseenEntities = Lists.newArrayList(); 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/minecraft/entity/ai/RandomPositionGenerator.java similarity index 87% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/RandomPositionGenerator.java rename to src/main/java/net/minecraft/entity/ai/RandomPositionGenerator.java index 4c28083b..ee8852c7 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/ai/RandomPositionGenerator.java +++ b/src/main/java/net/minecraft/entity/ai/RandomPositionGenerator.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.ai; +package 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; +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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. diff --git a/src/main/java/net/minecraft/entity/boss/EntityDragon.java b/src/main/java/net/minecraft/entity/boss/EntityDragon.java index 84c5e94a..bf79be04 100755 --- a/src/main/java/net/minecraft/entity/boss/EntityDragon.java +++ b/src/main/java/net/minecraft/entity/boss/EntityDragon.java @@ -1,18 +1,33 @@ package net.minecraft.entity.boss; +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.Iterator; import java.util.List; - +import net.minecraft.block.Block; +import net.minecraft.block.BlockTorch; +import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IEntityMultiPart; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.boss.EntityDragonPart; +import net.minecraft.entity.boss.IBossDisplayData; import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.monster.IMob; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.EntityDamageSource; +import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.Explosion; import net.minecraft.world.World; /**+ @@ -123,11 +138,13 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt * to react to sunlight and start to burn. */ public void onLivingUpdate() { - float f = MathHelper.cos(this.animTime * 3.1415927F * 2.0F); - float f1 = MathHelper.cos(this.prevAnimTime * 3.1415927F * 2.0F); - if (f1 <= -0.3F && f >= -0.3F && !this.isSilent()) { - this.worldObj.playSound(this.posX, this.posY, this.posZ, "mob.enderdragon.wings", 5.0F, - 0.8F + this.rand.nextFloat() * 0.3F, false); + if (this.worldObj.isRemote) { + float f = MathHelper.cos(this.animTime * 3.1415927F * 2.0F); + float f1 = MathHelper.cos(this.prevAnimTime * 3.1415927F * 2.0F); + if (f1 <= -0.3F && f >= -0.3F && !this.isSilent()) { + this.worldObj.playSound(this.posX, this.posY, this.posZ, "mob.enderdragon.wings", 5.0F, + 0.8F + this.rand.nextFloat() * 0.3F, false); + } } this.prevAnimTime = this.animTime; @@ -166,19 +183,100 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt this.ringBuffer[this.ringBufferIndex][0] = (double) this.rotationYaw; this.ringBuffer[this.ringBufferIndex][1] = this.posY; - if (this.newPosRotationIncrements > 0) { - double d10 = this.posX + (this.newPosX - this.posX) / (double) this.newPosRotationIncrements; - double d0 = this.posY + (this.newPosY - this.posY) / (double) this.newPosRotationIncrements; - double d1 = this.posZ + (this.newPosZ - this.posZ) / (double) this.newPosRotationIncrements; - double d2 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double) this.rotationYaw); - this.rotationYaw = (float) ((double) this.rotationYaw - + d2 / (double) this.newPosRotationIncrements); - this.rotationPitch = (float) ((double) this.rotationPitch - + (this.newRotationPitch - (double) this.rotationPitch) - / (double) this.newPosRotationIncrements); - --this.newPosRotationIncrements; - this.setPosition(d10, d0, d1); - this.setRotation(this.rotationYaw, this.rotationPitch); + if (this.worldObj.isRemote) { + if (this.newPosRotationIncrements > 0) { + double d10 = this.posX + (this.newPosX - this.posX) / (double) this.newPosRotationIncrements; + double d0 = this.posY + (this.newPosY - this.posY) / (double) this.newPosRotationIncrements; + double d1 = this.posZ + (this.newPosZ - this.posZ) / (double) this.newPosRotationIncrements; + double d2 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double) this.rotationYaw); + this.rotationYaw = (float) ((double) this.rotationYaw + + d2 / (double) this.newPosRotationIncrements); + this.rotationPitch = (float) ((double) this.rotationPitch + + (this.newRotationPitch - (double) this.rotationPitch) + / (double) this.newPosRotationIncrements); + --this.newPosRotationIncrements; + this.setPosition(d10, d0, d1); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + } else { + 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; @@ -208,6 +306,16 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt 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.worldObj.isRemote && 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); @@ -245,6 +353,11 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt this.posZ + (double) ((f4 * f23 + f22 * f24) * f2), 0.0F, 0.0F); } + if (!this.worldObj.isRemote) { + this.slowed = this.destroyBlocksInAABB(this.dragonPartHead.getEntityBoundingBox()) + | this.destroyBlocksInAABB(this.dragonPartBody.getEntityBoundingBox()); + } + } } } @@ -255,6 +368,11 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt private void updateDragonEnderCrystal() { if (this.healingEnderCrystal != null) { if (this.healingEnderCrystal.isDead) { + if (!this.worldObj.isRemote) { + 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); @@ -281,6 +399,80 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt } + /**+ + * 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. @@ -289,6 +481,51 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt 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; @@ -347,9 +584,88 @@ public class EntityDragon extends EntityLiving implements IBossDisplayData, IEnt 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.worldObj.isRemote) { + 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 && !this.worldObj.isRemote) { + 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()); } /**+ diff --git a/src/main/java/net/minecraft/entity/boss/EntityWither.java b/src/main/java/net/minecraft/entity/boss/EntityWither.java index ad5ce3b7..d48ea134 100755 --- a/src/main/java/net/minecraft/entity/boss/EntityWither.java +++ b/src/main/java/net/minecraft/entity/boss/EntityWither.java @@ -1,17 +1,24 @@ package net.minecraft.entity.boss; -import java.util.List; - import com.google.common.base.Predicate; import com.google.common.base.Predicates; - +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.IRangedAttackMob; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.boss.IBossDisplayData; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.player.EntityPlayer; @@ -20,7 +27,9 @@ import net.minecraft.entity.projectile.EntityWitherSkull; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathNavigateGround; import net.minecraft.potion.PotionEffect; +import net.minecraft.stats.AchievementList; import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.EntitySelectors; @@ -73,6 +82,15 @@ public class EntityWither extends EntityMob implements IBossDisplayData, IRanged 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; } @@ -130,6 +148,27 @@ public class EntityWither extends EntityMob implements IBossDisplayData, IRanged */ public void onLivingUpdate() { this.motionY *= 0.6000000238418579D; + if (!this.worldObj.isRemote && 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; @@ -461,6 +500,13 @@ public class EntityWither extends EntityMob implements IBossDisplayData, IRanged entityitem.setNoDespawn(); } + if (!this.worldObj.isRemote) { + for (EntityPlayer entityplayer : this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, + this.getEntityBoundingBox().expand(50.0D, 100.0D, 50.0D))) { + entityplayer.triggerAchievement(AchievementList.killWither); + } + } + } /**+ diff --git a/src/main/java/net/minecraft/entity/effect/EntityLightningBolt.java b/src/main/java/net/minecraft/entity/effect/EntityLightningBolt.java index 6b78bce8..7a8f7530 100755 --- a/src/main/java/net/minecraft/entity/effect/EntityLightningBolt.java +++ b/src/main/java/net/minecraft/entity/effect/EntityLightningBolt.java @@ -1,6 +1,14 @@ package net.minecraft.entity.effect; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.effect.EntityWeatherEffect; +import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; /**+ @@ -34,6 +42,25 @@ public class EntityLightningBolt extends EntityWeatherEffect { this.lightningState = 2; this.boltVertex = this.rand.nextLong(); this.boltLivingTime = this.rand.nextInt(3) + 1; + BlockPos blockpos = new BlockPos(this); + if (!worldIn.isRemote && 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()); + } + } + } + } /**+ @@ -56,11 +83,29 @@ public class EntityLightningBolt extends EntityWeatherEffect { --this.boltLivingTime; this.lightningState = 1; this.boltVertex = this.rand.nextLong(); + BlockPos blockpos = new BlockPos(this); + if (!this.worldObj.isRemote && 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) { - this.worldObj.setLastLightningBolt(2); + if (this.worldObj.isRemote) { + this.worldObj.setLastLightningBolt(2); + } else { + 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); + } + } } } diff --git a/src/main/java/net/minecraft/entity/item/EntityArmorStand.java b/src/main/java/net/minecraft/entity/item/EntityArmorStand.java index a0f59983..d122a794 100755 --- a/src/main/java/net/minecraft/entity/item/EntityArmorStand.java +++ b/src/main/java/net/minecraft/entity/item/EntityArmorStand.java @@ -1,19 +1,27 @@ package net.minecraft.entity.item; import java.util.List; - +import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.Rotations; import net.minecraft.util.Vec3; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -318,16 +326,160 @@ public class EntityArmorStand extends EntityLivingBase { public boolean interactAt(EntityPlayer entityplayer, Vec3 vec3) { if (this.func_181026_s()) { return false; + } else if (!this.worldObj.isRemote && !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) { - return false; + if (this.worldObj.isRemote) { + return false; + } else 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; + } } /**+ @@ -345,6 +497,46 @@ public class EntityArmorStand extends EntityLivingBase { 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; diff --git a/src/main/java/net/minecraft/entity/item/EntityBoat.java b/src/main/java/net/minecraft/entity/item/EntityBoat.java index 56bc1424..b5c13994 100755 --- a/src/main/java/net/minecraft/entity/item/EntityBoat.java +++ b/src/main/java/net/minecraft/entity/item/EntityBoat.java @@ -1,14 +1,19 @@ package net.minecraft.entity.item; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSourceIndirect; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.world.World; @@ -112,6 +117,42 @@ public class EntityBoat extends Entity { 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.worldObj.isRemote && !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. @@ -235,7 +276,7 @@ public class EntityBoat extends Entity { } } - if (this.isBoatEmpty) { + if (this.worldObj.isRemote && this.isBoatEmpty) { if (this.boatPosRotationIncrements > 0) { double d12 = this.posX + (this.boatX - this.posX) / (double) this.boatPosRotationIncrements; double d16 = this.posY + (this.boatY - this.posY) / (double) this.boatPosRotationIncrements; @@ -329,7 +370,20 @@ public class EntityBoat extends Entity { } this.moveEntity(this.motionX, this.motionY, this.motionZ); - if (!(this.isCollidedHorizontally && d9 > 0.2975D)) { + if (this.isCollidedHorizontally && d9 > 0.2975D) { + if (!this.worldObj.isRemote && !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; @@ -354,6 +408,23 @@ public class EntityBoat extends Entity { this.rotationYaw = (float) ((double) this.rotationYaw + d23); this.setRotation(this.rotationYaw, this.rotationPitch); + if (!this.worldObj.isRemote) { + 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; + } + + } } } @@ -384,13 +455,35 @@ public class EntityBoat extends Entity { * First layer of player interaction */ public boolean interactFirst(EntityPlayer entityplayer) { - return true; + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer + && this.riddenByEntity != entityplayer) { + return true; + } else { + if (!this.worldObj.isRemote) { + 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.worldObj.isRemote && !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 diff --git a/src/main/java/net/minecraft/entity/item/EntityEnderCrystal.java b/src/main/java/net/minecraft/entity/item/EntityEnderCrystal.java index 7e91d669..1029905c 100755 --- a/src/main/java/net/minecraft/entity/item/EntityEnderCrystal.java +++ b/src/main/java/net/minecraft/entity/item/EntityEnderCrystal.java @@ -4,6 +4,7 @@ import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.WorldProviderEnd; @@ -99,4 +100,24 @@ public class EntityEnderCrystal extends Entity { 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.worldObj.isRemote) { + this.health = 0; + if (this.health <= 0) { + this.setDead(); + if (!this.worldObj.isRemote) { + 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/minecraft/entity/item/EntityEnderEye.java b/src/main/java/net/minecraft/entity/item/EntityEnderEye.java index 6711054a..52ffd2ce 100755 --- a/src/main/java/net/minecraft/entity/item/EntityEnderEye.java +++ b/src/main/java/net/minecraft/entity/item/EntityEnderEye.java @@ -1,6 +1,8 @@ package net.minecraft.entity.item; import net.minecraft.entity.Entity; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumParticleTypes; @@ -137,6 +139,25 @@ public class EntityEnderEye extends Entity { this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + if (!this.worldObj.isRemote) { + 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()) { @@ -153,6 +174,20 @@ public class EntityEnderEye extends Entity { this.motionY, this.motionZ, new int[0]); } + if (!this.worldObj.isRemote) { + this.setPosition(this.posX, this.posY, this.posZ); + ++this.despawnTimer; + if (this.despawnTimer > 80 && !this.worldObj.isRemote) { + 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); + } + } + } + } /**+ diff --git a/src/main/java/net/minecraft/entity/item/EntityEnderPearl.java b/src/main/java/net/minecraft/entity/item/EntityEnderPearl.java index ffcdd554..8f572957 100755 --- a/src/main/java/net/minecraft/entity/item/EntityEnderPearl.java +++ b/src/main/java/net/minecraft/entity/item/EntityEnderPearl.java @@ -1,7 +1,10 @@ package net.minecraft.entity.item; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityEndermite; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumParticleTypes; @@ -63,6 +66,35 @@ public class EntityEnderPearl extends EntityThrowable { this.posZ, this.rand.nextGaussian(), 0.0D, this.rand.nextGaussian(), new int[0]); } + if (!this.worldObj.isRemote) { + 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(); + } + } /**+ diff --git a/src/main/java/net/minecraft/entity/item/EntityExpBottle.java b/src/main/java/net/minecraft/entity/item/EntityExpBottle.java index b138cf0e..27216a15 100755 --- a/src/main/java/net/minecraft/entity/item/EntityExpBottle.java +++ b/src/main/java/net/minecraft/entity/item/EntityExpBottle.java @@ -2,6 +2,7 @@ package net.minecraft.entity.item; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.util.BlockPos; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -58,6 +59,18 @@ public class EntityExpBottle extends EntityThrowable { * Called when this EntityThrowable hits a block or entity. */ protected void onImpact(MovingObjectPosition var1) { + if (!this.worldObj.isRemote) { + 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/minecraft/entity/item/EntityFallingBlock.java b/src/main/java/net/minecraft/entity/item/EntityFallingBlock.java index 4cefbb95..e8a8ca04 100755 --- a/src/main/java/net/minecraft/entity/item/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/entity/item/EntityFallingBlock.java @@ -1,20 +1,23 @@ package net.minecraft.entity.item; -import java.util.ArrayList; -import java.util.List; - import com.google.common.collect.Lists; - +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockFalling; +import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.crash.CrashReportCategory; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; @@ -102,6 +105,9 @@ public class EntityFallingBlock extends Entity { BlockPos blockpos = new BlockPos(this); if (this.worldObj.getBlockState(blockpos).getBlock() == block) { this.worldObj.setBlockToAir(blockpos); + } else if (!this.worldObj.isRemote) { + this.setDead(); + return; } } @@ -110,6 +116,54 @@ public class EntityFallingBlock extends Entity { this.motionX *= 0.9800000190734863D; this.motionY *= 0.9800000190734863D; this.motionZ *= 0.9800000190734863D; + if (!this.worldObj.isRemote) { + 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 && !this.worldObj.isRemote + && (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(); + } + } } } @@ -119,12 +173,12 @@ public class EntityFallingBlock extends Entity { if (this.hurtEntities) { int i = MathHelper.ceiling_float_int(f - 1.0F); if (i > 0) { - ArrayList arraylist = Lists.newArrayList( + 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 : (List) arraylist) { + for (Entity entity : arraylist) { entity.attackEntityFrom(damagesource, (float) Math .min(MathHelper.floor_float((float) i * this.fallHurtAmount), this.fallHurtMax)); } diff --git a/src/main/java/net/minecraft/entity/item/EntityFireworkRocket.java b/src/main/java/net/minecraft/entity/item/EntityFireworkRocket.java index 3b5a23aa..960cfda0 100755 --- a/src/main/java/net/minecraft/entity/item/EntityFireworkRocket.java +++ b/src/main/java/net/minecraft/entity/item/EntityFireworkRocket.java @@ -128,16 +128,21 @@ public class EntityFireworkRocket extends Entity { } ++this.fireworkAge; - if (this.fireworkAge % 2 < 2) { + if (this.worldObj.isRemote && this.fireworkAge % 2 < 2) { this.worldObj.spawnParticle(EnumParticleTypes.FIREWORKS_SPARK, this.posX, this.posY - 0.3D, this.posZ, this.rand.nextGaussian() * 0.05D, -this.motionY * 0.5D, this.rand.nextGaussian() * 0.05D, new int[0]); } + if (!this.worldObj.isRemote && this.fireworkAge > this.lifetime) { + this.worldObj.setEntityState(this, (byte) 17); + this.setDead(); + } + } public void handleStatusUpdate(byte b0) { - if (b0 == 17) { + if (b0 == 17 && this.worldObj.isRemote) { ItemStack itemstack = this.dataWatcher.getWatchableObjectItemStack(8); NBTTagCompound nbttagcompound = null; if (itemstack != null && itemstack.hasTagCompound()) { diff --git a/src/main/java/net/minecraft/entity/item/EntityItem.java b/src/main/java/net/minecraft/entity/item/EntityItem.java index 1dd3143e..dd188adb 100755 --- a/src/main/java/net/minecraft/entity/item/EntityItem.java +++ b/src/main/java/net/minecraft/entity/item/EntityItem.java @@ -8,8 +8,10 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.AchievementList; import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; @@ -111,6 +113,10 @@ public class EntityItem extends Entity { this.motionZ = (double) ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); } + + if (!this.worldObj.isRemote) { + this.searchForOtherItemsNearby(); + } } float f = 0.98F; @@ -132,6 +138,9 @@ public class EntityItem extends Entity { } this.handleWaterMovement(); + if (!this.worldObj.isRemote && this.age >= 6000) { + this.setDead(); + } } } @@ -304,7 +313,51 @@ public class EntityItem extends Entity { * Called by a player entity when they collide with an entity */ public void onCollideWithPlayer(EntityPlayer entityplayer) { + if (!this.worldObj.isRemote) { + 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(); + } + } + + } } /**+ @@ -324,6 +377,18 @@ public class EntityItem extends Entity { return false; } + /**+ + * Teleports the entity to another dimension. Params: Dimension + * number to teleport to + */ + public void travelToDimension(int i) { + super.travelToDimension(i); + if (!this.worldObj.isRemote) { + this.searchForOtherItemsNearby(); + } + + } + /**+ * Returns the ItemStack corresponding to the Entity (Note: if * no item exists, will log an error but still return an diff --git a/src/main/java/net/minecraft/entity/item/EntityItemFrame.java b/src/main/java/net/minecraft/entity/item/EntityItemFrame.java index dc536bf2..813acf30 100755 --- a/src/main/java/net/minecraft/entity/item/EntityItemFrame.java +++ b/src/main/java/net/minecraft/entity/item/EntityItemFrame.java @@ -66,6 +66,11 @@ public class EntityItemFrame extends EntityHanging { if (this.isEntityInvulnerable(damagesource)) { return false; } else if (!damagesource.isExplosion() && this.getDisplayedItem() != null) { + if (!this.worldObj.isRemote) { + this.dropItemOrSelf(damagesource.getEntity(), false); + this.setDisplayedItem((ItemStack) null); + } + return true; } else { return super.attackEntityFrom(damagesource, f); @@ -219,6 +224,19 @@ public class EntityItemFrame extends EntityHanging { * First layer of player interaction */ public boolean interactFirst(EntityPlayer entityplayer) { + if (this.getDisplayedItem() == null) { + ItemStack itemstack = entityplayer.getHeldItem(); + if (itemstack != null && !this.worldObj.isRemote) { + this.setDisplayedItem(itemstack); + if (!entityplayer.capabilities.isCreativeMode && --itemstack.stackSize <= 0) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, + (ItemStack) null); + } + } + } else if (!this.worldObj.isRemote) { + this.setItemRotation(this.getRotation() + 1); + } + return true; } diff --git a/src/main/java/net/minecraft/entity/item/EntityMinecart.java b/src/main/java/net/minecraft/entity/item/EntityMinecart.java index 0ff69662..f837cc4e 100755 --- a/src/main/java/net/minecraft/entity/item/EntityMinecart.java +++ b/src/main/java/net/minecraft/entity/item/EntityMinecart.java @@ -12,10 +12,13 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityMinecartCommandBlock; import net.minecraft.entity.ai.EntityMinecartMobSpawner; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; @@ -27,6 +30,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.Vec3; import net.minecraft.world.IWorldNameable; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -159,7 +163,33 @@ public abstract class EntityMinecart extends Entity implements IWorldNameable { * Called when the entity is attacked. */ public boolean attackEntityFrom(DamageSource damagesource, float f) { - return true; + if (!this.worldObj.isRemote && !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) { @@ -216,20 +246,120 @@ public abstract class EntityMinecart extends Entity implements IWorldNameable { this.kill(); } - if (this.turnProgress > 0) { - double d4 = this.posX + (this.minecartX - this.posX) / (double) this.turnProgress; - double d5 = this.posY + (this.minecartY - this.posY) / (double) this.turnProgress; - double d6 = this.posZ + (this.minecartZ - this.posZ) / (double) this.turnProgress; - double d1 = MathHelper.wrapAngleTo180_double(this.minecartYaw - (double) this.rotationYaw); - this.rotationYaw = (float) ((double) this.rotationYaw + d1 / (double) this.turnProgress); - this.rotationPitch = (float) ((double) this.rotationPitch - + (this.minecartPitch - (double) this.rotationPitch) / (double) this.turnProgress); - --this.turnProgress; - this.setPosition(d4, d5, d6); - this.setRotation(this.rotationYaw, this.rotationPitch); + if (!this.worldObj.isRemote && 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(); + } + + if (this.worldObj.isRemote) { + if (this.turnProgress > 0) { + double d4 = this.posX + (this.minecartX - this.posX) / (double) this.turnProgress; + double d5 = this.posY + (this.minecartY - this.posY) / (double) this.turnProgress; + double d6 = this.posZ + (this.minecartZ - this.posZ) / (double) this.turnProgress; + double d1 = MathHelper.wrapAngleTo180_double(this.minecartYaw - (double) this.rotationYaw); + this.rotationYaw = (float) ((double) this.rotationYaw + d1 / (double) this.turnProgress); + this.rotationPitch = (float) ((double) this.rotationPitch + + (this.minecartPitch - (double) this.rotationPitch) / (double) this.turnProgress); + --this.turnProgress; + this.setPosition(d4, d5, d6); + this.setRotation(this.rotationYaw, this.rotationPitch); + } else { + this.setPosition(this.posX, this.posY, this.posZ); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + } else { - this.setPosition(this.posX, this.posY, this.posZ); + 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(); } } @@ -607,7 +737,84 @@ public abstract class EntityMinecart extends Entity implements IWorldNameable { * from each other. Args: entity */ public void applyEntityCollision(Entity entity) { + if (!this.worldObj.isRemote) { + 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) { diff --git a/src/main/java/net/minecraft/entity/item/EntityMinecartContainer.java b/src/main/java/net/minecraft/entity/item/EntityMinecartContainer.java index 07e4524a..7cb5e49e 100755 --- a/src/main/java/net/minecraft/entity/item/EntityMinecartContainer.java +++ b/src/main/java/net/minecraft/entity/item/EntityMinecartContainer.java @@ -220,6 +220,10 @@ public abstract class EntityMinecartContainer extends EntityMinecart implements * First layer of player interaction */ public boolean interactFirst(EntityPlayer entityplayer) { + if (!this.worldObj.isRemote) { + entityplayer.displayGUIChest(this); + } + return true; } diff --git a/src/main/java/net/minecraft/entity/item/EntityMinecartEmpty.java b/src/main/java/net/minecraft/entity/item/EntityMinecartEmpty.java index 0e7ee4de..f4491813 100755 --- a/src/main/java/net/minecraft/entity/item/EntityMinecartEmpty.java +++ b/src/main/java/net/minecraft/entity/item/EntityMinecartEmpty.java @@ -43,6 +43,10 @@ public class EntityMinecartEmpty extends EntityMinecart { } else if (this.riddenByEntity != null && this.riddenByEntity != entityplayer) { return false; } else { + if (!this.worldObj.isRemote) { + entityplayer.mountEntity(this); + } + return true; } } diff --git a/src/main/java/net/minecraft/entity/item/EntityMinecartHopper.java b/src/main/java/net/minecraft/entity/item/EntityMinecartHopper.java index 8b716741..db14dd10 100755 --- a/src/main/java/net/minecraft/entity/item/EntityMinecartHopper.java +++ b/src/main/java/net/minecraft/entity/item/EntityMinecartHopper.java @@ -77,6 +77,10 @@ public class EntityMinecartHopper extends EntityMinecartContainer implements IHo * First layer of player interaction */ public boolean interactFirst(EntityPlayer entityplayer) { + if (!this.worldObj.isRemote) { + entityplayer.displayGUIChest(this); + } + return true; } @@ -136,6 +140,30 @@ public class EntityMinecartHopper extends EntityMinecartContainer implements IHo return this.posZ; } + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + if (!this.worldObj.isRemote && 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; diff --git a/src/main/java/net/minecraft/entity/item/EntityMinecartTNT.java b/src/main/java/net/minecraft/entity/item/EntityMinecartTNT.java index d712b12c..049cf403 100755 --- a/src/main/java/net/minecraft/entity/item/EntityMinecartTNT.java +++ b/src/main/java/net/minecraft/entity/item/EntityMinecartTNT.java @@ -1,5 +1,6 @@ package net.minecraft.entity.item; +import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DynamicLightManager; import net.minecraft.block.BlockRailBase; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; @@ -107,6 +108,16 @@ public class EntityMinecartTNT extends EntityMinecart { * Makes the minecart explode. */ protected void explodeCart(double parDouble1) { + if (!this.worldObj.isRemote) { + 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(); + } } @@ -144,6 +155,13 @@ public class EntityMinecartTNT extends EntityMinecart { */ public void ignite() { this.minecartTNTFuse = 80; + if (!this.worldObj.isRemote) { + this.worldObj.setEntityState(this, (byte) 10); + if (!this.isSilent()) { + this.worldObj.playSoundAtEntity(this, "game.tnt.primed", 1.0F, 1.0F); + } + } + } /**+ @@ -198,4 +216,15 @@ public class EntityMinecartTNT extends EntityMinecart { super.writeEntityToNBT(nbttagcompound); nbttagcompound.setInteger("TNTFuse", this.minecartTNTFuse); } + + protected void renderDynamicLightsEaglerAt(double entityX, double entityY, double entityZ, double renderX, + double renderY, double renderZ, float partialTicks, boolean isInFrustum) { + super.renderDynamicLightsEaglerAt(entityX, entityY, entityZ, renderX, renderY, renderZ, partialTicks, + isInFrustum); + if (minecartTNTFuse > -1 && minecartTNTFuse / 5 % 2 == 0) { + float dynamicLightMag = 10.0f; + DynamicLightManager.renderDynamicLight("entity_" + getEntityId() + "_tnt_flash", entityX, entityY + 0.5, + entityZ, dynamicLightMag, dynamicLightMag * 0.7792f, dynamicLightMag * 0.618f, false); + } + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/entity/item/EntityTNTPrimed.java b/src/main/java/net/minecraft/entity/item/EntityTNTPrimed.java index 8e832e5c..300b9d75 100755 --- a/src/main/java/net/minecraft/entity/item/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/entity/item/EntityTNTPrimed.java @@ -92,6 +92,9 @@ public class EntityTNTPrimed extends Entity { if (this.fuse-- <= 0) { this.setDead(); + if (!this.worldObj.isRemote) { + this.explode(); + } } else { this.handleWaterMovement(); this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY + 0.5D, this.posZ, 0.0D, @@ -100,6 +103,11 @@ public class EntityTNTPrimed extends Entity { } + 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. diff --git a/src/main/java/net/minecraft/entity/item/EntityXPOrb.java b/src/main/java/net/minecraft/entity/item/EntityXPOrb.java index 8b5ca920..fb4e8a45 100755 --- a/src/main/java/net/minecraft/entity/item/EntityXPOrb.java +++ b/src/main/java/net/minecraft/entity/item/EntityXPOrb.java @@ -209,6 +209,23 @@ public class EntityXPOrb extends Entity { this.xpValue = nbttagcompound.getShort("Value"); } + /**+ + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer entityplayer) { + if (!this.worldObj.isRemote) { + 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. */ diff --git a/src/main/java/net/minecraft/entity/monster/EntityBlaze.java b/src/main/java/net/minecraft/entity/monster/EntityBlaze.java index aa90985b..74e04eed 100755 --- a/src/main/java/net/minecraft/entity/monster/EntityBlaze.java +++ b/src/main/java/net/minecraft/entity/monster/EntityBlaze.java @@ -3,10 +3,21 @@ package net.minecraft.entity.monster; import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DynamicLightManager; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntitySmallFireball; import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; import net.minecraft.world.World; /**+ @@ -40,6 +51,13 @@ public class EntityBlaze extends EntityMob { 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() { @@ -96,16 +114,19 @@ public class EntityBlaze extends EntityMob { this.motionY *= 0.6D; } - if (this.rand.nextInt(24) == 0 && !this.isSilent()) { - this.worldObj.playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.fire", - 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F, false); - } + if (this.worldObj.isRemote) { + if (this.rand.nextInt(24) == 0 && !this.isSilent()) { + this.worldObj.playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.fire", + 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F, false); + } - for (int i = 0; i < 2; ++i) { - this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_LARGE, - 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, 0.0D, 0.0D, 0.0D, new int[0]); + for (int i = 0; i < 2; ++i) { + this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_LARGE, + 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, 0.0D, 0.0D, 0.0D, + new int[0]); + } } super.onLivingUpdate(); @@ -184,6 +205,85 @@ public class EntityBlaze extends EntityMob { 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(); + } + } + protected void renderDynamicLightsEaglerAt(double entityX, double entityY, double entityZ, double renderX, double renderY, double renderZ, float partialTicks, boolean isInFrustum) { float mag = 5.0f; diff --git a/src/main/java/net/minecraft/entity/monster/EntityCreeper.java b/src/main/java/net/minecraft/entity/monster/EntityCreeper.java index cbd731b0..63d88fff 100755 --- a/src/main/java/net/minecraft/entity/monster/EntityCreeper.java +++ b/src/main/java/net/minecraft/entity/monster/EntityCreeper.java @@ -2,10 +2,19 @@ package net.minecraft.entity.monster; import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DynamicLightManager; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.minecraft.entity.ai.EntityAICreeperSwell; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.passive.EntityOcelot; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; @@ -46,6 +55,15 @@ public class EntityCreeper extends EntityMob { 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() { @@ -135,6 +153,7 @@ public class EntityCreeper extends EntityMob { if (this.timeSinceIgnited >= this.fuseTime) { this.timeSinceIgnited = this.fuseTime; + this.explode(); } } @@ -231,11 +250,31 @@ public class EntityCreeper extends EntityMob { 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(); + if (!this.worldObj.isRemote) { + 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() { + if (!this.worldObj.isRemote) { + 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; } diff --git a/src/main/java/net/minecraft/entity/monster/EntityEnderman.java b/src/main/java/net/minecraft/entity/monster/EntityEnderman.java index 729466b5..1fcab970 100755 --- a/src/main/java/net/minecraft/entity/monster/EntityEnderman.java +++ b/src/main/java/net/minecraft/entity/monster/EntityEnderman.java @@ -1,28 +1,41 @@ package 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.opengl.ext.deferred.DynamicLightManager; - -import com.google.common.collect.Sets; - import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.EntityDamageSource; import net.minecraft.util.EntityDamageSourceIndirect; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; import net.minecraft.world.World; @@ -58,6 +71,21 @@ public class EntityEnderman extends EntityMob { 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() { @@ -104,6 +132,26 @@ public class EntityEnderman extends EntityMob { 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; } @@ -114,14 +162,17 @@ public class EntityEnderman extends EntityMob { * to react to sunlight and start to burn. */ public void onLivingUpdate() { - for (int i = 0; i < 2; ++i) { - this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, - this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width, - this.posY + this.rand.nextDouble() * (double) this.height - 0.25D, - this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width, - (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), - (this.rand.nextDouble() - 0.5D) * 2.0D, new int[0]); + if (this.worldObj.isRemote) { + for (int i = 0; i < 2; ++i) { + this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, + this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width, + this.posY + this.rand.nextDouble() * (double) this.height - 0.25D, + this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width, + (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), + (this.rand.nextDouble() - 0.5D) * 2.0D, new int[0]); + } } + this.isJumping = false; super.onLivingUpdate(); } @@ -295,9 +346,17 @@ public class EntityEnderman extends EntityMob { return false; } else { if (damagesource.getEntity() == null || !(damagesource.getEntity() instanceof EntityEndermite)) { + if (!this.worldObj.isRemote) { + this.setScreaming(true); + } if (damagesource instanceof EntityDamageSource && damagesource.getEntity() instanceof EntityPlayer) { - this.isAggressive = true; + if (damagesource.getEntity() instanceof EntityPlayerMP + && ((EntityPlayerMP) damagesource.getEntity()).theItemInWorldManager.isCreative()) { + this.setScreaming(false); + } else { + this.isAggressive = true; + } } if (damagesource instanceof EntityDamageSourceIndirect) { @@ -347,4 +406,155 @@ public class EntityEnderman extends EntityMob { 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/minecraft/entity/monster/EntityEndermite.java b/src/main/java/net/minecraft/entity/monster/EntityEndermite.java index 24d29efa..7c5f74dc 100755 --- a/src/main/java/net/minecraft/entity/monster/EntityEndermite.java +++ b/src/main/java/net/minecraft/entity/monster/EntityEndermite.java @@ -3,6 +3,13 @@ package net.minecraft.entity.monster; import net.minecraft.block.Block; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.nbt.NBTTagCompound; @@ -38,6 +45,13 @@ public class EntityEndermite extends EntityMob { 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() { @@ -135,14 +149,25 @@ public class EntityEndermite extends EntityMob { */ public void onLivingUpdate() { super.onLivingUpdate(); - for (int i = 0; i < 2; ++i) { - this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, - 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, - (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), - (this.rand.nextDouble() - 0.5D) * 2.0D, new int[0]); + if (this.worldObj.isRemote) { + for (int i = 0; i < 2; ++i) { + this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, + 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, + (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), + (this.rand.nextDouble() - 0.5D) * 2.0D, new int[0]); + } + } else { + if (!this.isNoDespawnRequired()) { + ++this.lifetime; + } + + if (this.lifetime >= 2400) { + this.setDead(); + } } + } /**+ diff --git a/src/main/java/net/minecraft/entity/monster/EntityGhast.java b/src/main/java/net/minecraft/entity/monster/EntityGhast.java index 17f2bb33..b1e6cb34 100755 --- a/src/main/java/net/minecraft/entity/monster/EntityGhast.java +++ b/src/main/java/net/minecraft/entity/monster/EntityGhast.java @@ -1,13 +1,23 @@ package net.minecraft.entity.monster; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.minecraft.entity.EntityFlying; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; +import net.minecraft.entity.ai.EntityMoveHelper; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityLargeFireball; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.stats.AchievementList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; @@ -42,6 +52,11 @@ public class EntityGhast extends EntityFlying implements IMob { 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() { @@ -56,6 +71,17 @@ public class EntityGhast extends EntityFlying implements IMob { return this.explosionStrength; } + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + if (!this.worldObj.isRemote && this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL) { + this.setDead(); + } + + } + /**+ * Called when the entity is attacked. */ @@ -174,4 +200,171 @@ public class EntityGhast extends EntityFlying implements IMob { 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/minecraft/entity/monster/EntityGuardian.java b/src/main/java/net/minecraft/entity/monster/EntityGuardian.java index b5277603..90ce59ac 100755 --- a/src/main/java/net/minecraft/entity/monster/EntityGuardian.java +++ b/src/main/java/net/minecraft/entity/monster/EntityGuardian.java @@ -1,21 +1,40 @@ package net.minecraft.entity.monster; +import com.google.common.base.Predicate; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.EntityLookHelper; +import net.minecraft.entity.ai.EntityMoveHelper; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.projectile.EntityFishHook; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemFishFood; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.pathfinding.PathNavigateSwimmer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; import net.minecraft.util.WeightedRandom; import net.minecraft.util.WeightedRandomFishable; +import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; /**+ @@ -47,11 +66,24 @@ public class EntityGuardian extends EntityMob { 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(); } @@ -81,6 +113,13 @@ public class EntityGuardian extends EntityMob { 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)); @@ -112,6 +151,10 @@ public class EntityGuardian extends EntityMob { 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; } @@ -131,6 +174,7 @@ public class EntityGuardian extends EntityMob { this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(8.0D); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(80.0D); this.enablePersistence(); + this.wander.setExecutionChance(400); } } @@ -143,6 +187,10 @@ public class EntityGuardian extends EntityMob { 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; } @@ -150,7 +198,7 @@ public class EntityGuardian extends EntityMob { public EntityLivingBase getTargetedEntity() { if (!this.hasTargetedEntity()) { return null; - } else { + } else if (this.worldObj.isRemote) { if (this.targetedEntity != null) { return this.targetedEntity; } else { @@ -162,6 +210,8 @@ public class EntityGuardian extends EntityMob { return null; } } + } else { + return this.getAttackTarget(); } } @@ -235,70 +285,74 @@ public class EntityGuardian extends EntityMob { * to react to sunlight and start to burn. */ public void onLivingUpdate() { - this.field_175484_c = this.field_175482_b; - if (!this.isInWater()) { - this.field_175483_bk = 2.0F; - if (this.motionY > 0.0D && this.field_175480_bp && !this.isSilent()) { - this.worldObj.playSound(this.posX, this.posY, this.posZ, "mob.guardian.flop", 1.0F, 1.0F, false); - } + if (this.worldObj.isRemote) { + this.field_175484_c = this.field_175482_b; + if (!this.isInWater()) { + this.field_175483_bk = 2.0F; + if (this.motionY > 0.0D && this.field_175480_bp && !this.isSilent()) { + this.worldObj.playSound(this.posX, this.posY, this.posZ, "mob.guardian.flop", 1.0F, 1.0F, false); + } - this.field_175480_bp = this.motionY < 0.0D - && this.worldObj.isBlockNormalCube((new BlockPos(this)).down(), false); - } else if (this.func_175472_n()) { - if (this.field_175483_bk < 0.5F) { - this.field_175483_bk = 4.0F; + this.field_175480_bp = this.motionY < 0.0D + && this.worldObj.isBlockNormalCube((new BlockPos(this)).down(), false); + } else if (this.func_175472_n()) { + if (this.field_175483_bk < 0.5F) { + this.field_175483_bk = 4.0F; + } else { + this.field_175483_bk += (0.5F - this.field_175483_bk) * 0.1F; + } } else { - this.field_175483_bk += (0.5F - this.field_175483_bk) * 0.1F; - } - } else { - this.field_175483_bk += (0.125F - this.field_175483_bk) * 0.2F; - } - - this.field_175482_b += this.field_175483_bk; - this.field_175486_bm = this.field_175485_bl; - if (!this.isInWater()) { - this.field_175485_bl = this.rand.nextFloat(); - } else if (this.func_175472_n()) { - this.field_175485_bl += (0.0F - this.field_175485_bl) * 0.25F; - } else { - this.field_175485_bl += (1.0F - this.field_175485_bl) * 0.06F; - } - - if (this.func_175472_n() && this.isInWater()) { - Vec3 vec3 = this.getLook(0.0F); - - for (int i = 0; i < 2; ++i) { - this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, - this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width - vec3.xCoord * 1.5D, - this.posY + this.rand.nextDouble() * (double) this.height - vec3.yCoord * 1.5D, - this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width - vec3.zCoord * 1.5D, 0.0D, - 0.0D, 0.0D, new int[0]); - } - } - - if (this.hasTargetedEntity()) { - if (this.field_175479_bo < this.func_175464_ck()) { - ++this.field_175479_bo; + this.field_175483_bk += (0.125F - this.field_175483_bk) * 0.2F; } - EntityLivingBase entitylivingbase = this.getTargetedEntity(); - if (entitylivingbase != null) { - double d5 = (double) this.func_175477_p(0.0F); - double d0 = entitylivingbase.posX - this.posX; - double d1 = entitylivingbase.posY + (double) (entitylivingbase.height * 0.5F) - - (this.posY + (double) this.getEyeHeight()); - double d2 = entitylivingbase.posZ - this.posZ; - double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2); - d0 = d0 / d3; - d1 = d1 / d3; - d2 = d2 / d3; - double d4 = this.rand.nextDouble(); + this.field_175482_b += this.field_175483_bk; + this.field_175486_bm = this.field_175485_bl; + if (!this.isInWater()) { + this.field_175485_bl = this.rand.nextFloat(); + } else if (this.func_175472_n()) { + this.field_175485_bl += (0.0F - this.field_175485_bl) * 0.25F; + } else { + this.field_175485_bl += (1.0F - this.field_175485_bl) * 0.06F; + } - while (d4 < d3) { - d4 += 1.8D - d5 + this.rand.nextDouble() * (1.7D - d5); - this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX + d0 * d4, - this.posY + d1 * d4 + (double) this.getEyeHeight(), this.posZ + d2 * d4, 0.0D, 0.0D, 0.0D, - new int[0]); + if (this.func_175472_n() && this.isInWater()) { + Vec3 vec3 = this.getLook(0.0F); + + for (int i = 0; i < 2; ++i) { + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, + this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width - vec3.xCoord * 1.5D, + this.posY + this.rand.nextDouble() * (double) this.height - vec3.yCoord * 1.5D, + this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width - vec3.zCoord * 1.5D, + 0.0D, 0.0D, 0.0D, new int[0]); + } + } + + if (this.hasTargetedEntity()) { + if (this.field_175479_bo < this.func_175464_ck()) { + ++this.field_175479_bo; + } + + EntityLivingBase entitylivingbase = this.getTargetedEntity(); + if (entitylivingbase != null) { + this.getLookHelper().setLookPositionWithEntity(entitylivingbase, 90.0F, 90.0F); + this.getLookHelper().onUpdateLook(); + double d5 = (double) this.func_175477_p(0.0F); + double d0 = entitylivingbase.posX - this.posX; + double d1 = entitylivingbase.posY + (double) (entitylivingbase.height * 0.5F) + - (this.posY + (double) this.getEyeHeight()); + double d2 = entitylivingbase.posZ - this.posZ; + double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2); + d0 = d0 / d3; + d1 = d1 / d3; + d2 = d2 / d3; + double d4 = this.rand.nextDouble(); + + while (d4 < d3) { + d4 += 1.8D - d5 + this.rand.nextDouble() * (1.7D - d5); + this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX + d0 * d4, + this.posY + d1 * d4 + (double) this.getEyeHeight(), this.posZ + d2 * d4, 0.0D, 0.0D, + 0.0D, new int[0]); + } } } } @@ -333,6 +387,39 @@ public class EntityGuardian extends EntityMob { 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 */ @@ -402,6 +489,7 @@ public class EntityGuardian extends EntityMob { } } + this.wander.makeUpdate(); return super.attackEntityFrom(damagesource, f); } @@ -438,4 +526,140 @@ public class EntityGuardian extends EntityMob { } + 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/minecraft/entity/monster/EntityIronGolem.java b/src/main/java/net/minecraft/entity/monster/EntityIronGolem.java index f312cdda..0248e3cf 100755 --- a/src/main/java/net/minecraft/entity/monster/EntityIronGolem.java +++ b/src/main/java/net/minecraft/entity/monster/EntityIronGolem.java @@ -1,21 +1,37 @@ package net.minecraft.entity.monster; +import com.google.common.base.Predicate; import net.minecraft.block.Block; import net.minecraft.block.BlockFlower; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIDefendVillage; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookAtVillager; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMoveThroughVillage; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAIMoveTowardsTarget; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathNavigateGround; import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; +import net.minecraft.village.Village; import net.minecraft.world.World; /**+ @@ -40,12 +56,26 @@ import net.minecraft.world.World; */ public class EntityIronGolem extends EntityGolem { 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() { @@ -53,6 +83,21 @@ public class EntityIronGolem extends EntityGolem { 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); @@ -160,6 +205,10 @@ public class EntityIronGolem extends EntityGolem { } + public Village getVillage() { + return this.villageObj; + } + public int getAttackTimer() { return this.attackTimer; } @@ -223,4 +272,54 @@ public class EntityIronGolem extends EntityGolem { } } + + /**+ + * 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/minecraft/entity/monster/EntityMob.java b/src/main/java/net/minecraft/entity/monster/EntityMob.java index 774498ad..337fd02e 100755 --- a/src/main/java/net/minecraft/entity/monster/EntityMob.java +++ b/src/main/java/net/minecraft/entity/monster/EntityMob.java @@ -53,6 +53,17 @@ public abstract class EntityMob extends EntityCreature implements IMob { super.onLivingUpdate(); } + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + super.onUpdate(); + if (!this.worldObj.isRemote && this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL) { + this.setDead(); + } + + } + protected String getSwimSound() { return "game.hostile.swim"; } diff --git a/src/main/java/net/minecraft/entity/monster/EntityPigZombie.java b/src/main/java/net/minecraft/entity/monster/EntityPigZombie.java index 734e496d..60d4d112 100755 --- a/src/main/java/net/minecraft/entity/monster/EntityPigZombie.java +++ b/src/main/java/net/minecraft/entity/monster/EntityPigZombie.java @@ -1,11 +1,13 @@ package net.minecraft.entity.monster; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; - import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.ai.attributes.IAttributeInstance; import net.minecraft.entity.player.EntityPlayer; @@ -59,6 +61,11 @@ public class EntityPigZombie extends EntityZombie { } + 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); @@ -261,4 +268,27 @@ public class EntityPigZombie extends EntityZombie { 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/minecraft/entity/monster/EntitySilverfish.java b/src/main/java/net/minecraft/entity/monster/EntitySilverfish.java index f000bbf3..a6d22b3f 100755 --- a/src/main/java/net/minecraft/entity/monster/EntitySilverfish.java +++ b/src/main/java/net/minecraft/entity/monster/EntitySilverfish.java @@ -1,12 +1,24 @@ package net.minecraft.entity.monster; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.minecraft.block.Block; +import net.minecraft.block.BlockSilverfish; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSource; +import net.minecraft.util.EnumFacing; import net.minecraft.world.World; /**+ @@ -30,10 +42,17 @@ import net.minecraft.world.World; * */ public class EntitySilverfish extends EntityMob { + 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)); } /**+ @@ -84,6 +103,21 @@ public class EntitySilverfish extends EntityMob { 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); } @@ -133,4 +167,113 @@ public class EntitySilverfish extends EntityMob { 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/minecraft/entity/monster/EntitySkeleton.java b/src/main/java/net/minecraft/entity/monster/EntitySkeleton.java index 0263ef38..3e45a446 100755 --- a/src/main/java/net/minecraft/entity/monster/EntitySkeleton.java +++ b/src/main/java/net/minecraft/entity/monster/EntitySkeleton.java @@ -1,7 +1,6 @@ package net.minecraft.entity.monster; import java.util.Calendar; - import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; @@ -12,6 +11,18 @@ import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.IRangedAttackMob; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.minecraft.entity.ai.EntityAIFleeSun; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIRestrictSun; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.passive.EntityWolf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Blocks; @@ -26,6 +37,7 @@ import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.World; +import net.minecraft.world.WorldProviderHell; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -48,9 +60,26 @@ import net.minecraft.world.World; * */ public class EntitySkeleton extends EntityMob implements IRangedAttackMob { + 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 && !worldIn.isRemote) { + this.setCombatTask(); + } + } protected void applyEntityAttributes() { @@ -113,8 +142,31 @@ public class EntitySkeleton extends EntityMob implements IRangedAttackMob { * to react to sunlight and start to burn. */ public void onLivingUpdate() { + if (this.worldObj.isDaytime() && !this.worldObj.isRemote) { + 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); + } + } - if (this.getSkeletonType() == 1) { + flag = false; + } + + if (flag) { + this.setFire(8); + } + } + } + + if (this.worldObj.isRemote && this.getSkeletonType() == 1) { this.setSize(0.72F, 2.535F); } @@ -213,6 +265,16 @@ public class EntitySkeleton extends EntityMob implements IRangedAttackMob { 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) { @@ -231,6 +293,15 @@ public class EntitySkeleton extends EntityMob implements IRangedAttackMob { * 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); + } + } /**+ @@ -304,6 +375,18 @@ public class EntitySkeleton extends EntityMob implements IRangedAttackMob { 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 (!this.worldObj.isRemote && i == 0) { + this.setCombatTask(); + } + + } + public float getEyeHeight() { return this.getSkeletonType() == 1 ? super.getEyeHeight() : 1.74F; } diff --git a/src/main/java/net/minecraft/entity/monster/EntitySlime.java b/src/main/java/net/minecraft/entity/monster/EntitySlime.java index 52e80821..0c948298 100755 --- a/src/main/java/net/minecraft/entity/monster/EntitySlime.java +++ b/src/main/java/net/minecraft/entity/monster/EntitySlime.java @@ -5,10 +5,15 @@ import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAIFindEntityNearest; +import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; +import net.minecraft.entity.ai.EntityMoveHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathNavigateGround; import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumParticleTypes; @@ -48,6 +53,13 @@ public class EntitySlime extends EntityLiving implements IMob { 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() { @@ -113,6 +125,11 @@ public class EntitySlime extends EntityLiving implements IMob { * Called to update the entity's position/logic. */ public void onUpdate() { + if (!this.worldObj.isRemote && 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(); @@ -176,6 +193,36 @@ public class EntitySlime extends EntityLiving implements IMob { super.onDataWatcherUpdate(i); } + /**+ + * Will get destroyed next tick. + */ + public void setDead() { + int i = this.getSlimeSize(); + if (!this.worldObj.isRemote && 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 @@ -335,4 +382,162 @@ public class EntitySlime extends EntityLiving implements IMob { 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/minecraft/entity/monster/EntitySnowman.java b/src/main/java/net/minecraft/entity/monster/EntitySnowman.java index 80dbe882..28c22eb2 100755 --- a/src/main/java/net/minecraft/entity/monster/EntitySnowman.java +++ b/src/main/java/net/minecraft/entity/monster/EntitySnowman.java @@ -1,11 +1,23 @@ package net.minecraft.entity.monster; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IRangedAttackMob; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.world.World; @@ -33,6 +45,13 @@ public class EntitySnowman extends EntityGolem implements IRangedAttackMob { 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() { @@ -41,6 +60,42 @@ public class EntitySnowman extends EntityGolem implements IRangedAttackMob { 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(); + if (!this.worldObj.isRemote) { + 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; } diff --git a/src/main/java/net/minecraft/entity/monster/EntitySpider.java b/src/main/java/net/minecraft/entity/monster/EntitySpider.java index af1cdeaf..2922d7f5 100755 --- a/src/main/java/net/minecraft/entity/monster/EntitySpider.java +++ b/src/main/java/net/minecraft/entity/monster/EntitySpider.java @@ -1,13 +1,25 @@ package net.minecraft.entity.monster; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; - import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILeapAtTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.pathfinding.PathNavigateClimber; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.BlockPos; @@ -39,6 +51,16 @@ public class EntitySpider extends EntityMob { 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)); } /**+ @@ -49,11 +71,29 @@ public class EntitySpider extends EntityMob { 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(); + if (!this.worldObj.isRemote) { + this.setBesideClimbableBlock(this.isCollidedHorizontally); + } + + } + protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(16.0D); @@ -187,6 +227,37 @@ public class EntitySpider extends EntityMob { 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; diff --git a/src/main/java/net/minecraft/entity/monster/EntityWitch.java b/src/main/java/net/minecraft/entity/monster/EntityWitch.java index 44cf73e8..9488ad4f 100755 --- a/src/main/java/net/minecraft/entity/monster/EntityWitch.java +++ b/src/main/java/net/minecraft/entity/monster/EntityWitch.java @@ -1,15 +1,27 @@ package net.minecraft.entity.monster; +import java.util.List; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; - +import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IRangedAttackMob; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityPotion; import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; @@ -50,6 +62,13 @@ public class EntityWitch extends EntityMob implements IRangedAttackMob { 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() { @@ -98,6 +117,68 @@ public class EntityWitch extends EntityMob implements IRangedAttackMob { 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.worldObj.isRemote) { + 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) { + 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) { diff --git a/src/main/java/net/minecraft/entity/monster/EntityZombie.java b/src/main/java/net/minecraft/entity/monster/EntityZombie.java index 917a7054..5ac5f726 100755 --- a/src/main/java/net/minecraft/entity/monster/EntityZombie.java +++ b/src/main/java/net/minecraft/entity/monster/EntityZombie.java @@ -3,7 +3,6 @@ package net.minecraft.entity.monster; import java.util.Calendar; import java.util.List; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; - import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; @@ -11,8 +10,19 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIBreakDoor; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMoveThroughVillage; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; import net.minecraft.entity.ai.attributes.RangedAttribute; import net.minecraft.entity.passive.EntityChicken; import net.minecraft.entity.passive.EntityVillager; @@ -22,6 +32,7 @@ import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathNavigateGround; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.BlockPos; @@ -63,6 +74,7 @@ public class EntityZombie extends EntityMob { .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; /**+ @@ -73,9 +85,27 @@ public class EntityZombie extends EntityMob { 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); @@ -109,6 +139,21 @@ public class EntityZombie extends EntityMob { 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 */ @@ -132,6 +177,14 @@ public class EntityZombie extends EntityMob { */ public void setChild(boolean childZombie) { this.getDataWatcher().updateObject(12, Byte.valueOf((byte) (childZombie ? 1 : 0))); + if (this.worldObj != null && !this.worldObj.isRemote) { + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + iattributeinstance.removeModifier(babySpeedBoostModifier); + if (childZombie) { + iattributeinstance.applyModifier(babySpeedBoostModifier); + } + } + this.setChildSize(childZombie); } @@ -149,6 +202,43 @@ public class EntityZombie extends EntityMob { 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.worldObj.isRemote && !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. */ @@ -205,6 +295,21 @@ public class EntityZombie extends EntityMob { } } + /**+ + * Called to update the entity's position/logic. + */ + public void onUpdate() { + if (!this.worldObj.isRemote && 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) { @@ -322,6 +427,8 @@ public class EntityZombie extends EntityMob { if (nbttagcompound.hasKey("ConversionTime", 99) && nbttagcompound.getInteger("ConversionTime") > -1) { this.startConversion(nbttagcompound.getInteger("ConversionTime")); } + + this.setBreakDoorsAItask(nbttagcompound.getBoolean("CanBreakDoors")); } /**+ @@ -417,6 +524,7 @@ public class EntityZombie extends EntityMob { } } + this.setBreakDoorsAItask(this.rand.nextFloat() < f * 0.1F); this.setEquipmentBasedOnDifficulty(difficultyinstance); this.setEnchantmentBasedOnDifficulty(difficultyinstance); if (this.getEquipmentInSlot(4) == null) { @@ -441,6 +549,7 @@ public class EntityZombie extends EntityMob { 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; @@ -462,6 +571,10 @@ public class EntityZombie extends EntityMob { entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, (ItemStack) null); } + if (!this.worldObj.isRemote) { + this.startConversion(this.rand.nextInt(2401) + 3600); + } + return true; } else { return false; diff --git a/src/main/java/net/minecraft/entity/passive/EntityBat.java b/src/main/java/net/minecraft/entity/passive/EntityBat.java index 59bfd654..4746c915 100755 --- a/src/main/java/net/minecraft/entity/passive/EntityBat.java +++ b/src/main/java/net/minecraft/entity/passive/EntityBat.java @@ -1,13 +1,13 @@ package net.minecraft.entity.passive; import java.util.Calendar; - import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.world.World; @@ -200,6 +200,21 @@ public class EntityBat extends EntityAmbientCreature { return true; } + /**+ + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource damagesource, float f) { + if (this.isEntityInvulnerable(damagesource)) { + return false; + } else { + if (!this.worldObj.isRemote && this.getIsBatHanging()) { + this.setIsBatHanging(false); + } + + return super.attackEntityFrom(damagesource, f); + } + } + /**+ * (abstract) Protected helper method to read subclass entity * data from NBT. diff --git a/src/main/java/net/minecraft/entity/passive/EntityChicken.java b/src/main/java/net/minecraft/entity/passive/EntityChicken.java index 0d10a8b7..5ab6f74f 100755 --- a/src/main/java/net/minecraft/entity/passive/EntityChicken.java +++ b/src/main/java/net/minecraft/entity/passive/EntityChicken.java @@ -4,6 +4,14 @@ import net.minecraft.block.Block; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; @@ -46,6 +54,14 @@ public class EntityChicken extends EntityAnimal { 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() { @@ -79,6 +95,12 @@ public class EntityChicken extends EntityAnimal { } this.wingRotation += this.wingRotDelta * 2.0F; + if (!this.worldObj.isRemote && !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) { diff --git a/src/main/java/net/minecraft/entity/passive/EntityCow.java b/src/main/java/net/minecraft/entity/passive/EntityCow.java index bc60aa90..cdfac514 100755 --- a/src/main/java/net/minecraft/entity/passive/EntityCow.java +++ b/src/main/java/net/minecraft/entity/passive/EntityCow.java @@ -3,10 +3,19 @@ package net.minecraft.entity.passive; import net.minecraft.block.Block; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.pathfinding.PathNavigateGround; import net.minecraft.util.BlockPos; import net.minecraft.world.World; @@ -34,6 +43,15 @@ public class EntityCow extends EntityAnimal { 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() { diff --git a/src/main/java/net/minecraft/entity/passive/EntityHorse.java b/src/main/java/net/minecraft/entity/passive/EntityHorse.java index 5e746ac4..d410a7bd 100755 --- a/src/main/java/net/minecraft/entity/passive/EntityHorse.java +++ b/src/main/java/net/minecraft/entity/passive/EntityHorse.java @@ -2,6 +2,7 @@ package net.minecraft.entity.passive; import com.google.common.base.Predicate; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -9,6 +10,14 @@ import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAIRunAroundLikeCrazy; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.ai.attributes.IAttribute; import net.minecraft.entity.ai.attributes.IAttributeInstance; import net.minecraft.entity.ai.attributes.RangedAttribute; @@ -22,6 +31,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.pathfinding.PathNavigateGround; import net.minecraft.potion.Potion; import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; @@ -102,6 +112,15 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { 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(); } @@ -351,7 +370,10 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { } public void dropChests() { - + if (!this.worldObj.isRemote && this.isChested()) { + this.dropItem(Item.getItemFromBlock(Blocks.chest), 1); + this.setChested(false); + } } private void func_110266_cB() { @@ -420,6 +442,12 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { * horse's inventory. */ private void updateHorseSlots() { + if (!this.worldObj.isRemote) { + this.setHorseSaddled(this.horseChest.getStackInSlot(0) != null); + if (this.canWearArmor()) { + this.setHorseArmorStack(this.horseChest.getStackInSlot(1)); + } + } } @@ -662,6 +690,11 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { } public void openGUI(EntityPlayer playerEntity) { + if (!this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == playerEntity) + && this.isTame()) { + this.horseChest.setCustomName(this.getName()); + playerEntity.displayGUIHorse(this, this.horseChest); + } } @@ -812,6 +845,9 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { player.rotationPitch = this.rotationPitch; this.setEatingHaystack(false); this.setRearing(false); + if (!this.worldObj.isRemote) { + player.mountEntity(this); + } } @@ -867,6 +903,17 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { this.field_110278_bp = 1; } + /**+ + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource damagesource) { + super.onDeath(damagesource); + if (!this.worldObj.isRemote) { + this.dropChestItems(); + } + + } + /**+ * Called frequently so the entity can update its state every * tick as required. For example, zombies and skeletons use this @@ -878,6 +925,32 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { } super.onLivingUpdate(); + if (!this.worldObj.isRemote) { + 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); + } + } + } + } /**+ @@ -885,7 +958,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { */ public void onUpdate() { super.onUpdate(); - if (this.dataWatcher.hasObjectChanged()) { + if (this.worldObj.isRemote && this.dataWatcher.hasObjectChanged()) { this.dataWatcher.func_111144_e(); this.resetTexturePrefix(); } @@ -895,6 +968,11 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { this.setHorseWatchableBoolean(128, false); } + if (!this.worldObj.isRemote && 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; } @@ -951,6 +1029,10 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { } private void openHorseMouth() { + if (!this.worldObj.isRemote) { + this.openMouthCounter = 1; + this.setHorseWatchableBoolean(128, true); + } } @@ -980,6 +1062,10 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { } private void makeHorseRear() { + if (!this.worldObj.isRemote) { + this.jumpRearingCounter = 1; + this.setRearing(true); + } } @@ -998,7 +1084,15 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { } private void dropItemsInChest(Entity entityIn, AnimalChest animalChestIn) { + if (animalChestIn != null && !this.worldObj.isRemote) { + 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) { @@ -1051,6 +1145,11 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { this.stepHeight = 1.0F; this.jumpMovementFactor = this.getAIMoveSpeed() * 0.1F; + if (!this.worldObj.isRemote) { + this.setAIMoveSpeed( + (float) this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue()); + super.moveEntityWithHeading(f, f1); + } if (this.onGround) { this.jumpPower = 0.0F; @@ -1088,7 +1187,11 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { nbttagcompound.setInteger("Variant", this.getHorseVariant()); nbttagcompound.setInteger("Temper", this.getTemper()); nbttagcompound.setBoolean("Tame", this.isTame()); - nbttagcompound.setString("OwnerUUID", this.getOwnerId()); + if (worldObj.isRemote && !SingleplayerServerController.isClientInEaglerSingleplayerOrLAN()) { + nbttagcompound.setString("OwnerUUID", this.getOwnerId()); + } else { + nbttagcompound.setString("Owner", this.getOwnerId()); + } if (this.isChested()) { NBTTagList nbttaglist = new NBTTagList(); @@ -1129,7 +1232,17 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { this.setHorseVariant(nbttagcompound.getInteger("Variant")); this.setTemper(nbttagcompound.getInteger("Temper")); this.setHorseTamed(nbttagcompound.getBoolean("Tame")); - String s = nbttagcompound.getString("OwnerUUID"); + String s = ""; + if (worldObj.isRemote && !SingleplayerServerController.isClientInEaglerSingleplayerOrLAN()) { + if (nbttagcompound.hasKey("OwnerUUID", 8)) { + s = nbttagcompound.getString("OwnerUUID"); + } + } else { + if (nbttagcompound.hasKey("Owner", 8)) { + s = nbttagcompound.getString("Owner"); + } + } + if (s.length() > 0) { this.setOwnerId(s); } diff --git a/src/main/java/net/minecraft/entity/passive/EntityMooshroom.java b/src/main/java/net/minecraft/entity/passive/EntityMooshroom.java index 12da2250..6e126596 100755 --- a/src/main/java/net/minecraft/entity/passive/EntityMooshroom.java +++ b/src/main/java/net/minecraft/entity/passive/EntityMooshroom.java @@ -1,6 +1,7 @@ package net.minecraft.entity.passive; import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -59,6 +60,25 @@ public class EntityMooshroom extends EntityCow { 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]); + if (!this.worldObj.isRemote) { + 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 { diff --git a/src/main/java/net/minecraft/entity/passive/EntityOcelot.java b/src/main/java/net/minecraft/entity/passive/EntityOcelot.java index 46f7b0d6..fee41653 100755 --- a/src/main/java/net/minecraft/entity/passive/EntityOcelot.java +++ b/src/main/java/net/minecraft/entity/passive/EntityOcelot.java @@ -1,16 +1,30 @@ package net.minecraft.entity.passive; +import com.google.common.base.Predicate; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.minecraft.entity.ai.EntityAIFollowOwner; +import net.minecraft.entity.ai.EntityAILeapAtTarget; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIOcelotAttack; +import net.minecraft.entity.ai.EntityAIOcelotSit; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITargetNonTamed; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathNavigateGround; import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.StatCollector; @@ -38,10 +52,24 @@ import net.minecraft.world.World; * */ public class EntityOcelot extends EntityTameable { + 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() { @@ -49,6 +77,26 @@ public class EntityOcelot extends EntityTameable { 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 @@ -129,6 +177,7 @@ public class EntityOcelot extends EntityTameable { if (this.isEntityInvulnerable(damagesource)) { return false; } else { + this.aiSit.setSitting(false); return super.attackEntityFrom(damagesource, f); } } @@ -139,6 +188,46 @@ public class EntityOcelot extends EntityTameable { 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.worldObj.isRemote && !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.worldObj.isRemote) { + 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()) { @@ -227,6 +316,18 @@ public class EntityOcelot extends EntityTameable { 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 diff --git a/src/main/java/net/minecraft/entity/passive/EntityPig.java b/src/main/java/net/minecraft/entity/passive/EntityPig.java index a2651ed2..c39faf05 100755 --- a/src/main/java/net/minecraft/entity/passive/EntityPig.java +++ b/src/main/java/net/minecraft/entity/passive/EntityPig.java @@ -3,12 +3,23 @@ package net.minecraft.entity.passive; import net.minecraft.block.Block; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIControlledByPlayer; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.monster.EntityPigZombie; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathNavigateGround; import net.minecraft.stats.AchievementList; import net.minecraft.util.BlockPos; import net.minecraft.world.World; @@ -34,10 +45,22 @@ import net.minecraft.world.World; * */ public class EntityPig extends EntityAnimal { + 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() { @@ -104,6 +127,22 @@ public class EntityPig extends EntityAnimal { 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.worldObj.isRemote + || 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; } @@ -151,7 +190,19 @@ public class EntityPig extends EntityAnimal { * Called when a lightning bolt hits the entity. */ public void onStruckByLightning(EntityLightningBolt var1) { + if (!this.worldObj.isRemote && !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) { @@ -174,4 +225,11 @@ public class EntityPig extends EntityAnimal { 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/minecraft/entity/passive/EntityRabbit.java b/src/main/java/net/minecraft/entity/passive/EntityRabbit.java index de6f57d1..ca1bd665 100755 --- a/src/main/java/net/minecraft/entity/passive/EntityRabbit.java +++ b/src/main/java/net/minecraft/entity/passive/EntityRabbit.java @@ -1,18 +1,40 @@ package net.minecraft.entity.passive; import net.minecraft.block.Block; +import net.minecraft.block.BlockCarrot; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIMoveToBlock; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.EntityJumpHelper; +import net.minecraft.entity.ai.EntityMoveHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.World; @@ -37,6 +59,7 @@ import net.minecraft.world.World; * */ public class EntityRabbit extends EntityAnimal { + private EntityRabbit.AIAvoidEntity aiAvoidWolves; private int field_175540_bm = 0; private int field_175535_bn = 0; private boolean field_175536_bo = false; @@ -49,6 +72,27 @@ public class EntityRabbit extends EntityAnimal { 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) { @@ -60,6 +104,11 @@ public class EntityRabbit extends EntityAnimal { : ((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) { @@ -67,6 +116,7 @@ public class EntityRabbit extends EntityAnimal { 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); } @@ -89,6 +139,61 @@ public class EntityRabbit extends EntityAnimal { 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. @@ -96,6 +201,28 @@ public class EntityRabbit extends EntityAnimal { 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 @@ -104,6 +231,10 @@ public class EntityRabbit extends EntityAnimal { public void onLivingUpdate() { super.onLivingUpdate(); if (this.field_175540_bm != this.field_175535_bn) { + if (this.field_175540_bm == 0 && !this.worldObj.isRemote) { + this.worldObj.setEntityState(this, (byte) 1); + } + ++this.field_175540_bm; } else if (this.field_175535_bn != 0) { this.field_175540_bm = 0; @@ -245,6 +376,17 @@ public class EntityRabbit extends EntityAnimal { } 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)); } @@ -274,6 +416,15 @@ public class EntityRabbit extends EntityAnimal { 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 @@ -303,6 +454,119 @@ public class EntityRabbit extends EntityAnimal { } + 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); @@ -336,6 +600,53 @@ public class EntityRabbit extends EntityAnimal { } } + 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; diff --git a/src/main/java/net/minecraft/entity/passive/EntitySheep.java b/src/main/java/net/minecraft/entity/passive/EntitySheep.java index cb6b45b3..3e4dfde5 100755 --- a/src/main/java/net/minecraft/entity/passive/EntitySheep.java +++ b/src/main/java/net/minecraft/entity/passive/EntitySheep.java @@ -1,14 +1,22 @@ package net.minecraft.entity.passive; +import com.google.common.collect.Maps; import java.util.Map; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; - -import com.google.common.collect.Maps; - import net.minecraft.block.Block; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIEatGrass; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -19,6 +27,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathNavigateGround; import net.minecraft.util.BlockPos; import net.minecraft.util.MathHelper; import net.minecraft.world.DifficultyInstance; @@ -57,6 +66,7 @@ public class EntitySheep extends EntityAnimal { }, 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); @@ -65,17 +75,35 @@ public class EntitySheep extends EntityAnimal { 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(); + } + /**+ * 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.sheepTimer = Math.max(0, this.sheepTimer - 1); + if (this.worldObj.isRemote) { + this.sheepTimer = Math.max(0, this.sheepTimer - 1); + } + super.onLivingUpdate(); } @@ -147,6 +175,20 @@ public class EntitySheep extends EntityAnimal { public boolean interact(EntityPlayer entityplayer) { ItemStack itemstack = entityplayer.inventory.getCurrentItem(); if (itemstack != null && itemstack.getItem() == Items.shears && !this.getSheared() && !this.isChild()) { + if (!this.worldObj.isRemote) { + 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); } diff --git a/src/main/java/net/minecraft/entity/passive/EntitySquid.java b/src/main/java/net/minecraft/entity/passive/EntitySquid.java index 527ef676..9a2fd179 100755 --- a/src/main/java/net/minecraft/entity/passive/EntitySquid.java +++ b/src/main/java/net/minecraft/entity/passive/EntitySquid.java @@ -2,6 +2,7 @@ package net.minecraft.entity.passive; import net.minecraft.block.material.Material; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.init.Items; import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; @@ -50,6 +51,7 @@ public class EntitySquid extends EntityWaterMob { 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() { @@ -136,7 +138,16 @@ public class EntitySquid extends EntityWaterMob { this.lastTentacleAngle = this.tentacleAngle; this.squidRotation += this.rotationVelocity; if ((double) this.squidRotation > 6.283185307179586D) { - this.squidRotation = 6.2831855F; + if (this.worldObj.isRemote) { + this.squidRotation = 6.2831855F; + } else { + 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) { @@ -155,6 +166,12 @@ public class EntitySquid extends EntityWaterMob { this.field_70871_bB *= 0.99F; } + if (!this.worldObj.isRemote) { + 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; @@ -164,6 +181,13 @@ public class EntitySquid extends EntityWaterMob { - this.squidPitch) * 0.1F; } else { this.tentacleAngle = MathHelper.abs(MathHelper.sin(this.squidRotation)) * 3.1415927F * 0.25F; + if (!this.worldObj.isRemote) { + 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); } @@ -204,4 +228,29 @@ public class EntitySquid extends EntityWaterMob { 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/minecraft/entity/passive/EntityTameable.java b/src/main/java/net/minecraft/entity/passive/EntityTameable.java index 92c62ee5..f6579587 100755 --- a/src/main/java/net/minecraft/entity/passive/EntityTameable.java +++ b/src/main/java/net/minecraft/entity/passive/EntityTameable.java @@ -1,11 +1,14 @@ package net.minecraft.entity.passive; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; - +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IEntityOwnable; +import net.minecraft.entity.ai.EntityAISit; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.scoreboard.Team; +import net.minecraft.util.DamageSource; import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.World; @@ -31,6 +34,8 @@ import net.minecraft.world.World; */ public abstract class EntityTameable extends EntityAnimal implements IEntityOwnable { + protected EntityAISit aiSit = new EntityAISit(this); + public EntityTameable(World worldIn) { super(worldIn); this.setupTamedAI(); @@ -48,10 +53,18 @@ public abstract class EntityTameable extends EntityAnimal implements IEntityOwna */ public void writeEntityToNBT(NBTTagCompound nbttagcompound) { super.writeEntityToNBT(nbttagcompound); - if (this.getOwnerId() == null) { - nbttagcompound.setString("OwnerUUID", ""); + if (worldObj.isRemote && !SingleplayerServerController.isClientInEaglerSingleplayerOrLAN()) { + if (this.getOwnerId() == null) { + nbttagcompound.setString("OwnerUUID", ""); + } else { + nbttagcompound.setString("OwnerUUID", this.getOwnerId()); + } } else { - nbttagcompound.setString("OwnerUUID", this.getOwnerId()); + if (this.getOwnerId() == null) { + nbttagcompound.setString("Owner", ""); + } else { + nbttagcompound.setString("Owner", this.getOwnerId()); + } } nbttagcompound.setBoolean("Sitting", this.isSitting()); @@ -63,11 +76,23 @@ public abstract class EntityTameable extends EntityAnimal implements IEntityOwna */ public void readEntityFromNBT(NBTTagCompound nbttagcompound) { super.readEntityFromNBT(nbttagcompound); - String s = nbttagcompound.getString("OwnerUUID"); + String s = ""; + if (worldObj.isRemote && !SingleplayerServerController.isClientInEaglerSingleplayerOrLAN()) { + if (nbttagcompound.hasKey("OwnerUUID", 8)) { + s = nbttagcompound.getString("OwnerUUID"); + } + } else { + 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")); } @@ -158,6 +183,13 @@ public abstract class EntityTameable extends EntityAnimal implements IEntityOwna 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; } @@ -187,4 +219,16 @@ public abstract class EntityTameable extends EntityAnimal implements IEntityOwna return super.isOnSameTeam(entitylivingbase); } + + /**+ + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource damagesource) { + if (!this.worldObj.isRemote && 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/minecraft/entity/passive/EntityVillager.java b/src/main/java/net/minecraft/entity/passive/EntityVillager.java index 661c7d3e..054ec92b 100755 --- a/src/main/java/net/minecraft/entity/passive/EntityVillager.java +++ b/src/main/java/net/minecraft/entity/passive/EntityVillager.java @@ -1,18 +1,39 @@ package net.minecraft.entity.passive; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; - import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentData; import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.IMerchant; import net.minecraft.entity.INpc; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.minecraft.entity.ai.EntityAIFollowGolem; +import net.minecraft.entity.ai.EntityAIHarvestFarmland; +import net.minecraft.entity.ai.EntityAILookAtTradePlayer; +import net.minecraft.entity.ai.EntityAIMoveIndoors; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAIOpenDoor; +import net.minecraft.entity.ai.EntityAIPlay; +import net.minecraft.entity.ai.EntityAIRestrictOpenDoor; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITradePlayer; +import net.minecraft.entity.ai.EntityAIVillagerInteract; +import net.minecraft.entity.ai.EntityAIVillagerMate; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.EntityAIWatchClosest2; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.monster.IMob; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -22,16 +43,21 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.pathfinding.PathNavigateGround; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.stats.StatList; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.DamageSource; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.IChatComponent; import net.minecraft.util.MathHelper; import net.minecraft.util.Tuple; import net.minecraft.village.MerchantRecipe; import net.minecraft.village.MerchantRecipeList; +import net.minecraft.village.Village; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.World; @@ -59,6 +85,7 @@ public class EntityVillager extends EntityAgeable implements IMerchant, INpc { private int randomTickDivider; private boolean isMating; private boolean isPlaying; + Village villageObj; private EntityPlayer buyingPlayer; private MerchantRecipeList buyingList; private int timeUntilReset; @@ -251,14 +278,98 @@ public class EntityVillager extends EntityAgeable implements IMerchant, INpc { 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. @@ -267,6 +378,11 @@ public class EntityVillager extends EntityAgeable implements IMerchant, INpc { ItemStack itemstack = entityplayer.inventory.getCurrentItem(); boolean flag = itemstack != null && itemstack.getItem() == Items.spawn_egg; if (!flag && this.isEntityAlive() && !this.isTrading() && !this.isChild()) { + if (!this.worldObj.isRemote && (this.buyingList == null || this.buyingList.size() > 0)) { + this.setCustomer(entityplayer); + entityplayer.displayVillagerTradeGui(this); + } + entityplayer.triggerAchievement(StatList.timesTalkedToVillagerStat); return true; } else { @@ -291,7 +407,11 @@ public class EntityVillager extends EntityAgeable implements IMerchant, INpc { nbttagcompound.setInteger("CareerLevel", this.careerLevel); nbttagcompound.setBoolean("Willing", this.isWillingToMate); if (this.buyingList != null) { - nbttagcompound.setTag("Offers", this.buyingList.getRecipiesAsTags()); + try { + nbttagcompound.setTag("Offers", this.buyingList.getRecipiesAsTags()); + } catch (Throwable t) { + this.buyingList = null; // workaround + } } NBTTagList nbttaglist = new NBTTagList(); @@ -332,6 +452,7 @@ public class EntityVillager extends EntityAgeable implements IMerchant, INpc { } this.setCanPickUpLoot(true); + this.setAdditionalAItasks(); } /**+ @@ -387,6 +508,48 @@ public class EntityVillager extends EntityAgeable implements IMerchant, INpc { 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; } @@ -468,6 +631,14 @@ public class EntityVillager extends EntityAgeable implements IMerchant, INpc { * played depending if the suggested itemstack is not null. */ public void verifySellingItem(ItemStack itemstack) { + if (!this.worldObj.isRemote && 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()); + } + } } @@ -618,6 +789,7 @@ public class EntityVillager extends EntityAgeable implements IMerchant, INpc { IEntityLivingData ientitylivingdata) { ientitylivingdata = super.onInitialSpawn(difficultyinstance, ientitylivingdata); this.setProfession(this.worldObj.rand.nextInt(5)); + this.setAdditionalAItasks(); return ientitylivingdata; } @@ -640,7 +812,20 @@ public class EntityVillager extends EntityAgeable implements IMerchant, INpc { * Called when a lightning bolt hits the entity. */ public void onStruckByLightning(EntityLightningBolt var1) { + if (!this.worldObj.isRemote && !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() { diff --git a/src/main/java/net/minecraft/entity/passive/EntityWolf.java b/src/main/java/net/minecraft/entity/passive/EntityWolf.java index f2d480d1..56410100 100755 --- a/src/main/java/net/minecraft/entity/passive/EntityWolf.java +++ b/src/main/java/net/minecraft/entity/passive/EntityWolf.java @@ -1,12 +1,28 @@ package net.minecraft.entity.passive; +import com.google.common.base.Predicate; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIBeg; +import net.minecraft.entity.ai.EntityAIFollowOwner; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILeapAtTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; +import net.minecraft.entity.ai.EntityAIOwnerHurtTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITargetNonTamed; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Items; @@ -15,6 +31,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathNavigateGround; import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumParticleTypes; @@ -52,6 +69,27 @@ public class EntityWolf extends EntityTameable { 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); } @@ -155,6 +193,26 @@ public class EntityWolf extends EntityTameable { 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.worldObj.isRemote && 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.worldObj.isRemote && this.getAttackTarget() == null && this.isAngry()) { + this.setAngry(false); + } + + } + /**+ * Called to update the entity's position/logic. */ @@ -257,6 +315,7 @@ public class EntityWolf extends EntityTameable { 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; } @@ -322,6 +381,13 @@ public class EntityWolf extends EntityTameable { } } } + + if (this.isOwner(entityplayer) && !this.worldObj.isRemote && !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; @@ -331,6 +397,22 @@ public class EntityWolf extends EntityTameable { entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, (ItemStack) null); } + if (!this.worldObj.isRemote) { + 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; } diff --git a/src/main/java/net/minecraft/entity/player/EntityPlayer.java b/src/main/java/net/minecraft/entity/player/EntityPlayer.java index 3c85f8be..cb373593 100755 --- a/src/main/java/net/minecraft/entity/player/EntityPlayer.java +++ b/src/main/java/net/minecraft/entity/player/EntityPlayer.java @@ -1,13 +1,12 @@ package 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 com.google.common.base.Charsets; -import com.google.common.collect.Lists; - -import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; import net.minecraft.block.Block; import net.minecraft.block.BlockBed; import net.minecraft.block.BlockDirectional; @@ -29,6 +28,7 @@ import net.minecraft.entity.boss.EntityDragonPart; import net.minecraft.entity.item.EntityBoat; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.monster.IMob; import net.minecraft.entity.passive.EntityHorse; import net.minecraft.entity.passive.EntityPig; @@ -48,6 +48,7 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.play.server.S12PacketEntityVelocity; import net.minecraft.potion.Potion; import net.minecraft.scoreboard.IScoreObjectiveCriteria; import net.minecraft.scoreboard.Score; @@ -55,6 +56,7 @@ import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.scoreboard.ScorePlayerTeam; import net.minecraft.scoreboard.Scoreboard; import net.minecraft.scoreboard.Team; +import net.minecraft.server.MinecraftServer; import net.minecraft.stats.AchievementList; import net.minecraft.stats.StatBase; import net.minecraft.stats.StatList; @@ -147,7 +149,7 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS super(worldIn); this.entityUniqueID = getUUID(gameProfileIn); this.gameProfile = gameProfileIn; - this.inventoryContainer = new ContainerPlayer(this.inventory, false, this); + this.inventoryContainer = new ContainerPlayer(this.inventory, !worldIn.isRemote, this); this.openContainer = this.inventoryContainer; BlockPos blockpos = worldIn.getSpawnPoint(); this.setLocationAndAngles((double) blockpos.getX() + 0.5D, (double) (blockpos.getY() + 1), @@ -211,6 +213,10 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS public void clearItemInUse() { this.itemInUse = null; this.itemInUseCount = 0; + if (!this.worldObj.isRemote) { + this.setEating(false); + } + } public boolean isBlocking() { @@ -233,7 +239,9 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS this.updateItemUse(itemstack, 5); } - --this.itemInUseCount; + if (--this.itemInUseCount == 0 && !this.worldObj.isRemote) { + this.onItemUseFinish(); + } } else { this.clearItemInUse(); } @@ -248,6 +256,14 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS if (this.sleepTimer > 100) { this.sleepTimer = 100; } + + if (!this.worldObj.isRemote) { + 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) { @@ -256,6 +272,10 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS } super.onUpdate(); + if (!this.worldObj.isRemote && this.openContainer != null && !this.openContainer.canInteractWith(this)) { + this.closeScreen(); + this.openContainer = this.inventoryContainer; + } if (this.isBurning() && this.capabilities.disableDamage) { this.extinguish(); @@ -299,6 +319,14 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS this.startMinecartRidingCoordinate = null; } + if (!this.worldObj.isRemote) { + 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); @@ -422,19 +450,25 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS * Handles updating while being ridden by an entity */ public void updateRidden() { - 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; + if (!this.worldObj.isRemote && 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; + } + } } @@ -481,6 +515,9 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS this.prevCameraYaw = this.cameraYaw; super.onLivingUpdate(); IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + if (!this.worldObj.isRemote) { + iattributeinstance.setBaseValue((double) this.capabilities.getWalkSpeed()); + } this.jumpMovementFactor = this.speedInAir; if (this.isSprinting()) { @@ -598,7 +635,7 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS */ public void addToPlayerScore(Entity entity, int i) { this.addScore(i); - Collection collection = this.getWorldScoreboard() + Collection collection = this.getWorldScoreboard() .getObjectivesFromCriteria(IScoreObjectiveCriteria.totalKillCount); if (entity instanceof EntityPlayer) { this.triggerAchievement(StatList.playerKillsStat); @@ -609,7 +646,7 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS this.triggerAchievement(StatList.mobKillsStat); } - for (ScoreObjective scoreobjective : (Collection) collection) { + for (ScoreObjective scoreobjective : collection) { Score score = this.getWorldScoreboard().getValueFromObjective(this.getName(), scoreobjective); score.func_96648_a(); } @@ -850,6 +887,10 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS if (this.getHealth() <= 0.0F) { return false; } else { + if (this.isPlayerSleeping() && !this.worldObj.isRemote) { + this.wakeUpPlayer(true, true, false); + } + if (damagesource.isDifficultyScaled()) { if (this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL) { f = 0.0F; @@ -991,6 +1032,17 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS this.destroyCurrentEquippedItem(); } + return true; + } + } else if (!this.worldObj.isRemote && 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; } } @@ -1087,6 +1139,15 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS 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); } @@ -1186,6 +1247,35 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS } public EntityPlayer.EnumStatus trySleep(BlockPos blockpos) { + if (!this.worldObj.isRemote) { + 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); @@ -1223,6 +1313,9 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS this.sleepTimer = 0; this.playerLocation = blockpos; this.motionX = this.motionZ = this.motionY = 0.0D; + if (!this.worldObj.isRemote) { + this.worldObj.updateAllPlayersSleepingFlag(); + } return EntityPlayer.EnumStatus.OK; } @@ -1265,6 +1358,9 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS } this.sleeping = false; + if (!this.worldObj.isRemote && flag1) { + this.worldObj.updateAllPlayersSleepingFlag(); + } this.sleepTimer = flag ? 0 : 100; if (flag2) { @@ -1618,7 +1714,12 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS * increases exhaustion level by supplied amount */ public void addExhaustion(float parFloat1) { + if (!this.capabilities.disableDamage) { + if (!this.worldObj.isRemote) { + this.foodStats.addExhaustion(parFloat1); + } + } } /**+ @@ -1647,6 +1748,10 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS if (itemstack != this.itemInUse) { this.itemInUse = itemstack; this.itemInUseCount = i; + if (!this.worldObj.isRemote) { + this.setEating(true); + } + } } @@ -1897,7 +2002,7 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS * about executed commands */ public boolean sendCommandFeedback() { - return true; + return MinecraftServer.getServer().worldServers[0].getGameRules().getBoolean("sendCommandFeedback"); } public boolean replaceItemInInventory(int i, ItemStack itemstack) { 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/minecraft/entity/player/EntityPlayerMP.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/EntityPlayerMP.java rename to src/main/java/net/minecraft/entity/player/EntityPlayerMP.java index 62044375..ac48f257 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/entity/player/EntityPlayerMP.java +++ b/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.entity.player; +package net.minecraft.entity.player; import com.google.common.collect.Lists; import com.google.common.collect.Sets; @@ -9,97 +9,95 @@ 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.block.Block; +import net.minecraft.block.BlockFence; +import net.minecraft.block.BlockFenceGate; +import net.minecraft.block.BlockWall; +import 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.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.ContainerHorseInventory; +import net.minecraft.inventory.ContainerMerchant; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryMerchant; +import net.minecraft.inventory.SlotCrafting; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemMapBase; +import 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.minecraft.network.NetHandlerPlayServer; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S06PacketUpdateHealth; +import net.minecraft.network.play.server.S0APacketUseBed; +import net.minecraft.network.play.server.S0BPacketAnimation; +import net.minecraft.network.play.server.S13PacketDestroyEntities; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S1EPacketRemoveEntityEffect; +import net.minecraft.network.play.server.S1FPacketSetExperience; +import net.minecraft.network.play.server.S21PacketChunkData; +import net.minecraft.network.play.server.S26PacketMapChunkBulk; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.minecraft.network.play.server.S2EPacketCloseWindow; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S30PacketWindowItems; +import net.minecraft.network.play.server.S31PacketWindowProperty; +import net.minecraft.network.play.server.S36PacketSignEditorOpen; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.network.play.server.S42PacketCombatEvent; +import net.minecraft.network.play.server.S43PacketCamera; +import net.minecraft.network.play.server.S48PacketResourcePackSend; +import net.minecraft.potion.PotionEffect; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.ItemInWorldManager; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.stats.StatisticsFile; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSource; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.JsonSerializableSet; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.village.MerchantRecipeList; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.IInteractionObject; +import net.minecraft.world.ILockableContainer; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.biome.BiomeGenBase; +import 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. * @@ -122,10 +120,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; diff --git a/src/main/java/net/minecraft/entity/projectile/EntityArrow.java b/src/main/java/net/minecraft/entity/projectile/EntityArrow.java index 69da7e57..a43a38c2 100755 --- a/src/main/java/net/minecraft/entity/projectile/EntityArrow.java +++ b/src/main/java/net/minecraft/entity/projectile/EntityArrow.java @@ -1,7 +1,6 @@ package net.minecraft.entity.projectile; import java.util.List; - import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; @@ -11,7 +10,11 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IProjectile; import net.minecraft.entity.monster.EntityEnderman; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.server.S2BPacketChangeGameState; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; @@ -178,11 +181,20 @@ public class EntityArrow extends Entity implements IProjectile { } + 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) @@ -292,6 +304,10 @@ public class EntityArrow extends Entity implements IProjectile { if (movingobjectposition.entityHit.attackEntityFrom(damagesource, (float) l)) { if (movingobjectposition.entityHit instanceof EntityLivingBase) { EntityLivingBase entitylivingbase = (EntityLivingBase) movingobjectposition.entityHit; + if (!this.worldObj.isRemote) { + entitylivingbase.setArrowCountInEntity(entitylivingbase.getArrowCountInEntity() + 1); + } + if (this.knockbackStrength > 0) { float f7 = MathHelper .sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); @@ -309,6 +325,13 @@ public class EntityArrow extends Entity implements IProjectile { 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)); @@ -458,6 +481,28 @@ public class EntityArrow extends Entity implements IProjectile { } + /**+ + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer entityplayer) { + if (!this.worldObj.isRemote && 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 diff --git a/src/main/java/net/minecraft/entity/projectile/EntityEgg.java b/src/main/java/net/minecraft/entity/projectile/EntityEgg.java index f29ea154..aa9af05e 100755 --- a/src/main/java/net/minecraft/entity/projectile/EntityEgg.java +++ b/src/main/java/net/minecraft/entity/projectile/EntityEgg.java @@ -1,6 +1,7 @@ package net.minecraft.entity.projectile; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityChicken; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.util.DamageSource; @@ -50,6 +51,20 @@ public class EntityEgg extends EntityThrowable { 0.0F); } + if (!this.worldObj.isRemote && 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) { @@ -58,5 +73,9 @@ public class EntityEgg extends EntityThrowable { ((double) this.rand.nextFloat() - 0.5D) * 0.08D, new int[] { Item.getIdFromItem(Items.egg) }); } + if (!this.worldObj.isRemote) { + this.setDead(); + } + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/entity/projectile/EntityFireball.java b/src/main/java/net/minecraft/entity/projectile/EntityFireball.java index 80faef2f..a4706265 100755 --- a/src/main/java/net/minecraft/entity/projectile/EntityFireball.java +++ b/src/main/java/net/minecraft/entity/projectile/EntityFireball.java @@ -104,7 +104,8 @@ public abstract class EntityFireball extends Entity { * Called to update the entity's position/logic. */ public void onUpdate() { - if (this.worldObj.isBlockLoaded(new BlockPos(this))) { + if (this.worldObj.isRemote || (this.shootingEntity == null || !this.shootingEntity.isDead) + && this.worldObj.isBlockLoaded(new BlockPos(this))) { super.onUpdate(); this.setFire(1); if (this.inGround) { diff --git a/src/main/java/net/minecraft/entity/projectile/EntityFishHook.java b/src/main/java/net/minecraft/entity/projectile/EntityFishHook.java index 487ba6fb..19557e4b 100755 --- a/src/main/java/net/minecraft/entity/projectile/EntityFishHook.java +++ b/src/main/java/net/minecraft/entity/projectile/EntityFishHook.java @@ -2,10 +2,12 @@ package net.minecraft.entity.projectile; import java.util.Arrays; import java.util.List; - import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -13,15 +15,19 @@ import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemFishFood; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.StatList; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Vec3; +import net.minecraft.util.WeightedRandom; import net.minecraft.util.WeightedRandomFishable; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -218,6 +224,28 @@ public class EntityFishHook extends Entity { this.setPosition(d7, d8, d9); this.setRotation(this.rotationYaw, this.rotationPitch); } else { + if (!this.worldObj.isRemote) { + 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; @@ -337,6 +365,107 @@ public class EntityFishHook extends Entity { } } + if (!this.worldObj.isRemote && 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) { @@ -385,7 +514,70 @@ public class EntityFishHook extends Entity { } public int handleHookRetraction() { - return 0; + if (this.worldObj.isRemote) { + return 0; + } else { + 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); + } + } } /**+ diff --git a/src/main/java/net/minecraft/entity/projectile/EntityLargeFireball.java b/src/main/java/net/minecraft/entity/projectile/EntityLargeFireball.java index d75d3d3b..abe2d8c3 100755 --- a/src/main/java/net/minecraft/entity/projectile/EntityLargeFireball.java +++ b/src/main/java/net/minecraft/entity/projectile/EntityLargeFireball.java @@ -1,7 +1,9 @@ package net.minecraft.entity.projectile; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -45,6 +47,19 @@ public class EntityLargeFireball extends EntityFireball { * Called when this EntityFireball hits a block or entity. */ protected void onImpact(MovingObjectPosition movingobjectposition) { + if (!this.worldObj.isRemote) { + 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(); + } + } /**+ diff --git a/src/main/java/net/minecraft/entity/projectile/EntityPotion.java b/src/main/java/net/minecraft/entity/projectile/EntityPotion.java index b19ffe38..e9397227 100755 --- a/src/main/java/net/minecraft/entity/projectile/EntityPotion.java +++ b/src/main/java/net/minecraft/entity/projectile/EntityPotion.java @@ -1,9 +1,14 @@ package net.minecraft.entity.projectile; +import java.util.List; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -95,6 +100,41 @@ public class EntityPotion extends EntityThrowable { * Called when this EntityThrowable hits a block or entity. */ protected void onImpact(MovingObjectPosition movingobjectposition) { + if (!this.worldObj.isRemote) { + 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(); + } } diff --git a/src/main/java/net/minecraft/entity/projectile/EntitySmallFireball.java b/src/main/java/net/minecraft/entity/projectile/EntitySmallFireball.java index adfc2ae2..0daf2fc7 100755 --- a/src/main/java/net/minecraft/entity/projectile/EntitySmallFireball.java +++ b/src/main/java/net/minecraft/entity/projectile/EntitySmallFireball.java @@ -1,6 +1,9 @@ package net.minecraft.entity.projectile; +import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -46,6 +49,32 @@ public class EntitySmallFireball extends EntityFireball { * Called when this EntityFireball hits a block or entity. */ protected void onImpact(MovingObjectPosition movingobjectposition) { + if (!this.worldObj.isRemote) { + 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(); + } } diff --git a/src/main/java/net/minecraft/entity/projectile/EntitySnowball.java b/src/main/java/net/minecraft/entity/projectile/EntitySnowball.java index db64af2b..a2dc92ff 100755 --- a/src/main/java/net/minecraft/entity/projectile/EntitySnowball.java +++ b/src/main/java/net/minecraft/entity/projectile/EntitySnowball.java @@ -59,5 +59,8 @@ public class EntitySnowball extends EntityThrowable { new int[0]); } + if (!this.worldObj.isRemote) { + this.setDead(); + } } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/entity/projectile/EntityThrowable.java b/src/main/java/net/minecraft/entity/projectile/EntityThrowable.java index 09951e59..12e09a3e 100755 --- a/src/main/java/net/minecraft/entity/projectile/EntityThrowable.java +++ b/src/main/java/net/minecraft/entity/projectile/EntityThrowable.java @@ -1,5 +1,7 @@ package net.minecraft.entity.projectile; +import java.util.List; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -7,6 +9,7 @@ import net.minecraft.entity.IProjectile; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; @@ -14,6 +17,7 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Vec3; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -191,6 +195,35 @@ public abstract class EntityThrowable extends Entity implements IProjectile { movingobjectposition.hitVec.zCoord); } + if (!this.worldObj.isRemote) { + 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) { @@ -304,6 +337,17 @@ public abstract class EntityThrowable extends Entity implements IProjectile { 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; diff --git a/src/main/java/net/minecraft/entity/projectile/EntityWitherSkull.java b/src/main/java/net/minecraft/entity/projectile/EntityWitherSkull.java index 4c7743bb..28adba76 100755 --- a/src/main/java/net/minecraft/entity/projectile/EntityWitherSkull.java +++ b/src/main/java/net/minecraft/entity/projectile/EntityWitherSkull.java @@ -4,9 +4,12 @@ import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.boss.EntityWither; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.EnumDifficulty; import net.minecraft.world.Explosion; import net.minecraft.world.World; @@ -79,6 +82,40 @@ public class EntityWitherSkull extends EntityFireball { * Called when this EntityFireball hits a block or entity. */ protected void onImpact(MovingObjectPosition movingobjectposition) { + if (!this.worldObj.isRemote) { + 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(); + } } diff --git a/src/main/java/net/minecraft/init/Bootstrap.java b/src/main/java/net/minecraft/init/Bootstrap.java index f55300eb..a67e2d89 100755 --- a/src/main/java/net/minecraft/init/Bootstrap.java +++ b/src/main/java/net/minecraft/init/Bootstrap.java @@ -1,10 +1,9 @@ package 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.log4j.LogManager; -import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; import net.minecraft.block.Block; import net.minecraft.block.BlockDispenser; import net.minecraft.block.BlockFire; @@ -34,6 +33,8 @@ import net.minecraft.entity.projectile.EntityEgg; import net.minecraft.entity.projectile.EntityPotion; import net.minecraft.entity.projectile.EntitySmallFireball; import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.item.EnumDyeColor; import net.minecraft.item.Item; import net.minecraft.item.ItemAxe; @@ -44,13 +45,20 @@ import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemPotion; import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.util.LoggingPrintStream; import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntitySkull; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.LoggingPrintStream; +import net.minecraft.util.StringUtils; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -318,7 +326,9 @@ public class Bootstrap { World world = iblocksource.getWorld(); BlockPos blockpos = iblocksource.getBlockPos() .offset(BlockDispenser.getFacing(iblocksource.getBlockMetadata())); - if (!ItemDye.applyBonemeal(itemstack, world, blockpos)) { + if (ItemDye.applyBonemeal(itemstack, world, blockpos)) { + world.playAuxSFX(2005, blockpos, 0); + } else { this.field_150838_b = false; } @@ -359,7 +369,40 @@ public class Bootstrap { 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))) { + 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; } @@ -385,6 +428,7 @@ public class Bootstrap { .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; @@ -416,7 +460,7 @@ public class Bootstrap { Block.registerBlocks(); Blocks.doBootstrap(); - BiomeGenBase.bootstrap(); + BiomeGenBase.doBootstrap(); BlockFire.init(); EntityEnderman.bootstrap(); ItemAxe.bootstrap(); diff --git a/src/main/java/net/minecraft/inventory/ContainerBeacon.java b/src/main/java/net/minecraft/inventory/ContainerBeacon.java index 5fac4968..c392b12a 100755 --- a/src/main/java/net/minecraft/inventory/ContainerBeacon.java +++ b/src/main/java/net/minecraft/inventory/ContainerBeacon.java @@ -59,6 +59,20 @@ public class ContainerBeacon extends Container { return this.tileBeacon; } + /**+ + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + if (entityplayer != null && !entityplayer.worldObj.isRemote) { + 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); } diff --git a/src/main/java/net/minecraft/inventory/ContainerEnchantment.java b/src/main/java/net/minecraft/inventory/ContainerEnchantment.java index c9bcb9e7..bf182d0b 100755 --- a/src/main/java/net/minecraft/inventory/ContainerEnchantment.java +++ b/src/main/java/net/minecraft/inventory/ContainerEnchantment.java @@ -2,7 +2,6 @@ package net.minecraft.inventory; import java.util.List; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; - import net.minecraft.enchantment.EnchantmentData; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayer; @@ -11,6 +10,7 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.EnumDyeColor; import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; import net.minecraft.util.BlockPos; import net.minecraft.world.World; @@ -142,7 +142,75 @@ public class ContainerEnchantment extends Container { public void onCraftMatrixChanged(IInventory iinventory) { if (iinventory == this.tableInventory) { ItemStack itemstack = iinventory.getStackInSlot(0); - if (!(itemstack != null && itemstack.isItemEnchantable())) { + if (itemstack != null && itemstack.isItemEnchantable()) { + if (!this.worldPointer.isRemote) { + 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; @@ -165,6 +233,38 @@ public class ContainerEnchantment extends Container { } else if (this.enchantLevels[i] > 0 && itemstack != null && (entityplayer.experienceLevel >= j && entityplayer.experienceLevel >= this.enchantLevels[i] || entityplayer.capabilities.isCreativeMode)) { + if (!this.worldPointer.isRemote) { + 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; @@ -186,6 +286,22 @@ public class ContainerEnchantment extends Container { return itemstack == null ? 0 : itemstack.stackSize; } + /**+ + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + if (!this.worldPointer.isRemote) { + 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, diff --git a/src/main/java/net/minecraft/inventory/ContainerMerchant.java b/src/main/java/net/minecraft/inventory/ContainerMerchant.java index 16010e1c..93a71f25 100755 --- a/src/main/java/net/minecraft/inventory/ContainerMerchant.java +++ b/src/main/java/net/minecraft/inventory/ContainerMerchant.java @@ -137,5 +137,16 @@ public class ContainerMerchant extends Container { super.onContainerClosed(entityplayer); this.theMerchant.setCustomer((EntityPlayer) null); super.onContainerClosed(entityplayer); + if (!this.theWorld.isRemote) { + 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/minecraft/inventory/ContainerRepair.java b/src/main/java/net/minecraft/inventory/ContainerRepair.java index 646b5fba..62fe6843 100755 --- a/src/main/java/net/minecraft/inventory/ContainerRepair.java +++ b/src/main/java/net/minecraft/inventory/ContainerRepair.java @@ -2,11 +2,8 @@ package net.minecraft.inventory; import java.util.Iterator; import java.util.Map; - -import org.apache.commons.lang3.StringUtils; - -import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; -import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.state.IBlockState; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayer; @@ -16,6 +13,9 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import 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; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -96,6 +96,22 @@ public class ContainerRepair extends Container { } ContainerRepair.this.maximumCost = 0; + IBlockState iblockstate = worldIn.getBlockState(blockPosIn); + if (!entityplayer.capabilities.isCreativeMode && !worldIn.isRemote + && 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 if (!worldIn.isRemote) { + worldIn.playAuxSFX(1021, blockPosIn, 0); + } } }); @@ -322,6 +338,22 @@ public class ContainerRepair extends Container { } + /**+ + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + if (!this.theWorld.isRemote) { + 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, diff --git a/src/main/java/net/minecraft/inventory/ContainerWorkbench.java b/src/main/java/net/minecraft/inventory/ContainerWorkbench.java index dd8d7f5d..2959bb26 100755 --- a/src/main/java/net/minecraft/inventory/ContainerWorkbench.java +++ b/src/main/java/net/minecraft/inventory/ContainerWorkbench.java @@ -70,6 +70,21 @@ public class ContainerWorkbench extends Container { CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); } + /**+ + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer entityplayer) { + super.onContainerClosed(entityplayer); + if (!this.worldObj.isRemote) { + 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, diff --git a/src/main/java/net/minecraft/inventory/SlotFurnaceOutput.java b/src/main/java/net/minecraft/inventory/SlotFurnaceOutput.java index 5c6e95ab..e8561208 100755 --- a/src/main/java/net/minecraft/inventory/SlotFurnaceOutput.java +++ b/src/main/java/net/minecraft/inventory/SlotFurnaceOutput.java @@ -1,9 +1,12 @@ package net.minecraft.inventory; +import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.stats.AchievementList; +import net.minecraft.util.MathHelper; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -76,6 +79,28 @@ public class SlotFurnaceOutput extends Slot { */ protected void onCrafting(ItemStack stack) { stack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75228_b); + if (!this.thePlayer.worldObj.isRemote) { + 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) { diff --git a/src/main/java/net/minecraft/item/ItemAppleGold.java b/src/main/java/net/minecraft/item/ItemAppleGold.java index 0de4cc76..68b91c44 100755 --- a/src/main/java/net/minecraft/item/ItemAppleGold.java +++ b/src/main/java/net/minecraft/item/ItemAppleGold.java @@ -1,9 +1,10 @@ package net.minecraft.item; import java.util.List; - import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; /**+ @@ -44,9 +45,20 @@ public class ItemAppleGold extends ItemFood { } protected void onFoodEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) { - if (itemstack.getMetadata() == 0) { + if (!world.isRemote) { + entityplayer.addPotionEffect(new PotionEffect(Potion.absorption.id, 2400, 0)); + } + + if (itemstack.getMetadata() > 0) { + if (!world.isRemote) { + 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); } + } /**+ diff --git a/src/main/java/net/minecraft/item/ItemArmorStand.java b/src/main/java/net/minecraft/item/ItemArmorStand.java index 9ad636be..22d8342a 100755 --- a/src/main/java/net/minecraft/item/ItemArmorStand.java +++ b/src/main/java/net/minecraft/item/ItemArmorStand.java @@ -1,13 +1,17 @@ package net.minecraft.item; import java.util.List; - +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Rotations; import net.minecraft.world.World; /**+ @@ -64,6 +68,27 @@ public class ItemArmorStand extends Item { if (list.size() > 0) { return false; } else { + if (!world.isRemote) { + 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; } @@ -71,4 +96,16 @@ public class ItemArmorStand extends Item { } } } + + 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/minecraft/item/ItemBanner.java b/src/main/java/net/minecraft/item/ItemBanner.java index 3c17a1ef..5b097b34 100755 --- a/src/main/java/net/minecraft/item/ItemBanner.java +++ b/src/main/java/net/minecraft/item/ItemBanner.java @@ -1,15 +1,18 @@ package net.minecraft.item; import java.util.List; - +import net.minecraft.block.BlockStandingSign; +import net.minecraft.block.BlockWallSign; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityBanner; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.World; @@ -57,7 +60,25 @@ public class ItemBanner extends ItemBlock { return false; } else if (!Blocks.standing_banner.canPlaceBlockAt(world, blockpos)) { return false; + } else if (world.isRemote) { + return true; } 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; } } diff --git a/src/main/java/net/minecraft/item/ItemBed.java b/src/main/java/net/minecraft/item/ItemBed.java index 5c462892..991e1eb2 100755 --- a/src/main/java/net/minecraft/item/ItemBed.java +++ b/src/main/java/net/minecraft/item/ItemBed.java @@ -1,9 +1,14 @@ package net.minecraft.item; +import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; import net.minecraft.world.World; /**+ @@ -36,6 +41,45 @@ public class ItemBed extends Item { */ public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, EnumFacing enumfacing, float var6, float var7, float var8) { - return true; + if (world.isRemote) { + return true; + } else 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/minecraft/item/ItemBlock.java b/src/main/java/net/minecraft/item/ItemBlock.java index 6db69e74..0cf4bda1 100755 --- a/src/main/java/net/minecraft/item/ItemBlock.java +++ b/src/main/java/net/minecraft/item/ItemBlock.java @@ -1,13 +1,15 @@ package net.minecraft.item; import java.util.List; - import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; @@ -88,7 +90,37 @@ public class ItemBlock extends Item { } public static boolean setTileEntityNBT(World worldIn, EntityPlayer pos, BlockPos stack, ItemStack parItemStack) { - return false; + 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 (!worldIn.isRemote && 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, diff --git a/src/main/java/net/minecraft/item/ItemBoat.java b/src/main/java/net/minecraft/item/ItemBoat.java index f5cd3bb9..d71c7084 100755 --- a/src/main/java/net/minecraft/item/ItemBoat.java +++ b/src/main/java/net/minecraft/item/ItemBoat.java @@ -104,6 +104,10 @@ public class ItemBoat extends Item { return itemstack; } + if (!world.isRemote) { + world.spawnEntityInWorld(entityboat); + } + if (!entityplayer.capabilities.isCreativeMode) { --itemstack.stackSize; } diff --git a/src/main/java/net/minecraft/item/ItemBow.java b/src/main/java/net/minecraft/item/ItemBow.java index 489f7164..b6e9a142 100755 --- a/src/main/java/net/minecraft/item/ItemBow.java +++ b/src/main/java/net/minecraft/item/ItemBow.java @@ -86,6 +86,9 @@ public class ItemBow extends Item { } playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); + if (!worldIn.isRemote) { + worldIn.spawnEntityInWorld(entityarrow); + } } } diff --git a/src/main/java/net/minecraft/item/ItemBucket.java b/src/main/java/net/minecraft/item/ItemBucket.java index 149628fb..20690290 100755 --- a/src/main/java/net/minecraft/item/ItemBucket.java +++ b/src/main/java/net/minecraft/item/ItemBucket.java @@ -137,6 +137,10 @@ public class ItemBucket extends Item { (double) j + Math.random(), (double) k + Math.random(), 0.0D, 0.0D, 0.0D, new int[0]); } } else { + if (!worldIn.isRemote && flag && !material.isLiquid()) { + worldIn.destroyBlock(pos, true); + } + worldIn.setBlockState(pos, this.isFull.getDefaultState(), 3); } diff --git a/src/main/java/net/minecraft/item/ItemBucketMilk.java b/src/main/java/net/minecraft/item/ItemBucketMilk.java index 07c9e48e..79247e16 100755 --- a/src/main/java/net/minecraft/item/ItemBucketMilk.java +++ b/src/main/java/net/minecraft/item/ItemBucketMilk.java @@ -41,6 +41,11 @@ public class ItemBucketMilk extends Item { if (!playerIn.capabilities.isCreativeMode) { --stack.stackSize; } + + if (!worldIn.isRemote) { + playerIn.clearActivePotions(); + } + playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); return stack.stackSize <= 0 ? new ItemStack(Items.bucket) : stack; } diff --git a/src/main/java/net/minecraft/item/ItemCarrotOnAStick.java b/src/main/java/net/minecraft/item/ItemCarrotOnAStick.java index 92f2955d..30873bf0 100755 --- a/src/main/java/net/minecraft/item/ItemCarrotOnAStick.java +++ b/src/main/java/net/minecraft/item/ItemCarrotOnAStick.java @@ -1,7 +1,10 @@ package net.minecraft.item; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.passive.EntityPig; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.stats.StatList; import net.minecraft.world.World; /**+ @@ -51,6 +54,21 @@ public class ItemCarrotOnAStick extends Item { * 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/minecraft/item/ItemDye.java b/src/main/java/net/minecraft/item/ItemDye.java index eec48e9b..9d7054e5 100755 --- a/src/main/java/net/minecraft/item/ItemDye.java +++ b/src/main/java/net/minecraft/item/ItemDye.java @@ -68,6 +68,10 @@ public class ItemDye extends Item { EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(itemstack.getMetadata()); if (enumdyecolor == EnumDyeColor.WHITE) { if (applyBonemeal(itemstack, world, blockpos)) { + if (!world.isRemote) { + world.playAuxSFX(2005, blockpos, 0); + } + return true; } } else if (enumdyecolor == EnumDyeColor.BROWN) { @@ -104,7 +108,15 @@ public class ItemDye extends Item { IBlockState iblockstate = worldIn.getBlockState(target); if (iblockstate.getBlock() instanceof IGrowable) { IGrowable igrowable = (IGrowable) iblockstate.getBlock(); - if (igrowable.canGrow(worldIn, target, iblockstate, true)) { + if (igrowable.canGrow(worldIn, target, iblockstate, worldIn.isRemote)) { + if (!worldIn.isRemote) { + if (igrowable.canUseBonemeal(worldIn, worldIn.rand, target, iblockstate)) { + igrowable.grow(worldIn, worldIn.rand, target, iblockstate); + } + + --stack.stackSize; + } + return true; } } diff --git a/src/main/java/net/minecraft/item/ItemEditableBook.java b/src/main/java/net/minecraft/item/ItemEditableBook.java index ddd3ea1f..b36a50bc 100755 --- a/src/main/java/net/minecraft/item/ItemEditableBook.java +++ b/src/main/java/net/minecraft/item/ItemEditableBook.java @@ -3,9 +3,12 @@ package net.minecraft.item; import java.util.List; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.Slot; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagString; +import net.minecraft.network.play.server.S2FPacketSetSlot; import net.minecraft.stats.StatList; import net.minecraft.util.ChatComponentProcessor; import net.minecraft.util.ChatComponentText; @@ -95,6 +98,10 @@ public class ItemEditableBook extends Item { * button is pressed. Args: itemStack, world, entityPlayer */ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + if (!world.isRemote) { + this.resolveContents(itemstack, entityplayer); + } + entityplayer.displayGUIBook(itemstack); entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); return itemstack; @@ -123,6 +130,13 @@ public class ItemEditableBook extends Item { } 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)); + } + } } } diff --git a/src/main/java/net/minecraft/item/ItemEgg.java b/src/main/java/net/minecraft/item/ItemEgg.java index 2db586e4..434f10ce 100755 --- a/src/main/java/net/minecraft/item/ItemEgg.java +++ b/src/main/java/net/minecraft/item/ItemEgg.java @@ -2,6 +2,7 @@ package net.minecraft.item; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityEgg; import net.minecraft.stats.StatList; import net.minecraft.world.World; @@ -41,6 +42,9 @@ public class ItemEgg extends Item { } world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + if (!world.isRemote) { + world.spawnEntityInWorld(new EntityEgg(world, entityplayer)); + } entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); return itemstack; diff --git a/src/main/java/net/minecraft/item/ItemEnderEye.java b/src/main/java/net/minecraft/item/ItemEnderEye.java index cb0efa9c..37e15221 100755 --- a/src/main/java/net/minecraft/item/ItemEnderEye.java +++ b/src/main/java/net/minecraft/item/ItemEnderEye.java @@ -3,10 +3,14 @@ package net.minecraft.item; import net.minecraft.block.BlockEndPortalFrame; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityEnderEye; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.stats.StatList; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; /**+ @@ -43,10 +47,124 @@ public class ItemEnderEye extends Item { if (entityplayer.canPlayerEdit(blockpos.offset(enumfacing), enumfacing, itemstack) && iblockstate.getBlock() == Blocks.end_portal_frame && !((Boolean) iblockstate.getValue(BlockEndPortalFrame.EYE)).booleanValue()) { - return true; + if (world.isRemote) { + return true; + } else { + 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 { + if (!world.isRemote) { + 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/minecraft/item/ItemEnderPearl.java b/src/main/java/net/minecraft/item/ItemEnderPearl.java index 13587f8f..f820c625 100755 --- a/src/main/java/net/minecraft/item/ItemEnderPearl.java +++ b/src/main/java/net/minecraft/item/ItemEnderPearl.java @@ -1,6 +1,8 @@ package net.minecraft.item; +import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityEnderPearl; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.stats.StatList; import net.minecraft.world.World; @@ -36,11 +38,17 @@ public class ItemEnderPearl extends Item { * button is pressed. Args: itemStack, world, entityPlayer */ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { - if (entityplayer.capabilities.isCreativeMode) { + if (entityplayer.capabilities.isCreativeMode && world.isRemote + && !SingleplayerServerController.isClientInEaglerSingleplayerOrLAN()) { return itemstack; } else { - --itemstack.stackSize; + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + if (!world.isRemote) { + world.spawnEntityInWorld(new EntityEnderPearl(world, entityplayer)); + } entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); return itemstack; diff --git a/src/main/java/net/minecraft/item/ItemExpBottle.java b/src/main/java/net/minecraft/item/ItemExpBottle.java index 37273cec..6b440c91 100755 --- a/src/main/java/net/minecraft/item/ItemExpBottle.java +++ b/src/main/java/net/minecraft/item/ItemExpBottle.java @@ -1,6 +1,7 @@ package net.minecraft.item; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityExpBottle; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.stats.StatList; import net.minecraft.world.World; @@ -44,6 +45,9 @@ public class ItemExpBottle extends Item { } world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + if (!world.isRemote) { + world.spawnEntityInWorld(new EntityExpBottle(world, entityplayer)); + } entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); return itemstack; diff --git a/src/main/java/net/minecraft/item/ItemFireball.java b/src/main/java/net/minecraft/item/ItemFireball.java index 17c0ff5d..d4830404 100755 --- a/src/main/java/net/minecraft/item/ItemFireball.java +++ b/src/main/java/net/minecraft/item/ItemFireball.java @@ -1,7 +1,9 @@ package net.minecraft.item; +import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; @@ -36,6 +38,26 @@ public class ItemFireball extends Item { */ public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, EnumFacing enumfacing, float var6, float var7, float var8) { - return true; + if (world.isRemote) { + return true; + } else { + 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/minecraft/item/ItemFirework.java b/src/main/java/net/minecraft/item/ItemFirework.java index 1142c7b8..8179764b 100755 --- a/src/main/java/net/minecraft/item/ItemFirework.java +++ b/src/main/java/net/minecraft/item/ItemFirework.java @@ -1,14 +1,16 @@ package net.minecraft.item; +import com.google.common.collect.Lists; import java.util.ArrayList; import java.util.List; - -import com.google.common.collect.Lists; - +import net.minecraft.entity.item.EntityFireworkRocket; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; import net.minecraft.util.StatCollector; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,6 +34,26 @@ import net.minecraft.util.StatCollector; */ public class ItemFirework extends Item { + /**+ + * 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) { + if (!world.isRemote) { + 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; + } else { + return false; + } + } + /**+ * allows items to add custom lines of information to the * mouseover description diff --git a/src/main/java/net/minecraft/item/ItemFishingRod.java b/src/main/java/net/minecraft/item/ItemFishingRod.java index 5c5cc0a2..90892851 100755 --- a/src/main/java/net/minecraft/item/ItemFishingRod.java +++ b/src/main/java/net/minecraft/item/ItemFishingRod.java @@ -2,6 +2,7 @@ package net.minecraft.item; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityFishHook; import net.minecraft.stats.StatList; import net.minecraft.world.World; @@ -58,6 +59,10 @@ public class ItemFishingRod extends Item { entityplayer.swingItem(); } else { world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + if (!world.isRemote) { + world.spawnEntityInWorld(new EntityFishHook(world, entityplayer)); + } + entityplayer.swingItem(); entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); } diff --git a/src/main/java/net/minecraft/item/ItemFood.java b/src/main/java/net/minecraft/item/ItemFood.java index c524768c..f99eaf7b 100755 --- a/src/main/java/net/minecraft/item/ItemFood.java +++ b/src/main/java/net/minecraft/item/ItemFood.java @@ -2,6 +2,7 @@ package net.minecraft.item; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.PotionEffect; import net.minecraft.stats.StatList; import net.minecraft.world.World; @@ -63,6 +64,11 @@ public class ItemFood extends Item { } protected void onFoodEaten(ItemStack var1, World world, EntityPlayer entityplayer) { + if (!world.isRemote && this.potionId > 0 && world.rand.nextFloat() < this.potionEffectProbability) { + entityplayer + .addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, this.potionAmplifier)); + } + } /**+ diff --git a/src/main/java/net/minecraft/item/ItemHangingEntity.java b/src/main/java/net/minecraft/item/ItemHangingEntity.java index c1fb2618..bf94339f 100755 --- a/src/main/java/net/minecraft/item/ItemHangingEntity.java +++ b/src/main/java/net/minecraft/item/ItemHangingEntity.java @@ -53,6 +53,9 @@ public class ItemHangingEntity extends Item { } else { EntityHanging entityhanging = this.createEntity(world, blockpos1, enumfacing); if (entityhanging != null && entityhanging.onValidSurface()) { + if (!world.isRemote) { + world.spawnEntityInWorld(entityhanging); + } --itemstack.stackSize; } diff --git a/src/main/java/net/minecraft/item/ItemHoe.java b/src/main/java/net/minecraft/item/ItemHoe.java index c49da361..87d9af89 100755 --- a/src/main/java/net/minecraft/item/ItemHoe.java +++ b/src/main/java/net/minecraft/item/ItemHoe.java @@ -78,7 +78,13 @@ public class ItemHoe extends Item { (double) ((float) target.getZ() + 0.5F), newState.getBlock().stepSound.getStepSound(), (newState.getBlock().stepSound.getVolume() + 1.0F) / 2.0F, newState.getBlock().stepSound.getFrequency() * 0.8F); - return true; + if (worldIn.isRemote) { + return true; + } else { + worldIn.setBlockState(target, newState); + stack.damageItem(1, player); + return true; + } } /**+ diff --git a/src/main/java/net/minecraft/item/ItemLead.java b/src/main/java/net/minecraft/item/ItemLead.java index 0ff437f7..4f216351 100755 --- a/src/main/java/net/minecraft/item/ItemLead.java +++ b/src/main/java/net/minecraft/item/ItemLead.java @@ -43,7 +43,12 @@ public class ItemLead extends Item { float var6, float var7, float var8) { Block block = world.getBlockState(blockpos).getBlock(); if (block instanceof BlockFence) { - return true; + if (world.isRemote) { + return true; + } else { + attachToFence(entityplayer, world, blockpos); + return true; + } } else { return false; } diff --git a/src/main/java/net/minecraft/item/ItemMap.java b/src/main/java/net/minecraft/item/ItemMap.java index 04b267b8..0d99646a 100755 --- a/src/main/java/net/minecraft/item/ItemMap.java +++ b/src/main/java/net/minecraft/item/ItemMap.java @@ -61,6 +61,18 @@ public class ItemMap extends ItemMapBase { public MapData getMapData(ItemStack stack, World worldIn) { String s = "map_" + stack.getMetadata(); MapData mapdata = (MapData) worldIn.loadItemData(MapData.class, s); + if (mapdata == null && !worldIn.isRemote) { + 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; } @@ -198,6 +210,26 @@ public class ItemMap extends ItemMapBase { } } + /**+ + * 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) { + if (!worldIn.isRemote) { + 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); } diff --git a/src/main/java/net/minecraft/item/ItemMinecart.java b/src/main/java/net/minecraft/item/ItemMinecart.java index e1d4c7de..2047d9cf 100755 --- a/src/main/java/net/minecraft/item/ItemMinecart.java +++ b/src/main/java/net/minecraft/item/ItemMinecart.java @@ -108,6 +108,26 @@ public class ItemMinecart extends Item { float hitX, float hitY, float hitZ) { IBlockState iblockstate = worldIn.getBlockState(pos); if (BlockRailBase.isRailBlock(iblockstate)) { + if (!worldIn.isRemote) { + 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 { diff --git a/src/main/java/net/minecraft/item/ItemMonsterPlacer.java b/src/main/java/net/minecraft/item/ItemMonsterPlacer.java index d1e042a3..04d5ed39 100755 --- a/src/main/java/net/minecraft/item/ItemMonsterPlacer.java +++ b/src/main/java/net/minecraft/item/ItemMonsterPlacer.java @@ -1,7 +1,9 @@ package net.minecraft.item; import java.util.List; - +import net.minecraft.block.BlockFence; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; @@ -9,9 +11,17 @@ import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.MobSpawnerBaseLogic; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.StatCollector; import net.minecraft.world.World; @@ -64,7 +74,92 @@ public class ItemMonsterPlacer extends Item { */ public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, EnumFacing enumfacing, float var6, float var7, float var8) { - return true; + if (world.isRemote) { + return true; + } else 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) { + if (world.isRemote) { + return itemstack; + } else { + 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; + } + } } /**+ diff --git a/src/main/java/net/minecraft/item/ItemPotion.java b/src/main/java/net/minecraft/item/ItemPotion.java index f4266d2e..c5f140bc 100755 --- a/src/main/java/net/minecraft/item/ItemPotion.java +++ b/src/main/java/net/minecraft/item/ItemPotion.java @@ -15,6 +15,7 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.ai.attributes.IAttribute; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityPotion; import net.minecraft.init.Items; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; @@ -110,6 +111,15 @@ public class ItemPotion extends Item { --itemstack.stackSize; } + if (!world.isRemote) { + 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) { @@ -148,6 +158,9 @@ public class ItemPotion extends Item { } world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + if (!world.isRemote) { + world.spawnEntityInWorld(new EntityPotion(world, entityplayer, itemstack)); + } entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); return itemstack; @@ -223,7 +236,7 @@ public class ItemPotion extends Item { Potion potion = Potion.potionTypes[potioneffect.getPotionID()]; Map map = potion.getAttributeModifierMap(); if (map != null && map.size() > 0) { - for (Entry entry : (Set) map.entrySet()) { + for (Entry entry : (Set>) map.entrySet()) { AttributeModifier attributemodifier = (AttributeModifier) entry.getValue(); AttributeModifier attributemodifier1 = new AttributeModifier(attributemodifier.getName(), potion.getAttributeModifierAmount(potioneffect.getAmplifier(), attributemodifier), @@ -257,7 +270,7 @@ public class ItemPotion extends Item { list.add(""); list.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("potion.effects.whenDrank")); - for (Entry entry1 : (Set) hashmultimap.entries()) { + for (Entry entry1 : (Set>) hashmultimap.entries()) { AttributeModifier attributemodifier2 = (AttributeModifier) entry1.getValue(); double d0 = attributemodifier2.getAmount(); double d1; diff --git a/src/main/java/net/minecraft/item/ItemRecord.java b/src/main/java/net/minecraft/item/ItemRecord.java index 569a3258..cf269441 100755 --- a/src/main/java/net/minecraft/item/ItemRecord.java +++ b/src/main/java/net/minecraft/item/ItemRecord.java @@ -10,6 +10,7 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.stats.StatList; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.StatCollector; @@ -54,7 +55,15 @@ public class ItemRecord extends Item { IBlockState iblockstate = world.getBlockState(blockpos); if (iblockstate.getBlock() == Blocks.jukebox && !((Boolean) iblockstate.getValue(BlockJukebox.HAS_RECORD)).booleanValue()) { - return true; + if (world.isRemote) { + return true; + } else { + ((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; } diff --git a/src/main/java/net/minecraft/item/ItemSign.java b/src/main/java/net/minecraft/item/ItemSign.java index 0a8cadfc..3056f68a 100755 --- a/src/main/java/net/minecraft/item/ItemSign.java +++ b/src/main/java/net/minecraft/item/ItemSign.java @@ -1,10 +1,15 @@ package net.minecraft.item; +import net.minecraft.block.BlockStandingSign; +import net.minecraft.block.BlockWallSign; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySign; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; import net.minecraft.world.World; /**+ @@ -48,7 +53,26 @@ public class ItemSign extends Item { return false; } else if (!Blocks.standing_sign.canPlaceBlockAt(world, blockpos)) { return false; + } else if (world.isRemote) { + return true; } 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; } } diff --git a/src/main/java/net/minecraft/item/ItemSkull.java b/src/main/java/net/minecraft/item/ItemSkull.java index ce67b885..9c7b9f84 100755 --- a/src/main/java/net/minecraft/item/ItemSkull.java +++ b/src/main/java/net/minecraft/item/ItemSkull.java @@ -1,19 +1,21 @@ package 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.mojang.authlib.GameProfile; import net.minecraft.block.Block; +import net.minecraft.block.BlockSkull; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTUtil; +import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntitySkull; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.World; @@ -70,6 +72,43 @@ public class ItemSkull extends Item { } else if (!Blocks.skull.canPlaceBlockAt(world, blockpos)) { return false; } else { + if (!world.isRemote) { + 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; } } diff --git a/src/main/java/net/minecraft/item/ItemSnowball.java b/src/main/java/net/minecraft/item/ItemSnowball.java index 944c5103..434db7f3 100755 --- a/src/main/java/net/minecraft/item/ItemSnowball.java +++ b/src/main/java/net/minecraft/item/ItemSnowball.java @@ -2,6 +2,7 @@ package net.minecraft.item; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntitySnowball; import net.minecraft.stats.StatList; import net.minecraft.world.World; @@ -41,6 +42,9 @@ public class ItemSnowball extends Item { } world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + if (!world.isRemote) { + world.spawnEntityInWorld(new EntitySnowball(world, entityplayer)); + } entityplayer.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); return itemstack; diff --git a/src/main/java/net/minecraft/network/EnumConnectionState.java b/src/main/java/net/minecraft/network/EnumConnectionState.java index 5a71189f..206ab41e 100755 --- a/src/main/java/net/minecraft/network/EnumConnectionState.java +++ b/src/main/java/net/minecraft/network/EnumConnectionState.java @@ -1,13 +1,13 @@ package net.minecraft.network; -import java.util.Collection; -import java.util.Map; - import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; import com.google.common.collect.Maps; -import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import java.util.Collection; +import java.util.Map; +import net.minecraft.network.EnumPacketDirection; +import net.minecraft.network.Packet; import net.minecraft.network.handshake.client.C00Handshake; import net.minecraft.network.login.client.C00PacketLoginStart; import net.minecraft.network.login.client.C01PacketEncryptionResponse; @@ -109,10 +109,7 @@ import net.minecraft.network.play.server.S46PacketSetCompressionLevel; import net.minecraft.network.play.server.S47PacketPlayerListHeaderFooter; import net.minecraft.network.play.server.S48PacketResourcePackSend; import net.minecraft.network.play.server.S49PacketUpdateEntityNBT; -import net.minecraft.network.status.client.C00PacketServerQuery; -import net.minecraft.network.status.client.C01PacketPing; -import net.minecraft.network.status.server.S00PacketServerInfo; -import net.minecraft.network.status.server.S01PacketPong; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -244,14 +241,6 @@ public enum EnumConnectionState { this.registerPacket(EnumPacketDirection.SERVERBOUND, C19PacketResourcePackStatus.class); } }, - STATUS(1) { - { - this.registerPacket(EnumPacketDirection.SERVERBOUND, C00PacketServerQuery.class); - this.registerPacket(EnumPacketDirection.CLIENTBOUND, S00PacketServerInfo.class); - this.registerPacket(EnumPacketDirection.SERVERBOUND, C01PacketPing.class); - this.registerPacket(EnumPacketDirection.CLIENTBOUND, S01PacketPong.class); - } - }, LOGIN(2) { { this.registerPacket(EnumPacketDirection.CLIENTBOUND, S00PacketDisconnect.class); diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/NetHandlerPlayServer.java b/src/main/java/net/minecraft/network/NetHandlerPlayServer.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/NetHandlerPlayServer.java rename to src/main/java/net/minecraft/network/NetHandlerPlayServer.java index e10bef77..a882a01f 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/network/NetHandlerPlayServer.java +++ b/src/main/java/net/minecraft/network/NetHandlerPlayServer.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.network; +package net.minecraft.network; import com.google.common.collect.Lists; import com.google.common.primitives.Doubles; @@ -12,93 +12,91 @@ 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.block.material.Material; +import 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.entity.Entity; +import net.minecraft.entity.EntityMinecartCommandBlock; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerBeacon; +import net.minecraft.inventory.ContainerMerchant; +import net.minecraft.inventory.ContainerRepair; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemEditableBook; +import net.minecraft.item.ItemStack; +import 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.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; +import net.minecraft.network.play.client.C00PacketKeepAlive; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.client.C0CPacketInput; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraft.network.play.client.C10PacketCreativeInventoryAction; +import net.minecraft.network.play.client.C11PacketEnchantItem; +import net.minecraft.network.play.client.C12PacketUpdateSign; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.minecraft.network.play.client.C14PacketTabComplete; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.network.play.client.C18PacketSpectate; +import net.minecraft.network.play.client.C19PacketResourcePackStatus; +import net.minecraft.network.play.server.S00PacketKeepAlive; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S07PacketRespawn; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S32PacketConfirmTransaction; +import net.minecraft.network.play.server.S3APacketTabComplete; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.network.play.server.S40PacketDisconnect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.stats.AchievementList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityCommandBlock; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatAllowedCharacters; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.ITickable; +import net.minecraft.util.IntHashMap; +import net.minecraft.util.ReportedException; +import 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. * @@ -121,10 +119,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; @@ -724,8 +718,7 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable { } 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); + s = net.minecraft.util.StringUtils.translateControlCodesAlternate(s); } ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", new Object[] { this.playerEntity.getDisplayName(), s }); @@ -1032,8 +1025,7 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable { 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); + s = net.minecraft.util.StringUtils.translateControlCodesAlternate(s); } tileentitysign.signText[i] = new ChatComponentText(s); } @@ -1101,7 +1093,7 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable { PacketBuffer packetbuffer3 = c17packetcustompayload.getBufferData(); try { - ItemStack itemstack1 = packetbuffer3.readItemStackFromBuffer_server(); + ItemStack itemstack1 = packetbuffer3.readItemStackFromBuffer(); if (itemstack1 != null) { if (!ItemWritableBook.isNBTValid(itemstack1.getTagCompound())) { throw new IOException("Invalid book tag!"); @@ -1129,7 +1121,7 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable { PacketBuffer packetbuffer2 = c17packetcustompayload.getBufferData(); try { - ItemStack itemstack = packetbuffer2.readItemStackFromBuffer_server(); + ItemStack itemstack = packetbuffer2.readItemStackFromBuffer(); if (itemstack != null) { if (!ItemEditableBook.validBookTagContents(itemstack.getTagCompound())) { throw new IOException("Invalid book tag!"); @@ -1237,8 +1229,7 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable { 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); + s = net.minecraft.util.StringUtils.translateControlCodesAlternate(s); } containerrepair.updateItemName(s); } 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 58d66b31..4837899c 100755 --- a/src/main/java/net/minecraft/network/login/client/C00PacketLoginStart.java +++ b/src/main/java/net/minecraft/network/login/client/C00PacketLoginStart.java @@ -1,9 +1,8 @@ package 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.mojang.authlib.GameProfile; import net.minecraft.network.Packet; import net.minecraft.network.PacketBuffer; import net.minecraft.network.login.INetHandlerLoginServer; @@ -66,4 +65,8 @@ public class C00PacketLoginStart implements Packet { 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/minecraft/network/play/client/C15PacketClientSettings.java b/src/main/java/net/minecraft/network/play/client/C15PacketClientSettings.java index 66530fa7..933e6f77 100755 --- a/src/main/java/net/minecraft/network/play/client/C15PacketClientSettings.java +++ b/src/main/java/net/minecraft/network/play/client/C15PacketClientSettings.java @@ -1,7 +1,6 @@ package net.minecraft.network.play.client; import java.io.IOException; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.network.Packet; import net.minecraft.network.PacketBuffer; @@ -90,4 +89,8 @@ public class C15PacketClientSettings implements Packet { 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/minecraft/network/play/client/C18PacketSpectate.java b/src/main/java/net/minecraft/network/play/client/C18PacketSpectate.java index 1b49ee80..c3b95a42 100755 --- a/src/main/java/net/minecraft/network/play/client/C18PacketSpectate.java +++ b/src/main/java/net/minecraft/network/play/client/C18PacketSpectate.java @@ -2,10 +2,11 @@ package net.minecraft.network.play.client; import java.io.IOException; import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; - +import net.minecraft.entity.Entity; import net.minecraft.network.Packet; import net.minecraft.network.PacketBuffer; import net.minecraft.network.play.INetHandlerPlayServer; +import net.minecraft.world.WorldServer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -58,4 +59,7 @@ public class C18PacketSpectate implements Packet { 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/minecraft/network/play/server/S38PacketPlayerListItem.java b/src/main/java/net/minecraft/network/play/server/S38PacketPlayerListItem.java index f05d3717..fcd46e2d 100755 --- a/src/main/java/net/minecraft/network/play/server/S38PacketPlayerListItem.java +++ b/src/main/java/net/minecraft/network/play/server/S38PacketPlayerListItem.java @@ -1,13 +1,12 @@ package net.minecraft.network.play.server; -import java.io.IOException; -import java.util.List; - 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.minecraft.entity.player.EntityPlayerMP; import net.minecraft.network.Packet; import net.minecraft.network.PacketBuffer; import net.minecraft.network.play.INetHandlerPlayClient; @@ -41,6 +40,28 @@ public class S38PacketPlayerListItem implements Packet { 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. */ @@ -105,7 +126,59 @@ public class S38PacketPlayerListItem implements Packet { * Writes the raw packet data to the data stream. */ public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { - // server only + 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(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(s38packetplayerlistitem$addplayerdata.getDisplayName()); + } + break; + case REMOVE_PLAYER: + parPacketBuffer.writeUuid(s38packetplayerlistitem$addplayerdata.getProfile().getId()); + } + } + } /**+ diff --git a/src/main/java/net/minecraft/network/status/INetHandlerStatusClient.java b/src/main/java/net/minecraft/network/status/INetHandlerStatusClient.java deleted file mode 100755 index 9f44b646..00000000 --- a/src/main/java/net/minecraft/network/status/INetHandlerStatusClient.java +++ /dev/null @@ -1,31 +0,0 @@ -package net.minecraft.network.status; - -import net.minecraft.network.INetHandler; -import net.minecraft.network.status.server.S00PacketServerInfo; -import net.minecraft.network.status.server.S01PacketPong; - -/**+ - * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. - * - * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" - * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team - * - * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 { - void handleServerInfo(S00PacketServerInfo var1); - - void handlePong(S01PacketPong var1); -} \ No newline at end of file diff --git a/src/main/java/net/minecraft/network/status/INetHandlerStatusServer.java b/src/main/java/net/minecraft/network/status/INetHandlerStatusServer.java deleted file mode 100755 index 978e1424..00000000 --- a/src/main/java/net/minecraft/network/status/INetHandlerStatusServer.java +++ /dev/null @@ -1,31 +0,0 @@ -package net.minecraft.network.status; - -import net.minecraft.network.INetHandler; -import net.minecraft.network.status.client.C00PacketServerQuery; -import net.minecraft.network.status.client.C01PacketPing; - -/**+ - * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. - * - * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" - * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team - * - * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 { - void processPing(C01PacketPing var1); - - void processServerQuery(C00PacketServerQuery var1); -} \ No newline at end of file diff --git a/src/main/java/net/minecraft/network/status/client/C00PacketServerQuery.java b/src/main/java/net/minecraft/network/status/client/C00PacketServerQuery.java deleted file mode 100755 index a001f13c..00000000 --- a/src/main/java/net/minecraft/network/status/client/C00PacketServerQuery.java +++ /dev/null @@ -1,48 +0,0 @@ -package net.minecraft.network.status.client; - -import java.io.IOException; - -import net.minecraft.network.Packet; -import net.minecraft.network.PacketBuffer; -import net.minecraft.network.status.INetHandlerStatusServer; - -/**+ - * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. - * - * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" - * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team - * - * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 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 { - /**+ - * 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(INetHandlerStatusServer inethandlerstatusserver) { - inethandlerstatusserver.processServerQuery(this); - } -} \ No newline at end of file diff --git a/src/main/java/net/minecraft/network/status/client/C01PacketPing.java b/src/main/java/net/minecraft/network/status/client/C01PacketPing.java deleted file mode 100755 index 5fa38dcd..00000000 --- a/src/main/java/net/minecraft/network/status/client/C01PacketPing.java +++ /dev/null @@ -1,63 +0,0 @@ -package net.minecraft.network.status.client; - -import java.io.IOException; - -import net.minecraft.network.Packet; -import net.minecraft.network.PacketBuffer; -import net.minecraft.network.status.INetHandlerStatusServer; - -/**+ - * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. - * - * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" - * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team - * - * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 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 { - private long clientTime; - - public C01PacketPing() { - } - - public C01PacketPing(long ping) { - this.clientTime = ping; - } - - /**+ - * Reads the raw packet data from the data stream. - */ - public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { - this.clientTime = parPacketBuffer.readLong(); - } - - /**+ - * Writes the raw packet data to the data stream. - */ - public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { - parPacketBuffer.writeLong(this.clientTime); - } - - /**+ - * Passes this Packet on to the NetHandler for processing. - */ - public void processPacket(INetHandlerStatusServer inethandlerstatusserver) { - inethandlerstatusserver.processPing(this); - } - - public long getClientTime() { - return this.clientTime; - } -} \ No newline at end of file diff --git a/src/main/java/net/minecraft/network/status/server/S00PacketServerInfo.java b/src/main/java/net/minecraft/network/status/server/S00PacketServerInfo.java deleted file mode 100755 index 68e2c66a..00000000 --- a/src/main/java/net/minecraft/network/status/server/S00PacketServerInfo.java +++ /dev/null @@ -1,80 +0,0 @@ -package net.minecraft.network.status.server; - -import java.io.IOException; - -import org.json.JSONException; -import org.json.JSONObject; - -import net.lax1dude.eaglercraft.v1_8.json.JSONTypeProvider; -import net.minecraft.network.Packet; -import net.minecraft.network.PacketBuffer; -import net.minecraft.network.ServerStatusResponse; -import net.minecraft.network.status.INetHandlerStatusClient; -import net.minecraft.util.ChatStyle; -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 class S00PacketServerInfo implements Packet { - - private ServerStatusResponse response; - - public S00PacketServerInfo() { - } - - public S00PacketServerInfo(ServerStatusResponse responseIn) { - this.response = responseIn; - } - - /**+ - * Reads the raw packet data from the data stream. - */ - public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { - try { - this.response = (ServerStatusResponse) JSONTypeProvider.deserialize( - new JSONObject(parPacketBuffer.readStringFromBuffer(32767)), ServerStatusResponse.class); - } catch (JSONException exc) { - throw new IOException("Invalid ServerStatusResponse JSON payload", exc); - } - } - - /**+ - * Writes the raw packet data to the data stream. - */ - public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { - try { - parPacketBuffer.writeString(((JSONObject) JSONTypeProvider.serialize(this.response)).toString()); - } catch (JSONException exc) { - throw new IOException("Invalid ServerStatusResponse JSON payload", exc); - } - } - - /**+ - * Passes this Packet on to the NetHandler for processing. - */ - public void processPacket(INetHandlerStatusClient inethandlerstatusclient) { - inethandlerstatusclient.handleServerInfo(this); - } - - public ServerStatusResponse getResponse() { - return this.response; - } -} \ No newline at end of file diff --git a/src/main/java/net/minecraft/network/status/server/S01PacketPong.java b/src/main/java/net/minecraft/network/status/server/S01PacketPong.java deleted file mode 100755 index 41137d2b..00000000 --- a/src/main/java/net/minecraft/network/status/server/S01PacketPong.java +++ /dev/null @@ -1,59 +0,0 @@ -package net.minecraft.network.status.server; - -import java.io.IOException; - -import net.minecraft.network.Packet; -import net.minecraft.network.PacketBuffer; -import net.minecraft.network.status.INetHandlerStatusClient; - -/**+ - * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. - * - * Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" - * Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team - * - * EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 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 { - private long clientTime; - - public S01PacketPong() { - } - - public S01PacketPong(long time) { - this.clientTime = time; - } - - /**+ - * Reads the raw packet data from the data stream. - */ - public void readPacketData(PacketBuffer parPacketBuffer) throws IOException { - this.clientTime = parPacketBuffer.readLong(); - } - - /**+ - * Writes the raw packet data to the data stream. - */ - public void writePacketData(PacketBuffer parPacketBuffer) throws IOException { - parPacketBuffer.writeLong(this.clientTime); - } - - /**+ - * Passes this Packet on to the NetHandler for processing. - */ - public void processPacket(INetHandlerStatusClient inethandlerstatusclient) { - inethandlerstatusclient.handlePong(this); - } -} \ 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/minecraft/pathfinding/Path.java similarity index 88% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/Path.java rename to src/main/java/net/minecraft/pathfinding/Path.java index d15b4a72..c8280545 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/Path.java +++ b/src/main/java/net/minecraft/pathfinding/Path.java @@ -1,8 +1,6 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding; +package 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; +import net.minecraft.pathfinding.PathPoint; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -26,10 +24,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class Path { - static { - __checkIntegratedContextValid("net/minecraft/pathfinding/Path"); - } - /**+ * Contains the points in this path */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathEntity.java b/src/main/java/net/minecraft/pathfinding/PathEntity.java similarity index 85% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathEntity.java rename to src/main/java/net/minecraft/pathfinding/PathEntity.java index 635134cc..da5690e6 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathEntity.java +++ b/src/main/java/net/minecraft/pathfinding/PathEntity.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding; +package 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; +import net.minecraft.entity.Entity; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.Vec3; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class PathEntity { - static { - __checkIntegratedContextValid("net/minecraft/pathfinding/PathEntity"); - } - private final PathPoint[] points; private int currentPathIndex; private int pathLength; diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathFinder.java b/src/main/java/net/minecraft/pathfinding/PathFinder.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathFinder.java rename to src/main/java/net/minecraft/pathfinding/PathFinder.java index aaaee0b2..38f58db3 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathFinder.java +++ b/src/main/java/net/minecraft/pathfinding/PathFinder.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding; +package 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; +import net.minecraft.entity.Entity; +import net.minecraft.pathfinding.Path; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.pathfinder.NodeProcessor; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class PathFinder { - static { - __checkIntegratedContextValid("net/minecraft/pathfinding/PathFinder"); - } - /**+ * The path being generated */ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigate.java b/src/main/java/net/minecraft/pathfinding/PathNavigate.java similarity index 84% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigate.java rename to src/main/java/net/minecraft/pathfinding/PathNavigate.java index 1dea1b30..14fea357 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigate.java +++ b/src/main/java/net/minecraft/pathfinding/PathNavigate.java @@ -1,20 +1,18 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding; +package 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; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathFinder; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.ChunkCache; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -38,10 +36,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public abstract class PathNavigate { - static { - __checkIntegratedContextValid("net/minecraft/pathfinding/PathNavigate"); - } - protected EntityLiving theEntity; protected World worldObj; protected PathEntity currentPath; diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateClimber.java b/src/main/java/net/minecraft/pathfinding/PathNavigateClimber.java similarity index 74% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateClimber.java rename to src/main/java/net/minecraft/pathfinding/PathNavigateClimber.java index a11b9cda..c321a24e 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateClimber.java +++ b/src/main/java/net/minecraft/pathfinding/PathNavigateClimber.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding; +package 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; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathNavigateGround; +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. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class PathNavigateClimber extends PathNavigateGround { - static { - __checkIntegratedContextValid("net/minecraft/pathfinding/PathNavigateClimber"); - } - private BlockPos targetPosition; public PathNavigateClimber(EntityLiving entityLivingIn, World worldIn) { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateGround.java b/src/main/java/net/minecraft/pathfinding/PathNavigateGround.java similarity index 81% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateGround.java rename to src/main/java/net/minecraft/pathfinding/PathNavigateGround.java index e656ede4..fb02f969 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateGround.java +++ b/src/main/java/net/minecraft/pathfinding/PathNavigateGround.java @@ -1,21 +1,19 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.init.Blocks; +import net.minecraft.pathfinding.PathFinder; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.pathfinder.WalkNodeProcessor; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -39,10 +37,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class PathNavigateGround extends PathNavigate { - static { - __checkIntegratedContextValid("net/minecraft/pathfinding/PathNavigateGround"); - } - protected WalkNodeProcessor nodeProcessor; private boolean shouldAvoidSun; diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateSwimmer.java b/src/main/java/net/minecraft/pathfinding/PathNavigateSwimmer.java similarity index 75% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateSwimmer.java rename to src/main/java/net/minecraft/pathfinding/PathNavigateSwimmer.java index 2ffad11c..bc23d545 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathNavigateSwimmer.java +++ b/src/main/java/net/minecraft/pathfinding/PathNavigateSwimmer.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding; +package 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; +import net.minecraft.entity.EntityLiving; +import net.minecraft.pathfinding.PathFinder; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.pathfinder.SwimNodeProcessor; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class PathNavigateSwimmer extends PathNavigate { - static { - __checkIntegratedContextValid("net/minecraft/pathfinding/PathNavigateSwimmer"); - } - public PathNavigateSwimmer(EntityLiving entitylivingIn, World worldIn) { super(entitylivingIn, worldIn); } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathPoint.java b/src/main/java/net/minecraft/pathfinding/PathPoint.java similarity index 86% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathPoint.java rename to src/main/java/net/minecraft/pathfinding/PathPoint.java index cf37dd67..da0165e8 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/pathfinding/PathPoint.java +++ b/src/main/java/net/minecraft/pathfinding/PathPoint.java @@ -1,8 +1,6 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.pathfinding; +package 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; +import net.minecraft.util.MathHelper; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -26,10 +24,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class PathPoint { - static { - __checkIntegratedContextValid("net/minecraft/pathfinding/PathPoint"); - } - public final int xCoord; public final int yCoord; public final int zCoord; diff --git a/src/main/java/net/minecraft/potion/Potion.java b/src/main/java/net/minecraft/potion/Potion.java index ff55e14f..c94a062e 100755 --- a/src/main/java/net/minecraft/potion/Potion.java +++ b/src/main/java/net/minecraft/potion/Potion.java @@ -214,7 +214,9 @@ public class Potion { } 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) { - // multiplayer only + if (!entityLivingBaseIn.worldObj.isRemote) { + ((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() diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ServerScoreboard.java b/src/main/java/net/minecraft/scoreboard/ServerScoreboard.java similarity index 82% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ServerScoreboard.java rename to src/main/java/net/minecraft/scoreboard/ServerScoreboard.java index 3a2e2d62..6d55c98c 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/scoreboard/ServerScoreboard.java +++ b/src/main/java/net/minecraft/scoreboard/ServerScoreboard.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.scoreboard; +package net.minecraft.scoreboard; import com.google.common.collect.Lists; import com.google.common.collect.Sets; @@ -6,20 +6,18 @@ 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; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S3BPacketScoreboardObjective; +import net.minecraft.network.play.server.S3CPacketUpdateScore; +import net.minecraft.network.play.server.S3DPacketDisplayScoreboard; +import net.minecraft.network.play.server.S3EPacketTeams; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.scoreboard.ScoreboardSaveData; +import net.minecraft.server.MinecraftServer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -43,10 +41,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java similarity index 85% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/MinecraftServer.java rename to src/main/java/net/minecraft/server/MinecraftServer.java index ac3108e4..e49f4406 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server; +package net.minecraft.server; import com.google.common.collect.Lists; import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; @@ -18,47 +18,45 @@ 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.command.CommandBase; +import net.minecraft.command.CommandResultStats; +import net.minecraft.command.ICommandManager; +import net.minecraft.command.ICommandSender; +import 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 net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.minecraft.profiler.Profiler; +import net.minecraft.server.management.ServerConfigurationManager; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.IThreadListener; +import net.minecraft.util.ITickable; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.util.Util; +import net.minecraft.util.Vec3; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.World; +import net.minecraft.world.WorldManager; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldServerMulti; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.demo.DemoWorldServer; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.ISaveHandler; +import 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. * @@ -81,10 +79,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; /**+ 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/minecraft/server/management/ItemInWorldManager.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/ItemInWorldManager.java rename to src/main/java/net/minecraft/server/management/ItemInWorldManager.java index 8702eded..8286cf86 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/ItemInWorldManager.java +++ b/src/main/java/net/minecraft/server/management/ItemInWorldManager.java @@ -1,26 +1,24 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.management; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.ILockableContainer; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -44,10 +42,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class ItemInWorldManager { - static { - __checkIntegratedContextValid("net/minecraft/server/management/ItemInWorldManager"); - } - public World theWorld; public EntityPlayerMP thisPlayerMP; private WorldSettings.GameType gameType = WorldSettings.GameType.NOT_SET; 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/minecraft/server/management/PlayerManager.java similarity index 89% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/PlayerManager.java rename to src/main/java/net/minecraft/server/management/PlayerManager.java index 60d3579e..1e5dcf96 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/PlayerManager.java +++ b/src/main/java/net/minecraft/server/management/PlayerManager.java @@ -1,26 +1,24 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.management; +package 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.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S21PacketChunkData; +import net.minecraft.network.play.server.S22PacketMultiBlockChange; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.LongHashMap; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldServer; +import 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. * @@ -43,10 +41,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class PlayerManager { - static { - __checkIntegratedContextValid("net/minecraft/server/management/PlayerManager"); - } - private static final Logger pmLogger = LogManager.getLogger(); private final WorldServer theWorldServer; /**+ 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/minecraft/server/management/ServerConfigurationManager.java similarity index 85% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/ServerConfigurationManager.java rename to src/main/java/net/minecraft/server/management/ServerConfigurationManager.java index f4a011f1..912f8d2e 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/management/ServerConfigurationManager.java +++ b/src/main/java/net/minecraft/server/management/ServerConfigurationManager.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.management; +package net.minecraft.server.management; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -15,59 +15,57 @@ 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.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.player.EntityPlayer; +import 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.minecraft.network.NetHandlerPlayServer; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.server.S01PacketJoinGame; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.minecraft.network.play.server.S07PacketRespawn; +import net.minecraft.network.play.server.S09PacketHeldItemChange; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S1FPacketSetExperience; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.minecraft.network.play.server.S3EPacketTeams; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.network.play.server.S41PacketServerDifficulty; +import net.minecraft.network.play.server.S44PacketWorldBorder; +import net.minecraft.potion.PotionEffect; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.ServerScoreboard; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.ItemInWorldManager; +import net.minecraft.server.management.PlayerManager; +import net.minecraft.stats.StatList; +import net.minecraft.stats.StatisticsFile; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.border.IBorderListener; +import net.minecraft.world.border.WorldBorder; +import net.minecraft.world.demo.DemoWorldManager; +import net.minecraft.world.storage.IPlayerFileData; +import 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. * @@ -90,10 +88,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/server/network/NetHandlerLoginServer.java similarity index 80% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/network/NetHandlerLoginServer.java rename to src/main/java/net/minecraft/server/network/NetHandlerLoginServer.java index 98afd140..bcb4c68a 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/server/network/NetHandlerLoginServer.java +++ b/src/main/java/net/minecraft/server/network/NetHandlerLoginServer.java @@ -1,29 +1,27 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.server.network; +package 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.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.login.INetHandlerLoginServer; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.login.client.C01PacketEncryptionResponse; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.network.login.server.S02PacketLoginSuccess; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import 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. * @@ -46,10 +44,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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]; diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatisticsFile.java b/src/main/java/net/minecraft/stats/StatisticsFile.java similarity index 82% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatisticsFile.java rename to src/main/java/net/minecraft/stats/StatisticsFile.java index d9d0e1c7..7b9f6967 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/stats/StatisticsFile.java +++ b/src/main/java/net/minecraft/stats/StatisticsFile.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.stats; +package net.minecraft.stats; import com.google.common.collect.Maps; import com.google.common.collect.Sets; @@ -9,18 +9,18 @@ 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 net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S37PacketStatistics; +import net.minecraft.server.MinecraftServer; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.stats.StatList; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IJsonSerializable; +import net.minecraft.util.TupleIntJsonSerializable; import org.json.JSONException; import org.json.JSONObject; @@ -28,8 +28,6 @@ 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. * @@ -52,10 +50,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; diff --git a/src/main/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java b/src/main/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java index 499e9c32..ff684b5b 100755 --- a/src/main/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java +++ b/src/main/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java @@ -13,6 +13,7 @@ import net.minecraft.entity.item.EntityMinecart; import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.StringUtils; @@ -99,18 +100,78 @@ public abstract class MobSpawnerBaseLogic { public void updateSpawner() { if (this.isActivated()) { BlockPos blockpos = this.getSpawnerPosition(); - double d3 = (double) ((float) blockpos.getX() + this.getSpawnerWorld().rand.nextFloat()); - double d4 = (double) ((float) blockpos.getY() + this.getSpawnerWorld().rand.nextFloat()); - double d5 = (double) ((float) blockpos.getZ() + this.getSpawnerWorld().rand.nextFloat()); - this.getSpawnerWorld().spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d3, d4, d5, 0.0D, 0.0D, 0.0D, - new int[0]); - this.getSpawnerWorld().spawnParticle(EnumParticleTypes.FLAME, d3, d4, d5, 0.0D, 0.0D, 0.0D, new int[0]); - if (this.spawnDelay > 0) { - --this.spawnDelay; + if (this.getSpawnerWorld().isRemote) { + double d3 = (double) ((float) blockpos.getX() + this.getSpawnerWorld().rand.nextFloat()); + double d4 = (double) ((float) blockpos.getY() + this.getSpawnerWorld().rand.nextFloat()); + double d5 = (double) ((float) blockpos.getZ() + this.getSpawnerWorld().rand.nextFloat()); + this.getSpawnerWorld().spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d3, d4, d5, 0.0D, 0.0D, 0.0D, + new int[0]); + this.getSpawnerWorld().spawnParticle(EnumParticleTypes.FLAME, d3, d4, d5, 0.0D, 0.0D, 0.0D, new int[0]); + if (this.spawnDelay > 0) { + --this.spawnDelay; + } + + this.prevMobRotation = this.mobRotation; + this.mobRotation = (this.mobRotation + (double) (1000.0F / ((float) this.spawnDelay + 200.0F))) + % 360.0D; + } else { + 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(); + } } - this.prevMobRotation = this.mobRotation; - this.mobRotation = (this.mobRotation + (double) (1000.0F / ((float) this.spawnDelay + 200.0F))) % 360.0D; } } @@ -271,7 +332,7 @@ public abstract class MobSpawnerBaseLogic { * return false. */ public boolean setDelayToMin(int delay) { - if (delay == 1) { + if (delay == 1 && this.getSpawnerWorld().isRemote) { this.spawnDelay = this.minSpawnDelay; return true; } else { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java b/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java index 164b325e..59fb8b4c 100755 --- a/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java @@ -1,10 +1,8 @@ package net.minecraft.tileentity; +import com.google.common.collect.Lists; import java.util.Arrays; import java.util.List; - -import com.google.common.collect.Lists; - import net.minecraft.block.Block; import net.minecraft.block.BlockStainedGlass; import net.minecraft.block.BlockStainedGlassPane; @@ -23,6 +21,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.ITickable; @@ -84,6 +85,31 @@ public class TileEntityBeacon extends TileEntityLockable implements ITickable, I } private void addEffectsToPlayers() { + if (this.isComplete && this.levels > 0 && !this.worldObj.isRemote && 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) { + 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) { + entityplayer1.addPotionEffect(new PotionEffect(this.secondaryEffect, 180, 0, true, true)); + } + } + } } @@ -167,6 +193,14 @@ public class TileEntityBeacon extends TileEntityLockable implements ITickable, I } } + if (!this.worldObj.isRemote && 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() { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java b/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java index 56be4b73..14f7c87f 100755 --- a/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java @@ -1,7 +1,9 @@ package net.minecraft.tileentity; +import java.util.Arrays; import java.util.List; - +import net.minecraft.block.BlockBrewingStand; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Items; @@ -103,6 +105,24 @@ public class TileEntityBrewingStand extends TileEntityLockable implements ITicka this.ingredientID = this.brewingItemStacks[3].getItem(); } + if (!this.worldObj.isRemote) { + 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() { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityChest.java b/src/main/java/net/minecraft/tileentity/TileEntityChest.java index 1658e29a..1e367c97 100755 --- a/src/main/java/net/minecraft/tileentity/TileEntityChest.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityChest.java @@ -7,9 +7,11 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryLargeChest; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.ITickable; @@ -276,6 +278,23 @@ public class TileEntityChest extends TileEntityLockable implements ITickable, II int j = this.pos.getY(); int k = this.pos.getZ(); ++this.ticksSinceSync; + if (!this.worldObj.isRemote && 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; diff --git a/src/main/java/net/minecraft/tileentity/TileEntityCommandBlock.java b/src/main/java/net/minecraft/tileentity/TileEntityCommandBlock.java index 98bf43ff..02690217 100755 --- a/src/main/java/net/minecraft/tileentity/TileEntityCommandBlock.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityCommandBlock.java @@ -1,6 +1,7 @@ package net.minecraft.tileentity; import net.lax1dude.eaglercraft.v1_8.netty.ByteBuf; +import net.minecraft.command.CommandResultStats; import net.minecraft.command.server.CommandBlockLogic; import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; @@ -100,4 +101,7 @@ public class TileEntityCommandBlock extends TileEntity { return this.commandBlockLogic; } + public CommandResultStats getCommandResultStats() { + return this.commandBlockLogic.getCommandResultStats(); + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/tileentity/TileEntityDaylightDetector.java b/src/main/java/net/minecraft/tileentity/TileEntityDaylightDetector.java index 6d42f6ad..7a36af3e 100755 --- a/src/main/java/net/minecraft/tileentity/TileEntityDaylightDetector.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityDaylightDetector.java @@ -1,5 +1,6 @@ package net.minecraft.tileentity; +import net.minecraft.block.BlockDaylightDetector; import net.minecraft.util.ITickable; /**+ @@ -27,5 +28,12 @@ public class TileEntityDaylightDetector extends TileEntity implements ITickable * Like the old updateEntity(), except more generic. */ public void update() { + if (this.worldObj != null && !this.worldObj.isRemote && 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/minecraft/tileentity/TileEntityFurnace.java b/src/main/java/net/minecraft/tileentity/TileEntityFurnace.java index 0b8cdbb0..10d37bb2 100755 --- a/src/main/java/net/minecraft/tileentity/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityFurnace.java @@ -1,6 +1,7 @@ package net.minecraft.tileentity; import net.minecraft.block.Block; +import net.minecraft.block.BlockFurnace; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -22,6 +23,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.EnumFacing; import net.minecraft.util.ITickable; +import net.minecraft.util.MathHelper; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -219,9 +221,53 @@ public class TileEntityFurnace extends TileEntityLockable implements ITickable, * Like the old updateEntity(), except more generic. */ public void update() { + boolean flag = this.isBurning(); + boolean flag1 = false; if (this.isBurning()) { --this.furnaceBurnTime; } + + if (!this.worldObj.isRemote) { + 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) { diff --git a/src/main/java/net/minecraft/tileentity/TileEntityHopper.java b/src/main/java/net/minecraft/tileentity/TileEntityHopper.java index 88be3943..65e4ba46 100755 --- a/src/main/java/net/minecraft/tileentity/TileEntityHopper.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityHopper.java @@ -1,9 +1,9 @@ package net.minecraft.tileentity; import java.util.List; - import net.minecraft.block.Block; import net.minecraft.block.BlockChest; +import net.minecraft.block.BlockHopper; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; @@ -215,10 +215,87 @@ public class TileEntityHopper extends TileEntityLockable implements IHopper, ITi * Like the old updateEntity(), except more generic. */ public void update() { + if (this.worldObj != null && !this.worldObj.isRemote) { + --this.transferCooldown; + if (!this.isOnTransferCooldown()) { + this.setTransferCooldown(0); + this.updateHopper(); + } + + } } public boolean updateHopper() { - return false; + if (this.worldObj != null && !this.worldObj.isRemote) { + 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; + } + } } /**+ @@ -441,6 +518,20 @@ public class TileEntityHopper extends TileEntityLockable implements IHopper, ITi 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 */ diff --git a/src/main/java/net/minecraft/tileentity/TileEntitySign.java b/src/main/java/net/minecraft/tileentity/TileEntitySign.java index 5b5bf132..ff652656 100755 --- a/src/main/java/net/minecraft/tileentity/TileEntitySign.java +++ b/src/main/java/net/minecraft/tileentity/TileEntitySign.java @@ -1,21 +1,25 @@ package net.minecraft.tileentity; -import org.json.JSONException; - import net.minecraft.command.CommandException; +import net.minecraft.command.CommandResultStats; import net.minecraft.command.ICommandSender; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.ClickEvent; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S33PacketUpdateSign; +import net.minecraft.server.MinecraftServer; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentProcessor; import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatStyle; import net.minecraft.util.IChatComponent; import net.minecraft.util.Vec3; import net.minecraft.world.World; +import org.json.JSONException; + /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. * @@ -47,6 +51,7 @@ public class TileEntitySign extends TileEntity { 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); @@ -56,6 +61,7 @@ public class TileEntitySign extends TileEntity { nbttagcompound.setString("Text" + (i + 1), s); } + this.stats.writeStatsToNBT(nbttagcompound); } public void readFromNBT(NBTTagCompound nbttagcompound) { @@ -98,6 +104,8 @@ public class TileEntitySign extends TileEntity { return false; } + public void setCommandStat(CommandResultStats.Type var1, int var2) { + } }; for (int i = 0; i < 4; ++i) { @@ -117,6 +125,7 @@ public class TileEntitySign extends TileEntity { } } + this.stats.readStatsFromNBT(nbttagcompound); } /**+ @@ -159,7 +168,63 @@ public class TileEntitySign extends TileEntity { } 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); + } + }; + + 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) { + MinecraftServer.getServer().getCommandManager().executeCommand(icommandsender, + clickevent.getValue()); + } + } + } + return true; } + public CommandResultStats getStats() { + return this.stats; + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/util/ChatComponentScore.java b/src/main/java/net/minecraft/util/ChatComponentScore.java index 34209f74..f281a0a0 100755 --- a/src/main/java/net/minecraft/util/ChatComponentScore.java +++ b/src/main/java/net/minecraft/util/ChatComponentScore.java @@ -1,5 +1,12 @@ package net.minecraft.util; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.server.MinecraftServer; + +import net.lax1dude.eaglercraft.v1_8.HString; + /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. * @@ -54,6 +61,18 @@ public class ChatComponentScore extends ChatComponentStyle { * 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; } diff --git a/src/main/java/net/minecraft/util/IThreadListener.java b/src/main/java/net/minecraft/util/IThreadListener.java index f578c28e..1bac31bf 100755 --- a/src/main/java/net/minecraft/util/IThreadListener.java +++ b/src/main/java/net/minecraft/util/IThreadListener.java @@ -1,7 +1,5 @@ package net.minecraft.util; -import net.lax1dude.eaglercraft.v1_8.futures.ListenableFuture; - /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. * @@ -23,5 +21,5 @@ import net.lax1dude.eaglercraft.v1_8.futures.ListenableFuture; * */ public interface IThreadListener { - ListenableFuture addScheduledTask(Runnable var1); + void addScheduledTask(Runnable var1); } \ No newline at end of file diff --git a/src/main/java/net/minecraft/util/Session.java b/src/main/java/net/minecraft/util/Session.java index f1dcb0c0..0c57aa74 100755 --- a/src/main/java/net/minecraft/util/Session.java +++ b/src/main/java/net/minecraft/util/Session.java @@ -4,7 +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; +import net.minecraft.entity.player.EntityPlayer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. diff --git a/src/main/java/net/minecraft/util/StatCollector.java b/src/main/java/net/minecraft/util/StatCollector.java index 58af200c..d90e078a 100755 --- a/src/main/java/net/minecraft/util/StatCollector.java +++ b/src/main/java/net/minecraft/util/StatCollector.java @@ -1,5 +1,7 @@ package net.minecraft.util; +import net.minecraft.util.StringTranslate; + /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. * @@ -22,12 +24,6 @@ package net.minecraft.util; */ public class StatCollector { private static StringTranslate localizedName = StringTranslate.getInstance(); - /**+ - * A StringTranslate instance using the hardcoded default locale - * (en_US). Used as a fallback in case the shared - * StringTranslate singleton instance fails to translate a key. - */ - private static StringTranslate fallbackTranslator = new StringTranslate(); /**+ * Translates a Stat name @@ -49,7 +45,8 @@ public class StatCollector { * translateToLocal fails. */ public static String translateToFallback(String key) { - return fallbackTranslator.translateKey(key); + return StringTranslate.fallbackInstance != null ? StringTranslate.fallbackInstance.translateKey(key) + : localizedName.translateKey(key); } /**+ diff --git a/src/main/java/net/minecraft/util/StringTranslate.java b/src/main/java/net/minecraft/util/StringTranslate.java index 3357a8b3..41589f7e 100755 --- a/src/main/java/net/minecraft/util/StringTranslate.java +++ b/src/main/java/net/minecraft/util/StringTranslate.java @@ -1,15 +1,5 @@ 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; - -import com.google.common.base.Charsets; import com.google.common.base.Splitter; import com.google.common.collect.Iterables; import com.google.common.collect.Maps; @@ -19,6 +9,16 @@ import net.lax1dude.eaglercraft.v1_8.HString; import net.lax1dude.eaglercraft.v1_8.IOUtils; import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +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.Pattern; + /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. * @@ -54,16 +54,27 @@ public class StringTranslate { * Is the private singleton instance of StringTranslate. */ private static StringTranslate instance = new StringTranslate(); + static StringTranslate fallbackInstance = null; private final Map languageList = Maps.newHashMap(); private long lastUpdateTimeInMilliseconds; - public StringTranslate() { - this.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); + private StringTranslate() { } - public static void doCLINIT() { - InputStream inputstream = EagRuntime.getResourceStream("/assets/minecraft/lang/en_US.lang"); - for (String s : IOUtils.readLines(inputstream, Charsets.UTF_8)) { + public static void initClient() { + try (InputStream inputstream = EagRuntime.getResourceStream("/assets/minecraft/lang/en_US.lang")) { + initServer(IOUtils.readLines(inputstream, StandardCharsets.UTF_8)); + fallbackInstance = new StringTranslate(); + fallbackInstance.replaceWith(instance.languageList); + SingleplayerServerController.updateLocale(dump()); + } catch (IOException e) { + EagRuntime.debugPrintStackTrace(e); + } + } + + public static void initServer(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) { @@ -95,7 +106,6 @@ public class StringTranslate { instance.languageList.clear(); instance.languageList.putAll(parMap); instance.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); - SingleplayerServerController.updateLocale(dump()); } /**+ diff --git a/src/main/java/net/minecraft/util/StringUtils.java b/src/main/java/net/minecraft/util/StringUtils.java index 20750f00..95632eba 100755 --- a/src/main/java/net/minecraft/util/StringUtils.java +++ b/src/main/java/net/minecraft/util/StringUtils.java @@ -47,4 +47,10 @@ public class StringUtils { 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/village/Village.java b/src/main/java/net/minecraft/village/Village.java similarity index 89% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/Village.java rename to src/main/java/net/minecraft/village/Village.java index 53b5990a..492ae6b1 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/Village.java +++ b/src/main/java/net/minecraft/village/Village.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village; +package net.minecraft.village; import com.google.common.collect.Lists; import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; @@ -6,24 +6,22 @@ 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.block.Block; +import net.minecraft.block.BlockDoor; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.passive.EntityVillager; +import 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; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.village.VillageDoorInfo; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -47,10 +45,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class Village { - static { - __checkIntegratedContextValid("net/minecraft/village/Village"); - } - private World worldObj; /**+ * list of VillageDoorInfo objects diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageCollection.java b/src/main/java/net/minecraft/village/VillageCollection.java similarity index 84% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageCollection.java rename to src/main/java/net/minecraft/village/VillageCollection.java index 6dcbf73c..6c7f101a 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageCollection.java +++ b/src/main/java/net/minecraft/village/VillageCollection.java @@ -1,22 +1,20 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village; +package 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.block.Block; +import net.minecraft.block.BlockDoor; +import 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; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.village.Village; +import net.minecraft.village.VillageDoorInfo; +import net.minecraft.world.World; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldSavedData; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -40,10 +38,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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 diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageDoorInfo.java b/src/main/java/net/minecraft/village/VillageDoorInfo.java similarity index 87% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageDoorInfo.java rename to src/main/java/net/minecraft/village/VillageDoorInfo.java index 53c183a9..b7e70849 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageDoorInfo.java +++ b/src/main/java/net/minecraft/village/VillageDoorInfo.java @@ -1,9 +1,7 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village; +package 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; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -27,10 +25,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class VillageDoorInfo { - static { - __checkIntegratedContextValid("net/minecraft/village/VillageDoorInfo"); - } - private final BlockPos doorBlockPos; private final BlockPos insideBlock; private final EnumFacing insideDirection; diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageSiege.java b/src/main/java/net/minecraft/village/VillageSiege.java similarity index 80% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageSiege.java rename to src/main/java/net/minecraft/village/VillageSiege.java index 1443b4c7..c88c3a2f 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/village/VillageSiege.java +++ b/src/main/java/net/minecraft/village/VillageSiege.java @@ -1,21 +1,19 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.village; +package 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; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.village.Village; +import net.minecraft.world.SpawnerAnimals; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -39,10 +37,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class VillageSiege { - static { - __checkIntegratedContextValid("net/minecraft/village/VillageSiege"); - } - private World worldObj; private boolean field_75535_b; private int field_75536_c = -1; diff --git a/src/main/java/net/minecraft/world/GameRules.java b/src/main/java/net/minecraft/world/GameRules.java index fb407545..8374ab52 100755 --- a/src/main/java/net/minecraft/world/GameRules.java +++ b/src/main/java/net/minecraft/world/GameRules.java @@ -44,6 +44,12 @@ public class GameRules { 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) { diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/SpawnerAnimals.java b/src/main/java/net/minecraft/world/SpawnerAnimals.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/SpawnerAnimals.java rename to src/main/java/net/minecraft/world/SpawnerAnimals.java index f7e62329..974d4c89 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/SpawnerAnimals.java +++ b/src/main/java/net/minecraft/world/SpawnerAnimals.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; +package net.minecraft.world; import com.google.common.collect.Sets; @@ -7,24 +7,22 @@ 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; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntitySpawnPlacementRegistry; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -48,10 +46,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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 diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/Teleporter.java b/src/main/java/net/minecraft/world/Teleporter.java similarity index 89% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/Teleporter.java rename to src/main/java/net/minecraft/world/Teleporter.java index f2f465a3..365d9dfd 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/Teleporter.java +++ b/src/main/java/net/minecraft/world/Teleporter.java @@ -1,22 +1,20 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; +package 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; +import net.minecraft.block.BlockPortal; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockPattern; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.LongHashMap; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.WorldServer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -40,10 +38,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class Teleporter { - static { - __checkIntegratedContextValid("net/minecraft/world/Teleporter"); - } - private final WorldServer worldServerInstance; private final EaglercraftRandom random; /**+ diff --git a/src/main/java/net/minecraft/world/World.java b/src/main/java/net/minecraft/world/World.java index 15250a6f..785d8433 100755 --- a/src/main/java/net/minecraft/world/World.java +++ b/src/main/java/net/minecraft/world/World.java @@ -1,5 +1,9 @@ package 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; @@ -10,11 +14,9 @@ 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 java.util.concurrent.Callable; +import net.lax1dude.eaglercraft.v1_8.HString; -import com.google.common.base.Predicate; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; +import java.util.concurrent.Callable; import net.minecraft.block.Block; import net.minecraft.block.BlockHopper; @@ -34,6 +36,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.profiler.Profiler; import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; @@ -46,10 +49,13 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.ReportedException; import net.minecraft.util.Vec3; +import net.minecraft.village.VillageCollection; import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; import net.minecraft.world.border.WorldBorder; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.structure.StructureBoundingBox; import net.minecraft.world.storage.ISaveHandler; import net.minecraft.world.storage.MapStorage; import net.minecraft.world.storage.WorldInfo; @@ -128,6 +134,7 @@ public abstract class World implements IBlockAccess { 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(); @@ -141,12 +148,10 @@ public abstract class World implements IBlockAccess { private boolean processingLoadedTiles; private final WorldBorder worldBorder; int[] lightUpdateBlockList; + public final boolean isRemote; protected World(ISaveHandler saveHandlerIn, WorldInfo info, WorldProvider providerIn, Profiler profilerIn, boolean client) { - if (!client) { - throw new IllegalStateException("Singleplayer is unavailable because all of it's code was deleted"); - } this.ambientTickCountdown = this.rand.nextInt(12000); this.spawnHostileMobs = true; this.spawnPeacefulMobs = true; @@ -156,6 +161,7 @@ public abstract class World implements IBlockAccess { this.worldInfo = info; this.provider = providerIn; this.worldBorder = providerIn.getWorldBorder(); + this.isRemote = client; } public World init() { @@ -167,22 +173,27 @@ public abstract class World implements IBlockAccess { Chunk chunk = this.getChunkFromBlockCoords(pos); try { - return chunk.getBiome(pos); + 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(pos); + return CrashReportCategory + .getCoordinateInfo(new net.minecraft.util.BlockPos(pos.getX(), pos.getY(), pos.getZ())); } }); throw new ReportedException(crashreport); } } else { - return BiomeGenBase.plains; + return this.provider.getWorldChunkManager().getBiomeGenerator(pos, BiomeGenBase.plains); } } + public WorldChunkManager getWorldChunkManager() { + return this.provider.getWorldChunkManager(); + } + protected abstract IChunkProvider createChunkProvider(); public void initialize(WorldSettings settings) { @@ -250,6 +261,14 @@ public abstract class World implements IBlockAccess { 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; @@ -294,6 +313,8 @@ public abstract class World implements IBlockAccess { public boolean setBlockState(BlockPos pos, IBlockState newState, int flags) { if (!this.isValid(pos)) { return false; + } else if (!this.isRemote && this.worldInfo.getTerrainType() == WorldType.DEBUG_WORLD) { + return false; } else { Chunk chunk = this.getChunkFromBlockCoords(pos); Block block = newState.getBlock(); @@ -309,10 +330,17 @@ public abstract class World implements IBlockAccess { this.theProfiler.endSection(); } - if ((flags & 2) != 0 && ((flags & 4) == 0) && chunk.isPopulated()) { + if ((flags & 2) != 0 && (!this.isRemote || (flags & 4) == 0) && chunk.isPopulated()) { this.markBlockForUpdate(pos); } + if (!this.isRemote && (flags & 1) != 0) { + this.notifyNeighborsRespectDebug(pos, iblockstate.getBlock()); + if (block.hasComparatorInputOverride()) { + this.updateComparatorOutputLevel(pos, block); + } + } + return true; } } @@ -357,7 +385,10 @@ public abstract class World implements IBlockAccess { } public void notifyNeighborsRespectDebug(BlockPos pos, Block blockType) { - this.notifyNeighborsOfStateChange(pos, blockType); + if (this.worldInfo.getTerrainType() != WorldType.DEBUG_WORLD) { + this.notifyNeighborsOfStateChange(pos, blockType); + } + } /**+ @@ -428,7 +459,29 @@ public abstract class World implements IBlockAccess { } public void notifyBlockOfStateChange(BlockPos pos, final Block blockIn) { + if (!this.isRemote) { + 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); + } + } + }); + CrashReportCategory.addBlockInfo(crashreportcategory, pos, iblockstate); + throw new ReportedException(crashreport); + } + } } public boolean isBlockTickPending(BlockPos pos, Block blockType) { @@ -2017,6 +2070,64 @@ public abstract class World implements IBlockAccess { * Updates all weather states. */ protected void updateWeather() { + if (!this.provider.getHasNoSky()) { + if (!this.isRemote) { + 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() { @@ -2057,6 +2168,30 @@ public abstract class World implements IBlockAccess { protected abstract int getRenderDistanceChunks(); protected void playMoodSoundAndCheckLight(int chunkIn, int parInt2, Chunk parChunk) { + this.theProfiler.endStartSection("moodSound"); + if (this.ambientTickCountdown == 0 && !this.isRemote) { + 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(); } @@ -2311,6 +2446,10 @@ public abstract class World implements IBlockAccess { 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 @@ -2358,7 +2497,7 @@ public abstract class World implements IBlockAccess { public List getPlayers(Class playerType, Predicate filter) { ArrayList arraylist = Lists.newArrayList(); - for (EntityPlayer entity : this.playerEntities) { + for (Entity entity : this.playerEntities) { if (playerType.isAssignableFrom(entity.getClass()) && filter.apply((T) entity)) { arraylist.add(entity); } @@ -2971,7 +3110,7 @@ public abstract class World implements IBlockAccess { */ public Calendar getCurrentDate() { if (this.getTotalWorldTime() % 600L == 0L) { - this.theCalendar.setTimeInMillis(System.currentTimeMillis()); + this.theCalendar.setTimeInMillis(MinecraftServer.getCurrentTimeMillis()); } return this.theCalendar; @@ -3039,6 +3178,10 @@ public abstract class World implements IBlockAccess { return this.findingSpawnPoint; } + public VillageCollection getVillageCollection() { + return this.villageCollectionObj; + } + public WorldBorder getWorldBorder() { return this.worldBorder; } @@ -3047,6 +3190,9 @@ public abstract class World implements IBlockAccess { * 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(); diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldManager.java b/src/main/java/net/minecraft/world/WorldManager.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldManager.java rename to src/main/java/net/minecraft/world/WorldManager.java index 8751f5ef..6b1ab842 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldManager.java +++ b/src/main/java/net/minecraft/world/WorldManager.java @@ -1,17 +1,15 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; +package 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; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S25PacketBlockBreakAnim; +import net.minecraft.network.play.server.S28PacketEffect; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.BlockPos; +import net.minecraft.world.IWorldAccess; +import net.minecraft.world.WorldServer; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -35,10 +33,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WorldManager implements IWorldAccess { - static { - __checkIntegratedContextValid("net/minecraft/world/WorldManager"); - } - private MinecraftServer mcServer; private WorldServer theWorldServer; diff --git a/src/main/java/net/minecraft/world/WorldProvider.java b/src/main/java/net/minecraft/world/WorldProvider.java index a33b9b5d..0f01241d 100755 --- a/src/main/java/net/minecraft/world/WorldProvider.java +++ b/src/main/java/net/minecraft/world/WorldProvider.java @@ -4,7 +4,15 @@ import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.biome.WorldChunkManagerHell; import net.minecraft.world.border.WorldBorder; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderDebug; +import net.minecraft.world.gen.ChunkProviderFlat; +import net.minecraft.world.gen.ChunkProviderGenerate; +import net.minecraft.world.gen.FlatGeneratorInfo; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,6 +39,7 @@ public abstract class WorldProvider { protected World worldObj; private WorldType terrainType; private String generatorSettings; + protected WorldChunkManager worldChunkMgr; protected boolean isHellWorld; protected boolean hasNoSky; /**+ @@ -72,9 +81,37 @@ public abstract class WorldProvider { * 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 @@ -205,6 +242,10 @@ public abstract class WorldProvider { public abstract String getInternalNameSuffix(); + public WorldChunkManager getWorldChunkManager() { + return this.worldChunkMgr; + } + public boolean doesWaterVaporize() { return this.isHellWorld; } diff --git a/src/main/java/net/minecraft/world/WorldProviderEnd.java b/src/main/java/net/minecraft/world/WorldProviderEnd.java index 205968d4..c94ca0b1 100755 --- a/src/main/java/net/minecraft/world/WorldProviderEnd.java +++ b/src/main/java/net/minecraft/world/WorldProviderEnd.java @@ -3,6 +3,10 @@ package net.minecraft.world; import net.minecraft.util.BlockPos; import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManagerHell; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderEnd; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +33,19 @@ public class WorldProviderEnd extends WorldProvider { * creates a new world chunk manager for WorldProvider */ public void registerWorldChunkManager() { + this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.sky, 0.0F); this.dimensionId = 1; 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) diff --git a/src/main/java/net/minecraft/world/WorldProviderHell.java b/src/main/java/net/minecraft/world/WorldProviderHell.java index e0356f36..b1de94cf 100755 --- a/src/main/java/net/minecraft/world/WorldProviderHell.java +++ b/src/main/java/net/minecraft/world/WorldProviderHell.java @@ -1,7 +1,11 @@ package net.minecraft.world; import net.minecraft.util.Vec3; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManagerHell; import net.minecraft.world.border.WorldBorder; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderHell; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,6 +32,7 @@ public class WorldProviderHell extends WorldProvider { * 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; @@ -53,6 +58,15 @@ public class WorldProviderHell extends WorldProvider { } + /**+ + * 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. diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldServer.java b/src/main/java/net/minecraft/world/WorldServer.java similarity index 82% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldServer.java rename to src/main/java/net/minecraft/world/WorldServer.java index 3a91a52b..62b52fcd 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldServer.java +++ b/src/main/java/net/minecraft/world/WorldServer.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; +package net.minecraft.world; import com.google.common.base.Predicate; import com.google.common.collect.Lists; @@ -12,78 +12,75 @@ 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.block.Block; +import net.minecraft.block.BlockEventData; +import net.minecraft.block.material.Material; +import 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.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EntityTracker; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.INpc; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityWaterMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.network.play.server.S24PacketBlockAction; +import net.minecraft.network.play.server.S27PacketExplosion; +import net.minecraft.network.play.server.S2APacketParticles; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity; +import net.minecraft.profiler.Profiler; +import net.minecraft.scoreboard.ScoreboardSaveData; +import net.minecraft.scoreboard.ServerScoreboard; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.PlayerManager; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.IThreadListener; +import net.minecraft.util.ReportedException; +import net.minecraft.util.Vec3; +import net.minecraft.util.WeightedRandom; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.village.VillageCollection; +import net.minecraft.village.VillageSiege; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.Explosion; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.NextTickListEntry; +import net.minecraft.world.SpawnerAnimals; +import net.minecraft.world.Teleporter; +import net.minecraft.world.World; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; +import net.minecraft.world.chunk.storage.IChunkLoader; +import net.minecraft.world.gen.ChunkProviderServer; +import net.minecraft.world.gen.feature.WorldGeneratorBonusChest; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.MapStorage; +import 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. * @@ -106,10 +103,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; @@ -572,8 +565,8 @@ public class WorldServer extends World implements IThreadListener { "Exception while ticking a block"); CrashReportCategory crashreportcategory = crashreport .makeCategory("Block being ticked"); - CrashReportHelper.addIntegratedServerBlockInfo(crashreportcategory, - nextticklistentry1.position, iblockstate); + CrashReportCategory.addBlockInfo(crashreportcategory, nextticklistentry1.position, + iblockstate); throw new ReportedException(crashreport); } } @@ -1065,10 +1058,6 @@ public class WorldServer extends World implements IThreadListener { this.mcServer.addScheduledTask(runnable); } - public boolean isCallingFromMinecraftThread() { - return this.mcServer.isCallingFromMinecraftThread(); - } - static class ServerBlockEventList extends ArrayList { private ServerBlockEventList() { } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldServerMulti.java b/src/main/java/net/minecraft/world/WorldServerMulti.java similarity index 71% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldServerMulti.java rename to src/main/java/net/minecraft/world/WorldServerMulti.java index 12112eb8..be96e730 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/WorldServerMulti.java +++ b/src/main/java/net/minecraft/world/WorldServerMulti.java @@ -1,17 +1,15 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world; +package 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; +import net.minecraft.profiler.Profiler; +import net.minecraft.server.MinecraftServer; +import net.minecraft.village.VillageCollection; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.border.IBorderListener; +import net.minecraft.world.border.WorldBorder; +import net.minecraft.world.storage.DerivedWorldInfo; +import net.minecraft.world.storage.ISaveHandler; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -35,10 +33,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WorldServerMulti extends WorldServer { - static { - __checkIntegratedContextValid("net/minecraft/world/WorldServerMulti"); - } - private WorldServer delegate; public WorldServerMulti(MinecraftServer server, ISaveHandler saveHandlerIn, int dimensionId, WorldServer delegate, 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/minecraft/world/biome/BiomeCache.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeCache.java rename to src/main/java/net/minecraft/world/biome/BiomeCache.java index dd2dcac7..83549392 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeCache.java +++ b/src/main/java/net/minecraft/world/biome/BiomeCache.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; +package 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; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.LongHashMap; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,10 +29,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class BiomeCache { - static { - __checkIntegratedContextValid("net/minecraft/world/biome/BiomeCache"); - } - private final WorldChunkManager chunkManager; private long lastCleanupTime; /**+ 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/minecraft/world/biome/BiomeDecorator.java similarity index 86% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeDecorator.java rename to src/main/java/net/minecraft/world/biome/BiomeDecorator.java index f88f1d6b..89deecfe 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeDecorator.java +++ b/src/main/java/net/minecraft/world/biome/BiomeDecorator.java @@ -1,30 +1,28 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; +package 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; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.BlockStone; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.ChunkProviderSettings; +import net.minecraft.world.gen.GeneratorBushFeature; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBigMushroom; +import net.minecraft.world.gen.feature.WorldGenCactus; +import net.minecraft.world.gen.feature.WorldGenClay; +import net.minecraft.world.gen.feature.WorldGenDeadBush; +import net.minecraft.world.gen.feature.WorldGenFlowers; +import net.minecraft.world.gen.feature.WorldGenLiquids; +import net.minecraft.world.gen.feature.WorldGenMinable; +import net.minecraft.world.gen.feature.WorldGenPumpkin; +import net.minecraft.world.gen.feature.WorldGenReed; +import net.minecraft.world.gen.feature.WorldGenSand; +import net.minecraft.world.gen.feature.WorldGenWaterlily; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -48,10 +46,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class BiomeDecorator { - static { - __checkIntegratedContextValid("net/minecraft/world/biome/BiomeDecorator"); - } - protected World currentWorld; protected EaglercraftRandom randomGenerator; protected BlockPos field_180294_c; 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/minecraft/world/biome/BiomeEndDecorator.java similarity index 68% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeEndDecorator.java rename to src/main/java/net/minecraft/world/biome/BiomeEndDecorator.java index 6d2816e3..a2a1a1fc 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/BiomeEndDecorator.java +++ b/src/main/java/net/minecraft/world/biome/BiomeEndDecorator.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; +package 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; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.BiomeDecorator; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.feature.WorldGenSpikes; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,10 +29,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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) { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenBase.java b/src/main/java/net/minecraft/world/biome/BiomeGenBase.java index 517b8046..d9c65225 100755 --- a/src/main/java/net/minecraft/world/biome/BiomeGenBase.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenBase.java @@ -1,19 +1,17 @@ package 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 com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; - -import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; -import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.minecraft.block.BlockFlower; import net.minecraft.block.BlockSand; +import net.minecraft.block.BlockTallGrass; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLiving; @@ -41,6 +39,15 @@ import net.minecraft.world.ColorizerGrass; import net.minecraft.world.World; import net.minecraft.world.chunk.ChunkPrimer; import net.minecraft.world.gen.NoiseGeneratorPerlin; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBigTree; +import net.minecraft.world.gen.feature.WorldGenDoublePlant; +import net.minecraft.world.gen.feature.WorldGenSwamp; +import net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.minecraft.world.gen.feature.WorldGenTrees; +import net.minecraft.world.gen.feature.WorldGenerator; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -124,10 +131,9 @@ public abstract class BiomeGenBase { public static BiomeGenBase mesaPlateau_F; public static BiomeGenBase mesaPlateau; public static BiomeGenBase field_180279_ad; - protected static final NoiseGeneratorPerlin temperatureNoise = new NoiseGeneratorPerlin( - new EaglercraftRandom(1234L), 1); - protected static final NoiseGeneratorPerlin GRASS_COLOR_NOISE = new NoiseGeneratorPerlin( - new EaglercraftRandom(2345L), 1); + 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; @@ -145,6 +151,7 @@ public abstract class BiomeGenBase { public float temperature; public float rainfall; public int waterColorMultiplier; + public BiomeDecorator theBiomeDecorator; protected List spawnableMonsterList; protected List spawnableCreatureList; protected List spawnableWaterCreatureList; @@ -152,6 +159,9 @@ public abstract class BiomeGenBase { 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; @@ -164,8 +174,12 @@ public abstract class BiomeGenBase { 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)); @@ -182,6 +196,13 @@ public abstract class BiomeGenBase { 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. */ @@ -209,6 +230,17 @@ public abstract class BiomeGenBase { 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; } @@ -340,6 +372,10 @@ public abstract class BiomeGenBase { } } + 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); @@ -475,44 +511,7 @@ public abstract class BiomeGenBase { } } - 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; - } - - public static void bootstrap() { + 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() @@ -610,6 +609,8 @@ public abstract class BiomeGenBase { 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)) { @@ -629,6 +630,45 @@ public abstract class BiomeGenBase { 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/minecraft/world/biome/BiomeGenBeach.java b/src/main/java/net/minecraft/world/biome/BiomeGenBeach.java index 36ba1184..8522c1e7 100755 --- a/src/main/java/net/minecraft/world/biome/BiomeGenBeach.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenBeach.java @@ -28,5 +28,9 @@ public class BiomeGenBeach extends BiomeGenBase { 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/minecraft/world/biome/BiomeGenDesert.java b/src/main/java/net/minecraft/world/biome/BiomeGenDesert.java index 604f1c7b..5ec89e51 100755 --- a/src/main/java/net/minecraft/world/biome/BiomeGenDesert.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenDesert.java @@ -1,6 +1,10 @@ package net.minecraft.world.biome; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenDesertWells; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,6 +32,21 @@ public class BiomeGenDesert extends BiomeGenBase { 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/minecraft/world/biome/BiomeGenEnd.java b/src/main/java/net/minecraft/world/biome/BiomeGenEnd.java index 3b71452b..ab1ac3a8 100755 --- a/src/main/java/net/minecraft/world/biome/BiomeGenEnd.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenEnd.java @@ -33,6 +33,7 @@ public class BiomeGenEnd extends BiomeGenBase { 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(); } /**+ diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenForest.java b/src/main/java/net/minecraft/world/biome/BiomeGenForest.java index 5c8db157..c3b5d20e 100755 --- a/src/main/java/net/minecraft/world/biome/BiomeGenForest.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenForest.java @@ -1,11 +1,16 @@ package net.minecraft.world.biome; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; - +import net.minecraft.block.BlockDoublePlant; import net.minecraft.block.BlockFlower; import net.minecraft.entity.passive.EntityWolf; import net.minecraft.util.BlockPos; import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBigMushroom; +import net.minecraft.world.gen.feature.WorldGenCanopyTree; +import net.minecraft.world.gen.feature.WorldGenForest; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +34,20 @@ import net.minecraft.util.MathHelper; */ public class BiomeGenForest extends BiomeGenBase { 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); @@ -46,6 +61,10 @@ public class BiomeGenForest extends BiomeGenBase { 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) { @@ -62,6 +81,11 @@ public class BiomeGenForest extends BiomeGenBase { } } + 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 @@ -77,6 +101,56 @@ public class BiomeGenForest extends BiomeGenBase { } } + 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; @@ -92,8 +166,16 @@ public class BiomeGenForest extends BiomeGenBase { return biomegenforest; } else { return this.biomeID != BiomeGenBase.birchForest.biomeID - && this.biomeID != BiomeGenBase.birchForestHills.biomeID ? new BiomeGenMutated(i, this) - : new BiomeGenMutated(i, this); + && 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/minecraft/world/biome/BiomeGenHills.java b/src/main/java/net/minecraft/world/biome/BiomeGenHills.java index 466300f9..d00be348 100755 --- a/src/main/java/net/minecraft/world/biome/BiomeGenHills.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenHills.java @@ -1,10 +1,15 @@ package net.minecraft.world.biome; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; - +import net.minecraft.block.BlockSilverfish; import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenMinable; +import net.minecraft.world.gen.feature.WorldGenTaiga2; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -27,6 +32,11 @@ import net.minecraft.world.chunk.ChunkPrimer; * */ public class BiomeGenHills extends BiomeGenBase { + + 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; @@ -36,11 +46,39 @@ public class BiomeGenHills extends BiomeGenBase { 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(); diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenJungle.java b/src/main/java/net/minecraft/world/biome/BiomeGenJungle.java index 9d3170f0..f11b4f7a 100755 --- a/src/main/java/net/minecraft/world/biome/BiomeGenJungle.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenJungle.java @@ -1,13 +1,25 @@ package net.minecraft.world.biome; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.minecraft.block.BlockLeaves; import net.minecraft.block.BlockOldLeaf; import net.minecraft.block.BlockOldLog; import net.minecraft.block.BlockPlanks; +import net.minecraft.block.BlockTallGrass; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.passive.EntityChicken; import net.minecraft.entity.passive.EntityOcelot; import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenMegaJungle; +import net.minecraft.world.gen.feature.WorldGenMelon; +import net.minecraft.world.gen.feature.WorldGenShrub; +import net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.minecraft.world.gen.feature.WorldGenTrees; +import net.minecraft.world.gen.feature.WorldGenVines; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -44,6 +56,14 @@ public class BiomeGenJungle extends BiomeGenBase { field_181622_aG = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.OAK) .withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)); 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)); } @@ -51,4 +71,37 @@ public class BiomeGenJungle extends BiomeGenBase { 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/minecraft/world/biome/BiomeGenMesa.java b/src/main/java/net/minecraft/world/biome/BiomeGenMesa.java index 097470f6..86fa03de 100755 --- a/src/main/java/net/minecraft/world/biome/BiomeGenMesa.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenMesa.java @@ -2,7 +2,6 @@ package net.minecraft.world.biome; import java.util.Arrays; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; - import net.minecraft.block.BlockColored; import net.minecraft.block.BlockDirt; import net.minecraft.block.BlockSand; @@ -12,8 +11,10 @@ import net.minecraft.init.Blocks; import net.minecraft.item.EnumDyeColor; import net.minecraft.util.BlockPos; import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.ChunkPrimer; import net.minecraft.world.gen.NoiseGeneratorPerlin; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -53,7 +54,20 @@ public class BiomeGenMesa extends BiomeGenBase { 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) { @@ -64,6 +78,10 @@ public class BiomeGenMesa extends BiomeGenBase { 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()) { diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java b/src/main/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java index 1b0c9d69..fdb2948d 100755 --- a/src/main/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java @@ -26,6 +26,11 @@ import net.minecraft.init.Blocks; public class BiomeGenMushroomIsland extends BiomeGenBase { 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(); diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenMutated.java b/src/main/java/net/minecraft/world/biome/BiomeGenMutated.java index 94dc4545..b28ec805 100755 --- a/src/main/java/net/minecraft/world/biome/BiomeGenMutated.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenMutated.java @@ -7,6 +7,7 @@ import com.google.common.collect.Lists; import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -56,6 +57,10 @@ public class BiomeGenMutated extends BiomeGenBase { 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); @@ -68,6 +73,10 @@ public class BiomeGenMutated extends BiomeGenBase { return this.baseBiome.getSpawningChance(); } + public WorldGenAbstractTree genBigTreeChance(EaglercraftRandom random) { + return this.baseBiome.genBigTreeChance(random); + } + public int getFoliageColorAtPos(BlockPos blockpos) { return this.baseBiome.getFoliageColorAtPos(blockpos); } diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenPlains.java b/src/main/java/net/minecraft/world/biome/BiomeGenPlains.java index dad556c0..39ac214f 100755 --- a/src/main/java/net/minecraft/world/biome/BiomeGenPlains.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenPlains.java @@ -1,10 +1,11 @@ package net.minecraft.world.biome; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; - +import net.minecraft.block.BlockDoublePlant; import net.minecraft.block.BlockFlower; import net.minecraft.entity.passive.EntityHorse; import net.minecraft.util.BlockPos; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -34,6 +35,9 @@ public class BiomeGenPlains extends BiomeGenBase { 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) { @@ -61,6 +65,39 @@ public class BiomeGenPlains extends BiomeGenBase { } } + 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"); diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenSavanna.java b/src/main/java/net/minecraft/world/biome/BiomeGenSavanna.java index 158bad44..b3710882 100755 --- a/src/main/java/net/minecraft/world/biome/BiomeGenSavanna.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenSavanna.java @@ -1,12 +1,15 @@ package net.minecraft.world.biome; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; - import net.minecraft.block.BlockDirt; +import net.minecraft.block.BlockDoublePlant; import net.minecraft.entity.passive.EntityHorse; import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenSavannaTree; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,9 +33,18 @@ import net.minecraft.world.chunk.ChunkPrimer; */ public class BiomeGenSavanna extends BiomeGenBase { + 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) { @@ -43,9 +55,25 @@ public class BiomeGenSavanna extends BiomeGenBase { 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, @@ -62,5 +90,9 @@ public class BiomeGenSavanna extends BiomeGenBase { 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/minecraft/world/biome/BiomeGenSnow.java b/src/main/java/net/minecraft/world/biome/BiomeGenSnow.java index 37ad569b..cb00192b 100755 --- a/src/main/java/net/minecraft/world/biome/BiomeGenSnow.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenSnow.java @@ -1,6 +1,13 @@ package net.minecraft.world.biome; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenIcePath; +import net.minecraft.world.gen.feature.WorldGenIceSpike; +import net.minecraft.world.gen.feature.WorldGenTaiga2; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -24,6 +31,8 @@ import net.minecraft.init.Blocks; */ public class BiomeGenSnow extends BiomeGenBase { 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); @@ -35,6 +44,28 @@ public class BiomeGenSnow extends BiomeGenBase { 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) diff --git a/src/main/java/net/minecraft/world/biome/BiomeGenStoneBeach.java b/src/main/java/net/minecraft/world/biome/BiomeGenStoneBeach.java index a22150b5..fc310bf7 100755 --- a/src/main/java/net/minecraft/world/biome/BiomeGenStoneBeach.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenStoneBeach.java @@ -28,5 +28,9 @@ public class BiomeGenStoneBeach extends BiomeGenBase { 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/minecraft/world/biome/BiomeGenSwamp.java b/src/main/java/net/minecraft/world/biome/BiomeGenSwamp.java index 8843825d..81abc93a 100755 --- a/src/main/java/net/minecraft/world/biome/BiomeGenSwamp.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenSwamp.java @@ -1,10 +1,14 @@ package net.minecraft.world.biome; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; - import net.minecraft.block.BlockFlower; +import net.minecraft.block.material.Material; import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +33,24 @@ import net.minecraft.util.BlockPos; public class BiomeGenSwamp extends BiomeGenBase { 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); @@ -46,4 +64,27 @@ public class BiomeGenSwamp extends BiomeGenBase { 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/minecraft/world/biome/BiomeGenTaiga.java b/src/main/java/net/minecraft/world/biome/BiomeGenTaiga.java index 02bf280b..25aa05f1 100755 --- a/src/main/java/net/minecraft/world/biome/BiomeGenTaiga.java +++ b/src/main/java/net/minecraft/world/biome/BiomeGenTaiga.java @@ -1,12 +1,21 @@ package net.minecraft.world.biome; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; - import net.minecraft.block.BlockDirt; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockTallGrass; import net.minecraft.entity.passive.EntityWolf; import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBlockBlob; +import net.minecraft.world.gen.feature.WorldGenMegaPineTree; +import net.minecraft.world.gen.feature.WorldGenTaiga1; +import net.minecraft.world.gen.feature.WorldGenTaiga2; +import net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,12 +38,67 @@ import net.minecraft.world.chunk.ChunkPrimer; * */ public class BiomeGenTaiga extends BiomeGenBase { + + 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, 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/minecraft/world/biome/WorldChunkManager.java similarity index 87% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/WorldChunkManager.java rename to src/main/java/net/minecraft/world/biome/WorldChunkManager.java index 00500d1d..36ff45b7 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/WorldChunkManager.java +++ b/src/main/java/net/minecraft/world/biome/WorldChunkManager.java @@ -1,20 +1,18 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; +package 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; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ReportedException; +import net.minecraft.world.World; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeCache; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -38,10 +36,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WorldChunkManager { - static { - __checkIntegratedContextValid("net/minecraft/world/biome/WorldChunkManager"); - } - private GenLayer genBiomes; private GenLayer biomeIndexLayer; private BiomeCache biomeCache; 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/minecraft/world/biome/WorldChunkManagerHell.java similarity index 84% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/WorldChunkManagerHell.java rename to src/main/java/net/minecraft/world/biome/WorldChunkManagerHell.java index 69bceabd..5d4af339 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/biome/WorldChunkManagerHell.java +++ b/src/main/java/net/minecraft/world/biome/WorldChunkManagerHell.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.biome; +package 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; +import net.minecraft.util.BlockPos; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,10 +29,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WorldChunkManagerHell extends WorldChunkManager { - static { - __checkIntegratedContextValid("net/minecraft/world/biome/WorldChunkManagerHell"); - } - private BiomeGenBase biomeGenerator; private float rainfall; diff --git a/src/main/java/net/minecraft/world/chunk/Chunk.java b/src/main/java/net/minecraft/world/chunk/Chunk.java index 141098ad..222aaa94 100755 --- a/src/main/java/net/minecraft/world/chunk/Chunk.java +++ b/src/main/java/net/minecraft/world/chunk/Chunk.java @@ -1,18 +1,16 @@ package net.minecraft.world.chunk; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; -import java.util.concurrent.Callable; - 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 net.lax1dude.eaglercraft.v1_8.log4j.LogManager; -import net.lax1dude.eaglercraft.v1_8.log4j.Logger; -import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager; +import java.util.concurrent.Callable; + +import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerMinecraftServer; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; @@ -32,7 +30,11 @@ import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; import net.minecraft.world.chunk.storage.ExtendedBlockStorage; +import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; +import net.lax1dude.eaglercraft.v1_8.log4j.Logger; +import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -86,7 +88,7 @@ public class Chunk { this.updateSkylightColumns = new boolean[256]; this.chunkTileEntityMap = Maps.newHashMap(); this.queuedLightChecks = 4096; - this.tileEntityPosQueue = new ArrayList(); + this.tileEntityPosQueue = new LinkedList(); this.entityLists = (ClassInheritanceMultiMap[]) (new ClassInheritanceMultiMap[16]); this.worldObj = worldIn; this.xPosition = x; @@ -243,6 +245,9 @@ public class Chunk { } } + if (!this.worldObj.isRemote) { + ++EaglerMinecraftServer.counterLightUpdate; + } this.isModified = true; } @@ -401,6 +406,9 @@ public class Chunk { this.updateSkylightNeighborHeight(k, l, j2, k2); } + if (!this.worldObj.isRemote) { + ++EaglerMinecraftServer.counterLightUpdate; + } this.isModified = true; } } @@ -569,7 +577,9 @@ public class Chunk { extendedblockstorage.set(i, j & 15, k, state); if (block1 != block) { - if (block1 instanceof ITileEntityProvider) { + if (!this.worldObj.isRemote) { + block1.breakBlock(this.worldObj, pos, iblockstate); + } else if (block1 instanceof ITileEntityProvider) { this.worldObj.removeTileEntity(pos); } } @@ -603,6 +613,10 @@ public class Chunk { } } + if (!this.worldObj.isRemote && block1 != block) { + block.onBlockAdded(this.worldObj, pos, state); + } + if (block instanceof ITileEntityProvider) { TileEntity tileentity1 = this.getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK); if (tileentity1 == null) { @@ -990,7 +1004,7 @@ public class Chunk { public void func_150804_b(boolean parFlag) { if (this.isGapLightingUpdated && !this.worldObj.provider.getHasNoSky() && !parFlag) { - this.recheckGaps(true); + this.recheckGaps(this.worldObj.isRemote); } this.field_150815_m = true; @@ -1120,10 +1134,16 @@ public class Chunk { } - public BiomeGenBase getBiome(BlockPos pos) { + 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 (chunkManager != null && 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; } 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/minecraft/world/chunk/storage/AnvilChunkLoader.java similarity index 85% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/AnvilChunkLoader.java rename to src/main/java/net/minecraft/world/chunk/storage/AnvilChunkLoader.java index 880f4c43..432afa3d 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/AnvilChunkLoader.java +++ b/src/main/java/net/minecraft/world/chunk/storage/AnvilChunkLoader.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage; +package net.minecraft.world.chunk.storage; import java.io.DataInputStream; import java.io.DataOutput; @@ -9,28 +9,26 @@ 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.block.Block; +import net.minecraft.entity.Entity; +import 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.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.NextTickListEntry; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.NibbleArray; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; +import 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. * @@ -53,10 +51,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public abstract class AnvilChunkLoader implements IChunkLoader { - static { - __checkIntegratedContextValid("net/minecraft/world/chunk/storage/AnvilChunkLoader"); - } - private static final Logger logger = LogManager.getLogger("AnvilChunkLoader"); /**+ 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/minecraft/world/chunk/storage/ChunkLoader.java similarity index 86% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/ChunkLoader.java rename to src/main/java/net/minecraft/world/chunk/storage/ChunkLoader.java index addfe437..7dd6b9ca 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/ChunkLoader.java +++ b/src/main/java/net/minecraft/world/chunk/storage/ChunkLoader.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage; +package 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; +import net.minecraft.util.BlockPos; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.NibbleArray; +import net.minecraft.world.chunk.storage.NibbleArrayReader; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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"); 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/minecraft/world/chunk/storage/IChunkLoader.java similarity index 81% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/IChunkLoader.java rename to src/main/java/net/minecraft/world/chunk/storage/IChunkLoader.java index a82c75a0..7edb3e5b 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/IChunkLoader.java +++ b/src/main/java/net/minecraft/world/chunk/storage/IChunkLoader.java @@ -1,9 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage; +package 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; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. 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/minecraft/world/chunk/storage/RegionFile.java similarity index 95% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/RegionFile.java rename to src/main/java/net/minecraft/world/chunk/storage/RegionFile.java index c2ef2956..4c60e642 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/chunk/storage/RegionFile.java +++ b/src/main/java/net/minecraft/world/chunk/storage/RegionFile.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.chunk.storage; +package net.minecraft.world.chunk.storage; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; 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/minecraft/world/demo/DemoWorldManager.java similarity index 78% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/demo/DemoWorldManager.java rename to src/main/java/net/minecraft/world/demo/DemoWorldManager.java index ecae97c0..6d96d47e 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/demo/DemoWorldManager.java +++ b/src/main/java/net/minecraft/world/demo/DemoWorldManager.java @@ -1,15 +1,13 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.demo; +package 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; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.server.management.ItemInWorldManager; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -33,10 +31,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; diff --git a/src/main/java/net/minecraft/world/demo/DemoWorldServer.java b/src/main/java/net/minecraft/world/demo/DemoWorldServer.java index ad5213e7..f208b2f8 100755 --- a/src/main/java/net/minecraft/world/demo/DemoWorldServer.java +++ b/src/main/java/net/minecraft/world/demo/DemoWorldServer.java @@ -1,8 +1,14 @@ package net.minecraft.world.demo; -import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; +import net.minecraft.profiler.Profiler; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldServer; import net.minecraft.world.WorldSettings; import net.minecraft.world.WorldType; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.WorldInfo; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -24,8 +30,15 @@ import net.minecraft.world.WorldType; * POSSIBILITY OF SUCH DAMAGE. * */ -public class DemoWorldServer { +public class DemoWorldServer extends WorldServer { + 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/minecraft/world/gen/ChunkProviderDebug.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderDebug.java rename to src/main/java/net/minecraft/world/gen/ChunkProviderDebug.java index 25cb1bf8..f14519fd 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderDebug.java +++ b/src/main/java/net/minecraft/world/gen/ChunkProviderDebug.java @@ -1,21 +1,19 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.chunk.IChunkProvider; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -39,10 +37,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/world/gen/ChunkProviderEnd.java similarity index 84% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderEnd.java rename to src/main/java/net/minecraft/world/gen/ChunkProviderEnd.java index 4a83883e..4772e8e8 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderEnd.java +++ b/src/main/java/net/minecraft/world/gen/ChunkProviderEnd.java @@ -1,23 +1,21 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; +package 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; +import net.minecraft.block.BlockFalling; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.NoiseGeneratorOctaves; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -41,10 +39,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class ChunkProviderEnd implements IChunkProvider { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/ChunkProviderEnd"); - } - private EaglercraftRandom endRNG; private NoiseGeneratorOctaves noiseGen1; private NoiseGeneratorOctaves noiseGen2; 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/minecraft/world/gen/ChunkProviderFlat.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderFlat.java rename to src/main/java/net/minecraft/world/gen/ChunkProviderFlat.java index c7e7f8eb..ee39de0a 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderFlat.java +++ b/src/main/java/net/minecraft/world/gen/ChunkProviderFlat.java @@ -1,33 +1,31 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; +package 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; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.FlatGeneratorInfo; +import net.minecraft.world.gen.FlatLayerInfo; +import net.minecraft.world.gen.MapGenBase; +import net.minecraft.world.gen.feature.WorldGenDungeons; +import net.minecraft.world.gen.feature.WorldGenLakes; +import net.minecraft.world.gen.structure.MapGenMineshaft; +import net.minecraft.world.gen.structure.MapGenScatteredFeature; +import net.minecraft.world.gen.structure.MapGenStronghold; +import net.minecraft.world.gen.structure.MapGenStructure; +import net.minecraft.world.gen.structure.MapGenVillage; +import net.minecraft.world.gen.structure.StructureOceanMonument; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -51,10 +49,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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]; 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/minecraft/world/gen/ChunkProviderGenerate.java similarity index 84% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderGenerate.java rename to src/main/java/net/minecraft/world/gen/ChunkProviderGenerate.java index fed2a095..8b69b88f 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderGenerate.java +++ b/src/main/java/net/minecraft/world/gen/ChunkProviderGenerate.java @@ -1,37 +1,35 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFalling; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.SpawnerAnimals; +import net.minecraft.world.World; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderSettings; +import net.minecraft.world.gen.MapGenBase; +import net.minecraft.world.gen.MapGenCaves; +import net.minecraft.world.gen.MapGenRavine; +import net.minecraft.world.gen.NoiseGeneratorOctaves; +import net.minecraft.world.gen.NoiseGeneratorPerlin; +import net.minecraft.world.gen.feature.WorldGenDungeons; +import net.minecraft.world.gen.feature.WorldGenLakes; +import net.minecraft.world.gen.structure.MapGenMineshaft; +import net.minecraft.world.gen.structure.MapGenScatteredFeature; +import net.minecraft.world.gen.structure.MapGenStronghold; +import net.minecraft.world.gen.structure.MapGenVillage; +import net.minecraft.world.gen.structure.StructureOceanMonument; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -55,10 +53,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/world/gen/ChunkProviderHell.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderHell.java rename to src/main/java/net/minecraft/world/gen/ChunkProviderHell.java index 9dec50ae..fa55d5df 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderHell.java +++ b/src/main/java/net/minecraft/world/gen/ChunkProviderHell.java @@ -1,35 +1,33 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; +package 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; +import net.minecraft.block.BlockFalling; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockHelper; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.GeneratorBushFeature; +import net.minecraft.world.gen.MapGenBase; +import net.minecraft.world.gen.MapGenCavesHell; +import net.minecraft.world.gen.NoiseGeneratorOctaves; +import net.minecraft.world.gen.feature.WorldGenFire; +import net.minecraft.world.gen.feature.WorldGenGlowStone1; +import net.minecraft.world.gen.feature.WorldGenGlowStone2; +import net.minecraft.world.gen.feature.WorldGenHellLava; +import net.minecraft.world.gen.feature.WorldGenMinable; +import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraft.world.gen.structure.MapGenNetherBridge; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -53,10 +51,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/world/gen/ChunkProviderServer.java similarity index 84% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderServer.java rename to src/main/java/net/minecraft/world/gen/ChunkProviderServer.java index a389eb96..8c38d921 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/world/gen/ChunkProviderServer.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; +package net.minecraft.world.gen; import com.google.common.collect.Lists; import java.io.IOException; @@ -10,26 +10,24 @@ 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.minecraft.entity.EnumCreatureType; +import net.minecraft.util.BlockPos; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.LongHashMap; +import net.minecraft.util.ReportedException; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.EmptyChunk; +import net.minecraft.world.chunk.IChunkProvider; +import 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. * @@ -52,10 +50,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/world/gen/GeneratorBushFeature.java similarity index 73% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/GeneratorBushFeature.java rename to src/main/java/net/minecraft/world/gen/GeneratorBushFeature.java index 426add0e..666d8e75 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/GeneratorBushFeature.java +++ b/src/main/java/net/minecraft/world/gen/GeneratorBushFeature.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; +package 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; +import net.minecraft.block.BlockBush; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GeneratorBushFeature extends WorldGenerator { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/GeneratorBushFeature"); - } - private BlockBush field_175908_a; public GeneratorBushFeature(BlockBush parBlockBush) { 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/minecraft/world/gen/MapGenBase.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenBase.java rename to src/main/java/net/minecraft/world/gen/MapGenBase.java index 416edbd8..1d581a26 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenBase.java +++ b/src/main/java/net/minecraft/world/gen/MapGenBase.java @@ -1,11 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; +package 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; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.chunk.IChunkProvider; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +27,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class MapGenBase { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/MapGenBase"); - } - /**+ * The number of Chunks to gen-check in any given direction. */ 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/minecraft/world/gen/MapGenCaves.java similarity index 88% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenCaves.java rename to src/main/java/net/minecraft/world/gen/MapGenCaves.java index 84ad37ad..e3f12c05 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenCaves.java +++ b/src/main/java/net/minecraft/world/gen/MapGenCaves.java @@ -1,18 +1,16 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; +package 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; +import net.minecraft.block.BlockSand; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.MapGenBase; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -36,10 +34,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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, 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/minecraft/world/gen/MapGenCavesHell.java similarity index 87% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenCavesHell.java rename to src/main/java/net/minecraft/world/gen/MapGenCavesHell.java index 4910aae4..b27c04e4 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenCavesHell.java +++ b/src/main/java/net/minecraft/world/gen/MapGenCavesHell.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; +package 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; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.MapGenBase; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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, 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/minecraft/world/gen/MapGenRavine.java similarity index 86% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenRavine.java rename to src/main/java/net/minecraft/world/gen/MapGenRavine.java index f9370e79..731329e6 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/MapGenRavine.java +++ b/src/main/java/net/minecraft/world/gen/MapGenRavine.java @@ -1,15 +1,13 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen; +package 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; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.MapGenBase; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -33,10 +31,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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, 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/minecraft/world/gen/feature/WorldGenAbstractTree.java similarity index 69% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenAbstractTree.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenAbstractTree.java index 6583055d..c9e4d886 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenAbstractTree.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenAbstractTree.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public abstract class WorldGenAbstractTree extends WorldGenerator { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenAbstractTree"); - } - public WorldGenAbstractTree(boolean parFlag) { super(parFlag); } 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/minecraft/world/gen/feature/WorldGenBigMushroom.java similarity index 84% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenBigMushroom.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenBigMushroom.java index 5c1361fb..40d436dc 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenBigMushroom.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenBigMushroom.java @@ -1,15 +1,13 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockHugeMushroom; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -33,10 +31,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WorldGenBigMushroom extends WorldGenerator { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenBigMushroom"); - } - private Block mushroomType; public WorldGenBigMushroom(Block parBlock) { 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/minecraft/world/gen/feature/WorldGenBigTree.java similarity index 87% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenBigTree.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenBigTree.java index 62438a3c..18d16188 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenBigTree.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenBigTree.java @@ -1,20 +1,18 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockLog; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -38,10 +36,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WorldGenBigTree extends WorldGenAbstractTree { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenBigTree"); - } - private EaglercraftRandom rand; private World world; private BlockPos basePos = BlockPos.ORIGIN; 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/minecraft/world/gen/feature/WorldGenBlockBlob.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenBlockBlob.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenBlockBlob.java index 43d0481b..789e7240 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenBlockBlob.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenBlockBlob.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,10 +29,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/world/gen/feature/WorldGenCactus.java similarity index 72% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenCactus.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenCactus.java index 888c2002..899c75f0 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenCactus.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenCactus.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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), 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/minecraft/world/gen/feature/WorldGenCanopyTree.java similarity index 80% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenCanopyTree.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenCanopyTree.java index f0f233a9..e825e9ea 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenCanopyTree.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenCanopyTree.java @@ -1,20 +1,18 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockNewLeaf; +import net.minecraft.block.BlockNewLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -38,10 +36,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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() 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/minecraft/world/gen/feature/WorldGenClay.java similarity index 72% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenClay.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenClay.java index daeed545..cdf1d1b2 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenClay.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenClay.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WorldGenClay extends WorldGenerator { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenClay"); - } - private Block field_150546_a = Blocks.clay; private int numberOfBlocks; 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/minecraft/world/gen/feature/WorldGenDeadBush.java similarity index 69% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDeadBush.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenDeadBush.java index fd7e29f9..fce64a8a 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDeadBush.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenDeadBush.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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 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/minecraft/world/gen/feature/WorldGenDesertWells.java similarity index 74% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDesertWells.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenDesertWells.java index 590de60d..c5b22100 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDesertWells.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenDesertWells.java @@ -1,19 +1,17 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.BlockSand; +import net.minecraft.block.BlockSlab; +import net.minecraft.block.BlockStoneSlab; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockStateHelper; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -37,10 +35,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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() 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/minecraft/world/gen/feature/WorldGenDoublePlant.java similarity index 71% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDoublePlant.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenDoublePlant.java index 8b3ca1d4..b92bf623 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDoublePlant.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenDoublePlant.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,10 +29,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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) { 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/minecraft/world/gen/feature/WorldGenDungeons.java similarity index 81% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDungeons.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenDungeons.java index fc9dd73a..29a872ea 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenDungeons.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenDungeons.java @@ -1,24 +1,22 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import 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. * @@ -41,10 +39,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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 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/minecraft/world/gen/feature/WorldGenFire.java similarity index 71% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenFire.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenFire.java index 5de151b7..9022a4f7 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenFire.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenFire.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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), 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/minecraft/world/gen/feature/WorldGenFlowers.java similarity index 73% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenFlowers.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenFlowers.java index bfa5da29..5c75b633 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenFlowers.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenFlowers.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,10 +29,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WorldGenFlowers extends WorldGenerator { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenFlowers"); - } - private BlockFlower flower; private IBlockState field_175915_b; 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/minecraft/world/gen/feature/WorldGenForest.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenForest.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenForest.java index 8596ebdd..6509cfe7 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenForest.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenForest.java @@ -1,18 +1,16 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockOldLeaf; +import net.minecraft.block.BlockOldLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -36,10 +34,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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() 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/minecraft/world/gen/feature/WorldGenGlowStone1.java similarity index 71% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenGlowStone1.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenGlowStone1.java index 6508e889..16cc9202 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenGlowStone1.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenGlowStone1.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/world/gen/feature/WorldGenGlowStone2.java similarity index 71% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenGlowStone2.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenGlowStone2.java index f950a1b6..3d338b28 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenGlowStone2.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenGlowStone2.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/world/gen/feature/WorldGenHellLava.java similarity index 75% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenHellLava.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenHellLava.java index a407f0f3..8e600f5d 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenHellLava.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenHellLava.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/world/gen/feature/WorldGenHugeTrees.java similarity index 81% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenHugeTrees.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenHugeTrees.java index 66fd7b50..b3d841f3 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenHugeTrees.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenHugeTrees.java @@ -1,15 +1,13 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -33,10 +31,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/world/gen/feature/WorldGenIcePath.java similarity index 74% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenIcePath.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenIcePath.java index 8460040d..18a2aeb0 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenIcePath.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenIcePath.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,10 +29,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WorldGenIcePath extends WorldGenerator { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenIcePath"); - } - private Block block = Blocks.packed_ice; private int basePathWidth; 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/minecraft/world/gen/feature/WorldGenIceSpike.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenIceSpike.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenIceSpike.java index 630d30cf..951e5139 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenIceSpike.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenIceSpike.java @@ -1,15 +1,13 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -33,10 +31,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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(); 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/minecraft/world/gen/feature/WorldGenLakes.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenLakes.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenLakes.java index c7fe7599..1b198d0f 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenLakes.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenLakes.java @@ -1,16 +1,14 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -34,10 +32,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WorldGenLakes extends WorldGenerator { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenLakes"); - } - private Block block; public WorldGenLakes(Block blockIn) { 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/minecraft/world/gen/feature/WorldGenLiquids.java similarity index 73% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenLiquids.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenLiquids.java index 6369da51..34a1d81b 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenLiquids.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenLiquids.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WorldGenLiquids extends WorldGenerator { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenLiquids"); - } - private Block block; public WorldGenLiquids(Block parBlock) { 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/minecraft/world/gen/feature/WorldGenMegaJungle.java similarity index 80% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMegaJungle.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenMegaJungle.java index f2500323..46d113a3 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMegaJungle.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenMegaJungle.java @@ -1,16 +1,14 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.BlockVine; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenHugeTrees; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -34,10 +32,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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); 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/minecraft/world/gen/feature/WorldGenMegaPineTree.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java index 77ba770e..2dc3e231 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java @@ -1,21 +1,19 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockOldLeaf; +import net.minecraft.block.BlockOldLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenHugeTrees; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -39,10 +37,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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() 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/minecraft/world/gen/feature/WorldGenMelon.java similarity index 71% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMelon.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenMelon.java index 103e7b1a..d04dccf1 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMelon.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenMelon.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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), 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/minecraft/world/gen/feature/WorldGenMinable.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMinable.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenMinable.java index 55c36f2e..0da39c76 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenMinable.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenMinable.java @@ -1,16 +1,14 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockHelper; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -34,10 +32,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/world/gen/feature/WorldGenPumpkin.java similarity index 68% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenPumpkin.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenPumpkin.java index 585d60a4..2854464f 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenPumpkin.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenPumpkin.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.BlockPumpkin; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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), 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/minecraft/world/gen/feature/WorldGenReed.java similarity index 73% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenReed.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenReed.java index 0d4c9662..34e48d7d 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenReed.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenReed.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,10 +29,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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, 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/minecraft/world/gen/feature/WorldGenSand.java similarity index 72% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSand.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenSand.java index 3f9df0c4..e6e168f5 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSand.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenSand.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WorldGenSand extends WorldGenerator { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenSand"); - } - private Block block; private int radius; 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/minecraft/world/gen/feature/WorldGenSavannaTree.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSavannaTree.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenSavannaTree.java index 3e545758..986696ca 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSavannaTree.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenSavannaTree.java @@ -1,20 +1,18 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockNewLeaf; +import net.minecraft.block.BlockNewLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -38,10 +36,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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() 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/minecraft/world/gen/feature/WorldGenShrub.java similarity index 73% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenShrub.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenShrub.java index f03c7246..9b0caebd 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenShrub.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenShrub.java @@ -1,15 +1,13 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenTrees; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -33,10 +31,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WorldGenShrub extends WorldGenTrees { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenShrub"); - } - private final IBlockState leavesMetadata; private final IBlockState woodMetadata; 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/minecraft/world/gen/feature/WorldGenSpikes.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSpikes.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenSpikes.java index 60b1cf28..bb65b23b 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSpikes.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenSpikes.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WorldGenSpikes extends WorldGenerator { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenSpikes"); - } - private Block baseBlockRequired; public WorldGenSpikes(Block parBlock) { 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/minecraft/world/gen/feature/WorldGenSwamp.java similarity index 80% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSwamp.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenSwamp.java index 45cae41a..2db68d85 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenSwamp.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenSwamp.java @@ -1,20 +1,18 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockOldLeaf; +import net.minecraft.block.BlockOldLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.BlockVine; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -38,10 +36,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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() 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/minecraft/world/gen/feature/WorldGenTaiga1.java similarity index 74% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTaiga1.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenTaiga1.java index 8f50d1c7..e81c2c31 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTaiga1.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenTaiga1.java @@ -1,19 +1,17 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockOldLeaf; +import net.minecraft.block.BlockOldLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -37,10 +35,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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() 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/minecraft/world/gen/feature/WorldGenTaiga2.java similarity index 75% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTaiga2.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenTaiga2.java index cd7d5717..c4a4e35b 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTaiga2.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenTaiga2.java @@ -1,19 +1,17 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockOldLeaf; +import net.minecraft.block.BlockOldLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -37,10 +35,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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() 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/minecraft/world/gen/feature/WorldGenTallGrass.java similarity index 66% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTallGrass.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenTallGrass.java index 3b8b55ee..a4540a35 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTallGrass.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenTallGrass.java @@ -1,16 +1,14 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -34,10 +32,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WorldGenTallGrass extends WorldGenerator { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenTallGrass"); - } - private final IBlockState tallGrassState; public WorldGenTallGrass(BlockTallGrass.EnumType parEnumType) { 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/minecraft/world/gen/feature/WorldGenTrees.java similarity index 82% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTrees.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenTrees.java index 69ef29e8..6db0782c 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenTrees.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenTrees.java @@ -1,23 +1,21 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockCocoa; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockOldLeaf; +import net.minecraft.block.BlockOldLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.BlockVine; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -41,10 +39,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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() 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/minecraft/world/gen/feature/WorldGenVines.java similarity index 69% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenVines.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenVines.java index aaddf96e..8e7396ba 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenVines.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenVines.java @@ -1,15 +1,13 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.BlockVine; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -33,10 +31,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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)) { 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/minecraft/world/gen/feature/WorldGenWaterlily.java similarity index 72% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenWaterlily.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenWaterlily.java index 2ed8f8a3..98d6fee9 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenWaterlily.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenWaterlily.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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); 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/minecraft/world/gen/feature/WorldGenerator.java similarity index 73% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenerator.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGenerator.java index c61748ee..a75871d4 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGenerator.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGenerator.java @@ -1,11 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +27,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public abstract class WorldGenerator { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGenerator"); - } - private final boolean doBlockNotify; public WorldGenerator() { 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/minecraft/world/gen/feature/WorldGeneratorBonusChest.java similarity index 74% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java rename to src/main/java/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java index 3a976a43..a5113104 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java +++ b/src/main/java/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java @@ -1,18 +1,16 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.feature; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.BlockPos; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -36,10 +34,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WorldGeneratorBonusChest extends WorldGenerator { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/feature/WorldGeneratorBonusChest"); - } - private final List chestItems; private final int itemsToGenerateInBonusChest; 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/minecraft/world/gen/layer/GenLayer.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayer.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayer.java index 221534bf..18bd49df 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayer.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayer.java @@ -1,33 +1,31 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.util.ReportedException; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.ChunkProviderSettings; +import net.minecraft.world.gen.layer.GenLayerAddIsland; +import net.minecraft.world.gen.layer.GenLayerAddMushroomIsland; +import net.minecraft.world.gen.layer.GenLayerAddSnow; +import net.minecraft.world.gen.layer.GenLayerBiome; +import net.minecraft.world.gen.layer.GenLayerBiomeEdge; +import net.minecraft.world.gen.layer.GenLayerDeepOcean; +import net.minecraft.world.gen.layer.GenLayerEdge; +import net.minecraft.world.gen.layer.GenLayerFuzzyZoom; +import net.minecraft.world.gen.layer.GenLayerHills; +import net.minecraft.world.gen.layer.GenLayerIsland; +import net.minecraft.world.gen.layer.GenLayerRareBiome; +import net.minecraft.world.gen.layer.GenLayerRemoveTooMuchOcean; +import net.minecraft.world.gen.layer.GenLayerRiver; +import net.minecraft.world.gen.layer.GenLayerRiverInit; +import net.minecraft.world.gen.layer.GenLayerRiverMix; +import net.minecraft.world.gen.layer.GenLayerShore; +import net.minecraft.world.gen.layer.GenLayerSmooth; +import net.minecraft.world.gen.layer.GenLayerVoronoiZoom; +import net.minecraft.world.gen.layer.GenLayerZoom; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -51,10 +49,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public abstract class GenLayer { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayer"); - } - private long worldGenSeed; protected GenLayer parent; private long chunkSeed; 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/minecraft/world/gen/layer/GenLayerAddIsland.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerAddIsland.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerAddIsland.java index 185253c8..588cfa9b 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerAddIsland.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerAddIsland.java @@ -1,9 +1,7 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -27,10 +25,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GenLayerAddIsland extends GenLayer { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerAddIsland"); - } - public GenLayerAddIsland(long parLong1, GenLayer parGenLayer) { super(parLong1); this.parent = parGenLayer; 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/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java similarity index 78% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java index 671ab17f..c4e0abe3 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GenLayerAddMushroomIsland extends GenLayer { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerAddMushroomIsland"); - } - public GenLayerAddMushroomIsland(long parLong1, GenLayer parGenLayer) { super(parLong1); this.parent = parGenLayer; 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/minecraft/world/gen/layer/GenLayerAddSnow.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerAddSnow.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerAddSnow.java index 011e239a..a020ef79 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerAddSnow.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerAddSnow.java @@ -1,9 +1,7 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -27,10 +25,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GenLayerAddSnow extends GenLayer { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerAddSnow"); - } - public GenLayerAddSnow(long parLong1, GenLayer parGenLayer) { super(parLong1); this.parent = parGenLayer; 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/minecraft/world/gen/layer/GenLayerBiome.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerBiome.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerBiome.java index 75f93b50..58a315ec 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerBiome.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerBiome.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.ChunkProviderSettings; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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, 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/minecraft/world/gen/layer/GenLayerBiomeEdge.java similarity index 90% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerBiomeEdge.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerBiomeEdge.java index 669e7aed..c6f53c81 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerBiomeEdge.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerBiomeEdge.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GenLayerBiomeEdge extends GenLayer { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerBiomeEdge"); - } - public GenLayerBiomeEdge(long parLong1, GenLayer parGenLayer) { super(parLong1); this.parent = parGenLayer; 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/minecraft/world/gen/layer/GenLayerDeepOcean.java similarity index 79% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerDeepOcean.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerDeepOcean.java index bcd7e2cc..a4c9ebb3 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerDeepOcean.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerDeepOcean.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GenLayerDeepOcean extends GenLayer { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerDeepOcean"); - } - public GenLayerDeepOcean(long parLong1, GenLayer parGenLayer) { super(parLong1); this.parent = parGenLayer; 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/minecraft/world/gen/layer/GenLayerEdge.java similarity index 87% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerEdge.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerEdge.java index 7fd8004d..3497ab17 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerEdge.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerEdge.java @@ -1,9 +1,7 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -27,10 +25,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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) { 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/minecraft/world/gen/layer/GenLayerFuzzyZoom.java similarity index 74% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.java index de1158db..792249f5 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.java @@ -1,9 +1,7 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.GenLayerZoom; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -27,10 +25,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GenLayerFuzzyZoom extends GenLayerZoom { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerFuzzyZoom"); - } - public GenLayerFuzzyZoom(long parLong1, GenLayer parGenLayer) { super(parLong1, parGenLayer); } 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/minecraft/world/gen/layer/GenLayerHills.java similarity index 87% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerHills.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerHills.java index b03e4718..1f1ade69 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerHills.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerHills.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.layer.GenLayer; +import 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. * @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/world/gen/layer/GenLayerIsland.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerIsland.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerIsland.java index dbebc2d6..7d721d7f 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerIsland.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerIsland.java @@ -1,9 +1,7 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -27,10 +25,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GenLayerIsland extends GenLayer { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerIsland"); - } - public GenLayerIsland(long parLong1) { super(parLong1); } 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/minecraft/world/gen/layer/GenLayerRareBiome.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRareBiome.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerRareBiome.java index 161e9716..cb4c14d0 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRareBiome.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerRareBiome.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GenLayerRareBiome extends GenLayer { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerRareBiome"); - } - public GenLayerRareBiome(long parLong1, GenLayer parGenLayer) { super(parLong1); this.parent = parGenLayer; 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/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java similarity index 80% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java index 794e5ead..f2053f2a 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java @@ -1,9 +1,7 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -27,10 +25,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GenLayerRemoveTooMuchOcean extends GenLayer { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean"); - } - public GenLayerRemoveTooMuchOcean(long parLong1, GenLayer parGenLayer) { super(parLong1); this.parent = parGenLayer; 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/minecraft/world/gen/layer/GenLayerRiver.java similarity index 78% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRiver.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerRiver.java index 6fd2b858..cfead437 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRiver.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerRiver.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GenLayerRiver extends GenLayer { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerRiver"); - } - public GenLayerRiver(long parLong1, GenLayer parGenLayer) { super(parLong1); super.parent = parGenLayer; 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/minecraft/world/gen/layer/GenLayerRiverInit.java similarity index 77% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRiverInit.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerRiverInit.java index 29065ce3..62dc925d 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRiverInit.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerRiverInit.java @@ -1,9 +1,7 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -27,10 +25,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GenLayerRiverInit extends GenLayer { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerRiverInit"); - } - public GenLayerRiverInit(long parLong1, GenLayer parGenLayer) { super(parLong1); this.parent = parGenLayer; 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/minecraft/world/gen/layer/GenLayerRiverMix.java similarity index 81% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRiverMix.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerRiverMix.java index eedcaa60..67153e60 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerRiverMix.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerRiverMix.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -28,10 +26,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GenLayerRiverMix extends GenLayer { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerRiverMix"); - } - private GenLayer biomePatternGeneratorChain; private GenLayer riverPatternGeneratorChain; 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/minecraft/world/gen/layer/GenLayerShore.java similarity index 87% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerShore.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerShore.java index d3608b22..109a049f 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerShore.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerShore.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.BiomeGenJungle; +import net.minecraft.world.biome.BiomeGenMesa; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GenLayerShore extends GenLayer { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerShore"); - } - public GenLayerShore(long parLong1, GenLayer parGenLayer) { super(parLong1); this.parent = parGenLayer; 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/minecraft/world/gen/layer/GenLayerSmooth.java similarity index 80% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerSmooth.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerSmooth.java index 0f16c36b..db48494b 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerSmooth.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerSmooth.java @@ -1,9 +1,7 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -27,10 +25,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GenLayerSmooth extends GenLayer { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerSmooth"); - } - public GenLayerSmooth(long parLong1, GenLayer parGenLayer) { super(parLong1); super.parent = parGenLayer; 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/minecraft/world/gen/layer/GenLayerVoronoiZoom.java similarity index 87% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.java index 8a15e478..92f8d747 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.java @@ -1,9 +1,7 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -27,10 +25,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GenLayerVoronoiZoom extends GenLayer { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerVoronoiZoom"); - } - public GenLayerVoronoiZoom(long parLong1, GenLayer parGenLayer) { super(parLong1); super.parent = parGenLayer; 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/minecraft/world/gen/layer/GenLayerZoom.java similarity index 83% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerZoom.java rename to src/main/java/net/minecraft/world/gen/layer/GenLayerZoom.java index 646a5a98..45756971 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/GenLayerZoom.java +++ b/src/main/java/net/minecraft/world/gen/layer/GenLayerZoom.java @@ -1,9 +1,7 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -27,10 +25,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class GenLayerZoom extends GenLayer { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/layer/GenLayerZoom"); - } - public GenLayerZoom(long parLong1, GenLayer parGenLayer) { super(parLong1); super.parent = parGenLayer; 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/minecraft/world/gen/layer/IntCache.java similarity index 90% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/IntCache.java rename to src/main/java/net/minecraft/world/gen/layer/IntCache.java index f78383c2..c4bdbc98 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/layer/IntCache.java +++ b/src/main/java/net/minecraft/world/gen/layer/IntCache.java @@ -1,10 +1,8 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.layer; +package 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. * @@ -27,10 +25,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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 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/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java similarity index 94% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java rename to src/main/java/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java index e7b85a7e..be5801e5 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java +++ b/src/main/java/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java @@ -1,31 +1,29 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package 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.block.BlockFlowerPot; +import net.minecraft.block.BlockLever; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.BlockSandStone; +import net.minecraft.block.BlockStoneBrick; +import net.minecraft.block.BlockStoneSlab; +import net.minecraft.block.BlockTripWire; +import net.minecraft.block.BlockTripWireHook; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import 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; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -49,10 +47,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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"); 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/minecraft/world/gen/structure/MapGenMineshaft.java similarity index 72% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenMineshaft.java rename to src/main/java/net/minecraft/world/gen/structure/MapGenMineshaft.java index 5aafb756..5776eda0 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenMineshaft.java +++ b/src/main/java/net/minecraft/world/gen/structure/MapGenMineshaft.java @@ -1,13 +1,11 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package 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; +import net.minecraft.util.MathHelper; +import net.minecraft.world.gen.structure.MapGenStructure; +import net.minecraft.world.gen.structure.StructureMineshaftStart; +import net.minecraft.world.gen.structure.StructureStart; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -31,10 +29,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class MapGenMineshaft extends MapGenStructure { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/structure/MapGenMineshaft"); - } - private double field_82673_e = 0.004D; public MapGenMineshaft() { 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/minecraft/world/gen/structure/MapGenNetherBridge.java similarity index 70% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenNetherBridge.java rename to src/main/java/net/minecraft/world/gen/structure/MapGenNetherBridge.java index 855eb772..6b447c89 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenNetherBridge.java +++ b/src/main/java/net/minecraft/world/gen/structure/MapGenNetherBridge.java @@ -1,20 +1,18 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package 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; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.structure.MapGenStructure; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureNetherBridgePieces; +import net.minecraft.world.gen.structure.StructureStart; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -38,10 +36,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class MapGenNetherBridge extends MapGenStructure { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/structure/MapGenNetherBridge"); - } - private List spawnList = Lists.newArrayList(); public MapGenNetherBridge() { 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/minecraft/world/gen/structure/MapGenScatteredFeature.java similarity index 81% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenScatteredFeature.java rename to src/main/java/net/minecraft/world/gen/structure/MapGenScatteredFeature.java index 84b51795..944b858f 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenScatteredFeature.java +++ b/src/main/java/net/minecraft/world/gen/structure/MapGenScatteredFeature.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package net.minecraft.world.gen.structure; import com.google.common.collect.Lists; import java.util.Arrays; @@ -6,17 +6,15 @@ 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; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.structure.ComponentScatteredFeaturePieces; +import net.minecraft.world.gen.structure.MapGenStructure; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureStart; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -40,10 +38,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; 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/minecraft/world/gen/structure/MapGenStronghold.java similarity index 81% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStronghold.java rename to src/main/java/net/minecraft/world/gen/structure/MapGenStronghold.java index 2089e56d..b4ff6e78 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStronghold.java +++ b/src/main/java/net/minecraft/world/gen/structure/MapGenStronghold.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package net.minecraft.world.gen.structure; import com.google.common.collect.Lists; import java.util.ArrayList; @@ -6,17 +6,15 @@ 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; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.structure.MapGenStructure; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureStart; +import net.minecraft.world.gen.structure.StructureStrongholdPieces; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -40,10 +38,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class MapGenStronghold extends MapGenStructure { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/structure/MapGenStronghold"); - } - private List field_151546_e; private boolean ranBiomeCheck; private ChunkCoordIntPair[] structureCoords; 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/minecraft/world/gen/structure/MapGenStructure.java similarity index 82% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStructure.java rename to src/main/java/net/minecraft/world/gen/structure/MapGenStructure.java index f466549d..5ab7f952 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStructure.java +++ b/src/main/java/net/minecraft/world/gen/structure/MapGenStructure.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package net.minecraft.world.gen.structure; import com.google.common.collect.Maps; @@ -13,20 +13,18 @@ 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; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ReportedException; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.MapGenBase; +import net.minecraft.world.gen.structure.MapGenStructureData; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureStart; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -50,10 +48,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public abstract class MapGenStructure extends MapGenBase { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/structure/MapGenStructure"); - } - private MapGenStructureData structureData; protected Map structureMap = Maps.newHashMap(); 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/minecraft/world/gen/structure/MapGenStructureData.java similarity index 82% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStructureData.java rename to src/main/java/net/minecraft/world/gen/structure/MapGenStructureData.java index 6965622c..cf8a44a3 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStructureData.java +++ b/src/main/java/net/minecraft/world/gen/structure/MapGenStructureData.java @@ -1,9 +1,7 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package 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; +import net.minecraft.world.WorldSavedData; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -27,10 +25,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class MapGenStructureData extends WorldSavedData { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/structure/MapGenStructureData"); - } - private NBTTagCompound tagCompound = new NBTTagCompound(); public MapGenStructureData(String name) { 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/minecraft/world/gen/structure/MapGenStructureIO.java similarity index 69% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStructureIO.java rename to src/main/java/net/minecraft/world/gen/structure/MapGenStructureIO.java index 6c762885..73efc3e8 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenStructureIO.java +++ b/src/main/java/net/minecraft/world/gen/structure/MapGenStructureIO.java @@ -1,28 +1,26 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package 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.minecraft.world.World; +import net.minecraft.world.gen.structure.ComponentScatteredFeaturePieces; +import net.minecraft.world.gen.structure.MapGenNetherBridge; +import net.minecraft.world.gen.structure.MapGenScatteredFeature; +import net.minecraft.world.gen.structure.MapGenStronghold; +import net.minecraft.world.gen.structure.MapGenVillage; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureMineshaftPieces; +import net.minecraft.world.gen.structure.StructureMineshaftStart; +import net.minecraft.world.gen.structure.StructureNetherBridgePieces; +import net.minecraft.world.gen.structure.StructureOceanMonument; +import net.minecraft.world.gen.structure.StructureOceanMonumentPieces; +import net.minecraft.world.gen.structure.StructureStart; +import net.minecraft.world.gen.structure.StructureStrongholdPieces; +import 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. * @@ -45,10 +43,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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(); 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/minecraft/world/gen/structure/MapGenVillage.java similarity index 81% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenVillage.java rename to src/main/java/net/minecraft/world/gen/structure/MapGenVillage.java index d53aaad2..a17c12b4 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/MapGenVillage.java +++ b/src/main/java/net/minecraft/world/gen/structure/MapGenVillage.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package net.minecraft.world.gen.structure; import java.util.Arrays; import java.util.List; @@ -6,15 +6,13 @@ 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; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.structure.MapGenStructure; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureStart; +import net.minecraft.world.gen.structure.StructureVillagePieces; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -38,10 +36,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class MapGenVillage extends MapGenStructure { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/structure/MapGenVillage"); - } - /**+ * A list of all the biomes villages can spawn in. */ 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/minecraft/world/gen/structure/StructureBoundingBox.java similarity index 90% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureBoundingBox.java rename to src/main/java/net/minecraft/world/gen/structure/StructureBoundingBox.java index 1f0bff64..1d836c15 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureBoundingBox.java +++ b/src/main/java/net/minecraft/world/gen/structure/StructureBoundingBox.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package 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; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.Vec3i; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class StructureBoundingBox { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/structure/StructureBoundingBox"); - } - public int minX; public int minY; public int minZ; 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/minecraft/world/gen/structure/StructureComponent.java similarity index 89% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureComponent.java rename to src/main/java/net/minecraft/world/gen/structure/StructureComponent.java index a6263e90..3cdb30d1 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureComponent.java +++ b/src/main/java/net/minecraft/world/gen/structure/StructureComponent.java @@ -1,26 +1,24 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package 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.block.Block; +import net.minecraft.block.BlockDirectional; +import net.minecraft.block.BlockDoor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import 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; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraft.world.gen.structure.StructureBoundingBox; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -44,10 +42,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public abstract class StructureComponent { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/structure/StructureComponent"); - } - protected StructureBoundingBox boundingBox; protected EnumFacing coordBaseMode; protected int componentType; 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/minecraft/world/gen/structure/StructureMineshaftPieces.java similarity index 93% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureMineshaftPieces.java rename to src/main/java/net/minecraft/world/gen/structure/StructureMineshaftPieces.java index 4657d745..4db3e4ba 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureMineshaftPieces.java +++ b/src/main/java/net/minecraft/world/gen/structure/StructureMineshaftPieces.java @@ -1,28 +1,26 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package 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.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.item.EntityMinecartChest; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import 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; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -46,10 +44,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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), 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/minecraft/world/gen/structure/StructureMineshaftStart.java similarity index 73% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureMineshaftStart.java rename to src/main/java/net/minecraft/world/gen/structure/StructureMineshaftStart.java index 06597906..3ba7f36a 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureMineshaftStart.java +++ b/src/main/java/net/minecraft/world/gen/structure/StructureMineshaftStart.java @@ -1,11 +1,9 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package 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; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureMineshaftPieces; +import net.minecraft.world.gen.structure.StructureStart; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -29,10 +27,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class StructureMineshaftStart extends StructureStart { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/structure/StructureMineshaftStart"); - } - public StructureMineshaftStart() { } 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/minecraft/world/gen/structure/StructureNetherBridgePieces.java similarity index 96% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java rename to src/main/java/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java index b7284754..da87d729 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java +++ b/src/main/java/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java @@ -1,23 +1,21 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package 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.init.Blocks; +import net.minecraft.init.Items; +import 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; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -41,10 +39,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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), 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/minecraft/world/gen/structure/StructureOceanMonument.java similarity index 80% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureOceanMonument.java rename to src/main/java/net/minecraft/world/gen/structure/StructureOceanMonument.java index 14f0bf48..c8c69119 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureOceanMonument.java +++ b/src/main/java/net/minecraft/world/gen/structure/StructureOceanMonument.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package net.minecraft.world.gen.structure; import com.google.common.collect.Lists; import com.google.common.collect.Sets; @@ -8,21 +8,19 @@ 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.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; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.structure.MapGenStructure; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureOceanMonumentPieces; +import net.minecraft.world.gen.structure.StructureStart; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -46,10 +44,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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, 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/minecraft/world/gen/structure/StructureOceanMonumentPieces.java similarity index 96% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureOceanMonumentPieces.java rename to src/main/java/net/minecraft/world/gen/structure/StructureOceanMonumentPieces.java index 5c1f48ee..013d1586 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureOceanMonumentPieces.java +++ b/src/main/java/net/minecraft/world/gen/structure/StructureOceanMonumentPieces.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package net.minecraft.world.gen.structure; import com.google.common.collect.Lists; import java.util.ArrayList; @@ -8,21 +8,19 @@ 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.block.BlockPrismarine; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.monster.EntityGuardian; +import 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; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -46,10 +44,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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"); 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/minecraft/world/gen/structure/StructureStart.java similarity index 84% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureStart.java rename to src/main/java/net/minecraft/world/gen/structure/StructureStart.java index 8b90ebd5..eccc1e17 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureStart.java +++ b/src/main/java/net/minecraft/world/gen/structure/StructureStart.java @@ -1,17 +1,15 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package 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; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -35,10 +33,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public abstract class StructureStart { - static { - __checkIntegratedContextValid("net/minecraft/world/gen/structure/StructureStart"); - } - /**+ * List of all StructureComponents that are part of this * structure 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/minecraft/world/gen/structure/StructureStrongholdPieces.java similarity index 96% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureStrongholdPieces.java rename to src/main/java/net/minecraft/world/gen/structure/StructureStrongholdPieces.java index 58d5028a..8b885aa5 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureStrongholdPieces.java +++ b/src/main/java/net/minecraft/world/gen/structure/StructureStrongholdPieces.java @@ -1,26 +1,24 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package 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.block.BlockEndPortalFrame; +import net.minecraft.block.BlockSilverfish; +import net.minecraft.block.BlockStoneBrick; +import net.minecraft.block.BlockStoneSlab; +import net.minecraft.init.Blocks; +import 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; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -44,10 +42,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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), 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/minecraft/world/gen/structure/StructureVillagePieces.java similarity index 95% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureVillagePieces.java rename to src/main/java/net/minecraft/world/gen/structure/StructureVillagePieces.java index 98c674a6..71f241ff 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/gen/structure/StructureVillagePieces.java +++ b/src/main/java/net/minecraft/world/gen/structure/StructureVillagePieces.java @@ -1,36 +1,34 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.gen.structure; +package 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.block.Block; +import net.minecraft.block.BlockSandStone; +import net.minecraft.block.BlockStairs; +import net.minecraft.block.BlockTorch; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import 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; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraft.world.gen.structure.MapGenVillage; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -54,10 +52,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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"); 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/minecraft/world/pathfinder/NodeProcessor.java similarity index 76% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/pathfinder/NodeProcessor.java rename to src/main/java/net/minecraft/world/pathfinder/NodeProcessor.java index c669e62a..f488d0e3 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/pathfinder/NodeProcessor.java +++ b/src/main/java/net/minecraft/world/pathfinder/NodeProcessor.java @@ -1,12 +1,10 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.pathfinder; +package 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; +import net.minecraft.entity.Entity; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.IntHashMap; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -30,10 +28,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public abstract class NodeProcessor { - static { - __checkIntegratedContextValid("net/minecraft/world/pathfinder/NodeProcessor"); - } - protected IBlockAccess blockaccess; protected IntHashMap pointMap = new IntHashMap(); protected int entitySizeX; 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/minecraft/world/pathfinder/SwimNodeProcessor.java similarity index 75% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/pathfinder/SwimNodeProcessor.java rename to src/main/java/net/minecraft/world/pathfinder/SwimNodeProcessor.java index b32d1f49..1f26752d 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/pathfinder/SwimNodeProcessor.java +++ b/src/main/java/net/minecraft/world/pathfinder/SwimNodeProcessor.java @@ -1,16 +1,14 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.pathfinder; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.pathfinder.NodeProcessor; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -34,10 +32,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class SwimNodeProcessor extends NodeProcessor { - static { - __checkIntegratedContextValid("net/minecraft/world/pathfinder/SwimNodeProcessor"); - } - public void initProcessor(IBlockAccess iblockaccess, Entity entity) { super.initProcessor(iblockaccess, entity); } 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/minecraft/world/pathfinder/WalkNodeProcessor.java similarity index 82% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/pathfinder/WalkNodeProcessor.java rename to src/main/java/net/minecraft/world/pathfinder/WalkNodeProcessor.java index 57c1cf36..b7d623a5 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/pathfinder/WalkNodeProcessor.java +++ b/src/main/java/net/minecraft/world/pathfinder/WalkNodeProcessor.java @@ -1,21 +1,19 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.pathfinder; +package 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; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoor; +import net.minecraft.block.BlockFence; +import net.minecraft.block.BlockFenceGate; +import net.minecraft.block.BlockRailBase; +import net.minecraft.block.BlockWall; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.pathfinder.NodeProcessor; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -39,10 +37,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class WalkNodeProcessor extends NodeProcessor { - static { - __checkIntegratedContextValid("net/minecraft/world/pathfinder/WalkNodeProcessor"); - } - private boolean canEnterDoors; private boolean canBreakDoors; private boolean avoidsWater; 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/minecraft/world/storage/DerivedWorldInfo.java similarity index 84% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/DerivedWorldInfo.java rename to src/main/java/net/minecraft/world/storage/DerivedWorldInfo.java index 87e07390..f6a47c29 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/DerivedWorldInfo.java +++ b/src/main/java/net/minecraft/world/storage/DerivedWorldInfo.java @@ -1,14 +1,12 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage; +package 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; +import net.minecraft.util.BlockPos; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.GameRules; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import net.minecraft.world.storage.WorldInfo; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -32,10 +30,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class DerivedWorldInfo extends WorldInfo { - static { - __checkIntegratedContextValid("net/minecraft/world/storage/DerivedWorldInfo"); - } - private final WorldInfo theWorldInfo; public DerivedWorldInfo(WorldInfo parWorldInfo) { diff --git a/src/main/java/net/minecraft/world/storage/ISaveFormat.java b/src/main/java/net/minecraft/world/storage/ISaveFormat.java index 35833922..859f9ddd 100755 --- a/src/main/java/net/minecraft/world/storage/ISaveFormat.java +++ b/src/main/java/net/minecraft/world/storage/ISaveFormat.java @@ -59,7 +59,7 @@ public interface ISaveFormat { * 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 renameWorld(String var1, String var2); boolean func_154334_a(String var1); diff --git a/src/main/java/net/minecraft/world/storage/ISaveHandler.java b/src/main/java/net/minecraft/world/storage/ISaveHandler.java index 441a8333..c2e9beb2 100755 --- a/src/main/java/net/minecraft/world/storage/ISaveHandler.java +++ b/src/main/java/net/minecraft/world/storage/ISaveHandler.java @@ -1,7 +1,12 @@ package net.minecraft.world.storage; import net.minecraft.nbt.NBTTagCompound; +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; import net.minecraft.world.MinecraftException; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.chunk.storage.IChunkLoader; +import net.minecraft.world.storage.IPlayerFileData; +import net.minecraft.world.storage.WorldInfo; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -34,6 +39,12 @@ public interface ISaveHandler { */ 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. @@ -53,6 +64,17 @@ public interface ISaveHandler { */ 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. diff --git a/src/main/java/net/minecraft/world/storage/MapStorage.java b/src/main/java/net/minecraft/world/storage/MapStorage.java index ffab720a..5a1b61b6 100755 --- a/src/main/java/net/minecraft/world/storage/MapStorage.java +++ b/src/main/java/net/minecraft/world/storage/MapStorage.java @@ -1,12 +1,25 @@ package net.minecraft.world.storage; -import java.util.List; -import java.util.Map; - 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.minecraft.scoreboard.ScoreboardSaveData; +import net.minecraft.village.VillageCollection; import net.minecraft.world.WorldSavedData; +import net.minecraft.world.gen.structure.MapGenStructureData; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -37,6 +50,19 @@ public class MapStorage { 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(); @@ -49,7 +75,36 @@ public class MapStorage { * instantiate, String dataid */ public WorldSavedData loadData(Class oclass, String s) { - return (WorldSavedData) this.loadedDataMap.get(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; + } } /**+ @@ -70,16 +125,69 @@ public class MapStorage { */ public void saveAllData() { for (int i = 0; i < this.loadedDataList.size(); ++i) { - ((WorldSavedData) this.loadedDataList.get(i)).setDirty(false); + 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() { - this.idCounts.clear(); + 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); + } + } /**+ @@ -95,6 +203,28 @@ public class MapStorage { } this.idCounts.put(s, oshort); - return oshort.shortValue(); + 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/SaveFormatOld.java b/src/main/java/net/minecraft/world/storage/SaveFormatOld.java similarity index 85% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveFormatOld.java rename to src/main/java/net/minecraft/world/storage/SaveFormatOld.java index 6f5c3761..b675e73d 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveFormatOld.java +++ b/src/main/java/net/minecraft/world/storage/SaveFormatOld.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage; +package net.minecraft.world.storage; import com.google.common.collect.Lists; @@ -9,18 +9,16 @@ 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.minecraft.util.IProgressUpdate; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.SaveFormatComparator; +import net.minecraft.world.storage.SaveHandler; +import 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. * @@ -43,10 +41,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ public class SaveFormatOld implements ISaveFormat { - static { - __checkIntegratedContextValid("net/minecraft/world/storage/SaveFormatOld"); - } - private static final Logger logger = LogManager.getLogger(); protected final VFile2 savesDirectory; @@ -70,7 +64,7 @@ public class SaveFormatOld implements ISaveFormat { if (worldinfo != null) { arraylist.add(new SaveFormatComparator(s, "", worldinfo.getLastTimePlayed(), worldinfo.getSizeOnDisk(), worldinfo.getGameType(), false, worldinfo.isHardcoreModeEnabled(), - worldinfo.areCommandsAllowed())); + worldinfo.areCommandsAllowed(), null)); } } 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/minecraft/world/storage/SaveHandler.java similarity index 86% rename from src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveHandler.java rename to src/main/java/net/minecraft/world/storage/SaveHandler.java index 03b40b33..99813e42 100755 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/sp/server/classes/net/minecraft/world/storage/SaveHandler.java +++ b/src/main/java/net/minecraft/world/storage/SaveHandler.java @@ -1,4 +1,4 @@ -package net.lax1dude.eaglercraft.v1_8.sp.server.classes.net.minecraft.world.storage; +package net.minecraft.world.storage; import java.io.DataInputStream; import java.io.DataOutputStream; @@ -7,23 +7,21 @@ 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.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.minecraft.server.MinecraftServer; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.chunk.storage.IChunkLoader; +import net.minecraft.world.storage.IPlayerFileData; +import net.minecraft.world.storage.ISaveHandler; +import 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. * @@ -46,10 +44,6 @@ import static net.lax1dude.eaglercraft.v1_8.sp.server.classes.ContextUtil.__chec */ 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; diff --git a/src/main/java/net/minecraft/world/storage/SaveHandlerMP.java b/src/main/java/net/minecraft/world/storage/SaveHandlerMP.java index ab72186e..cbe38e10 100755 --- a/src/main/java/net/minecraft/world/storage/SaveHandlerMP.java +++ b/src/main/java/net/minecraft/world/storage/SaveHandlerMP.java @@ -1,7 +1,10 @@ package net.minecraft.world.storage; +import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.MinecraftException; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.chunk.storage.IChunkLoader; /**+ * This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. @@ -69,4 +72,30 @@ public class SaveHandlerMP implements ISaveHandler { return "none"; } + @Override + /**+ + * initializes and returns the chunk loader for the specified + * world provider + */ + public IChunkLoader getChunkLoader(WorldProvider var1) { + return null; + } + + @Override + /**+ + * Gets the File object corresponding to the base directory of + * this world. + */ + public VFile2 getWorldDirectory() { + return null; + } + + @Override + /**+ + * Gets the file location of the given map + */ + public VFile2 getMapFileFromName(String var1) { + return null; + } + } \ No newline at end of file diff --git a/src/main/java/net/minecraft/world/storage/WorldInfo.java b/src/main/java/net/minecraft/world/storage/WorldInfo.java index f46748a8..ec3ec6b2 100755 --- a/src/main/java/net/minecraft/world/storage/WorldInfo.java +++ b/src/main/java/net/minecraft/world/storage/WorldInfo.java @@ -1,9 +1,9 @@ package net.minecraft.world.storage; import java.util.concurrent.Callable; - import net.minecraft.crash.CrashReportCategory; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; import net.minecraft.util.BlockPos; import net.minecraft.world.EnumDifficulty; import net.minecraft.world.GameRules; @@ -276,7 +276,7 @@ public class WorldInfo { nbt.setLong("Time", this.totalTime); nbt.setLong("DayTime", this.worldTime); nbt.setLong("SizeOnDisk", this.sizeOnDisk); - // nbt.setLong("LastPlayed", MinecraftServer.getCurrentTimeMillis()); + nbt.setLong("LastPlayed", MinecraftServer.getCurrentTimeMillis()); nbt.setString("LevelName", this.levelName); nbt.setInteger("version", this.saveVersion); nbt.setInteger("clearWeatherTime", this.cleanWeatherTime); diff --git a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/ServerPlatformSingleplayer.java b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/ServerPlatformSingleplayer.java index c2215037..8ebc44a3 100755 --- a/src/teavm/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/ServerPlatformSingleplayer.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/v1_8/sp/server/internal/ServerPlatformSingleplayer.java @@ -5,7 +5,6 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; -import net.lax1dude.eaglercraft.v1_8.sp.server.classes.EaglerServerBootstrap; import org.teavm.jso.JSBody; import org.teavm.jso.JSFunctor; import org.teavm.jso.JSObject; @@ -75,7 +74,6 @@ public class ServerPlatformSingleplayer { public static void initializeContext() { PlatformFilesystem.initialize(); - EaglerServerBootstrap.staticInit(); } @JSBody(params = { "ch", "dat" }, script = "postMessage({ ch: ch, dat : dat });")