This commit is contained in:
eaglercraft 2024-02-19 02:02:25 -08:00
parent 2ebb5d6da9
commit 401ebe2324
1261 changed files with 12766 additions and 138431 deletions

4
CompileJS.bat Executable file
View File

@ -0,0 +1,4 @@
@echo off
title gradlew generateJavascript
gradlew generateJavascript
pause

3
CompileJS.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
chmod +x gradlew
./gradlew generateJavascript

View File

@ -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;
}

View File

@ -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;

1
gradle.properties Executable file
View File

@ -0,0 +1 @@
org.gradle.jvmargs=-Xmx2G -Xms2G

View File

@ -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

View File

@ -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) {

View File

@ -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;

View File

@ -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

View File

@ -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");
}
}

View File

@ -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();
}
}

View File

@ -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.

View File

@ -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<String>() {
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<String>() {
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<String>() {
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<String>() {
public String call() throws Exception {
return state.toString();
}
});
category.addCrashSectionCallable("Block location", new Callable<String>() {
public String call() throws Exception {
return CrashReportCategory.getCoordinateInfo(new net.minecraft.util.BlockPos(pos.getX(), pos.getY(), pos.getZ()));
}
});
}
}

View File

@ -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;

View File

@ -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);

View File

@ -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;
/**

View File

@ -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;
/**

View File

@ -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));
}
}
}

View File

@ -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;
/**

View File

@ -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);
}
}
}

View File

@ -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());
}
}

View File

@ -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);
}
}

View File

@ -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;
}
}

View File

@ -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<ItemStack> 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";
}
}
}

View File

@ -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 });
}
}
}

View File

@ -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) {
}
}

View File

@ -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);
}

View File

@ -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);
}
}
});
}
}
}
}

View File

@ -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<BlockBed.EnumPartType> PART;
public static final PropertyBool OCCUPIED = PropertyBool.create("occupied");
public static void bootstrapStates() {
PART = PropertyEnum.<BlockBed.EnumPartType>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;
}
}
}

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -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<AxisAlignedBB> 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] });
}
}

View File

@ -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;
}
}

View File

@ -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 });
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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 });
}
}

View File

@ -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;
}
}

View File

@ -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<EnumDyeColor> COLOR = PropertyEnum.<EnumDyeColor>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<ItemStack> 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);
}
}

View File

@ -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;
}
}

View File

@ -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<AxisAlignedBB> 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 });
}
}

View File

@ -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 });
}
}

View File

@ -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;
}
}

View File

@ -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 });
}
}

View File

@ -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<EnumDyeColor> COLOR = PropertyEnum.<EnumDyeColor>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<ItemStack> 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 });
}
}

View File

@ -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));
}
}

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -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 });
}
}

View File

@ -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<ItemStack> list) {
if (!this.inverted) {
super.getSubBlocks(item, creativetabs, list);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}

View File

@ -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<BlockDirt.DirtType> 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.<BlockDirt.DirtType>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<ItemStack> 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;
}
}
}
}

View File

@ -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<Item, IBehaviorDispenseItem> 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 });
}
}

View File

@ -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<BlockDoor.EnumHingePosition> HINGE;
public static final PropertyBool POWERED = PropertyBool.create("powered");
public static PropertyEnum<BlockDoor.EnumDoorHalf> 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.<BlockDoor.EnumHingePosition>create("hinge", BlockDoor.EnumHingePosition.class);
HALF = PropertyEnum.<BlockDoor.EnumDoorHalf>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";
}
}
}

View File

@ -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<BlockDoublePlant.EnumPlantType> VARIANT;
public static PropertyEnum<BlockDoublePlant.EnumBlockHalf> HALF;
public static final PropertyEnum<EnumFacing> 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.<BlockDoublePlant.EnumPlantType>create("variant", BlockDoublePlant.EnumPlantType.class);
HALF = PropertyEnum.<BlockDoublePlant.EnumBlockHalf>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<ItemStack> 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;
}
}
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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);
}
}
}
}
}

View File

@ -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<EnumFacing>) 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<EnumFacing> 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));
}
}
}

View File

@ -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());
}
}
}
}

View File

@ -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<AxisAlignedBB> 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;
}
}

View File

@ -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<AxisAlignedBB> 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 });
}
}

View File

@ -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 });
}
}

View File

@ -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;
}
}

View File

@ -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) {
}
}

View File

@ -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 });
}
}

View File

@ -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<AxisAlignedBB> 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 });
}
}

View File

@ -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 });
}
}

View File

@ -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<Block, Integer> encouragements = Maps.newIdentityHashMap();
private final Map<Block, Integer> 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 });
}
}

View File

@ -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<BlockFlower.EnumFlowerType> 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<ItemStack> 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<BlockFlower.EnumFlowerType> getTypeProperty() {
if (this.type == null) {
this.type = PropertyEnum.create("type", BlockFlower.EnumFlowerType.class,
new Predicate<BlockFlower.EnumFlowerType>() {
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<BlockFlower.EnumFlowerType>() {
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()]);
}
}
}
}

View File

@ -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<BlockFlowerPot.EnumFlowerType> 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.<BlockFlowerPot.EnumFlowerType>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;
}
}
}

View File

@ -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 });
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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 });
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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());
}
}

View File

@ -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<EnumFacing>() {
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<AxisAlignedBB> 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 });
}
}

View File

@ -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<BlockHugeMushroom.EnumType> 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.<BlockHugeMushroom.EnumType>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;
}
}
}
}

View File

@ -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;
}
}

View File

@ -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();
}
}
}

View File

@ -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 });
}
}

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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<BlockLever.EnumOrientation> 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.<BlockLever.EnumOrientation>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;
}
}
}
}

View File

@ -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<AxisAlignedBB> 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;
}
}

View File

@ -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");
}
}
}

View File

@ -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<BlockLog.EnumAxis> 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.<BlockLog.EnumAxis>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;
}
}
}

View File

@ -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));
}
}

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -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 });
}
}

Some files were not shown because too many files have changed in this diff Show More