Add air checks to BlockSand falling and Piston pushing. Please report any other issues with custom 'Air' blocks in issue #602

This commit is contained in:
LexManos committed 2013-06-14 12:08:24 -07:00
1 parent 0ec313abb1
commit f425a367cd
2 files changed
+30 -3

No files matched your search

@@ -9,7 +9,7 @@
}
}
@@ -455,7 +455,7 @@
@@ -455,14 +455,14 @@
{
if (l1 < 13)
{
@@ -18,7 +18,15 @@
{
return false;
}
@@ -505,7 +505,7 @@
int i2 = par0World.getBlockId(i1, j1, k1);
- if (i2 != 0)
+ if (!par0World.isAirBlock(i1, j1, k1))
{
if (!canPushBlock(i2, par0World, i1, j1, k1, true))
{
@@ -505,14 +505,14 @@
if (l1 < 13)
{
@@ -27,12 +35,20 @@
{
return false;
}
i2 = par1World.getBlockId(i1, j1, k1);
- if (i2 != 0)
+ if (!par1World.isAirBlock(i1, j1, k1))
{
if (!canPushBlock(i2, par1World, i1, j1, k1, true))
{
@@ -533,7 +533,9 @@
continue;
}
- Block.blocksList[i2].dropBlockAsItem(par1World, i1, j1, k1, par1World.getBlockMetadata(i1, j1, k1), 0);
+ //With our change to how snowballs are dropped this needs to dissallow to mimic vanilla behavior.
+ //With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior.
+ float chance = (Block.blocksList[i2] instanceof BlockSnow ? -1.0f : 1.0f);
+ Block.blocksList[i2].dropBlockAsItemWithChance(par1World, i1, j1, k1, par1World.getBlockMetadata(i1, j1, k1), chance, 0);
par1World.setBlockToAir(i1, j1, k1);
@@ -0,0 +1,11 @@
--- ../src_base/minecraft/net/minecraft/block/BlockSand.java
+++ ../src_work/minecraft/net/minecraft/block/BlockSand.java
@@ -105,7 +105,7 @@
{
int l = par0World.getBlockId(par1, par2, par3);
- if (l == 0)
+ if (par0World.isAirBlock(par1, par2, par3))
{
return true;
}