Fix replaceable checks to work on blocks with a non-replacable material, Closes #532
This commit is contained in:
parent
13ff75bd9c
commit
06727b965e
2 changed files with 26 additions and 4 deletions
|
@ -131,7 +131,17 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
@@ -1086,7 +1105,7 @@
|
||||
@@ -926,7 +945,8 @@
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
int l = par1World.getBlockId(par2, par3, par4);
|
||||
- return l == 0 || blocksList[l].blockMaterial.isReplaceable();
|
||||
+ Block block = Block.blocksList[l];
|
||||
+ return block == null || block.isBlockReplaceable(par1World, par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1086,7 +1106,7 @@
|
||||
par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
|
||||
par2EntityPlayer.addExhaustion(0.025F);
|
||||
|
||||
|
@ -140,7 +150,7 @@
|
|||
{
|
||||
ItemStack itemstack = this.createStackedBlock(par6);
|
||||
|
||||
@@ -1102,12 +1121,13 @@
|
||||
@@ -1102,12 +1122,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -155,7 +165,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -1439,4 +1459,944 @@
|
||||
@@ -1439,4 +1460,944 @@
|
||||
canBlockGrass[0] = true;
|
||||
StatList.initBreakableStats();
|
||||
}
|
||||
|
@ -259,7 +269,7 @@
|
|||
+ */
|
||||
+ public boolean isBlockReplaceable(World world, int x, int y, int z)
|
||||
+ {
|
||||
+ return false;
|
||||
+ return blockMaterial.isReplaceable();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
--- ../src_base/minecraft/net/minecraft/block/BlockPumpkin.java
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockPumpkin.java
|
||||
@@ -123,7 +123,8 @@
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
int l = par1World.getBlockId(par2, par3, par4);
|
||||
- return (l == 0 || Block.blocksList[l].blockMaterial.isReplaceable()) && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
|
||||
+ Block block = Block.blocksList[l];
|
||||
+ return (block == null || block.isBlockReplaceable(par1World, par2, par3, par4)) && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
|
||||
}
|
||||
|
||||
/**
|
Loading…
Reference in a new issue