Switch to srg patches

This commit is contained in:
cpw 2016-03-11 19:59:24 -05:00
parent 93c1c737e1
commit 52e877bdd0
341 changed files with 5909 additions and 6323 deletions

View File

@ -47,11 +47,11 @@ minecraft {
projects {
forge {
rootDir "."
patchDir "patches.mcp/minecraft"
patchDir "patches/minecraft"
patchAfter "clean"
genPatchesFrom "clean"
genMcpPatches = true
applyMcpPatches = true
genMcpPatches = false
applyMcpPatches = false
with common
}
}

View File

@ -1,18 +1,18 @@
--- ../src-base/minecraft/net/minecraft/block/Block.java
+++ ../src-work/minecraft/net/minecraft/block/Block.java
@@ -38,8 +38,9 @@
@@ -46,8 +46,9 @@
public class Block
{
private static final ResourceLocation field_176230_a = new ResourceLocation("air");
- public static final RegistryNamespacedDefaultedByKey<ResourceLocation, Block> field_149771_c = new RegistryNamespacedDefaultedByKey(field_176230_a);
- public static final ObjectIntIdentityMap<IBlockState> field_176229_d = new ObjectIntIdentityMap();
+ public static final RegistryNamespacedDefaultedByKey<ResourceLocation,Block> field_149771_c = net.minecraftforge.fml.common.registry.GameData.getBlockRegistry();
+ public static final RegistryNamespacedDefaultedByKey<ResourceLocation, Block> field_149771_c = net.minecraftforge.fml.common.registry.GameData.getBlockRegistry();
+ @Deprecated //Modders: DO NOT use this! Use GameRegistry
+ public static final ObjectIntIdentityMap<IBlockState> field_176229_d = net.minecraftforge.fml.common.registry.GameData.getBlockStateIDMap();
public static final AxisAlignedBB field_185505_j = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D);
public static final AxisAlignedBB field_185506_k = null;
private CreativeTabs field_149772_a;
public static final Block.SoundType field_149769_e = new Block.SoundType("stone", 1.0F, 1.0F);
public static final Block.SoundType field_149766_f = new Block.SoundType("wood", 1.0F, 1.0F);
@@ -119,6 +120,9 @@
@@ -70,6 +71,9 @@
private IBlockState field_176228_M;
private String field_149770_b;
@ -22,7 +22,7 @@
public static int func_149682_b(Block p_149682_0_)
{
return field_149771_c.func_148757_b(p_149682_0_);
@@ -132,7 +136,8 @@
@@ -83,7 +87,8 @@
public static Block func_149729_e(int p_149729_0_)
{
@ -32,16 +32,16 @@
}
public static IBlockState func_176220_d(int p_176220_0_)
@@ -303,7 +308,7 @@
@@ -268,7 +273,7 @@
public boolean func_176200_f(World p_176200_1_, BlockPos p_176200_2_)
public boolean func_176200_f(IBlockAccess p_176200_1_, BlockPos p_176200_2_)
{
- return false;
+ return func_149688_o().func_76222_j();
+ return p_176200_1_.func_180495_p(p_176200_2_).func_185904_a().func_76222_j();
}
public Block func_149711_c(float p_149711_1_)
@@ -340,9 +345,10 @@
@@ -305,9 +310,10 @@
return this.field_149789_z;
}
@ -52,33 +52,33 @@
+ return hasTileEntity(func_176223_P());
}
public final void func_149676_a(float p_149676_1_, float p_149676_2_, float p_149676_3_, float p_149676_4_, float p_149676_5_, float p_149676_6_)
@@ -359,13 +365,13 @@
public int func_176207_c(IBlockAccess p_176207_1_, BlockPos p_176207_2_)
public AxisAlignedBB func_185496_a(IBlockState p_185496_1_, IBlockAccess p_185496_2_, BlockPos p_185496_3_)
@@ -346,13 +352,13 @@
@SideOnly(Side.CLIENT)
public int func_185484_c(IBlockState p_185484_1_, IBlockAccess p_185484_2_, BlockPos p_185484_3_)
{
Block block = p_176207_1_.func_180495_p(p_176207_2_).func_177230_c();
- int i = p_176207_1_.func_175626_b(p_176207_2_, block.func_149750_m());
+ int i = p_176207_1_.func_175626_b(p_176207_2_, block.getLightValue(p_176207_1_, p_176207_2_));
- int i = p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.func_185906_d());
+ int i = p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.getLightValue(p_185484_2_, p_185484_3_));
if (i == 0 && block instanceof BlockSlab)
if (i == 0 && p_185484_1_.func_177230_c() instanceof BlockSlab)
{
p_176207_2_ = p_176207_2_.func_177977_b();
block = p_176207_1_.func_180495_p(p_176207_2_).func_177230_c();
- return p_176207_1_.func_175626_b(p_176207_2_, block.func_149750_m());
+ return p_176207_1_.func_175626_b(p_176207_2_, block.getLightValue(p_176207_1_, p_176207_2_));
p_185484_3_ = p_185484_3_.func_177977_b();
p_185484_1_ = p_185484_2_.func_180495_p(p_185484_3_);
- return p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.func_185906_d());
+ return p_185484_2_.func_175626_b(p_185484_3_, p_185484_1_.getLightValue(p_185484_2_, p_185484_3_));
}
else
{
@@ -376,7 +382,7 @@
@SideOnly(Side.CLIENT)
public boolean func_176225_a(IBlockAccess p_176225_1_, BlockPos p_176225_2_, EnumFacing p_176225_3_)
{
- return p_176225_3_ == EnumFacing.DOWN && this.field_149760_C > 0.0D ? true : (p_176225_3_ == EnumFacing.UP && this.field_149756_F < 1.0D ? true : (p_176225_3_ == EnumFacing.NORTH && this.field_149754_D > 0.0D ? true : (p_176225_3_ == EnumFacing.SOUTH && this.field_149757_G < 1.0D ? true : (p_176225_3_ == EnumFacing.WEST && this.field_149759_B > 0.0D ? true : (p_176225_3_ == EnumFacing.EAST && this.field_149755_E < 1.0D ? true : !p_176225_1_.func_180495_p(p_176225_2_).func_177230_c().func_149662_c())))));
+ return p_176225_3_ == EnumFacing.DOWN && this.field_149760_C > 0.0D ? true : (p_176225_3_ == EnumFacing.UP && this.field_149756_F < 1.0D ? true : (p_176225_3_ == EnumFacing.NORTH && this.field_149754_D > 0.0D ? true : (p_176225_3_ == EnumFacing.SOUTH && this.field_149757_G < 1.0D ? true : (p_176225_3_ == EnumFacing.WEST && this.field_149759_B > 0.0D ? true : (p_176225_3_ == EnumFacing.EAST && this.field_149755_E < 1.0D ? true : !p_176225_1_.func_180495_p(p_176225_2_).func_177230_c().doesSideBlockRendering(p_176225_1_, p_176225_2_, p_176225_3_))))));
@@ -415,7 +421,7 @@
}
}
- return !p_176225_2_.func_180495_p(p_176225_3_.func_177972_a(p_176225_4_)).func_185914_p();
+ return !p_176225_2_.func_180495_p(p_176225_3_.func_177972_a(p_176225_4_)).doesSideBlockRendering(p_176225_2_, p_176225_3_.func_177972_a(p_176225_4_), p_176225_4_.func_176734_d());
}
public boolean func_176212_b(IBlockAccess p_176212_1_, BlockPos p_176212_2_, EnumFacing p_176212_3_)
@@ -453,6 +459,10 @@
@SideOnly(Side.CLIENT)
@@ -472,6 +478,10 @@
public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_)
{
@ -89,17 +89,17 @@
}
public int func_149745_a(Random p_149745_1_)
@@ -467,8 +477,7 @@
@@ -486,8 +496,7 @@
public float func_180647_a(EntityPlayer p_180647_1_, World p_180647_2_, BlockPos p_180647_3_)
public float func_180647_a(IBlockState p_180647_1_, EntityPlayer p_180647_2_, World p_180647_3_, BlockPos p_180647_4_)
{
- float f = this.func_176195_g(p_180647_2_, p_180647_3_);
- return f < 0.0F ? 0.0F : (!p_180647_1_.func_146099_a(this) ? p_180647_1_.func_180471_a(this) / f / 100.0F : p_180647_1_.func_180471_a(this) / f / 30.0F);
+ return net.minecraftforge.common.ForgeHooks.blockStrength(p_180647_2_.func_180495_p(p_180647_3_), p_180647_1_, p_180647_2_, p_180647_3_);
- float f = p_180647_1_.func_185887_b(p_180647_3_, p_180647_4_);
- return f < 0.0F ? 0.0F : (!p_180647_2_.func_184823_b(p_180647_1_) ? p_180647_2_.func_184813_a(p_180647_1_) / f / 100.0F : p_180647_2_.func_184813_a(p_180647_1_) / f / 30.0F);
+ return net.minecraftforge.common.ForgeHooks.blockStrength(p_180647_1_, p_180647_2_, p_180647_3_, p_180647_4_);
}
public final void func_176226_b(World p_176226_1_, BlockPos p_176226_2_, IBlockState p_176226_3_, int p_176226_4_)
@@ -478,20 +487,16 @@
@@ -497,20 +506,16 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
@ -125,7 +125,7 @@
}
}
}
@@ -499,8 +504,13 @@
@@ -518,8 +523,13 @@
public static void func_180635_a(World p_180635_0_, BlockPos p_180635_1_, ItemStack p_180635_2_)
{
@ -140,7 +140,7 @@
float f = 0.5F;
double d0 = (double)(p_180635_0_.field_73012_v.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
double d1 = (double)(p_180635_0_.field_73012_v.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
@@ -687,7 +697,7 @@
@@ -588,7 +598,7 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
@ -148,15 +148,15 @@
+ return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().func_176200_f(p_176196_1_, p_176196_2_);
}
public boolean func_180639_a(World p_180639_1_, BlockPos p_180639_2_, IBlockState p_180639_3_, EntityPlayer p_180639_4_, EnumFacing p_180639_5_, float p_180639_6_, float p_180639_7_, float p_180639_8_)
@@ -799,25 +809,35 @@
p_180657_2_.func_71029_a(StatList.field_75934_C[func_149682_b(this)]);
public boolean func_180639_a(World p_180639_1_, BlockPos p_180639_2_, IBlockState p_180639_3_, EntityPlayer p_180639_4_, EnumHand p_180639_5_, ItemStack p_180639_6_, EnumFacing p_180639_7_, float p_180639_8_, float p_180639_9_, float p_180639_10_)
@@ -638,25 +648,35 @@
p_180657_2_.func_71029_a(StatList.func_188055_a(this));
p_180657_2_.func_71020_j(0.025F);
- if (this.func_149700_E() && EnchantmentHelper.func_77502_d(p_180657_2_))
+ if (this.canSilkHarvest(p_180657_1_, p_180657_3_, p_180657_1_.func_180495_p(p_180657_3_), p_180657_2_) && EnchantmentHelper.func_77502_d(p_180657_2_))
- if (this.func_149700_E() && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0)
+ if (this.canSilkHarvest(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_) && EnchantmentHelper.func_77506_a(Enchantments.field_185306_r, p_180657_6_) > 0)
{
+ java.util.ArrayList<ItemStack> items = new java.util.ArrayList<ItemStack>();
+ java.util.List<ItemStack> items = new java.util.ArrayList<ItemStack>();
ItemStack itemstack = this.func_180643_i(p_180657_4_);
if (itemstack != null)
@ -165,7 +165,7 @@
+ items.add(itemstack);
}
+
+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_1_.func_180495_p(p_180657_3_), 0, 1.0f, true, p_180657_2_);
+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, 0, 1.0f, true, p_180657_2_);
+ for (ItemStack stack : items)
+ {
+ func_180635_a(p_180657_1_, p_180657_3_, stack);
@ -174,7 +174,7 @@
else
{
+ harvesters.set(p_180657_2_);
int i = EnchantmentHelper.func_77517_e(p_180657_2_);
int i = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_);
this.func_176226_b(p_180657_1_, p_180657_3_, p_180657_4_, i);
+ harvesters.set(null);
}
@ -183,12 +183,20 @@
+ @Deprecated //Forge: State sensitive version
protected boolean func_149700_E()
{
- return this.func_149686_d() && !this.field_149758_A;
+ return this.func_149686_d() && !this.hasTileEntity(silk_check_state.get());
- return this.func_176223_P().func_185917_h() && !this.field_149758_A;
+ return this.func_176223_P().func_185917_h() && !this.hasTileEntity(silk_check_state.get());
}
protected ItemStack func_180643_i(IBlockState p_180643_1_)
@@ -1010,6 +1030,1147 @@
@@ -747,6 +767,7 @@
p_176216_2_.field_70181_x = 0.0D;
}
+ @Deprecated // Forge: Use more sensitive version below: getPickBlock
public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_)
{
return new ItemStack(Item.func_150898_a(this), 1, this.func_180651_a(p_185473_3_));
@@ -844,6 +865,1166 @@
return "Block{" + field_149771_c.func_177774_c(this) + "}";
}
@ -200,42 +208,45 @@
+ /**
+ * Get a light value for the block at the specified coordinates, normal ranges are between 0 and 15
+ *
+ * @param state Block state
+ * @param world The current world
+ * @param pos Block position in world
+ * @return The light value
+ */
+ public int getLightValue(IBlockAccess world, BlockPos pos)
+ public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos)
+ {
+ Block block = world.func_180495_p(pos).func_177230_c();
+ if (block != this)
+ IBlockState other = world.func_180495_p(pos);
+ if (other.func_177230_c() != this)
+ {
+ return block.getLightValue(world, pos);
+ return other.getLightValue(world, pos);
+ }
+ return func_149750_m();
+ return state.func_185906_d();
+ }
+
+ /**
+ * Checks if a player or entity can use this block to 'climb' like a ladder.
+ *
+ * @param state The current state
+ * @param world The current world
+ * @param pos Block position in world
+ * @param entity The entity trying to use the ladder, CAN be null.
+ * @return True if the block should act like a ladder
+ */
+ public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return false; }
+ public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return false; }
+
+ /**
+ * Return true if the block is a normal, solid cube. This
+ * determines indirect power state, entity ejection from blocks, and a few
+ * others.
+ *
+ * @param state The current state
+ * @param world The current world
+ * @param pos Block position in world
+ * @return True if the block is a full cube
+ */
+ public boolean isNormalCube(IBlockAccess world, BlockPos pos)
+ public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
+ {
+ return func_149688_o().func_76218_k() && func_149686_d() && !func_149744_f();
+ return state.func_185904_a().func_76218_k() && state.func_185917_h() && !state.func_185897_m();
+ }
+
+ /**
@ -249,26 +260,30 @@
+ * @param side The side to check
+ * @return True if the block is opaque on the specified side.
+ */
+ public boolean doesSideBlockRendering(IBlockAccess world, BlockPos pos, EnumFacing face)
+ public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face)
+ {
+ return func_149662_c();
+ return state.func_185914_p();
+ }
+
+ /**
+ * Checks if the block is a solid face on the given side, used by placement logic.
+ *
+ * @param base_state The base state, getActualState should be called first
+ * @param world The current world
+ * @param pos Block position in world
+ * @param side The side to check
+ * @return True if the block is solid on the specified side.
+ */
+ public boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side)
+ public boolean isSideSolid(IBlockState base_state, IBlockAccess world, BlockPos pos, EnumFacing side)
+ {
+ IBlockState state = this.func_176221_a(world.func_180495_p(pos), world, pos);
+ if (base_state.func_185896_q()) // Short circuit to vanilla function if its true
+ return true;
+
+ IBlockState state = this.func_176221_a(base_state, world, pos);
+
+ if (this instanceof BlockSlab)
+ {
+ return func_149730_j()
+ return base_state.func_185913_b()
+ || (state.func_177229_b(BlockSlab.field_176554_a) == BlockSlab.EnumBlockHalf.TOP && side == EnumFacing.UP )
+ || (state.func_177229_b(BlockSlab.field_176554_a) == BlockSlab.EnumBlockHalf.BOTTOM && side == EnumFacing.DOWN);
+ }
@ -308,7 +323,7 @@
+ {
+ return true;
+ }
+ return isNormalCube(world, pos);
+ return isNormalCube(state, world, pos);
+ }
+
+ /**
@ -330,13 +345,14 @@
+ * useful for creating pure logic-blocks that will be invisible
+ * to the player and otherwise interact as air would.
+ *
+ * @param sata The current state
+ * @param world The current world
+ * @param pos Block position in world
+ * @return True if the block considered air
+ */
+ public boolean isAir(IBlockAccess world, BlockPos pos)
+ public boolean isAir(IBlockState state, IBlockAccess world, BlockPos pos)
+ {
+ return func_149688_o() == Material.field_151579_a;
+ return state.func_185904_a() == Material.field_151579_a;
+ }
+
+ /**
@ -362,6 +378,7 @@
+ * Note: When used in multiplayer, this is called on both client and
+ * server sides!
+ *
+ * @param state The current state.
+ * @param world The current world
+ * @param player The player damaging the block, may be null
+ * @param pos Block position in world
@ -369,9 +386,10 @@
+ * Can be useful to delay the destruction of tile entities till after harvestBlock
+ * @return True if the block is actually destroyed.
+ */
+ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
+ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
+ {
+ return world.func_175698_g(pos);
+ this.func_176208_a(world, pos, state, player);
+ return world.func_180501_a(pos, net.minecraft.init.Blocks.field_150350_a.func_176223_P(), world.field_72995_K ? 11 : 3);
+ }
+
+ /**
@ -535,23 +553,15 @@
+ * Determines if a specified mob type can spawn on this block, returning false will
+ * prevent any mob from spawning on the block.
+ *
+ * @param state The current state
+ * @param world The current world
+ * @param pos Block position in world
+ * @param type The Mob Category Type
+ * @return True to allow a mob of the specified category to spawn, false to prevent it.
+ */
+ public boolean canCreatureSpawn(IBlockAccess world, BlockPos pos, net.minecraft.entity.EntityLiving.SpawnPlacementType type)
+ public boolean canCreatureSpawn(IBlockState state, IBlockAccess world, BlockPos pos, net.minecraft.entity.EntityLiving.SpawnPlacementType type)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ if (this instanceof BlockSlab)
+ {
+ return (func_149730_j() || state.func_177229_b(BlockSlab.field_176554_a) == BlockSlab.EnumBlockHalf.TOP);
+ }
+ else if (this instanceof BlockStairs)
+ {
+ return state.func_177229_b(BlockStairs.field_176308_b) == BlockStairs.EnumHalf.TOP;
+ }
+ return isSideSolid(world, pos, EnumFacing.UP);
+ return isSideSolid(state, world, pos, EnumFacing.UP);
+ }
+
+ /**
@ -559,12 +569,13 @@
+ * players to sleep in it, though the block has to specifically
+ * perform the sleeping functionality in it's activated event.
+ *
+ * @param state The current state
+ * @param world The current world
+ * @param pos Block position in world
+ * @param player The player or camera entity, null in some cases.
+ * @return True to treat this as a bed
+ */
+ public boolean isBed(IBlockAccess world, BlockPos pos, Entity player)
+ public boolean isBed(IBlockState state, IBlockAccess world, BlockPos pos, Entity player)
+ {
+ return this == net.minecraft.init.Blocks.field_150324_C;
+ }
@ -573,12 +584,13 @@
+ * Returns the position that the player is moved to upon
+ * waking up, or respawning at the bed.
+ *
+ * @param state The current state
+ * @param world The current world
+ * @param pos Block position in world
+ * @param player The player or camera entity, null in some cases.
+ * @return The spawn position
+ */
+ public BlockPos getBedSpawnPosition(IBlockAccess world, BlockPos pos, EntityPlayer player)
+ public BlockPos getBedSpawnPosition(IBlockState state, IBlockAccess world, BlockPos pos, EntityPlayer player)
+ {
+ if (world instanceof World)
+ return BlockBed.func_176468_a((World)world, pos, 0);
@ -608,13 +620,14 @@
+ * Returns the direction of the block. Same values that
+ * are returned by BlockDirectional
+ *
+ * @param state The current state
+ * @param world The current world
+ * @param pos Block position in world
+ * @return Bed direction
+ */
+ public EnumFacing getBedDirection(IBlockAccess world, BlockPos pos)
+ public EnumFacing getBedDirection(IBlockState state, IBlockAccess world, BlockPos pos)
+ {
+ return (EnumFacing)func_176221_a(world.func_180495_p(pos), world, pos).func_177229_b(BlockDirectional.field_176387_N);
+ return (EnumFacing)func_176221_a(state, world, pos).func_177229_b(BlockHorizontal.field_185512_D);
+ }
+
+ /**
@ -632,19 +645,20 @@
+ /**
+ * Called when a leaf should start its decay process.
+ *
+ * @param state The current state
+ * @param world The current world
+ * @param pos Block position in world
+ */
+ public void beginLeavesDecay(World world, BlockPos pos){}
+ public void beginLeavesDecay(IBlockState state, World world, BlockPos pos){}
+
+ /**
+ * Determines if this block can prevent leaves connected to it from decaying.
+ *
+ * @param state The current state
+ * @param world The current world
+ * @param pos Block position in world
+ * @return true if the presence this block can prevent leaves from decaying.
+ */
+ public boolean canSustainLeaves(IBlockAccess world, BlockPos pos)
+ public boolean canSustainLeaves(IBlockState state, IBlockAccess world, BlockPos pos)
+ {
+ return false;
+ }
@ -652,25 +666,27 @@
+ /**
+ * Determines if this block is considered a leaf block, used to apply the leaf decay and generation system.
+ *
+ * @param state The current state
+ * @param world The current world
+ * @param pos Block position in world
+ * @return true if this block is considered leaves.
+ */
+ public boolean isLeaves(IBlockAccess world, BlockPos pos)
+ public boolean isLeaves(IBlockState state, IBlockAccess world, BlockPos pos)
+ {
+ return func_149688_o() == Material.field_151584_j;
+ return state.func_185904_a() == Material.field_151584_j;
+ }
+
+ /**
+ * Used during tree growth to determine if newly generated leaves can replace this block.
+ *
+ * @param state The current state
+ * @param world The current world
+ * @param pos Block position in world
+ * @return true if this block can be replaced by growing leaves.
+ */
+ public boolean canBeReplacedByLeaves(IBlockAccess world, BlockPos pos)
+ public boolean canBeReplacedByLeaves(IBlockState state, IBlockAccess world, BlockPos pos)
+ {
+ return !func_149730_j();
+ return !state.func_185913_b();
+ }
+
+ /**
@ -687,15 +703,16 @@
+ /**
+ * Determines if the current block is replaceable by Ore veins during world generation.
+ *
+ * @param state The current state
+ * @param world The current world
+ * @param pos Block position in world
+ * @param target The generic target block the gen is looking for, Standards define stone
+ * for overworld generation, and neatherack for the nether.
+ * @return True to allow this block to be replaced by a ore
+ */
+ public boolean isReplaceableOreGen(World world, BlockPos pos, com.google.common.base.Predicate<IBlockState> target)
+ public boolean isReplaceableOreGen(IBlockState state, IBlockAccess world, BlockPos pos, com.google.common.base.Predicate<IBlockState> target)
+ {
+ return target.apply(world.func_180495_p(pos));
+ return target.apply(state);
+ }
+
+ /**
@ -731,27 +748,29 @@
+ * Determine if this block can make a redstone connection on the side provided,
+ * Useful to control which sides are inputs and outputs for redstone wires.
+ *
+ * @param state The current state
+ * @param world The current world
+ * @param pos Block position in world
+ * @param side The side that is trying to make the connection, CAN BE NULL
+ * @return True to make the connection
+ */
+ public boolean canConnectRedstone(IBlockAccess world, BlockPos pos, EnumFacing side)
+ public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
+ {
+ return func_149744_f() && side != null;
+ return state.func_185897_m() && side != null;
+ }
+
+ /**
+ * Determines if a torch can be placed on the top surface of this block.
+ * Useful for creating your own block that torches can be on, such as fences.
+ *
+ * @param state The current state
+ * @param world The current world
+ * @param pos Block position in world
+ * @return True to allow the torch to be placed
+ */
+ public boolean canPlaceTorchOnTop(IBlockAccess world, BlockPos pos)
+ public boolean canPlaceTorchOnTop(IBlockState state, IBlockAccess world, BlockPos pos)
+ {
+ if (isSideSolid(world, pos, EnumFacing.UP))
+ if (state.isSideSolid(world, pos, EnumFacing.UP))
+ {
+ return true;
+ }
@ -780,22 +799,9 @@
+ * @param target The full target the player is looking at
+ * @return A ItemStack to add to the player's inventory, Null if nothing should be added.
+ */
+ public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player)
+ public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player)
+ {
+ return getPickBlock(target, world, pos);
+ }
+ @Deprecated
+ public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos)
+ {
+ Item item = func_180665_b(world, pos);
+
+ if (item == null)
+ {
+ return null;
+ }
+
+ Block block = item instanceof ItemBlock && !func_149648_K() ? Block.func_149634_a(item) : this;
+ return new ItemStack(item, 1, block.func_176222_j(world, pos));
+ return func_185473_a(world, pos, state);
+ }
+
+ /**
@ -821,7 +827,7 @@
+ * @param numberOfParticles that vanilla would have spawned.
+ * @return True to prevent vanilla landing particles form spawning.
+ */
+ public boolean addLandingEffects(net.minecraft.world.WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles )
+ public boolean addLandingEffects(IBlockState state, net.minecraft.world.WorldServer worldObj, BlockPos blockPosition, IBlockState iblockstate, EntityLivingBase entity, int numberOfParticles )
+ {
+ return false;
+ }
@ -832,13 +838,14 @@
+ * control over the particles. Useful when you have entirely different
+ * texture sheets for different sides/locations in the world.
+ *
+ * @param state The current state
+ * @param world The current world
+ * @param target The target the player is looking at {x/y/z/side/sub}
+ * @param effectRenderer A reference to the current effect renderer.
+ * @return True to prevent vanilla digging particles form spawning.
+ */
+ @SideOnly(Side.CLIENT)
+ public boolean addHitEffects(World worldObj, MovingObjectPosition target, net.minecraft.client.particle.EffectRenderer effectRenderer)
+ public boolean addHitEffects(IBlockState state, World worldObj, RayTraceResult target, net.minecraft.client.particle.EffectRenderer effectRenderer)
+ {
+ return false;
+ }
@ -871,15 +878,15 @@
+ * Plains check if its grass or dirt
+ * Water check if its still water
+ *
+ * @param state The Current state
+ * @param world The current world
+ * @param pos Block position in world
+ * @param direction The direction relative to the given position the plant wants to be, typically its UP
+ * @param plantable The plant that wants to check
+ * @return True to allow the plant to be planted/stay.
+ */
+ public boolean canSustainPlant(IBlockAccess world, BlockPos pos, EnumFacing direction, net.minecraftforge.common.IPlantable plantable)
+ public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, net.minecraftforge.common.IPlantable plantable)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ IBlockState plant = plantable.getPlant(world, pos.func_177972_a(direction));
+ net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.func_177972_a(direction));
+
@ -893,7 +900,7 @@
+ return true;
+ }
+
+ if (plantable instanceof BlockBush && ((BlockBush)plantable).func_149854_a(this))
+ if (plantable instanceof BlockBush && ((BlockBush)plantable).func_185514_i(state))
+ {
+ return true;
+ }
@ -903,15 +910,15 @@
+ case Desert: return this == net.minecraft.init.Blocks.field_150354_m || this == net.minecraft.init.Blocks.field_150405_ch || this == net.minecraft.init.Blocks.field_150406_ce || this == net.minecraft.init.Blocks.field_150346_d;
+ case Nether: return this == net.minecraft.init.Blocks.field_150425_aM;
+ case Crop: return this == net.minecraft.init.Blocks.field_150458_ak;
+ case Cave: return isSideSolid(world, pos, EnumFacing.UP);
+ case Cave: return state.isSideSolid(world, pos, EnumFacing.UP);
+ case Plains: return this == net.minecraft.init.Blocks.field_150349_c || this == net.minecraft.init.Blocks.field_150346_d || this == net.minecraft.init.Blocks.field_150458_ak;
+ case Water: return func_149688_o() == Material.field_151586_h && ((Integer)state.func_177229_b(BlockLiquid.field_176367_b)) == 0;
+ case Water: return state.func_185904_a() == Material.field_151586_h && state.func_177229_b(BlockLiquid.field_176367_b) == 0;
+ case Beach:
+ boolean isBeach = this == net.minecraft.init.Blocks.field_150349_c || this == net.minecraft.init.Blocks.field_150346_d || this == net.minecraft.init.Blocks.field_150354_m;
+ boolean hasWater = (world.func_180495_p(pos.func_177974_f()).func_177230_c().func_149688_o() == Material.field_151586_h ||
+ world.func_180495_p(pos.func_177976_e()).func_177230_c().func_149688_o() == Material.field_151586_h ||
+ world.func_180495_p(pos.func_177978_c()).func_177230_c().func_149688_o() == Material.field_151586_h ||
+ world.func_180495_p(pos.func_177968_d()).func_177230_c().func_149688_o() == Material.field_151586_h);
+ boolean hasWater = (world.func_180495_p(pos.func_177974_f()).func_185904_a() == Material.field_151586_h ||
+ world.func_180495_p(pos.func_177976_e()).func_185904_a() == Material.field_151586_h ||
+ world.func_180495_p(pos.func_177978_c()).func_185904_a() == Material.field_151586_h ||
+ world.func_180495_p(pos.func_177968_d()).func_185904_a() == Material.field_151586_h);
+ return isBeach && hasWater;
+ }
+
@ -927,11 +934,12 @@
+ *
+ * Note: This happens DURING the generation, the generation may not be complete when this is called.
+ *
+ * @param state The current state
+ * @param world Current world
+ * @param pos Block position in world
+ * @param source Source plant's position in world
+ */
+ public void onPlantGrow(World world, BlockPos pos, BlockPos source)
+ public void onPlantGrow(IBlockState state, World world, BlockPos pos, BlockPos source)
+ {
+ if (this == net.minecraft.init.Blocks.field_150349_c || this == net.minecraft.init.Blocks.field_150458_ak)
+ {
@ -966,27 +974,43 @@
+ * Recommended that you have your tile entity call relight after being placed if you
+ * rely on it for light info.
+ *
+ * @param state The Block state
+ * @param world The current world
+ * @param pos Block position in world
+ * @return The amount of light to block, 0 for air, 255 for fully opaque.
+ */
+ public int getLightOpacity(IBlockAccess world, BlockPos pos)
+ public int getLightOpacity(IBlockState state, IBlockAccess world, BlockPos pos)
+ {
+ return func_149717_k();
+ return state.func_185891_c();
+ }
+
+ /**
+ * Determines if this block is can be destroyed by the specified entities normal behavior.
+ *
+ * @param state The current state
+ * @param world The current world
+ * @param pos Block position in world
+ * @return True to allow the ender dragon to destroy this block
+ */
+ public boolean canEntityDestroy(IBlockAccess world, BlockPos pos, Entity entity)
+ public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity entity)
+ {
+ if (entity instanceof net.minecraft.entity.boss.EntityDragon)
+ {
+ return this != net.minecraft.init.Blocks.field_180401_cv && this != net.minecraft.init.Blocks.field_150343_Z && this != net.minecraft.init.Blocks.field_150377_bs && this != net.minecraft.init.Blocks.field_150357_h && this != net.minecraft.init.Blocks.field_150483_bI;
+ return this != net.minecraft.init.Blocks.field_180401_cv &&
+ this != net.minecraft.init.Blocks.field_150343_Z &&
+ this != net.minecraft.init.Blocks.field_150377_bs &&
+ this != net.minecraft.init.Blocks.field_150357_h &&
+ this != net.minecraft.init.Blocks.field_150384_bq &&
+ this != net.minecraft.init.Blocks.field_150378_br &&
+ this != net.minecraft.init.Blocks.field_150483_bI &&
+ this != net.minecraft.init.Blocks.field_185776_dc &&
+ this != net.minecraft.init.Blocks.field_185777_dd &&
+ this != net.minecraft.init.Blocks.field_150411_aY &&
+ this != net.minecraft.init.Blocks.field_185775_db;
+ }
+ else if (entity instanceof net.minecraft.entity.boss.EntityWither)
+ {
+ return net.minecraft.entity.boss.EntityWither.func_181033_a(this);
+ }
+
+ return true;
@ -1019,7 +1043,7 @@
+ public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ for (IProperty prop : (java.util.Set<IProperty>)state.func_177228_b().keySet())
+ for (IProperty<?> prop : state.func_177228_b().keySet())
+ {
+ if (prop.func_177701_a().equals("facing") || prop.func_177701_a().equals("rotation"))
+ {
@ -1040,10 +1064,11 @@
+ public EnumFacing[] getValidRotations(World world, BlockPos pos)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ for (IProperty prop : (java.util.Set<IProperty>)state.func_177228_b().keySet())
+ for (IProperty<?> prop : state.func_177228_b().keySet())
+ {
+ if (prop.func_177701_a().equals("facing") && prop.func_177699_b() == EnumFacing.class)
+ {
+ @SuppressWarnings("unchecked")
+ java.util.Collection<EnumFacing> values = ((java.util.Collection<EnumFacing>)prop.func_177700_c());
+ return values.toArray(new EnumFacing[values.size()]);
+ }
@ -1070,10 +1095,11 @@
+ * @param color The color to change to
+ * @return If the recoloring was successful
+ */
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public boolean recolorBlock(World world, BlockPos pos, EnumFacing side, net.minecraft.item.EnumDyeColor color)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ for (IProperty prop : (java.util.Set<IProperty>)state.func_177228_b().keySet())
+ for (IProperty prop : state.func_177228_b().keySet())
+ {
+ if (prop.func_177701_a().equals("color") && prop.func_177699_b() == net.minecraft.item.EnumDyeColor.class)
+ {
@ -1091,12 +1117,13 @@
+ /**
+ * Gathers how much experience this block drops when broken.
+ *
+ * @param state The current state
+ * @param world The world
+ * @param pos Block position
+ * @param fortune
+ * @return Amount of XP from breaking this block.
+ */
+ public int getExpDrop(IBlockAccess world, BlockPos pos, int fortune)
+ public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return 0;
+ }
@ -1116,9 +1143,9 @@
+ * @param side The INPUT side of the block to be powered - ie the opposite of this block's output side
+ * @return Whether Block#isProvidingWeakPower should be called when determining indirect power
+ */
+ public boolean shouldCheckWeakPower(IBlockAccess world, BlockPos pos, EnumFacing side)
+ public boolean shouldCheckWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
+ {
+ return func_149721_r();
+ return state.func_185915_l();
+ }
+
+ /**
@ -1220,7 +1247,7 @@
+ /**
+ * Called when the entity is inside this block, may be used to determined if the entity can breathing,
+ * display material overlays, or if the entity can swim inside a block.
+ *
+ *
+ * @param world that is being tested.
+ * @param blockpos position thats being tested.
+ * @param iblockstate state at world/blockpos
@ -1230,15 +1257,15 @@
+ * @param testingHead when true, its testing the entities head for vision, breathing ect... otherwise its testing the body, for swimming and movement adjustment.
+ * @return null for default behavior, true if the entity is within the material, false if it was not.
+ */
+ public Boolean isEntityInsideMaterial(World world, BlockPos blockpos, IBlockState iblockstate, Entity entity, double yToTest, Material materialIn, boolean testingHead)
+ public Boolean isEntityInsideMaterial(IBlockAccess world, BlockPos blockpos, IBlockState iblockstate, Entity entity, double yToTest, Material materialIn, boolean testingHead)
+ {
+ return null;
+ }
+
+
+ /**
+ * Called when boats or fishing hooks are inside the block to check if they are inside
+ * the material requested.
+ *
+ *
+ * @param world world that is being tested.
+ * @param pos block thats being tested.
+ * @param boundingBox box to test, generally the bounds of an entity that are besting tested.
@ -1254,7 +1281,7 @@
+ * Queries if this block should render in a given layer.
+ * ISmartBlockModel can use MinecraftForgeClient.getRenderLayer to alter their model based on layer
+ */
+ public boolean canRenderInLayer(EnumWorldBlockLayer layer)
+ public boolean canRenderInLayer(BlockRenderLayer layer)
+ {
+ return func_180664_k() == layer;
+ }

View File

@ -1,21 +1,13 @@
--- ../src-base/minecraft/net/minecraft/block/BlockBanner.java
+++ ../src-work/minecraft/net/minecraft/block/BlockBanner.java
@@ -85,22 +85,7 @@
@@ -104,14 +104,7 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
- TileEntity tileentity = p_180653_1_.func_175625_s(p_180653_2_);
- ItemStack itemstack = this.func_185549_e(p_180653_1_, p_180653_2_, p_180653_3_);
-
- if (tileentity instanceof TileEntityBanner)
- if (itemstack != null)
{
- ItemStack itemstack = new ItemStack(Items.field_179564_cE, 1, ((TileEntityBanner)tileentity).func_175115_b());
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- tileentity.func_145841_b(nbttagcompound);
- nbttagcompound.func_82580_o("x");
- nbttagcompound.func_82580_o("y");
- nbttagcompound.func_82580_o("z");
- nbttagcompound.func_82580_o("id");
- itemstack.func_77983_a("BlockEntityTag", nbttagcompound);
- func_180635_a(p_180653_1_, p_180653_2_, itemstack);
- }
- else
@ -23,7 +15,7 @@
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
}
}
@@ -133,6 +118,28 @@
@@ -138,6 +131,28 @@
}
}
@ -51,4 +43,4 @@
+
public static class BlockBannerHanging extends BlockBanner
{
public BlockBannerHanging()
protected static final AxisAlignedBB field_185551_d = new AxisAlignedBB(0.0D, 0.0D, 0.875D, 1.0D, 0.78125D, 1.0D);

View File

@ -1,40 +1,40 @@
--- ../src-base/minecraft/net/minecraft/block/BlockBush.java
+++ ../src-work/minecraft/net/minecraft/block/BlockBush.java
@@ -13,7 +13,7 @@
@@ -14,7 +14,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockBush extends Block
+public class BlockBush extends Block implements net.minecraftforge.common.IPlantable
{
protected BlockBush()
{
@@ -36,7 +36,7 @@
protected static final AxisAlignedBB field_185515_b = new AxisAlignedBB(0.30000001192092896D, 0.0D, 0.30000001192092896D, 0.699999988079071D, 0.6000000238418579D, 0.699999988079071D);
@@ -37,7 +37,8 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return super.func_176196_c(p_176196_1_, p_176196_2_) && this.func_149854_a(p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c());
+ return super.func_176196_c(p_176196_1_, p_176196_2_) && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c().canSustainPlant(p_176196_1_, p_176196_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
- return super.func_176196_c(p_176196_1_, p_176196_2_) && this.func_185514_i(p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()));
+ IBlockState soil = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
+ return super.func_176196_c(p_176196_1_, p_176196_2_) && soil.func_177230_c().canSustainPlant(soil, p_176196_1_, p_176196_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
}
protected boolean func_149854_a(Block p_149854_1_)
@@ -66,7 +66,10 @@
protected boolean func_185514_i(IBlockState p_185514_1_)
@@ -67,6 +68,11 @@
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
{
- return this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c());
+ BlockPos down = p_180671_2_.func_177977_b();
+ Block soil = p_180671_1_.func_180495_p(down).func_177230_c();
+ if (p_180671_3_.func_177230_c() != this) return this.func_149854_a(soil); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
+ return soil.canSustainPlant(p_180671_1_, down, net.minecraft.util.EnumFacing.UP, this);
+ if (p_180671_3_.func_177230_c() == this) //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
+ {
+ IBlockState soil = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b());
+ return soil.func_177230_c().canSustainPlant(soil, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
+ }
return this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()));
}
public AxisAlignedBB func_180640_a(World p_180640_1_, BlockPos p_180640_2_, IBlockState p_180640_3_)
@@ -89,4 +92,33 @@
{
return EnumWorldBlockLayer.CUTOUT;
@@ -90,6 +96,35 @@
return false;
}
+
+ @Override
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
@ -63,4 +63,7 @@
+ if (state.func_177230_c() != this) return func_176223_P();
+ return state;
+ }
}
+
@SideOnly(Side.CLIENT)
public BlockRenderLayer func_180664_k()
{

View File

@ -1,12 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockButton.java
+++ ../src-work/minecraft/net/minecraft/block/BlockButton.java
@@ -74,8 +74,7 @@
@@ -89,7 +89,7 @@
protected static boolean func_181088_a(World p_181088_0_, BlockPos p_181088_1_, EnumFacing p_181088_2_)
{
- BlockPos blockpos = p_181088_1_.func_177972_a(p_181088_2_);
- return p_181088_2_ == EnumFacing.DOWN ? World.func_175683_a(p_181088_0_, blockpos) : p_181088_0_.func_180495_p(blockpos).func_177230_c().func_149721_r();
+ return p_181088_2_ == EnumFacing.DOWN && World.func_175683_a(p_181088_0_, p_181088_1_.func_177977_b()) ? true : p_181088_0_.isSideSolid(p_181088_1_.func_177972_a(p_181088_2_), p_181088_2_.func_176734_d());
BlockPos blockpos = p_181088_1_.func_177972_a(p_181088_2_);
- return p_181088_2_ == EnumFacing.DOWN ? p_181088_0_.func_180495_p(blockpos).func_185896_q() : p_181088_0_.func_180495_p(blockpos).func_185915_l();
+ return p_181088_0_.func_180495_p(blockpos).isSideSolid(p_181088_0_, blockpos, p_181088_2_.func_176734_d());
}
public IBlockState func_180642_a(World p_180642_1_, BlockPos p_180642_2_, EnumFacing p_180642_3_, float p_180642_4_, float p_180642_5_, float p_180642_6_, int p_180642_7_, EntityLivingBase p_180642_8_)

View File

@ -8,21 +8,22 @@
+public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable
{
public static final PropertyInteger field_176587_a = PropertyInteger.func_177719_a("age", 0, 15);
@@ -109,7 +109,7 @@
protected static final AxisAlignedBB field_185593_b = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.9375D, 0.9375D);
@@ -110,8 +110,8 @@
}
}
Block block = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b()).func_177230_c();
- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m;
+ return block.canSustainPlant(p_176586_1_, p_176586_2_.func_177977_b(), EnumFacing.UP, this);
- Block block = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b()).func_177230_c();
- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m && !p_176586_1_.func_180495_p(p_176586_2_.func_177984_a()).func_185904_a().func_76224_d();
+ IBlockState state = p_176586_1_.func_180495_p(p_176586_2_.func_177977_b());
+ return state.func_177230_c().canSustainPlant(state, p_176586_1_, p_176586_2_, EnumFacing.UP, this) && !p_176586_1_.func_180495_p(p_176586_2_.func_177984_a()).func_185904_a().func_76224_d();
}
public void func_180634_a(World p_180634_1_, BlockPos p_180634_2_, IBlockState p_180634_3_, Entity p_180634_4_)
@@ -137,4 +137,16 @@
{
return new BlockState(this, new IProperty[] {field_176587_a});
@@ -135,6 +135,18 @@
return ((Integer)p_176201_1_.func_177229_b(field_176587_a)).intValue();
}
+
+ @Override
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
@ -34,4 +35,7 @@
+ {
+ return func_176223_P();
+ }
}
+
protected BlockStateContainer func_180661_e()
{
return new BlockStateContainer(this, new IProperty[] {field_176587_a});

View File

@ -1,11 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockChest.java
+++ ../src-work/minecraft/net/minecraft/block/BlockChest.java
@@ -527,7 +527,7 @@
@@ -506,7 +506,7 @@
private boolean func_176456_n(World p_176456_1_, BlockPos p_176456_2_)
{
- return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).func_177230_c().func_149721_r();
+ return p_176456_1_.isSideSolid(p_176456_2_.func_177984_a(), EnumFacing.DOWN, false);
- return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).func_185915_l();
+ return p_176456_1_.func_180495_p(p_176456_2_.func_177984_a()).isSideSolid(p_176456_1_, p_176456_2_, EnumFacing.DOWN);
}
private boolean func_176453_o(World p_176453_1_, BlockPos p_176453_2_)

View File

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java
+++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java
@@ -137,7 +137,14 @@
@@ -131,7 +131,14 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
@ -16,7 +16,7 @@
int j = 1;
if (i >= 2)
@@ -147,8 +154,9 @@
@@ -141,8 +148,9 @@
for (int k = 0; k < j; ++k)
{
@ -26,4 +26,4 @@
+ return dropped;
}
@SideOnly(Side.CLIENT)
public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_)

View File

@ -1,11 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockCrops.java
+++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java
@@ -81,11 +81,11 @@
@@ -116,11 +116,11 @@
float f1 = 0.0F;
IBlockState iblockstate = p_180672_1_.func_180495_p(blockpos.func_177982_a(i, 0, j));
- if (iblockstate.func_177230_c() == Blocks.field_150458_ak)
+ if (iblockstate.func_177230_c().canSustainPlant(p_180672_1_, blockpos.func_177982_a(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)p_180672_0_))
+ if (iblockstate.func_177230_c().canSustainPlant(iblockstate, p_180672_1_, blockpos.func_177982_a(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)p_180672_0_))
{
f1 = 1.0F;
@ -14,45 +14,20 @@
{
f1 = 3.0F;
}
@@ -126,7 +126,7 @@
@@ -161,7 +161,8 @@
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
{
- return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c());
+ return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c().canSustainPlant(p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
- return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()));
+ IBlockState soil = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b());
+ return (p_180671_1_.func_175699_k(p_180671_2_) >= 8 || p_180671_1_.func_175678_i(p_180671_2_)) && soil.func_177230_c().canSustainPlant(soil, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this);
}
protected Item func_149866_i()
@@ -142,24 +142,6 @@
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, 0);
-
- if (!p_180653_1_.field_72995_K)
- {
- int i = ((Integer)p_180653_3_.func_177229_b(field_176488_a)).intValue();
-
- if (i >= 7)
- {
- int j = 3 + p_180653_5_;
-
- for (int k = 0; k < j; ++k)
- {
- if (p_180653_1_.field_73012_v.nextInt(15) <= i)
- {
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(this.func_149866_i(), 1, 0));
- }
- }
- }
- }
@@ -174,11 +175,33 @@
return Items.field_151015_O;
}
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
@@ -202,4 +184,26 @@
{
return new BlockState(this, new IProperty[] {field_176488_a});
}
+
+ @Override
+ public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
@ -74,4 +49,13 @@
+ }
+ return ret;
+ }
}
+
public void func_180653_a(World p_180653_1_, BlockPos p_180653_2_, IBlockState p_180653_3_, float p_180653_4_, int p_180653_5_)
{
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, 0);
- if (!p_180653_1_.field_72995_K)
+ if (false && !p_180653_1_.field_72995_K) // Forge: NOP all this.
{
int i = this.func_185527_x(p_180653_3_);

View File

@ -1,26 +1,25 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDeadBush.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDeadBush.java
@@ -14,7 +14,7 @@
import net.minecraft.util.BlockPos;
@@ -16,7 +16,7 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-public class BlockDeadBush extends BlockBush
+public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable
{
protected BlockDeadBush()
{
@@ -45,14 +45,15 @@
protected static final AxisAlignedBB field_185516_a = new AxisAlignedBB(0.09999999403953552D, 0.0D, 0.09999999403953552D, 0.8999999761581421D, 0.800000011920929D, 0.8999999761581421D);
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
@@ -57,7 +57,7 @@
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_, ItemStack p_180657_6_)
{
- if (!p_180657_1_.field_72995_K && p_180657_2_.func_71045_bC() != null && p_180657_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
- if (!p_180657_1_.field_72995_K && p_180657_6_ != null && p_180657_6_.func_77973_b() == Items.field_151097_aZ)
+ if (false && !p_180657_1_.field_72995_K && p_180657_6_ != null && p_180657_6_.func_77973_b() == Items.field_151097_aZ) // Forge: Noop
{
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150330_I, 1, 0));
- }
- else
- {
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
p_180657_2_.func_71029_a(StatList.func_188055_a(this));
func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150330_I, 1, 0));
@@ -67,4 +67,11 @@
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
}
}
+
@ -28,6 +27,6 @@
+ @Override
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return new java.util.ArrayList<ItemStack>(java.util.Arrays.asList(new ItemStack(Blocks.field_150330_I)));
+ return java.util.Arrays.asList(new ItemStack(Blocks.field_150330_I));
+ }
}

View File

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDoor.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java
@@ -154,7 +154,7 @@
@@ -107,7 +107,7 @@
{
if (this.field_149764_J == Material.field_151573_f)
{
@ -9,12 +9,12 @@
}
else
{
@@ -272,7 +272,7 @@
@@ -219,7 +219,7 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return p_176196_2_.func_177956_o() >= 255 ? false : World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a());
+ return p_176196_2_.func_177956_o() >= p_176196_1_.func_72800_K() - 1 ? false : World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a());
- return p_176196_2_.func_177956_o() >= 255 ? false : p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q() && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a());
+ return p_176196_2_.func_177956_o() >= p_176196_1_.func_72800_K() - 1 ? false : p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).isSideSolid(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP) && super.func_176196_c(p_176196_1_, p_176196_2_) && super.func_176196_c(p_176196_1_, p_176196_2_.func_177984_a());
}
public int func_149656_h()
public EnumPushReaction func_149656_h(IBlockState p_149656_1_)

View File

@ -9,7 +9,7 @@
{
public static final PropertyEnum<BlockDoublePlant.EnumPlantType> field_176493_a = PropertyEnum.<BlockDoublePlant.EnumPlantType>func_177709_a("variant", BlockDoublePlant.EnumPlantType.class);
public static final PropertyEnum<BlockDoublePlant.EnumBlockHalf> field_176492_b = PropertyEnum.<BlockDoublePlant.EnumBlockHalf>func_177709_a("half", BlockDoublePlant.EnumBlockHalf.class);
@@ -90,6 +90,8 @@
@@ -88,6 +88,8 @@
Block block = (Block)(flag ? this : p_176475_1_.func_180495_p(blockpos).func_177230_c());
Block block1 = (Block)(flag ? p_176475_1_.func_180495_p(blockpos1).func_177230_c() : this);
@ -18,7 +18,7 @@
if (block == this)
{
p_176475_1_.func_180501_a(blockpos, Blocks.field_150350_a.func_176223_P(), 2);
@@ -98,17 +100,13 @@
@@ -96,17 +98,13 @@
if (block1 == this)
{
p_176475_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 3);
@ -37,24 +37,24 @@
if (p_180671_3_.func_177229_b(field_176492_b) == BlockDoublePlant.EnumBlockHalf.UPPER)
{
return p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c() == this;
@@ -158,7 +156,6 @@
@@ -149,7 +147,6 @@
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_)
public void func_180657_a(World p_180657_1_, EntityPlayer p_180657_2_, BlockPos p_180657_3_, IBlockState p_180657_4_, TileEntity p_180657_5_, ItemStack p_180657_6_)
{
- if (p_180657_1_.field_72995_K || p_180657_2_.func_71045_bC() == null || p_180657_2_.func_71045_bC().func_77973_b() != Items.field_151097_aZ || p_180657_4_.func_177229_b(field_176492_b) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.func_176489_b(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_))
- if (p_180657_1_.field_72995_K || p_180657_6_ == null || p_180657_6_.func_77973_b() != Items.field_151097_aZ || p_180657_4_.func_177229_b(field_176492_b) != BlockDoublePlant.EnumBlockHalf.LOWER || !this.func_176489_b(p_180657_1_, p_180657_3_, p_180657_4_, p_180657_2_))
{
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
}
@@ -221,8 +218,6 @@
@@ -212,8 +209,6 @@
else
{
p_176489_4_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
p_176489_4_.func_71029_a(StatList.func_188055_a(this));
- int i = (blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS ? BlockTallGrass.EnumType.GRASS : BlockTallGrass.EnumType.FERN).func_177044_a();
- func_180635_a(p_176489_1_, p_176489_2_, new ItemStack(Blocks.field_150329_H, 2, i));
return true;
}
}
@@ -293,6 +288,32 @@
@@ -284,6 +279,33 @@
return Block.EnumOffsetType.XZ;
}
@ -65,6 +65,7 @@
+ EnumPlantType type = (EnumPlantType)state.func_177229_b(field_176493_a);
+ return state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && (type == EnumPlantType.FERN || type == EnumPlantType.GRASS);
+ }
+
+ @Override
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
@ -74,11 +75,11 @@
+ if (type == EnumPlantType.GRASS) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.GRASS.func_177044_a()));
+ return ret;
+ }
+
+ @Override
+ public boolean removedByPlayer(World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
+ public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
+ {
+ //Forge: Break both parts on the client to prevent the top part flickering as default type for a few frames.
+ IBlockState state = world.func_180495_p(pos);
+ if (state.func_177230_c() == this && state.func_177229_b(field_176492_b) == EnumBlockHalf.LOWER && world.func_180495_p(pos.func_177984_a()).func_177230_c() == this)
+ world.func_175698_g(pos.func_177984_a());
+ return world.func_175698_g(pos);

View File

@ -0,0 +1,20 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDragonEgg.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDragonEgg.java
@@ -48,7 +48,7 @@
private void func_180683_d(World p_180683_1_, BlockPos p_180683_2_)
{
- if (BlockFalling.func_185759_i(p_180683_1_.func_180495_p(p_180683_2_.func_177977_b())) && p_180683_2_.func_177956_o() >= 0)
+ if (p_180683_1_.func_175623_d(p_180683_2_.func_177977_b()) && BlockFalling.func_185759_i(p_180683_1_.func_180495_p(p_180683_2_.func_177977_b())) && p_180683_2_.func_177956_o() >= 0)
{
int i = 32;
@@ -61,7 +61,7 @@
p_180683_1_.func_175698_g(p_180683_2_);
BlockPos blockpos;
- for (blockpos = p_180683_2_; BlockFalling.func_185759_i(p_180683_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b())
+ for (blockpos = p_180683_2_; p_180683_1_.func_175623_d(blockpos) && BlockFalling.func_185759_i(p_180683_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b())
{
;
}

View File

@ -1,10 +1,20 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFalling.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java
@@ -86,6 +86,7 @@
@@ -44,7 +44,7 @@
public static boolean func_180685_d(World p_180685_0_, BlockPos p_180685_1_)
private void func_176503_e(World p_176503_1_, BlockPos p_176503_2_)
{
+ if (p_180685_0_.func_175623_d(p_180685_1_)) return true;
Block block = p_180685_0_.func_180495_p(p_180685_1_).func_177230_c();
Material material = block.field_149764_J;
return block == Blocks.field_150480_ab || material == Material.field_151579_a || material == Material.field_151586_h || material == Material.field_151587_i;
- if (func_185759_i(p_176503_1_.func_180495_p(p_176503_2_.func_177977_b())) && p_176503_2_.func_177956_o() >= 0)
+ if (p_176503_1_.func_175623_d(p_176503_2_) && func_185759_i(p_176503_1_.func_180495_p(p_176503_2_.func_177977_b())) && p_176503_2_.func_177956_o() >= 0)
{
int i = 32;
@@ -62,7 +62,7 @@
p_176503_1_.func_175698_g(p_176503_2_);
BlockPos blockpos;
- for (blockpos = p_176503_2_.func_177977_b(); func_185759_i(p_176503_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b())
+ for (blockpos = p_176503_2_.func_177977_b(); p_176503_1_.func_175623_d(blockpos) && func_185759_i(p_176503_1_.func_180495_p(blockpos)) && blockpos.func_177956_o() > 0; blockpos = blockpos.func_177977_b())
{
;
}

View File

@ -1,11 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java
@@ -89,7 +89,7 @@
@@ -87,7 +87,7 @@
private boolean func_176529_d(World p_176529_1_, BlockPos p_176529_2_)
{
Block block = p_176529_1_.func_180495_p(p_176529_2_.func_177984_a()).func_177230_c();
- return block instanceof BlockCrops || block instanceof BlockStem;
+ return block instanceof net.minecraftforge.common.IPlantable && canSustainPlant(p_176529_1_, p_176529_2_, net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)block);
+ return block instanceof net.minecraftforge.common.IPlantable && canSustainPlant(p_176529_1_.func_180495_p(p_176529_2_), p_176529_1_, p_176529_2_, net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)block);
}
private boolean func_176530_e(World p_176530_1_, BlockPos p_176530_2_)

View File

@ -1,34 +1,23 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFire.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFire.java
@@ -41,18 +41,24 @@
int j = p_176221_3_.func_177956_o();
int k = p_176221_3_.func_177952_p();
@@ -37,7 +37,15 @@
- if (!World.func_175683_a(p_176221_2_, p_176221_3_.func_177977_b()) && !Blocks.field_150480_ab.func_176535_e(p_176221_2_, p_176221_3_.func_177977_b()))
+ if (!World.func_175683_a(p_176221_2_, p_176221_3_.func_177977_b()) && !Blocks.field_150480_ab.canCatchFire(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP))
{
boolean flag = (i + j + k & 1) == 1;
boolean flag1 = (i / 2 + j / 2 + k / 2 & 1) == 1;
int l = 0;
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
{
- return !p_176221_2_.func_180495_p(p_176221_3_.func_177977_b()).func_185896_q() && !Blocks.field_150480_ab.func_176535_e(p_176221_2_, p_176221_3_.func_177977_b()) ? p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177978_c()))).func_177226_a(field_176546_O, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177974_f()))).func_177226_a(field_176541_P, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177968_d()))).func_177226_a(field_176539_Q, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177976_e()))).func_177226_a(field_176542_R, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177984_a()))) : this.func_176223_P();
+ if (!p_176221_2_.func_180495_p(p_176221_3_.func_177977_b()).isSideSolid(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP) && !Blocks.field_150480_ab.canCatchFire(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP))
+ {
+ return p_176221_1_.func_177226_a(field_176545_N, this.canCatchFire(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH))
+ .func_177226_a(field_176546_O, this.canCatchFire(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.WEST))
+ .func_177226_a(field_176541_P, this.canCatchFire(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH))
+ .func_177226_a(field_176539_Q, this.canCatchFire(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST))
+ .func_177226_a(field_176542_R, this.canCatchFire(p_176221_2_, p_176221_3_.func_177984_a(), EnumFacing.DOWN));
+ }
+ return this.func_176223_P();
}
- if (this.func_176535_e(p_176221_2_, p_176221_3_.func_177984_a()))
+ if (this.canCatchFire(p_176221_2_, p_176221_3_.func_177984_a(), EnumFacing.DOWN))
{
l = flag ? 1 : 2;
}
- return p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177978_c()))).func_177226_a(field_176546_O, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177974_f()))).func_177226_a(field_176541_P, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177968_d()))).func_177226_a(field_176539_Q, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177976_e()))).func_177226_a(field_176542_R, Integer.valueOf(l)).func_177226_a(field_176540_b, Boolean.valueOf(flag1)).func_177226_a(field_176544_M, Boolean.valueOf(flag));
+ return p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH)))
+ .func_177226_a(field_176546_O, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.EAST )))
+ .func_177226_a(field_176541_P, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH)))
+ .func_177226_a(field_176539_Q, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST )))
+ .func_177226_a(field_176542_R, Integer.valueOf(l))
+ .func_177226_a(field_176540_b, Boolean.valueOf(flag1))
+ .func_177226_a(field_176544_M, Boolean.valueOf(flag));
}
else
{
@@ -108,6 +114,7 @@
protected BlockFire()
@@ -90,6 +98,7 @@
public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_)
{
@ -36,7 +25,7 @@
this.field_149849_a.put(p_180686_1_, Integer.valueOf(p_180686_2_));
this.field_149848_b.put(p_180686_1_, Integer.valueOf(p_180686_3_));
}
@@ -147,13 +154,8 @@
@@ -129,13 +138,8 @@
}
Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c();
@ -48,10 +37,19 @@
- flag = true;
- }
-
if (!flag && p_180650_1_.func_72896_J() && this.func_176537_d(p_180650_1_, p_180650_2_))
{
p_180650_1_.func_175698_g(p_180650_2_);
@@ -182,7 +184,7 @@
int i = ((Integer)p_180650_3_.func_177229_b(field_176543_a)).intValue();
if (!flag && p_180650_1_.func_72896_J() && this.func_176537_d(p_180650_1_, p_180650_2_) && p_180650_4_.nextFloat() < 0.2F + (float)i * 0.03F)
@@ -156,7 +160,7 @@
{
if (!this.func_176533_e(p_180650_1_, p_180650_2_))
{
- if (!p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_185896_q() || i > 3)
+ if (!p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).isSideSolid(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP) || i > 3)
{
p_180650_1_.func_175698_g(p_180650_2_);
}
@@ -164,7 +168,7 @@
return;
}
@ -60,7 +58,7 @@
{
p_180650_1_.func_175698_g(p_180650_2_);
return;
@@ -197,12 +199,12 @@
@@ -179,12 +183,12 @@
j = -50;
}
@ -79,7 +77,7 @@
for (int k = -1; k <= 1; ++k)
{
@@ -261,22 +263,30 @@
@@ -243,45 +247,53 @@
return false;
}
@ -104,14 +102,44 @@
+ this.tryCatchFire(p_176536_1_, p_176536_2_, p_176536_3_, p_176536_4_, p_176536_5_, EnumFacing.UP);
+ }
+ private void tryCatchFire(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_, EnumFacing face)
- if (p_176536_4_.nextInt(p_176536_3_) < i)
+ private void tryCatchFire(World worldIn, BlockPos pos, int chance, Random random, int age, EnumFacing face)
+ {
+ int i = p_176536_1_.func_180495_p(p_176536_2_).func_177230_c().getFlammability(p_176536_1_, p_176536_2_, face);
+ int i = worldIn.func_180495_p(pos).func_177230_c().getFlammability(worldIn, pos, face);
+
if (p_176536_4_.nextInt(p_176536_3_) < i)
+ if (random.nextInt(chance) < i)
{
IBlockState iblockstate = p_176536_1_.func_180495_p(p_176536_2_);
@@ -308,7 +318,7 @@
- IBlockState iblockstate = p_176536_1_.func_180495_p(p_176536_2_);
+ IBlockState iblockstate = worldIn.func_180495_p(pos);
- if (p_176536_4_.nextInt(p_176536_5_ + 10) < 5 && !p_176536_1_.func_175727_C(p_176536_2_))
+ if (random.nextInt(age + 10) < 5 && !worldIn.func_175727_C(pos))
{
- int j = p_176536_5_ + p_176536_4_.nextInt(5) / 4;
+ int j = age + random.nextInt(5) / 4;
if (j > 15)
{
j = 15;
}
- p_176536_1_.func_180501_a(p_176536_2_, this.func_176223_P().func_177226_a(field_176543_a, Integer.valueOf(j)), 3);
+ worldIn.func_180501_a(pos, this.func_176223_P().func_177226_a(field_176543_a, Integer.valueOf(j)), 3);
}
else
{
- p_176536_1_.func_175698_g(p_176536_2_);
+ worldIn.func_175698_g(pos);
}
if (iblockstate.func_177230_c() == Blocks.field_150335_W)