New hook to allow for custom beacon support blocks.

This commit is contained in:
LexManos committed 2012-10-28 06:47:53 -07:00
1 parent f72f6ab7b0
commit 31638a0697
2 files changed
+32 -1

No files matched your search

@@ -102,7 +102,7 @@
{
ItemStack var8 = this.createStackedBlock(par6);
@@ -1297,4 +1303,831 @@
@@ -1297,4 +1303,848 @@
canBlockGrass[0] = true;
StatList.initBreakableStats();
}
@@ -932,5 +932,22 @@
+ public boolean canDragonDestroy(World world, int x, int y, int z)
+ {
+ return blockID != obsidian.blockID && blockID != whiteStone.blockID && blockID != bedrock.blockID;
+ }
+
+ /**
+ * Determines if this block can be used as the base of a beacon.
+ *
+ * @param world The current world
+ * @param x X Position
+ * @param y Y Position
+ * @param z Z position
+ * @param beaconX Beacons X Position
+ * @param beaconY Beacons Y Position
+ * @param beaconZ Beacons Z Position
+ * @return True, to support the beacon, and make it active with this block.
+ */
+ public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
+ {
+ return (blockID == blockEmerald.blockID || blockID == blockGold.blockID || blockID == blockDiamond.blockID || blockID == blockSteel.blockID);
+ }
}
@@ -0,0 +1,14 @@
--- ../src_base/common/net/minecraft/src/TileEntityBeacon.java
+++ ../src_work/common/net/minecraft/src/TileEntityBeacon.java
@@ -95,8 +95,9 @@
for (int var5 = this.zCoord - var1; var5 <= this.zCoord + var1; ++var5)
{
int var6 = this.worldObj.getBlockId(var4, var2, var5);
-
- if (var6 != Block.blockEmerald.blockID && var6 != Block.blockGold.blockID && var6 != Block.blockDiamond.blockID && var6 != Block.blockSteel.blockID)
+ Block block = Block.blocksList[var6];
+
+ if (block == null || !block.isBeaconBase(worldObj, var4, var2, var5, xCoord, yCoord, zCoord))
{
var3 = false;
break;