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 @@
}
}
public boolean func_176212_b(IBlockAccess p_176212_1_, BlockPos p_176212_2_, EnumFacing p_176212_3_)
@@ -453,6 +459,10 @@
- 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());
}
@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();
+ }
+
+ /**
@ -1230,7 +1257,7 @@
+ * @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;
+ }
@ -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))
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
{
boolean flag = (i + j + k & 1) == 1;
boolean flag1 = (i / 2 + j / 2 + k / 2 & 1) == 1;
int l = 0;
- 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_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();
}
- 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_))
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_);
@@ -182,7 +184,7 @@
}
@@ -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)
{
- Blocks.field_150335_W.func_176206_d(p_176536_1_, p_176536_2_, iblockstate.func_177226_a(BlockTNT.field_176246_a, Boolean.valueOf(true)));
+ Blocks.field_150335_W.func_176206_d(worldIn, pos, iblockstate.func_177226_a(BlockTNT.field_176246_a, Boolean.valueOf(true)));
}
}
}
@@ -290,7 +302,7 @@
{
for (EnumFacing enumfacing : EnumFacing.values())
{
@ -120,7 +148,7 @@
{
return true;
}
@@ -329,7 +339,7 @@
@@ -311,7 +323,7 @@
for (EnumFacing enumfacing : EnumFacing.values())
{
@ -129,7 +157,7 @@
}
return i;
@@ -341,9 +351,10 @@
@@ -323,9 +335,10 @@
return false;
}
@ -141,57 +169,57 @@
}
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
@@ -382,9 +393,9 @@
p_180655_1_.func_72980_b((double)((float)p_180655_2_.func_177958_n() + 0.5F), (double)((float)p_180655_2_.func_177956_o() + 0.5F), (double)((float)p_180655_2_.func_177952_p() + 0.5F), "fire.fire", 1.0F + p_180655_4_.nextFloat(), p_180655_4_.nextFloat() * 0.7F + 0.3F, false);
@@ -364,9 +377,9 @@
p_180655_2_.func_184134_a((double)((float)p_180655_3_.func_177958_n() + 0.5F), (double)((float)p_180655_3_.func_177956_o() + 0.5F), (double)((float)p_180655_3_.func_177952_p() + 0.5F), SoundEvents.field_187643_bs, SoundCategory.BLOCKS, 1.0F + p_180655_4_.nextFloat(), p_180655_4_.nextFloat() * 0.7F + 0.3F, false);
}
- if (!World.func_175683_a(p_180655_1_, p_180655_2_.func_177977_b()) && !Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177977_b()))
+ if (!World.func_175683_a(p_180655_1_, p_180655_2_.func_177977_b()) && !Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177977_b(), EnumFacing.UP))
- if (!p_180655_2_.func_180495_p(p_180655_3_.func_177977_b()).func_185896_q() && !Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177977_b()))
+ if (!p_180655_2_.func_180495_p(p_180655_3_.func_177977_b()).isSideSolid(p_180655_2_, p_180655_3_.func_177977_b(), EnumFacing.UP) && !Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177977_b(), EnumFacing.UP))
{
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177976_e()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177976_e(), EnumFacing.EAST))
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177976_e()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177976_e(), EnumFacing.EAST))
{
for (int j = 0; j < 2; ++j)
{
@@ -395,7 +406,7 @@
@@ -377,7 +390,7 @@
}
}
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177974_f()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177974_f(), EnumFacing.WEST))
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177974_f()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177974_f(), EnumFacing.WEST))
{
for (int k = 0; k < 2; ++k)
{
@@ -406,7 +417,7 @@
@@ -388,7 +401,7 @@
}
}
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177978_c()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177978_c(), EnumFacing.SOUTH))
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177978_c()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177978_c(), EnumFacing.SOUTH))
{
for (int l = 0; l < 2; ++l)
{
@@ -417,7 +428,7 @@
@@ -399,7 +412,7 @@
}
}
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177968_d()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177968_d(), EnumFacing.NORTH))
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177968_d()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177968_d(), EnumFacing.NORTH))
{
for (int i1 = 0; i1 < 2; ++i1)
{
@@ -428,7 +439,7 @@
@@ -410,7 +423,7 @@
}
}
- if (Blocks.field_150480_ab.func_176535_e(p_180655_1_, p_180655_2_.func_177984_a()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_1_, p_180655_2_.func_177984_a(), EnumFacing.DOWN))
- if (Blocks.field_150480_ab.func_176535_e(p_180655_2_, p_180655_3_.func_177984_a()))
+ if (Blocks.field_150480_ab.canCatchFire(p_180655_2_, p_180655_3_.func_177984_a(), EnumFacing.DOWN))
{
for (int j1 = 0; j1 < 2; ++j1)
{
@@ -476,4 +487,19 @@
@@ -458,4 +471,19 @@
{
return new BlockState(this, new IProperty[] {field_176543_a, field_176545_N, field_176546_O, field_176541_P, field_176539_Q, field_176542_R, field_176540_b, field_176544_M});
return new BlockStateContainer(this, new IProperty[] {field_176543_a, field_176545_N, field_176546_O, field_176541_P, field_176539_Q, field_176542_R});
}
+
+ /*================================= Forge Start ======================================*/

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java
@@ -169,13 +169,6 @@
@@ -148,13 +148,6 @@
public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_)
{
@ -14,8 +14,8 @@
super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
}
@@ -395,6 +388,31 @@
return EnumWorldBlockLayer.CUTOUT;
@@ -374,6 +367,31 @@
return BlockRenderLayer.CUTOUT;
}
+
@ -30,15 +30,15 @@
+ 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)
+ {
+ if (willHarvest) return true; //If it will harvest, delay deletion of the block until after getDrops
+ return super.removedByPlayer(world, pos, player, willHarvest);
+ return super.removedByPlayer(state, world, pos, player, willHarvest);
+ }
+ @Override
+ public void func_180657_a(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te)
+ public void func_180657_a(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te, ItemStack tool)
+ {
+ super.func_180657_a(world, player, pos, state, te);
+ super.func_180657_a(world, player, pos, state, te, tool);
+ world.func_175698_g(pos);
+ }
+ /*===========================FORGE END==========================================*/

View file

@ -1,24 +1,24 @@
--- ../src-base/minecraft/net/minecraft/block/BlockGrass.java
+++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java
@@ -58,7 +58,7 @@
@@ -38,7 +38,7 @@
{
if (!p_180650_1_.field_72995_K)
{
- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().func_149717_k() > 2)
+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2)
- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_185891_c() > 2)
+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2)
{
p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P());
}
@@ -72,7 +72,7 @@
Block block = p_180650_1_.func_180495_p(blockpos.func_177984_a()).func_177230_c();
IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos);
@@ -58,7 +58,7 @@
IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos.func_177984_a());
IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos);
- if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && block.func_149717_k() <= 2)
+ if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && block.getLightOpacity(p_180650_1_, blockpos.func_177984_a()) <= 2)
- if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate.func_185891_c() <= 2)
+ if (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate.getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) <= 2)
{
p_180650_1_.func_175656_a(blockpos, Blocks.field_150349_c.func_176223_P());
}
@@ -110,7 +110,7 @@
@@ -96,7 +96,7 @@
{
if (j >= i / 16)
{

View file

@ -1,13 +1,13 @@
--- ../src-base/minecraft/net/minecraft/block/BlockHugeMushroom.java
+++ ../src-work/minecraft/net/minecraft/block/BlockHugeMushroom.java
@@ -79,6 +79,20 @@
return new BlockState(this, new IProperty[] {field_176380_a});
@@ -221,6 +221,20 @@
return new BlockStateContainer(this, new IProperty[] {field_176380_a});
}
+ 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 : (java.util.Set<IProperty<?>>)state.func_177228_b().keySet())
+ {
+ if (prop.func_177701_a().equals("variant"))
+ {

View file

@ -1,35 +1,34 @@
--- ../src-base/minecraft/net/minecraft/block/BlockIce.java
+++ ../src-work/minecraft/net/minecraft/block/BlockIce.java
@@ -38,14 +38,17 @@
p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
@@ -40,14 +40,19 @@
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.List<ItemStack> items = new java.util.ArrayList<ItemStack>();
ItemStack itemstack = this.func_180643_i(p_180657_4_);
- if (itemstack != null)
- {
if (itemstack != null)
{
- func_180635_a(p_180657_1_, p_180657_3_, itemstack);
- }
+ if (itemstack != null) 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_);
+ items.add(itemstack);
}
+
+ net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, p_180657_1_, p_180657_3_, p_180657_4_, 0, 1.0f, true, p_180657_2_);
+ for (ItemStack is : items)
+ func_180635_a(p_180657_1_, p_180657_3_, is);
}
else
{
@@ -56,7 +59,9 @@
@@ -58,7 +63,9 @@
}
int i = EnchantmentHelper.func_77517_e(p_180657_2_);
int i = EnchantmentHelper.func_77506_a(Enchantments.field_185308_t, p_180657_6_);
+ harvesters.set(p_180657_2_);
this.func_176226_b(p_180657_1_, p_180657_3_, p_180657_4_, i);
+ harvesters.set(null);
Material material = p_180657_1_.func_180495_p(p_180657_3_.func_177977_b()).func_177230_c().func_149688_o();
Material material = p_180657_1_.func_180495_p(p_180657_3_.func_177977_b()).func_185904_a();
if (material.func_76230_c() || material.func_76224_d())

View file

@ -1,30 +1,30 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLadder.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java
@@ -78,7 +78,10 @@
@@ -61,7 +61,10 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return p_176196_1_.func_180495_p(p_176196_2_.func_177976_e()).func_177230_c().func_149721_r() ? true : (p_176196_1_.func_180495_p(p_176196_2_.func_177974_f()).func_177230_c().func_149721_r() ? true : (p_176196_1_.func_180495_p(p_176196_2_.func_177978_c()).func_177230_c().func_149721_r() ? true : p_176196_1_.func_180495_p(p_176196_2_.func_177968_d()).func_177230_c().func_149721_r()));
+ return p_176196_1_.isSideSolid(p_176196_2_.func_177976_e(), EnumFacing.EAST, true) ||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177974_f(), EnumFacing.WEST, true) ||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177978_c(), EnumFacing.SOUTH, true) ||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177968_d(), EnumFacing.NORTH, true);
- return p_176196_1_.func_180495_p(p_176196_2_.func_177976_e()).func_185915_l() ? true : (p_176196_1_.func_180495_p(p_176196_2_.func_177974_f()).func_185915_l() ? true : (p_176196_1_.func_180495_p(p_176196_2_.func_177978_c()).func_185915_l() ? true : p_176196_1_.func_180495_p(p_176196_2_.func_177968_d()).func_185915_l()));
+ return p_176196_1_.func_180495_p(p_176196_2_.func_177976_e()).isSideSolid(p_176196_1_, p_176196_2_.func_177976_e(), EnumFacing.EAST) ||
+ p_176196_1_.func_180495_p(p_176196_2_.func_177974_f()).isSideSolid(p_176196_1_, p_176196_2_.func_177974_f(), EnumFacing.WEST) ||
+ p_176196_1_.func_180495_p(p_176196_2_.func_177978_c()).isSideSolid(p_176196_1_, p_176196_2_.func_177978_c(), EnumFacing.SOUTH) ||
+ p_176196_1_.func_180495_p(p_176196_2_.func_177968_d()).isSideSolid(p_176196_1_, p_176196_2_.func_177968_d(), EnumFacing.NORTH);
}
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_)
@@ -116,7 +119,7 @@
@@ -99,7 +102,7 @@
protected boolean func_176381_b(World p_176381_1_, BlockPos p_176381_2_, EnumFacing p_176381_3_)
{
- return p_176381_1_.func_180495_p(p_176381_2_.func_177972_a(p_176381_3_.func_176734_d())).func_177230_c().func_149721_r();
+ return p_176381_1_.isSideSolid(p_176381_2_.func_177972_a(p_176381_3_.func_176734_d()), p_176381_3_, true);
- return p_176381_1_.func_180495_p(p_176381_2_.func_177972_a(p_176381_3_.func_176734_d())).func_185915_l();
+ return p_176381_1_.func_180495_p(p_176381_2_.func_177972_a(p_176381_3_.func_176734_d())).isSideSolid(p_176381_1_, p_176381_2_.func_177972_a(p_176381_3_.func_176734_d()), p_176381_3_);
}
public IBlockState func_176203_a(int p_176203_1_)
@@ -146,4 +149,6 @@
@@ -139,4 +142,6 @@
{
return new BlockState(this, new IProperty[] {field_176382_a});
return new BlockStateContainer(this, new IProperty[] {field_176382_a});
}
+
+ @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; }
+ @Override public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) { return true; }
}

View file

@ -1,39 +1,39 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java
@@ -18,7 +18,7 @@
@@ -17,7 +17,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public abstract class BlockLeaves extends BlockLeavesBase
+public abstract class BlockLeaves extends BlockLeavesBase implements net.minecraftforge.common.IShearable
-public abstract class BlockLeaves extends Block
+public abstract class BlockLeaves extends Block implements net.minecraftforge.common.IShearable
{
public static final PropertyBool field_176237_a = PropertyBool.func_177716_a("decayable");
public static final PropertyBool field_176236_b = PropertyBool.func_177716_a("check_decay");
@@ -75,9 +75,9 @@
@@ -53,9 +53,9 @@
BlockPos blockpos = p_180663_2_.func_177982_a(j1, k1, l1);
IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos);
- if (iblockstate.func_177230_c().func_149688_o() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(field_176236_b)).booleanValue())
+ if (iblockstate.func_177230_c().isLeaves(p_180663_1_, blockpos))
- if (iblockstate.func_185904_a() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(field_176236_b)).booleanValue())
+ if (iblockstate.func_177230_c().isLeaves(iblockstate, p_180663_1_, blockpos))
{
- p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(field_176236_b, Boolean.valueOf(true)), 4);
+ iblockstate.func_177230_c().beginLeavesDecay(p_180663_1_, blockpos);
+ iblockstate.func_177230_c().beginLeavesDecay(iblockstate, p_180663_1_, blockpos);
}
}
}
@@ -117,9 +117,9 @@
{
Block block = p_180650_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)).func_177230_c();
@@ -96,9 +96,9 @@
IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2));
Block block = iblockstate.func_177230_c();
- if (block != Blocks.field_150364_r && block != Blocks.field_150363_s)
+ if (!block.canSustainLeaves(p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)))
+ if (!block.canSustainLeaves(iblockstate, p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)))
{
- if (block.func_149688_o() == Material.field_151584_j)
+ if (block.isLeaves(p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)))
- if (iblockstate.func_185904_a() == Material.field_151584_j)
+ if (block.isLeaves(iblockstate, p_180650_1_, blockpos$mutableblockpos.func_181079_c(k + i2, l + j2, i1 + k2)))
{
this.field_150128_a[(i2 + l1) * k1 + (j2 + l1) * j1 + k2 + l1] = -2;
}
@@ -226,40 +226,7 @@
@@ -205,40 +205,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_)
{
@ -75,18 +75,16 @@
}
protected void func_176234_a(World p_176234_1_, BlockPos p_176234_2_, IBlockState p_176234_3_, int p_176234_4_)
@@ -296,4 +263,48 @@
}
@@ -274,6 +241,49 @@
public abstract BlockPlanks.EnumType func_176233_b(int p_176233_1_);
+
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
+ @Override public boolean isLeaves(IBlockAccess world, BlockPos pos){ return true; }
+ @Override public boolean isLeaves(IBlockState state, IBlockAccess world, BlockPos pos){ return true; }
+
+ @Override
+ public void beginLeavesDecay(World world, BlockPos pos)
+ public void beginLeavesDecay(IBlockState state, World world, BlockPos pos)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ if (!(Boolean)state.func_177229_b(field_176236_b))
+ {
+ world.func_180501_a(pos, state.func_177226_a(field_176236_b, true), 4);
@ -123,4 +121,7 @@
+ return ret;
+ }
+
}
+
@SideOnly(Side.CLIENT)
public boolean func_176225_a(IBlockState p_176225_1_, IBlockAccess p_176225_2_, BlockPos p_176225_3_, EnumFacing p_176225_4_)
{

View file

@ -1,7 +1,7 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLever.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLever.java
@@ -237,6 +237,12 @@
return new BlockState(this, new IProperty[] {field_176360_a, field_176359_b});
@@ -295,6 +295,12 @@
return new BlockStateContainer(this, new IProperty[] {field_176360_a, field_176359_b});
}
+

View file

@ -1,22 +1,22 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLog.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLog.java
@@ -33,9 +33,9 @@
@@ -34,9 +34,9 @@
{
IBlockState iblockstate = p_180663_1_.func_180495_p(blockpos);
- if (iblockstate.func_177230_c().func_149688_o() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(BlockLeaves.field_176236_b)).booleanValue())
+ if (iblockstate.func_177230_c().isLeaves(p_180663_1_, blockpos))
- if (iblockstate.func_185904_a() == Material.field_151584_j && !((Boolean)iblockstate.func_177229_b(BlockLeaves.field_176236_b)).booleanValue())
+ if (iblockstate.func_177230_c().isLeaves(iblockstate, p_180663_1_, blockpos))
{
- p_180663_1_.func_180501_a(blockpos, iblockstate.func_177226_a(BlockLeaves.field_176236_b, Boolean.valueOf(true)), 4);
+ iblockstate.func_177230_c().beginLeavesDecay(p_180663_1_, blockpos);
+ iblockstate.func_177230_c().beginLeavesDecay(iblockstate, p_180663_1_, blockpos);
}
}
}
@@ -46,6 +46,9 @@
return super.func_180642_a(p_180642_1_, p_180642_2_, p_180642_3_, p_180642_4_, p_180642_5_, p_180642_6_, p_180642_7_, p_180642_8_).func_177226_a(field_176299_a, BlockLog.EnumAxis.func_176870_a(p_180642_3_.func_176740_k()));
@@ -69,6 +69,9 @@
}
}
+ @Override public boolean canSustainLeaves(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+ @Override public boolean canSustainLeaves(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+ @Override public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+
public static enum EnumAxis implements IStringSerializable

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java
+++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java
@@ -37,10 +37,14 @@
@@ -39,10 +39,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_)
{
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
@ -9,11 +9,11 @@
}
+ @Override
+ public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15);
+ }
+
public boolean func_149662_c()
public boolean func_149662_c(IBlockState p_149662_1_)
{
return false;

View file

@ -1,11 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java
+++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java
@@ -71,7 +71,7 @@
@@ -78,7 +78,7 @@
if (p_180671_2_.func_177956_o() >= 0 && p_180671_2_.func_177956_o() < 256)
{
IBlockState iblockstate = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b());
- return iblockstate.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && this.func_149854_a(iblockstate.func_177230_c()));
+ return iblockstate.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && iblockstate.func_177230_c().canSustainPlant(p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this));
- return iblockstate.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && this.func_185514_i(iblockstate));
+ return iblockstate.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && iblockstate.func_177230_c().canSustainPlant(iblockstate, p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this));
}
else
{

View file

@ -4,17 +4,17 @@
{
if (!p_180650_1_.field_72995_K)
{
- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().func_149717_k() > 2)
+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_177230_c().getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2)
- if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).func_185891_c() > 2)
+ if (p_180650_1_.func_175671_l(p_180650_2_.func_177984_a()) < 4 && p_180650_1_.func_180495_p(p_180650_2_.func_177984_a()).getLightOpacity(p_180650_1_, p_180650_2_.func_177984_a()) > 2)
{
p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P().func_177226_a(BlockDirt.field_176386_a, BlockDirt.DirtType.DIRT));
}
@@ -53,7 +53,7 @@
IBlockState iblockstate = p_180650_1_.func_180495_p(blockpos);
Block block = p_180650_1_.func_180495_p(blockpos.func_177984_a()).func_177230_c();
IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos.func_177984_a());
- if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && block.func_149717_k() <= 2)
+ if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && block.getLightOpacity(p_180650_1_, blockpos.func_177984_a()) <= 2)
- if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate1.func_185891_c() <= 2)
+ if (iblockstate.func_177230_c() == Blocks.field_150346_d && iblockstate.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.DIRT && p_180650_1_.func_175671_l(blockpos.func_177984_a()) >= 4 && iblockstate1.getLightOpacity(p_180650_1_, blockpos.func_177984_a()) <= 2)
{
p_180650_1_.func_175656_a(blockpos, this.func_176223_P());
}

View file

@ -1,15 +1,15 @@
--- ../src-base/minecraft/net/minecraft/block/BlockNetherWart.java
+++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java
@@ -38,7 +38,7 @@
@@ -42,7 +42,7 @@
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());
- return this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()));
+ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_);
}
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
@@ -54,9 +54,11 @@
@@ -58,9 +58,11 @@
super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_);
}
@ -22,11 +22,10 @@
{
int i = 1;
@@ -107,4 +109,24 @@
{
return new BlockState(this, new IProperty[] {field_176486_a});
@@ -106,6 +108,26 @@
return ((Integer)p_176201_1_.func_177229_b(field_176486_a)).intValue();
}
+
+ @Override
+ public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
@ -46,4 +45,7 @@
+
+ return ret;
+ }
}
+
protected BlockStateContainer func_180661_e()
{
return new BlockStateContainer(this, new IProperty[] {field_176486_a});

View file

@ -1,24 +1,22 @@
--- ../src-base/minecraft/net/minecraft/block/BlockNewLeaf.java
+++ ../src-work/minecraft/net/minecraft/block/BlockNewLeaf.java
@@ -99,14 +99,15 @@
@@ -98,7 +98,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_)
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 this
{
- 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(Item.func_150898_a(this), 1, ((BlockPlanks.EnumType)p_180657_4_.func_177229_b(field_176240_P)).func_176839_a() - 4));
- }
- 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(Item.func_150898_a(this), 1, ((BlockPlanks.EnumType)p_180657_4_.func_177229_b(field_176240_P)).func_176839_a() - 4));
@@ -108,4 +108,10 @@
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_, p_180657_6_);
}
}
+
+ @Override
+ public List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, ((BlockPlanks.EnumType)state.func_177229_b(field_176240_P)).func_176839_a() - 4)));
+ return java.util.Arrays.asList(new ItemStack(this, 1, world.func_180495_p(pos).func_177229_b(field_176240_P).func_176839_a() - 4));
+ }
}

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/block/BlockNote.java
+++ ../src-work/minecraft/net/minecraft/block/BlockNote.java
@@ -58,7 +58,9 @@
@@ -64,7 +64,9 @@
if (tileentity instanceof TileEntityNote)
{
TileEntityNote tileentitynote = (TileEntityNote)tileentity;
@ -8,9 +8,9 @@
tileentitynote.func_145877_a();
+ if (old == tileentitynote.field_145879_a) return false;
tileentitynote.func_175108_a(p_180639_1_, p_180639_2_);
p_180639_4_.func_71029_a(StatList.field_181735_S);
p_180639_4_.func_71029_a(StatList.field_188087_U);
}
@@ -98,6 +100,10 @@
@@ -104,6 +106,10 @@
public boolean func_180648_a(World p_180648_1_, BlockPos p_180648_2_, IBlockState p_180648_3_, int p_180648_4_, int p_180648_5_)
{
@ -19,5 +19,5 @@
+ p_180648_4_ = e.instrument.ordinal();
+ p_180648_5_ = e.getVanillaNoteId();
float f = (float)Math.pow(2.0D, (double)(p_180648_5_ - 12) / 12.0D);
p_180648_1_.func_72908_a((double)p_180648_2_.func_177958_n() + 0.5D, (double)p_180648_2_.func_177956_o() + 0.5D, (double)p_180648_2_.func_177952_p() + 0.5D, "note." + this.func_176433_b(p_180648_4_), 3.0F, f);
p_180648_1_.func_184133_a((EntityPlayer)null, p_180648_2_, this.func_185576_e(p_180648_4_), SoundCategory.BLOCKS, 3.0F, f);
p_180648_1_.func_175688_a(EnumParticleTypes.NOTE, (double)p_180648_2_.func_177958_n() + 0.5D, (double)p_180648_2_.func_177956_o() + 1.2D, (double)p_180648_2_.func_177952_p() + 0.5D, (double)p_180648_5_ / 24.0D, 0.0D, 0.0D, new int[0]);

View file

@ -1,21 +1,28 @@
--- ../src-base/minecraft/net/minecraft/block/BlockOldLeaf.java
+++ ../src-work/minecraft/net/minecraft/block/BlockOldLeaf.java
@@ -142,11 +142,17 @@
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)
@@ -14,6 +14,7 @@
import net.minecraft.stats.StatList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
+import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -103,11 +104,16 @@
if (!p_180657_1_.field_72995_K && p_180657_6_ != null && p_180657_6_.func_77973_b() == Items.field_151097_aZ)
{
p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
p_180657_2_.func_71029_a(StatList.func_188055_a(this));
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Item.func_150898_a(this), 1, ((BlockPlanks.EnumType)p_180657_4_.func_177229_b(field_176239_P)).func_176839_a()));
}
else
{
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_);
}
}
+
+ @Override
+ public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ return new java.util.ArrayList(java.util.Arrays.asList(new ItemStack(this, 1, ((BlockPlanks.EnumType)state.func_177229_b(field_176239_P)).func_176839_a())));
+ return java.util.Arrays.asList(new ItemStack(this, 1, world.func_180495_p(pos).func_177229_b(field_176239_P).func_176839_a()));
+ }
}

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/block/BlockOre.java
+++ ../src-work/minecraft/net/minecraft/block/BlockOre.java
@@ -58,34 +58,40 @@
@@ -59,34 +59,39 @@
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_, p_180653_5_);
@ -8,9 +8,8 @@
- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this))
+ }
+ @Override
+ public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ IBlockState state = world.func_180495_p(pos);
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
+ if (this.func_180660_a(state, rand, fortune) != Item.func_150898_a(this))
{
@ -48,4 +47,4 @@
+ return 0;
}
public int func_176222_j(World p_176222_1_, BlockPos p_176222_2_)
public ItemStack func_185473_a(World p_185473_1_, BlockPos p_185473_2_, IBlockState p_185473_3_)

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPane.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPane.java
@@ -38,7 +38,10 @@
@@ -105,7 +105,10 @@
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
{
@ -12,30 +12,15 @@
}
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
@@ -64,10 +67,10 @@
public void func_180638_a(World p_180638_1_, BlockPos p_180638_2_, IBlockState p_180638_3_, AxisAlignedBB p_180638_4_, List<AxisAlignedBB> p_180638_5_, Entity p_180638_6_)
@@ -182,4 +185,11 @@
{
- boolean flag = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177978_c()).func_177230_c());
- boolean flag1 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177968_d()).func_177230_c());
- boolean flag2 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177976_e()).func_177230_c());
- boolean flag3 = this.func_150098_a(p_180638_1_.func_180495_p(p_180638_2_.func_177974_f()).func_177230_c());
+ boolean flag = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.NORTH);
+ boolean flag1 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.SOUTH);
+ boolean flag2 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.WEST);
+ boolean flag3 = this.canPaneConnectTo(p_180638_1_, p_180638_2_, EnumFacing.EAST);
if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1))
{
@@ -186,4 +189,11 @@
{
return new BlockState(this, new IProperty[] {field_176241_b, field_176242_M, field_176244_O, field_176243_N});
return new BlockStateContainer(this, new IProperty[] {field_176241_b, field_176242_M, field_176244_O, field_176243_N});
}
+
+ public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir)
+ {
+ BlockPos off = pos.func_177972_a(dir);
+ Block block = world.func_180495_p(off).func_177230_c();
+ return func_150098_a(block) || block.isSideSolid(world, off, dir.func_176734_d());
+ IBlockState state = world.func_180495_p(off);
+ return func_150098_a(state.func_177230_c()) || state.isSideSolid(world, off, dir.func_176734_d());
+ }
}

View file

@ -1,31 +1,31 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java
@@ -189,7 +189,7 @@
@@ -235,7 +235,7 @@
}
}
- if (!flag1 && block.func_149688_o() != Material.field_151579_a && func_180696_a(block, p_180648_1_, blockpos, enumfacing.func_176734_d(), false) && (block.func_149656_h() == 0 || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
+ if (!flag1 && !block.isAir(p_180648_1_, blockpos) && func_180696_a(block, p_180648_1_, blockpos, enumfacing.func_176734_d(), false) && (block.func_149656_h() == 0 || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
- if (!flag1 && iblockstate.func_185904_a() != Material.field_151579_a && func_185646_a(iblockstate, p_180648_1_, blockpos, enumfacing.func_176734_d(), false) && (iblockstate.func_185905_o() == EnumPushReaction.NORMAL || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
+ if (!flag1 && !iblockstate.func_177230_c().isAir(iblockstate, p_180648_1_, blockpos) && func_185646_a(iblockstate, p_180648_1_, blockpos, enumfacing.func_176734_d(), false) && (iblockstate.func_185905_o() == EnumPushReaction.NORMAL || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
{
this.func_176319_a(p_180648_1_, p_180648_2_, enumfacing, false);
}
@@ -333,7 +333,7 @@
@@ -320,7 +320,7 @@
return false;
}
- return !(p_180696_0_ instanceof ITileEntityProvider);
+ return !(p_180696_0_.hasTileEntity(p_180696_1_.func_180495_p(p_180696_2_)));
- return !block.func_149716_u();
+ return !block.hasTileEntity(p_185646_0_);
}
else
{
@@ -371,7 +371,9 @@
@@ -366,7 +366,9 @@
{
BlockPos blockpos = (BlockPos)list1.get(j);
Block block = p_176319_1_.func_180495_p(blockpos).func_177230_c();
- block.func_176226_b(p_176319_1_, blockpos, p_176319_1_.func_180495_p(blockpos), 0);
+ //With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior.
+ float chance = block instanceof BlockSnow ? -1.0f : 1.0f;
+ block.func_180653_a(p_176319_1_, blockpos, p_176319_1_.func_180495_p(blockpos), chance, 0);
p_176319_1_.func_175698_g(blockpos);
--i;
ablock[i] = block;
BlockPos blockpos1 = (BlockPos)list2.get(j);
IBlockState iblockstate = p_176319_1_.func_180495_p(blockpos1);
- iblockstate.func_177230_c().func_176226_b(p_176319_1_, blockpos1, iblockstate, 0);
+ // Forge: With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior.
+ float chance = iblockstate.func_177230_c() instanceof BlockSnow ? -1.0f : 1.0f;
+ iblockstate.func_177230_c().func_180653_a(p_176319_1_, blockpos1, iblockstate, chance, 0);
p_176319_1_.func_175698_g(blockpos1);
--k;
aiblockstate[k] = iblockstate;

View file

@ -1,32 +1,31 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPistonMoving.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonMoving.java
@@ -109,16 +109,7 @@
@@ -110,7 +110,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_)
{
- if (!p_180653_1_.field_72995_K)
- {
- TileEntityPiston tileentitypiston = this.func_176422_e(p_180653_1_, p_180653_2_);
-
- if (tileentitypiston != null)
- {
- IBlockState iblockstate = tileentitypiston.func_174927_b();
- iblockstate.func_177230_c().func_176226_b(p_180653_1_, p_180653_2_, iblockstate, 0);
- }
- }
+ if (false && !p_180653_1_.field_72995_K) // Forge: Noop this out
{
TileEntityPiston tileentitypiston = this.func_185589_c(p_180653_1_, p_180653_2_);
@@ -120,6 +120,7 @@
iblockstate.func_177230_c().func_176226_b(p_180653_1_, p_180653_2_, iblockstate, 0);
}
}
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
}
public MovingObjectPosition func_180636_a(World p_180636_1_, BlockPos p_180636_2_, Vec3 p_180636_3_, Vec3 p_180636_4_)
@@ -282,4 +273,16 @@
public RayTraceResult func_180636_a(IBlockState p_180636_1_, World p_180636_2_, BlockPos p_180636_3_, Vec3d p_180636_4_, Vec3d p_180636_5_)
@@ -190,4 +191,16 @@
{
return new BlockState(this, new IProperty[] {field_176426_a, field_176425_b});
return new BlockStateContainer(this, new IProperty[] {field_176426_a, field_176425_b});
}
+
+ @Override
+ public java.util.List<net.minecraft.item.ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ TileEntityPiston tileentitypiston = this.func_176422_e(world, pos);
+ TileEntityPiston tileentitypiston = this.func_185589_c(world, pos);
+ if (tileentitypiston != null)
+ {
+ IBlockState pushed = tileentitypiston.func_174927_b();

View file

@ -1,24 +1,24 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPotato.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPotato.java
@@ -22,13 +22,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_)
@@ -27,7 +27,7 @@
{
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
-
- if (!p_180653_1_.field_72995_K)
- {
- if (((Integer)p_180653_3_.func_177229_b(field_176488_a)).intValue() >= 7 && p_180653_1_.field_73012_v.nextInt(50) == 0)
- {
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(Items.field_151170_bI));
- }
- }
+ if (false && !p_180653_1_.field_72995_K) //Forge: Moved to getDrops
{
if (this.func_185525_y(p_180653_3_) && p_180653_1_.field_73012_v.nextInt(50) == 0)
{
@@ -40,4 +40,13 @@
{
return field_185534_a[((Integer)p_185496_1_.func_177229_b(this.func_185524_e())).intValue()];
}
+
+ @Override
+ public java.util.List<net.minecraft.item.ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
+ java.util.Random rand = world instanceof World ? ((World)world).field_73012_v : new java.util.Random();
+ if (((Integer)state.func_177229_b(field_176488_a)) >= 7 && rand.nextInt(50) == 0)
+ if (this.func_185525_y(state) && RANDOM.nextInt(50) == 0)
+ ret.add(new ItemStack(Items.field_151170_bI));
+ return ret;
+ }

View file

@ -1,11 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPumpkin.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java
@@ -115,7 +115,7 @@
@@ -117,7 +117,7 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().field_149764_J.func_76222_j() && World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b());
+ return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().func_176200_f(p_176196_1_, p_176196_2_) && World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b());
- return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().field_149764_J.func_76222_j() && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q();
+ return p_176196_1_.func_180495_p(p_176196_2_).func_177230_c().func_176200_f(p_176196_1_, p_176196_2_) && p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).isSideSolid(p_176196_1_, p_176196_2_, EnumFacing.UP);
}
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_)
public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_)

View file

@ -1,13 +1,13 @@
--- ../src-base/minecraft/net/minecraft/block/BlockQuartz.java
+++ ../src-work/minecraft/net/minecraft/block/BlockQuartz.java
@@ -90,6 +90,26 @@
return new BlockState(this, new IProperty[] {field_176335_a});
@@ -113,6 +113,26 @@
return new BlockStateContainer(this, new IProperty[] {field_176335_a});
}
+ 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("variant") && prop.func_177699_b() == EnumType.class)
+ {

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java
@@ -31,7 +31,7 @@
@@ -32,7 +32,7 @@
public static boolean func_176563_d(IBlockState p_176563_0_)
{
Block block = p_176563_0_.func_177230_c();
@ -9,7 +9,46 @@
}
protected BlockRailBase(boolean p_i45389_1_)
@@ -175,6 +175,81 @@
@@ -65,7 +65,7 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_185896_q();
+ return p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).isSideSolid(p_176196_1_, p_176196_2_, EnumFacing.UP);
}
public void func_176213_c(World p_176213_1_, BlockPos p_176213_2_, IBlockState p_176213_3_)
@@ -88,24 +88,24 @@
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_176204_3_.func_177229_b(this.func_176560_l());
boolean flag = false;
- if (!p_176204_1_.func_180495_p(p_176204_2_.func_177977_b()).func_185896_q())
+ if (!p_176204_1_.func_180495_p(p_176204_2_.func_177977_b()).isSideSolid(p_176204_1_, p_176204_2_.func_177977_b(), EnumFacing.UP))
{
flag = true;
}
- if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_EAST && !p_176204_1_.func_180495_p(p_176204_2_.func_177974_f()).func_185896_q())
+ if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_EAST && !p_176204_1_.func_180495_p(p_176204_2_.func_177974_f()).isSideSolid(p_176204_1_, p_176204_2_.func_177974_f(), EnumFacing.UP))
{
flag = true;
}
- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_WEST && !p_176204_1_.func_180495_p(p_176204_2_.func_177976_e()).func_185896_q())
+ else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_WEST && !p_176204_1_.func_180495_p(p_176204_2_.func_177976_e()).isSideSolid(p_176204_1_, p_176204_2_.func_177976_e(), EnumFacing.UP))
{
flag = true;
}
- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_NORTH && !p_176204_1_.func_180495_p(p_176204_2_.func_177978_c()).func_185896_q())
+ else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_NORTH && !p_176204_1_.func_180495_p(p_176204_2_.func_177978_c()).isSideSolid(p_176204_1_, p_176204_2_.func_177978_c(), EnumFacing.UP))
{
flag = true;
}
- else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_SOUTH && !p_176204_1_.func_180495_p(p_176204_2_.func_177968_d()).func_185896_q())
+ else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_SOUTH && !p_176204_1_.func_180495_p(p_176204_2_.func_177968_d()).isSideSolid(p_176204_1_, p_176204_2_.func_177968_d(), EnumFacing.UP))
{
flag = true;
}
@@ -160,6 +160,81 @@
public abstract IProperty<BlockRailBase.EnumRailDirection> func_176560_l();
@ -75,7 +114,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("shape"))
+ {
@ -91,7 +130,7 @@
public static enum EnumRailDirection implements IStringSerializable
{
NORTH_SOUTH(0, "north_south"),
@@ -245,6 +320,7 @@
@@ -230,6 +305,7 @@
private IBlockState field_180366_e;
private final boolean field_150656_f;
private final List<BlockPos> field_150657_g = Lists.<BlockPos>newArrayList();
@ -99,17 +138,17 @@
public Rail(World p_i45739_2_, BlockPos p_i45739_3_, IBlockState p_i45739_4_)
{
@@ -253,7 +329,8 @@
@@ -238,7 +314,8 @@
this.field_180366_e = p_i45739_4_;
this.field_180365_d = (BlockRailBase)p_i45739_4_.func_177230_c();
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_i45739_4_.func_177229_b(BlockRailBase.this.func_176560_l());
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_i45739_4_.func_177229_b(this.field_180365_d.func_176560_l());
- this.field_150656_f = this.field_180365_d.field_150053_a;
+ this.field_150656_f = !this.field_180365_d.isFlexibleRail(p_i45739_2_, p_i45739_3_);
+ canMakeSlopes = this.field_180365_d.canMakeSlopes(p_i45739_2_, p_i45739_3_);
+ this.canMakeSlopes = this.field_180365_d.canMakeSlopes(p_i45739_2_, p_i45739_3_);
this.func_180360_a(blockrailbase$enumraildirection);
}
@@ -439,7 +516,7 @@
@@ -429,7 +506,7 @@
}
}
@ -118,7 +157,7 @@
{
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
{
@@ -452,7 +529,7 @@
@@ -442,7 +519,7 @@
}
}
@ -127,7 +166,7 @@
{
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a()))
{
@@ -595,7 +672,7 @@
@@ -585,7 +662,7 @@
}
}
@ -136,7 +175,7 @@
{
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
{
@@ -608,7 +685,7 @@
@@ -598,7 +675,7 @@
}
}

View file

@ -1,7 +1,7 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneComparator.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneComparator.java
@@ -295,6 +295,21 @@
return this.func_176223_P().func_177226_a(field_176387_N, p_180642_8_.func_174811_aO().func_176734_d()).func_177226_a(field_176464_a, Boolean.valueOf(false)).func_177226_a(field_176463_b, BlockRedstoneComparator.Mode.COMPARE);
@@ -310,6 +310,21 @@
return this.func_176223_P().func_177226_a(field_185512_D, p_180642_8_.func_174811_aO().func_176734_d()).func_177226_a(field_176464_a, Boolean.valueOf(false)).func_177226_a(field_176463_b, BlockRedstoneComparator.Mode.COMPARE);
}
+ @Override

View file

@ -1,8 +1,8 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneDiode.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneDiode.java
@@ -198,6 +198,8 @@
@@ -204,6 +204,8 @@
{
EnumFacing enumfacing = (EnumFacing)p_176400_3_.func_177229_b(field_176387_N);
EnumFacing enumfacing = (EnumFacing)p_176400_3_.func_177229_b(field_185512_D);
BlockPos blockpos = p_176400_2_.func_177972_a(enumfacing.func_176734_d());
+ if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(p_176400_1_, p_176400_2_, p_176400_1_.func_180495_p(p_176400_2_), java.util.EnumSet.of(enumfacing.func_176734_d())).isCanceled())
+ return;

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java
@@ -91,12 +91,16 @@
@@ -92,12 +92,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_)
{
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
@ -8,9 +8,9 @@
- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this))
+ @Override
+ public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ public int getExpDrop(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ if (this.func_180660_a(world.func_180495_p(pos), RANDOM, fortune) != Item.func_150898_a(this))
+ if (this.func_180660_a(state, RANDOM, fortune) != Item.func_150898_a(this))
{
- int i = 1 + p_180653_1_.field_73012_v.nextInt(5);
- this.func_180637_b(p_180653_1_, p_180653_2_, i);

View file

@ -1,59 +1,65 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java
@@ -58,10 +58,10 @@
@@ -97,15 +97,15 @@
BlockPos blockpos = p_176341_2_.func_177972_a(p_176341_3_);
Block block = p_176341_1_.func_180495_p(p_176341_2_.func_177972_a(p_176341_3_)).func_177230_c();
IBlockState iblockstate = p_176341_1_.func_180495_p(p_176341_2_.func_177972_a(p_176341_3_));
- if (!func_176343_a(p_176341_1_.func_180495_p(blockpos), p_176341_3_) && (block.func_149637_q() || !func_176346_d(p_176341_1_.func_180495_p(blockpos.func_177977_b()))))
+ if (!canRestoneConnect(p_176341_1_, blockpos, p_176341_3_) && (block.func_149637_q() || !canRestoneConnect(p_176341_1_, blockpos.func_177977_b(), null)))
- if (!func_176343_a(p_176341_1_.func_180495_p(blockpos), p_176341_3_) && (iblockstate.func_185915_l() || !func_176346_d(p_176341_1_.func_180495_p(blockpos.func_177977_b()))))
+ if (!canConnectTo(p_176341_1_.func_180495_p(blockpos), p_176341_3_, p_176341_1_, blockpos) && (iblockstate.func_185915_l() || !func_176340_e(p_176341_1_, blockpos.func_177977_b())))
{
Block block1 = p_176341_1_.func_180495_p(p_176341_2_.func_177984_a()).func_177230_c();
- return !block1.func_149637_q() && block.func_149637_q() && func_176346_d(p_176341_1_.func_180495_p(blockpos.func_177984_a())) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE;
+ return !block1.func_149637_q() && block.func_149637_q() && canRestoneConnect(p_176341_1_, blockpos.func_177984_a(), null) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE;
}
else
IBlockState iblockstate1 = p_176341_1_.func_180495_p(p_176341_2_.func_177984_a());
if (!iblockstate1.func_185915_l())
{
@@ -359,35 +359,24 @@
Block block = iblockstate.func_177230_c();
boolean flag = block.func_149721_r();
boolean flag1 = p_176339_1_.func_180495_p(p_176339_2_.func_177984_a()).func_177230_c().func_149721_r();
- return !flag1 && flag && func_176340_e(p_176339_1_, blockpos.func_177984_a()) ? true : (func_176343_a(iblockstate, p_176339_3_) ? true : (block == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_176387_N) == p_176339_3_ ? true : !flag && func_176340_e(p_176339_1_, blockpos.func_177977_b())));
+ return !flag1 && flag && canRestoneConnect(p_176339_1_, blockpos.func_177984_a(), null) ? true : (canRestoneConnect(p_176339_1_, blockpos, p_176339_3_) ? true : (block == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_176387_N) == p_176339_3_ ? true : !flag && canRestoneConnect(p_176339_1_, blockpos.func_177977_b(), null)));
- boolean flag = p_176341_1_.func_180495_p(blockpos).func_185896_q() || p_176341_1_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150426_aN;
+ boolean flag = p_176341_1_.func_180495_p(blockpos).isSideSolid(p_176341_1_, blockpos, EnumFacing.UP) || p_176341_1_.func_180495_p(blockpos).func_177230_c() == Blocks.field_150426_aN;
- if (flag && func_176346_d(p_176341_1_.func_180495_p(blockpos.func_177984_a())))
+ if (flag && func_176340_e(p_176341_1_, blockpos.func_177984_a()))
{
if (iblockstate.func_185898_k())
{
@@ -406,35 +406,30 @@
IBlockState iblockstate = p_176339_1_.func_180495_p(blockpos);
boolean flag = iblockstate.func_185915_l();
boolean flag1 = p_176339_1_.func_180495_p(p_176339_2_.func_177984_a()).func_185915_l();
- return !flag1 && flag && func_176340_e(p_176339_1_, blockpos.func_177984_a()) ? true : (func_176343_a(iblockstate, p_176339_3_) ? true : (iblockstate.func_177230_c() == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_185512_D) == p_176339_3_ ? true : !flag && func_176340_e(p_176339_1_, blockpos.func_177977_b())));
+ return !flag1 && flag && func_176340_e(p_176339_1_, blockpos.func_177984_a()) ? true : (canConnectTo(iblockstate, p_176339_3_, p_176339_1_, p_176339_2_) ? true : (iblockstate.func_177230_c() == Blocks.field_150416_aS && iblockstate.func_177229_b(BlockRedstoneDiode.field_185512_D) == p_176339_3_ ? true : !flag && func_176340_e(p_176339_1_, blockpos.func_177977_b())));
}
- protected static boolean func_176340_e(IBlockAccess p_176340_0_, BlockPos p_176340_1_)
+ protected static boolean canRestoneConnect(IBlockAccess world, BlockPos pos, EnumFacing side)
protected static boolean func_176340_e(IBlockAccess p_176340_0_, BlockPos p_176340_1_)
{
- return func_176346_d(p_176340_0_.func_180495_p(p_176340_1_));
- }
-
+ return canConnectTo(p_176340_0_.func_180495_p(p_176340_1_), null, p_176340_0_, p_176340_1_);
}
- protected static boolean func_176346_d(IBlockState p_176346_0_)
- {
+ protected static boolean canConnectTo(IBlockState blockState, EnumFacing side, IBlockAccess world, BlockPos pos)
{
- return func_176343_a(p_176346_0_, (EnumFacing)null);
- }
-
+ Block block = blockState.func_177230_c();
- protected static boolean func_176343_a(IBlockState p_176343_0_, EnumFacing p_176343_1_)
- {
- Block block = p_176343_0_.func_177230_c();
-
- if (block == Blocks.field_150488_af)
+ IBlockState state = world.func_180495_p(pos);
+ if (state.func_177230_c() == Blocks.field_150488_af)
if (block == Blocks.field_150488_af)
{
return true;
}
- else if (Blocks.field_150413_aR.func_149907_e(block))
+ else if (Blocks.field_150413_aR.func_149907_e(state.func_177230_c()))
- else if (Blocks.field_150413_aR.func_185547_C(p_176343_0_))
+ else if (Blocks.field_150413_aR.func_185547_C(blockState))
{
- EnumFacing enumfacing = (EnumFacing)p_176343_0_.func_177229_b(BlockRedstoneRepeater.field_176387_N);
- EnumFacing enumfacing = (EnumFacing)p_176343_0_.func_177229_b(BlockRedstoneRepeater.field_185512_D);
- return enumfacing == p_176343_1_ || enumfacing.func_176734_d() == p_176343_1_;
+ EnumFacing direction = (EnumFacing)state.func_177229_b(BlockRedstoneRepeater.field_176387_N);
+ return direction == side || direction.func_176734_d() == side;
+ EnumFacing enumfacing = (EnumFacing)blockState.func_177229_b(BlockRedstoneRepeater.field_185512_D);
+ return enumfacing == side || enumfacing.func_176734_d() == side;
}
else
{
- return block.func_149744_f() && p_176343_1_ != null;
+ return state.func_177230_c().canConnectRedstone(world, pos, side);
- return p_176343_0_.func_185897_m() && p_176343_1_ != null;
+ return blockState.func_177230_c().canConnectRedstone(blockState, world, pos, side);
}
}

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/block/BlockReed.java
+++ ../src-work/minecraft/net/minecraft/block/BlockReed.java
@@ -18,7 +18,7 @@
@@ -19,7 +19,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@ -8,20 +8,22 @@
+public class BlockReed extends Block implements net.minecraftforge.common.IPlantable
{
public static final PropertyInteger field_176355_a = PropertyInteger.func_177719_a("age", 0, 15);
protected static final AxisAlignedBB field_185701_b = new AxisAlignedBB(0.125D, 0.0D, 0.125D, 0.875D, 1.0D, 0.875D);
@@ -69,7 +69,9 @@
@@ -65,6 +65,7 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
Block block = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c();
+ if (block.canSustainPlant(p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP, this)) return true;
- Block block = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b()).func_177230_c();
+ IBlockState state = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
+ Block block = state.func_177230_c();
+ if (block.canSustainPlant(state, p_176196_1_, p_176196_2_.func_177977_b(), EnumFacing.UP, this)) return true;
if (block == this)
{
@@ -164,4 +165,15 @@
{
return new BlockState(this, new IProperty[] {field_176355_a});
@@ -162,6 +164,17 @@
return ((Integer)p_176201_1_.func_177229_b(field_176355_a)).intValue();
}
+
+ @Override
+ public net.minecraftforge.common.EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
+ {
@ -32,4 +34,7 @@
+ {
+ return this.func_176223_P();
+ }
}
+
protected BlockStateContainer func_180661_e()
{
return new BlockStateContainer(this, new IProperty[] {field_176355_a});

View file

@ -1,11 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRotatedPillar.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRotatedPillar.java
@@ -18,4 +18,18 @@
{
@@ -28,6 +28,21 @@
super(p_i46385_1_, p_i46385_2_);
}
+
+ public boolean rotateBlock(net.minecraft.world.World world, net.minecraft.util.BlockPos pos, EnumFacing axis)
+ @Override
+ public boolean rotateBlock(net.minecraft.world.World world, BlockPos pos, EnumFacing axis)
+ {
+ net.minecraft.block.state.IBlockState state = world.func_180495_p(pos);
+ for (net.minecraft.block.properties.IProperty<?> prop : state.func_177228_b().keySet())
@ -18,4 +18,7 @@
+ }
+ return false;
+ }
}
+
public IBlockState func_185499_a(IBlockState p_185499_1_, Rotation p_185499_2_)
{
switch (p_185499_2_)

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/block/BlockSapling.java
+++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java
@@ -71,6 +71,7 @@
@@ -77,6 +77,7 @@
public void func_176476_e(World p_176476_1_, BlockPos p_176476_2_, IBlockState p_176476_3_, Random p_176476_4_)
{

View file

@ -1,7 +1,7 @@
--- ../src-base/minecraft/net/minecraft/block/BlockSkull.java
+++ ../src-work/minecraft/net/minecraft/block/BlockSkull.java
@@ -121,10 +121,6 @@
return tileentity instanceof TileEntitySkull ? ((TileEntitySkull)tileentity).func_145904_a() : super.func_176222_j(p_176222_1_, p_176222_2_);
@@ -116,10 +116,6 @@
return new ItemStack(Items.field_151144_bL, 1, i);
}
- 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_)
@ -11,7 +11,7 @@
public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, IBlockState p_176208_3_, EntityPlayer p_176208_4_)
{
if (p_176208_4_.field_71075_bZ.field_75098_d)
@@ -132,13 +128,18 @@
@@ -127,22 +123,27 @@
p_176208_3_ = p_176208_3_.func_177226_a(field_176417_b, Boolean.valueOf(true));
p_176208_1_.func_180501_a(p_176208_2_, p_176208_3_, 4);
}
@ -25,22 +25,25 @@
- if (!p_180663_1_.field_72995_K)
+ super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
+ }
+ public java.util.List<ItemStack> getDrops(IBlockAccess p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_, int fortune)
+ public java.util.List<ItemStack> getDrops(IBlockAccess worldIn, BlockPos pos, IBlockState state, int fortune)
+ {
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
{
if (!((Boolean)p_180663_3_.func_177229_b(field_176417_b)).booleanValue())
- if (!((Boolean)p_180663_3_.func_177229_b(field_176417_b)).booleanValue())
+ if (!((Boolean)state.func_177229_b(field_176417_b)).booleanValue())
{
@@ -147,7 +148,7 @@
- TileEntity tileentity = p_180663_1_.func_175625_s(p_180663_2_);
+ TileEntity tileentity = worldIn.func_175625_s(pos);
if (tileentity instanceof TileEntitySkull)
{
TileEntitySkull tileentityskull = (TileEntitySkull)tileentity;
- ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, this.func_176222_j(p_180663_1_, p_180663_2_));
- ItemStack itemstack = this.func_185473_a(p_180663_1_, p_180663_2_, p_180663_3_);
+ ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, tileentityskull.func_145904_a());
if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_152108_a() != null)
{
@@ -157,12 +158,11 @@
@@ -152,12 +153,11 @@
itemstack.func_77978_p().func_74782_a("SkullOwner", nbttagcompound);
}

View file

@ -1,13 +1,13 @@
--- ../src-base/minecraft/net/minecraft/block/BlockSlab.java
+++ ../src-work/minecraft/net/minecraft/block/BlockSlab.java
@@ -91,6 +91,17 @@
@@ -50,6 +50,17 @@
return this.func_176552_j();
}
+ @Override
+ public boolean doesSideBlockRendering(IBlockAccess world, BlockPos pos, EnumFacing face)
+ public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face)
+ {
+ if ( func_149662_c() )
+ if ( state.func_185914_p() )
+ return true;
+
+ // face is on the block being rendered, not this block.
@ -18,21 +18,19 @@
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_)
{
IBlockState iblockstate = super.func_180642_a(p_180642_1_, p_180642_2_, p_180642_3_, p_180642_4_, p_180642_5_, p_180642_6_, p_180642_7_, p_180642_8_).func_177226_a(field_176554_a, BlockSlab.EnumBlockHalf.BOTTOM);
@@ -118,15 +129,8 @@
@@ -77,13 +88,14 @@
{
return false;
}
- else
- {
- BlockPos blockpos = p_176225_2_.func_177972_a(p_176225_3_.func_176734_d());
- IBlockState iblockstate = p_176225_1_.func_180495_p(p_176225_2_);
- IBlockState iblockstate1 = p_176225_1_.func_180495_p(blockpos);
- boolean flag = func_150003_a(iblockstate.func_177230_c()) && iblockstate.func_177229_b(field_176554_a) == BlockSlab.EnumBlockHalf.TOP;
- boolean flag1 = func_150003_a(iblockstate1.func_177230_c()) && iblockstate1.func_177229_b(field_176554_a) == BlockSlab.EnumBlockHalf.TOP;
- return flag1 ? (p_176225_3_ == EnumFacing.DOWN ? true : (p_176225_3_ == EnumFacing.UP && super.func_176225_a(p_176225_1_, p_176225_2_, p_176225_3_) ? true : !func_150003_a(iblockstate.func_177230_c()) || !flag)) : (p_176225_3_ == EnumFacing.UP ? true : (p_176225_3_ == EnumFacing.DOWN && super.func_176225_a(p_176225_1_, p_176225_2_, p_176225_3_) ? true : !func_150003_a(iblockstate.func_177230_c()) || flag));
- }
+ // additional logic breaks doesSideBlockRendering and is no longer useful.
+ return super.func_176225_a(p_176225_1_, p_176225_2_, p_176225_3_);
+ else if (false) // Forge: Additional logic breaks doesSideBlockRendering and is no longer useful.
{
IBlockState iblockstate = p_176225_2_.func_180495_p(p_176225_3_.func_177972_a(p_176225_4_));
boolean flag = func_185675_i(iblockstate) && iblockstate.func_177229_b(field_176554_a) == BlockSlab.EnumBlockHalf.TOP;
boolean flag1 = func_185675_i(p_176225_1_) && p_176225_1_.func_177229_b(field_176554_a) == BlockSlab.EnumBlockHalf.TOP;
return flag1 ? (p_176225_4_ == EnumFacing.DOWN ? true : (p_176225_4_ == EnumFacing.UP && super.func_176225_a(p_176225_1_, p_176225_2_, p_176225_3_, p_176225_4_) ? true : !func_185675_i(iblockstate) || !flag)) : (p_176225_4_ == EnumFacing.UP ? true : (p_176225_4_ == EnumFacing.DOWN && super.func_176225_a(p_176225_1_, p_176225_2_, p_176225_3_, p_176225_4_) ? true : !func_185675_i(iblockstate) || flag));
}
+ return super.func_176225_a(p_176225_1_, p_176225_2_, p_176225_3_, p_176225_4_);
}
@SideOnly(Side.CLIENT)

View file

@ -1,15 +1,15 @@
--- ../src-base/minecraft/net/minecraft/block/BlockSnow.java
+++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java
@@ -79,7 +79,7 @@
@@ -73,7 +73,7 @@
{
IBlockState iblockstate = p_176196_1_.func_180495_p(p_176196_2_.func_177977_b());
Block block = iblockstate.func_177230_c();
- return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.func_149688_o() == Material.field_151584_j ? true : (block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() >= 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false;
+ return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.isLeaves(p_176196_1_, p_176196_2_.func_177977_b()) ? true : (block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() >= 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false;
- return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (iblockstate.func_185904_a() == Material.field_151584_j ? true : (block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() >= 7 ? true : iblockstate.func_185914_p() && iblockstate.func_185904_a().func_76230_c())) : false;
+ return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (iblockstate.func_177230_c().isLeaves(iblockstate, p_176196_1_, p_176196_2_.func_177977_b()) ? true : (block == this && ((Integer)iblockstate.func_177229_b(field_176315_a)).intValue() >= 7 ? true : iblockstate.func_185914_p() && iblockstate.func_185904_a().func_76230_c())) : false;
}
public void func_176204_a(World p_176204_1_, BlockPos p_176204_2_, IBlockState p_176204_3_, Block p_176204_4_)
@@ -91,7 +91,6 @@
@@ -85,7 +85,6 @@
{
if (!this.func_176196_c(p_176314_1_, p_176314_2_))
{
@ -17,18 +17,18 @@
p_176314_1_.func_175698_g(p_176314_2_);
return false;
}
@@ -103,9 +102,8 @@
@@ -97,9 +96,8 @@
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_)
{
- func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Items.field_151126_ay, ((Integer)p_180657_4_.func_177229_b(field_176315_a)).intValue() + 1, 0));
+ 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_);
p_180657_1_.func_175698_g(p_180657_3_);
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
- p_180657_2_.func_71029_a(StatList.func_188055_a(this));
}
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
@@ -115,14 +113,13 @@
@@ -109,14 +107,13 @@
public int func_149745_a(Random p_149745_1_)
{
@ -44,10 +44,12 @@
p_180650_1_.func_175698_g(p_180650_2_);
}
}
@@ -152,4 +149,6 @@
{
return new BlockState(this, new IProperty[] {field_176315_a});
@@ -150,6 +147,8 @@
return ((Integer)p_176201_1_.func_177229_b(field_176315_a)).intValue() - 1;
}
+
+ @Override public int quantityDropped(IBlockState state, int fortune, Random random){ return ((Integer)state.func_177229_b(field_176315_a)) + 1; }
}
+
protected BlockStateContainer func_180661_e()
{
return new BlockStateContainer(this, new IProperty[] {field_176315_a});

View file

@ -1,13 +1,13 @@
--- ../src-base/minecraft/net/minecraft/block/BlockStairs.java
+++ ../src-work/minecraft/net/minecraft/block/BlockStairs.java
@@ -68,6 +68,19 @@
return false;
@@ -443,6 +443,19 @@
return new BlockStateContainer(this, new IProperty[] {field_176309_a, field_176308_b, field_176310_M});
}
+ @Override
+ public boolean doesSideBlockRendering(IBlockAccess world, BlockPos pos, EnumFacing face)
+ public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face)
+ {
+ if ( func_149662_c() )
+ if ( state.func_185914_p() )
+ return true;
+
+ // face is on the block being rendered, not this block.
@ -17,6 +17,6 @@
+ return side == face.func_176734_d() || (half == EnumHalf.TOP && face == EnumFacing.DOWN) || (half == EnumHalf.BOTTOM && face == EnumFacing.UP);
+ }
+
public boolean func_149686_d()
public static enum EnumHalf implements IStringSerializable
{
return false;
TOP("top"),

View file

@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockStaticLiquid.java
+++ ../src-work/minecraft/net/minecraft/block/BlockStaticLiquid.java
@@ -52,7 +52,7 @@
{
blockpos = blockpos.func_177982_a(p_180650_4_.nextInt(3) - 1, 1, p_180650_4_.nextInt(3) - 1);
- if (blockpos.func_177956_o() >= 0 && blockpos.func_177956_o() < 256 && !p_180650_1_.func_175667_e(blockpos))
+ if (blockpos.func_177956_o() >= 0 && blockpos.func_177956_o() < p_180650_1_.func_72800_K() && !p_180650_1_.func_175667_e(blockpos))
{
return;
}

View file

@ -1,15 +1,19 @@
--- ../src-base/minecraft/net/minecraft/block/BlockStem.java
+++ ../src-work/minecraft/net/minecraft/block/BlockStem.java
@@ -94,7 +94,7 @@
@@ -89,9 +89,10 @@
}
p_180650_2_ = p_180650_2_.func_177972_a(EnumFacing.Plane.HORIZONTAL.func_179518_a(p_180650_4_));
Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c();
- Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c();
+ IBlockState soil = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b());
+ Block block = soil.func_177230_c();
- if (p_180650_1_.func_180495_p(p_180650_2_).func_177230_c().field_149764_J == Material.field_151579_a && (block == Blocks.field_150458_ak || block == Blocks.field_150346_d || block == Blocks.field_150349_c))
+ if (p_180650_1_.func_175623_d(p_180650_2_) && (block.canSustainPlant(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP, this) || block == Blocks.field_150346_d || block == Blocks.field_150349_c))
+ if (p_180650_1_.func_175623_d(p_180650_2_) && (block.canSustainPlant(soil, p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP, this) || block == Blocks.field_150346_d || block == Blocks.field_150349_c))
{
p_180650_1_.func_175656_a(p_180650_2_, this.field_149877_a.func_176223_P());
}
@@ -148,24 +148,29 @@
@@ -109,24 +110,29 @@
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_, p_180653_5_);

View file

@ -8,17 +8,17 @@
+public class BlockTallGrass extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable
{
public static final PropertyEnum<BlockTallGrass.EnumType> field_176497_a = PropertyEnum.<BlockTallGrass.EnumType>func_177709_a("type", BlockTallGrass.EnumType.class);
@@ -43,7 +43,7 @@
protected static final AxisAlignedBB field_185522_c = new AxisAlignedBB(0.09999999403953552D, 0.0D, 0.09999999403953552D, 0.8999999761581421D, 0.800000011920929D, 0.8999999761581421D);
@@ -41,7 +41,7 @@
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());
- return this.func_185514_i(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()));
+ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_);
}
public boolean func_176200_f(World p_176200_1_, BlockPos p_176200_2_)
@@ -53,7 +53,7 @@
public boolean func_176200_f(IBlockAccess p_176200_1_, BlockPos p_176200_2_)
@@ -51,7 +51,7 @@
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
{
@ -27,21 +27,16 @@
}
public int func_149679_a(int p_149679_1_, Random p_149679_2_)
@@ -63,13 +63,7 @@
@@ -61,7 +61,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_)
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 Taken care of by IShearable
{
- 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_150329_H, 1, ((BlockTallGrass.EnumType)p_180657_4_.func_177229_b(field_176497_a)).func_177044_a()));
- }
- else
- {
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
}
}
@@ -204,4 +198,22 @@
p_180657_2_.func_71029_a(StatList.func_188055_a(this));
func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150329_H, 1, ((BlockTallGrass.EnumType)p_180657_4_.func_177229_b(field_176497_a)).func_177044_a()));
@@ -181,4 +181,22 @@
}
}
}

View file

@ -1,15 +1,24 @@
--- ../src-base/minecraft/net/minecraft/block/BlockTorch.java
+++ ../src-work/minecraft/net/minecraft/block/BlockTorch.java
@@ -63,7 +63,7 @@
@@ -79,14 +79,14 @@
private boolean func_176594_d(World p_176594_1_, BlockPos p_176594_2_)
{
- if (p_176594_1_.func_180495_p(p_176594_2_).func_185896_q())
+ IBlockState state = p_176594_1_.func_180495_p(p_176594_2_);
+ if (state.isSideSolid(p_176594_1_, p_176594_2_, EnumFacing.UP))
{
return true;
}
else
{
Block block = p_176594_1_.func_180495_p(p_176594_2_).func_177230_c();
- Block block = p_176594_1_.func_180495_p(p_176594_2_).func_177230_c();
- return block instanceof BlockFence || block == Blocks.field_150359_w || block == Blocks.field_150463_bK || block == Blocks.field_150399_cn;
+ return block.canPlaceTorchOnTop(p_176594_1_, p_176594_2_);
+ return state.func_177230_c().canPlaceTorchOnTop(state, p_176594_1_, p_176594_2_);
}
}
@@ -84,7 +84,7 @@
@@ -107,7 +107,7 @@
{
BlockPos blockpos = p_176595_2_.func_177972_a(p_176595_3_.func_176734_d());
boolean flag = p_176595_3_.func_176740_k().func_176722_c();
@ -18,7 +27,7 @@
}
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_)
@@ -97,7 +97,7 @@
@@ -120,7 +120,7 @@
{
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
{
@ -27,7 +36,7 @@
{
return this.func_176223_P().func_177226_a(field_176596_a, enumfacing);
}
@@ -130,7 +130,7 @@
@@ -153,7 +153,7 @@
EnumFacing enumfacing1 = enumfacing.func_176734_d();
boolean flag = false;

View file

@ -1,43 +1,21 @@
--- ../src-base/minecraft/net/minecraft/block/BlockTrapDoor.java
+++ ../src-work/minecraft/net/minecraft/block/BlockTrapDoor.java
@@ -25,6 +25,8 @@
public class BlockTrapDoor extends Block
{
+ /** Set this to allow trapdoors to remain free-floating */
+ public static boolean disableValidation = false;
public static final PropertyDirection field_176284_a = PropertyDirection.func_177712_a("facing", EnumFacing.Plane.HORIZONTAL);
public static final PropertyBool field_176283_b = PropertyBool.func_177716_a("open");
public static final PropertyEnum<BlockTrapDoor.DoorHalf> field_176285_M = PropertyEnum.<BlockTrapDoor.DoorHalf>func_177709_a("half", BlockTrapDoor.DoorHalf.class);
@@ -140,9 +142,10 @@
{
if (!p_176204_1_.field_72995_K)
{
+ EnumFacing direction = (EnumFacing)p_176204_3_.func_177229_b(field_176284_a);
BlockPos blockpos = p_176204_2_.func_177972_a(((EnumFacing)p_176204_3_.func_177229_b(field_176284_a)).func_176734_d());
- if (!func_150119_a(p_176204_1_.func_180495_p(blockpos).func_177230_c()))
+ if (!(func_150119_a(p_176204_1_.func_180495_p(blockpos).func_177230_c()) || p_176204_1_.isSideSolid(blockpos, direction, true)))
{
p_176204_1_.func_175698_g(p_176204_2_);
this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0);
@@ -186,7 +189,10 @@
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
{
- return !p_176198_3_.func_176740_k().func_176720_b() && func_150119_a(p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_177230_c());
+ if (disableValidation) return true;
+ EnumFacing dir = p_176198_3_.func_176734_d();
+ p_176198_2_ = p_176198_2_.func_177972_a(dir);
+ return !p_176198_3_.func_176740_k().func_176720_b() && (func_150119_a(p_176198_1_.func_180495_p(p_176198_2_).func_177230_c()) || p_176198_1_.isSideSolid(p_176198_2_, p_176198_3_, true));
@@ -241,6 +241,18 @@
return new BlockStateContainer(this, new IProperty[] {field_176284_a, field_176283_b, field_176285_M});
}
protected static EnumFacing func_176281_b(int p_176281_0_)
@@ -223,6 +229,7 @@
private static boolean func_150119_a(Block p_150119_0_)
+ @Override
+ public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity)
+ {
+ if (state.func_177229_b(field_176283_b))
+ {
+ IBlockState down = world.func_180495_p(pos.func_177977_b());
+ if (down.func_177230_c() == net.minecraft.init.Blocks.field_150468_ap)
+ return down.func_177229_b(BlockLadder.field_176382_a) == state.func_177229_b(field_176284_a);
+ }
+ return false;
+ }
+
public static enum DoorHalf implements IStringSerializable
{
+ if (disableValidation) return true;
return p_150119_0_.field_149764_J.func_76218_k() && p_150119_0_.func_149686_d() || p_150119_0_ == Blocks.field_150426_aN || p_150119_0_ instanceof BlockSlab || p_150119_0_ instanceof BlockStairs;
}
TOP("top"),

View file

@ -1,28 +1,28 @@
--- ../src-base/minecraft/net/minecraft/block/BlockTripWireHook.java
+++ ../src-work/minecraft/net/minecraft/block/BlockTripWireHook.java
@@ -58,14 +58,14 @@
@@ -77,14 +77,14 @@
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
{
- return p_176198_3_.func_176740_k().func_176722_c() && p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_177230_c().func_149721_r();
+ return p_176198_3_.func_176740_k().func_176722_c() && p_176198_1_.isSideSolid(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()), p_176198_3_, true);
- return p_176198_3_.func_176740_k().func_176722_c() && p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).func_185915_l();
+ return p_176198_3_.func_176740_k().func_176722_c() && p_176198_1_.func_180495_p(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d())).isSideSolid(p_176198_1_, p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()), p_176198_3_);
}
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
{
- if (p_176196_1_.func_180495_p(p_176196_2_.func_177972_a(enumfacing)).func_177230_c().func_149721_r())
+ if (p_176196_1_.isSideSolid(p_176196_2_.func_177972_a(enumfacing), enumfacing.func_176734_d(), true))
- if (p_176196_1_.func_180495_p(p_176196_2_.func_177972_a(enumfacing)).func_185915_l())
+ if (p_176196_1_.func_180495_p(p_176196_2_.func_177972_a(enumfacing)).isSideSolid(p_176196_1_, p_176196_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()))
{
return true;
}
@@ -99,7 +99,7 @@
@@ -118,7 +118,7 @@
{
EnumFacing enumfacing = (EnumFacing)p_176204_3_.func_177229_b(field_176264_a);
- if (!p_176204_1_.func_180495_p(p_176204_2_.func_177972_a(enumfacing.func_176734_d())).func_177230_c().func_149721_r())
+ if (!p_176204_1_.isSideSolid(p_176204_2_.func_177972_a(enumfacing.func_176734_d()), enumfacing, true))
- if (!p_176204_1_.func_180495_p(p_176204_2_.func_177972_a(enumfacing.func_176734_d())).func_185915_l())
+ if (!p_176204_1_.func_180495_p(p_176204_2_.func_177972_a(enumfacing.func_176734_d())).isSideSolid(p_176204_1_, p_176204_2_.func_177972_a(enumfacing.func_176734_d()), enumfacing))
{
this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0);
p_176204_1_.func_175698_g(p_176204_2_);

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/block/BlockVine.java
+++ ../src-work/minecraft/net/minecraft/block/BlockVine.java
@@ -25,7 +25,7 @@
@@ -26,7 +26,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@ -9,26 +9,21 @@
{
public static final PropertyBool field_176277_a = PropertyBool.func_177716_a("up");
public static final PropertyBool field_176273_b = PropertyBool.func_177716_a("north");
@@ -387,13 +387,7 @@
@@ -342,7 +342,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_)
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, Covered by IShearable
{
- 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_150395_bd, 1, 0));
- }
- else
- {
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
}
}
@@ -474,4 +468,14 @@
p_180657_2_.func_71029_a(StatList.func_188055_a(this));
func_180635_a(p_180657_1_, p_180657_3_, new ItemStack(Blocks.field_150395_bd, 1, 0));
@@ -457,4 +457,14 @@
return i;
}
+ /*************************FORGE START***********************************/
+ @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity){ return true; }
+ @Override public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity){ return true; }
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
+ @Override
+ public java.util.List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)

View file

@ -1,29 +1,29 @@
--- ../src-base/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java
+++ ../src-work/minecraft/net/minecraft/block/state/BlockPistonStructureHelper.java
@@ -78,7 +78,7 @@
{
Block block = this.field_177261_a.func_180495_p(p_177251_1_).func_177230_c();
@@ -80,7 +80,7 @@
IBlockState iblockstate = this.field_177261_a.func_180495_p(p_177251_1_);
Block block = iblockstate.func_177230_c();
- if (block.func_149688_o() == Material.field_151579_a)
+ if (block.isAir(field_177261_a, p_177251_1_))
- if (iblockstate.func_185904_a() == Material.field_151579_a)
+ if (iblockstate.func_177230_c().isAir(iblockstate, this.field_177261_a, p_177251_1_))
{
return true;
}
@@ -109,7 +109,7 @@
BlockPos blockpos = p_177251_1_.func_177967_a(this.field_177257_d.func_176734_d(), i);
block = this.field_177261_a.func_180495_p(blockpos).func_177230_c();
@@ -112,7 +112,7 @@
iblockstate = this.field_177261_a.func_180495_p(blockpos);
block = iblockstate.func_177230_c();
- if (block.func_149688_o() == Material.field_151579_a || !BlockPistonBase.func_180696_a(block, this.field_177261_a, blockpos, this.field_177257_d, false) || blockpos.equals(this.field_177259_b))
+ if (block.isAir(field_177261_a, blockpos)|| !BlockPistonBase.func_180696_a(block, this.field_177261_a, blockpos, this.field_177257_d, false) || blockpos.equals(this.field_177259_b))
- if (iblockstate.func_185904_a() == Material.field_151579_a || !BlockPistonBase.func_185646_a(iblockstate, this.field_177261_a, blockpos, this.field_177257_d, false) || blockpos.equals(this.field_177259_b))
+ if (iblockstate.func_177230_c().isAir(iblockstate, this.field_177261_a, blockpos) || !BlockPistonBase.func_185646_a(iblockstate, this.field_177261_a, blockpos, this.field_177257_d, false) || blockpos.equals(this.field_177259_b))
{
break;
}
@@ -156,7 +156,7 @@
@@ -159,7 +159,7 @@
block = this.field_177261_a.func_180495_p(blockpos1).func_177230_c();
iblockstate = this.field_177261_a.func_180495_p(blockpos1);
- if (block.func_149688_o() == Material.field_151579_a)
+ if (block.isAir(field_177261_a, blockpos1))
- if (iblockstate.func_185904_a() == Material.field_151579_a)
+ if (iblockstate.func_177230_c().isAir(iblockstate, this.field_177261_a, blockpos1))
{
return true;
}

View file

@ -1,53 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/state/BlockState.java
+++ ../src-work/minecraft/net/minecraft/block/state/BlockState.java
@@ -38,6 +38,16 @@
public BlockState(Block p_i45663_1_, IProperty... p_i45663_2_)
{
+ this(p_i45663_1_, p_i45663_2_, null);
+ }
+
+ protected StateImplementation createState(Block block, ImmutableMap<IProperty, Comparable> properties, ImmutableMap<net.minecraftforge.common.property.IUnlistedProperty<?>, com.google.common.base.Optional<?>> unlistedProperties)
+ {
+ return new StateImplementation(block, properties);
+ }
+
+ protected BlockState(Block p_i45663_1_, IProperty[] p_i45663_2_, ImmutableMap<net.minecraftforge.common.property.IUnlistedProperty<?>, com.google.common.base.Optional<?>> unlistedProperties)
+ {
this.field_177627_c = p_i45663_1_;
Arrays.sort(p_i45663_2_, new Comparator<IProperty>()
{
@@ -53,7 +63,7 @@
for (List<Comparable> list1 : Cartesian.func_179321_a(this.func_177620_e()))
{
Map<IProperty, Comparable> map1 = MapPopulator.<IProperty, Comparable>func_179400_b(this.field_177624_d, list1);
- BlockState.StateImplementation blockstate$stateimplementation = new BlockState.StateImplementation(p_i45663_1_, ImmutableMap.copyOf(map1));
+ BlockState.StateImplementation blockstate$stateimplementation = createState(p_i45663_1_, ImmutableMap.copyOf(map1), unlistedProperties);
map.put(map1, blockstate$stateimplementation);
list.add(blockstate$stateimplementation);
}
@@ -132,6 +142,13 @@
}
}
+ protected StateImplementation(Block blockIn, ImmutableMap<IProperty, Comparable> propertiesIn, ImmutableTable<IProperty, Comparable, IBlockState> propertyValueTable)
+ {
+ this.field_177239_a = blockIn;
+ this.field_177237_b = propertiesIn;
+ this.field_177238_c = propertyValueTable;
+ }
+
public <T extends Comparable<T>, V extends T> IBlockState func_177226_a(IProperty<T> p_177226_1_, V p_177226_2_)
{
if (!this.field_177237_b.containsKey(p_177226_1_))
@@ -199,5 +216,10 @@
map.put(p_177236_1_, p_177236_2_);
return map;
}
+
+ public ImmutableTable<IProperty, Comparable, IBlockState> getPropertyValueTable()
+ {
+ return field_177238_c;
+ }
}
}

View file

@ -1,11 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/state/BlockStateBase.java
+++ ../src-work/minecraft/net/minecraft/block/state/BlockStateBase.java
@@ -67,4 +67,9 @@
@@ -71,4 +71,9 @@
return stringbuilder.toString();
}
+
+ public com.google.common.collect.ImmutableTable<IProperty, Comparable, IBlockState> getPropertyValueTable()
+ public com.google.common.collect.ImmutableTable<IProperty<?>, Comparable<?>, IBlockState> getPropertyValueTable()
+ {
+ return null;
+ }

View file

@ -0,0 +1,86 @@
--- ../src-base/minecraft/net/minecraft/block/state/BlockStateContainer.java
+++ ../src-work/minecraft/net/minecraft/block/state/BlockStateContainer.java
@@ -55,12 +55,22 @@
public BlockStateContainer(Block p_i45663_1_, IProperty<?>... p_i45663_2_)
{
- this.field_177627_c = p_i45663_1_;
+ this(p_i45663_1_, p_i45663_2_, null);
+ }
+
+ protected StateImplementation createState(Block block, ImmutableMap<IProperty<?>, Comparable<?>> properties, ImmutableMap<net.minecraftforge.common.property.IUnlistedProperty<?>, com.google.common.base.Optional<?>> unlistedProperties)
+ {
+ return new StateImplementation(block, properties);
+ }
+
+ protected BlockStateContainer(Block blockIn, IProperty<?>[] properties, ImmutableMap<net.minecraftforge.common.property.IUnlistedProperty<?>, com.google.common.base.Optional<?>> unlistedProperties)
+ {
+ this.field_177627_c = blockIn;
Map < String, IProperty<? >> map = Maps. < String, IProperty<? >> newHashMap();
- for (IProperty<?> iproperty : p_i45663_2_)
+ for (IProperty<?> iproperty : properties)
{
- func_185919_a(p_i45663_1_, iproperty);
+ func_185919_a(blockIn, iproperty);
map.put(iproperty.func_177701_a(), iproperty);
}
@@ -71,7 +81,7 @@
for (List < Comparable<? >> list : Cartesian.func_179321_a(this.func_177620_e()))
{
Map < IProperty<?>, Comparable<? >> map1 = MapPopulator. < IProperty<?>, Comparable<? >> func_179400_b(this.field_177624_d.values(), list);
- BlockStateContainer.StateImplementation blockstatecontainer$stateimplementation = new BlockStateContainer.StateImplementation(p_i45663_1_, ImmutableMap.copyOf(map1));
+ BlockStateContainer.StateImplementation blockstatecontainer$stateimplementation = createState(blockIn, ImmutableMap.copyOf(map1), unlistedProperties);
map2.put(map1, blockstatecontainer$stateimplementation);
list1.add(blockstatecontainer$stateimplementation);
}
@@ -163,6 +173,13 @@
this.field_177237_b = p_i45660_2_;
}
+ protected StateImplementation(Block blockIn, ImmutableMap<IProperty<?>, Comparable<?>> propertiesIn, ImmutableTable<IProperty<?>, Comparable<?>, IBlockState> propertyValueTable)
+ {
+ this.field_177239_a = blockIn;
+ this.field_177237_b = propertiesIn;
+ this.field_177238_c = propertyValueTable;
+ }
+
public Collection < IProperty<? >> func_177227_a()
{
return Collections. < IProperty<? >> unmodifiableCollection(this.field_177237_b.keySet());
@@ -414,5 +431,34 @@
{
return this.field_177239_a.func_185481_k(this);
}
+
+ //Forge Start
+ public ImmutableTable<IProperty<?>, Comparable<?>, IBlockState> getPropertyValueTable()
+ {
+ return field_177238_c;
+ }
+
+ @Override
+ public int getLightOpacity(IBlockAccess world, BlockPos pos)
+ {
+ return this.field_177239_a.getLightOpacity(this, world, pos);
+ }
+
+ @Override
+ public int getLightValue(IBlockAccess world, BlockPos pos)
+ {
+ return this.field_177239_a.getLightValue(this, world, pos);
+ }
+
+ public boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side)
+ {
+ return this.field_177239_a.isSideSolid(this, world, pos, side);
+ }
+
+ @Override
+ public boolean doesSideBlockRendering(IBlockAccess world, BlockPos pos, EnumFacing side)
+ {
+ return this.field_177239_a.doesSideBlockRendering(this, world, pos, side);
+ }
}
}

View file

@ -0,0 +1,27 @@
--- ../src-base/minecraft/net/minecraft/block/state/IBlockProperties.java
+++ ../src-work/minecraft/net/minecraft/block/state/IBlockProperties.java
@@ -25,9 +25,13 @@
boolean func_185913_b();
+ @Deprecated //Forge location aware version below
int func_185891_c();
+ int getLightOpacity(IBlockAccess world, BlockPos pos);
+ @Deprecated //Forge location aware version below
int func_185906_d();
+ int getLightValue(IBlockAccess world, BlockPos pos);
@SideOnly(Side.CLIENT)
boolean func_185895_e();
@@ -88,5 +92,10 @@
RayTraceResult func_185910_a(World p_185910_1_, BlockPos p_185910_2_, Vec3d p_185910_3_, Vec3d p_185910_4_);
+ @Deprecated // Forge: Use isSideSolid(IBlockAccess, BlockPos, EnumFacing.UP) instead
boolean func_185896_q();
+
+ //Forge added functions
+ boolean doesSideBlockRendering(IBlockAccess world, BlockPos pos, EnumFacing side);
+ boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side);
}

View file

@ -9,10 +9,10 @@
+ if (!net.minecraftforge.fml.client.FMLClientHandler.instance().handleLoadingScreen(scaledresolution)) //FML Don't render while FML's pre-screen is rendering
+ {
Tessellator tessellator = Tessellator.func_178181_a();
WorldRenderer worldrenderer = tessellator.func_178180_c();
VertexBuffer vertexbuffer = tessellator.func_178180_c();
this.field_73725_b.func_110434_K().func_110577_a(Gui.field_110325_k);
@@ -174,6 +178,12 @@
GlStateManager.func_179120_a(770, 771, 1, 0);
GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
this.field_73725_b.field_71466_p.func_175063_a(this.field_73726_c, (float)((k - this.field_73725_b.field_71466_p.func_78256_a(this.field_73726_c)) / 2), (float)(l / 2 - 4 - 16), 16777215);
this.field_73725_b.field_71466_p.func_175063_a(this.field_73727_a, (float)((k - this.field_73725_b.field_71466_p.func_78256_a(this.field_73727_a)) / 2), (float)(l / 2 - 4 + 8), 16777215);
+ }

View file

@ -1,14 +1,14 @@
--- ../src-base/minecraft/net/minecraft/client/Minecraft.java
+++ ../src-work/minecraft/net/minecraft/client/Minecraft.java
@@ -301,7 +301,6 @@
this.field_152355_az = (new YggdrasilAuthenticationService(p_i45547_1_.field_178745_a.field_178751_c, UUID.randomUUID().toString())).createMinecraftSessionService();
@@ -318,7 +318,6 @@
this.field_152355_az = (new YggdrasilAuthenticationService(this.field_110453_aa, UUID.randomUUID().toString())).createMinecraftSessionService();
this.field_71449_j = p_i45547_1_.field_178745_a.field_178752_a;
field_147123_G.info("Setting user: " + this.field_71449_j.func_111285_a());
- field_147123_G.info("(Session ID is " + this.field_71449_j.func_111286_b() + ")");
this.field_71459_aj = p_i45547_1_.field_178741_d.field_178756_a;
this.field_71443_c = p_i45547_1_.field_178743_b.field_178764_a > 0 ? p_i45547_1_.field_178743_b.field_178764_a : 1;
this.field_71440_d = p_i45547_1_.field_178743_b.field_178762_b > 0 ? p_i45547_1_.field_178743_b.field_178762_b : 1;
@@ -415,10 +414,10 @@
@@ -432,10 +431,10 @@
this.field_110451_am = new SimpleReloadableResourceManager(this.field_110452_an);
this.field_135017_as = new LanguageManager(this.field_110452_an, this.field_71474_y.field_74363_ab);
this.field_110451_am.func_110542_a(this.field_135017_as);
@ -18,10 +18,10 @@
this.field_110451_am.func_110542_a(this.field_71446_o);
- this.func_180510_a(this.field_71446_o);
+ net.minecraftforge.fml.client.SplashProgress.drawVanillaScreen(this.field_71446_o);
this.func_175595_al();
this.field_152350_aA = new SkinManager(this.field_71446_o, new File(this.field_110446_Y, "skins"), this.field_152355_az);
this.field_71469_aa = new AnvilSaveConverter(new File(this.field_71412_D, "saves"));
@@ -453,6 +452,8 @@
this.field_71469_aa = new AnvilSaveConverter(new File(this.field_71412_D, "saves"), this.field_184131_U);
this.field_147127_av = new SoundHandler(this.field_110451_am, this.field_71474_y);
@@ -469,6 +468,8 @@
}
});
this.field_71417_B = new MouseHelper();
@ -30,13 +30,13 @@
this.func_71361_d("Pre startup");
GlStateManager.func_179098_w();
GlStateManager.func_179103_j(7425);
@@ -466,17 +467,21 @@
@@ -482,19 +483,23 @@
GlStateManager.func_179096_D();
GlStateManager.func_179128_n(5888);
this.func_71361_d("Startup");
- this.field_147128_au = new TextureMap("textures");
+ bar.step("Loading Texture Map");
+ this.field_147128_au = new TextureMap("textures",true);
+ this.field_147128_au = new TextureMap("textures", true);
this.field_147128_au.func_147633_a(this.field_71474_y.field_151442_I);
this.field_71446_o.func_110580_a(TextureMap.field_110575_b, this.field_147128_au);
this.field_71446_o.func_110577_a(TextureMap.field_110575_b);
@ -44,16 +44,18 @@
+ bar.step("Loading Model Manager");
this.field_175617_aL = new ModelManager(this.field_147128_au);
this.field_110451_am.func_110542_a(this.field_175617_aL);
this.field_184127_aH = BlockColors.func_186723_a();
this.field_184128_aI = ItemColors.func_186729_a(this.field_184127_aH);
+ bar.step("Loading Item Renderer");
this.field_175621_X = new RenderItem(this.field_71446_o, this.field_175617_aL);
this.field_175621_X = new RenderItem(this.field_71446_o, this.field_175617_aL, this.field_184128_aI);
this.field_175616_W = new RenderManager(this.field_71446_o, this.field_175621_X);
this.field_175620_Y = new ItemRenderer(this);
this.field_110451_am.func_110542_a(this.field_175621_X);
+ bar.step("Loading Entity Renderer");
this.field_71460_t = new EntityRenderer(this, this.field_110451_am);
this.field_110451_am.func_110542_a(this.field_71460_t);
this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_71474_y);
@@ -486,22 +491,25 @@
this.field_175618_aM = new BlockRendererDispatcher(this.field_175617_aL.func_174954_c(), this.field_184127_aH);
@@ -504,23 +509,26 @@
this.field_71458_u = new GuiAchievement(this);
GlStateManager.func_179083_b(0, 0, this.field_71443_c, this.field_71440_d);
this.field_71452_i = new EffectRenderer(this.field_71441_e, this.field_71446_o);
@ -77,12 +79,13 @@
+ net.minecraftforge.fml.client.SplashProgress.clearVanillaResources(field_71446_o, field_152354_ay);
this.field_152354_ay = null;
this.field_71461_s = new LoadingScreenRenderer(this);
this.field_184132_p = new DebugRenderer(this);
+ net.minecraftforge.fml.client.FMLClientHandler.instance().onInitializationComplete();
if (this.field_71474_y.field_74353_u && !this.field_71431_Q)
{
this.func_71352_k();
@@ -681,21 +689,23 @@
@@ -692,21 +700,23 @@
File file2 = new File(file1, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt");
Bootstrap.func_179870_a(p_71377_1_.func_71502_e());
@ -109,7 +112,7 @@
}
public boolean func_152349_b()
@@ -883,11 +893,6 @@
@@ -899,11 +909,6 @@
public void func_147108_a(GuiScreen p_147108_1_)
{
@ -121,8 +124,8 @@
if (p_147108_1_ == null && this.field_71441_e == null)
{
p_147108_1_ = new GuiMainMenu();
@@ -897,6 +902,17 @@
p_147108_1_ = new GuiGameOver();
@@ -913,6 +918,17 @@
p_147108_1_ = new GuiGameOver((ITextComponent)null);
}
+ GuiScreen old = this.field_71462_r;
@ -136,10 +139,10 @@
+ old.func_146281_b();
+ }
+
if (p_147108_1_ instanceof GuiMainMenu)
if (p_147108_1_ instanceof GuiMainMenu || p_147108_1_ instanceof GuiMultiplayer)
{
this.field_71474_y.field_74330_P = false;
@@ -1030,9 +1046,11 @@
@@ -1051,9 +1067,11 @@
if (!this.field_71454_w)
{
@ -151,47 +154,28 @@
}
this.field_71424_I.func_76319_b();
@@ -1377,7 +1395,7 @@
@@ -1393,9 +1411,9 @@
{
BlockPos blockpos = this.field_71476_x.func_178782_a();
if (this.field_71441_e.func_180495_p(blockpos).func_177230_c().func_149688_o() != Material.field_151579_a && this.field_71442_b.func_180512_c(blockpos, this.field_71476_x.field_178784_b))
- if (this.field_71441_e.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a && this.field_71442_b.func_180512_c(blockpos, this.field_71476_x.field_178784_b))
+ if (!this.field_71441_e.func_175623_d(blockpos) && this.field_71442_b.func_180512_c(blockpos, this.field_71476_x.field_178784_b))
{
- this.field_71452_i.func_180532_a(blockpos, this.field_71476_x.field_178784_b);
+ this.field_71452_i.addBlockHitEffects(blockpos, this.field_71476_x);
this.field_71439_g.func_71038_i();
this.field_71439_g.func_184609_a(EnumHand.MAIN_HAND);
}
}
@@ -1463,15 +1481,19 @@
@@ -1429,7 +1447,7 @@
case BLOCK:
BlockPos blockpos = this.field_71476_x.func_178782_a();
- if (this.field_71441_e.func_180495_p(blockpos).func_177230_c().func_149688_o() != Material.field_151579_a)
- if (this.field_71441_e.func_180495_p(blockpos).func_185904_a() != Material.field_151579_a)
+ if (!this.field_71441_e.func_175623_d(blockpos))
{
int i = itemstack != null ? itemstack.field_77994_a : 0;
+
+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_71439_g, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, this.field_71441_e, blockpos, this.field_71476_x.field_178784_b, this.field_71476_x.field_72307_f).isCanceled();
+ if (result) { //Forge: Kept separate to simplify patch
if (this.field_71442_b.func_178890_a(this.field_71439_g, this.field_71441_e, itemstack, blockpos, this.field_71476_x.field_178784_b, this.field_71476_x.field_72307_f))
{
flag = false;
this.field_71439_g.func_71038_i();
}
+ }
if (itemstack == null)
{
@@ -1494,7 +1516,8 @@
{
ItemStack itemstack1 = this.field_71439_g.field_71071_by.func_70448_g();
- if (itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1))
+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_71439_g, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR, field_71441_e, null, null, null).isCanceled();
+ if (result && itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1))
{
this.field_71460_t.field_78516_c.func_78445_c();
}
@@ -1598,6 +1621,8 @@
this.field_71442_b.func_180511_b(blockpos, this.field_71476_x.field_178784_b);
break;
@@ -1623,6 +1641,8 @@
--this.field_71467_ac;
}
@ -200,8 +184,32 @@
this.field_71424_I.func_76320_a("gui");
if (!this.field_71445_n)
@@ -1690,6 +1715,8 @@
@@ -1734,6 +1754,7 @@
this.field_71457_ai = 0;
this.field_71441_e.func_72897_h(this.field_71439_g);
}
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireMouseInput();
}
this.field_71424_I.func_76318_c("gameRenderer");
@@ -1821,6 +1842,7 @@
this.field_71453_ak.func_74428_b();
}
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onPostClientTick();
this.field_71424_I.func_76319_b();
this.field_71423_H = func_71386_F();
}
@@ -1926,6 +1948,7 @@
this.field_71474_y.field_181657_aC = this.field_71474_y.field_74330_P && GuiScreen.func_175283_s();
}
}
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireKeyInput();
}
}
@@ -2166,6 +2189,8 @@
{
while (Mouse.next())
{
+ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue;
@ -209,31 +217,7 @@
int i = Mouse.getEventButton();
KeyBinding.func_74510_a(i - 100, Mouse.getEventButtonState());
@@ -1745,6 +1772,7 @@
this.field_71462_r.func_146274_d();
}
}
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireMouseInput();
}
if (this.field_71429_W > 0)
@@ -1923,6 +1951,7 @@
}
}
}
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().fireKeyInput();
}
for (int l = 0; l < 9; ++l)
@@ -2119,12 +2148,15 @@
this.field_71453_ak.func_74428_b();
}
+ net.minecraftforge.fml.common.FMLCommonHandler.instance().onPostClientTick();
+
this.field_71424_I.func_76319_b();
this.field_71423_H = func_71386_F();
}
@@ -2231,6 +2256,7 @@
public void func_71371_a(String p_71371_1_, String p_71371_2_, WorldSettings p_71371_3_)
{
@ -241,7 +225,7 @@
this.func_71403_a((WorldClient)null);
System.gc();
ISaveHandler isavehandler = this.field_71469_aa.func_75804_a(p_71371_1_, false);
@@ -2160,6 +2192,12 @@
@@ -2273,6 +2299,12 @@
while (!this.field_71437_Z.func_71200_ad())
{
@ -254,24 +238,24 @@
String s = this.field_71437_Z.func_71195_b_();
if (s != null)
@@ -2185,8 +2223,14 @@
@@ -2298,8 +2330,14 @@
SocketAddress socketaddress = this.field_71437_Z.func_147137_ag().func_151270_a();
NetworkManager networkmanager = NetworkManager.func_150722_a(socketaddress);
networkmanager.func_150719_a(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null));
- networkmanager.func_179290_a(new C00Handshake(47, socketaddress.toString(), 0, EnumConnectionState.LOGIN));
- networkmanager.func_179290_a(new C00PacketLoginStart(this.func_110432_I().func_148256_e()));
+ networkmanager.func_179290_a(new C00Handshake(47, socketaddress.toString(), 0, EnumConnectionState.LOGIN, true));
- networkmanager.func_179290_a(new C00Handshake(107, socketaddress.toString(), 0, EnumConnectionState.LOGIN));
- networkmanager.func_179290_a(new CPacketLoginStart(this.func_110432_I().func_148256_e()));
+ networkmanager.func_179290_a(new C00Handshake(107, socketaddress.toString(), 0, EnumConnectionState.LOGIN, true));
+ com.mojang.authlib.GameProfile gameProfile = this.func_110432_I().func_148256_e();
+ if (!this.func_110432_I().hasCachedProperties())
+ {
+ gameProfile = field_152355_az.fillProfileProperties(gameProfile, true); //Forge: Fill profile properties upon game load. Fixes MC-52974.
+ this.func_110432_I().setProperties(gameProfile.getProperties());
+ }
+ networkmanager.func_179290_a(new C00PacketLoginStart(gameProfile));
+ networkmanager.func_179290_a(new CPacketLoginStart(gameProfile));
this.field_71453_ak = networkmanager;
}
@@ -2197,6 +2241,8 @@
@@ -2310,6 +2348,8 @@
public void func_71353_a(WorldClient p_71353_1_, String p_71353_2_)
{
@ -280,10 +264,10 @@
if (p_71353_1_ == null)
{
NetHandlerPlayClient nethandlerplayclient = this.func_147114_u();
@@ -2210,6 +2256,18 @@
@@ -2322,6 +2362,18 @@
if (this.field_71437_Z != null && this.field_71437_Z.func_175578_N())
{
this.field_71437_Z.func_71263_m();
this.field_71437_Z.func_175592_a();
+ if (field_71461_s != null)
+ {
+ this.field_71461_s.func_73719_c(I18n.func_135052_a("forge.client.shutdown.internal"));
@ -299,7 +283,7 @@
}
this.field_71437_Z = null;
@@ -2232,6 +2290,7 @@
@@ -2345,6 +2397,7 @@
this.field_71456_v.func_181029_i();
this.func_71351_a((ServerData)null);
this.field_71455_al = false;
@ -307,77 +291,72 @@
}
this.field_147127_av.func_147690_c();
@@ -2336,126 +2395,10 @@
if (this.field_71476_x != null)
@@ -2461,159 +2514,8 @@
{
boolean flag = this.field_71439_g.field_71075_bZ.field_75098_d;
- int i = 0;
- boolean flag1 = false;
if (this.field_71476_x != null && this.field_71476_x.field_72313_a != RayTraceResult.Type.MISS)
{
- boolean flag = this.field_71439_g.field_71075_bZ.field_75098_d;
- TileEntity tileentity = null;
- Item item;
- ItemStack itemstack;
-
- if (this.field_71476_x.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK)
- if (this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK)
- {
- BlockPos blockpos = this.field_71476_x.func_178782_a();
- Block block = this.field_71441_e.func_180495_p(blockpos).func_177230_c();
- IBlockState iblockstate = this.field_71441_e.func_180495_p(blockpos);
- Block block = iblockstate.func_177230_c();
-
- if (block.func_149688_o() == Material.field_151579_a)
- if (iblockstate.func_185904_a() == Material.field_151579_a)
- {
- return;
- }
-
- item = block.func_180665_b(this.field_71441_e, blockpos);
- itemstack = block.func_185473_a(this.field_71441_e, blockpos, iblockstate);
-
- if (item == null)
- if (itemstack == null)
- {
- return;
- }
-
- if (flag && GuiScreen.func_146271_m())
- if (flag && GuiScreen.func_146271_m() && block.func_149716_u())
- {
- tileentity = this.field_71441_e.func_175625_s(blockpos);
- }
-
- Block block1 = item instanceof ItemBlock && !block.func_149648_K() ? Block.func_149634_a(item) : block;
- i = block1.func_176222_j(this.field_71441_e, blockpos);
- flag1 = item.func_77614_k();
- }
- else
- {
- if (this.field_71476_x.field_72313_a != MovingObjectPosition.MovingObjectType.ENTITY || this.field_71476_x.field_72308_g == null || !flag)
- if (this.field_71476_x.field_72313_a != RayTraceResult.Type.ENTITY || this.field_71476_x.field_72308_g == null || !flag)
- {
- return;
- }
-
- if (this.field_71476_x.field_72308_g instanceof EntityPainting)
- {
- item = Items.field_151159_an;
- itemstack = new ItemStack(Items.field_151159_an);
- }
- else if (this.field_71476_x.field_72308_g instanceof EntityLeashKnot)
- {
- item = Items.field_151058_ca;
- itemstack = new ItemStack(Items.field_151058_ca);
- }
- else if (this.field_71476_x.field_72308_g instanceof EntityItemFrame)
- {
- EntityItemFrame entityitemframe = (EntityItemFrame)this.field_71476_x.field_72308_g;
- ItemStack itemstack = entityitemframe.func_82335_i();
- ItemStack itemstack1 = entityitemframe.func_82335_i();
-
- if (itemstack == null)
- if (itemstack1 == null)
- {
- item = Items.field_151160_bD;
- itemstack = new ItemStack(Items.field_151160_bD);
- }
- else
- {
- item = itemstack.func_77973_b();
- i = itemstack.func_77960_j();
- flag1 = true;
- itemstack = ItemStack.func_77944_b(itemstack1);
- }
- }
- else if (this.field_71476_x.field_72308_g instanceof EntityMinecart)
- {
- EntityMinecart entityminecart = (EntityMinecart)this.field_71476_x.field_72308_g;
- Item item;
-
- switch (entityminecart.func_180456_s())
- switch (entityminecart.func_184264_v())
- {
- case FURNACE:
- item = Items.field_151109_aJ;
@ -397,53 +376,91 @@
- default:
- item = Items.field_151143_au;
- }
-
- itemstack = new ItemStack(item);
- }
- else if (this.field_71476_x.field_72308_g instanceof EntityBoat)
- {
- item = Items.field_151124_az;
- itemstack = new ItemStack(((EntityBoat)this.field_71476_x.field_72308_g).func_184455_j());
- }
- else if (this.field_71476_x.field_72308_g instanceof EntityArmorStand)
- {
- item = Items.field_179565_cj;
- itemstack = new ItemStack(Items.field_179565_cj);
- }
- else if (this.field_71476_x.field_72308_g instanceof EntityEnderCrystal)
- {
- itemstack = new ItemStack(Items.field_185158_cP);
- }
- else
- {
- item = Items.field_151063_bx;
- i = EntityList.func_75619_a(this.field_71476_x.field_72308_g);
- flag1 = true;
- String s = EntityList.func_75621_b(this.field_71476_x.field_72308_g);
-
- if (!EntityList.field_75627_a.containsKey(Integer.valueOf(i)))
- if (!EntityList.field_75627_a.containsKey(s))
- {
- return;
- }
-
- itemstack = new ItemStack(Items.field_151063_bx);
- ItemMonsterPlacer.func_185078_a(itemstack, s);
- }
- }
-
InventoryPlayer inventoryplayer = this.field_71439_g.field_71071_by;
- if (tileentity == null)
- if (itemstack.func_77973_b() == null)
- {
- inventoryplayer.func_146030_a(item, i, flag1, flag);
- String s1 = "";
-
- if (this.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK)
- {
- s1 = ((ResourceLocation)Block.field_149771_c.func_177774_c(this.field_71441_e.func_180495_p(this.field_71476_x.func_178782_a()).func_177230_c())).toString();
- }
- else if (this.field_71476_x.field_72313_a == RayTraceResult.Type.ENTITY)
- {
- s1 = EntityList.func_75621_b(this.field_71476_x.field_72308_g);
- }
-
- field_147123_G.warn("Picking on: [{}] {} gave null item", new Object[] {this.field_71476_x.field_72313_a, s1});
- }
- else
- {
- ItemStack itemstack1 = this.func_181036_a(item, i, tileentity);
- inventoryplayer.func_70299_a(inventoryplayer.field_70461_c, itemstack1);
- InventoryPlayer inventoryplayer = this.field_71439_g.field_71071_by;
-
- if (tileentity != null)
- {
- this.func_184119_a(itemstack, tileentity);
- }
-
+ if (!net.minecraftforge.common.ForgeHooks.onPickBlock(this.field_71476_x, this.field_71439_g, this.field_71441_e)) return;
- int i = inventoryplayer.func_184429_b(itemstack);
-
- if (flag)
- {
- inventoryplayer.func_184434_a(itemstack);
- this.field_71442_b.func_78761_a(this.field_71439_g.func_184586_b(EnumHand.MAIN_HAND), 36 + inventoryplayer.field_70461_c);
- }
- else if (i != -1)
- {
- if (InventoryPlayer.func_184435_e(i))
- {
- inventoryplayer.field_70461_c = i;
- }
- else
- {
- this.field_71442_b.func_187100_a(i);
- }
- }
- }
+ net.minecraftforge.common.ForgeHooks.onPickBlock(this.field_71476_x, this.field_71439_g, this.field_71441_e);
+ // We delete this code wholly instead of commenting it out, to make sure we detect changes in it between MC versions
if (flag)
{
int j = this.field_71439_g.field_71069_bz.field_75151_b.size() - 9 + inventoryplayer.field_70461_c;
@@ -2756,18 +2699,8 @@
}
}
@@ -2909,18 +2811,8 @@
public static int func_71369_N()
{
- for (int i = 16384; i > 0; i >>= 1)
- {
- GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, i, i, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)((ByteBuffer)null));
- int j = GL11.glGetTexLevelParameteri(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
- GlStateManager.func_187419_a(32868, 0, 6408, i, i, 0, 6408, 5121, (IntBuffer)null);
- int j = GlStateManager.func_187411_c(32868, 0, 4096);
-
- if (j != 0)
- {
@ -457,15 +474,3 @@
}
public boolean func_70002_Q()
@@ -2924,9 +2857,9 @@
{
this.func_147108_a(new GuiYesNo(new GuiYesNoCallback()
{
- public void func_73878_a(boolean p_73878_1_, int p_73878_2_)
+ public void func_73878_a(boolean result, int id)
{
- if (p_73878_1_)
+ if (result)
{
Minecraft.this.func_152346_Z().func_152930_t();
}

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/client/audio/SoundManager.java
+++ ../src-work/minecraft/net/minecraft/client/audio/SoundManager.java
@@ -69,6 +69,7 @@
@@ -76,6 +76,7 @@
{
SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
@ -8,34 +8,34 @@
}
catch (SoundSystemException soundsystemexception)
{
@@ -80,6 +81,7 @@
{
@@ -100,6 +101,7 @@
this.func_148613_b();
this.func_148608_i();
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.SoundLoadEvent(this));
}
private synchronized void func_148608_i()
@@ -316,6 +318,9 @@
@@ -350,6 +352,9 @@
}
else
{
+ p_148611_1_ = net.minecraftforge.client.ForgeHooksClient.playSound(this, p_148611_1_);
+ if (p_148611_1_ == null) return;
+
SoundEventAccessorComposite soundeventaccessorcomposite = this.field_148622_c.func_147680_a(p_148611_1_.func_147650_b());
if (soundeventaccessorcomposite == null)
@@ -357,10 +362,12 @@
if (soundpoolentry.func_148648_d())
if (!this.field_188777_o.isEmpty())
{
this.field_148620_e.newStreamingSource(false, s, func_148612_a(resourcelocation), resourcelocation.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f1);
for (ISoundEventListener isoundeventlistener : this.field_188777_o)
@@ -400,10 +405,12 @@
if (sound.func_188723_h())
{
this.field_148620_e.newStreamingSource(false, s, func_148612_a(resourcelocation1), resourcelocation1.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlayStreamingSourceEvent(this, p_148611_1_, s));
}
else
{
this.field_148620_e.newSource(false, s, func_148612_a(resourcelocation), resourcelocation.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f1);
this.field_148620_e.newSource(false, s, func_148612_a(resourcelocation1), resourcelocation1.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.PlaySoundSourceEvent(this, p_148611_1_, s));
}
field_148621_b.debug(field_148623_a, "Playing sound {} for event {} as channel {}", new Object[] {soundpoolentry.func_148652_a(), soundeventaccessorcomposite.func_148729_c(), s});
field_148621_b.debug(field_148623_a, "Playing sound {} for event {} as channel {}", new Object[] {sound.func_188719_a(), resourcelocation1, s});

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java
+++ ../src-work/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java
@@ -128,6 +128,6 @@
@@ -148,6 +148,6 @@
f *= 1.0F - f1 * 0.15F;
}

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
+++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
@@ -345,6 +345,15 @@
@@ -400,6 +400,15 @@
this.field_71159_c.field_71456_v.func_146158_b().func_146227_a(p_146105_1_);
}
@ -16,7 +16,7 @@
protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_)
{
if (this.field_70145_X)
@@ -357,30 +366,34 @@
@@ -412,30 +421,34 @@
double d0 = p_145771_1_ - (double)blockpos.func_177958_n();
double d1 = p_145771_5_ - (double)blockpos.func_177952_p();
@ -56,16 +56,18 @@
{
d2 = 1.0D - d1;
i = 5;
@@ -448,6 +461,12 @@
@@ -515,7 +528,13 @@
public void func_85030_a(String p_85030_1_, float p_85030_2_, float p_85030_3_)
public void func_184185_a(SoundEvent p_184185_1_, float p_184185_2_, float p_184185_3_)
{
+ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(this, p_85030_1_, p_85030_2_, p_85030_3_);
+ if (event.isCanceled() || event.name == null) return;
+ p_85030_1_ = event.name;
+ p_85030_2_ = event.newVolume;
+ p_85030_3_ = event.newPitch;
- this.field_70170_p.func_184134_a(this.field_70165_t, this.field_70163_u, this.field_70161_v, p_184185_1_, this.func_184176_by(), p_184185_2_, p_184185_3_, false);
+ net.minecraftforge.event.entity.PlaySoundAtEntityEvent event = net.minecraftforge.event.ForgeEventFactory.onPlaySoundAtEntity(this, p_184185_1_, this.func_184176_by(), p_184185_2_, p_184185_3_);
+ if (event.isCanceled() || event.getSound() == null) return;
+ p_184185_1_ = event.getSound();
+ p_184185_2_ = event.getVolume();
+ p_184185_3_ = event.getPitch();
+
this.field_70170_p.func_72980_b(this.field_70165_t, this.field_70163_u, this.field_70161_v, p_85030_1_, p_85030_2_, p_85030_3_, false);
+ this.field_70170_p.func_184134_a(this.field_70165_t, this.field_70163_u, this.field_70161_v, p_184185_1_, event.getCategory(), p_184185_2_, p_184185_3_, false);
}
public boolean func_70613_aW()

View file

@ -17,25 +17,25 @@
}
private void func_111272_d()
@@ -105,7 +106,7 @@
@@ -106,7 +107,7 @@
try
{
- bufferedimage = TextureUtil.func_177053_a(Minecraft.func_71410_x().func_110442_L().func_110536_a(this.field_111273_g).func_110527_b());
+ bufferedimage = TextureUtil.func_177053_a(getResourceInputStream(this.field_111273_g));
- iresource = Minecraft.func_71410_x().func_110442_L().func_110536_a(this.field_111273_g);
+ iresource = getResource(this.field_111273_g);
bufferedimage = TextureUtil.func_177053_a(iresource.func_110527_b());
}
catch (IOException ioexception)
{
@@ -165,7 +166,7 @@
@@ -171,7 +172,7 @@
try
{
- inputstream = Minecraft.func_71410_x().func_110442_L().func_110536_a(new ResourceLocation("font/glyph_sizes.bin")).func_110527_b();
+ inputstream = getResourceInputStream(new ResourceLocation("font/glyph_sizes.bin"));
inputstream.read(this.field_78287_e);
- iresource = Minecraft.func_71410_x().func_110442_L().func_110536_a(new ResourceLocation("font/glyph_sizes.bin"));
+ iresource = getResource(new ResourceLocation("font/glyph_sizes.bin"));
iresource.func_110527_b().read(this.field_78287_e);
}
catch (IOException ioexception)
@@ -196,7 +197,7 @@
@@ -202,7 +203,7 @@
int i = p_78266_1_ % 16 * 8;
int j = p_78266_1_ / 16 * 8;
int k = p_78266_2_ ? 1 : 0;
@ -43,8 +43,8 @@
+ bindTexture(this.field_111273_g);
int l = this.field_78286_d[p_78266_1_];
float f = (float)l - 0.01F;
GL11.glBegin(GL11.GL_TRIANGLE_STRIP);
@@ -224,7 +225,7 @@
GlStateManager.func_187447_r(5);
@@ -230,7 +231,7 @@
private void func_78257_a(int p_78257_1_)
{
@ -53,7 +53,7 @@
}
protected float func_78277_a(char p_78277_1_, boolean p_78277_2_)
@@ -271,7 +272,7 @@
@@ -279,7 +280,7 @@
public int func_175065_a(String p_175065_1_, float p_175065_2_, float p_175065_3_, int p_175065_4_, boolean p_175065_5_)
{
@ -62,7 +62,7 @@
this.func_78265_b();
int i;
@@ -341,7 +342,7 @@
@@ -349,7 +350,7 @@
int j1 = this.field_78285_g[i1];
this.field_78304_r = j1;
@ -71,7 +71,7 @@
}
else if (i1 == 16)
{
@@ -370,7 +371,7 @@
@@ -378,7 +379,7 @@
this.field_78299_w = false;
this.field_78300_v = false;
this.field_78301_u = false;
@ -80,7 +80,7 @@
}
++i;
@@ -398,7 +399,7 @@
@@ -406,7 +407,7 @@
c0 = c1;
}
@ -89,7 +89,7 @@
boolean flag = (c0 == 0 || j == -1 || this.field_78293_l) && p_78255_2_;
if (flag)
@@ -436,7 +437,16 @@
@@ -444,7 +445,16 @@
++f;
}
@ -106,7 +106,7 @@
if (this.field_78299_w)
{
Tessellator tessellator = Tessellator.func_178181_a();
@@ -509,7 +519,7 @@
@@ -517,7 +527,7 @@
this.field_78292_o = (float)(p_180455_4_ >> 8 & 255) / 255.0F;
this.field_78306_p = (float)(p_180455_4_ & 255) / 255.0F;
this.field_78305_q = (float)(p_180455_4_ >> 24 & 255) / 255.0F;
@ -115,19 +115,7 @@
this.field_78295_j = p_180455_2_;
this.field_78296_k = p_180455_3_;
this.func_78255_a(p_180455_1_, p_180455_5_);
@@ -588,11 +598,6 @@
int j = this.field_78287_e[p_78263_1_] >>> 4;
int k = this.field_78287_e[p_78263_1_] & 15;
- if (k > 7)
- {
- k = 15;
- j = 0;
- }
++k;
return (k - j) / 2 + 1;
@@ -846,6 +851,26 @@
@@ -848,6 +858,26 @@
return this.field_78294_m;
}
@ -146,11 +134,11 @@
+ field_78298_i.func_110577_a(location);
+ }
+
+ protected InputStream getResourceInputStream(ResourceLocation location) throws IOException
+ protected IResource getResource(ResourceLocation location) throws IOException
+ {
+ return Minecraft.func_71410_x().func_110442_L().func_110536_a(location).func_110527_b();
+ return Minecraft.func_71410_x().func_110442_L().func_110536_a(location);
+ }
+
public int func_175064_b(char p_175064_1_)
{
return this.field_78285_g["0123456789abcdef".indexOf(p_175064_1_)];
int i = "0123456789abcdef".indexOf(p_175064_1_);

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiButton.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiButton.java
@@ -21,6 +21,7 @@
@@ -22,6 +22,7 @@
public boolean field_146124_l;
public boolean field_146125_m;
protected boolean field_146123_n;
@ -8,7 +8,7 @@
public GuiButton(int p_i1020_1_, int p_i1020_2_, int p_i1020_3_, String p_i1020_4_)
{
@@ -74,6 +75,11 @@
@@ -75,6 +76,11 @@
this.func_146119_b(p_146112_1_, p_146112_2_, p_146112_3_);
int j = 14737632;

View file

@ -1,39 +1,10 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiChat.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiChat.java
@@ -215,13 +215,14 @@
this.field_146297_k.field_71456_v.func_146158_b().func_146234_a(new ChatComponentText(stringbuilder.toString()), 1);
}
@@ -250,6 +250,7 @@
- this.field_146415_a.func_146191_b((String)this.field_146412_t.get(this.field_146413_s++));
+ this.field_146415_a.func_146191_b(net.minecraft.util.EnumChatFormatting.func_110646_a((String)this.field_146412_t.get(this.field_146413_s++)));
}
private void func_146405_a(String p_146405_1_, String p_146405_2_)
public BlockPos func_186839_b()
{
if (p_146405_1_.length() >= 1)
{
+ net.minecraftforge.client.ClientCommandHandler.instance.autoComplete(p_146405_1_, p_146405_2_);
+
BlockPos blockpos = null;
if (this.field_146297_k.field_71476_x != null && this.field_146297_k.field_71476_x.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK)
@@ -281,6 +282,12 @@
this.field_146417_i = false;
this.field_146412_t.clear();
+ String[] complete = net.minecraftforge.client.ClientCommandHandler.instance.latestAutoComplete;
+ if (complete != null)
+ {
+ p_146406_1_ = com.google.common.collect.ObjectArrays.concat(complete, p_146406_1_, String.class);
+ }
+
for (String s : p_146406_1_)
{
if (s.length() > 0)
@@ -291,6 +298,7 @@
String s1 = this.field_146415_a.func_146179_b().substring(this.field_146415_a.func_146197_a(-1, this.field_146415_a.func_146198_h(), false));
String s2 = StringUtils.getCommonPrefix(p_146406_1_);
+ s2 = net.minecraft.util.EnumChatFormatting.func_110646_a(s2);
if (s2.length() > 0 && !s1.equalsIgnoreCase(s2))
{
if (this.field_186853_g.field_71476_x != null && this.field_186853_g.field_71476_x.field_72313_a == RayTraceResult.Type.BLOCK)

View file

@ -6,10 +6,10 @@
+ WorldType.field_77139_a[this.field_146331_K].onGUICreateWorldPress();
+
WorldSettings.GameType worldsettings$gametype = WorldSettings.GameType.func_77142_a(this.field_146342_r);
WorldSettings worldsettings = new WorldSettings(i, worldsettings$gametype, this.field_146341_s, this.field_146337_w, WorldType.field_77139_a[this.field_146331_K]);
WorldSettings worldsettings = new WorldSettings(i, WorldSettings.GameType.func_77142_a(this.field_146342_r), this.field_146341_s, this.field_146337_w, WorldType.field_77139_a[this.field_146331_K]);
worldsettings.func_82750_a(this.field_146334_a);
@@ -312,14 +314,7 @@
@@ -311,14 +313,7 @@
}
else if (p_146284_1_.field_146127_k == 8)
{
@ -25,7 +25,7 @@
}
}
}
@@ -371,7 +366,7 @@
@@ -370,7 +365,7 @@
this.field_146326_C.field_146125_m = this.field_146344_y;
this.field_146320_D.field_146125_m = this.field_146344_y;
this.field_146321_E.field_146125_m = this.field_146344_y;

View file

@ -0,0 +1,12 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiIngame.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiIngame.java
@@ -360,7 +360,8 @@
BlockPos blockpos = raytraceresult.func_178782_a();
- if (!this.field_73839_d.field_71441_e.func_180495_p(blockpos).func_177230_c().func_149716_u() || !(this.field_73839_d.field_71441_e.func_175625_s(blockpos) instanceof IInventory))
+ net.minecraft.block.state.IBlockState state = this.field_73839_d.field_71441_e.func_180495_p(blockpos);
+ if (!state.func_177230_c().hasTileEntity(state) || !(this.field_73839_d.field_71441_e.func_175625_s(blockpos) instanceof IInventory))
{
return;
}

View file

@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiListWorldSelectionEntry.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiListWorldSelectionEntry.java
@@ -242,7 +242,7 @@
if (this.field_186784_e.func_71359_d().func_90033_f(this.field_186786_g.func_75786_a()))
{
- this.field_186784_e.func_71371_a(this.field_186786_g.func_75786_a(), this.field_186786_g.func_75788_b(), (WorldSettings)null);
+ net.minecraftforge.fml.client.FMLClientHandler.instance().tryLoadExistingWorld(field_186785_f, this.field_186786_g);
}
}

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiMainMenu.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiMainMenu.java
@@ -223,7 +223,8 @@
@@ -216,7 +216,8 @@
{
this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 100, p_73969_1_, I18n.func_135052_a("menu.singleplayer", new Object[0])));
this.field_146292_n.add(new GuiButton(2, this.field_146294_l / 2 - 100, p_73969_1_ + p_73969_2_ * 1, I18n.func_135052_a("menu.multiplayer", new Object[0])));
@ -10,7 +10,7 @@
}
private void func_73972_b(int p_73972_1_, int p_73972_2_)
@@ -271,6 +272,11 @@
@@ -264,6 +265,11 @@
this.field_146297_k.func_71400_g();
}
@ -22,8 +22,8 @@
if (p_146284_1_.field_146127_k == 11)
{
this.field_146297_k.func_71371_a("Demo_World", "Demo_World", DemoWorldServer.field_73071_a);
@@ -516,7 +522,16 @@
s = s + " Demo";
@@ -512,7 +518,16 @@
s = s + ("release".equalsIgnoreCase(this.field_146297_k.func_184123_d()) ? "" : "/" + this.field_146297_k.func_184123_d());
}
- this.func_73731_b(this.field_146289_q, s, 2, this.field_146295_m - 10, -1);

View file

@ -1,8 +1,8 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java
@@ -176,6 +176,9 @@
@@ -190,6 +190,9 @@
long l = j - k;
List<String> list = Lists.newArrayList(new String[] {String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.field_175242_a.func_147111_S() ? 64 : 32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(func_175240_a(l)), Long.valueOf(func_175240_a(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(func_175240_a(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.func_183029_j()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GL11.glGetString(GL11.GL_VENDOR)}), GL11.glGetString(GL11.GL_RENDERER), GL11.glGetString(GL11.GL_VERSION)});
List<String> list = Lists.newArrayList(new String[] {String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.field_175242_a.func_147111_S() ? 64 : 32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(func_175240_a(l)), Long.valueOf(func_175240_a(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(func_175240_a(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.func_183029_j()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GlStateManager.func_187416_u(7936)}), GlStateManager.func_187416_u(7937), GlStateManager.func_187416_u(7938)});
+ list.add("");
+ list.addAll(net.minecraftforge.fml.common.FMLCommonHandler.instance().getBrandings(false));

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiScreen.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreen.java
@@ -143,7 +143,8 @@
@@ -141,7 +141,8 @@
}
}
@ -10,7 +10,7 @@
}
protected void func_146279_a(String p_146279_1_, int p_146279_2_, int p_146279_3_)
@@ -153,6 +154,11 @@
@@ -151,6 +152,11 @@
protected void func_146283_a(List<String> p_146283_1_, int p_146283_2_, int p_146283_3_)
{
@ -22,7 +22,7 @@
if (!p_146283_1_.isEmpty())
{
GlStateManager.func_179101_C();
@@ -163,7 +169,7 @@
@@ -161,7 +167,7 @@
for (String s : p_146283_1_)
{
@ -31,7 +31,7 @@
if (j > i)
{
@@ -208,7 +214,7 @@
@@ -206,7 +212,7 @@
for (int k1 = 0; k1 < p_146283_1_.size(); ++k1)
{
String s1 = (String)p_146283_1_.get(k1);
@ -40,7 +40,7 @@
if (k1 == 0)
{
@@ -436,6 +442,7 @@
@@ -421,6 +427,7 @@
{
this.field_146297_k.field_71456_v.func_146158_b().func_146239_a(p_175281_1_);
}
@ -48,7 +48,7 @@
this.field_146297_k.field_71439_g.func_71165_d(p_175281_1_);
}
@@ -450,9 +457,15 @@
@@ -435,9 +442,15 @@
if (guibutton.func_146116_c(this.field_146297_k, p_73864_1_, p_73864_2_))
{
@ -64,7 +64,7 @@
}
}
}
@@ -482,8 +495,12 @@
@@ -467,8 +480,12 @@
this.field_146289_q = p_146280_1_.field_71466_p;
this.field_146294_l = p_146280_2_;
this.field_146295_m = p_146280_3_;
@ -77,7 +77,7 @@
}
public void func_183500_a(int p_183500_1_, int p_183500_2_)
@@ -502,7 +519,9 @@
@@ -487,7 +504,9 @@
{
while (Mouse.next())
{
@ -87,7 +87,7 @@
}
}
@@ -510,7 +529,9 @@
@@ -495,7 +514,9 @@
{
while (Keyboard.next())
{
@ -97,7 +97,7 @@
}
}
}
@@ -570,6 +591,7 @@
@@ -557,6 +578,7 @@
public void func_146276_q_()
{
this.func_146270_b(0);

View file

@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiSelectWorld.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSelectWorld.java
@@ -186,7 +186,7 @@
if (this.field_146297_k.func_71359_d().func_90033_f(s))
{
- this.field_146297_k.func_71371_a(s, s1, (WorldSettings)null);
+ net.minecraftforge.fml.client.FMLClientHandler.instance().tryLoadExistingWorld(this, s, s1);
}
}
}

View file

@ -3,15 +3,15 @@
@@ -181,15 +181,8 @@
GlStateManager.func_179106_n();
Tessellator tessellator = Tessellator.func_178181_a();
WorldRenderer worldrenderer = tessellator.func_178180_c();
VertexBuffer vertexbuffer = tessellator.func_178180_c();
- this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k);
- GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
- float f = 32.0F;
- worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181709_i);
- worldrenderer.func_181662_b((double)this.field_148152_e, (double)this.field_148154_c, 0.0D).func_181673_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d();
- worldrenderer.func_181662_b((double)this.field_148151_d, (double)this.field_148154_c, 0.0D).func_181673_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d();
- worldrenderer.func_181662_b((double)this.field_148151_d, (double)this.field_148153_b, 0.0D).func_181673_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d();
- worldrenderer.func_181662_b((double)this.field_148152_e, (double)this.field_148153_b, 0.0D).func_181673_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d();
- vertexbuffer.func_181668_a(7, DefaultVertexFormats.field_181709_i);
- vertexbuffer.func_181662_b((double)this.field_148152_e, (double)this.field_148154_c, 0.0D).func_187315_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d();
- vertexbuffer.func_181662_b((double)this.field_148151_d, (double)this.field_148154_c, 0.0D).func_187315_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d();
- vertexbuffer.func_181662_b((double)this.field_148151_d, (double)this.field_148153_b, 0.0D).func_187315_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d();
- vertexbuffer.func_181662_b((double)this.field_148152_e, (double)this.field_148153_b, 0.0D).func_187315_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d();
- tessellator.func_78381_a();
+ // Forge: background rendering moved into separate method.
+ this.drawContainerBackground(tessellator);
@ -25,15 +25,15 @@
+
+ protected void drawContainerBackground(Tessellator tessellator)
+ {
+ WorldRenderer worldrenderer = tessellator.func_178180_c();
+ VertexBuffer buffer = tessellator.func_178180_c();
+ this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k);
+ GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
+ float f = 32.0F;
+ worldrenderer.func_181668_a(7, DefaultVertexFormats.field_181709_i);
+ worldrenderer.func_181662_b((double)this.field_148152_e, (double)this.field_148154_c, 0.0D).func_181673_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d();
+ worldrenderer.func_181662_b((double)this.field_148151_d, (double)this.field_148154_c, 0.0D).func_181673_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d();
+ worldrenderer.func_181662_b((double)this.field_148151_d, (double)this.field_148153_b, 0.0D).func_181673_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d();
+ worldrenderer.func_181662_b((double)this.field_148152_e, (double)this.field_148153_b, 0.0D).func_181673_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d();
+ buffer.func_181668_a(7, DefaultVertexFormats.field_181709_i);
+ buffer.func_181662_b((double)this.field_148152_e, (double)this.field_148154_c, 0.0D).func_187315_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d();
+ buffer.func_181662_b((double)this.field_148151_d, (double)this.field_148154_c, 0.0D).func_187315_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d();
+ buffer.func_181662_b((double)this.field_148151_d, (double)this.field_148153_b, 0.0D).func_187315_a((double)((float)this.field_148151_d / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d();
+ buffer.func_181662_b((double)this.field_148152_e, (double)this.field_148153_b, 0.0D).func_187315_a((double)((float)this.field_148152_e / f), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f)).func_181669_b(32, 32, 32, 255).func_181675_d();
+ tessellator.func_78381_a();
+ }
}

View file

@ -5,6 +5,6 @@
}
+ s3 = FontRenderer.func_78282_e(s2) + s3; //Forge: Fix chat formatting not surviving line wrapping.
ChatComponentText chatcomponenttext2 = new ChatComponentText(s3);
chatcomponenttext2.func_150255_a(ichatcomponent1.func_150256_b().func_150232_l());
list1.add(j + 1, chatcomponenttext2);
TextComponentString textcomponentstring2 = new TextComponentString(s3);
textcomponentstring2.func_150255_a(itextcomponent1.func_150256_b().func_150232_l());
list1.add(j + 1, textcomponentstring2);

View file

@ -1,7 +1,7 @@
--- ../src-base/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java
+++ ../src-work/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java
@@ -82,7 +82,7 @@
boolean flag1 = this.field_148301_e.field_82821_f < 47;
boolean flag1 = this.field_148301_e.field_82821_f < 107;
boolean flag2 = flag || flag1;
this.field_148300_d.field_71466_p.func_78276_b(this.field_148301_e.field_78847_a, p_180790_2_ + 32 + 3, p_180790_3_ + 1, 16777215);
- List<String> list = this.field_148300_d.field_71466_p.func_78271_c(this.field_148301_e.field_78843_d, p_180790_4_ - 32 - 2);

View file

@ -13,10 +13,10 @@
this.field_146562_a = p_i45026_1_;
@@ -57,6 +61,14 @@
int j = 141;
this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.field_76004_f.field_75993_a * 24 - i / 2 - 12);
this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.field_76004_f.field_75991_b * 24 - j / 2);
this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.field_187982_f.field_75993_a * 24 - i / 2 - 12);
this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.field_187982_f.field_75991_b * 24 - j / 2);
+ minecraftAchievements.clear();
+ for (Achievement achievement : AchievementList.field_76007_e)
+ for (Achievement achievement : AchievementList.field_187981_e)
+ {
+ if (!net.minecraftforge.common.AchievementPage.isAchievementInPages(achievement))
+ {
@ -27,7 +27,7 @@
public void func_73866_w_()
@@ -64,6 +76,7 @@
this.field_146297_k.func_147114_u().func_147297_a(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS));
this.field_146297_k.func_147114_u().func_147297_a(new CPacketClientStatus(CPacketClientStatus.State.REQUEST_STATS));
this.field_146292_n.clear();
this.field_146292_n.add(new GuiOptionButton(1, this.field_146294_l / 2 + 24, this.field_146295_m / 2 + 74, 80, 20, I18n.func_135052_a("gui.done", new Object[0])));
+ this.field_146292_n.add(button = new GuiButton(2, (field_146294_l - field_146555_f) / 2 + 24, field_146295_m / 2 + 74, 125, 20, net.minecraftforge.common.AchievementPage.getTitle(currentPage)));
@ -66,12 +66,11 @@
GlStateManager.func_179143_c(515);
this.field_146297_k.func_110434_K().func_110577_a(field_146561_C);
- for (int j5 = 0; j5 < AchievementList.field_76007_e.size(); ++j5)
- for (int j5 = 0; j5 < AchievementList.field_187981_e.size(); ++j5)
+ java.util.List<Achievement> achievementList = (currentPage == -1 ? minecraftAchievements : net.minecraftforge.common.AchievementPage.getAchievementPage(currentPage).getAchievements());
+ for (int j5 = 0; j5 < achievementList.size(); ++j5)
{
- Achievement achievement1 = (Achievement)AchievementList.field_76007_e.get(j5);
+ Achievement achievement1 = achievementList.get(j5);
Achievement achievement1 = (Achievement)AchievementList.field_187981_e.get(j5);
- if (achievement1.field_75992_c != null)
+ if (achievement1.field_75992_c != null && achievementList.contains(achievement1.field_75992_c))
@ -82,10 +81,10 @@
GlStateManager.func_179091_B();
GlStateManager.func_179142_g();
- for (int i6 = 0; i6 < AchievementList.field_76007_e.size(); ++i6)
- for (int i6 = 0; i6 < AchievementList.field_187981_e.size(); ++i6)
+ for (int i6 = 0; i6 < achievementList.size(); ++i6)
{
- Achievement achievement2 = (Achievement)AchievementList.field_76007_e.get(i6);
- Achievement achievement2 = (Achievement)AchievementList.field_187981_e.get(i6);
+ Achievement achievement2 = achievementList.get(i6);
int l6 = achievement2.field_75993_a * 24 - i;
int j7 = achievement2.field_75991_b * 24 - j;
@ -114,4 +113,4 @@
+ GlStateManager.func_179140_f(); //Forge: Make sure Lighting is disabled. Fixes MC-33065
GlStateManager.func_179089_o();
this.field_146296_j.func_180450_b(achievement2.field_75990_d, l6 + 3, j7 + 3);
GlStateManager.func_179112_b(770, 771);
GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);

View file

@ -1,69 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/gui/achievement/GuiStats.java
+++ ../src-work/minecraft/net/minecraft/client/gui/achievement/GuiStats.java
@@ -5,6 +5,8 @@
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
+
+import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.GuiButton;
@@ -443,17 +445,18 @@
for (StatCrafting statcrafting : StatList.field_75939_e)
{
boolean flag = false;
- int i = Item.func_150891_b(statcrafting.func_150959_a());
+ int i = Block.func_149682_b(Block.func_149634_a(statcrafting.func_150959_a()));
+ int itemId = Item.func_150891_b(statcrafting.func_150959_a());
if (GuiStats.this.field_146546_t.func_77444_a(statcrafting) > 0)
{
flag = true;
}
- else if (StatList.field_75929_E[i] != null && GuiStats.this.field_146546_t.func_77444_a(StatList.field_75929_E[i]) > 0)
+ else if (StatList.field_75929_E[itemId] != null && GuiStats.this.field_146546_t.func_77444_a(StatList.field_75929_E[itemId]) > 0)
{
flag = true;
}
- else if (StatList.field_75928_D[i] != null && GuiStats.this.field_146546_t.func_77444_a(StatList.field_75928_D[i]) > 0)
+ else if (StatList.field_75928_D[itemId] != null && GuiStats.this.field_146546_t.func_77444_a(StatList.field_75928_D[itemId]) > 0)
{
flag = true;
}
@@ -468,8 +471,15 @@
{
public int compare(StatCrafting p_compare_1_, StatCrafting p_compare_2_)
{
- int j = Item.func_150891_b(p_compare_1_.func_150959_a());
- int k = Item.func_150891_b(p_compare_2_.func_150959_a());
+ int j;
+ int k;
+ if (StatsBlock.this.field_148217_o == 2) {
+ j = Block.func_149682_b(Block.func_149634_a(p_compare_1_.func_150959_a()));
+ k = Block.func_149682_b(Block.func_149634_a(p_compare_2_.func_150959_a()));
+ } else {
+ j = Item.func_150891_b(p_compare_1_.func_150959_a());
+ k = Item.func_150891_b(p_compare_2_.func_150959_a());
+ }
StatBase statbase = null;
StatBase statbase1 = null;
@@ -748,7 +758,7 @@
super(p_i45510_2_, GuiStats.this.field_146294_l, GuiStats.this.field_146295_m, 32, GuiStats.this.field_146295_m - 64, GuiStats.this.field_146289_q.field_78288_b * 4);
this.func_148130_a(false);
- for (EntityList.EntityEggInfo entitylist$entityegginfo : EntityList.field_75627_a.values())
+ for (EntityList.EntityEggInfo entitylist$entityegginfo : com.google.common.collect.Iterables.concat(EntityList.field_75627_a.values(), net.minecraftforge.fml.common.registry.EntityRegistry.getEggs().values()))
{
if (GuiStats.this.field_146546_t.func_77444_a(entitylist$entityegginfo.field_151512_d) > 0 || GuiStats.this.field_146546_t.func_77444_a(entitylist$entityegginfo.field_151513_e) > 0)
{
@@ -784,7 +794,7 @@
protected void func_180791_a(int p_180791_1_, int p_180791_2_, int p_180791_3_, int p_180791_4_, int p_180791_5_, int p_180791_6_)
{
EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo)this.field_148222_l.get(p_180791_1_);
- String s = I18n.func_135052_a("entity." + EntityList.func_75617_a(entitylist$entityegginfo.field_75613_a) + ".name", new Object[0]);
+ String s = I18n.func_135052_a("entity." + entitylist$entityegginfo.name + ".name", new Object[0]);
int i = GuiStats.this.field_146546_t.func_77444_a(entitylist$entityegginfo.field_151512_d);
int j = GuiStats.this.field_146546_t.func_77444_a(entitylist$entityegginfo.field_151513_e);
String s1 = I18n.func_135052_a("stat.entityKills", new Object[] {Integer.valueOf(i), s});

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
+++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
@@ -175,8 +175,11 @@
@@ -176,8 +176,11 @@
GlStateManager.func_179109_b(0.0F, 0.0F, 32.0F);
this.field_73735_i = 200.0F;
this.field_146296_j.field_77023_b = 200.0F;
@ -13,9 +13,9 @@
this.field_73735_i = 0.0F;
this.field_146296_j.field_77023_b = 0.0F;
}
@@ -239,13 +242,12 @@
@@ -240,13 +243,12 @@
if (itemstack == null)
if (itemstack == null && p_146977_1_.func_111238_b())
{
- String s1 = p_146977_1_.func_178171_c();
+ TextureAtlasSprite textureatlassprite = p_146977_1_.getBackgroundSprite();
@ -30,7 +30,7 @@
this.func_175175_a(i, j, textureatlassprite, 16, 16);
GlStateManager.func_179145_e();
flag1 = true;
@@ -326,6 +328,7 @@
@@ -327,6 +329,7 @@
int j = this.field_147003_i;
int k = this.field_147009_r;
boolean flag1 = p_73864_1_ < j || p_73864_2_ < k || p_73864_1_ >= j + this.field_146999_f || p_73864_2_ >= k + this.field_147000_g;
@ -38,7 +38,7 @@
int l = -1;
if (slot != null)
@@ -463,10 +466,12 @@
@@ -464,10 +467,12 @@
protected void func_146286_b(int p_146286_1_, int p_146286_2_, int p_146286_3_)
{
@ -51,7 +51,7 @@
int k = -1;
if (slot != null)
@@ -685,4 +690,16 @@
@@ -686,4 +691,16 @@
this.field_146297_k.field_71439_g.func_71053_j();
}
}

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java
+++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java
@@ -48,6 +48,8 @@
@@ -49,6 +49,8 @@
private Slot field_147064_C;
private boolean field_147057_D;
private CreativeCrafting field_147059_E;
@ -9,16 +9,7 @@
public GuiContainerCreative(EntityPlayer p_i1088_1_)
{
@@ -175,7 +177,7 @@
return;
}
- if (itemstack1 != null && itemstack2 != null && itemstack1.func_77969_a(itemstack2))
+ if (itemstack1 != null && itemstack2 != null && itemstack1.func_77969_a(itemstack2) && ItemStack.func_77970_a(itemstack1, itemstack2)) //Forge: Bugfix, Compare NBT data, allow for deletion of enchanted books, MC-12770
{
if (p_146984_3_ == 0)
{
@@ -259,6 +261,13 @@
@@ -258,6 +260,13 @@
this.func_147050_b(CreativeTabs.field_78032_a[i]);
this.field_147059_E = new CreativeCrafting(this.field_146297_k);
this.field_146297_k.field_71439_g.field_71069_bz.func_75132_a(this.field_147059_E);
@ -32,7 +23,7 @@
}
else
{
@@ -280,7 +289,7 @@
@@ -279,7 +288,7 @@
protected void func_73869_a(char p_73869_1_, int p_73869_2_) throws IOException
{
@ -41,7 +32,7 @@
{
if (GameSettings.func_100015_a(this.field_146297_k.field_71474_y.field_74310_D))
{
@@ -318,6 +327,14 @@
@@ -317,6 +326,14 @@
GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h;
guicontainercreative$containercreative.field_148330_a.clear();
@ -56,7 +47,7 @@
for (Item item : Item.field_150901_e)
{
if (item != null && item.func_77640_w() != null)
@@ -325,7 +342,13 @@
@@ -324,7 +341,13 @@
item.func_150895_a(item, (CreativeTabs)null, guicontainercreative$containercreative.field_148330_a);
}
}
@ -67,10 +58,10 @@
+ private void updateFilteredItems(GuiContainerCreative.ContainerCreative guicontainercreative$containercreative)
+ {
+ if (CreativeTabs.field_78032_a[field_147058_w] == CreativeTabs.field_78027_g) // FORGE: Only add enchanted books to the regular search
for (Enchantment enchantment : Enchantment.field_77331_b)
for (Enchantment enchantment : Enchantment.field_185264_b)
{
if (enchantment != null && enchantment.field_77351_y != null)
@@ -333,7 +356,6 @@
@@ -332,7 +355,6 @@
Items.field_151134_bR.func_92113_a(enchantment, guicontainercreative$containercreative.field_148330_a);
}
}
@ -78,7 +69,7 @@
Iterator<ItemStack> iterator = guicontainercreative$containercreative.field_148330_a.iterator();
String s1 = this.field_147062_A.func_146179_b().toLowerCase();
@@ -365,7 +387,7 @@
@@ -364,7 +386,7 @@
{
CreativeTabs creativetabs = CreativeTabs.field_78032_a[field_147058_w];
@ -87,7 +78,7 @@
{
GlStateManager.func_179084_k();
this.field_146289_q.func_78276_b(I18n.func_135052_a(creativetabs.func_78024_c(), new Object[0]), 8, 6, 4210752);
@@ -400,7 +422,7 @@
@@ -399,7 +421,7 @@
for (CreativeTabs creativetabs : CreativeTabs.field_78032_a)
{
@ -96,7 +87,7 @@
{
this.func_147050_b(creativetabs);
return;
@@ -413,11 +435,13 @@
@@ -412,11 +434,13 @@
private boolean func_147055_p()
{
@ -110,7 +101,7 @@
int i = field_147058_w;
field_147058_w = p_147050_1_.func_78021_a();
GuiContainerCreative.ContainerCreative guicontainercreative$containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h;
@@ -483,12 +507,14 @@
@@ -487,12 +511,14 @@
if (this.field_147062_A != null)
{
@ -126,7 +117,7 @@
this.func_147053_i();
}
else
@@ -558,20 +584,43 @@
@@ -562,20 +588,43 @@
}
super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
@ -171,7 +162,7 @@
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.func_179140_f();
}
@@ -633,16 +682,35 @@
@@ -637,16 +686,35 @@
RenderHelper.func_74520_c();
CreativeTabs creativetabs = CreativeTabs.field_78032_a[field_147058_w];
@ -208,7 +199,7 @@
this.field_146297_k.func_110434_K().func_110577_a(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.func_78015_f()));
this.func_73729_b(this.field_147003_i, this.field_147009_r, 0, 0, this.field_146999_f, this.field_147000_g);
this.field_147062_A.func_146194_f();
@@ -657,6 +725,14 @@
@@ -661,6 +729,14 @@
this.func_73729_b(i, j + (int)((float)(k - j - 17) * this.field_147067_x), 232 + (this.func_147055_p() ? 0 : 12), 0, 12, 15);
}
@ -223,7 +214,7 @@
this.func_147051_a(creativetabs);
if (creativetabs == CreativeTabs.field_78036_m)
@@ -667,6 +743,14 @@
@@ -671,6 +747,14 @@
protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_)
{
@ -238,7 +229,7 @@
int i = p_147049_1_.func_78020_k();
int j = 28 * i;
int k = 0;
@@ -763,6 +847,8 @@
@@ -767,6 +851,8 @@
}
GlStateManager.func_179140_f();
@ -247,7 +238,7 @@
this.func_73729_b(l, i1, j, k, 28, j1);
this.field_73735_i = 100.0F;
this.field_146296_j.field_77023_b = 100.0F;
@@ -789,6 +875,15 @@
@@ -793,6 +879,15 @@
{
this.field_146297_k.func_147108_a(new GuiStats(this, this.field_146297_k.field_71439_g.func_146107_m()));
}

View file

@ -13,6 +13,6 @@
}
+ @SideOnly(Side.CLIENT)
public void func_178780_a(WorldRenderer p_178780_1_, float p_178780_2_)
public void func_178780_a(VertexBuffer p_178780_1_, float p_178780_2_)
{
for (int i = 0; i < this.field_78254_i.length; ++i)

View file

@ -1,14 +1,14 @@
--- ../src-base/minecraft/net/minecraft/client/model/ModelRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/model/ModelRenderer.java
@@ -10,7 +10,6 @@
@@ -9,7 +9,6 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
-@SideOnly(Side.CLIENT)
public class ModelRenderer
{
public float field_78801_a;
@@ -109,6 +108,7 @@
@@ -108,6 +107,7 @@
this.field_78798_e = p_78793_3_;
}
@ -16,7 +16,7 @@
public void func_78785_a(float p_78785_1_)
{
if (!this.field_78807_k)
@@ -190,6 +190,7 @@
@@ -189,6 +189,7 @@
}
}
@ -24,7 +24,7 @@
public void func_78791_b(float p_78791_1_)
{
if (!this.field_78807_k)
@@ -225,6 +226,7 @@
@@ -224,6 +225,7 @@
}
}
@ -32,7 +32,7 @@
public void func_78794_c(float p_78794_1_)
{
if (!this.field_78807_k)
@@ -266,6 +268,7 @@
@@ -265,6 +267,7 @@
}
}

View file

@ -3,11 +3,11 @@
@@ -1,10 +1,7 @@
package net.minecraft.client.model;
import net.minecraft.util.Vec3;
import net.minecraft.util.math.Vec3d;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-@SideOnly(Side.CLIENT)
public class PositionTextureVertex
{
public Vec3 field_78243_a;
public Vec3d field_78243_a;

View file

@ -1,13 +1,18 @@
--- ../src-base/minecraft/net/minecraft/client/model/TexturedQuad.java
+++ ../src-work/minecraft/net/minecraft/client/model/TexturedQuad.java
@@ -4,10 +4,7 @@
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.Vec3;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
@@ -7,7 +7,6 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-@SideOnly(Side.CLIENT)
public class TexturedQuad
{
public PositionTextureVertex[] field_78239_a;
@@ -43,6 +42,7 @@
this.field_78239_a = apositiontexturevertex;
}
+ @SideOnly(Side.CLIENT)
public void func_178765_a(VertexBuffer p_178765_1_, float p_178765_2_)
{
Vec3d vec3d = this.field_78239_a[1].field_78243_a.func_72444_a(this.field_78239_a[0].field_78243_a);

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java
@@ -55,6 +55,7 @@
@@ -52,6 +52,7 @@
Chunk chunk = new Chunk(this.field_73235_d, p_73158_1_, p_73158_2_);
this.field_73236_b.func_76163_a(ChunkCoordIntPair.func_77272_a(p_73158_1_, p_73158_2_), chunk);
this.field_73237_c.add(chunk);

View file

@ -4,8 +4,8 @@
inetaddress = InetAddress.getByName(p_146367_1_);
GuiConnecting.this.field_146371_g = NetworkManager.func_181124_a(inetaddress, p_146367_2_, GuiConnecting.this.field_146297_k.field_71474_y.func_181148_f());
GuiConnecting.this.field_146371_g.func_150719_a(new NetHandlerLoginClient(GuiConnecting.this.field_146371_g, GuiConnecting.this.field_146297_k, GuiConnecting.this.field_146374_i));
- GuiConnecting.this.field_146371_g.func_179290_a(new C00Handshake(47, p_146367_1_, p_146367_2_, EnumConnectionState.LOGIN));
+ GuiConnecting.this.field_146371_g.func_179290_a(new C00Handshake(47, p_146367_1_, p_146367_2_, EnumConnectionState.LOGIN, true));
GuiConnecting.this.field_146371_g.func_179290_a(new C00PacketLoginStart(GuiConnecting.this.field_146297_k.func_110432_I().func_148256_e()));
- GuiConnecting.this.field_146371_g.func_179290_a(new C00Handshake(107, p_146367_1_, p_146367_2_, EnumConnectionState.LOGIN));
+ GuiConnecting.this.field_146371_g.func_179290_a(new C00Handshake(107, p_146367_1_, p_146367_2_, EnumConnectionState.LOGIN, true));
GuiConnecting.this.field_146371_g.func_179290_a(new CPacketLoginStart(GuiConnecting.this.field_146297_k.func_110432_I().func_148256_e()));
}
catch (UnknownHostException unknownhostexception)

View file

@ -1,87 +1,93 @@
--- ../src-base/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java
@@ -111,6 +111,12 @@
@@ -121,6 +121,12 @@
}
}
+ ItemStack stack = field_78776_a.field_71439_g.func_71045_bC();
+ if (stack != null && stack.func_77973_b() != null && stack.func_77973_b().onBlockStartBreak(stack, p_178888_1_, field_78776_a.field_71439_g))
+ ItemStack stack = field_78776_a.field_71439_g.func_184614_ca();
+ if (stack != null && stack.func_77973_b() != null && stack.func_77973_b().onBlockStartBreak(stack, p_187103_1_, field_78776_a.field_71439_g))
+ {
+ return false;
+ }
+
if (this.field_78779_k.func_77145_d() && this.field_78776_a.field_71439_g.func_70694_bm() != null && this.field_78776_a.field_71439_g.func_70694_bm().func_77973_b() instanceof ItemSword)
if (this.field_78779_k.func_77145_d() && this.field_78776_a.field_71439_g.func_184614_ca() != null && this.field_78776_a.field_71439_g.func_184614_ca().func_77973_b() instanceof ItemSword)
{
return false;
@@ -128,13 +134,7 @@
@@ -142,14 +148,7 @@
else
{
world.func_175718_b(2001, p_178888_1_, Block.func_176210_f(iblockstate));
- boolean flag = world.func_175698_g(p_178888_1_);
world.func_175718_b(2001, p_187103_1_, Block.func_176210_f(iblockstate));
- block.func_176208_a(world, p_187103_1_, iblockstate, this.field_78776_a.field_71439_g);
- boolean flag = world.func_180501_a(p_187103_1_, Blocks.field_150350_a.func_176223_P(), 11);
- if (flag)
- {
- block1.func_176206_d(world, p_178888_1_, iblockstate);
- block.func_176206_d(world, p_187103_1_, iblockstate);
- }
-
this.field_178895_c = new BlockPos(this.field_178895_c.func_177958_n(), -1, this.field_178895_c.func_177952_p());
if (!this.field_78779_k.func_77145_d())
@@ -152,6 +152,12 @@
@@ -160,13 +159,20 @@
{
itemstack1.func_179548_a(world, iblockstate, p_187103_1_, this.field_78776_a.field_71439_g);
- if (itemstack1.field_77994_a == 0)
+ if (itemstack1.field_77994_a <= 0)
{
+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this.field_78776_a.field_71439_g, itemstack1, EnumHand.MAIN_HAND);
this.field_78776_a.field_71439_g.func_184611_a(EnumHand.MAIN_HAND, (ItemStack)null);
}
}
}
+ boolean flag = block1.removedByPlayer(world, p_178888_1_, field_78776_a.field_71439_g, false);
+ boolean flag = block.removedByPlayer(iblockstate, world, p_187103_1_, field_78776_a.field_71439_g, false);
+
+ if (flag)
+ {
+ block1.func_176206_d(world, p_178888_1_, iblockstate);
+ block.func_176206_d(world, p_187103_1_, iblockstate);
+ }
return flag;
}
}
@@ -356,11 +362,19 @@
@@ -373,11 +379,15 @@
{
if (this.field_78779_k != WorldSettings.GameType.SPECTATOR)
{
+ net.minecraft.item.Item item = p_187099_3_ == null ? null : p_187099_3_.func_77973_b();
+ EnumActionResult ret = item == null ? EnumActionResult.PASS : item.onItemUseFirst(p_187099_3_, p_187099_1_, p_187099_2_, p_187099_4_, p_187099_5_, f, f1, f2, p_187099_7_);
+ if (ret != EnumActionResult.PASS) return ret;
+
+ if (p_178890_3_ != null &&
+ p_178890_3_.func_77973_b() != null &&
+ p_178890_3_.func_77973_b().onItemUseFirst(p_178890_3_, p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2))
+ {
+ return true;
+ }
+
IBlockState iblockstate = p_178890_2_.func_180495_p(p_178890_4_);
IBlockState iblockstate = p_187099_2_.func_180495_p(p_187099_4_);
- if ((!p_178890_1_.func_70093_af() || p_178890_1_.func_70694_bm() == null) && iblockstate.func_177230_c().func_180639_a(p_178890_2_, p_178890_4_, iblockstate, p_178890_1_, p_178890_5_, f, f1, f2))
+ if ((!p_178890_1_.func_70093_af() || p_178890_1_.func_70694_bm() == null || p_178890_1_.func_70694_bm().func_77973_b().doesSneakBypassUse(p_178890_2_, p_178890_4_, p_178890_1_)))
- if ((!p_187099_1_.func_70093_af() || p_187099_1_.func_184614_ca() == null && p_187099_1_.func_184592_cb() == null) && iblockstate.func_177230_c().func_180639_a(p_187099_2_, p_187099_4_, iblockstate, p_187099_1_, p_187099_7_, p_187099_3_, p_187099_5_, f, f1, f2))
+ if ((!p_187099_1_.func_70093_af() || (p_187099_1_.func_184614_ca() == null || item.doesSneakBypassUse(p_187099_3_, p_187099_2_, p_187099_4_, p_187099_1_)) && p_187099_1_.func_184592_cb() == null))
{
- flag = true;
+ flag = iblockstate.func_177230_c().func_180639_a(p_178890_2_, p_178890_4_, iblockstate, p_178890_1_, p_178890_5_, f, f1, f2);
+ flag = iblockstate.func_177230_c().func_180639_a(p_187099_2_, p_187099_4_, iblockstate, p_187099_1_, p_187099_7_, p_187099_3_, p_187099_5_, f, f1, f2);
}
if (!flag && p_178890_3_ != null && p_178890_3_.func_77973_b() instanceof ItemBlock)
@@ -393,7 +407,9 @@
if (!flag && p_187099_3_ != null && p_187099_3_.func_77973_b() instanceof ItemBlock)
@@ -418,7 +428,9 @@
}
else
{
- return p_178890_3_.func_179546_a(p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2);
+ if (!p_178890_3_.func_179546_a(p_178890_1_, p_178890_2_, p_178890_4_, p_178890_5_, f, f1, f2)) return false;
+ if (p_178890_3_.field_77994_a <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_178890_1_, p_178890_3_);
+ return true;
- return p_187099_3_.func_179546_a(p_187099_1_, p_187099_2_, p_187099_4_, p_187099_7_, p_187099_5_, f, f1, f2);
+ EnumActionResult ret = p_187099_3_.func_179546_a(p_187099_1_, p_187099_2_, p_187099_4_, p_187099_7_, p_187099_5_, f, f1, f2);
+ if (p_187099_3_.field_77994_a <= 0) net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_187099_1_, p_187099_3_, p_187099_7_);
+ return ret;
}
}
else
@@ -420,9 +436,10 @@
@@ -453,9 +465,10 @@
{
p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = itemstack;
p_187101_1_.func_184611_a(p_187101_4_, itemstack);
- if (itemstack.field_77994_a == 0)
+ if (itemstack.field_77994_a <= 0)
{
p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = null;
+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_78769_1_, itemstack);
p_187101_1_.func_184611_a(p_187101_4_, (ItemStack)null);
+ net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(p_187101_1_, itemstack, p_187101_4_);
}
}
return true;

View file

@ -1,7 +1,7 @@
--- ../src-base/minecraft/net/minecraft/client/multiplayer/WorldClient.java
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/WorldClient.java
@@ -52,12 +52,13 @@
super(new SaveHandlerMP(), new WorldInfo(p_i45063_2_, "MpServer"), WorldProvider.func_76570_a(p_i45063_3_), p_i45063_5_, true);
@@ -63,12 +63,13 @@
this.field_184157_a = Sets.<ChunkCoordIntPair>newHashSet();
this.field_73035_a = p_i45063_1_;
this.func_72912_H().func_176144_a(p_i45063_4_);
- this.func_175652_B(new BlockPos(8, 64, 8));

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java
+++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java
@@ -104,7 +104,10 @@
@@ -106,7 +106,10 @@
{
this.field_175091_e = p_147390_1_.func_179730_a();
this.field_147393_d.func_150723_a(EnumConnectionState.PLAY);
@ -11,4 +11,4 @@
+ net.minecraftforge.fml.client.FMLClientHandler.instance().setPlayClient(nhpc);
}
public void func_147231_a(IChatComponent p_147231_1_)
public void func_147231_a(ITextComponent p_147231_1_)

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java
+++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java
@@ -246,7 +246,7 @@
@@ -267,7 +267,7 @@
{
PacketThreadUtil.func_180031_a(p_147282_1_, this, this.field_147299_f);
this.field_147299_f.field_71442_b = new PlayerControllerMP(this.field_147299_f, this);
@ -9,11 +9,11 @@
this.field_147299_f.field_71474_y.field_74318_M = p_147282_1_.func_149192_g();
this.field_147299_f.func_71403_a(this.field_147300_g);
this.field_147299_f.field_71439_g.field_71093_bK = p_147282_1_.func_149194_f();
@@ -750,14 +750,16 @@
public void func_147251_a(S02PacketChat p_147251_1_)
@@ -785,14 +785,16 @@
public void func_147251_a(SPacketChat p_147251_1_)
{
PacketThreadUtil.func_180031_a(p_147251_1_, this, this.field_147299_f);
+ net.minecraft.util.IChatComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(p_147251_1_.func_179841_c(), p_147251_1_.func_148915_c());
+ net.minecraft.util.text.ITextComponent message = net.minecraftforge.event.ForgeEventFactory.onClientChat(p_147251_1_.func_179841_c(), p_147251_1_.func_148915_c());
+ if (message == null) return;
if (p_147251_1_.func_179841_c() == 2)
@ -28,7 +28,7 @@
}
}
@@ -808,6 +810,11 @@
@@ -848,6 +850,11 @@
float f = (float)(p_147281_1_.func_149028_l() * 360) / 256.0F;
float f1 = (float)(p_147281_1_.func_149030_m() * 360) / 256.0F;
EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.func_75616_a(p_147281_1_.func_149025_e(), this.field_147299_f.field_71441_e);
@ -37,10 +37,10 @@
+ net.minecraftforge.fml.common.FMLLog.info("Server attempted to spawn an unknown entity using ID: {0} at ({1}, {2}, {3}) Skipping!", p_147281_1_.func_149025_e(), d0, d1, d2);
+ return;
+ }
entitylivingbase.field_70118_ct = p_147281_1_.func_149023_f();
entitylivingbase.field_70117_cu = p_147281_1_.func_149034_g();
entitylivingbase.field_70116_cv = p_147281_1_.func_149029_h();
@@ -1133,6 +1140,10 @@
EntityTracker.func_187254_a(entitylivingbase, d0, d1, d2);
entitylivingbase.field_70761_aq = entitylivingbase.field_70759_as = (float)(p_147281_1_.func_149032_n() * 360) / 256.0F;
Entity[] aentity = entitylivingbase.func_70021_al();
@@ -1179,6 +1186,10 @@
{
tileentity.func_145839_a(p_147273_1_.func_148857_g());
}
@ -48,15 +48,15 @@
+ {
+ tileentity.onDataPacket(field_147302_e, p_147273_1_);
+ }
}
}
@@ -1341,7 +1352,7 @@
if (flag && this.field_147299_f.field_71462_r instanceof GuiCommandBlock)
{
@@ -1378,7 +1389,7 @@
if (entity instanceof EntityLivingBase)
{
- PotionEffect potioneffect = new PotionEffect(p_147260_1_.func_149427_e(), p_147260_1_.func_180755_e(), p_147260_1_.func_149428_f(), false, p_147260_1_.func_179707_f());
+ PotionEffect potioneffect = new PotionEffect(p_147260_1_.func_149427_e() & 0xff, p_147260_1_.func_180755_e(), p_147260_1_.func_149428_f(), false, p_147260_1_.func_179707_f());
potioneffect.func_100012_b(p_147260_1_.func_149429_c());
((EntityLivingBase)entity).func_70690_d(potioneffect);
}
- Potion potion = Potion.func_188412_a(p_147260_1_.func_149427_e());
+ Potion potion = Potion.func_188412_a(p_147260_1_.func_149427_e() & 0xFF);
if (potion != null)
{

View file

@ -1,10 +1,10 @@
--- ../src-base/minecraft/net/minecraft/client/network/OldServerPinger.java
+++ ../src-work/minecraft/net/minecraft/client/network/OldServerPinger.java
--- ../src-base/minecraft/net/minecraft/client/network/ServerPinger.java
+++ ../src-work/minecraft/net/minecraft/client/network/ServerPinger.java
@@ -150,6 +150,7 @@
p_147224_1_.func_147407_a((String)null);
}
+ net.minecraftforge.fml.client.FMLClientHandler.instance().bindServerListData(p_147224_1_, serverstatusresponse);
this.field_175092_e = Minecraft.func_71386_F();
networkmanager.func_179290_a(new C01PacketPing(this.field_175092_e));
networkmanager.func_179290_a(new CPacketPing(this.field_175092_e));
this.field_147403_d = true;

View file

@ -1,31 +1,41 @@
--- ../src-base/minecraft/net/minecraft/client/particle/EffectRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/particle/EffectRenderer.java
@@ -133,6 +133,7 @@
@@ -3,6 +3,9 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Queues;
+
+import akka.actor.FSM.State;
+
import java.util.ArrayDeque;
import java.util.Iterator;
import java.util.List;
@@ -143,6 +146,7 @@
public void func_78873_a(EntityFX p_78873_1_)
{
+ if (p_78873_1_ == null) return; //Forge: Prevent modders from being bad and adding nulls causing untraceable NPEs.
int i = p_78873_1_.func_70537_b();
int j = p_78873_1_.func_174838_j() != 1.0F ? 0 : 1;
this.field_187241_h.add(p_78873_1_);
}
@@ -351,7 +352,7 @@
@@ -376,7 +380,7 @@
public void func_180533_a(BlockPos p_180533_1_, IBlockState p_180533_2_)
{
- if (p_180533_2_.func_177230_c().func_149688_o() != Material.field_151579_a)
+ if (!p_180533_2_.func_177230_c().isAir(field_78878_a, p_180533_1_) && !p_180533_2_.func_177230_c().addDestroyEffects(field_78878_a, p_180533_1_, this))
- if (p_180533_2_.func_185904_a() != Material.field_151579_a)
+ if (p_180533_2_.func_177230_c().isAir(p_180533_2_, field_78878_a, p_180533_1_) && !p_180533_2_.func_177230_c().addDestroyEffects(field_78878_a, p_180533_1_, this))
{
p_180533_2_ = p_180533_2_.func_177230_c().func_176221_a(p_180533_2_, this.field_78878_a, p_180533_1_);
p_180533_2_ = p_180533_2_.func_185899_b(this.field_78878_a, p_180533_1_);
int i = 4;
@@ -457,4 +458,13 @@
@@ -460,4 +464,13 @@
return "" + i;
}
+
+ public void addBlockHitEffects(BlockPos pos, net.minecraft.util.MovingObjectPosition target)
+ public void addBlockHitEffects(BlockPos pos, net.minecraft.util.math.RayTraceResult target)
+ {
+ Block block = field_78878_a.func_180495_p(pos).func_177230_c();
+ if (block != null && !block.addHitEffects(field_78878_a, target, this))
+ IBlockState state = field_78878_a.func_180495_p(pos);
+ if (state != null && !state.func_177230_c().addHitEffects(state, field_78878_a, target, this))
+ {
+ func_180532_a(pos, target.field_178784_b);
+ }

View file

@ -1,24 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java
@@ -533,8 +533,19 @@
@SideOnly(Side.CLIENT)
public static enum EnumNeighborInfo
{
- DOWN(new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.NORTH, EnumFacing.SOUTH}, 0.5F, false, new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0]),
- UP(new EnumFacing[]{EnumFacing.EAST, EnumFacing.WEST, EnumFacing.NORTH, EnumFacing.SOUTH}, 1.0F, false, new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0], new BlockModelRenderer.Orientation[0]),
+ // -- Forge Patch to Fix Top/Bottom Lighting Interpolation --
+ // Forge PR - https://github.com/MinecraftForge/MinecraftForge/pull/1892
+ // Mojang Bug - https://bugs.mojang.com/browse/MC-80148
+ DOWN( new EnumFacing[]{ EnumFacing.WEST, EnumFacing.EAST, EnumFacing.NORTH, EnumFacing.SOUTH }, 0.5F, true,
+ new Orientation[]{ Orientation.FLIP_WEST, Orientation.SOUTH, Orientation.FLIP_WEST, Orientation.FLIP_SOUTH, Orientation.WEST, Orientation.FLIP_SOUTH, Orientation.WEST, Orientation.SOUTH },
+ new Orientation[]{ Orientation.FLIP_WEST, Orientation.NORTH, Orientation.FLIP_WEST, Orientation.FLIP_NORTH, Orientation.WEST, Orientation.FLIP_NORTH, Orientation.WEST, Orientation.NORTH },
+ new Orientation[]{ Orientation.FLIP_EAST, Orientation.NORTH, Orientation.FLIP_EAST, Orientation.FLIP_NORTH, Orientation.EAST, Orientation.FLIP_NORTH, Orientation.EAST, Orientation.NORTH },
+ new Orientation[]{ Orientation.FLIP_EAST, Orientation.SOUTH, Orientation.FLIP_EAST, Orientation.FLIP_SOUTH, Orientation.EAST, Orientation.FLIP_SOUTH, Orientation.EAST, Orientation.SOUTH } ),
+ UP( new EnumFacing[]{ EnumFacing.EAST, EnumFacing.WEST, EnumFacing.NORTH, EnumFacing.SOUTH }, 1.0F, true,
+ new Orientation[]{ Orientation.EAST, Orientation.SOUTH, Orientation.EAST, Orientation.FLIP_SOUTH, Orientation.FLIP_EAST, Orientation.FLIP_SOUTH, Orientation.FLIP_EAST, Orientation.SOUTH },
+ new Orientation[]{ Orientation.EAST, Orientation.NORTH, Orientation.EAST, Orientation.FLIP_NORTH, Orientation.FLIP_EAST, Orientation.FLIP_NORTH, Orientation.FLIP_EAST, Orientation.NORTH },
+ new Orientation[]{ Orientation.WEST, Orientation.NORTH, Orientation.WEST, Orientation.FLIP_NORTH, Orientation.FLIP_WEST, Orientation.FLIP_NORTH, Orientation.FLIP_WEST, Orientation.NORTH },
+ new Orientation[]{ Orientation.WEST, Orientation.SOUTH, Orientation.WEST, Orientation.FLIP_SOUTH, Orientation.FLIP_WEST, Orientation.FLIP_SOUTH, Orientation.FLIP_WEST, Orientation.SOUTH } ),
NORTH(new EnumFacing[]{EnumFacing.UP, EnumFacing.DOWN, EnumFacing.EAST, EnumFacing.WEST}, 0.8F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_WEST}),
SOUTH(new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.DOWN, EnumFacing.UP}, 0.8F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_WEST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.WEST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.WEST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.EAST}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_EAST, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.EAST, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.EAST}),
WEST(new EnumFacing[]{EnumFacing.UP, EnumFacing.DOWN, EnumFacing.NORTH, EnumFacing.SOUTH}, 0.6F, true, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.SOUTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.SOUTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.NORTH, BlockModelRenderer.Orientation.UP, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_UP, BlockModelRenderer.Orientation.NORTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.NORTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_NORTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.NORTH}, new BlockModelRenderer.Orientation[]{BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.SOUTH, BlockModelRenderer.Orientation.DOWN, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.FLIP_SOUTH, BlockModelRenderer.Orientation.FLIP_DOWN, BlockModelRenderer.Orientation.SOUTH}),

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/BlockModelShapes.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockModelShapes.java
@@ -309,5 +309,6 @@
@@ -307,5 +307,6 @@
return new ModelResourceLocation(s + "_double_slab", s1);
}
});

View file

@ -1,49 +1,31 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/BlockRendererDispatcher.java
@@ -24,7 +24,7 @@
@@ -29,7 +29,7 @@
public BlockRendererDispatcher(BlockModelShapes p_i46577_1_, BlockColors p_i46577_2_)
{
private BlockModelShapes field_175028_a;
private final GameSettings field_175026_b;
- private final BlockModelRenderer field_175027_c = new BlockModelRenderer();
+ private final BlockModelRenderer field_175027_c = new net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer();
private final ChestRenderer field_175024_d = new ChestRenderer();
private final BlockFluidRenderer field_175025_e = new BlockFluidRenderer();
this.field_175028_a = p_i46577_1_;
- this.field_175027_c = new BlockModelRenderer(p_i46577_2_);
+ this.field_175027_c = new net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer(p_i46577_2_);
this.field_175025_e = new BlockFluidRenderer(p_i46577_2_);
}
@@ -48,6 +48,24 @@
@@ -44,7 +44,7 @@
{
p_175020_1_ = block.func_176221_a(p_175020_1_, p_175020_4_, p_175020_2_);
p_175020_1_ = p_175020_1_.func_185899_b(p_175020_4_, p_175020_2_);
IBakedModel ibakedmodel = this.field_175028_a.func_178125_b(p_175020_1_);
+
+ if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartBlockModel)
+ {
+ IBlockState extendedState = block.getExtendedState(p_175020_1_, p_175020_4_, p_175020_2_);
+ for ( net.minecraft.util.EnumWorldBlockLayer layer : net.minecraft.util.EnumWorldBlockLayer.values() )
+ {
+ if ( block.canRenderInLayer( layer ) )
+ {
+ net.minecraftforge.client.ForgeHooksClient.setRenderLayer(layer);
+
+ IBakedModel targetLayer = ((net.minecraftforge.client.model.ISmartBlockModel)ibakedmodel).handleBlockState(extendedState);
+ IBakedModel damageModel = (new SimpleBakedModel.Builder(targetLayer, p_175020_3_)).func_177645_b();
+ this.field_175027_c.func_178259_a(p_175020_4_, damageModel, p_175020_1_, p_175020_2_, Tessellator.func_178181_a().func_178180_c());
+ }
+ }
+ return;
+ }
+
IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(ibakedmodel, p_175020_3_)).func_177645_b();
this.field_175027_c.func_178259_a(p_175020_4_, ibakedmodel1, p_175020_1_, p_175020_2_, Tessellator.func_178181_a().func_178180_c());
- IBakedModel ibakedmodel1 = (new SimpleBakedModel.Builder(p_175020_1_, ibakedmodel, p_175020_3_, p_175020_2_)).func_177645_b();
+ IBakedModel ibakedmodel1 = net.minecraftforge.client.ForgeHooksClient.getDamageModel(ibakedmodel, p_175020_3_, p_175020_1_, p_175020_4_, p_175020_2_);
this.field_175027_c.func_178267_a(p_175020_4_, ibakedmodel1, p_175020_1_, p_175020_2_, Tessellator.func_178181_a().func_178180_c(), true);
}
@@ -128,6 +146,12 @@
ibakedmodel = ((WeightedBakedModel)ibakedmodel).func_177564_a(MathHelper.func_180186_a(p_175022_3_));
}
+ if(ibakedmodel instanceof net.minecraftforge.client.model.ISmartBlockModel)
+ {
+ IBlockState extendedState = block.getExtendedState(p_175022_1_, p_175022_2_, p_175022_3_);
+ ibakedmodel = ((net.minecraftforge.client.model.ISmartBlockModel)ibakedmodel).handleBlockState(extendedState);
+ }
+
return ibakedmodel;
}
@@ -76,7 +76,9 @@
switch (enumblockrendertype)
{
case MODEL:
- return this.field_175027_c.func_178267_a(p_175018_3_, this.func_184389_a(p_175018_1_), p_175018_1_, p_175018_2_, p_175018_4_, true);
+ IBakedModel model = this.func_184389_a(p_175018_1_);
+ p_175018_1_ = p_175018_1_.func_177230_c().getExtendedState(p_175018_1_, p_175018_3_, p_175018_2_);
+ return this.field_175027_c.func_178267_a(p_175018_3_, model, p_175018_1_, p_175018_2_, p_175018_4_, true);
case ENTITYBLOCK_ANIMATED:
return false;
case LIQUID:

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/EntityRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/EntityRenderer.java
@@ -200,6 +200,7 @@
@@ -207,6 +207,7 @@
{
this.func_175069_a(new ResourceLocation("shaders/post/invert.json"));
}
@ -8,25 +8,25 @@
}
}
@@ -419,7 +420,7 @@
@@ -398,7 +399,7 @@
if (d3 < d2 || d2 == 0.0D)
{
- if (entity1 == entity.field_70154_o)
+ if (entity1 == entity.field_70154_o && !entity.canRiderInteract())
- if (entity1.func_184208_bv() == entity.func_184208_bv())
+ if (entity1.func_184208_bv() == entity.func_184208_bv() && !entity.canRiderInteract())
{
if (d2 == 0.0D)
{
@@ -512,7 +513,7 @@
@@ -491,7 +492,7 @@
f = f * 60.0F / 70.0F;
}
- return f;
+ return net.minecraftforge.client.ForgeHooksClient.getFOVModifier(this, entity, block, p_78481_1_, f);
+ return net.minecraftforge.client.ForgeHooksClient.getFOVModifier(this, entity, iblockstate, p_78481_1_, f);
}
}
@@ -576,14 +577,8 @@
@@ -555,14 +556,8 @@
{
BlockPos blockpos = new BlockPos(entity);
IBlockState iblockstate = this.field_78531_r.field_71441_e.func_180495_p(blockpos);
@ -35,14 +35,14 @@
- if (block == Blocks.field_150324_C)
- {
- int j = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_176387_N)).func_176736_b();
- int j = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_185512_D)).func_176736_b();
- GlStateManager.func_179114_b((float)(j * 90), 0.0F, 1.0F, 0.0F);
- }
-
GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F);
GlStateManager.func_179114_b(entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_, -1.0F, 0.0F, 0.0F);
}
@@ -650,17 +645,20 @@
@@ -629,17 +624,20 @@
if (!this.field_78531_r.field_71474_y.field_74325_U)
{
@ -61,8 +61,8 @@
- {
- GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F);
- }
+ Block block = ActiveRenderInfo.func_180786_a(this.field_78531_r.field_71441_e, entity, p_78467_1_);
+ net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup event = new net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup(this, entity, block, p_78467_1_, yaw, pitch, roll);
+ IBlockState state = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78467_1_);
+ net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup event = new net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup(this, entity, state, p_78467_1_, yaw, pitch, roll);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
+ GlStateManager.func_179114_b(event.roll, 0.0F, 0.0F, 1.0F);
+ GlStateManager.func_179114_b(event.pitch, 1.0F, 0.0F, 0.0F);
@ -70,7 +70,15 @@
}
GlStateManager.func_179109_b(0.0F, -f, 0.0F);
@@ -1103,7 +1101,7 @@
@@ -757,6 +755,7 @@
boolean flag = this.field_78531_r.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_78531_r.func_175606_aa()).func_70608_bn();
+ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(field_78531_r.field_71438_f, p_78476_1_, p_78476_2_))
if (this.field_78531_r.field_71474_y.field_74320_O == 0 && !flag && !this.field_78531_r.field_71474_y.field_74319_N && !this.field_78531_r.field_71442_b.func_78747_a())
{
this.func_180436_i();
@@ -1092,7 +1091,7 @@
try
{
@ -79,7 +87,7 @@
}
catch (Throwable throwable)
{
@@ -1164,7 +1162,7 @@
@@ -1187,7 +1186,7 @@
if (this.field_78531_r.field_71442_b.func_178889_l() == WorldSettings.GameType.SPECTATOR)
{
@ -88,7 +96,7 @@
}
else
{
@@ -1314,7 +1312,9 @@
@@ -1312,7 +1311,9 @@
GlStateManager.func_179094_E();
RenderHelper.func_74519_b();
this.field_78531_r.field_71424_I.func_76318_c("entities");
@ -97,40 +105,34 @@
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
RenderHelper.func_74518_a();
this.func_175072_h();
GlStateManager.func_179128_n(5888);
@@ -1326,6 +1326,7 @@
}
@@ -1325,6 +1326,7 @@
EntityPlayer entityplayer = (EntityPlayer)entity;
GlStateManager.func_179118_c();
this.field_78531_r.field_71424_I.func_76318_c("outline");
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.func_70694_bm(), p_175068_2_))
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, p_175068_2_))
renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_);
GlStateManager.func_179141_d();
}
@@ -1339,6 +1340,7 @@
EntityPlayer entityplayer1 = (EntityPlayer)entity;
GlStateManager.func_179118_c();
this.field_78531_r.field_71424_I.func_76318_c("outline");
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer1, field_78531_r.field_71476_x, 0, entityplayer1.func_70694_bm(), p_175068_2_))
renderglobal.func_72731_b(entityplayer1, this.field_78531_r.field_71476_x, 0, p_175068_2_);
GlStateManager.func_179141_d();
}
@@ -1380,6 +1382,15 @@
@@ -1366,6 +1368,17 @@
GlStateManager.func_179103_j(7425);
this.field_78531_r.field_71424_I.func_76318_c("translucent");
renderglobal.func_174977_a(EnumWorldBlockLayer.TRANSLUCENT, (double)p_175068_2_, p_175068_1_, entity);
renderglobal.func_174977_a(BlockRenderLayer.TRANSLUCENT, (double)p_175068_2_, p_175068_1_, entity);
+ if (!this.field_175078_W) //Only render if render pass 0 happens as well.
+ {
+ RenderHelper.func_74519_b();
+ this.field_78531_r.field_71424_I.func_76318_c("entities");
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(1);
+ renderglobal.func_180446_a(entity, icamera, p_175068_2_);
+ // restore blending function changed by RenderGlobal.preRenderDamagedBlocks
+ GlStateManager.func_187428_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(-1);
+ RenderHelper.func_74518_a();
+ }
GlStateManager.func_179103_j(7424);
GlStateManager.func_179132_a(true);
GlStateManager.func_179089_o();
@@ -1392,8 +1403,12 @@
@@ -1378,6 +1391,9 @@
this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_);
}
@ -139,11 +141,8 @@
+
this.field_78531_r.field_71424_I.func_76318_c("hand");
+ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(renderglobal, p_175068_2_, p_175068_1_))
if (this.field_175074_C)
{
GlStateManager.func_179086_m(256);
@@ -1505,6 +1520,13 @@
@@ -1490,6 +1506,13 @@
protected void func_78474_d(float p_78474_1_)
{
@ -157,11 +156,11 @@
float f = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_);
if (f > 0.0F)
@@ -1830,6 +1852,13 @@
@@ -1820,6 +1843,13 @@
this.field_175081_S = f7;
}
+ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, block, p_78466_1_, this.field_175080_Q, this.field_175082_R, this.field_175081_S);
+ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, iblockstate, p_78466_1_, this.field_175080_Q, this.field_175082_R, this.field_175081_S);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
+
+ this.field_175080_Q = event.red;
@ -171,22 +170,22 @@
GlStateManager.func_179082_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 0.0F);
}
@@ -1848,6 +1877,10 @@
@@ -1830,7 +1860,9 @@
GlStateManager.func_187432_a(0.0F, -1.0F, 0.0F);
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
Block block = ActiveRenderInfo.func_180786_a(this.field_78531_r.field_71441_e, entity, p_78468_2_);
+ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, block, p_78468_2_, 0.1F);
+ if (hook >= 0)
+ GlStateManager.func_179095_a(hook);
IBlockState iblockstate = ActiveRenderInfo.func_186703_a(this.field_78531_r.field_71441_e, entity, p_78468_2_);
-
+ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, iblockstate, p_78468_2_, 0.1F);
+ if (hook >= 0) GlStateManager.func_179095_a(hook);
+ else
if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(Potion.field_76440_q))
if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(MobEffects.field_76440_q))
{
float f1 = 5.0F;
@@ -1925,6 +1958,7 @@
@@ -1915,6 +1947,7 @@
GlStateManager.func_179102_b(f * 0.05F);
GlStateManager.func_179153_c(Math.min(f, 192.0F) * 0.5F);
}
+ net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, block, p_78468_2_, p_78468_1_, f);
+ net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, iblockstate, p_78468_2_, p_78468_1_, f);
}
GlStateManager.func_179142_g();

Some files were not shown because too many files have changed in this diff Show more