Files
MinecraftForge/patches/minecraft/net/minecraft/block/BlockSnow.java.patch
T
Lex Manos e68577ffd3 Updated FML:
MinecraftForge/FML@03fb1879d7 Fix obf error when right clicking a Empty Map.
MinecraftForge/FML@6bb9b8b953 Clean up FMLEventChannel. Closes #367.
MinecraftForge/FML@b7b3450dcd Update MCP mapping snapshot to latest crowdsourced names.
MinecraftForge/FML@8c9e8b5270 Fix isRemote, this is integral to so many parts of the code, everyone knows it by this name, People should not change it.
2014-02-05 01:14:24 -08:00

84 lines
3.9 KiB
Diff

--- ../src-base/minecraft/net/minecraft/block/BlockSnow.java
+++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java
@@ -79,7 +79,7 @@
public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
{
Block block = p_149742_1_.getBlock(p_149742_2_, p_149742_3_ - 1, p_149742_4_);
- return block != Blocks.ice && block != Blocks.packed_ice ? (block.getMaterial() == Material.leaves ? true : (block == this && (p_149742_1_.getBlockMetadata(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false;
+ return block != Blocks.ice && block != Blocks.packed_ice ? (block.isLeaves(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : (block == this && (p_149742_1_.getBlockMetadata(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false;
}
// JAVADOC METHOD $$ func_149695_a
@@ -92,7 +92,6 @@
{
if (!this.canPlaceBlockAt(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_))
{
- this.dropBlockAsItem(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_, p_150155_1_.getBlockMetadata(p_150155_2_, p_150155_3_, p_150155_4_), 0);
p_150155_1_.setBlockToAir(p_150155_2_, p_150155_3_, p_150155_4_);
return false;
}
@@ -105,10 +104,8 @@
// JAVADOC METHOD $$ func_149636_a
public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
{
- int i1 = p_149636_6_ & 7;
- this.dropBlockAsItem(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Items.snowball, i1 + 1, 0));
+ super.harvestBlock(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
p_149636_1_.setBlockToAir(p_149636_3_, p_149636_4_, p_149636_5_);
- p_149636_2_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1);
}
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
@@ -119,7 +116,7 @@
// JAVADOC METHOD $$ func_149745_a
public int quantityDropped(Random p_149745_1_)
{
- return 0;
+ return 1;
}
// JAVADOC METHOD $$ func_149674_a
@@ -127,7 +124,6 @@
{
if (p_149674_1_.getSavedLightValue(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11)
{
- this.dropBlockAsItem(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_), 0);
p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_);
}
}
@@ -138,4 +134,34 @@
{
return p_149646_5_ == 1 ? true : super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
}
+
+ /**
+ * Metadata and fortune sensitive version, this replaces the old (int meta, Random rand)
+ * version in 1.1.
+ *
+ * @param meta Blocks Metadata
+ * @param fortune Current item fortune level
+ * @param random Random number generator
+ * @return The number of items to drop
+ */
+ public int quantityDropped(int meta, int fortune, Random random)
+ {
+ return (meta & 7) + 1;
+ }
+
+ /**
+ * Determines if a new block can be replace the space occupied by this one,
+ * Used in the player's placement code to make the block act like water, and lava.
+ *
+ * @param world The current world
+ * @param x X Position
+ * @param y Y position
+ * @param z Z position
+ * @return True if the block is replaceable by another block
+ */
+ public boolean isReplaceable(IBlockAccess world, int x, int y, int z)
+ {
+ int meta = world.getBlockMetadata(x, y, z);
+ return meta >= 7 ? false : blockMaterial.isReplaceable();
+ }
}