Files
MinecraftForge/patches/minecraft/net/minecraft/block/BlockSnow.java.patch
T
LexManos 2c05258205 Update to 1.5.2 PR.
MinecraftForge/FML@f0bba74a47 Update for minecraft 1.5.2
MinecraftForge/FML@62fdbad74c Update MCP's md5 for the fixed srg files.
2013-04-28 13:28:40 -07:00

67 lines
2.6 KiB
Diff

--- ../src_base/minecraft/net/minecraft/block/BlockSnow.java
+++ ../src_work/minecraft/net/minecraft/block/BlockSnow.java
@@ -96,8 +96,12 @@
*/
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
- int l = par1World.getBlockId(par2, par3 - 1, par4);
- return l == 0 ? false : (l == this.blockID && (par1World.getBlockMetadata(par2, par3 - 1, par4) & 7) == 7 ? true : (l != Block.leaves.blockID && !Block.blocksList[l].isOpaqueCube() ? false : par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement()));
+ int l = par1World.getBlockId(par2, par3 - 1, par4);
+ Block block = Block.blocksList[l];
+ if (block == null) return false;
+ if (block == this && (par1World.getBlockMetadata(par2, par3 - 1, par4) & 7) == 7) return true;
+ if (!block.isLeaves(par1World, par2, par3 - 1, par4) && !Block.blocksList[l].isOpaqueCube()) return false;
+ return par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement();
}
/**
@@ -116,7 +120,6 @@
{
if (!this.canPlaceBlockAt(par1World, par2, par3, par4))
{
- this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
par1World.setBlockToAir(par2, par3, par4);
return false;
}
@@ -132,11 +135,8 @@
*/
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
{
- int i1 = Item.snowball.itemID;
- int j1 = par6 & 7;
- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(i1, j1 + 1, 0));
+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
par1World.setBlockToAir(par3, par4, par5);
- par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
}
/**
@@ -152,7 +152,7 @@
*/
public int quantityDropped(Random par1Random)
{
- return 0;
+ return 1;
}
/**
@@ -162,7 +162,6 @@
{
if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11)
{
- this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
par1World.setBlockToAir(par2, par3, par4);
}
}
@@ -177,4 +176,10 @@
{
return par5 == 1 ? true : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
}
+
+ @Override
+ public int quantityDropped(int meta, int fortune, Random random)
+ {
+ return (meta & 7) + 1;
+ }
}