Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.

Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
This commit is contained in:
Lex Manos 2014-11-25 19:56:35 -08:00
parent 0e91787efb
commit 53659fca06
410 changed files with 8717 additions and 14103 deletions

4
.gitignore vendored
View File

@ -21,3 +21,7 @@
/patches-/
# FML changelog
changelog.txt
/patches_old/
/patches_old_bak/
*.py
*.7z

View File

@ -34,11 +34,12 @@ repositories {
}
minecraft {
version = '1.7.10'
mcpVersion = '9.05'
version = '1.8'
mcpVersion = '9.10'
mappings = 'snapshot_nodoc_20140930'
fmlDir = projectDir.getAbsolutePath() + "/fml";
mainClass = 'cpw.mods.fml.relauncher.ServerLaunchWrapper'
tweakClass = 'cpw.mods.fml.common.launcher.FMLTweaker'
mainClass = 'net.minecraftforge.fml.relauncher.ServerLaunchWrapper'
tweakClass = 'net.minecraftforge.fml.common.launcher.FMLTweaker'
installerVersion = "1.4"
}

Binary file not shown.

2
fml

@ -1 +1 @@
Subproject commit d00feb58c762b0bbc506d79faf1ce40bc96732e9
Subproject commit df6ec21f2dbb29285bb44096331c8c5d0f6fd48c

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
--- ../src-base/minecraft/net/minecraft/block/BlockAir.java
+++ ../src-work/minecraft/net/minecraft/block/BlockAir.java
@@ -36,4 +36,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_) {}
+
+ public boolean func_176200_f(World worldIn, BlockPos pos){ return true; }
}

View File

@ -1,73 +1,54 @@
--- ../src-base/minecraft/net/minecraft/block/BlockBush.java
+++ ../src-work/minecraft/net/minecraft/block/BlockBush.java
@@ -6,8 +6,13 @@
import net.minecraft.init.Blocks;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
+import net.minecraft.world.IBlockAccess;
+import net.minecraftforge.common.EnumPlantType;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.common.IPlantable;
+import static net.minecraftforge.common.EnumPlantType.*;
@@ -12,7 +12,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockBush extends Block
+public class BlockBush extends Block implements IPlantable
+public class BlockBush extends Block implements net.minecraftforge.common.IPlantable
{
private static final String __OBFID = "CL_00000208";
@@ -27,7 +32,7 @@
@@ -32,7 +32,7 @@
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.func_149854_a(p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_));
+ return super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.func_149718_j(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_);
- 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);
}
protected boolean func_149854_a(Block p_149854_1_)
@@ -57,7 +62,7 @@
public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
@@ -85,4 +85,33 @@
{
- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_));
+ return p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_).canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this);
}
public AxisAlignedBB func_149668_a(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
@@ -79,4 +84,37 @@
{
return 1;
return EnumWorldBlockLayer.CUTOUT;
}
+
+ @Override
+ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
+ if (this == Blocks.field_150464_aj) return Crop;
+ if (this == Blocks.field_150459_bM) return Crop;
+ if (this == Blocks.field_150469_bN) return Crop;
+ if (this == Blocks.field_150394_bc) return Crop;
+ if (this == Blocks.field_150393_bb) return Crop;
+ if (this == Blocks.field_150330_I) return Desert;
+ if (this == Blocks.field_150392_bi) return Water;
+ if (this == Blocks.field_150337_Q) return Cave;
+ if (this == Blocks.field_150338_P) return Cave;
+ if (this == Blocks.field_150388_bm) return Nether;
+ if (this == Blocks.field_150345_g) return Plains;
+ if (this == Blocks.field_150329_H) return Plains;
+ if (this == Blocks.field_150398_cm) return Plains;
+ if (this == Blocks.field_150328_O) return Plains;
+ if (this == Blocks.field_150327_N) return Plains;
+ return Plains;
+ if (this == Blocks.field_150464_aj) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150459_bM) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150469_bN) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150394_bc) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150393_bb) return net.minecraftforge.common.EnumPlantType.Crop;
+ if (this == Blocks.field_150330_I) return net.minecraftforge.common.EnumPlantType.Desert;
+ if (this == Blocks.field_150392_bi) return net.minecraftforge.common.EnumPlantType.Water;
+ if (this == Blocks.field_150337_Q) return net.minecraftforge.common.EnumPlantType.Cave;
+ if (this == Blocks.field_150338_P) return net.minecraftforge.common.EnumPlantType.Cave;
+ if (this == Blocks.field_150388_bm) return net.minecraftforge.common.EnumPlantType.Nether;
+ if (this == Blocks.field_150345_g) return net.minecraftforge.common.EnumPlantType.Plains;
+ if (this == Blocks.field_150329_H) return net.minecraftforge.common.EnumPlantType.Plains;
+ if (this == Blocks.field_150398_cm) return net.minecraftforge.common.EnumPlantType.Plains;
+ if (this == Blocks.field_150328_O) return net.minecraftforge.common.EnumPlantType.Plains;
+ if (this == Blocks.field_150327_N) return net.minecraftforge.common.EnumPlantType.Plains;
+ return net.minecraftforge.common.EnumPlantType.Plains;
+ }
+
+ @Override
+ public Block getPlant(IBlockAccess world, int x, int y, int z)
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
+ return this;
+ }
+
+ @Override
+ public int getPlantMetadata(IBlockAccess world, int x, int y, int z)
+ {
+ return world.func_72805_g(x, y, z);
+ IBlockState state = world.func_180495_p(pos);
+ if (state.func_177230_c() != this) return func_176223_P();
+ return state;
+ }
}

View File

@ -1,100 +1,55 @@
--- ../src-base/minecraft/net/minecraft/block/BlockButton.java
+++ ../src-work/minecraft/net/minecraft/block/BlockButton.java
@@ -14,6 +14,9 @@
@@ -18,6 +18,7 @@
import net.minecraft.util.EnumFacing;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import static net.minecraft.util.EnumFacing.*;
+import net.minecraftforge.common.util.ForgeDirection;
+import static net.minecraftforge.common.util.ForgeDirection.*;
+
public abstract class BlockButton extends Block
{
private final boolean field_150047_a;
@@ -49,12 +52,19 @@
@@ -57,7 +58,7 @@
public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_)
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
{
- return p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r()));
+ ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_);
+ return (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) ||
+ (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) ||
+ (dir == WEST && p_149707_1_.isSideSolid(p_149707_2_ + 1, p_149707_3_, p_149707_4_, WEST)) ||
+ (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST));
- return 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_1_.isSideSolid(p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()), p_176198_3_, true);
}
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
@@ -69,7 +70,7 @@
{
EnumFacing enumfacing = aenumfacing[j];
- 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))
{
return true;
}
@@ -80,7 +81,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_)
{
- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r()));
+ return (p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST)) ||
+ (p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST)) ||
+ (p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH)) ||
+ (p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH));
- return p_180642_1_.func_180495_p(p_180642_2_.func_177972_a(p_180642_3_.func_176734_d())).func_177230_c().func_149721_r() ? this.func_176223_P().func_177226_a(field_176585_a, p_180642_3_).func_177226_a(field_176584_b, Boolean.valueOf(false)) : this.func_176223_P().func_177226_a(field_176585_a, EnumFacing.DOWN).func_177226_a(field_176584_b, Boolean.valueOf(false));
+ return p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(p_180642_3_.func_176734_d()), p_180642_3_, true) ? this.func_176223_P().func_177226_a(field_176585_a, p_180642_3_).func_177226_a(field_176584_b, Boolean.valueOf(false)) : this.func_176223_P().func_177226_a(field_176585_a, EnumFacing.DOWN).func_177226_a(field_176584_b, Boolean.valueOf(false));
}
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
@@ -63,19 +73,21 @@
int k1 = j1 & 8;
j1 &= 7;
public void func_176204_a(World p_176204_1_, BlockPos p_176204_2_, IBlockState p_176204_3_, Block p_176204_4_)
@@ -89,7 +90,7 @@
{
EnumFacing enumfacing = (EnumFacing)p_176204_3_.func_177229_b(field_176585_a);
- if (p_149660_5_ == 2 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r())
+ ForgeDirection dir = ForgeDirection.getOrientation(p_149660_5_);
- 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))
{
this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0);
p_176204_1_.func_175698_g(p_176204_2_);
@@ -338,6 +339,8 @@
return new BlockState(this, new IProperty[] {field_176585_a, field_176584_b});
}
+ @Override public net.minecraft.item.Item func_180660_a(IBlockState state, Random rnd, int fortune){ return null; }
+
+ if (dir == NORTH && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH))
static final class SwitchEnumFacing
{
j1 = 4;
}
- else if (p_149660_5_ == 3 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r())
+ else if (dir == SOUTH && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH))
{
j1 = 3;
}
- else if (p_149660_5_ == 4 && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r())
+ else if (dir == WEST && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST))
{
j1 = 2;
}
- else if (p_149660_5_ == 5 && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r())
+ else if (dir == EAST && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST))
{
j1 = 1;
}
@@ -89,7 +101,11 @@
private int func_150045_e(World p_150045_1_, int p_150045_2_, int p_150045_3_, int p_150045_4_)
{
- return p_150045_1_.func_147439_a(p_150045_2_ - 1, p_150045_3_, p_150045_4_).func_149721_r() ? 1 : (p_150045_1_.func_147439_a(p_150045_2_ + 1, p_150045_3_, p_150045_4_).func_149721_r() ? 2 : (p_150045_1_.func_147439_a(p_150045_2_, p_150045_3_, p_150045_4_ - 1).func_149721_r() ? 3 : (p_150045_1_.func_147439_a(p_150045_2_, p_150045_3_, p_150045_4_ + 1).func_149721_r() ? 4 : 1)));
+ if (p_150045_1_.isSideSolid(p_150045_2_ - 1, p_150045_3_, p_150045_4_, EAST)) return 1;
+ if (p_150045_1_.isSideSolid(p_150045_2_ + 1, p_150045_3_, p_150045_4_, WEST)) return 2;
+ if (p_150045_1_.isSideSolid(p_150045_2_, p_150045_3_, p_150045_4_ - 1, SOUTH)) return 3;
+ if (p_150045_1_.isSideSolid(p_150045_2_, p_150045_3_, p_150045_4_ + 1, NORTH)) return 4;
+ return 1;
}
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
@@ -99,22 +115,22 @@
int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_) & 7;
boolean flag = false;
- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 1)
+ if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && l == 1)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 2)
+ if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && l == 2)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && l == 3)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && l == 3)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && l == 4)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && l == 4)
{
flag = true;
}
static final int[] field_180420_a = new int[EnumFacing.values().length];

View File

@ -1,49 +1,37 @@
--- ../src-base/minecraft/net/minecraft/block/BlockCactus.java
+++ ../src-work/minecraft/net/minecraft/block/BlockCactus.java
@@ -11,9 +11,13 @@
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.common.EnumPlantType;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.common.IPlantable;
@@ -19,7 +19,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockCactus extends Block
+public class BlockCactus extends Block implements IPlantable
+public class BlockCactus extends Block implements net.minecraftforge.common.IPlantable
{
@SideOnly(Side.CLIENT)
private IIcon field_150041_a;
@@ -125,7 +129,7 @@
else
{
Block block = p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_);
- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m;
+ return block.canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this);
public static final PropertyInteger field_176587_a = PropertyInteger.func_177719_a("age", 0, 15);
private static final String __OBFID = "CL_00000210";
@@ -115,7 +115,7 @@
}
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);
}
@@ -141,4 +145,22 @@
this.field_150041_a = p_149651_1_.func_94245_a(this.func_149641_N() + "_top");
this.field_150040_b = p_149651_1_.func_94245_a(this.func_149641_N() + "_bottom");
public void func_180634_a(World p_180634_1_, BlockPos p_180634_2_, IBlockState p_180634_3_, Entity p_180634_4_)
@@ -143,4 +143,16 @@
{
return new BlockState(this, new IProperty[] {field_176587_a});
}
+
+ @Override
+ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
+ public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
+ return EnumPlantType.Desert;
+ return net.minecraftforge.common.EnumPlantType.Desert;
+ }
+
+ @Override
+ public Block getPlant(IBlockAccess world, int x, int y, int z)
+ public IBlockState getPlant(net.minecraft.world.IBlockAccess world, BlockPos pos)
+ {
+ return this;
+ }
+
+ @Override
+ public int getPlantMetadata(IBlockAccess world, int x, int y, int z)
+ {
+ return -1;
+ return func_176223_P();
+ }
}

View File

@ -1,44 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockChest.java
+++ ../src-work/minecraft/net/minecraft/block/BlockChest.java
@@ -24,6 +24,8 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -531,7 +531,7 @@
+import static net.minecraftforge.common.util.ForgeDirection.*;
+
public class BlockChest extends BlockContainer
{
private final Random field_149955_b = new Random();
@@ -408,7 +410,7 @@
{
return null;
}
- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_).func_149721_r())
+ else if (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_, DOWN))
{
return null;
}
@@ -416,19 +418,19 @@
{
return null;
}
- else if (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_)))
+ else if (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_)))
{
return null;
}
- else if (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_)))
+ else if (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_)))
{
return null;
}
- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1)))
+ else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1)))
{
return null;
}
- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1)))
+ else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1)))
{
return null;
}
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);
}
private boolean func_176453_o(World p_176453_1_, BlockPos p_176453_2_)

View File

@ -1,46 +1,29 @@
--- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java
+++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java
@@ -2,6 +2,7 @@
@@ -137,7 +137,14 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -160,6 +161,13 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_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_)
{
+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
- int j = ((Integer)p_180653_3_.func_177229_b(field_176501_a)).intValue();
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
+ }
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int p_149690_5_, int fortune)
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ ArrayList<ItemStack> dropped = super.getDrops(world, x, y, z, p_149690_5_, fortune);
int j1 = func_149987_c(p_149690_5_);
+ java.util.List<ItemStack> dropped = super.getDrops(world, pos, state, fortune);
+ int j = ((Integer)state.func_177229_b(field_176501_a)).intValue();
byte b0 = 1;
@@ -170,8 +178,9 @@
if (j >= 2)
@@ -147,8 +154,9 @@
for (int k1 = 0; k1 < b0; ++k1)
for (int k = 0; k < b0; ++k)
{
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.field_151100_aR, 1, 3));
+ dropped.add(new ItemStack(Items.field_151100_aR, 1, 3));
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b()));
+ dropped.add(new ItemStack(Items.field_151100_aR, 1, EnumDyeColor.BROWN.func_176767_b()));
}
+ return dropped;
}
@SideOnly(Side.CLIENT)
@@ -216,4 +225,10 @@
++j1;
p_149853_1_.func_72921_c(p_149853_3_, p_149853_4_, p_149853_5_, j1 << 2 | i1, 2);
}
+
+ @Override
+ public Item func_149650_a(int par1, Random par2Random, int par3)
+ {
+ return null;
+ }
}

View File

@ -1,79 +1,68 @@
--- ../src-base/minecraft/net/minecraft/block/BlockCrops.java
+++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java
@@ -2,6 +2,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -12,6 +13,7 @@
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
public class BlockCrops extends BlockBush implements IGrowable
{
@@ -89,11 +91,11 @@
{
@@ -82,11 +82,11 @@
float f1 = 0.0F;
IBlockState iblockstate = p_180672_1_.func_180495_p(blockpos1.func_177982_a(i, 0, j));
- if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1) == Blocks.field_150458_ak)
+ if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1).canSustainPlant(p_149864_1_, l, p_149864_3_ - 1, i1, ForgeDirection.UP, this))
- if (iblockstate.func_177230_c() == Blocks.field_150458_ak)
+ if (iblockstate.func_177230_c().canSustainPlant(p_180672_1_, blockpos1.func_177982_a(i, 0, j), net.minecraft.util.EnumFacing.UP, (net.minecraftforge.common.IPlantable)p_180672_0_))
{
f1 = 1.0F;
- if (p_149864_1_.func_72805_g(l, p_149864_3_ - 1, i1) > 0)
+ if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1).isFertile(p_149864_1_, l, p_149864_3_ - 1, i1))
- if (((Integer)iblockstate.func_177229_b(BlockFarmland.field_176531_a)).intValue() > 0)
+ if (iblockstate.func_177230_c().isFertile(p_180672_1_, blockpos1.func_177982_a(i, 0, j)))
{
f1 = 3.0F;
}
@@ -145,22 +147,6 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
@@ -143,24 +143,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_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, 0);
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, 0);
-
- if (!p_149690_1_.field_72995_K)
- if (!p_180653_1_.field_72995_K)
- {
- if (p_149690_5_ >= 7)
- {
- int j1 = 3 + p_149690_7_;
- int j = ((Integer)p_180653_3_.func_177229_b(field_176488_a)).intValue();
-
- for (int k1 = 0; k1 < j1; ++k1)
- if (j >= 7)
- {
- int k = 3 + p_180653_5_;
-
- for (int l = 0; l < k; ++l)
- {
- if (p_149690_1_.field_73012_v.nextInt(15) <= p_149690_5_)
- if (p_180653_1_.field_73012_v.nextInt(15) <= j)
- {
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(this.func_149866_i(), 1, 0));
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(this.func_149866_i(), 1, 0));
- }
- }
- }
- }
}
public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
@@ -204,4 +190,23 @@
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
@@ -203,4 +185,26 @@
{
this.func_149863_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_);
return new BlockState(this, new IProperty[] {field_176488_a});
}
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
+ public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
+ java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
+ int age = ((Integer)state.func_177229_b(field_176488_a)).intValue();
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
+
+ if (metadata >= 7)
+ if (age >= 7)
+ {
+ int k = 3 + fortune;
+
+ for (int i = 0; i < 3 + fortune; ++i)
+ {
+ if (world.field_73012_v.nextInt(15) <= metadata)
+ if (rand.nextInt(15) <= age)
+ {
+ ret.add(new ItemStack(this.func_149866_i(), 1, 0));
+ }
+ }
+ }
+
+ return ret;
+ }
}

View File

@ -1,45 +1,33 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDeadBush.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDeadBush.java
@@ -1,5 +1,7 @@
package net.minecraft.block;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
@@ -8,9 +10,11 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.StatList;
+import net.minecraft.world.IBlockAccess;
@@ -13,7 +13,7 @@
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
+import net.minecraftforge.common.IShearable;
-public class BlockDeadBush extends BlockBush
+public class BlockDeadBush extends BlockBush implements IShearable
+public class BlockDeadBush extends BlockBush implements net.minecraftforge.common.IShearable
{
private static final String __OBFID = "CL_00000224";
@@ -33,14 +37,15 @@
@@ -41,14 +41,15 @@
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_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_)
{
- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
- 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_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150330_I, 1, p_149636_6_));
- 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_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
}
}
+
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { return true; }
+ @Override public boolean isShearable(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+ @Override
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return new ArrayList<ItemStack>(Arrays.asList(new ItemStack(Blocks.field_150330_I, 1, world.func_72805_g(x, y, z))));
+ return new java.util.ArrayList<ItemStack>(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
@@ -249,7 +249,7 @@
@@ -149,7 +149,7 @@
{
if (this.field_149764_J == Material.field_151573_f)
{
@ -9,12 +9,12 @@
}
else
{
@@ -367,7 +367,7 @@
@@ -267,7 +267,7 @@
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return p_149742_3_ >= 255 ? false : World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_ + 1, p_149742_4_);
+ return p_149742_3_ >= p_149742_1_.func_72800_K() - 1 ? false : World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_ + 1, p_149742_4_);
- 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());
}
public int func_149656_h()

View File

@ -1,52 +1,71 @@
--- ../src-base/minecraft/net/minecraft/block/BlockDoublePlant.java
+++ ../src-work/minecraft/net/minecraft/block/BlockDoublePlant.java
@@ -2,6 +2,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import net.minecraft.block.material.Material;
@@ -18,8 +19,9 @@
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.common.IShearable;
@@ -24,7 +24,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockDoublePlant extends BlockBush implements IGrowable
+public class BlockDoublePlant extends BlockBush implements IGrowable, IShearable
+public class BlockDoublePlant extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable
{
public static final String[] field_149892_a = new String[] {"sunflower", "syringa", "grass", "fern", "rose", "paeonia"};
@SideOnly(Side.CLIENT)
@@ -81,6 +83,7 @@
public static final PropertyEnum field_176493_a = PropertyEnum.func_177709_a("variant", BlockDoublePlant.EnumPlantType.class);
public static final PropertyEnum field_176492_b = PropertyEnum.func_177709_a("half", BlockDoublePlant.EnumBlockHalf.class);
@@ -89,6 +89,8 @@
Object object = flag ? this : p_176475_1_.func_180495_p(blockpos1).func_177230_c();
Object object1 = flag ? p_176475_1_.func_180495_p(blockpos2).func_177230_c() : this;
public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
+ if (!flag) this.func_176226_b(p_176475_1_, p_176475_2_, p_176475_3_, 0); //Forge move above the setting to air.
+
if (object == this)
{
p_176475_1_.func_180501_a(blockpos1, Blocks.field_150350_a.func_176223_P(), 3);
@@ -97,17 +99,13 @@
if (object1 == this)
{
p_176475_1_.func_180501_a(blockpos2, Blocks.field_150350_a.func_176223_P(), 3);
-
- if (!flag)
- {
- this.func_176226_b(p_176475_1_, blockpos2, p_176475_3_, 0);
- }
}
}
}
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
{
+ if (p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_, p_149718_4_) != this) return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); //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.
int l = p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_, p_149718_4_);
return func_149887_c(l) ? p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == this : p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ + 1, p_149718_4_) == this && super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_);
+ if (p_180671_3_.func_177230_c() != this) return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_); //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.
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;
@@ -157,7 +155,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_)
{
- 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_))
{
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
}
@@ -296,6 +293,23 @@
return Block.EnumOffsetType.XZ;
}
@@ -262,4 +265,22 @@
int l = this.func_149885_e(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_);
this.func_149642_a(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, new ItemStack(this, 1, l));
}
+
+ @Override
+ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z)
+ public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos)
+ {
+ int metadata = world.func_72805_g(x, y, z);
+ int type = func_149890_d(metadata);
+ return func_149887_c(metadata) && (type == 3 || type == 4);
+ IBlockState state = world.func_180495_p(pos);
+ 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 ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
+ public java.util.List<ItemStack> onSheared(ItemStack item, net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ int type = func_149890_d(world.func_72805_g(x, y, z));
+ if (type == 3 || type == 2)
+ ret.add(new ItemStack(Blocks.field_150329_H, 2, type == 3 ? 2 : 1));
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
+ EnumPlantType type = (EnumPlantType)world.func_180495_p(pos).func_177229_b(field_176493_a);
+ if (type == EnumPlantType.FERN) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.FERN.func_177044_a()));
+ if (type == EnumPlantType.GRASS) ret.add(new ItemStack(Blocks.field_150329_H, 2, BlockTallGrass.EnumType.GRASS.func_177044_a()));
+ return ret;
+ }
}
+
static enum EnumBlockHalf implements IStringSerializable
{
UPPER,

View File

@ -1,19 +1,10 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFalling.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java
@@ -84,7 +84,7 @@
{
Block block = p_149831_0_.func_147439_a(p_149831_1_, p_149831_2_, p_149831_3_);
@@ -85,6 +85,7 @@
- if (block.field_149764_J == Material.field_151579_a)
+ if (block.isAir(p_149831_0_, p_149831_1_, p_149831_2_, p_149831_3_))
{
return true;
}
@@ -94,6 +94,7 @@
}
else
{
+ //TODO: King, take a look here when doing liquids!
Material material = block.field_149764_J;
return material == Material.field_151586_h ? true : material == Material.field_151587_i;
}
public static boolean func_180685_d(World p_180685_0_, BlockPos p_180685_1_)
{
+ 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;

View File

@ -1,20 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java
@@ -12,6 +12,8 @@
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
+import net.minecraftforge.common.IPlantable;
+import net.minecraftforge.common.util.ForgeDirection;
@@ -89,7 +89,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);
}
public class BlockFarmland extends Block
{
@@ -94,7 +96,7 @@
{
Block block = p_149822_1_.func_147439_a(l, p_149822_3_ + 1, i1);
- if (block == Blocks.field_150464_aj || block == Blocks.field_150394_bc || block == Blocks.field_150393_bb || block == Blocks.field_150469_bN || block == Blocks.field_150459_bM)
+ if (block instanceof IPlantable && canSustainPlant(p_149822_1_, p_149822_2_, p_149822_3_, p_149822_4_, ForgeDirection.UP, (IPlantable)block))
{
return true;
}
private boolean func_176530_e(World p_176530_1_, BlockPos p_176530_2_)

View File

@ -1,309 +1,211 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFire.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFire.java
@@ -2,7 +2,10 @@
@@ -42,18 +42,24 @@
int j = p_176221_3_.func_177956_o();
int k = p_176221_3_.func_177952_p();
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.IdentityHashMap;
+import java.util.Map.Entry;
import java.util.Random;
+import com.google.common.collect.Maps;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -12,11 +15,15 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraft.world.WorldProviderEnd;
+import net.minecraftforge.common.util.ForgeDirection;
+import static net.minecraftforge.common.util.ForgeDirection.*;
public class BlockFire extends Block
{
- private int[] field_149849_a = new int[256];
- private int[] field_149848_b = new int[256];
+ @Deprecated
+ private int[] field_149849_a = new int[4096];
+ @Deprecated
+ private int[] field_149848_b = new int[4096];
@SideOnly(Side.CLIENT)
private IIcon[] field_149850_M;
private static final String __OBFID = "CL_00000245";
@@ -54,10 +61,10 @@
Blocks.field_150480_ab.func_149842_a(func_149682_b(Blocks.field_150404_cg), 60, 20);
}
+ @Deprecated // Use setFireInfo
public void func_149842_a(int p_149842_1_, int p_149842_2_, int p_149842_3_)
{
- this.field_149849_a[p_149842_1_] = p_149842_2_;
- this.field_149848_b[p_149842_1_] = p_149842_3_;
+ this.setFireInfo((Block)Block.field_149771_c.func_148754_a(p_149842_1_), p_149842_2_, p_149842_3_);
}
public AxisAlignedBB func_149668_a(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
@@ -94,13 +101,8 @@
{
if (p_149674_1_.func_82736_K().func_82766_b("doFireTick"))
- if (!World.func_175683_a(p_176221_2_, p_176221_3_.func_177977_b()) && !Blocks.field_150480_ab.func_176535_e(p_176221_2_, p_176221_3_.func_177977_b()))
+ if (!World.func_175683_a(p_176221_2_, p_176221_3_.func_177977_b()) && !Blocks.field_150480_ab.canCatchFire(p_176221_2_, p_176221_3_.func_177977_b(), EnumFacing.UP))
{
- boolean flag = p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.field_150424_aL;
+ boolean flag = p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_).isFireSource(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP);
boolean flag = (i + j + k & 1) == 1;
boolean flag1 = (i / 2 + j / 2 + k / 2 & 1) == 1;
int l = 0;
- if (p_149674_1_.field_73011_w instanceof WorldProviderEnd && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.field_150357_h)
- if (this.func_176535_e(p_176221_2_, p_176221_3_.func_177984_a()))
+ if (this.canCatchFire(p_176221_2_, p_176221_3_.func_177984_a(), EnumFacing.DOWN))
{
l = flag ? 1 : 2;
}
- return p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177978_c()))).func_177226_a(field_176546_O, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177974_f()))).func_177226_a(field_176541_P, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177968_d()))).func_177226_a(field_176539_Q, Boolean.valueOf(this.func_176535_e(p_176221_2_, p_176221_3_.func_177976_e()))).func_177226_a(field_176542_R, Integer.valueOf(l)).func_177226_a(field_176540_b, Boolean.valueOf(flag1)).func_177226_a(field_176544_M, Boolean.valueOf(flag));
+ return p_176221_1_.func_177226_a(field_176545_N, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177978_c(), EnumFacing.SOUTH)))
+ .func_177226_a(field_176546_O, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177974_f(), EnumFacing.EAST )))
+ .func_177226_a(field_176541_P, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177968_d(), EnumFacing.NORTH)))
+ .func_177226_a(field_176539_Q, Boolean.valueOf(this.canCatchFire(p_176221_2_, p_176221_3_.func_177976_e(), EnumFacing.EAST )))
+ .func_177226_a(field_176542_R, Integer.valueOf(l))
+ .func_177226_a(field_176540_b, Boolean.valueOf(flag1))
+ .func_177226_a(field_176544_M, Boolean.valueOf(flag));
}
else
{
@@ -109,6 +115,7 @@
public void func_180686_a(Block p_180686_1_, int p_180686_2_, int p_180686_3_)
{
+ if (p_180686_1_ == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
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_));
}
@@ -148,13 +155,8 @@
}
Block block = p_180650_1_.func_180495_p(p_180650_2_.func_177977_b()).func_177230_c();
- boolean flag = block == Blocks.field_150424_aL;
+ boolean flag = block.isFireSource(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP);
- if (p_180650_1_.field_73011_w instanceof WorldProviderEnd && block == Blocks.field_150357_h)
- {
- flag = true;
- }
-
if (!this.func_149742_c(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_))
if (!flag && p_180650_1_.func_72896_J() && this.func_176537_d(p_180650_1_, p_180650_2_))
{
p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_);
@@ -128,7 +130,7 @@
p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_);
}
}
- else if (!flag && !this.func_149844_e(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_) && l == 15 && p_149674_5_.nextInt(4) == 0)
+ else if (!flag && !this.canCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP) && l == 15 && p_149674_5_.nextInt(4) == 0)
{
p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_);
}
@@ -142,12 +144,12 @@
b0 = -50;
p_180650_1_.func_175698_g(p_180650_2_);
@@ -183,7 +185,7 @@
return;
}
- this.func_149841_a(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l);
- this.func_149841_a(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l);
- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l);
- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, 250 + b0, p_149674_5_, l);
- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, 300 + b0, p_149674_5_, l);
- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, 300 + b0, p_149674_5_, l);
+ this.tryCatchFire(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l, WEST );
+ this.tryCatchFire(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l, EAST );
+ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l, UP );
+ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, 250 + b0, p_149674_5_, l, DOWN );
+ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, 300 + b0, p_149674_5_, l, SOUTH);
+ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, 300 + b0, p_149674_5_, l, NORTH);
for (int i1 = p_149674_2_ - 1; i1 <= p_149674_2_ + 1; ++i1)
- if (!this.func_176535_e(p_180650_1_, p_180650_2_.func_177977_b()) && i == 15 && p_180650_4_.nextInt(4) == 0)
+ if (!this.canCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), EnumFacing.UP) && i == 15 && p_180650_4_.nextInt(4) == 0)
{
@@ -201,10 +203,16 @@
p_180650_1_.func_175698_g(p_180650_2_);
return;
@@ -198,12 +200,12 @@
b0 = -50;
}
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177974_f(), 300 + b0, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177976_e(), 300 + b0, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177977_b(), 250 + b0, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177984_a(), 250 + b0, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177978_c(), 300 + b0, p_180650_4_, i);
- this.func_176536_a(p_180650_1_, p_180650_2_.func_177968_d(), 300 + b0, p_180650_4_, i);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177974_f(), 300 + b0, p_180650_4_, i, EnumFacing.WEST);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177976_e(), 300 + b0, p_180650_4_, i, EnumFacing.EAST);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177977_b(), 250 + b0, p_180650_4_, i, EnumFacing.UP);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177984_a(), 250 + b0, p_180650_4_, i, EnumFacing.DOWN);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177978_c(), 300 + b0, p_180650_4_, i, EnumFacing.SOUTH);
+ this.tryCatchFire(p_180650_1_, p_180650_2_.func_177968_d(), 300 + b0, p_180650_4_, i, EnumFacing.NORTH);
for (int j = -1; j <= 1; ++j)
{
@@ -262,22 +264,30 @@
return false;
}
+ @Deprecated
private void func_149841_a(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_)
+ @Deprecated // Use Block.getFlammability
public int func_176532_c(Block p_176532_1_)
{
- int j1 = this.field_149848_b[Block.func_149682_b(p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_))];
+ this.tryCatchFire(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, p_149841_5_, p_149841_6_, p_149841_7_, UP);
Integer integer = (Integer)this.field_149848_b.get(p_176532_1_);
return integer == null ? 0 : integer.intValue();
}
+ @Deprecated // Use Block.getFlammability
public int func_176534_d(Block p_176534_1_)
{
Integer integer = (Integer)this.field_149849_a.get(p_176534_1_);
return integer == null ? 0 : integer.intValue();
}
+ @Deprecated // Use tryCatchFire with face below
private void func_176536_a(World p_176536_1_, BlockPos p_176536_2_, int p_176536_3_, Random p_176536_4_, int p_176536_5_)
{
- int k = this.func_176532_c(p_176536_1_.func_180495_p(p_176536_2_).func_177230_c());
+ this.tryCatchFire(p_176536_1_, p_176536_2_, p_176536_3_, p_176536_4_, p_176536_5_, EnumFacing.UP);
+ }
+ private void tryCatchFire(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_, ForgeDirection face)
+ 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)
+ {
+ int j1 = p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_).getFlammability(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, face);
+ int k = p_176536_1_.func_180495_p(p_176536_2_).func_177230_c().getFlammability(p_176536_1_, p_176536_2_, face);
+
if (p_149841_6_.nextInt(p_149841_5_) < j1)
if (p_176536_4_.nextInt(p_176536_3_) < k)
{
boolean flag = p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.field_150335_W;
@@ -234,7 +242,12 @@
private boolean func_149847_e(World p_149847_1_, int p_149847_2_, int p_149847_3_, int p_149847_4_)
{
- return this.func_149844_e(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1) ? true : this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1)))));
+ return this.canCatchFire(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_, WEST ) ||
+ this.canCatchFire(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_, EAST ) ||
+ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_, UP ) ||
+ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_, DOWN ) ||
+ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1, SOUTH) ||
+ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1, NORTH);
}
private int func_149845_m(World p_149845_1_, int p_149845_2_, int p_149845_3_, int p_149845_4_)
@@ -247,12 +260,13 @@
}
else
IBlockState iblockstate = p_176536_1_.func_180495_p(p_176536_2_);
@@ -314,7 +324,7 @@
{
- int l = this.func_149846_a(p_149845_1_, p_149845_2_ + 1, p_149845_3_, p_149845_4_, b0);
- l = this.func_149846_a(p_149845_1_, p_149845_2_ - 1, p_149845_3_, p_149845_4_, l);
- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_ - 1, p_149845_4_, l);
- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_ + 1, p_149845_4_, l);
- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ - 1, l);
- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ + 1, l);
+ int l = b0;
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_ + 1, p_149845_3_, p_149845_4_, l, WEST );
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_ - 1, p_149845_3_, p_149845_4_, l, EAST );
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_ - 1, p_149845_4_, l, UP );
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_ + 1, p_149845_4_, l, DOWN );
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ - 1, l, SOUTH);
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ + 1, l, NORTH);
return l;
}
}
@@ -262,15 +276,16 @@
EnumFacing enumfacing = aenumfacing[j];
- if (this.func_176535_e(p_176533_1_, p_176533_2_.func_177972_a(enumfacing)))
+ if (this.canCatchFire(p_176533_1_, p_176533_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()))
{
return true;
}
@@ -338,7 +348,7 @@
for (int k = 0; k < j; ++k)
{
EnumFacing enumfacing = aenumfacing[k];
- i = Math.max(this.func_176534_d(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c()), i);
+ i = Math.max(p_176538_1_.func_180495_p(p_176538_2_.func_177972_a(enumfacing)).func_177230_c().getFlammability(p_176538_1_, p_176538_2_.func_177972_a(enumfacing), enumfacing.func_176734_d()), i);
}
return i;
@@ -350,9 +360,10 @@
return false;
}
+ @Deprecated
public boolean func_149844_e(IBlockAccess p_149844_1_, int p_149844_2_, int p_149844_3_, int p_149844_4_)
+ @Deprecated // Use canCatchFire with face sensitive version below
public boolean func_176535_e(IBlockAccess p_176535_1_, BlockPos p_176535_2_)
{
- return this.field_149849_a[Block.func_149682_b(p_149844_1_.func_147439_a(p_149844_2_, p_149844_3_, p_149844_4_))] > 0;
+ return canCatchFire(p_149844_1_, p_149844_2_, p_149844_3_, p_149844_4_, UP);
- return this.func_176534_d(p_176535_1_.func_180495_p(p_176535_2_).func_177230_c()) > 0;
+ return canCatchFire(p_176535_1_, p_176535_2_, EnumFacing.UP);
}
+ @Deprecated
public int func_149846_a(World p_149846_1_, int p_149846_2_, int p_149846_3_, int p_149846_4_, int p_149846_5_)
{
- int i1 = this.field_149849_a[Block.func_149682_b(p_149846_1_.func_147439_a(p_149846_2_, p_149846_3_, p_149846_4_))];
- return i1 > p_149846_5_ ? i1 : p_149846_5_;
+ return getChanceToEncourageFire(p_149846_1_, p_149846_2_, p_149846_3_, p_149846_4_, p_149846_5_, UP);
}
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
@@ -396,9 +407,9 @@
double d1;
double d2;
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
@@ -314,9 +329,9 @@
float f1;
float f2;
- if (!World.func_147466_a(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_))
+ if (!World.func_147466_a(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP))
- 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 (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_))
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_, EAST))
- 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))
{
for (l = 0; l < 2; ++l)
for (i = 0; i < 2; ++i)
{
@@ -327,7 +342,7 @@
@@ -409,7 +420,7 @@
}
}
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_))
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_, WEST))
- 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))
{
for (l = 0; l < 2; ++l)
for (i = 0; i < 2; ++i)
{
@@ -338,7 +353,7 @@
@@ -420,7 +431,7 @@
}
}
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1))
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1, SOUTH))
- 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))
{
for (l = 0; l < 2; ++l)
for (i = 0; i < 2; ++i)
{
@@ -349,7 +364,7 @@
@@ -431,7 +442,7 @@
}
}
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1))
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1, NORTH))
- 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))
{
for (l = 0; l < 2; ++l)
for (i = 0; i < 2; ++i)
{
@@ -360,7 +375,7 @@
@@ -442,7 +453,7 @@
}
}
- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_))
+ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_, DOWN))
- 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))
{
for (l = 0; l < 2; ++l)
for (i = 0; i < 2; ++i)
{
@@ -405,4 +420,101 @@
@@ -490,4 +501,19 @@
{
return MapColor.field_151656_f;
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});
}
+
+ /*================================= Forge Start ======================================*/
+ private static class FireInfo
+ {
+ private int encouragement = 0;
+ private int flammibility = 0;
+ }
+ private IdentityHashMap<Block, FireInfo> blockInfo = Maps.newIdentityHashMap();
+
+ public void setFireInfo(Block block, int encouragement, int flammibility)
+ {
+ if (block == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
+ int id = Block.func_149682_b(block);
+ this.field_149849_a[id] = encouragement;
+ this.field_149848_b[id] = flammibility;
+
+ FireInfo info = getInfo(block, true);
+ info.encouragement = encouragement;
+ info.flammibility = flammibility;
+ }
+
+ private FireInfo getInfo(Block block, boolean garentee)
+ {
+ FireInfo ret = blockInfo.get(block);
+ if (ret == null && garentee)
+ {
+ ret = new FireInfo();
+ blockInfo.put(block, ret);
+ }
+ return ret;
+ }
+
+ public void rebuildFireInfo()
+ {
+ for (int x = 0; x < 4096; x++)
+ {
+ //If we care.. we could detect changes in here and make sure we keep them, however
+ //it's my thinking that anyone who hacks into the private variables should DIAF and we don't care about them.
+ field_149849_a[x] = 0;
+ field_149848_b[x] = 0;
+ }
+
+ for (Entry<Block, FireInfo> e : blockInfo.entrySet())
+ {
+ int id = Block.func_149682_b(e.getKey());
+ if (id >= 0 && id < 4096)
+ {
+ field_149849_a[id] = e.getValue().encouragement;
+ field_149848_b[id] = e.getValue().flammibility;
+ }
+ }
+ }
+
+ public int getFlammability(Block block)
+ {
+ int id = Block.func_149682_b(block);
+ return id >= 0 && id < 4096 ? field_149848_b[id] : 0;
+ }
+
+ public int getEncouragement(Block block)
+ {
+ int id = Block.func_149682_b(block);
+ return id >= 0 && id < 4096 ? field_149849_a[id] : 0;
+ }
+
+ /**
+ * Side sensitive version that calls the block function.
+ *
+ *
+ * @param world The current world
+ * @param x X Position
+ * @param y Y Position
+ * @param z Z Position
+ * @param pos Block position
+ * @param face The side the fire is coming from
+ * @return True if the face can catch fire.
+ */
+ public boolean canCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face)
+ public boolean canCatchFire(IBlockAccess world, BlockPos pos, EnumFacing face)
+ {
+ return world.func_147439_a(x, y, z).isFlammable(world, x, y, z, face);
+ }
+
+ /**
+ * Side sensitive version that calls the block function.
+ *
+ * @param world The current world
+ * @param x X Position
+ * @param y Y Position
+ * @param z Z Position
+ * @param oldChance The previous maximum chance.
+ * @param face The side the fire is coming from
+ * @return The chance of the block catching fire, or oldChance if it is higher
+ */
+ public int getChanceToEncourageFire(IBlockAccess world, int x, int y, int z, int oldChance, ForgeDirection face)
+ {
+ int newChance = world.func_147439_a(x, y, z).getFireSpreadSpeed(world, x, y, z, face);
+ return (newChance > oldChance ? newChance : oldChance);
+ return world.func_180495_p(pos).func_177230_c().isFlammable(world, pos, face);
+ }
+ /*================================= Forge Start ======================================*/
}

View File

@ -1,53 +1,48 @@
--- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java
+++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java
@@ -2,6 +2,7 @@
@@ -162,13 +162,6 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
@@ -138,13 +139,6 @@
public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_)
{
- TileEntityFlowerPot tileentityflowerpot = this.func_149929_e(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_);
- TileEntityFlowerPot tileentityflowerpot = this.func_176442_d(p_180663_1_, p_180663_2_);
-
- if (tileentityflowerpot != null && tileentityflowerpot.func_145965_a() != null)
- {
- this.func_149642_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, new ItemStack(tileentityflowerpot.func_145965_a(), 1, tileentityflowerpot.func_145966_b()));
- func_180635_a(p_180663_1_, p_180663_2_, new ItemStack(tileentityflowerpot.func_145965_a(), 1, tileentityflowerpot.func_145966_b()));
- }
-
super.func_149749_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
}
@@ -231,4 +225,28 @@
return new TileEntityFlowerPot(Item.func_150898_a((Block)object), b0);
@@ -388,6 +381,31 @@
return EnumWorldBlockLayer.CUTOUT;
}
+
+ /*============================FORGE START=====================================*/
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
+ TileEntityFlowerPot te = this.func_149929_e(world, x, y, z);
+ java.util.List<ItemStack> ret = super.getDrops(world, pos, state, fortune);
+ TileEntityFlowerPot te = world.func_175625_s(pos) instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)world.func_175625_s(pos) : null;
+ if (te != null && te.func_145965_a() != null)
+ ret.add(new ItemStack(te.func_145965_a(), 1, te.func_145966_b()));
+ return ret;
+ }
+ @Override
+ public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest)
+ public boolean removedByPlayer(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, player, x, y, z, willHarvest);
+ return super.removedByPlayer(world, pos, player, willHarvest);
+ }
+ @Override
+ public void func_149636_a(World world, EntityPlayer player, int x, int y, int z, int meta)
+ public void func_180657_a(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te)
+ {
+ super.func_149636_a(world, player, x, y, z, meta);
+ world.func_147468_f(x, y, z);
+ super.func_180657_a(world, player, pos, state, te);
+ world.func_175698_g(pos);
+ }
+ /*===========================FORGE END==========================================*/
}
+
public static enum EnumFlowerType implements IStringSerializable
{
EMPTY("empty"),

View File

@ -1,37 +1,41 @@
--- ../src-base/minecraft/net/minecraft/block/BlockGrass.java
+++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java
@@ -43,7 +43,7 @@
@@ -59,7 +59,7 @@
{
if (!p_149674_1_.field_72995_K)
if (!p_180650_1_.field_72995_K)
{
- if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ + 1, p_149674_4_).func_149717_k() > 2)
+ if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 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().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)
{
p_149674_1_.func_147449_b(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.field_150346_d);
p_180650_1_.func_175656_a(p_180650_2_, Blocks.field_150346_d.func_176223_P());
}
@@ -56,7 +56,7 @@
int k1 = p_149674_4_ + p_149674_5_.nextInt(3) - 1;
Block block = p_149674_1_.func_147439_a(i1, j1 + 1, k1);
@@ -73,7 +73,7 @@
Block block = p_180650_1_.func_180495_p(blockpos1.func_177984_a()).func_177230_c();
IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos1);
- if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && block.func_149717_k() <= 2)
+ if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
{
p_149674_1_.func_147449_b(i1, j1, k1, Blocks.field_150349_c);
- 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(blockpos1.func_177984_a()) >= 4 && block.func_149717_k() <= 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(blockpos1.func_177984_a()) >= 4 && block.getLightOpacity(p_180650_1_, blockpos1.func_177984_a()) <= 2)
{
p_180650_1_.func_175656_a(blockpos1, Blocks.field_150349_c.func_176223_P());
}
@@ -120,18 +120,11 @@
continue;
}
@@ -184,15 +184,7 @@
}
- else if (p_176474_1_.func_180495_p(blockpos2).func_177230_c().field_149764_J == Material.field_151579_a)
+ else if (p_176474_1_.func_175623_d(blockpos2))
{
if (p_176474_2_.nextInt(8) == 0)
{
- BlockFlower.EnumFlowerType enumflowertype = p_176474_1_.func_180494_b(blockpos2).func_180623_a(p_176474_2_, blockpos2);
- BlockFlower blockflower = enumflowertype.func_176964_a().func_180346_a();
- IBlockState iblockstate1 = blockflower.func_176223_P().func_177226_a(blockflower.func_176494_l(), enumflowertype);
-
- if (blockflower.func_180671_f(p_176474_1_, blockpos2, iblockstate1))
- {
- p_176474_1_.func_180501_a(blockpos2, iblockstate1, 3);
- }
+ p_176474_1_.func_180494_b(blockpos2).plantFlower(p_176474_1_, p_176474_2_, blockpos2);
}
else
{
- String s = p_149853_1_.func_72807_a(i1, k1).func_150572_a(p_149853_2_, i1, j1, k1);
- field_149992_a.debug("Flower in " + p_149853_1_.func_72807_a(i1, k1).field_76791_y + ": " + s);
- BlockFlower blockflower = BlockFlower.func_149857_e(s);
-
- if (blockflower != null && blockflower.func_149718_j(p_149853_1_, i1, j1, k1))
- {
- int i2 = BlockFlower.func_149856_f(s);
- p_149853_1_.func_147465_d(i1, j1, k1, blockflower, i2, 3);
- }
+ p_149853_1_.func_72807_a(i1, k1).plantFlower(p_149853_1_, p_149853_2_, i1, j1, k1);
}
}

View File

@ -1,50 +1,35 @@
--- ../src-base/minecraft/net/minecraft/block/BlockIce.java
+++ ../src-work/minecraft/net/minecraft/block/BlockIce.java
@@ -2,6 +2,7 @@
@@ -40,14 +40,17 @@
p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
p_180657_2_.func_71020_j(0.025F);
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
@@ -13,6 +14,7 @@
import net.minecraft.world.EnumSkyBlock;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.event.ForgeEventFactory;
public class BlockIce extends BlockBreakable
{
@@ -43,14 +45,16 @@
p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
p_149636_2_.func_71020_j(0.025F);
- if (this.func_149700_E() && EnchantmentHelper.func_77502_d(p_149636_2_))
+ if (this.canSilkHarvest(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_) && EnchantmentHelper.func_77502_d(p_149636_2_))
- 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_))
{
+ ArrayList<ItemStack> items = new ArrayList<ItemStack>();
ItemStack itemstack = this.func_149644_j(p_149636_6_);
+ java.util.List<ItemStack> items = new java.util.ArrayList<ItemStack>();
ItemStack itemstack = this.func_180643_i(p_180657_4_);
- if (itemstack != null)
- {
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, itemstack);
- func_180635_a(p_180657_1_, p_180657_3_, itemstack);
- }
+ if (itemstack != null) items.add(itemstack);
+
+ ForgeEventFactory.fireBlockHarvesting(items, p_149636_1_, this, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, 0, 1.0f, true, p_149636_2_);
+ 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_);
+
+ for (ItemStack is : items)
+ this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, is);
+ func_180635_a(p_180657_1_, p_180657_3_, is);
}
else
{
@@ -61,7 +65,9 @@
@@ -58,7 +61,9 @@
}
int i1 = EnchantmentHelper.func_77517_e(p_149636_2_);
+ harvesters.set(p_149636_2_);
this.func_149697_b(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, i1);
int i = EnchantmentHelper.func_77517_e(p_180657_2_);
+ 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_149636_1_.func_147439_a(p_149636_3_, p_149636_4_ - 1, p_149636_5_).func_149688_o();
Material material = p_180657_1_.func_180495_p(p_180657_3_.func_177977_b()).func_177230_c().func_149688_o();
if (material.func_76230_c() || material.func_76224_d())

View File

@ -1,93 +1,23 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLadder.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java
@@ -5,10 +5,14 @@
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -80,7 +80,10 @@
+import net.minecraftforge.common.util.ForgeDirection;
+import static net.minecraftforge.common.util.ForgeDirection.*;
+
public class BlockLadder extends Block
{
private static final String __OBFID = "CL_00000262";
@@ -79,29 +83,32 @@
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r()));
+ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) ||
+ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH);
- 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);
}
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
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_)
@@ -124,7 +127,7 @@
protected boolean func_176381_b(World p_176381_1_, BlockPos p_176381_2_, EnumFacing p_176381_3_)
{
int j1 = p_149660_9_;
- if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r())
+ if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH))
{
j1 = 2;
}
- if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r())
+ if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH))
{
j1 = 3;
}
- if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r())
+ if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST))
{
j1 = 4;
}
- if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r())
+ if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST))
{
j1 = 5;
}
@@ -114,22 +121,22 @@
int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_);
boolean flag = false;
- if (l == 2 && p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r())
+ if (l == 2 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH))
{
flag = true;
}
- if (l == 3 && p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r())
+ if (l == 3 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH))
{
flag = true;
}
- if (l == 4 && p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r())
+ if (l == 4 && p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST))
{
flag = true;
}
- if (l == 5 && p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r())
+ if (l == 5 && p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST))
{
flag = true;
}
@@ -147,4 +154,10 @@
{
return 1;
- 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);
}
+
+ @Override
+ public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity)
+ {
+ return true;
+ }
}
@SideOnly(Side.CLIENT)

View File

@ -1,151 +1,108 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java
@@ -2,6 +2,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
@@ -15,8 +16,9 @@
import net.minecraft.world.ColorizerFoliage;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.common.IShearable;
@@ -18,7 +18,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 IShearable
+public abstract class BlockLeaves extends BlockLeavesBase implements net.minecraftforge.common.IShearable
{
int[] field_150128_a;
@SideOnly(Side.CLIENT)
@@ -82,10 +84,10 @@
{
for (int l1 = -b0; l1 <= b0; ++l1)
{
- if (p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).func_149688_o() == Material.field_151584_j)
+ Block block = p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
+ if (block.isLeaves(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1))
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");
@@ -76,9 +76,9 @@
BlockPos blockpos1 = p_180663_2_.func_177982_a(i1, j1, k1);
IBlockState iblockstate1 = p_180663_1_.func_180495_p(blockpos1);
- if (iblockstate1.func_177230_c().func_149688_o() == Material.field_151584_j && !((Boolean)iblockstate1.func_177229_b(field_176236_b)).booleanValue())
+ if (iblockstate1.func_177230_c().isLeaves(p_180663_1_, blockpos1))
{
- int i2 = p_149749_1_.func_72805_g(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
- p_149749_1_.func_72921_c(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1, i2 | 8, 4);
+ block.beginLeavesDecay(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
- p_180663_1_.func_180501_a(blockpos1, iblockstate1.func_177226_a(field_176236_b, Boolean.valueOf(true)), 4);
+ iblockstate1.func_177230_c().beginLeavesDecay(p_180663_1_, blockpos1);
}
}
}
@@ -127,9 +129,9 @@
@@ -119,11 +119,12 @@
{
for (i2 = -b0; i2 <= b0; ++i2)
{
Block block = p_149674_1_.func_147439_a(p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2);
- Block block = p_180650_1_.func_180495_p(new BlockPos(j + k1, k + l1, l + i2)).func_177230_c();
+ BlockPos tmp = new BlockPos(j + k1, k + l1, l + i2);
+ Block block = p_180650_1_.func_180495_p(tmp).func_177230_c();
- if (block != Blocks.field_150364_r && block != Blocks.field_150363_s)
+ if (!block.canSustainLeaves(p_149674_1_, p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2))
+ if (!block.canSustainLeaves(p_180650_1_, tmp))
{
- if (block.func_149688_o() == Material.field_151584_j)
+ if (block.isLeaves(p_149674_1_, p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2))
+ if (block.isLeaves(p_180650_1_, tmp))
{
this.field_150128_a[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2;
this.field_150128_a[(k1 + j1) * i1 + (l1 + j1) * b1 + i2 + j1] = -2;
}
@@ -236,40 +238,7 @@
@@ -230,40 +231,7 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_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_149690_1_.field_72995_K)
- if (!p_180653_1_.field_72995_K)
- {
- int j1 = this.func_150123_b(p_149690_5_);
- int j = this.func_176232_d(p_180653_3_);
-
- if (p_149690_7_ > 0)
- if (p_180653_5_ > 0)
- {
- j1 -= 2 << p_149690_7_;
- j -= 2 << p_180653_5_;
-
- if (j1 < 10)
- if (j < 10)
- {
- j1 = 10;
- j = 10;
- }
- }
-
- if (p_149690_1_.field_73012_v.nextInt(j1) == 0)
- if (p_180653_1_.field_73012_v.nextInt(j) == 0)
- {
- Item item = this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_);
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(item, 1, this.func_149692_a(p_149690_5_)));
- Item item = this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_);
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item, 1, this.func_180651_a(p_180653_3_)));
- }
-
- j1 = 200;
- j = 200;
-
- if (p_149690_7_ > 0)
- if (p_180653_5_ > 0)
- {
- j1 -= 10 << p_149690_7_;
- j -= 10 << p_180653_5_;
-
- if (j1 < 40)
- if (j < 40)
- {
- j1 = 40;
- j = 40;
- }
- }
-
- this.func_150124_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, j1);
- this.func_176234_a(p_180653_1_, p_180653_2_, p_180653_3_, j);
- }
+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, 1.0f, p_149690_7_);
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
}
protected void func_150124_c(World p_150124_1_, int p_150124_2_, int p_150124_3_, int p_150124_4_, int p_150124_5_, int p_150124_6_) {}
@@ -281,13 +250,7 @@
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
{
- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
{
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Item.func_150898_a(this), 1, p_149636_6_ & 3));
- }
- else
- {
super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
}
}
@@ -318,4 +281,67 @@
protected void func_176234_a(World p_176234_1_, BlockPos p_176234_2_, IBlockState p_176234_3_, int p_176234_4_) {}
@@ -298,4 +266,48 @@
}
public abstract String[] func_150125_e();
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 isShearable(ItemStack item, IBlockAccess world, int x, int y, int z)
+ public void beginLeavesDecay(World world, BlockPos pos)
+ {
+ return true;
+ }
+
+ @Override
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ ret.add(new ItemStack(this, 1, world.func_72805_g(x, y, z) & 3));
+ return ret;
+ }
+
+ @Override
+ public void beginLeavesDecay(World world, int x, int y, int z)
+ {
+
+ int i2 = world.func_72805_g(x, y, z);
+
+ if ((i2 & 8) == 0)
+ IBlockState state = world.func_180495_p(pos);
+ if (!(Boolean)state.func_177229_b(field_176236_b))
+ {
+ world.func_72921_c(x, y, z, i2 | 8, 4);
+ world.func_180501_a(pos, state.func_177226_a(field_176236_b, true), 4);
+ }
+ world.func_72921_c(x, y, z, world.func_72805_g(x, y, z) | 8, 4);
+ }
+
+ @Override
+ public boolean isLeaves(IBlockAccess world, int x, int y, int z)
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ return true;
+ }
+
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ int chance = this.func_150123_b(metadata);
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
+ int chance = this.func_176232_d(state);
+
+ if (fortune > 0)
+ {
@ -153,8 +110,8 @@
+ if (chance < 10) chance = 10;
+ }
+
+ if (world.field_73012_v.nextInt(chance) == 0)
+ ret.add(new ItemStack(this.func_149650_a(metadata, world.field_73012_v, fortune), 1, this.func_149692_a(metadata)));
+ if (rand.nextInt(chance) == 0)
+ ret.add(new ItemStack(func_180660_a(state, rand, fortune), 1, func_180651_a(state)));
+
+ chance = 200;
+ if (fortune > 0)
@ -164,8 +121,10 @@
+ }
+
+ this.captureDrops(true);
+ this.func_150124_c(world, x, y, z, metadata, chance); // Dammet mojang
+ if (world instanceof World)
+ this.func_176234_a((World)world, pos, state, chance); // Dammet mojang
+ ret.addAll(this.captureDrops(false));
+ return ret;
+ }
+
}

View File

@ -1,128 +1,67 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLever.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLever.java
@@ -10,6 +10,9 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -47,24 +47,24 @@
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
{
- return p_176198_3_ == EnumFacing.UP && World.func_175683_a(p_176198_1_, p_176198_2_.func_177977_b()) ? true : this.func_176358_d(p_176198_1_, p_176198_2_.func_177972_a(p_176198_3_.func_176734_d()));
+ return p_176198_3_ == EnumFacing.UP && World.func_175683_a(p_176198_1_, p_176198_2_.func_177977_b()) ? true : p_176198_1_.isSideSolid(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_)
{
- return this.func_176358_d(p_176196_1_, p_176196_2_.func_177976_e()) ? true : (this.func_176358_d(p_176196_1_, p_176196_2_.func_177974_f()) ? true : (this.func_176358_d(p_176196_1_, p_176196_2_.func_177978_c()) ? true : (this.func_176358_d(p_176196_1_, p_176196_2_.func_177968_d()) ? true : (World.func_175683_a(p_176196_1_, p_176196_2_.func_177977_b()) ? true : this.func_176358_d(p_176196_1_, p_176196_2_.func_177984_a())))));
+ return p_176196_1_.isSideSolid(p_176196_2_.func_177976_e(), EnumFacing.EAST ) ||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177974_f(), EnumFacing.WEST ) ||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177978_c(), EnumFacing.SOUTH) ||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177968_d(), EnumFacing.NORTH) ||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177977_b(), EnumFacing.UP ) ||
+ p_176196_1_.isSideSolid(p_176196_2_.func_177984_a(), EnumFacing.DOWN );
}
- protected boolean func_176358_d(World p_176358_1_, BlockPos p_176358_2_)
- {
- return p_176358_1_.func_180495_p(p_176358_2_).func_177230_c().func_149721_r();
- }
-
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 = this.func_176223_P().func_177226_a(field_176359_b, Boolean.valueOf(false));
- if (this.func_176358_d(p_180642_1_, p_180642_2_.func_177972_a(p_180642_3_.func_176734_d())))
+ if (p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(p_180642_3_.func_176734_d()), p_180642_3_))
{
return iblockstate.func_177226_a(field_176360_a, BlockLever.EnumOrientation.func_176856_a(p_180642_3_, p_180642_8_.func_174811_aO()));
}
@@ -87,7 +87,7 @@
enumfacing1 = (EnumFacing)iterator.next();
}
- while (enumfacing1 == p_180642_3_ || !this.func_176358_d(p_180642_1_, p_180642_2_.func_177972_a(enumfacing1.func_176734_d())));
+ while (enumfacing1 == p_180642_3_ || !p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(enumfacing1.func_176734_d()), enumfacing1));
return iblockstate.func_177226_a(field_176360_a, BlockLever.EnumOrientation.func_176856_a(enumfacing1, p_180642_8_.func_174811_aO()));
}
@@ -116,7 +116,8 @@
public void func_176204_a(World p_176204_1_, BlockPos p_176204_2_, IBlockState p_176204_3_, Block p_176204_4_)
{
- if (this.func_176356_e(p_176204_1_, p_176204_2_) && !this.func_176358_d(p_176204_1_, p_176204_2_.func_177972_a(((BlockLever.EnumOrientation)p_176204_3_.func_177229_b(field_176360_a)).func_176852_c().func_176734_d())))
+ EnumFacing dir = ((BlockLever.EnumOrientation)p_176204_3_.func_177229_b(field_176360_a)).func_176852_c();
+ if (this.func_176356_e(p_176204_1_, p_176204_2_) && !p_176204_1_.isSideSolid(p_176204_2_.func_177972_a(dir.func_176734_d()), dir))
{
this.func_176226_b(p_176204_1_, p_176204_2_, p_176204_3_, 0);
p_176204_1_.func_175698_g(p_176204_2_);
@@ -235,6 +236,12 @@
return new BlockState(this, new IProperty[] {field_176360_a, field_176359_b});
}
+import net.minecraftforge.common.util.ForgeDirection;
+import static net.minecraftforge.common.util.ForgeDirection.*;
+
public class BlockLever extends Block
{
private static final String __OBFID = "CL_00000264";
@@ -42,12 +45,23 @@
public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_)
+ private boolean canAttach(World world, BlockPos pos, EnumFacing side)
+ {
+ return world.isSideSolid(pos, side);
+ }
+
public static enum EnumOrientation implements IStringSerializable
{
- return p_149707_5_ == 0 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_ + 1, p_149707_4_).func_149721_r() ? true : (p_149707_5_ == 1 && World.func_147466_a(p_149707_1_, p_149707_2_, p_149707_3_ - 1, p_149707_4_) ? true : (p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r()))));
+ ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_);
+ return (dir == DOWN && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_ + 1, p_149707_4_, DOWN )) ||
+ (dir == UP && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_ - 1, p_149707_4_, UP )) ||
+ (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) ||
+ (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) ||
+ (dir == WEST && p_149707_1_.isSideSolid(p_149707_2_ + 1, p_149707_3_, p_149707_4_, WEST )) ||
+ (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST ));
}
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
{
- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r() ? true : (World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ + 1, p_149742_4_).func_149721_r()))));
+ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) ||
+ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_ - 1, p_149742_4_, UP ) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_ + 1, p_149742_4_, DOWN );
}
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
@@ -56,32 +70,32 @@
int j1 = p_149660_9_ & 7;
byte b0 = -1;
- if (p_149660_5_ == 0 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_ + 1, p_149660_4_).func_149721_r())
+ if (p_149660_5_ == 0 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_ + 1, p_149660_4_, DOWN))
{
b0 = 0;
}
- if (p_149660_5_ == 1 && World.func_147466_a(p_149660_1_, p_149660_2_, p_149660_3_ - 1, p_149660_4_))
+ if (p_149660_5_ == 1 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_ - 1, p_149660_4_, UP))
{
b0 = 5;
}
- if (p_149660_5_ == 2 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r())
+ if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH))
{
b0 = 4;
}
- if (p_149660_5_ == 3 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r())
+ if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH))
{
b0 = 3;
}
- if (p_149660_5_ == 4 && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r())
+ if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST))
{
b0 = 2;
}
- if (p_149660_5_ == 5 && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r())
+ if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST))
{
b0 = 1;
}
@@ -147,42 +161,42 @@
int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_) & 7;
boolean flag = false;
- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 1)
+ if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && l == 1)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 2)
+ if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && l == 2)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && l == 3)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && l == 3)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && l == 4)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && l == 4)
{
flag = true;
}
- if (!World.func_147466_a(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 5)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ - 1, p_149695_4_, UP) && l == 5)
{
flag = true;
}
- if (!World.func_147466_a(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 6)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ - 1, p_149695_4_, UP) && l == 6)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_ + 1, p_149695_4_).func_149721_r() && l == 0)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ + 1, p_149695_4_, DOWN) && l == 0)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_ + 1, p_149695_4_).func_149721_r() && l == 7)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ + 1, p_149695_4_, DOWN) && l == 7)
{
flag = true;
}
DOWN_X(0, "down_x", EnumFacing.DOWN),

View File

@ -1,11 +0,0 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLiquid.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLiquid.java
@@ -67,7 +67,7 @@
{
for (int l1 = -1; l1 <= 1; ++l1)
{
- int i2 = p_149720_1_.func_72807_a(p_149720_2_ + l1, p_149720_4_ + k1).field_76759_H;
+ int i2 = p_149720_1_.func_72807_a(p_149720_2_ + l1, p_149720_4_ + k1).getWaterColorMultiplier();
l += (i2 & 16711680) >> 16;
i1 += (i2 & 65280) >> 8;
j1 += i2 & 255;

View File

@ -1,45 +1,24 @@
--- ../src-base/minecraft/net/minecraft/block/BlockLog.java
+++ ../src-work/minecraft/net/minecraft/block/BlockLog.java
@@ -7,6 +7,7 @@
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -38,9 +38,9 @@
BlockPos blockpos1 = (BlockPos)iterator.next();
IBlockState iblockstate1 = p_180663_1_.func_180495_p(blockpos1);
public abstract class BlockLog extends BlockRotatedPillar
@@ -53,14 +54,10 @@
- if (iblockstate1.func_177230_c().func_149688_o() == Material.field_151584_j && !((Boolean)iblockstate1.func_177229_b(BlockLeaves.field_176236_b)).booleanValue())
+ if (iblockstate1.func_177230_c().isLeaves(p_180663_1_, blockpos1))
{
for (int l1 = -b0; l1 <= b0; ++l1)
{
- if (p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).func_149688_o() == Material.field_151584_j)
+ Block block = p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
+ if (block.isLeaves(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1))
{
- int i2 = p_149749_1_.func_72805_g(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
-
- if ((i2 & 8) == 0)
- {
- p_149749_1_.func_72921_c(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1, i2 | 8, 4);
- }
+ block.beginLeavesDecay(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1);
}
}
- p_180663_1_.func_180501_a(blockpos1, iblockstate1.func_177226_a(BlockLeaves.field_176236_b, Boolean.valueOf(true)), 4);
+ iblockstate1.func_177230_c().beginLeavesDecay(p_180663_1_, blockpos1);
}
@@ -79,4 +76,16 @@
{
return this.field_150166_b[p_150161_1_ % this.field_150166_b.length];
}
}
@@ -51,6 +51,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()));
}
+ @Override public boolean canSustainLeaves(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+ @Override public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
+
+ @Override
+ public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z)
+ {
+ return true;
+ }
+
+ @Override
+ public boolean isWood(IBlockAccess world, int x, int y, int z)
+ {
+ return true;
+ }
}
public static enum EnumAxis implements IStringSerializable
{
X("x"),

View File

@ -1,26 +1,17 @@
--- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java
+++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java
@@ -7,6 +7,7 @@
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityMobSpawner;
+import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockMobSpawner extends BlockContainer
@@ -36,10 +37,15 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
@@ -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_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
- int j1 = 15 + p_149690_1_.field_73012_v.nextInt(15) + p_149690_1_.field_73012_v.nextInt(15);
- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1);
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
- int j = 15 + p_180653_1_.field_73012_v.nextInt(15) + p_180653_1_.field_73012_v.nextInt(15);
- this.func_180637_b(p_180653_1_, p_180653_2_, j);
}
+ private Random rand = new Random();
+ @Override
+ public int getExpDrop(IBlockAccess world, int metadata, int fortune)
+ public int getExpDrop(net.minecraft.world.IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return 15 + rand.nextInt(15) + rand.nextInt(15);
+ return 15 + RANDOM.nextInt(15) + RANDOM.nextInt(15);
+ }
+
public boolean func_149662_c()

View File

@ -1,19 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java
+++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java
@@ -4,6 +4,7 @@
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenBigMushroom;
+import net.minecraftforge.common.util.ForgeDirection;
public class BlockMushroom extends BlockBush implements IGrowable
{
@@ -85,7 +86,7 @@
if (p_149718_3_ >= 0 && p_149718_3_ < 256)
@@ -76,7 +76,7 @@
if (p_180671_2_.func_177956_o() >= 0 && p_180671_2_.func_177956_o() < 256)
{
Block block = p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_);
- return block == Blocks.field_150391_bh || block == Blocks.field_150346_d && p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.func_72883_k(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && this.func_149854_a(block);
+ return block == Blocks.field_150391_bh || block == Blocks.field_150346_d && p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.func_72883_k(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && block.canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this);
IBlockState iblockstate1 = p_180671_1_.func_180495_p(p_180671_2_.func_177977_b());
- return iblockstate1.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.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(iblockstate1.func_177230_c()));
+ return iblockstate1.func_177230_c() == Blocks.field_150391_bh ? true : (iblockstate1.func_177230_c() == Blocks.field_150346_d && iblockstate1.func_177229_b(BlockDirt.field_176386_a) == BlockDirt.DirtType.PODZOL ? true : p_180671_1_.func_175699_k(p_180671_2_) < 13 && iblockstate1.func_177230_c().canSustainPlant(p_180671_1_, p_180671_2_.func_177977_b(), net.minecraft.util.EnumFacing.UP, this));
}
else
{

View File

@ -1,20 +1,20 @@
--- ../src-base/minecraft/net/minecraft/block/BlockMycelium.java
+++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java
@@ -37,7 +37,7 @@
@@ -39,7 +39,7 @@
{
if (!p_149674_1_.field_72995_K)
if (!p_180650_1_.field_72995_K)
{
- if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ + 1, p_149674_4_).func_149717_k() > 2)
+ if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 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().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)
{
p_149674_1_.func_147449_b(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.field_150346_d);
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));
}
@@ -50,7 +50,7 @@
int k1 = p_149674_4_ + p_149674_5_.nextInt(3) - 1;
Block block = p_149674_1_.func_147439_a(i1, j1 + 1, k1);
@@ -53,7 +53,7 @@
IBlockState iblockstate1 = p_180650_1_.func_180495_p(blockpos1);
Block block = p_180650_1_.func_180495_p(blockpos1.func_177984_a()).func_177230_c();
- if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && block.func_149717_k() <= 2)
+ if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
{
p_149674_1_.func_147449_b(i1, j1, k1, this);
}
- 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(blockpos1.func_177984_a()) >= 4 && block.func_149717_k() <= 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(blockpos1.func_177984_a()) >= 4 && block.getLightOpacity(p_180650_1_, blockpos1.func_177984_a()) <= 2)
{
p_180650_1_.func_175656_a(blockpos1, this.func_176223_P());
}

View File

@ -1,58 +1,42 @@
--- ../src-base/minecraft/net/minecraft/block/BlockNetherWart.java
+++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java
@@ -2,6 +2,7 @@
@@ -36,7 +36,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -11,6 +12,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
public class BlockNetherWart extends BlockBush
{
@@ -33,7 +35,7 @@
public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
{
- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_));
+ return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_);
- return this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c());
+ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_);
}
public void func_149674_a(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
@@ -60,9 +62,12 @@
return 6;
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
@@ -52,9 +52,11 @@
super.func_180650_b(p_180650_1_, p_180650_2_, p_180650_3_, p_180650_4_);
}
+ @SuppressWarnings("unused")
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_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_149690_1_.field_72995_K)
+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
+
+ if (false && !p_149690_1_.field_72995_K)
- if (!p_180653_1_.field_72995_K)
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
+ if (false && !p_180653_1_.field_72995_K)
{
int j1 = 1;
int j = 1;
@@ -109,4 +114,23 @@
this.field_149883_a[i] = p_149651_1_.func_94245_a(this.func_149641_N() + "_stage_" + i);
}
@@ -105,4 +107,24 @@
{
return new BlockState(this, new IProperty[] {field_176486_a});
}
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
+ public java.util.List<ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
+ Random rand = world instanceof World ? ((World)world).field_73012_v : new Random();
+ int count = 1;
+
+ if (metadata >= 3)
+ if (((Integer)state.func_177229_b(field_176486_a)) >= 3)
+ {
+ count = 2 + world.field_73012_v.nextInt(3) + (fortune > 0 ? world.field_73012_v.nextInt(fortune + 1) : 0);
+ count = 2 + rand.nextInt(3) + (fortune > 0 ? rand.nextInt(fortune + 1) : 0);
+ }
+
+ for (int i = 0; i < count; i++)

View File

@ -0,0 +1,24 @@
--- ../src-base/minecraft/net/minecraft/block/BlockNewLeaf.java
+++ ../src-work/minecraft/net/minecraft/block/BlockNewLeaf.java
@@ -105,14 +105,15 @@
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_)
{
- 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_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_);
}
}
+
+ @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)));
+ }
}

View File

@ -1,24 +1,23 @@
--- ../src-base/minecraft/net/minecraft/block/BlockNote.java
+++ ../src-work/minecraft/net/minecraft/block/BlockNote.java
@@ -45,7 +45,9 @@
if (tileentitynote != null)
@@ -58,7 +58,9 @@
if (tileentity instanceof TileEntityNote)
{
TileEntityNote tileentitynote = (TileEntityNote)tileentity;
+ int old = tileentitynote.field_145879_a;
tileentitynote.func_145877_a();
+ if (old == tileentitynote.field_145879_a) return false;
tileentitynote.func_145878_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_);
tileentitynote.func_175108_a(p_180639_1_, p_180639_2_);
}
@@ -73,6 +75,11 @@
@@ -96,6 +98,10 @@
public boolean func_149696_a(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_)
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_)
{
+ int meta = p_149696_1_.func_72805_g(p_149696_2_, p_149696_3_, p_149696_4_);
+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, meta, p_149696_6_, p_149696_5_);
+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_180648_1_, p_180648_2_, p_180648_3_, p_180648_5_, p_180648_4_);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false;
+ p_149696_5_ = e.instrument.ordinal();
+ p_149696_6_ = e.getVanillaNoteId();
float f = (float)Math.pow(2.0D, (double)(p_149696_6_ - 12) / 12.0D);
String s = "harp";
+ 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_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

@ -0,0 +1,14 @@
--- ../src-base/minecraft/net/minecraft/block/BlockOldLeaf.java
+++ ../src-work/minecraft/net/minecraft/block/BlockOldLeaf.java
@@ -155,4 +155,11 @@
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
}
}
+
+ @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())));
+ }
}

View File

@ -1,58 +1,59 @@
--- ../src-base/minecraft/net/minecraft/block/BlockOre.java
+++ ../src-work/minecraft/net/minecraft/block/BlockOre.java
@@ -7,6 +7,7 @@
import net.minecraft.init.Items;
@@ -10,6 +10,7 @@
import net.minecraft.item.Item;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MathHelper;
+import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockOre extends Block
@@ -51,34 +52,40 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
@@ -54,34 +55,40 @@
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_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
-
- if (this.func_180660_a(p_180653_3_, p_180653_1_.field_73012_v, p_180653_5_) != Item.func_150898_a(this))
+ }
- if (this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_) != Item.func_150898_a(this))
+ private Random rand = new Random();
+ @Override
+ public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_)
+ public int getExpDrop(IBlockAccess world, BlockPos pos, int fortune)
+ {
+ if (this.func_149650_a(p_149690_5_, rand, p_149690_7_) != Item.func_150898_a(this))
+ 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))
{
int j1 = 0;
int j = 0;
if (this == Blocks.field_150365_q)
{
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 0, 2);
+ j1 = MathHelper.func_76136_a(rand, 0, 2);
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 0, 2);
+ j = MathHelper.func_76136_a(rand, 0, 2);
}
else if (this == Blocks.field_150482_ag)
{
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 3, 7);
+ j1 = MathHelper.func_76136_a(rand, 3, 7);
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7);
+ j = MathHelper.func_76136_a(rand, 3, 7);
}
else if (this == Blocks.field_150412_bA)
{
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 3, 7);
+ j1 = MathHelper.func_76136_a(rand, 3, 7);
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 3, 7);
+ j = MathHelper.func_76136_a(rand, 3, 7);
}
else if (this == Blocks.field_150369_x)
{
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 2, 5);
+ j1 = MathHelper.func_76136_a(rand, 2, 5);
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5);
+ j = MathHelper.func_76136_a(rand, 2, 5);
}
else if (this == Blocks.field_150449_bY)
{
- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 2, 5);
+ j1 = MathHelper.func_76136_a(rand, 2, 5);
- j = MathHelper.func_76136_a(p_180653_1_.field_73012_v, 2, 5);
+ j = MathHelper.func_76136_a(rand, 2, 5);
}
- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1);
+ return j1;
- this.func_180637_b(p_180653_1_, p_180653_2_, j);
+ return j;
}
+ return 0;
}
public int func_149692_a(int p_149692_1_)
public int func_176222_j(World p_176222_1_, BlockPos p_176222_2_)

View File

@ -1,52 +1,41 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPane.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPane.java
@@ -15,6 +15,8 @@
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import static net.minecraftforge.common.util.ForgeDirection.*;
@@ -39,7 +39,10 @@
public class BlockPane extends Block
{
@@ -62,10 +64,10 @@
public void func_149743_a(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_)
public IBlockState func_176221_a(IBlockState p_176221_1_, IBlockAccess p_176221_2_, BlockPos p_176221_3_)
{
- boolean flag = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_, p_149743_3_, p_149743_4_ - 1));
- boolean flag1 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_, p_149743_3_, p_149743_4_ + 1));
- boolean flag2 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_ - 1, p_149743_3_, p_149743_4_));
- boolean flag3 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_ + 1, p_149743_3_, p_149743_4_));
+ boolean flag = this.canPaneConnectTo(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_ - 1, NORTH);
+ boolean flag1 = this.canPaneConnectTo(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_ + 1, SOUTH);
+ boolean flag2 = this.canPaneConnectTo(p_149743_1_, p_149743_2_ - 1, p_149743_3_, p_149743_4_, WEST );
+ boolean flag3 = this.canPaneConnectTo(p_149743_1_, p_149743_2_ + 1, p_149743_3_, p_149743_4_, EAST );
- return p_176221_1_.func_177226_a(field_176241_b, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177978_c()).func_177230_c()))).func_177226_a(field_176243_N, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177968_d()).func_177230_c()))).func_177226_a(field_176244_O, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177976_e()).func_177230_c()))).func_177226_a(field_176242_M, Boolean.valueOf(this.func_150098_a(p_176221_2_.func_180495_p(p_176221_3_.func_177974_f()).func_177230_c())));
+ return p_176221_1_.func_177226_a(field_176241_b, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.NORTH))
+ .func_177226_a(field_176243_N, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.SOUTH))
+ .func_177226_a(field_176244_O, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.WEST))
+ .func_177226_a(field_176242_M, canPaneConnectTo(p_176221_2_, p_176221_3_, EnumFacing.EAST));
}
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
@@ -65,10 +68,10 @@
public void func_180638_a(World p_180638_1_, BlockPos p_180638_2_, IBlockState p_180638_3_, AxisAlignedBB p_180638_4_, List p_180638_5_, Entity p_180638_6_)
{
- 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))
{
@@ -117,10 +119,10 @@
float f1 = 0.5625F;
float f2 = 0.4375F;
float f3 = 0.5625F;
- boolean flag = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_, p_149719_3_, p_149719_4_ - 1));
- boolean flag1 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_, p_149719_3_, p_149719_4_ + 1));
- boolean flag2 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_ - 1, p_149719_3_, p_149719_4_));
- boolean flag3 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_ + 1, p_149719_3_, p_149719_4_));
+ boolean flag = this.canPaneConnectTo(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ - 1, NORTH);
+ boolean flag1 = this.canPaneConnectTo(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ + 1, SOUTH);
+ boolean flag2 = this.canPaneConnectTo(p_149719_1_, p_149719_2_ - 1, p_149719_3_, p_149719_4_, WEST );
+ boolean flag3 = this.canPaneConnectTo(p_149719_1_, p_149719_2_ + 1, p_149719_3_, p_149719_4_, EAST );
if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1))
{
@@ -186,4 +188,10 @@
this.field_149761_L = p_149651_1_.func_94245_a(this.field_150101_M);
this.field_150102_N = p_149651_1_.func_94245_a(this.field_150100_a);
@@ -187,4 +190,11 @@
{
return new BlockState(this, new IProperty[] {field_176241_b, field_176242_M, field_176244_O, field_176243_N});
}
+
+ public boolean canPaneConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir)
+ public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir)
+ {
+ return func_150098_a(world.func_147439_a(x, y, z)) ||
+ world.isSideSolid(x, y, z, dir.getOpposite(), false);
+ BlockPos off = pos.func_177972_a(dir.func_176734_d());
+ Block block = world.func_180495_p(off).func_177230_c();
+ return func_150098_a(block) || block.isSideSolid(world, pos, dir);
+ }
}

View File

@ -1,65 +1,31 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java
@@ -11,6 +11,7 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
+import net.minecraft.server.management.PlayerManager;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityPiston;
import net.minecraft.util.AxisAlignedBB;
@@ -360,7 +361,8 @@
return false;
}
- return !(p_150080_0_ instanceof ITileEntityProvider);
+ return !(p_150080_1_.func_147439_a(p_150080_2_, p_150080_3_, p_150080_4_).hasTileEntity(p_150080_1_.func_72805_g(p_150080_2_, p_150080_3_, p_150080_4_)));
+
}
}
@@ -375,14 +377,14 @@
{
if (l1 < 13)
{
- if (j1 <= 0 || j1 >= 255)
+ if (j1 <= 0 || j1 >= p_150077_0_.func_72800_K())
{
return false;
}
Block block = p_150077_0_.func_147439_a(i1, j1, k1);
- if (block.func_149688_o() != Material.field_151579_a)
+ if (!block.isAir(p_150077_0_, i1, j1, k1))
{
if (!func_150080_a(block, p_150077_0_, i1, j1, k1, true))
{
@@ -420,14 +422,14 @@
{
if (l1 < 13)
{
- if (j1 <= 0 || j1 >= 255)
+ if (j1 <= 0 || j1 >= p_150079_1_.func_72800_K())
{
return false;
}
Block block = p_150079_1_.func_147439_a(i1, j1, k1);
- if (block.func_149688_o() != Material.field_151579_a)
+ if (!block.isAir(p_150079_1_, i1, j1, k1))
{
if (!func_150080_a(block, p_150079_1_, i1, j1, k1, true))
{
@@ -448,7 +450,9 @@
continue;
@@ -200,7 +200,7 @@
}
- block.func_149697_b(p_150079_1_, i1, j1, k1, p_150079_1_.func_72805_g(i1, j1, k1), 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_149690_a(p_150079_1_, i1, j1, k1, p_150079_1_.func_72805_g(i1, j1, k1), chance, 0);
p_150079_1_.func_147468_f(i1, j1, k1);
}
- if (!flag1 && block.func_149688_o() != Material.field_151579_a && func_180696_a(block, p_180648_1_, blockpos1, 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_, blockpos1) && func_180696_a(block, p_180648_1_, blockpos1, enumfacing.func_176734_d(), false) && (block.func_149656_h() == 0 || block == Blocks.field_150331_J || block == Blocks.field_150320_F))
{
this.func_176319_a(p_180648_1_, p_180648_2_, enumfacing, false);
}
@@ -344,7 +344,7 @@
return false;
}
- return !(p_180696_0_ instanceof ITileEntityProvider);
+ return !(p_180696_0_.hasTileEntity(p_180696_1_.func_180495_p(p_180696_2_)));
}
else
{
@@ -384,7 +384,9 @@
{
blockpos1 = (BlockPos)list1.get(j);
Block block = p_176319_1_.func_180495_p(blockpos1).func_177230_c();
- block.func_176226_b(p_176319_1_, blockpos1, p_176319_1_.func_180495_p(blockpos1), 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_, blockpos1, p_176319_1_.func_180495_p(blockpos1), chance, 0);
p_176319_1_.func_175698_g(blockpos1);
--i;
ablock[i] = block;

View File

@ -1,47 +1,37 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPistonMoving.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPistonMoving.java
@@ -2,11 +2,13 @@
@@ -110,16 +110,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityPiston;
import net.minecraft.util.AxisAlignedBB;
@@ -90,15 +92,7 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_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_149690_1_.field_72995_K)
- if (!p_180653_1_.field_72995_K)
- {
- TileEntityPiston tileentitypiston = this.func_149963_e(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_);
- TileEntityPiston tileentitypiston = this.func_176422_e(p_180653_1_, p_180653_2_);
-
- if (tileentitypiston != null)
- {
- tileentitypiston.func_145861_a().func_149697_b(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, tileentitypiston.func_145832_p(), 0);
- IBlockState iblockstate1 = tileentitypiston.func_174927_b();
- iblockstate1.func_177230_c().func_176226_b(p_180653_1_, p_180653_2_, iblockstate1, 0);
- }
- }
+ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
+ super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
}
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
@@ -231,4 +225,13 @@
public MovingObjectPosition func_180636_a(World p_180636_1_, BlockPos p_180636_2_, Vec3 p_180636_3_, Vec3 p_180636_4_)
@@ -283,4 +274,16 @@
{
this.field_149761_L = p_149651_1_.func_94245_a("piston_top_normal");
return new BlockState(this, new IProperty[] {field_176426_a, field_176425_b});
}
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
+ public java.util.List<net.minecraft.item.ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ TileEntityPiston te = this.func_149963_e(world, x, y, z);
+ if (te != null)
+ return te.func_145861_a().getDrops(world, x, y, z, te.func_145832_p(), 0);
+ return new ArrayList<ItemStack>();
+ TileEntityPiston tileentitypiston = this.func_176422_e(world, pos);
+ if (tileentitypiston != null)
+ {
+ IBlockState pushed = tileentitypiston.func_174927_b();
+ return pushed.func_177230_c().getDrops(world, pos, pushed, fortune);
+ }
+ return new java.util.ArrayList();
+ }
}

View File

@ -1,32 +1,25 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPotato.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPotato.java
@@ -1,5 +1,6 @@
package net.minecraft.block;
+import java.util.ArrayList;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -46,14 +47,15 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
@@ -24,13 +24,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_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
+ }
- if (!p_149690_1_.field_72995_K)
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 (p_149690_5_ >= 7 && p_149690_1_.field_73012_v.nextInt(50) == 0)
- if (((Integer)p_180653_3_.func_177229_b(field_176488_a)).intValue() >= 7 && p_180653_1_.field_73012_v.nextInt(50) == 0)
- {
- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.field_151170_bI));
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(Items.field_151170_bI));
- }
- }
}
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
+ public java.util.List<net.minecraft.item.ItemStack> getDrops(net.minecraft.world.IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ ArrayList<ItemStack> ret = super.getDrops(world, x, y, z, metadata, fortune);
+ if (metadata >= 7 && world.field_73012_v.nextInt(50) == 0)
+ 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)
+ ret.add(new ItemStack(Items.field_151170_bI));
+ return ret;
}
@SideOnly(Side.CLIENT)
+ }
}

View File

@ -1,11 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockPumpkin.java
+++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java
@@ -113,7 +113,7 @@
@@ -109,7 +109,7 @@
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
- return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).field_149764_J.func_76222_j() && World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_);
+ return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).isReplaceable(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_);
- 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());
}
public void func_149689_a(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_)
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

@ -1,109 +1,51 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java
@@ -5,6 +5,7 @@
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.init.Blocks;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovingObjectPosition;
@@ -25,7 +26,7 @@
public static final boolean func_150051_a(Block p_150051_0_)
@@ -33,7 +33,7 @@
public static boolean func_176563_d(IBlockState p_176563_0_)
{
- return p_150051_0_ == Blocks.field_150448_aq || p_150051_0_ == Blocks.field_150318_D || p_150051_0_ == Blocks.field_150319_E || p_150051_0_ == Blocks.field_150408_cc;
+ return p_150051_0_ instanceof BlockRailBase;
Block block = p_176563_0_.func_177230_c();
- return block == Blocks.field_150448_aq || block == Blocks.field_150318_D || block == Blocks.field_150319_E || block == Blocks.field_150408_cc;
+ return block instanceof BlockRailBase;
}
protected BlockRailBase(boolean p_i45389_1_)
@@ -78,7 +79,7 @@
public int func_149645_b()
{
- return 9;
+ return renderType;
}
public int func_149745_a(Random p_149745_1_)
@@ -193,6 +194,111 @@
}
@@ -174,7 +174,56 @@
}
public abstract IProperty func_176560_l();
+ /* ======================================== FORGE START =====================================*/
+ /**
+ * Return true if the rail can make corners.
+ * Used by placement logic.
+ * @param world The world.
+ * @param x The rail X coordinate.
+ * @param y The rail Y coordinate.
+ * @param z The rail Z coordinate.
+ * @param pod Block's position in world
+ * @return True if the rail can make corners.
+ */
+ public boolean isFlexibleRail(IBlockAccess world, int y, int x, int z)
+ public boolean isFlexibleRail(IBlockAccess world, BlockPos pos)
+ {
+ return !func_150050_e();
+ return !this.field_150053_a;
+ }
+
+ /**
+ * Returns true if the rail can make up and down slopes.
+ * Used by placement logic.
+ * @param world The world.
+ * @param x The rail X coordinate.
+ * @param y The rail Y coordinate.
+ * @param z The rail Z coordinate.
+ * @param pod Block's position in world
+ * @return True if the rail can make slopes.
+ */
+ public boolean canMakeSlopes(IBlockAccess world, int x, int y, int z)
+ public boolean canMakeSlopes(IBlockAccess world, BlockPos pos)
+ {
+ return true;
+ }
+
+ /**
+ * Return the rail's metadata (without the power bit if the rail uses one).
+ * Can be used to make the cart think the rail something other than it is,
+ * for example when making diamond junctions or switches.
+ * The cart parameter will often be null unless it it called from EntityMinecart.
+ *
+ * Valid rail metadata is defined as follows:
+ * 0x0: flat track going North-South
+ * 0x1: flat track going West-East
+ * 0x2: track ascending to the East
+ * 0x3: track ascending to the West
+ * 0x4: track ascending to the North
+ * 0x5: track ascending to the South
+ * 0x6: WestNorth corner (connecting East and South)
+ * 0x7: EastNorth corner (connecting West and South)
+ * 0x8: EastSouth corner (connecting West and North)
+ * 0x9: WestSouth corner (connecting East and North)
+ *
+ * @param world The world.
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
+ * @param y The rail X coordinate.
+ * @param x The rail Y coordinate.
+ * @param z The rail Z coordinate.
+ * @return The metadata.
+ */
+ public int getBasicRailMetadata(IBlockAccess world, EntityMinecart cart, int x, int y, int z)
+ {
+ int meta = world.func_72805_g(x, y, z);
+ if(func_150050_e())
+ {
+ meta = meta & 7;
+ }
+ return meta;
+ }
+
+ /**
+ * Returns the max speed of the rail at the specified position.
+ * @param world The world.
+ * @param cart The cart on the rail, may be null.
+ * @param x The rail X coordinate.
+ * @param y The rail Y coordinate.
+ * @param z The rail Z coordinate.
+ * @param pod Block's position in world
+ * @return The max speed of the current rail.
+ */
+ public float getRailMaxSpeed(World world, EntityMinecart cart, int y, int x, int z)
+ public float getRailMaxSpeed(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
+ {
+ return 0.4f;
+ }
@ -113,96 +55,68 @@
+ * It is called once per update tick that the minecart is on the rail.
+ * @param world The world.
+ * @param cart The cart on the rail.
+ * @param y The rail X coordinate.
+ * @param x The rail Y coordinate.
+ * @param z The rail Z coordinate.
+ * @param pod Block's position in world
+ */
+ public void onMinecartPass(World world, EntityMinecart cart, int y, int x, int z)
+ public void onMinecartPass(World world, net.minecraft.entity.item.EntityMinecart cart, BlockPos pos)
+ {
+ }
+
+ /**
+ * Forge: Moved render type to a field and a setter.
+ * This allows for a mod to change the render type
+ * for vanilla rails, and any mod rails that extend
+ * this class.
+ */
+ private int renderType = 9;
+
+ public void setRenderType(int value)
+ {
+ renderType = value;
+ }
+
+ /* ======================================== FORGE END =====================================*/
+
public class Rail
public static enum EnumRailDirection implements IStringSerializable
{
private World field_150660_b;
@@ -202,6 +308,7 @@
NORTH_SOUTH(0, "north_south"),
@@ -251,6 +300,7 @@
private final boolean field_150656_f;
private List field_150657_g = new ArrayList();
private final List field_150657_g = Lists.newArrayList();
private static final String __OBFID = "CL_00000196";
+ private final boolean canMakeSlopes;
public Rail(World p_i45388_2_, int p_i45388_3_, int p_i45388_4_, int p_i45388_5_)
public Rail(World p_i45739_2_, BlockPos p_i45739_3_, IBlockState p_i45739_4_)
{
@@ -209,19 +316,10 @@
this.field_150661_c = p_i45388_3_;
this.field_150658_d = p_i45388_4_;
this.field_150659_e = p_i45388_5_;
- Block block = p_i45388_2_.func_147439_a(p_i45388_3_, p_i45388_4_, p_i45388_5_);
- int l = p_i45388_2_.func_72805_g(p_i45388_3_, p_i45388_4_, p_i45388_5_);
-
- if (((BlockRailBase)block).field_150053_a)
- {
- this.field_150656_f = true;
- l &= -9;
- }
- else
- {
- this.field_150656_f = false;
- }
-
+ BlockRailBase block = (BlockRailBase)p_i45388_2_.func_147439_a(p_i45388_3_, p_i45388_4_, p_i45388_5_);
+ int l = block.getBasicRailMetadata(p_i45388_2_, null, p_i45388_3_, p_i45388_4_, p_i45388_5_);
+ this.field_150656_f = !block.isFlexibleRail(p_i45388_2_, p_i45388_3_, p_i45388_4_, p_i45388_5_);
+ canMakeSlopes = block.canMakeSlopes(p_i45388_2_, p_i45388_3_, p_i45388_4_, p_i45388_5_);
this.func_150648_a(l);
@@ -259,7 +309,8 @@
this.field_180366_e = p_i45739_4_;
this.field_180365_d = (BlockRailBase)p_i45739_4_.func_177230_c();
BlockRailBase.EnumRailDirection enumraildirection = (BlockRailBase.EnumRailDirection)p_i45739_4_.func_177229_b(BlockRailBase.this.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.func_180360_a(enumraildirection);
}
@@ -412,7 +510,7 @@
@@ -448,7 +499,7 @@
}
}
- if (b0 == 0)
+ if (b0 == 0 && canMakeSlopes)
- if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
+ if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
{
if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1))
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
{
@@ -425,7 +523,7 @@
@@ -461,7 +512,7 @@
}
}
- if (b0 == 1)
+ if (b0 == 1 && canMakeSlopes)
- if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
+ if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes)
{
if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e))
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a()))
{
@@ -570,7 +668,7 @@
@@ -604,7 +655,7 @@
}
}
- if (b0 == 0)
+ if (b0 == 0 && canMakeSlopes)
- if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
+ if (enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH && canMakeSlopes)
{
if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1))
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos.func_177984_a()))
{
@@ -583,7 +681,7 @@
@@ -617,7 +668,7 @@
}
}
- if (b0 == 1)
+ if (b0 == 1 && canMakeSlopes)
- if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
+ if (enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST && canMakeSlopes)
{
if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e))
if (BlockRailBase.func_176562_d(this.field_150660_b, blockpos3.func_177984_a()))
{

View File

@ -1,22 +1,24 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneComparator.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneComparator.java
@@ -228,4 +228,19 @@
{
return new TileEntityComparator();
@@ -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);
}
+ @Override
+ public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor)
+ {
+ if (pos.func_177956_o() == neighbor.func_177956_o() && world instanceof World)
+ {
+ func_176204_a((World)world, pos, world.func_180495_p(neighbor), world.func_180495_p(neighbor).func_177230_c());
+ }
+ }
+
+ @Override
+ public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ)
+ {
+ if (y == tileY && world instanceof World)
+ {
+ func_149695_a((World)world, x, y, z, world.func_147439_a(tileX, tileY, tileZ));
+ }
+ }
+
+ @Override
+ public boolean getWeakChanges(IBlockAccess world, int x, int y, int z)
+ public boolean getWeakChanges(IBlockAccess world, BlockPos pos)
+ {
+ return true;
+ }
}
+
public static enum Mode implements IStringSerializable
{
COMPARE("compare"),

View File

@ -1,29 +1,20 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java
@@ -10,6 +10,7 @@
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
+import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockRedstoneOre extends Block
@@ -88,12 +89,17 @@
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
@@ -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_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
super.func_180653_a(p_180653_1_, p_180653_2_, p_180653_3_, p_180653_4_, p_180653_5_);
+ }
- if (this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_) != Item.func_150898_a(this))
+ private Random rand = new Random();
+ @Override // World, meta, fortune
+ public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_)
- 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)
+ {
+ if (this.func_149650_a(p_149690_5_, rand, p_149690_7_) != Item.func_150898_a(this))
+ if (this.func_180660_a(world.func_180495_p(pos), RANDOM, fortune) != Item.func_150898_a(this))
{
- int j1 = 1 + p_149690_1_.field_73012_v.nextInt(5);
- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1);
+ return 1 + rand.nextInt(5);
- int j = 1 + p_180653_1_.field_73012_v.nextInt(5);
- this.func_180637_b(p_180653_1_, p_180653_2_, j);
+ return 1 + RANDOM.nextInt(5);
}
+ return 0;
}

View File

@ -1,11 +1,59 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java
@@ -405,7 +405,7 @@
}
else if (!Blocks.field_150413_aR.func_149907_e(block))
@@ -60,10 +60,10 @@
BlockPos blockpos1 = 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();
- if (!func_176343_a(p_176341_1_.func_180495_p(blockpos1), p_176341_3_) && (block.func_149637_q() || !func_176346_d(p_176341_1_.func_180495_p(blockpos1.func_177977_b()))))
+ if (!canRestoneConnect(p_176341_1_, blockpos1, p_176341_3_) && (block.func_149637_q() || !canRestoneConnect(p_176341_1_, blockpos1.func_177977_b(), null)))
{
- return block.func_149744_f() && p_150174_4_ != -1;
+ return block.canConnectRedstone(p_150174_0_, p_150174_1_, p_150174_2_, p_150174_3_, p_150174_4_);
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(blockpos1.func_177984_a())) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE;
+ return !block1.func_149637_q() && block.func_149637_q() && canRestoneConnect(p_176341_1_, blockpos1.func_177984_a(), null) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE;
}
else
{
@@ -393,35 +393,25 @@
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_, blockpos1.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_, blockpos1.func_177977_b())));
+ return !flag1 && flag && canRestoneConnect(p_176339_1_, blockpos1.func_177984_a(), null) ? true : (canRestoneConnect(p_176339_1_, blockpos1, 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_, blockpos1.func_177977_b(), null)));
}
- protected static boolean func_176340_e(IBlockAccess p_176340_0_, BlockPos p_176340_1_)
+ protected static boolean canRestoneConnect(IBlockAccess world, BlockPos pos, EnumFacing side)
{
- return func_176346_d(p_176340_0_.func_180495_p(p_176340_1_));
- }
+ IBlockState state = world.func_180495_p(pos);
- protected static boolean func_176346_d(IBlockState p_176346_0_)
- {
- return func_176343_a(p_176346_0_, (EnumFacing)null);
- }
-
- 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)
+ if (state.func_177230_c() == 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()))
{
- EnumFacing enumfacing1 = (EnumFacing)p_176343_0_.func_177229_b(BlockRedstoneRepeater.field_176387_N);
- return enumfacing1 == p_176343_1_ || enumfacing1.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;
}
else
{
- return block.func_149744_f() && p_176343_1_ != null;
+ return state.func_177230_c().canConnectRedstone(world, pos, side);
}
}

View File

@ -1,47 +1,35 @@
--- ../src-base/minecraft/net/minecraft/block/BlockReed.java
+++ ../src-work/minecraft/net/minecraft/block/BlockReed.java
@@ -11,7 +11,11 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -19,7 +19,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockReed extends Block
+import net.minecraftforge.common.EnumPlantType;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.common.IPlantable;
+
+public class BlockReed extends Block implements IPlantable
+public class BlockReed extends Block implements net.minecraftforge.common.IPlantable
{
public static final PropertyInteger field_176355_a = PropertyInteger.func_177719_a("age", 0, 15);
private static final String __OBFID = "CL_00000300";
@@ -57,7 +61,7 @@
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
@@ -67,6 +67,7 @@
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
{
Block block = p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_);
- return block == this ? true : (block != Blocks.field_150349_c && block != Blocks.field_150346_d && block != Blocks.field_150354_m ? false : (p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_ - 1, p_149742_4_).func_149688_o() == Material.field_151586_h ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_ - 1, p_149742_4_).func_149688_o() == Material.field_151586_h ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_ - 1).func_149688_o() == Material.field_151586_h ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_ + 1).func_149688_o() == Material.field_151586_h))));
+ return block.canSustainPlant(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_, ForgeDirection.UP, this);
}
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_, EnumFacing.UP, this)) return true;
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
@@ -120,4 +124,22 @@
if (block == this)
{
@@ -172,4 +173,15 @@
{
return p_149720_1_.func_72807_a(p_149720_2_, p_149720_4_).func_150558_b(p_149720_2_, p_149720_3_, p_149720_4_);
return new BlockState(this, new IProperty[] {field_176355_a});
}
+
+ @Override
+ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
+ public net.minecraftforge.common.EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
+ {
+ return EnumPlantType.Beach;
+ return net.minecraftforge.common.EnumPlantType.Beach;
+ }
+
+ @Override
+ public Block getPlant(IBlockAccess world, int x, int y, int z)
+ public IBlockState getPlant(IBlockAccess world, BlockPos pos)
+ {
+ return this;
+ }
+
+ @Override
+ public int getPlantMetadata(IBlockAccess world, int x, int y, int z)
+ {
+ return world.func_72805_g(x, y, z);
+ return this.func_176223_P();
+ }
}

View File

@ -1,10 +1,10 @@
--- ../src-base/minecraft/net/minecraft/block/BlockSapling.java
+++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java
@@ -71,6 +71,7 @@
@@ -66,6 +66,7 @@
public void func_149878_d(World p_149878_1_, int p_149878_2_, int p_149878_3_, int p_149878_4_, Random p_149878_5_)
public void func_176476_e(World p_176476_1_, BlockPos p_176476_2_, IBlockState p_176476_3_, Random p_176476_4_)
{
+ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(p_149878_1_, p_149878_5_, p_149878_2_, p_149878_3_, p_149878_4_)) return;
int l = p_149878_1_.func_72805_g(p_149878_2_, p_149878_3_, p_149878_4_) & 7;
Object object = p_149878_5_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true);
int i1 = 0;
+ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(p_176476_1_, p_176476_4_, p_176476_2_)) return;
Object object = p_176476_4_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true);
int i = 0;
int j = 0;

View File

@ -1,63 +1,55 @@
--- ../src-base/minecraft/net/minecraft/block/BlockSkull.java
+++ ../src-work/minecraft/net/minecraft/block/BlockSkull.java
@@ -2,6 +2,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Iterator;
import java.util.Random;
import net.minecraft.block.material.Material;
@@ -109,8 +110,6 @@
return p_149692_1_;
@@ -122,8 +122,6 @@
return tileentity instanceof TileEntitySkull ? ((TileEntitySkull)tileentity).func_145904_a() : super.func_176222_j(p_176222_1_, p_176222_2_);
}
- public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_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_) {}
-
public void func_149681_a(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_)
public void func_176208_a(World p_176208_1_, BlockPos p_176208_2_, IBlockState p_176208_3_, EntityPlayer p_176208_4_)
{
if (p_149681_6_.field_71075_bZ.field_75098_d)
@@ -118,19 +117,28 @@
p_149681_5_ |= 8;
p_149681_1_.func_72921_c(p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 4);
if (p_176208_4_.field_71075_bZ.field_75098_d)
@@ -131,13 +129,18 @@
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);
}
+ this.func_149697_b(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 0);
+ this.func_176226_b(p_176208_1_, p_176208_2_, p_176208_3_, 0);
super.func_149681_a(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_);
super.func_176208_a(p_176208_1_, p_176208_2_, p_176208_3_, p_176208_4_);
}
public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
public void func_180663_b(World p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_)
{
- if (!p_149749_1_.field_72995_K)
+ super.func_149749_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
- if (!p_180663_1_.field_72995_K)
+ super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
+ }
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, int p_149749_6_, int fortune)
+ public java.util.List<ItemStack> getDrops(IBlockAccess p_180663_1_, BlockPos p_180663_2_, IBlockState p_180663_3_, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
{
if ((p_149749_6_ & 8) == 0)
if (!((Boolean)p_180663_3_.func_177229_b(field_176417_b)).booleanValue())
{
ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, this.func_149643_k(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_));
TileEntitySkull tileentityskull = (TileEntitySkull)p_149749_1_.func_147438_o(p_149749_2_, p_149749_3_, p_149749_4_);
+ if (tileentityskull == null) return ret;
+
if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_152108_a() != null)
@@ -146,7 +149,7 @@
if (tileentity instanceof TileEntitySkull)
{
itemstack.func_77982_d(new NBTTagCompound());
@@ -139,11 +147,10 @@
itemstack.func_77978_p().func_74782_a("SkullOwner", nbttagcompound);
}
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 = new ItemStack(Items.field_151144_bL, 1, tileentityskull.func_145904_a());
- this.func_149642_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, itemstack);
+ ret.add(itemstack);
if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_152108_a() != null)
{
@@ -156,12 +159,11 @@
itemstack.func_77978_p().func_74782_a("SkullOwner", nbttagcompound);
}
- func_180635_a(p_180663_1_, p_180663_2_, itemstack);
+ ret.add(itemstack);
}
}
-
- super.func_149749_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
- super.func_180663_b(p_180663_1_, p_180663_2_, p_180663_3_);
}
+ return ret;
}
public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)

View File

@ -1,35 +1,34 @@
--- ../src-base/minecraft/net/minecraft/block/BlockSnow.java
+++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java
@@ -73,7 +73,7 @@
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
@@ -80,7 +80,7 @@
{
Block block = p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_);
- return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.func_149688_o() == Material.field_151584_j ? true : (block == this && (p_149742_1_.func_72805_g(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 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_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : (block == this && (p_149742_1_.func_72805_g(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false;
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;
}
public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
@@ -85,7 +85,6 @@
public void func_176204_a(World p_176204_1_, BlockPos p_176204_2_, IBlockState p_176204_3_, Block p_176204_4_)
@@ -92,7 +92,6 @@
{
if (!this.func_149742_c(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_))
if (!this.func_176196_c(p_176314_1_, p_176314_2_))
{
- this.func_149697_b(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_, p_150155_1_.func_72805_g(p_150155_2_, p_150155_3_, p_150155_4_), 0);
p_150155_1_.func_147468_f(p_150155_2_, p_150155_3_, p_150155_4_);
- this.func_176226_b(p_176314_1_, p_176314_2_, p_176314_3_, 0);
p_176314_1_.func_175698_g(p_176314_2_);
return false;
}
@@ -97,10 +96,8 @@
@@ -104,9 +103,8 @@
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_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_)
{
- int i1 = p_149636_6_ & 7;
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Items.field_151126_ay, i1 + 1, 0));
+ super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
p_149636_1_.func_147468_f(p_149636_3_, p_149636_4_, p_149636_5_);
- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
- 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_);
p_180657_1_.func_175698_g(p_180657_3_);
- p_180657_2_.func_71029_a(StatList.field_75934_C[Block.func_149682_b(this)]);
}
public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
@@ -110,14 +107,13 @@
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
@@ -116,14 +114,13 @@
public int func_149745_a(Random p_149745_1_)
{
@ -37,46 +36,18 @@
+ return 1;
}
public void func_149674_a(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
public void func_180650_b(World p_180650_1_, BlockPos p_180650_2_, IBlockState p_180650_3_, Random p_180650_4_)
{
if (p_149674_1_.func_72972_b(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11)
if (p_180650_1_.func_175642_b(EnumSkyBlock.BLOCK, p_180650_2_) > 11)
{
- this.func_149697_b(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_1_.func_72805_g(p_149674_2_, p_149674_3_, p_149674_4_), 0);
p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_);
- this.func_176226_b(p_180650_1_, p_180650_2_, p_180650_1_.func_180495_p(p_180650_2_), 0);
p_180650_1_.func_175698_g(p_180650_2_);
}
}
@@ -127,4 +123,34 @@
@@ -153,4 +150,6 @@
{
return p_149646_5_ == 1 ? true : super.func_149646_a(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
return new BlockState(this, new IProperty[] {field_176315_a});
}
+
+ /**
+ * Metadata and fortune sensitive version, this replaces the old (int meta, Random rand)
+ * version in 1.1.
+ *
+ * @param meta Blocks Metadata
+ * @param fortune Current item fortune level
+ * @param random Random number generator
+ * @return The number of items to drop
+ */
+ public int quantityDropped(int meta, int fortune, Random random)
+ {
+ return (meta & 7) + 1;
+ }
+
+ /**
+ * Determines if a new block can be replace the space occupied by this one,
+ * Used in the player's placement code to make the block act like water, and lava.
+ *
+ * @param world The current world
+ * @param x X Position
+ * @param y Y position
+ * @param z Z position
+ * @return True if the block is replaceable by another block
+ */
+ public boolean isReplaceable(IBlockAccess world, int x, int y, int z)
+ {
+ int meta = world.func_72805_g(x, y, z);
+ return meta >= 7 ? false : field_149764_J.func_76222_j();
+ }
+ @Override public int quantityDropped(IBlockState state, int fortune, Random random){ return ((Integer)state.func_177229_b(field_176315_a)) + 1; }
}

View File

@ -1,79 +1,45 @@
--- ../src-base/minecraft/net/minecraft/block/BlockStem.java
+++ ../src-work/minecraft/net/minecraft/block/BlockStem.java
@@ -2,6 +2,7 @@
@@ -108,7 +108,7 @@
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();
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -14,6 +15,7 @@
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import static net.minecraftforge.common.util.ForgeDirection.*;
public class BlockStem extends BlockBush implements IGrowable
{
@@ -101,7 +103,7 @@
Block block = p_149674_1_.func_147439_a(j1, p_149674_3_ - 1, k1);
- if (p_149674_1_.func_147439_a(j1, p_149674_3_, k1).field_149764_J == Material.field_151579_a && (block == Blocks.field_150458_ak || block == Blocks.field_150346_d || block == Blocks.field_150349_c))
+ if (p_149674_1_.func_147437_c(j1, p_149674_3_, k1) && (block.canSustainPlant(p_149674_1_, j1, p_149674_3_ - 1, k1, UP, this) || block == Blocks.field_150346_d || block == Blocks.field_150349_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))
{
p_149674_1_.func_147449_b(j1, p_149674_3_, k1, this.field_149877_a);
p_180650_1_.func_175656_a(p_180650_2_, this.field_149877_a.func_176223_P());
}
@@ -144,11 +146,11 @@
Block block8 = p_149875_1_.func_147439_a(l, p_149875_3_ - 1, i1);
float f1 = 0.0F;
- if (block8 == Blocks.field_150458_ak)
+ if (block8.canSustainPlant(p_149875_1_, l, p_149875_3_ - 1, i1, UP, this))
{
f1 = 1.0F;
- if (p_149875_1_.func_72805_g(l, p_149875_3_ - 1, i1) > 0)
+ if (block8.isFertile(p_149875_1_, l, p_149875_3_ - 1, i1))
{
f1 = 3.0F;
}
@@ -211,11 +213,12 @@
return l < 7 ? -1 : (p_149873_1_.func_147439_a(p_149873_2_ - 1, p_149873_3_, p_149873_4_) == this.field_149877_a ? 0 : (p_149873_1_.func_147439_a(p_149873_2_ + 1, p_149873_3_, p_149873_4_) == this.field_149877_a ? 1 : (p_149873_1_.func_147439_a(p_149873_2_, p_149873_3_, p_149873_4_ - 1) == this.field_149877_a ? 2 : (p_149873_1_.func_147439_a(p_149873_2_, p_149873_3_, p_149873_4_ + 1) == this.field_149877_a ? 3 : -1))));
}
+ @SuppressWarnings("unused")
public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
@@ -162,24 +162,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_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);
- if (!p_149690_1_.field_72995_K)
+ if (false && !p_149690_1_.field_72995_K)
{
Item item = null;
@@ -282,4 +285,23 @@
{
this.func_149874_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_);
}
+
+
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+
+ Item item = null;
+ item = field_149877_a == Blocks.field_150423_aK ? Items.field_151080_bb : item;
+ item = field_149877_a == Blocks.field_150440_ba ? Items.field_151081_bc : item;
+
+ for (int i = 0; item != null && i < 3; i++)
+ {
+ if (world.field_73012_v.nextInt(15) <= meta)
+ ret.add(new ItemStack(item));
+ }
+
+ return ret;
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)
+ @Override
+ public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
{
Item item = this.func_176481_j();
if (item != null)
{
- int j = ((Integer)p_180653_3_.func_177229_b(field_176484_a)).intValue();
+ int j = ((Integer)state.func_177229_b(field_176484_a)).intValue();
for (int k = 0; k < 3; ++k)
{
- if (p_180653_1_.field_73012_v.nextInt(15) <= j)
+ if (RANDOM.nextInt(15) <= j)
{
- func_180635_a(p_180653_1_, p_180653_2_, new ItemStack(item));
+ ret.add(new ItemStack(item));
}
}
}
}
+ return ret;
}
protected Item func_176481_j()

View File

@ -1,83 +1,66 @@
--- ../src-base/minecraft/net/minecraft/block/BlockTallGrass.java
+++ ../src-work/minecraft/net/minecraft/block/BlockTallGrass.java
@@ -2,6 +2,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import net.minecraft.block.material.Material;
@@ -17,8 +18,10 @@
import net.minecraft.world.ColorizerGrass;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.common.ForgeHooks;
+import net.minecraftforge.common.IShearable;
@@ -23,7 +23,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockTallGrass extends BlockBush implements IGrowable
+public class BlockTallGrass extends BlockBush implements IGrowable, IShearable
+public class BlockTallGrass extends BlockBush implements IGrowable, net.minecraftforge.common.IShearable
{
private static final String[] field_149871_a = new String[] {"deadbush", "tallgrass", "fern"};
@SideOnly(Side.CLIENT)
@@ -53,7 +56,7 @@
public static final PropertyEnum field_176497_a = PropertyEnum.func_177709_a("type", BlockTallGrass.EnumType.class);
private static final String __OBFID = "CL_00000321";
@@ -44,7 +44,7 @@
public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_)
public boolean func_180671_f(World p_180671_1_, BlockPos p_180671_2_, IBlockState p_180671_3_)
{
- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_));
+ return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_);
- return this.func_149854_a(p_180671_1_.func_180495_p(p_180671_2_.func_177977_b()).func_177230_c());
+ return super.func_180671_f(p_180671_1_, p_180671_2_, p_180671_3_);
}
@SideOnly(Side.CLIENT)
@@ -71,7 +74,7 @@
public boolean func_176200_f(World p_176200_1_, BlockPos p_176200_2_)
@@ -74,7 +74,7 @@
public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
{
- return p_149650_2_.nextInt(8) == 0 ? Items.field_151014_N : null;
- return p_180660_2_.nextInt(8) == 0 ? Items.field_151014_N : null;
+ return null;
}
public int func_149679_a(int p_149679_1_, Random p_149679_2_)
@@ -81,13 +84,7 @@
@@ -84,13 +84,7 @@
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_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_)
{
- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
- 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_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150329_H, 1, p_149636_6_));
- 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_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
}
}
@@ -143,4 +140,28 @@
Blocks.field_150398_cm.func_149889_c(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, b0, 2);
@@ -210,4 +204,22 @@
}
}
}
+
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
+ @Override
+ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune)
+ public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ if (world.field_73012_v.nextInt(8) != 0) return ret;
+ ItemStack seed = ForgeHooks.getGrassSeed(world);
+ List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
+ ret.add(new ItemStack(Blocks.field_150329_H, 1, ((BlockTallGrass.EnumType)world.func_180495_p(pos).func_177229_b(field_176497_a)).func_177044_a()));
+ return ret;
+ }
+ @Override
+ public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
+ {
+ List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
+ if (RANDOM.nextInt(8) != 0) return ret;
+ ItemStack seed = net.minecraftforge.common.ForgeHooks.getGrassSeed(RANDOM);
+ if (seed != null) ret.add(seed);
+ return ret;
+ }
+
+ @Override
+ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z)
+ {
+ return true;
+ }
+
+ @Override
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ ret.add(new ItemStack(this, 1, world.func_72805_g(x, y, z)));
+ return ret;
+ }
}

View File

@ -1,108 +1,38 @@
--- ../src-base/minecraft/net/minecraft/block/BlockTorch.java
+++ ../src-work/minecraft/net/minecraft/block/BlockTorch.java
@@ -10,6 +10,7 @@
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
+import static net.minecraftforge.common.util.ForgeDirection.*;
public class BlockTorch extends Block
{
@@ -51,13 +52,17 @@
@@ -70,7 +70,7 @@
else
{
Block block = p_150107_1_.func_147439_a(p_150107_2_, p_150107_3_, p_150107_4_);
- return block == Blocks.field_150422_aJ || block == Blocks.field_150386_bk || block == Blocks.field_150359_w || block == Blocks.field_150463_bK;
+ return block.canPlaceTorchOnTop(p_150107_1_, p_150107_2_, p_150107_3_, p_150107_4_);
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_);
}
}
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
@@ -97,7 +97,7 @@
{
- return p_149742_1_.func_147445_c(p_149742_2_ - 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_ + 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_, p_149742_3_, p_149742_4_ - 1, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_, p_149742_3_, p_149742_4_ + 1, true) ? true : this.func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_))));
+ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST, true) ||
+ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST, true) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH, true) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH, true) ||
+ func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_);
BlockPos blockpos1 = p_176595_2_.func_177972_a(p_176595_3_.func_176734_d());
boolean flag = p_176595_3_.func_176740_k().func_176722_c();
- return flag && p_176595_1_.func_175677_d(blockpos1, true) || p_176595_3_.equals(EnumFacing.UP) && this.func_176594_d(p_176595_1_, blockpos1);
+ return flag && p_176595_1_.isSideSolid(blockpos1, p_176595_3_, true) || p_176595_3_.equals(EnumFacing.UP) && this.func_176594_d(p_176595_1_, blockpos1);
}
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
@@ -69,22 +74,22 @@
j1 = 5;
}
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_)
@@ -120,7 +120,7 @@
- if (p_149660_5_ == 2 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true))
+ if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH, true))
{
j1 = 4;
}
enumfacing1 = (EnumFacing)iterator.next();
}
- while (!p_180642_1_.func_175677_d(p_180642_2_.func_177972_a(enumfacing1.func_176734_d()), true));
+ while (!p_180642_1_.isSideSolid(p_180642_2_.func_177972_a(enumfacing1.func_176734_d()), enumfacing1, true));
- if (p_149660_5_ == 3 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true))
+ if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH, true))
{
j1 = 3;
return this.func_176223_P().func_177226_a(field_176596_a, enumfacing1);
}
- if (p_149660_5_ == 4 && p_149660_1_.func_147445_c(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true))
+ if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST, true))
{
j1 = 2;
}
- if (p_149660_5_ == 5 && p_149660_1_.func_147445_c(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true))
+ if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST, true))
{
j1 = 1;
}
@@ -106,19 +111,19 @@
{
if (p_149726_1_.func_72805_g(p_149726_2_, p_149726_3_, p_149726_4_) == 0)
{
- if (p_149726_1_.func_147445_c(p_149726_2_ - 1, p_149726_3_, p_149726_4_, true))
+ if (p_149726_1_.isSideSolid(p_149726_2_ - 1, p_149726_3_, p_149726_4_, EAST, true))
{
p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 1, 2);
}
- else if (p_149726_1_.func_147445_c(p_149726_2_ + 1, p_149726_3_, p_149726_4_, true))
+ else if (p_149726_1_.isSideSolid(p_149726_2_ + 1, p_149726_3_, p_149726_4_, WEST, true))
{
p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 2, 2);
}
- else if (p_149726_1_.func_147445_c(p_149726_2_, p_149726_3_, p_149726_4_ - 1, true))
+ else if (p_149726_1_.isSideSolid(p_149726_2_, p_149726_3_, p_149726_4_ - 1, SOUTH, true))
{
p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 3, 2);
}
- else if (p_149726_1_.func_147445_c(p_149726_2_, p_149726_3_, p_149726_4_ + 1, true))
+ else if (p_149726_1_.isSideSolid(p_149726_2_, p_149726_3_, p_149726_4_ + 1, NORTH, true))
{
p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 4, 2);
}
@@ -143,22 +148,22 @@
int l = p_150108_1_.func_72805_g(p_150108_2_, p_150108_3_, p_150108_4_);
@@ -149,7 +149,7 @@
EnumFacing enumfacing1 = enumfacing.func_176734_d();
boolean flag = false;
- if (!p_150108_1_.func_147445_c(p_150108_2_ - 1, p_150108_3_, p_150108_4_, true) && l == 1)
+ if (!p_150108_1_.isSideSolid(p_150108_2_ - 1, p_150108_3_, p_150108_4_, EAST, true) && l == 1)
{
flag = true;
}
- if (!p_150108_1_.func_147445_c(p_150108_2_ + 1, p_150108_3_, p_150108_4_, true) && l == 2)
+ if (!p_150108_1_.isSideSolid(p_150108_2_ + 1, p_150108_3_, p_150108_4_, WEST, true) && l == 2)
{
flag = true;
}
- if (!p_150108_1_.func_147445_c(p_150108_2_, p_150108_3_, p_150108_4_ - 1, true) && l == 3)
+ if (!p_150108_1_.isSideSolid(p_150108_2_, p_150108_3_, p_150108_4_ - 1, SOUTH, true) && l == 3)
{
flag = true;
}
- if (!p_150108_1_.func_147445_c(p_150108_2_, p_150108_3_, p_150108_4_ + 1, true) && l == 4)
+ if (!p_150108_1_.isSideSolid(p_150108_2_, p_150108_3_, p_150108_4_ + 1, NORTH, true) && l == 4)
- if (axis.func_176722_c() && !p_176592_1_.func_175677_d(p_176592_2_.func_177972_a(enumfacing1), true))
+ if (axis.func_176722_c() && !p_176592_1_.isSideSolid(p_176592_2_.func_177972_a(enumfacing1), enumfacing1, true))
{
flag = true;
}

View File

@ -1,49 +1,43 @@
--- ../src-base/minecraft/net/minecraft/block/BlockTrapDoor.java
+++ ../src-work/minecraft/net/minecraft/block/BlockTrapDoor.java
@@ -11,9 +11,12 @@
import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
@@ -25,6 +25,8 @@
public class BlockTrapDoor extends Block
{
+ /** Set this to allow trapdoors to remain free-floating */
+ public static boolean disableValidation = false;
private static final String __OBFID = "CL_00000327";
protected BlockTrapDoor(Material p_i45434_1_)
@@ -163,7 +166,7 @@
--i1;
}
- if (!func_150119_a(p_149695_1_.func_147439_a(i1, p_149695_3_, j1)))
+ if (!(func_150119_a(p_149695_1_.func_147439_a(i1, p_149695_3_, j1)) || p_149695_1_.isSideSolid(i1, p_149695_3_, j1, ForgeDirection.getOrientation((l & 3) + 2))))
{
p_149695_1_.func_147468_f(p_149695_2_, p_149695_3_, p_149695_4_);
this.func_149697_b(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, l, 0);
@@ -218,6 +221,7 @@
public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_)
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 field_176285_M = PropertyEnum.func_177709_a("half", BlockTrapDoor.DoorHalf.class);
@@ -141,9 +143,10 @@
{
+ if (disableValidation) return true;
if (p_149707_5_ == 0)
if (!p_176204_1_.field_72995_K)
{
return false;
@@ -248,7 +252,7 @@
--p_149707_2_;
}
+ EnumFacing direction = (EnumFacing)p_176204_3_.func_177229_b(field_176284_a);
BlockPos blockpos1 = p_176204_2_.func_177972_a(((EnumFacing)p_176204_3_.func_177229_b(field_176284_a)).func_176734_d());
- return func_150119_a(p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_));
+ return func_150119_a(p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_)) || p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_, ForgeDirection.UP);
}
- if (!func_150119_a(p_176204_1_.func_180495_p(blockpos1).func_177230_c()))
+ if (!(func_150119_a(p_176204_1_.func_180495_p(blockpos1).func_177230_c()) || p_176204_1_.isSideSolid(blockpos1, 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);
@@ -187,7 +190,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));
}
@@ -259,6 +263,7 @@
protected static EnumFacing func_176281_b(int p_176281_0_)
@@ -224,6 +230,7 @@
private static boolean func_150119_a(Block p_150119_0_)
{
+ 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;
}
}

View File

@ -1,96 +1,29 @@
--- ../src-base/minecraft/net/minecraft/block/BlockTripWireHook.java
+++ ../src-work/minecraft/net/minecraft/block/BlockTripWireHook.java
@@ -9,6 +9,9 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -60,7 +60,7 @@
+import net.minecraftforge.common.util.ForgeDirection;
+import static net.minecraftforge.common.util.ForgeDirection.*;
+
public class BlockTripWireHook extends Block
{
private static final String __OBFID = "CL_00000329";
@@ -47,34 +50,41 @@
public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_)
public boolean func_176198_a(World p_176198_1_, BlockPos p_176198_2_, EnumFacing p_176198_3_)
{
- return p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r()));
+ ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_);
+ return (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) ||
+ (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) ||
+ (dir == WEST && p_149707_1_.isSideSolid(p_149707_2_ + 1, p_149707_3_, p_149707_4_, WEST )) ||
+ (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST ));
- 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);
}
public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
{
- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r()));
+ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) ||
+ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) ||
+ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH);
public boolean func_176196_c(World p_176196_1_, BlockPos p_176196_2_)
@@ -77,7 +77,7 @@
enumfacing = (EnumFacing)iterator.next();
}
- while (!p_176196_1_.func_180495_p(p_176196_2_.func_177972_a(enumfacing)).func_177230_c().func_149721_r());
+ while (!p_176196_1_.isSideSolid(p_176196_2_.func_177972_a(enumfacing), enumfacing.func_176734_d(), true));
return true;
}
@@ -107,7 +107,7 @@
{
EnumFacing enumfacing = (EnumFacing)p_176204_3_.func_177229_b(field_176264_a);
public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
{
byte b0 = 0;
- if (p_149660_5_ == 2 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true))
+ if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH, true))
{
b0 = 2;
}
- if (p_149660_5_ == 3 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true))
+ if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH, true))
{
b0 = 0;
}
- if (p_149660_5_ == 4 && p_149660_1_.func_147445_c(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true))
+ if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST, true))
{
b0 = 1;
}
- if (p_149660_5_ == 5 && p_149660_1_.func_147445_c(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true))
+ if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST, true))
{
b0 = 3;
}
@@ -97,22 +107,22 @@
int i1 = l & 3;
boolean flag = false;
- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && i1 == 3)
+ if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && i1 == 3)
- 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))
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && i1 == 1)
+ if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && i1 == 1)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && i1 == 0)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && i1 == 0)
{
flag = true;
}
- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && i1 == 2)
+ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && i1 == 2)
{
flag = true;
}
@@ -133,7 +143,7 @@
boolean flag3 = (p_150136_6_ & 8) == 8;
boolean flag4 = !p_150136_5_;
boolean flag5 = false;
- boolean flag6 = !World.func_147466_a(p_150136_1_, p_150136_2_, p_150136_3_ - 1, p_150136_4_);
+ boolean flag6 = !p_150136_1_.isSideSolid(p_150136_2_, p_150136_3_ - 1, p_150136_4_, UP);
int l1 = Direction.field_71583_a[k1];
int i2 = Direction.field_71581_b[k1];
int j2 = 0;
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,61 +1,42 @@
--- ../src-base/minecraft/net/minecraft/block/BlockVine.java
+++ ../src-work/minecraft/net/minecraft/block/BlockVine.java
@@ -2,9 +2,11 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -16,8 +18,10 @@
import net.minecraft.world.ColorizerFoliage;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
+import net.minecraftforge.common.ForgeHooks;
+import net.minecraftforge.common.IShearable;
@@ -26,7 +26,7 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-public class BlockVine extends Block
+public class BlockVine extends Block implements IShearable
+public class BlockVine extends Block implements net.minecraftforge.common.IShearable
{
private static final String __OBFID = "CL_00000330";
public static final PropertyBool field_176277_a = PropertyBool.func_177716_a("up");
public static final PropertyBool field_176273_b = PropertyBool.func_177716_a("north");
@@ -416,13 +416,7 @@
@@ -375,14 +379,28 @@
public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_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_)
{
- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ)
- 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_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1);
- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150395_bd, 1, 0));
- 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_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
super.func_180657_a(p_180657_1_, p_180657_2_, p_180657_3_, p_180657_4_, p_180657_5_);
}
}
+
@@ -508,6 +502,16 @@
return i;
}
+ /*************************FORGE START***********************************/
+ @Override public boolean isLadder(IBlockAccess world, BlockPos pos, EntityLivingBase entity){ return true; }
+ @Override public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos){ return true; }
+ @Override
+ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z)
+ public java.util.List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune)
+ {
+ return true;
+ return java.util.Arrays.asList(new ItemStack(this, 1));
+ }
+ /*************************FORGE END***********************************/
+
+ @Override
+ public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ ret.add(new ItemStack(this, 1));
+ return ret;
+ }
+
+ @Override
+ public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity)
+ {
+ return true;
+ }
}
static final class SwitchEnumFacing
{
static final int[] field_177057_a = new int[EnumFacing.values().length];

View File

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

View File

@ -1,32 +1,23 @@
--- ../src-base/minecraft/net/minecraft/client/Minecraft.java
+++ ../src-work/minecraft/net/minecraft/client/Minecraft.java
@@ -276,7 +276,6 @@
this.func_71389_H();
this.field_71449_j = p_i1103_1_;
field_147123_G.info("Setting user: " + p_i1103_1_.func_111285_a());
- field_147123_G.info("(Session ID is " + p_i1103_1_.func_111286_b() + ")");
this.field_71459_aj = p_i1103_5_;
this.field_71443_c = p_i1103_2_;
this.field_71440_d = p_i1103_3_;
@@ -430,7 +429,7 @@
try
{
- Display.create((new PixelFormat()).withDepthBits(24));
+ net.minecraftforge.client.ForgeHooksClient.createDisplay();
}
catch (LWJGLException lwjglexception)
{
@@ -541,7 +540,7 @@
@@ -296,7 +296,6 @@
this.field_152355_az = (new YggdrasilAuthenticationService(p_i45547_1_.field_178745_a.field_178751_c, 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;
@@ -484,7 +483,7 @@
this.field_71452_i = new EffectRenderer(this.field_71441_e, this.field_71446_o);
FMLClientHandler.instance().finishMinecraftLoading();
net.minecraftforge.fml.client.FMLClientHandler.instance().finishMinecraftLoading();
this.func_71361_d("Post startup");
- this.field_71456_v = new GuiIngame(this);
+ this.field_71456_v = new net.minecraftforge.client.GuiIngameForge(this);
if (this.field_71475_ae != null)
{
@@ -761,11 +760,6 @@
@@ -891,11 +890,6 @@
public void func_147108_a(GuiScreen p_147108_1_)
{
@ -38,7 +29,7 @@
if (p_147108_1_ == null && this.field_71441_e == null)
{
p_147108_1_ = new GuiMainMenu();
@@ -775,6 +769,17 @@
@@ -905,6 +899,17 @@
p_147108_1_ = new GuiGameOver();
}
@ -52,69 +43,62 @@
+ {
+ old.func_146281_b();
+ }
+
+
if (p_147108_1_ instanceof GuiMainMenu)
{
this.field_71474_y.field_74330_P = false;
@@ -1341,7 +1346,7 @@
@@ -1388,7 +1393,7 @@
if (this.field_71439_g.func_82246_f(i, j, k))
{
- this.field_71452_i.func_78867_a(i, j, k, this.field_71476_x.field_72310_e);
+ this.field_71452_i.addBlockHitEffects(i, j, k, this.field_71476_x);
this.field_71439_g.func_71038_i();
}
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))
{
- 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();
}
@@ -1422,11 +1427,12 @@
int j = this.field_71476_x.field_72312_c;
int k = this.field_71476_x.field_72309_d;
}
@@ -1468,15 +1473,19 @@
case 2:
BlockPos blockpos = this.field_71476_x.func_178782_a();
- if (this.field_71441_e.func_147439_a(i, j, k).func_149688_o() != Material.field_151579_a)
+ if (!this.field_71441_e.func_147439_a(i, j, k).isAir(field_71441_e, i, j, k))
- 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_175623_d(blockpos))
{
int l = itemstack != null ? itemstack.field_77994_a : 0;
int i = itemstack != null ? itemstack.field_77994_a : 0;
- if (this.field_71442_b.func_78760_a(this.field_71439_g, this.field_71441_e, itemstack, i, j, k, this.field_71476_x.field_72310_e, this.field_71476_x.field_72307_f))
+ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_71439_g, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, i, j, k, this.field_71476_x.field_72310_e, this.field_71441_e).isCanceled();
+ if (result && this.field_71442_b.func_78760_a(this.field_71439_g, this.field_71441_e, itemstack, i, j, k, this.field_71476_x.field_72310_e, this.field_71476_x.field_72307_f))
+
+ 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).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();
@@ -1453,7 +1459,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, 0, 0, 0, -1, this.field_71441_e).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();
}
@@ -1665,6 +1672,8 @@
if (itemstack == null)
{
@@ -1697,6 +1706,8 @@
while (Mouse.next())
{
+ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue;
+
j = Mouse.getEventButton();
KeyBinding.func_74510_a(j - 100, Mouse.getEventButtonState());
i = Mouse.getEventButton();
KeyBinding.func_74510_a(i - 100, Mouse.getEventButtonState());
@@ -2127,6 +2136,11 @@
@@ -2217,6 +2228,8 @@
public void func_71353_a(WorldClient p_71353_1_, String p_71353_2_)
{
+ if (field_71441_e != null)
+ {
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(field_71441_e));
+ }
+ if (field_71441_e != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(field_71441_e));
+
if (p_71353_1_ == null)
{
NetHandlerPlayClient nethandlerplayclient = this.func_147114_u();
@@ -2139,6 +2153,18 @@
if (this.field_71437_Z != null)
@@ -2230,6 +2243,18 @@
{
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"));
@ -130,37 +114,40 @@
}
this.field_71437_Z = null;
@@ -2287,113 +2313,10 @@
@@ -2361,134 +2386,11 @@
if (this.field_71476_x != null)
{
boolean flag = this.field_71439_g.field_71075_bZ.field_75098_d;
- int i = 0;
- boolean flag1 = false;
- Item item;
int j;
- TileEntity tileentity = null;
- Object object;
- if (this.field_71476_x.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK)
- {
- j = this.field_71476_x.field_72311_b;
- int k = this.field_71476_x.field_72312_c;
- int l = this.field_71476_x.field_72309_d;
- Block block = this.field_71441_e.func_147439_a(j, k, l);
- BlockPos blockpos = this.field_71476_x.func_178782_a();
- Block block = this.field_71441_e.func_180495_p(blockpos).func_177230_c();
-
- if (block.func_149688_o() == Material.field_151579_a)
- {
- return;
- }
-
- item = block.func_149694_d(this.field_71441_e, j, k, l);
- object = block.func_180665_b(this.field_71441_e, blockpos);
-
- if (item == null)
- if (object == null)
- {
- return;
- }
-
- flag1 = item.func_77614_k();
- Block block1 = item instanceof ItemBlock && !block.func_149648_K() ? Block.func_149634_a(item) : block;
- i = block1.func_149643_k(this.field_71441_e, j, k, l);
- if (flag && GuiScreen.func_146271_m())
- {
- tileentity = this.field_71441_e.func_175625_s(blockpos);
- }
-
- Block block1 = object instanceof ItemBlock && !block.func_149648_K() ? Block.func_149634_a((Item)object) : block;
- i = block1.func_176222_j(this.field_71441_e, blockpos);
- flag1 = ((Item)object).func_77614_k();
- }
- else
- {
@ -171,11 +158,11 @@
-
- if (this.field_71476_x.field_72308_g instanceof EntityPainting)
- {
- item = Items.field_151159_an;
- object = Items.field_151159_an;
- }
- else if (this.field_71476_x.field_72308_g instanceof EntityLeashKnot)
- {
- item = Items.field_151058_ca;
- object = Items.field_151058_ca;
- }
- else if (this.field_71476_x.field_72308_g instanceof EntityItemFrame)
- {
@ -184,11 +171,11 @@
-
- if (itemstack == null)
- {
- item = Items.field_151160_bD;
- object = Items.field_151160_bD;
- }
- else
- {
- item = itemstack.func_77973_b();
- object = itemstack.func_77973_b();
- i = itemstack.func_77960_j();
- flag1 = true;
- }
@ -197,56 +184,74 @@
- {
- EntityMinecart entityminecart = (EntityMinecart)this.field_71476_x.field_72308_g;
-
- if (entityminecart.func_94087_l() == 2)
- switch (Minecraft.SwitchEnumMinecartType.field_178901_b[entityminecart.func_180456_s().ordinal()])
- {
- item = Items.field_151109_aJ;
- }
- else if (entityminecart.func_94087_l() == 1)
- {
- item = Items.field_151108_aI;
- }
- else if (entityminecart.func_94087_l() == 3)
- {
- item = Items.field_151142_bV;
- }
- else if (entityminecart.func_94087_l() == 5)
- {
- item = Items.field_151140_bW;
- }
- else if (entityminecart.func_94087_l() == 6)
- {
- item = Items.field_151095_cc;
- }
- else
- {
- item = Items.field_151143_au;
- case 1:
- object = Items.field_151109_aJ;
- break;
- case 2:
- object = Items.field_151108_aI;
- break;
- case 3:
- object = Items.field_151142_bV;
- break;
- case 4:
- object = Items.field_151140_bW;
- break;
- case 5:
- object = Items.field_151095_cc;
- break;
- default:
- object = Items.field_151143_au;
- }
- }
- else if (this.field_71476_x.field_72308_g instanceof EntityBoat)
- {
- item = Items.field_151124_az;
- object = Items.field_151124_az;
- }
- else if (this.field_71476_x.field_72308_g instanceof EntityArmorStand)
- {
- object = Items.field_179565_cj;
- }
- else
- {
- item = Items.field_151063_bx;
- object = Items.field_151063_bx;
- i = EntityList.func_75619_a(this.field_71476_x.field_72308_g);
- flag1 = true;
-
- if (i <= 0 || !EntityList.field_75627_a.containsKey(Integer.valueOf(i)))
- if (!EntityList.field_75627_a.containsKey(Integer.valueOf(i)))
- {
- return;
- }
- }
- }
-
- this.field_71439_g.field_71071_by.func_146030_a(item, i, flag1, flag);
InventoryPlayer inventoryplayer = this.field_71439_g.field_71071_by;
- if (tileentity == null)
- {
- inventoryplayer.func_146030_a((Item)object, i, flag1, flag);
- }
- else
- {
- NBTTagCompound nbttagcompound1 = new NBTTagCompound();
- tileentity.func_145841_b(nbttagcompound1);
- ItemStack itemstack1 = new ItemStack((Item)object, 1, i);
- itemstack1.func_77983_a("BlockEntityTag", nbttagcompound1);
- NBTTagCompound nbttagcompound = new NBTTagCompound();
- NBTTagList nbttaglist = new NBTTagList();
- nbttaglist.func_74742_a(new NBTTagString("(+NBT)"));
- nbttagcompound.func_74782_a("Lore", nbttaglist);
- itemstack1.func_77983_a("display", nbttagcompound);
- inventoryplayer.func_70299_a(inventoryplayer.field_70461_c, itemstack1);
- }
-
+ if (!net.minecraftforge.common.ForgeHooks.onPickBlock(this.field_71476_x, this.field_71439_g, this.field_71441_e)) return;
+ // We delete this code wholly instead of commenting it out, to make sure we detect changes in it between MC versions
if (flag)
{
j = this.field_71439_g.field_71069_bz.field_75151_b.size() - 9 + this.field_71439_g.field_71071_by.field_70461_c;
@@ -2659,8 +2582,15 @@
int j = this.field_71439_g.field_71069_bz.field_75151_b.size() - 9 + inventoryplayer.field_70461_c;
@@ -2744,8 +2646,11 @@
p_70001_1_.func_152767_b("gl_max_texture_size", Integer.valueOf(func_71369_N()));
}
@ -254,15 +259,11 @@
+ private static int max_texture_size = -1;
public static int func_71369_N()
{
+ if (max_texture_size != -1)
+ {
+ return max_texture_size;
+ }
+
+ if (max_texture_size != -1) return max_texture_size;
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)null);
@@ -2668,6 +2598,7 @@
@@ -2753,6 +2658,7 @@
if (j != 0)
{

View File

@ -1,17 +1,17 @@
--- ../src-base/minecraft/net/minecraft/client/audio/SoundManager.java
+++ ../src-work/minecraft/net/minecraft/client/audio/SoundManager.java
@@ -35,6 +35,10 @@
@@ -36,6 +36,10 @@
import paulscode.sound.codecs.CodecJOrbis;
import paulscode.sound.libraries.LibraryLWJGLOpenAL;
+import net.minecraftforge.client.*;
+import net.minecraftforge.client.ForgeHooksClient;
+import net.minecraftforge.client.event.sound.*;
+import net.minecraftforge.common.MinecraftForge;
+
@SideOnly(Side.CLIENT)
public class SoundManager
{
@@ -69,6 +73,7 @@
@@ -70,6 +74,7 @@
{
SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
@ -19,7 +19,7 @@
}
catch (SoundSystemException soundsystemexception)
{
@@ -80,6 +85,7 @@
@@ -81,6 +86,7 @@
{
this.func_148613_b();
this.func_148608_i();
@ -27,7 +27,7 @@
}
private synchronized void func_148608_i()
@@ -302,6 +308,9 @@
@@ -329,6 +335,9 @@
}
else
{
@ -37,7 +37,7 @@
SoundEventAccessorComposite soundeventaccessorcomposite = this.field_148622_c.func_147680_a(p_148611_1_.func_147650_b());
if (soundeventaccessorcomposite == null)
@@ -343,10 +352,12 @@
@@ -370,10 +379,12 @@
if (soundpoolentry.func_148648_d())
{
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);

View File

@ -0,0 +1,10 @@
--- ../src-base/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java
+++ ../src-work/minecraft/net/minecraft/client/entity/AbstractClientPlayer.java
@@ -129,6 +129,6 @@
f *= 1.0F - f1 * 0.15F;
}
- return f;
+ return net.minecraftforge.client.ForgeHooksClient.getOffsetFOV(this, f);
}
}

View File

@ -1,12 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java
+++ ../src-work/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java
@@ -151,7 +151,8 @@
}
}
- public float func_70047_e()
+ @Override
+ public float getDefaultEyeHeight()
{
return 1.82F;
}

View File

@ -1,85 +1,78 @@
--- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
+++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java
@@ -50,6 +50,9 @@
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Session;
@@ -53,6 +53,9 @@
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
+import net.minecraftforge.client.ForgeHooksClient;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.entity.PlaySoundAtEntityEvent;
@SideOnly(Side.CLIENT)
public class EntityPlayerSP extends AbstractClientPlayer
@@ -325,7 +328,7 @@
f *= 1.0F - f1 * 0.15F;
}
- return f;
+ return ForgeHooksClient.getOffsetFOV(this, f);
@@ -342,6 +345,15 @@
this.field_71159_c.field_71456_v.func_146158_b().func_146227_a(p_146105_1_);
}
public void func_71053_j()
@@ -479,20 +482,45 @@
return this.field_70170_p.func_147439_a(p_71153_1_, p_71153_2_, p_71153_3_).func_149721_r();
}
+ private boolean isHeadspaceFree(int x, int y, int z, int height)
+ private boolean isHeadspaceFree(BlockPos pos, int height)
+ {
+ for (int i1 = 0; i1 < height; i1++)
+ for (int y = 0; y < height; y++)
+ {
+ if (func_71153_f(x, y + i1, z + 1)) return false;
+ if (func_175162_d(pos.func_177982_a(0, y, 0))) return false;
+ }
+ return true;
+ }
+
protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_)
{
+ if (this.field_70145_X)
+ {
+ return false;
+ }
int i = MathHelper.func_76128_c(p_145771_1_);
int j = MathHelper.func_76128_c(p_145771_3_);
int k = MathHelper.func_76128_c(p_145771_5_);
double d3 = p_145771_1_ - (double)i;
double d4 = p_145771_5_ - (double)k;
if (this.field_70145_X)
@@ -354,30 +366,34 @@
double d3 = p_145771_1_ - (double)blockpos.func_177958_n();
double d4 = p_145771_5_ - (double)blockpos.func_177952_p();
- if (this.func_71153_f(i, j, k) || this.func_71153_f(i, j + 1, k))
+ int entHeight = Math.max(Math.round(this.field_70131_O), 1);
- if (!this.func_175162_d(blockpos))
+ int entHeight = Math.max(Math.round(this.field_70131_O), 1);
+
+ boolean inTranslucentBlock = true;
+ boolean inTranslucentBlock = this.isHeadspaceFree(blockpos, entHeight);
+
+ for (int i1 = 0; i1 < entHeight; i1++)
{
- boolean flag = !this.func_71153_f(i - 1, j, k) && !this.func_71153_f(i - 1, j + 1, k);
- boolean flag1 = !this.func_71153_f(i + 1, j, k) && !this.func_71153_f(i + 1, j + 1, k);
- boolean flag2 = !this.func_71153_f(i, j, k - 1) && !this.func_71153_f(i, j + 1, k - 1);
- boolean flag3 = !this.func_71153_f(i, j, k + 1) && !this.func_71153_f(i, j + 1, k + 1);
+ if (!this.func_71153_f(i, j + i1, k))
+ {
+ inTranslucentBlock = false;
+ }
+ }
+
+ if (inTranslucentBlock)
+ {
+ boolean flag = !isHeadspaceFree(i - 1, j, k, entHeight);
+ boolean flag1 = !isHeadspaceFree(i + 1, j, k, entHeight);
+ boolean flag2 = !isHeadspaceFree(i, j, k - 1, entHeight);
+ boolean flag3 = !isHeadspaceFree(i, j, k + 1, entHeight);
byte b0 = -1;
double d5 = 9999.0D;
+ if (inTranslucentBlock)
{
byte b0 = -1;
double d5 = 9999.0D;
@@ -576,6 +604,12 @@
- if (this.func_175162_d(blockpos.func_177976_e()) && d3 < d5)
+ if (!this.isHeadspaceFree(blockpos.func_177976_e(), entHeight) && d3 < d5)
{
d5 = d3;
b0 = 0;
}
- if (this.func_175162_d(blockpos.func_177974_f()) && 1.0D - d3 < d5)
+ if (!this.isHeadspaceFree(blockpos.func_177974_f(), entHeight) && 1.0D - d3 < d5)
{
d5 = 1.0D - d3;
b0 = 1;
}
- if (this.func_175162_d(blockpos.func_177978_c()) && d4 < d5)
+ if (!this.isHeadspaceFree(blockpos.func_177978_c(), entHeight) && d4 < d5)
{
d5 = d4;
b0 = 4;
}
- if (this.func_175162_d(blockpos.func_177968_d()) && 1.0D - d4 < d5)
+ if (!this.isHeadspaceFree(blockpos.func_177968_d(), entHeight) && 1.0D - d4 < d5)
{
d5 = 1.0D - d4;
b0 = 5;
@@ -445,6 +461,9 @@
public void func_85030_a(String p_85030_1_, float p_85030_2_, float p_85030_3_)
{
+ PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(this, p_85030_1_, p_85030_2_, p_85030_3_);
+ if (MinecraftForge.EVENT_BUS.post(event))
+ {
+ return;
+ }
+ if (MinecraftForge.EVENT_BUS.post(event)) return;
+ p_85030_1_ = event.name;
this.field_70170_p.func_72980_b(this.field_70165_t, this.field_70163_u - (double)this.field_70129_M, this.field_70161_v, p_85030_1_, p_85030_2_, p_85030_3_, false);
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);
}

View File

@ -1,19 +1,11 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiChat.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiChat.java
@@ -138,6 +138,7 @@
public void func_146403_a(String p_146403_1_)
{
this.field_146297_k.field_71456_v.func_146158_b().func_146239_a(p_146403_1_);
+ if (net.minecraftforge.client.ClientCommandHandler.instance.func_71556_a(field_146297_k.field_71439_g, p_146403_1_) != 0) return;
this.field_146297_k.field_71439_g.func_71165_d(p_146403_1_);
}
@@ -330,13 +331,14 @@
@@ -217,13 +217,14 @@
this.field_146297_k.field_71456_v.func_146158_b().func_146234_a(new ChatComponentText(stringbuilder.toString()), 1);
}
- this.field_146415_a.func_146191_b((String)this.field_146412_t.get(this.field_146413_s++));
+ this.field_146415_a.func_146191_b(EnumChatFormatting.func_110646_a((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_)
@ -21,10 +13,10 @@
if (p_146405_1_.length() >= 1)
{
+ net.minecraftforge.client.ClientCommandHandler.instance.autoComplete(p_146405_1_, p_146405_2_);
this.field_146297_k.field_71439_g.field_71174_a.func_147297_a(new C14PacketTabComplete(p_146405_1_));
this.field_146414_r = true;
}
@@ -458,6 +460,13 @@
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)
@@ -285,6 +286,13 @@
String[] astring1 = p_146406_1_;
int i = p_146406_1_.length;

View File

@ -1,20 +1,27 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
@@ -320,7 +320,7 @@
@@ -322,14 +322,7 @@
}
else if (p_146284_1_.field_146127_k == 8)
{
- this.field_146297_k.func_147108_a(new GuiCreateFlatWorld(this, this.field_146334_a));
+ WorldType.field_77139_a[field_146331_K].onCustomizeButton(field_146297_k, this);
- if (WorldType.field_77139_a[this.field_146331_K] == WorldType.field_77138_c)
- {
- this.field_146297_k.func_147108_a(new GuiCreateFlatWorld(this, this.field_146334_a));
- }
- else
- {
- this.field_146297_k.func_147108_a(new GuiCustomizeWorldScreen(this, this.field_146334_a));
- }
+ WorldType.field_77139_a[this.field_146331_K].onCustomizeButton(field_146297_k, this);
}
}
}
@@ -338,7 +338,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;
- this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K] == WorldType.field_77138_c;
+ this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K].isCustomizable();
@@ -381,7 +374,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;
- this.field_146322_F.field_146125_m = this.field_146344_y && (WorldType.field_77139_a[this.field_146331_K] == WorldType.field_77138_c || WorldType.field_77139_a[this.field_146331_K] == WorldType.field_180271_f);
+ this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K].isCustomizable();
}
if (this.field_146344_y)
{
this.func_146319_h();

View File

@ -1,18 +1,10 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiMainMenu.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiMainMenu.java
@@ -25,6 +25,7 @@
import net.minecraft.world.demo.DemoWorldServer;
import net.minecraft.world.storage.ISaveFormat;
import net.minecraft.world.storage.WorldInfo;
+import net.minecraftforge.client.ForgeHooksClient;
import org.apache.commons.io.Charsets;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -507,6 +508,7 @@
@@ -511,6 +511,7 @@
this.func_73731_b(this.field_146289_q, brd, 2, this.field_146295_m - ( 10 + i * (this.field_146289_q.field_78288_b + 1)), 16777215);
}
}
+ ForgeHooksClient.renderMainMenu(this, field_146289_q, field_146294_l, field_146295_m);
+ net.minecraftforge.client.ForgeHooksClient.renderMainMenu(this, this.field_146289_q, this.field_146294_l, this.field_146295_m);
String s1 = "Copyright Mojang AB. Do not distribute!";
this.func_73731_b(this.field_146289_q, s1, this.field_146294_l - this.field_146289_q.func_78256_a(s1) - 2, this.field_146295_m - 10, -1);

View File

@ -1,10 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiNewChat.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiNewChat.java
@@ -99,6 +99,7 @@
byte b0 = 0;
int j2 = -j1 * 9;
func_73734_a(b0, j2 - 9, b0 + i1 + 4, j2, i2 / 2 << 24);
+ GL11.glEnable(GL11.GL_BLEND); // FORGE: BugFix MC-36812 Chat Opacity Broken in 1.7.x
String s = chatline.func_151461_a().func_150254_d();
this.field_146247_f.field_71466_p.func_78261_a(s, b0, j2 - 8, 16777215 + (i2 << 24));
GL11.glDisable(GL11.GL_ALPHA_TEST);

View File

@ -1,27 +1,26 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiScreen.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreen.java
@@ -17,6 +17,10 @@
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.item.ItemStack;
@@ -37,6 +37,9 @@
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent;
+import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent;
+import net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent;
+import net.minecraftforge.common.MinecraftForge;
+
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
@@ -111,7 +115,8 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.StringUtils;
@@ -146,7 +149,8 @@
}
}
- this.func_146283_a(list, p_146285_2_, p_146285_3_);
+ FontRenderer font = p_146285_1_.func_77973_b().getFontRenderer(p_146285_1_);
+ drawHoveringText(list, p_146285_2_, p_146285_3_, (font == null ? field_146289_q : font));
+ this.drawHoveringText(list, p_146285_2_, p_146285_3_, (font == null ? field_146289_q : font));
}
protected void func_146279_a(String p_146279_1_, int p_146279_2_, int p_146279_3_)
@@ -121,6 +126,11 @@
@@ -156,6 +160,11 @@
protected void func_146283_a(List p_146283_1_, int p_146283_2_, int p_146283_3_)
{
@ -32,8 +31,8 @@
+ {
if (!p_146283_1_.isEmpty())
{
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
@@ -133,7 +143,7 @@
GlStateManager.func_179101_C();
@@ -168,7 +177,7 @@
while (iterator.hasNext())
{
String s = (String)iterator.next();
@ -42,16 +41,24 @@
if (l > k)
{
@@ -178,7 +188,7 @@
@@ -213,7 +222,7 @@
for (int i2 = 0; i2 < p_146283_1_.size(); ++i2)
{
String s1 = (String)p_146283_1_.get(i2);
- this.field_146289_q.func_78261_a(s1, j2, k2, -1);
+ font.func_78261_a(s1, j2, k2, -1);
- this.field_146289_q.func_175063_a(s1, (float)j2, (float)k2, -1);
+ font.func_175063_a(s1, j2, k2, -1);
if (i2 == 0)
{
@@ -207,9 +217,14 @@
@@ -441,6 +450,7 @@
this.field_146297_k.field_71456_v.func_146158_b().func_146239_a(p_175281_1_);
}
+ if (net.minecraftforge.client.ClientCommandHandler.instance.func_71556_a(field_146297_k.field_71439_g, p_175281_1_) != 0) return;
this.field_146297_k.field_71439_g.func_71165_d(p_175281_1_);
}
@@ -454,9 +464,14 @@
if (guibutton.func_146116_c(this.field_146297_k, p_73864_1_, p_73864_2_))
{
@ -69,7 +76,7 @@
}
}
}
@@ -234,8 +249,12 @@
@@ -482,8 +497,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_;

View File

@ -1,39 +1,40 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiSlot.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSlot.java
@@ -294,16 +294,7 @@
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG);
Tessellator tessellator = Tessellator.field_78398_a;
- this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k);
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- float f1 = 32.0F;
- tessellator.func_78382_b();
- tessellator.func_78378_d(2105376);
- tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
- tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
- tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
- tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
- tessellator.func_78381_a();
+ drawContainerBackground(tessellator);
l1 = this.field_148152_e + this.field_148155_a / 2 - this.func_148139_c() / 2 + 2;
i2 = this.field_148153_b + 4 - (int)this.field_148169_q;
@@ -185,16 +185,7 @@
GlStateManager.func_179106_n();
Tessellator tessellator = Tessellator.func_178181_a();
WorldRenderer worldrenderer = 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 f1 = 32.0F;
- worldrenderer.func_178970_b();
- worldrenderer.func_178991_c(2105376);
- worldrenderer.func_178985_a((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
- worldrenderer.func_178985_a((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
- worldrenderer.func_178985_a((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
- worldrenderer.func_178985_a((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
- tessellator.func_78381_a();
+ this.drawContainerBackground(tessellator);
int i1 = this.field_148152_e + this.field_148155_a / 2 - this.func_148139_c() / 2 + 2;
int j1 = this.field_148153_b + 4 - (int)this.field_148169_q;
@@ -475,4 +466,18 @@
@@ -456,4 +447,19 @@
{
return this.field_148149_f;
}
+
+ protected void drawContainerBackground(Tessellator tessellator)
+ {
+ WorldRenderer worldrenderer = tessellator.func_178180_c();
+ this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
+ float f1 = 32.0F;
+ tessellator.func_78382_b();
+ tessellator.func_78378_d(2105376);
+ tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
+ tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
+ tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
+ tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
+ worldrenderer.func_178970_b();
+ worldrenderer.func_178991_c(2105376);
+ worldrenderer.func_178985_a((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
+ worldrenderer.func_178985_a((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1));
+ worldrenderer.func_178985_a((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
+ worldrenderer.func_178985_a((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1));
+ tessellator.func_78381_a();
+ }
}

View File

@ -1,9 +1,9 @@
--- ../src-base/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java
+++ ../src-work/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java
@@ -24,6 +24,9 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
+import java.util.LinkedList;
+import java.util.List;
+import net.minecraftforge.common.AchievementPage;
@ -43,7 +43,7 @@
+ this.field_146292_n.add(button = new GuiButton(2, (field_146294_l - field_146555_f) / 2 + 24, field_146295_m / 2 + 74, 125, 20, AchievementPage.getTitle(currentPage)));
}
protected void func_146284_a(GuiButton p_146284_1_)
protected void func_146284_a(GuiButton p_146284_1_) throws IOException
@@ -75,6 +91,16 @@
{
this.field_146297_k.func_147108_a(this.field_146562_a);
@ -56,13 +56,13 @@
+ {
+ currentPage = -1;
+ }
+ button.field_146126_j = AchievementPage.getTitle(currentPage);
+ this.button.field_146126_j = AchievementPage.getTitle(currentPage);
+ }
}
}
@@ -339,11 +365,12 @@
int j4;
@@ -341,11 +367,12 @@
int i4;
int l4;
- for (i3 = 0; i3 < AchievementList.field_76007_e.size(); ++i3)
@ -77,40 +77,40 @@
{
j3 = achievement1.field_75993_a * 24 - k + 11;
k3 = achievement1.field_75991_b * 24 - l + 11;
@@ -400,9 +427,9 @@
@@ -401,9 +428,9 @@
int i5;
int j5;
- for (l4 = 0; l4 < AchievementList.field_76007_e.size(); ++l4)
+ for (l4 = 0; l4 < achievementList.size(); ++l4)
- for (k3 = 0; k3 < AchievementList.field_76007_e.size(); ++k3)
+ for (k3 = 0; k3 < achievementList.size(); ++k3)
{
- Achievement achievement2 = (Achievement)AchievementList.field_76007_e.get(l4);
+ Achievement achievement2 = (Achievement)achievementList.get(l4);
i5 = achievement2.field_75993_a * 24 - k;
j5 = achievement2.field_75991_b * 24 - l;
- Achievement achievement2 = (Achievement)AchievementList.field_76007_e.get(k3);
+ Achievement achievement2 = (Achievement)achievementList.get(k3);
l4 = achievement2.field_75993_a * 24 - k;
i5 = achievement2.field_75991_b * 24 - l;
@@ -444,6 +471,7 @@
@@ -445,6 +472,7 @@
this.field_146297_k.func_110434_K().func_110577_a(field_146561_C);
+ GL11.glEnable(GL11.GL_BLEND);// Forge: Specifically enable blend because it is needed here. And we fix Generic RenderItem's leakage of it.
+ GlStateManager.func_179147_l(); // Forge: Specifically enable blend because it is needed here. And we fix Generic RenderItem's leakage of it.
if (achievement2.func_75984_f())
{
this.func_73729_b(i5 - 2, j5 - 2, 26, 202, 26, 26);
@@ -452,6 +480,7 @@
this.func_73729_b(l4 - 2, i5 - 2, 26, 202, 26, 26);
@@ -453,6 +481,7 @@
{
this.func_73729_b(i5 - 2, j5 - 2, 0, 202, 26, 26);
this.func_73729_b(l4 - 2, i5 - 2, 0, 202, 26, 26);
}
+ GL11.glDisable(GL11.GL_BLEND); //Forge: Cleanup states we set.
+ GlStateManager.func_179084_k(); //Forge: Cleanup states we set.
if (!this.field_146556_E.func_77442_b(achievement2))
{
@@ -460,7 +489,7 @@
renderitem.field_77024_a = false;
@@ -461,7 +490,7 @@
this.field_146296_j.func_175039_a(false);
}
- GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_LIGHTING); //Forge: Make sure Lighting is disabled. Fixes MC-33065
GL11.glEnable(GL11.GL_CULL_FACE);
renderitem.func_82406_b(this.field_146297_k.field_71466_p, this.field_146297_k.func_110434_K(), achievement2.field_75990_d, i5 + 3, j5 + 3);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- GlStateManager.func_179145_e();
+ 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, l4 + 3, i5 + 3);
GlStateManager.func_179112_b(770, 771);

View File

@ -1,51 +1,44 @@
--- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
+++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
@@ -6,6 +6,7 @@
@@ -5,6 +5,7 @@
import java.util.Iterator;
import java.util.Set;
import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
@@ -112,7 +113,11 @@
}
}
+ //Forge: Force lighting to be disabled as there are some issue where lighting would
+ //incorrectly be applied based on items that are in the inventory.
+ GL11.glDisable(GL11.GL_LIGHTING);
this.func_146979_b(p_73863_1_, p_73863_2_);
+ GL11.glEnable(GL11.GL_LIGHTING);
InventoryPlayer inventoryplayer = this.field_146297_k.field_71439_g.field_71071_by;
ItemStack itemstack = this.field_147012_x == null ? inventoryplayer.func_70445_o() : this.field_147012_x;
@@ -176,8 +181,11 @@
GL11.glTranslatef(0.0F, 0.0F, 32.0F);
@@ -178,8 +179,11 @@
GlStateManager.func_179109_b(0.0F, 0.0F, 32.0F);
this.field_73735_i = 200.0F;
field_146296_j.field_77023_b = 200.0F;
- field_146296_j.func_82406_b(this.field_146289_q, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_);
- field_146296_j.func_94148_a(this.field_146289_q, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_);
this.field_146296_j.field_77023_b = 200.0F;
+ FontRenderer font = null;
+ if (p_146982_1_ != null) font = p_146982_1_.func_77973_b().getFontRenderer(p_146982_1_);
+ if (font == null) font = field_146289_q;
+ field_146296_j.func_82406_b(font, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_);
+ field_146296_j.func_94148_a(font, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_);
this.field_146296_j.func_180450_b(p_146982_1_, p_146982_2_, p_146982_3_);
- this.field_146296_j.func_180453_a(this.field_146289_q, p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_);
+ this.field_146296_j.func_180453_a(font, p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_);
this.field_73735_i = 0.0F;
field_146296_j.field_77023_b = 0.0F;
this.field_146296_j.field_77023_b = 0.0F;
}
@@ -243,8 +251,10 @@
if (iicon != null)
@@ -240,13 +244,12 @@
if (itemstack == null)
{
- String s1 = p_146977_1_.func_178171_c();
+ TextureAtlasSprite textureatlassprite = p_146977_1_.getBackgroundSprite();
- if (s1 != null)
+ if (textureatlassprite != null)
{
GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_BLEND); // Forge: Blending needs to be enabled for this.
this.field_146297_k.func_110434_K().func_110577_a(TextureMap.field_110576_c);
this.func_94065_a(i, j, iicon, 16, 16);
+ GL11.glDisable(GL11.GL_BLEND); // Forge: And clean that up
GL11.glEnable(GL11.GL_LIGHTING);
- TextureAtlasSprite textureatlassprite = this.field_146297_k.func_147117_R().func_110572_b(s1);
GlStateManager.func_179140_f();
- this.field_146297_k.func_110434_K().func_110577_a(TextureMap.field_110575_b);
+ this.field_146297_k.func_110434_K().func_110577_a(p_146977_1_.getBackgroundLocation());
this.func_175175_a(i, j, textureatlassprite, 16, 16);
GlStateManager.func_179145_e();
flag1 = true;
}
@@ -458,6 +468,7 @@
@@ -465,6 +468,7 @@
protected void func_146286_b(int p_146286_1_, int p_146286_2_, int p_146286_3_)
{

View File

@ -9,7 +9,7 @@
public GuiContainerCreative(EntityPlayer p_i1088_1_)
{
@@ -185,7 +187,7 @@
@@ -187,7 +189,7 @@
return;
}
@ -18,30 +18,30 @@
{
if (p_146984_3_ == 0)
{
@@ -260,6 +262,13 @@
@@ -262,6 +264,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);
+ int tabCount = CreativeTabs.field_78032_a.length;
+ if (tabCount > 12)
+ {
+ field_146292_n.add(new GuiButton(101, field_147003_i, field_147009_r - 50, 20, 20, "<"));
+ field_146292_n.add(new GuiButton(101, field_147003_i, field_147009_r - 50, 20, 20, "<"));
+ field_146292_n.add(new GuiButton(102, field_147003_i + field_146999_f - 20, field_147009_r - 50, 20, 20, ">"));
+ maxPages = ((tabCount - 12) / 10) + 1;
+ }
}
else
{
@@ -281,7 +290,7 @@
@@ -283,7 +292,7 @@
protected void func_73869_a(char p_73869_1_, int p_73869_2_)
protected void func_73869_a(char p_73869_1_, int p_73869_2_) throws IOException
{
- if (field_147058_w != CreativeTabs.field_78027_g.func_78021_a())
+ if (!CreativeTabs.field_78032_a[field_147058_w].hasSearchBar())
{
if (GameSettings.func_100015_a(this.field_146297_k.field_71474_y.field_74310_D))
{
@@ -318,6 +327,15 @@
@@ -320,6 +329,15 @@
{
GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h;
containercreative.field_148330_a.clear();
@ -57,7 +57,7 @@
Iterator iterator = Item.field_150901_e.iterator();
while (iterator.hasNext())
@@ -329,10 +347,17 @@
@@ -331,10 +349,17 @@
item.func_150895_a(item, (CreativeTabs)null, containercreative.field_148330_a);
}
}
@ -75,25 +75,16 @@
for (int i = 0; i < j; ++i)
{
Enchantment enchantment = aenchantment[i];
@@ -383,7 +408,7 @@
@@ -385,7 +410,7 @@
{
CreativeTabs creativetabs = CreativeTabs.field_78032_a[field_147058_w];
- if (creativetabs.func_78019_g())
+ if (creativetabs != null && creativetabs.func_78019_g())
{
GL11.glDisable(GL11.GL_BLEND);
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);
@@ -403,7 +428,7 @@
{
CreativeTabs creativetabs = acreativetabs[k1];
- if (this.func_147049_a(creativetabs, l, i1))
+ if (creativetabs != null && this.func_147049_a(creativetabs, l, i1))
{
return;
}
@@ -426,7 +451,7 @@
@@ -428,7 +453,7 @@
{
CreativeTabs creativetabs = acreativetabs[k1];
@ -102,7 +93,7 @@
{
this.func_147050_b(creativetabs);
return;
@@ -439,11 +464,13 @@
@@ -441,11 +466,13 @@
private boolean func_147055_p()
{
@ -116,7 +107,7 @@
int i = field_147058_w;
field_147058_w = p_147050_1_.func_78021_a();
GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h;
@@ -512,12 +539,14 @@
@@ -514,12 +541,14 @@
if (this.field_147062_A != null)
{
@ -132,7 +123,7 @@
this.func_147053_i();
}
else
@@ -608,23 +637,45 @@
@@ -590,23 +619,45 @@
super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_);
CreativeTabs[] acreativetabs = CreativeTabs.field_78032_a;
@ -169,7 +160,7 @@
+ {
+ String page = String.format("%d / %d", tabPage + 1, maxPages + 1);
+ int width = field_146289_q.func_78256_a(page);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GlStateManager.func_179140_f();
+ this.field_73735_i = 300.0F;
+ field_146296_j.field_77023_b = 300.0F;
+ field_146289_q.func_78276_b(page, field_147003_i + (field_146999_f / 2) - (width / 2), field_147009_r - 44, -1);
@ -177,10 +168,10 @@
+ field_146296_j.field_77023_b = 0.0F;
+ }
+
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.func_179140_f();
}
@@ -693,17 +744,37 @@
@@ -675,17 +726,36 @@
int k = acreativetabs.length;
int l;
@ -195,7 +186,6 @@
this.field_146297_k.func_110434_K().func_110577_a(field_147061_u);
+ if (creativetabs1 == null) continue;
+
if (creativetabs1.func_78021_a() != field_147058_w)
{
this.func_147051_a(creativetabs1);
@ -219,7 +209,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();
@@ -718,6 +789,14 @@
@@ -700,6 +770,14 @@
this.func_73729_b(i1, k + (int)((float)(l - k - 17) * this.field_147067_x), 232 + (this.func_147055_p() ? 0 : 12), 0, 12, 15);
}
@ -234,7 +224,7 @@
this.func_147051_a(creativetabs);
if (creativetabs == CreativeTabs.field_78036_m)
@@ -728,6 +807,15 @@
@@ -710,6 +788,15 @@
protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_)
{
@ -250,16 +240,16 @@
int k = p_147049_1_.func_78020_k();
int l = 28 * k;
byte b0 = 0;
@@ -828,6 +916,8 @@
@@ -810,6 +897,8 @@
}
GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glColor3f(1F, 1F, 1F); //Forge: Reset color in case Items change it.
+ GL11.glEnable(GL11.GL_BLEND); //Forge: Make sure blend is enabled else tabs show a white border.
GlStateManager.func_179140_f();
+ GlStateManager.func_179124_c(1F, 1F, 1F); //Forge: Reset color in case Items change it.
+ GlStateManager.func_179147_l(); //Forge: Make sure blend is enabled else tabs show a white border.
this.func_73729_b(l, i1, j, k, 28, b0);
this.field_73735_i = 100.0F;
field_146296_j.field_77023_b = 100.0F;
@@ -854,6 +944,15 @@
this.field_146296_j.field_77023_b = 100.0F;
@@ -836,6 +925,15 @@
{
this.field_146297_k.func_147108_a(new GuiStats(this, this.field_146297_k.field_71439_g.func_146107_m()));
}

View File

@ -1,8 +1,8 @@
--- ../src-base/minecraft/net/minecraft/client/model/ModelBase.java
+++ ../src-work/minecraft/net/minecraft/client/model/ModelBase.java
@@ -10,7 +10,6 @@
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-@SideOnly(Side.CLIENT)
public abstract class ModelBase

View File

@ -1,18 +1,18 @@
--- ../src-base/minecraft/net/minecraft/client/model/ModelBox.java
+++ ../src-work/minecraft/net/minecraft/client/model/ModelBox.java
@@ -4,7 +4,6 @@
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.Tessellator;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
-@SideOnly(Side.CLIENT)
public class ModelBox
{
private PositionTextureVertex[] field_78253_h;
@@ -77,6 +76,7 @@
@@ -82,6 +81,7 @@
}
}
+ @SideOnly(Side.CLIENT)
public void func_78245_a(Tessellator p_78245_1_, float p_78245_2_)
public void func_178780_a(WorldRenderer 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
@@ -8,7 +8,6 @@
import net.minecraft.client.renderer.Tessellator;
@@ -10,7 +10,6 @@
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
-@SideOnly(Side.CLIENT)
public class ModelRenderer
{
public float field_78801_a;
@@ -102,6 +101,7 @@
@@ -110,6 +109,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)
@@ -184,6 +184,7 @@
@@ -192,6 +192,7 @@
}
}
@ -24,7 +24,7 @@
public void func_78791_b(float p_78791_1_)
{
if (!this.field_78807_k)
@@ -219,6 +220,7 @@
@@ -227,6 +228,7 @@
}
}
@ -32,7 +32,7 @@
public void func_78794_c(float p_78794_1_)
{
if (!this.field_78807_k)
@@ -260,6 +262,7 @@
@@ -268,6 +270,7 @@
}
}

View File

@ -3,9 +3,9 @@
@@ -1,10 +1,7 @@
package net.minecraft.client.model;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.Vec3;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-@SideOnly(Side.CLIENT)
public class PositionTextureVertex

View File

@ -1,12 +1,11 @@
--- ../src-base/minecraft/net/minecraft/client/model/TexturedQuad.java
+++ ../src-work/minecraft/net/minecraft/client/model/TexturedQuad.java
@@ -1,11 +1,8 @@
package net.minecraft.client.model;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
@@ -3,10 +3,7 @@
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.util.Vec3;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-@SideOnly(Side.CLIENT)
public class TexturedQuad

View File

@ -5,6 +5,6 @@
this.field_73236_b.func_76163_a(ChunkCoordIntPair.func_77272_a(p_73158_1_, p_73158_2_), chunk);
this.field_73237_c.add(chunk);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(chunk));
chunk.field_76636_d = true;
chunk.func_177417_c(true);
return chunk;
}

View File

@ -1,85 +1,69 @@
--- ../src-base/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java
@@ -28,6 +28,10 @@
import net.minecraft.world.World;
import net.minecraft.world.WorldSettings;
@@ -113,6 +113,12 @@
}
}
+import net.minecraftforge.common.ForgeHooks;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
+
@SideOnly(Side.CLIENT)
public class PlayerControllerMP
{
@@ -88,6 +92,12 @@
public boolean func_78751_a(int p_78751_1_, int p_78751_2_, int p_78751_3_, int p_78751_4_)
{
+ 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_78751_1_, p_78751_2_, p_78751_3_, field_78776_a.field_71439_g))
+ if (stack != null && stack.func_77973_b() != null && stack.func_77973_b().onBlockStartBreak(stack, p_178888_1_, field_78776_a.field_71439_g))
+ {
+ return false;
+ }
+
if (this.field_78779_k.func_82752_c() && !this.field_78776_a.field_71439_g.func_82246_f(p_78751_1_, p_78751_2_, p_78751_3_))
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)
{
return false;
@@ -109,7 +119,7 @@
@@ -130,7 +136,7 @@
else
{
worldclient.func_72926_e(2001, p_78751_1_, p_78751_2_, p_78751_3_, Block.func_149682_b(block) + (worldclient.func_72805_g(p_78751_1_, p_78751_2_, p_78751_3_) << 12));
int i1 = worldclient.func_72805_g(p_78751_1_, p_78751_2_, p_78751_3_);
- boolean flag = worldclient.func_147468_f(p_78751_1_, p_78751_2_, p_78751_3_);
+ boolean flag = block.removedByPlayer(worldclient, field_78776_a.field_71439_g, p_78751_1_, p_78751_2_, p_78751_3_);
worldclient.func_175718_b(2001, p_178888_1_, Block.func_176210_f(iblockstate));
- boolean flag = worldclient.func_175698_g(p_178888_1_);
+ boolean flag = block1.removedByPlayer(worldclient, p_178888_1_, field_78776_a.field_71439_g, false);
if (flag)
{
@@ -304,11 +314,18 @@
float f2 = (float)p_78760_8_.field_72449_c - (float)p_78760_6_;
boolean flag = false;
- if ((!p_78760_1_.func_70093_af() || p_78760_1_.func_70694_bm() == null) && p_78760_2_.func_147439_a(p_78760_4_, p_78760_5_, p_78760_6_).func_149727_a(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_1_, p_78760_7_, f, f1, f2))
+ if (p_78760_3_ != null &&
+ p_78760_3_.func_77973_b() != null &&
+ p_78760_3_.func_77973_b().onItemUseFirst(p_78760_3_, p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, f, f1, f2))
@@ -360,11 +366,19 @@
{
- flag = true;
+ return true;
}
+ if (!p_78760_1_.func_70093_af() || p_78760_1_.func_70694_bm() == null || p_78760_1_.func_70694_bm().func_77973_b().doesSneakBypassUse(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_1_))
+ {
+ flag = p_78760_2_.func_147439_a(p_78760_4_, p_78760_5_, p_78760_6_).func_149727_a(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_1_, p_78760_7_, f, f1, f2);
+ }
+
if (!flag && p_78760_3_ != null && p_78760_3_.func_77973_b() instanceof ItemBlock)
{
ItemBlock itemblock = (ItemBlock)p_78760_3_.func_77973_b();
@@ -340,7 +357,15 @@
}
else
{
- return p_78760_3_.func_77943_a(p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, f, f1, f2);
+ if (!p_78760_3_.func_77943_a(p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, f, f1, f2))
+ {
+ return false;
+ }
+ if (p_78760_3_.field_77994_a <= 0)
+ {
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(p_78760_1_, p_78760_3_));
+ }
+ return true;
}
}
@@ -359,9 +384,10 @@
{
p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = itemstack1;
- if (itemstack1.field_77994_a == 0)
+ if (itemstack1.field_77994_a <= 0)
if (this.field_78779_k != WorldSettings.GameType.SPECTATOR)
{
p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = null;
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(p_78769_1_, itemstack1));
}
+
+ 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_);
return true;
- 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_)))
{
- 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);
}
if (!flag && p_178890_3_ != null && p_178890_3_.func_77973_b() instanceof ItemBlock)
@@ -397,7 +411,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;
}
}
else
@@ -428,9 +444,10 @@
{
p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = itemstack1;
- if (itemstack1.field_77994_a == 0)
+ if (itemstack1.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_, itemstack1);
}
return true;

View File

@ -1,38 +1,12 @@
--- ../src-base/minecraft/net/minecraft/client/multiplayer/WorldClient.java
+++ ../src-work/minecraft/net/minecraft/client/multiplayer/WorldClient.java
@@ -34,6 +34,9 @@
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.storage.SaveHandlerMP;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.world.WorldEvent;
+
@SideOnly(Side.CLIENT)
public class WorldClient extends World
{
@@ -51,8 +54,11 @@
super(new SaveHandlerMP(), "MpServer", WorldProvider.func_76570_a(p_i45063_3_), p_i45063_2_, p_i45063_5_);
@@ -54,8 +54,8 @@
super(new SaveHandlerMP(), new WorldInfo(p_i45063_2_, "MpServer"), WorldProvider.func_76570_a(p_i45063_3_), p_i45063_5_, true);
this.field_73035_a = p_i45063_1_;
this.field_73013_u = p_i45063_4_;
- this.func_72950_A(8, 64, 8);
this.field_72988_C = p_i45063_1_.field_147305_a;
+ this.field_72995_K = true;
+ this.finishSetup();
+ this.func_72950_A(8, 64, 8);
+ MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(this));
}
public void func_72835_b()
@@ -261,6 +267,12 @@
protected void func_72979_l()
{
+ super.func_72979_l();
+ }
+
+ @Override
+ public void updateWeatherBody()
+ {
if (!this.field_73011_w.field_76576_e)
{
;
this.func_72912_H().func_176144_a(p_i45063_4_);
- this.func_175652_B(new BlockPos(8, 64, 8));
this.field_73011_w.func_76558_a(this);
+ this.func_175652_B(new BlockPos(8, 64, 8)); //Forge: Moved below registerWorld to prevent NPE in our redirect.
this.field_73020_y = this.func_72970_h();
this.field_72988_C = new SaveDataMemoryStorage();
this.func_72966_v();

View File

@ -1,45 +1,41 @@
--- ../src-base/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java
+++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java
@@ -195,6 +195,8 @@
import net.minecraft.world.storage.ISaveHandler;
import net.minecraft.world.storage.MapData;
import net.minecraft.world.storage.MapStorage;
+import net.minecraftforge.client.event.ClientChatReceivedEvent;
+import net.minecraftforge.common.MinecraftForge;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -389,7 +391,8 @@
@@ -410,7 +410,8 @@
public void func_147286_a(S11PacketSpawnExperienceOrb p_147286_1_)
{
PacketThreadUtil.func_180031_a(p_147286_1_, this, this.field_147299_f);
- EntityXPOrb entityxporb = new EntityXPOrb(this.field_147300_g, (double)p_147286_1_.func_148984_d(), (double)p_147286_1_.func_148983_e(), (double)p_147286_1_.func_148982_f(), p_147286_1_.func_148986_g());
+ EntityXPOrb entityxporb = new EntityXPOrb(this.field_147300_g, (double)p_147286_1_.func_148984_d() / 32.0D, (double)p_147286_1_.func_148983_e() / 32.0D, (double)p_147286_1_.func_148982_f() / 32.0D, p_147286_1_.func_148986_g());
+ // FORGE: BugFix MC-12013 Wrong XP orb clientside spawn position
entityxporb.field_70118_ct = p_147286_1_.func_148984_d();
entityxporb.field_70117_cu = p_147286_1_.func_148983_e();
entityxporb.field_70116_cv = p_147286_1_.func_148982_f();
@@ -686,7 +689,11 @@
@@ -754,14 +755,15 @@
public void func_147251_a(S02PacketChat p_147251_1_)
{
- this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(p_147251_1_.func_148915_c());
+ ClientChatReceivedEvent event = new ClientChatReceivedEvent(p_147251_1_.func_148915_c());
+ if (!MinecraftForge.EVENT_BUS.post(event) && event.message != null)
+ {
+ this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(event.message);
+ }
}
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());
public void func_147279_a(S0BPacketAnimation p_147279_1_)
@@ -1126,6 +1133,10 @@
{
tileentity.func_145839_a(p_147273_1_.func_148857_g());
}
+ else
+ {
+ tileentity.onDataPacket(field_147302_e, p_147273_1_);
+ }
}
if (p_147251_1_.func_179841_c() == 2)
{
- this.field_147299_f.field_71456_v.func_175188_a(p_147251_1_.func_148915_c(), false);
+ this.field_147299_f.field_71456_v.func_175188_a(message, false);
}
else
{
- this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(p_147251_1_.func_148915_c());
+ this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(message);
}
}
@@ -1137,6 +1139,10 @@
{
tileentity.func_145839_a(p_147273_1_.func_148857_g());
}
+ else
+ {
+ tileentity.onDataPacket(field_147302_e, p_147273_1_);
+ }
}
}

View File

@ -1,74 +1,33 @@
--- ../src-base/minecraft/net/minecraft/client/particle/EffectRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/particle/EffectRenderer.java
@@ -16,9 +16,11 @@
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
+import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.ReportedException;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
+
import org.lwjgl.opengl.GL11;
@@ -135,6 +135,7 @@
@SideOnly(Side.CLIENT)
@@ -70,7 +72,10 @@
try
{
- entityfx.func_70071_h_();
+ if (entityfx != null)
+ {
+ entityfx.func_70071_h_();
+ }
}
catch (Throwable throwable)
{
@@ -95,7 +100,7 @@
throw new ReportedException(crashreport);
}
- if (entityfx.field_70128_L)
+ if (entityfx == null || entityfx.field_70128_L)
{
this.field_78876_b[i].remove(j--);
}
@@ -144,6 +149,7 @@
for (int j = 0; j < this.field_78876_b[i].size(); ++j)
{
final EntityFX entityfx = (EntityFX)this.field_78876_b[i].get(j);
+ if (entityfx == null) continue;
tessellator.func_78380_c(entityfx.func_70070_b(p_78874_2_));
try
@@ -200,6 +206,7 @@
for (int i = 0; i < list.size(); ++i)
{
EntityFX entityfx = (EntityFX)list.get(i);
+ if (entityfx == null) continue;
tessellator.func_78380_c(entityfx.func_70070_b(p_78872_2_));
entityfx.func_70539_a(tessellator, p_78872_2_, f2, f6, f3, f4, f5);
}
@@ -218,7 +225,7 @@
public void func_147215_a(int p_147215_1_, int p_147215_2_, int p_147215_3_, Block p_147215_4_, int p_147215_5_)
public void func_78873_a(EntityFX p_78873_1_)
{
- if (p_147215_4_.func_149688_o() != Material.field_151579_a)
+ if (!p_147215_4_.isAir(field_78878_a, p_147215_1_, p_147215_2_, p_147215_3_) && !p_147215_4_.addDestroyEffects(field_78878_a, p_147215_1_, p_147215_2_, p_147215_3_, p_147215_5_, this))
+ 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;
@@ -361,7 +362,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))
{
p_180533_2_ = p_180533_2_.func_177230_c().func_176221_a(p_180533_2_, this.field_78878_a, p_180533_1_);
byte b0 = 4;
@@ -467,4 +468,13 @@
@@ -287,4 +294,13 @@
{
return "" + (this.field_78876_b[0].size() + this.field_78876_b[1].size() + this.field_78876_b[2].size());
return "" + i;
}
+
+ public void addBlockHitEffects(int x, int y, int z, MovingObjectPosition target)
+ public void addBlockHitEffects(BlockPos pos, net.minecraft.util.MovingObjectPosition target)
+ {
+ Block block = field_78878_a.func_147439_a(x, y, z);
+ Block block = field_78878_a.func_180495_p(pos).func_177230_c();
+ if (block != null && !block.addHitEffects(field_78878_a, target, this))
+ {
+ func_78867_a(x, y, z, target.field_72310_e);
+ func_180532_a(pos, target.field_178784_b);
+ }
+ }
}

View File

@ -1,32 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/particle/EntityDiggingFX.java
+++ ../src-work/minecraft/net/minecraft/client/particle/EntityDiggingFX.java
@@ -12,20 +12,27 @@
{
private Block field_145784_a;
private static final String __OBFID = "CL_00000932";
+ private int side;
public EntityDiggingFX(World p_i1234_1_, double p_i1234_2_, double p_i1234_4_, double p_i1234_6_, double p_i1234_8_, double p_i1234_10_, double p_i1234_12_, Block p_i1234_14_, int p_i1234_15_)
{
+ this(p_i1234_1_, p_i1234_2_, p_i1234_4_, p_i1234_6_, p_i1234_8_, p_i1234_10_, p_i1234_12_, p_i1234_14_, p_i1234_15_, p_i1234_1_.field_73012_v.nextInt(6));
+ }
+
+ public EntityDiggingFX(World p_i1234_1_, double p_i1234_2_, double p_i1234_4_, double p_i1234_6_, double p_i1234_8_, double p_i1234_10_, double p_i1234_12_, Block p_i1234_14_, int p_i1234_15_, int side)
+ {
super(p_i1234_1_, p_i1234_2_, p_i1234_4_, p_i1234_6_, p_i1234_8_, p_i1234_10_, p_i1234_12_);
this.field_145784_a = p_i1234_14_;
- this.func_110125_a(p_i1234_14_.func_149691_a(0, p_i1234_15_));
+ this.func_110125_a(p_i1234_14_.func_149691_a(side, p_i1234_15_));
this.field_70545_g = p_i1234_14_.field_149763_I;
this.field_70552_h = this.field_70553_i = this.field_70551_j = 0.6F;
this.field_70544_f /= 2.0F;
+ this.side = side;
}
public EntityDiggingFX func_70596_a(int p_70596_1_, int p_70596_2_, int p_70596_3_)
{
- if (this.field_145784_a == Blocks.field_150349_c)
+ if (this.field_145784_a == Blocks.field_150349_c && this.side != 1)
{
return this;
}

View File

@ -1,162 +1,110 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/EntityRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/EntityRenderer.java
@@ -51,6 +51,12 @@
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GLContext;
import org.lwjgl.util.glu.Project;
+import net.minecraftforge.client.ForgeHooksClient;
+import net.minecraftforge.client.IRenderHandler;
+import net.minecraftforge.client.event.DrawBlockHighlightEvent;
+import net.minecraftforge.client.event.GuiScreenEvent.DrawScreenEvent;
+import net.minecraftforge.client.event.RenderWorldLastEvent;
+import net.minecraftforge.common.MinecraftForge;
@SideOnly(Side.CLIENT)
public class EntityRenderer implements IResourceManagerReloadListener
@@ -358,7 +364,7 @@
@@ -403,7 +403,7 @@
if (d3 < d2 || d2 == 0.0D)
{
- if (entity == this.field_78531_r.field_71451_h.field_70154_o)
+ if (entity == this.field_78531_r.field_71451_h.field_70154_o && !entity.canRiderInteract())
- if (entity1 == entity.field_70154_o)
+ if (entity1 == entity.field_70154_o && !entity.canRiderInteract())
{
if (d2 == 0.0D)
{
@@ -392,8 +398,15 @@
private void func_78477_e()
{
- EntityPlayerSP entityplayersp = (EntityPlayerSP)this.field_78531_r.field_71451_h;
- this.field_78501_T = entityplayersp.func_71151_f();
+ if (field_78531_r.field_71451_h instanceof EntityPlayerSP)
+ {
+ EntityPlayerSP entityplayersp = (EntityPlayerSP)this.field_78531_r.field_71451_h;
+ this.field_78501_T = entityplayersp.func_71151_f();
+ }
+ else
+ {
+ this.field_78501_T = field_78531_r.field_71439_g.func_71151_f();
+ }
this.field_78506_S = this.field_78507_R;
this.field_78507_R += (this.field_78501_T - this.field_78507_R) * 0.5F;
@@ -416,7 +429,7 @@
}
else
{
- EntityPlayer entityplayer = (EntityPlayer)this.field_78531_r.field_71451_h;
+ EntityLivingBase entityplayer = (EntityLivingBase)this.field_78531_r.field_71451_h;
float f1 = 70.0F;
if (p_78481_2_)
@@ -497,15 +510,7 @@
if (!this.field_78531_r.field_71474_y.field_74325_U)
@@ -556,14 +556,8 @@
{
- Block block = this.field_78531_r.field_71441_e.func_147439_a(MathHelper.func_76128_c(entitylivingbase.field_70165_t), MathHelper.func_76128_c(entitylivingbase.field_70163_u), MathHelper.func_76128_c(entitylivingbase.field_70161_v));
-
BlockPos blockpos = new BlockPos(entity);
IBlockState iblockstate = this.field_78531_r.field_71441_e.func_180495_p(blockpos);
- Block block = iblockstate.func_177230_c();
+ net.minecraftforge.client.ForgeHooksClient.orientBedCamera(this.field_78531_r.field_71441_e, blockpos, iblockstate, entity);
- if (block == Blocks.field_150324_C)
- {
- int i = this.field_78531_r.field_71441_e.func_72805_g(MathHelper.func_76128_c(entitylivingbase.field_70165_t), MathHelper.func_76128_c(entitylivingbase.field_70163_u), MathHelper.func_76128_c(entitylivingbase.field_70161_v));
- int j = i & 3;
- GL11.glRotatef((float)(j * 90), 0.0F, 1.0F, 0.0F);
- int j = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_176387_N)).func_176736_b();
- GlStateManager.func_179114_b((float)(j * 90), 0.0F, 1.0F, 0.0F);
- }
-
+ ForgeHooksClient.orientBedCamera(field_78531_r, entitylivingbase);
GL11.glRotatef(entitylivingbase.field_70126_B + (entitylivingbase.field_70177_z - entitylivingbase.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F);
GL11.glRotatef(entitylivingbase.field_70127_C + (entitylivingbase.field_70125_A - entitylivingbase.field_70127_C) * p_78467_1_, -1.0F, 0.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);
}
@@ -1052,7 +1057,9 @@
@@ -1081,7 +1075,7 @@
try
{
- this.field_78531_r.field_71462_r.func_73863_a(k, l, p_78480_1_);
+ if (!MinecraftForge.EVENT_BUS.post(new DrawScreenEvent.Pre(this.field_78531_r.field_71462_r, k, l, p_78480_1_)))
+ this.field_78531_r.field_71462_r.func_73863_a(k, l, p_78480_1_);
+ MinecraftForge.EVENT_BUS.post(new DrawScreenEvent.Post(this.field_78531_r.field_71462_r, k, l, p_78480_1_));
- this.field_78531_r.field_71462_r.func_73863_a(l, i1, p_78480_1_);
+ net.minecraftforge.client.ForgeHooksClient.drawScreen(this.field_78531_r.field_71462_r, l, i1, p_78480_1_);
}
catch (Throwable throwable)
{
@@ -1213,7 +1220,10 @@
GL11.glPushMatrix();
RenderHelper.func_74519_b();
this.field_78531_r.field_71424_I.func_76318_c("entities");
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
renderglobal.func_147589_a(entitylivingbase, frustrum, p_78471_1_);
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
+ //ToDo: Try and figure out how to make particles render sorted correctly.. {They render behind water}
RenderHelper.func_74518_a();
this.func_78483_a((double)p_78471_1_);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
@@ -1225,7 +1235,10 @@
entityplayer = (EntityPlayer)entitylivingbase;
GL11.glDisable(GL11.GL_ALPHA_TEST);
this.field_78531_r.field_71424_I.func_76318_c("outline");
- renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_);
+ if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.field_71071_by.func_70448_g(), p_78471_1_))
+ {
+ renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_);
+ }
GL11.glEnable(GL11.GL_ALPHA_TEST);
}
}
@@ -1238,14 +1251,17 @@
entityplayer = (EntityPlayer)entitylivingbase;
GL11.glDisable(GL11.GL_ALPHA_TEST);
@@ -1145,7 +1139,7 @@
if (this.field_78531_r.field_71442_b.func_178889_l() == WorldSettings.GameType.SPECTATOR)
{
- flag = block.func_149716_u() && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory;
+ flag = block.hasTileEntity(this.field_78531_r.field_71441_e.func_180495_p(blockpos)) && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory;
}
else
{
@@ -1296,7 +1290,9 @@
GlStateManager.func_179094_E();
RenderHelper.func_74519_b();
this.field_78531_r.field_71424_I.func_76318_c("entities");
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
renderglobal.func_180446_a(entity, frustum, p_175068_2_);
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
RenderHelper.func_74518_a();
this.func_175072_h();
GlStateManager.func_179128_n(5888);
@@ -1308,6 +1304,7 @@
entityplayer = (EntityPlayer)entity;
GlStateManager.func_179118_c();
this.field_78531_r.field_71424_I.func_76318_c("outline");
- renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_);
+ if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.field_71071_by.func_70448_g(), p_78471_1_))
+ {
+ renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_);
+ }
GL11.glEnable(GL11.GL_ALPHA_TEST);
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.func_70694_bm(), p_175068_2_))
renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_);
GlStateManager.func_179141_d();
}
@@ -1321,6 +1318,7 @@
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_))
renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_);
GlStateManager.func_179141_d();
}
@@ -1373,6 +1371,16 @@
renderglobal.func_174977_a(EnumWorldBlockLayer.TRANSLUCENT, (double)p_175068_2_, p_175068_1_, entity);
}
this.field_78531_r.field_71424_I.func_76318_c("destroyProgress");
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.func_148821_a(770, 1, 1, 0);
- renderglobal.func_72717_a(Tessellator.field_78398_a, (EntityPlayer)entitylivingbase, p_78471_1_);
+ renderglobal.drawBlockDamageTexture(Tessellator.field_78398_a, entitylivingbase, p_78471_1_);
GL11.glDisable(GL11.GL_BLEND);
if (this.field_78532_q == 0)
@@ -1313,6 +1329,16 @@
renderglobal.func_72719_a(entitylivingbase, 1, (double)p_78471_1_);
}
+ if (this.field_78532_q == 0) //Only render if render pass 0 happens as well.
+ {
+ RenderHelper.func_74519_b();
+ this.field_78531_r.field_71424_I.func_76318_c("entities");
+ ForgeHooksClient.setRenderPass(1);
+ renderglobal.func_147589_a(entitylivingbase, frustrum, p_78471_1_);
+ ForgeHooksClient.setRenderPass(-1);
+ RenderHelper.func_74518_a();
+ }
+ 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, frustum, p_175068_2_);
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(-1);
+ RenderHelper.func_74518_a();
+ }
+
GL11.glDepthMask(true);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
@@ -1324,9 +1350,12 @@
this.func_82829_a(renderglobal, p_78471_1_);
}
GlStateManager.func_179103_j(7424);
GlStateManager.func_179132_a(true);
GlStateManager.func_179089_o();
@@ -1385,8 +1393,12 @@
this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_);
}
+ this.field_78531_r.field_71424_I.func_76318_c("FRenderLast");
+ ForgeHooksClient.dispatchRenderLast(renderglobal, p_78471_1_);
+ this.field_78531_r.field_71424_I.func_76318_c("forge_render_last");
+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(renderglobal, p_175068_2_);
+
this.field_78531_r.field_71424_I.func_76318_c("hand");
this.field_78531_r.field_71424_I.func_76318_c("hand");
- if (this.field_78503_V == 1.0D)
+ if (!ForgeHooksClient.renderFirstPersonHand(renderglobal, p_78471_1_, j) && this.field_78503_V == 1.0D)
{
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
this.func_78476_b(p_78471_1_, j);
@@ -1442,6 +1471,13 @@
+ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(renderglobal, p_175068_2_, p_175068_1_))
if (this.field_175074_C)
{
GlStateManager.func_179086_m(256);
@@ -1498,6 +1510,13 @@
protected void func_78474_d(float p_78474_1_)
{
+ IRenderHandler renderer = null;
+ if ((renderer = this.field_78531_r.field_71441_e.field_73011_w.getWeatherRenderer()) != null)
+ net.minecraftforge.client.IRenderHandler renderer = this.field_78531_r.field_71441_e.field_73011_w.getWeatherRenderer();
+ if (renderer != null)
+ {
+ renderer.render(p_78474_1_, this.field_78531_r.field_71441_e, field_78531_r);
+ return;
@ -165,39 +113,36 @@
float f1 = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_);
if (f1 > 0.0F)
@@ -1791,6 +1827,13 @@
this.field_78533_p = f7;
@@ -1835,6 +1854,13 @@
this.field_175081_S = f8;
}
+ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entitylivingbase, block, p_78466_1_, this.field_78518_n, this.field_78519_o, this.field_78533_p);
+ MinecraftForge.EVENT_BUS.post(event);
+ 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.common.MinecraftForge.EVENT_BUS.post(event);
+
+ this.field_78518_n = event.red;
+ this.field_78533_p = event.blue;
+ this.field_78519_o = event.green;
+ this.field_175080_Q = event.red;
+ this.field_175082_R = event.blue;
+ this.field_175081_S = event.green;
+
GL11.glClearColor(this.field_78518_n, this.field_78519_o, this.field_78533_p, 0.0F);
GlStateManager.func_179082_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 0.0F);
}
@@ -1826,6 +1869,13 @@
Block block = ActiveRenderInfo.func_151460_a(this.field_78531_r.field_71441_e, entitylivingbase, p_78468_2_);
float f1;
@@ -1854,6 +1880,10 @@
Block block = ActiveRenderInfo.func_180786_a(this.field_78531_r.field_71441_e, entity, p_78468_2_);
float f1;
+ net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity(this, entitylivingbase, block, p_78468_2_, 0.1F);
+
+ if (MinecraftForge.EVENT_BUS.post(event))
+ {
+ GL11.glFogf(GL11.GL_FOG_DENSITY, event.density);
+ }
+ else
if (entitylivingbase.func_70644_a(Potion.field_76440_q))
{
f1 = 5.0F;
@@ -1930,6 +1980,7 @@
GL11.glFogf(GL11.GL_FOG_START, f1 * 0.05F);
GL11.glFogf(GL11.GL_FOG_END, Math.min(f1, 192.0F) * 0.5F);
}
+ MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.EntityViewRenderEvent.RenderFogEvent(this, entitylivingbase, block, p_78468_2_, p_78468_1_, f1));
+ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, block, 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))
{
f1 = 5.0F;
@@ -1931,6 +1961,7 @@
GlStateManager.func_179102_b(f1 * 0.05F);
GlStateManager.func_179153_c(Math.min(f1, 192.0F) * 0.5F);
}
+ net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, block, p_78468_2_, p_78468_1_, f1);
}
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
GlStateManager.func_179142_g();

View File

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java
@@ -75,6 +75,8 @@
@@ -83,6 +83,8 @@
this.func_73729_b(i + 6, j + 7, 0 + l % 8 * 18, 198 + l / 8 * 18, 18, 18);
}

View File

@ -1,167 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/ItemRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/ItemRenderer.java
@@ -20,6 +20,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemCloth;
+import net.minecraft.item.ItemMap;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
@@ -28,6 +29,13 @@
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
+import net.minecraftforge.client.ForgeHooksClient;
+import net.minecraftforge.client.IItemRenderer;
+import net.minecraftforge.client.IItemRenderer.ItemRenderType;
+import net.minecraftforge.client.MinecraftForgeClient;
+import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*;
+import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*;
+
@SideOnly(Side.CLIENT)
public class ItemRenderer
{
@@ -49,6 +57,11 @@
public void func_78443_a(EntityLivingBase p_78443_1_, ItemStack p_78443_2_, int p_78443_3_)
{
+ this.renderItem(p_78443_1_, p_78443_2_, p_78443_3_, EQUIPPED);
+ }
+
+ public void renderItem(EntityLivingBase p_78443_1_, ItemStack p_78443_2_, int p_78443_3_, ItemRenderType type)
+ {
GL11.glPushMatrix();
TextureManager texturemanager = this.field_78455_a.func_110434_K();
Item item = p_78443_2_.func_77973_b();
@@ -60,7 +73,13 @@
GL11.glEnable(GL11.GL_CULL_FACE);
OpenGlHelper.func_148821_a(770, 771, 1, 0);
}
-
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(p_78443_2_, type);
+ if (customRenderer != null)
+ {
+ texturemanager.func_110577_a(texturemanager.func_130087_a(p_78443_2_.func_94608_d()));
+ ForgeHooksClient.renderEquippedItem(type, customRenderer, field_147720_h, p_78443_1_, p_78443_2_);
+ }
+ else
if (p_78443_2_.func_94608_d() == 0 && item instanceof ItemBlock && RenderBlocks.func_147739_a(block.func_149645_b()))
{
texturemanager.func_110577_a(texturemanager.func_130087_a(0));
@@ -104,7 +123,7 @@
GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
func_78439_a(tessellator, f1, f2, f, f3, iicon.func_94211_a(), iicon.func_94216_b(), 0.0625F);
- if (p_78443_2_.func_77962_s() && p_78443_3_ == 0)
+ if (p_78443_2_.hasEffect(p_78443_3_))
{
GL11.glDepthFunc(GL11.GL_EQUAL);
GL11.glDisable(GL11.GL_LIGHTING);
@@ -282,7 +301,7 @@
Render render;
RenderPlayer renderplayer;
- if (itemstack != null && itemstack.func_77973_b() == Items.field_151098_aY)
+ if (itemstack != null && itemstack.func_77973_b() instanceof ItemMap)
{
GL11.glPushMatrix();
f13 = 0.8F;
@@ -349,12 +368,21 @@
tessellator.func_78374_a((double)(128 + b0), (double)(0 - b0), 0.0D, 1.0D, 0.0D);
tessellator.func_78374_a((double)(0 - b0), (double)(0 - b0), 0.0D, 0.0D, 0.0D);
tessellator.func_78381_a();
- MapData mapdata = Items.field_151098_aY.func_77873_a(itemstack, this.field_78455_a.field_71441_e);
- if (mapdata != null)
+ IItemRenderer custom = MinecraftForgeClient.getItemRenderer(itemstack, FIRST_PERSON_MAP);
+ MapData mapdata = ((ItemMap)itemstack.func_77973_b()).func_77873_a(itemstack, this.field_78455_a.field_71441_e);
+
+ if (custom == null)
{
- this.field_78455_a.field_71460_t.func_147701_i().func_148250_a(mapdata, false);
+ if (mapdata != null)
+ {
+ this.field_78455_a.field_71460_t.func_147701_i().func_148250_a(mapdata, false);
+ }
}
+ else
+ {
+ custom.renderItem(FIRST_PERSON_MAP, itemstack, field_78455_a.field_71439_g, field_78455_a.func_110434_K(), mapdata);
+ }
GL11.glPopMatrix();
}
@@ -455,17 +483,20 @@
if (itemstack.func_77973_b().func_77623_v())
{
- this.func_78443_a(entityclientplayermp, itemstack, 0);
- int k1 = itemstack.func_77973_b().func_82790_a(itemstack, 1);
- f10 = (float)(k1 >> 16 & 255) / 255.0F;
- f11 = (float)(k1 >> 8 & 255) / 255.0F;
- f12 = (float)(k1 & 255) / 255.0F;
- GL11.glColor4f(1.0F * f10, 1.0F * f11, 1.0F * f12, 1.0F);
- this.func_78443_a(entityclientplayermp, itemstack, 1);
+ this.renderItem(entityclientplayermp, itemstack, 0, EQUIPPED_FIRST_PERSON);
+ for (int x = 1; x < itemstack.func_77973_b().getRenderPasses(itemstack.func_77960_j()); x++)
+ {
+ int k1 = itemstack.func_77973_b().func_82790_a(itemstack, x);
+ f10 = (float)(k1 >> 16 & 255) / 255.0F;
+ f11 = (float)(k1 >> 8 & 255) / 255.0F;
+ f12 = (float)(k1 & 255) / 255.0F;
+ GL11.glColor4f(1.0F * f10, 1.0F * f11, 1.0F * f12, 1.0F);
+ this.renderItem(entityclientplayermp, itemstack, x, EQUIPPED_FIRST_PERSON);
+ }
}
else
{
- this.func_78443_a(entityclientplayermp, itemstack, 0);
+ this.renderItem(entityclientplayermp, itemstack, 0, EQUIPPED_FIRST_PERSON);
}
GL11.glPopMatrix();
@@ -516,6 +547,7 @@
if (this.field_78455_a.field_71439_g.func_70027_ad())
{
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderBlockOverlayEvent(this.field_78455_a.field_71439_g, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.FIRE, Blocks.field_150480_ab, MathHelper.func_76128_c(this.field_78455_a.field_71439_g.field_70165_t), MathHelper.func_76128_c(this.field_78455_a.field_71439_g.field_70163_u), MathHelper.func_76128_c(this.field_78455_a.field_71439_g.field_70161_v))))
this.func_78442_d(p_78447_1_);
}
@@ -525,9 +557,11 @@
int j = MathHelper.func_76128_c(this.field_78455_a.field_71439_g.field_70163_u);
int k = MathHelper.func_76128_c(this.field_78455_a.field_71439_g.field_70161_v);
Block block = this.field_78455_a.field_71441_e.func_147439_a(i, j, k);
+ int block2_X = i, block2_Y = j, block2_Z = k;
if (this.field_78455_a.field_71441_e.func_147439_a(i, j, k).func_149721_r())
{
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderBlockOverlayEvent(this.field_78455_a.field_71439_g, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, block, i, j, k)))
this.func_78446_a(p_78447_1_, block.func_149733_h(2));
}
else
@@ -544,18 +578,23 @@
if (this.field_78455_a.field_71441_e.func_147439_a(i1, j1, k1).func_149721_r())
{
block = this.field_78455_a.field_71441_e.func_147439_a(i1, j1, k1);
+ block2_X = i;
+ block2_Y = j;
+ block2_Z = k;
}
}
}
if (block.func_149688_o() != Material.field_151579_a)
{
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderBlockOverlayEvent(this.field_78455_a.field_71439_g, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, block, block2_X, block2_Y, block2_Z)))
this.func_78446_a(p_78447_1_, block.func_149733_h(2));
}
}
if (this.field_78455_a.field_71439_g.func_70055_a(Material.field_151586_h))
{
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderBlockOverlayEvent(this.field_78455_a.field_71439_g, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.WATER, Blocks.field_150355_j, MathHelper.func_76128_c(this.field_78455_a.field_71439_g.field_70165_t), MathHelper.func_76128_c(this.field_78455_a.field_71439_g.field_70163_u), MathHelper.func_76128_c(this.field_78455_a.field_71439_g.field_70161_v))))
this.func_78448_c(p_78447_1_);
}

View File

@ -1,7 +1,7 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java
@@ -54,6 +54,10 @@
private static String field_153196_B = "";
@@ -78,6 +78,10 @@
public static int field_148826_e;
private static final String __OBFID = "CL_00001179";
+ /* Stores the last values sent into setLightmapTextureCoords */
@ -11,7 +11,7 @@
public static void func_77474_a()
{
ContextCapabilities contextcapabilities = GLContext.getCapabilities();
@@ -688,6 +692,12 @@
@@ -813,6 +817,12 @@
{
GL13.glMultiTexCoord2f(p_77475_0_, p_77475_1_, p_77475_2_);
}

View File

@ -1,128 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/RenderBlocks.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/RenderBlocks.java
@@ -52,6 +52,8 @@
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
+import static net.minecraftforge.common.util.ForgeDirection.*;
+
@SideOnly(Side.CLIENT)
public class RenderBlocks
{
@@ -339,9 +341,9 @@
public boolean func_147773_v(Block p_147773_1_, int p_147773_2_, int p_147773_3_, int p_147773_4_)
{
Tessellator tessellator = Tessellator.field_78398_a;
- int l = this.field_147845_a.func_72805_g(p_147773_2_, p_147773_3_, p_147773_4_);
- int i1 = BlockBed.func_149895_l(l);
- boolean flag = BlockBed.func_149975_b(l);
+ Block bed = this.field_147845_a.func_147439_a(p_147773_2_, p_147773_3_, p_147773_4_);
+ int i1 = bed.getBedDirection(field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_);
+ boolean flag = bed.isBedFoot(field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_);
float f = 0.5F;
float f1 = 1.0F;
float f2 = 0.8F;
@@ -350,6 +352,7 @@
tessellator.func_78380_c(j1);
tessellator.func_78386_a(f, f, f);
IIcon iicon = this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 0);
+ if (func_147744_b()) iicon = field_147840_d; //BugFix Proper breaking texture on underside
double d0 = (double)iicon.func_94209_e();
double d1 = (double)iicon.func_94212_f();
double d2 = (double)iicon.func_94206_g();
@@ -366,6 +369,7 @@
tessellator.func_78380_c(p_147773_1_.func_149677_c(this.field_147845_a, p_147773_2_, p_147773_3_ + 1, p_147773_4_));
tessellator.func_78386_a(f1, f1, f1);
iicon = this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 1);
+ if (func_147744_b()) iicon = field_147840_d; //BugFix Proper breaking texture on underside
d0 = (double)iicon.func_94209_e();
d1 = (double)iicon.func_94212_f();
d2 = (double)iicon.func_94206_g();
@@ -2040,7 +2044,7 @@
double d10;
double d11;
- if (!World.func_147466_a(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_))
+ if (!World.func_147466_a(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_, UP))
{
float f2 = 0.2F;
float f1 = 0.0625F;
@@ -2060,7 +2064,7 @@
d0 = d5;
}
- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_ - 1, p_147801_3_, p_147801_4_))
+ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_ - 1, p_147801_3_, p_147801_4_, EAST))
{
tessellator.func_78374_a((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1);
tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1), d2, d3);
@@ -2072,7 +2076,7 @@
tessellator.func_78374_a((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1);
}
- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_ + 1, p_147801_3_, p_147801_4_))
+ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_ + 1, p_147801_3_, p_147801_4_, WEST))
{
tessellator.func_78374_a((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1);
tessellator.func_78374_a((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d0, d3);
@@ -2084,7 +2088,7 @@
tessellator.func_78374_a((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1);
}
- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ - 1))
+ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ - 1, SOUTH))
{
tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d2, d1);
tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d2, d3);
@@ -2096,7 +2100,7 @@
tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d2, d1);
}
- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ + 1))
+ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ + 1, NORTH))
{
tessellator.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d0, d1);
tessellator.func_78374_a((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1 - 0), d0, d3);
@@ -2108,7 +2112,7 @@
tessellator.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d0, d1);
}
- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_ + 1, p_147801_4_))
+ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_ + 1, p_147801_4_, DOWN))
{
d5 = (double)p_147801_2_ + 0.5D + 0.5D;
d6 = (double)p_147801_2_ + 0.5D - 0.5D;
@@ -3121,10 +3125,10 @@
double d16 = (double)p_147767_2_ + 0.5D + 0.0625D;
double d17 = (double)p_147767_4_ + 0.5D - 0.0625D;
double d18 = (double)p_147767_4_ + 0.5D + 0.0625D;
- boolean flag = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_, p_147767_3_, p_147767_4_ - 1));
- boolean flag1 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_, p_147767_3_, p_147767_4_ + 1));
- boolean flag2 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_ - 1, p_147767_3_, p_147767_4_));
- boolean flag3 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_ + 1, p_147767_3_, p_147767_4_));
+ boolean flag = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_, p_147767_3_, p_147767_4_ - 1, NORTH);
+ boolean flag1 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_, p_147767_3_, p_147767_4_ + 1, SOUTH);
+ boolean flag2 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_ - 1, p_147767_3_, p_147767_4_, WEST );
+ boolean flag3 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_ + 1, p_147767_3_, p_147767_4_, EAST );
boolean flag4 = p_147767_1_.func_149646_a(this.field_147845_a, p_147767_2_, p_147767_3_ + 1, p_147767_4_, 1);
boolean flag5 = p_147767_1_.func_149646_a(this.field_147845_a, p_147767_2_, p_147767_3_ - 1, p_147767_4_, 0);
double d19 = 0.01D;
@@ -8247,4 +8251,18 @@
return (IIcon)p_147758_1_;
}
+
+ /*==================================== FORGE START ===========================================*/
+ private static RenderBlocks instance;
+ /**
+ * Returns a single lazy loaded instance of RenderBlocks, for use in mods who
+ * don't care about the interaction of other objects on the current state of the RenderBlocks they are using.
+ * @return A global instance of RenderBlocks
+ */
+ public static RenderBlocks getInstance()
+ {
+ if (instance == null) instance = new RenderBlocks();
+ return instance;
+ }
+ /*==================================== FORGE END =============================================*/
}

View File

@ -1,130 +1,134 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/RenderGlobal.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/RenderGlobal.java
@@ -79,6 +79,9 @@
import org.lwjgl.opengl.ARBOcclusionQuery;
import org.lwjgl.opengl.GL11;
@@ -517,8 +517,10 @@
+import net.minecraftforge.client.IRenderHandler;
+import net.minecraftforge.client.MinecraftForgeClient;
+
@SideOnly(Side.CLIENT)
public class RenderGlobal implements IWorldAccess
{
@@ -376,8 +379,10 @@
public void func_147589_a(EntityLivingBase p_147589_1_, ICamera p_147589_2_, float p_147589_3_)
public void func_180446_a(Entity p_180446_1_, ICamera p_180446_2_, float p_180446_3_)
{
+ int pass = MinecraftForgeClient.getRenderPass();
+ int pass = net.minecraftforge.client.MinecraftForgeClient.getRenderPass();
if (this.field_72740_G > 0)
{
+ if (pass > 0) return;
--this.field_72740_G;
}
else
@@ -388,9 +393,12 @@
@@ -529,9 +531,12 @@
this.field_72769_h.field_72984_F.func_76320_a("prepare");
TileEntityRendererDispatcher.field_147556_a.func_147542_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.field_71451_h, p_147589_3_);
RenderManager.field_78727_a.func_147938_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.field_71451_h, this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_147589_3_);
TileEntityRendererDispatcher.field_147556_a.func_178470_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), p_180446_3_);
this.field_175010_j.func_180597_a(this.field_72769_h, this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_180446_3_);
+ if (pass == 0) // no indentation to shrink patch
+ {
this.field_72748_H = 0;
this.field_72749_I = 0;
this.field_72750_J = 0;
+ }
EntityLivingBase entitylivingbase1 = this.field_72777_q.field_71451_h;
double d3 = entitylivingbase1.field_70142_S + (entitylivingbase1.field_70165_t - entitylivingbase1.field_70142_S) * (double)p_147589_3_;
double d4 = entitylivingbase1.field_70137_T + (entitylivingbase1.field_70163_u - entitylivingbase1.field_70137_T) * (double)p_147589_3_;
@@ -419,13 +427,17 @@
this.field_72777_q.field_71460_t.func_78463_b((double)p_147589_3_);
Entity entity1 = this.field_72777_q.func_175606_aa();
double d3 = entity1.field_70142_S + (entity1.field_70165_t - entity1.field_70142_S) * (double)p_180446_3_;
double d4 = entity1.field_70137_T + (entity1.field_70163_u - entity1.field_70137_T) * (double)p_180446_3_;
@@ -543,13 +548,17 @@
this.field_72777_q.field_71460_t.func_180436_i();
this.field_72769_h.field_72984_F.func_76318_c("global");
List list = this.field_72769_h.func_72910_y();
+ if (pass == 0) // no indentation for smaller patch size
+ if (pass == 0) // no indentation to shrink patch
+ {
this.field_72748_H = list.size();
+ }
int i;
Entity entity;
Entity entity2;
for (i = 0; i < this.field_72769_h.field_73007_j.size(); ++i)
{
entity = (Entity)this.field_72769_h.field_73007_j.get(i);
+ if (!entity.shouldRenderInPass(pass)) continue;
entity2 = (Entity)this.field_72769_h.field_73007_j.get(i);
+ if (!entity2.shouldRenderInPass(pass)) continue;
++this.field_72749_I;
if (entity.func_145770_h(d0, d1, d2))
@@ -439,6 +451,7 @@
for (i = 0; i < list.size(); ++i)
{
entity = (Entity)list.get(i);
+ if (!entity.shouldRenderInPass(pass)) continue;
boolean flag = entity.func_145770_h(d0, d1, d2) && (entity.field_70158_ak || p_147589_2_.func_78546_a(entity.field_70121_D) || entity.field_70153_n == this.field_72777_q.field_71439_g);
if (entity2.func_145770_h(d0, d1, d2))
@@ -571,6 +580,7 @@
for (i = 0; i < list.size(); ++i)
{
entity2 = (Entity)list.get(i);
+ if (!entity2.shouldRenderInPass(pass)) continue;
boolean flag = this.field_72777_q.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_72777_q.func_175606_aa()).func_70608_bn();
boolean flag1 = entity2.func_145770_h(d0, d1, d2) && (entity2.field_70158_ak || p_180446_2_.func_78546_a(entity2.func_174813_aQ()) || entity2.field_70153_n == this.field_72777_q.field_71439_g) && entity2 instanceof EntityPlayer;
if (!flag && entity instanceof EntityLiving)
@@ -464,7 +477,11 @@
@@ -605,6 +615,7 @@
while (iterator2.hasNext())
{
Entity entity3 = (Entity)iterator2.next();
+ if (!entity3.shouldRenderInPass(pass)) continue;
boolean flag2 = this.field_175010_j.func_178635_a(entity3, p_180446_2_, d0, d1, d2) || entity3.field_70153_n == this.field_72777_q.field_71439_g;
for (i = 0; i < this.field_147598_a.size(); ++i)
{
- TileEntityRendererDispatcher.field_147556_a.func_147544_a((TileEntity)this.field_147598_a.get(i), p_147589_3_);
+ TileEntity tile = (TileEntity)this.field_147598_a.get(i);
+ if (tile.shouldRenderInPass(pass) && p_147589_2_.func_78546_a(tile.getRenderBoundingBox()))
+ {
+ TileEntityRendererDispatcher.field_147556_a.func_147544_a(tile, p_147589_3_);
+ }
if (flag2)
@@ -640,6 +651,7 @@
while (iterator1.hasNext())
{
tileentity = (TileEntity)iterator1.next();
+ if (!tileentity.shouldRenderInPass(pass) || !p_180446_2_.func_78546_a(tileentity.getRenderBoundingBox())) continue;
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, p_180446_3_, -1);
}
}
@@ -671,7 +683,7 @@
this.field_72777_q.field_71460_t.func_78483_a((double)p_147589_3_);
@@ -941,6 +958,12 @@
Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
public void func_72714_a(float p_72714_1_)
- if (tileentity != null && (block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull))
+ if (tileentity != null && tileentity.shouldRenderInPass(pass) && tileentity.canRenderBreaking() && p_180446_2_.func_78546_a(tileentity.getRenderBoundingBox()))
{
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, p_180446_3_, destroyblockprogress.func_73106_e());
}
@@ -1151,6 +1163,12 @@
public void func_174976_a(float p_174976_1_, int p_174976_2_)
{
+ IRenderHandler skyProvider = null;
+ if ((skyProvider = this.field_72777_q.field_71441_e.field_73011_w.getSkyRenderer()) != null)
+ net.minecraftforge.client.IRenderHandler renderer = this.field_72769_h.field_73011_w.getSkyRenderer();
+ if (renderer != null)
+ {
+ skyProvider.render(p_72714_1_, this.field_72769_h, field_72777_q);
+ renderer.render(p_174976_1_, field_72769_h, field_72777_q);
+ return;
+ }
if (this.field_72777_q.field_71441_e.field_73011_w.field_76574_g == 1)
if (this.field_72777_q.field_71441_e.field_73011_w.func_177502_q() == 1)
{
GL11.glDisable(GL11.GL_FOG);
@@ -1179,6 +1202,12 @@
this.func_180448_r();
@@ -1381,6 +1399,12 @@
public void func_72718_b(float p_72718_1_)
public void func_180447_b(float p_180447_1_, int p_180447_2_)
{
+ IRenderHandler renderer = null;
+ if ((renderer = field_72769_h.field_73011_w.getCloudRenderer()) != null)
+ net.minecraftforge.client.IRenderHandler renderer = this.field_72777_q.field_71441_e.field_73011_w.getCloudRenderer();
+ if (renderer != null)
+ {
+ renderer.render(p_72718_1_, field_72769_h, field_72777_q);
+ renderer.render(p_180447_1_, this.field_72777_q.field_71441_e, field_72777_q);
+ return;
+ }
if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d())
{
if (this.field_72777_q.field_71474_y.field_74347_j)
@@ -1579,6 +1608,11 @@
@@ -1805,8 +1829,11 @@
double d4 = (double)blockpos.func_177956_o() - d1;
double d5 = (double)blockpos.func_177952_p() - d2;
Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
+ TileEntity te = this.field_72769_h.func_175625_s(blockpos);
+ boolean hasBreak = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull;
+ if (!hasBreak) hasBreak = te != null && te.canRenderBreaking();
public void func_72717_a(Tessellator p_72717_1_, EntityPlayer p_72717_2_, float p_72717_3_)
{
+ drawBlockDamageTexture(p_72717_1_, (EntityLivingBase)p_72717_2_, p_72717_3_);
+ }
+
+ public void drawBlockDamageTexture(Tessellator p_72717_1_, EntityLivingBase p_72717_2_, float p_72717_3_)
+ {
double d0 = p_72717_2_.field_70142_S + (p_72717_2_.field_70165_t - p_72717_2_.field_70142_S) * (double)p_72717_3_;
double d1 = p_72717_2_.field_70137_T + (p_72717_2_.field_70163_u - p_72717_2_.field_70137_T) * (double)p_72717_3_;
double d2 = p_72717_2_.field_70136_U + (p_72717_2_.field_70161_v - p_72717_2_.field_70136_U) * (double)p_72717_3_;
@@ -1798,12 +1832,15 @@
- if (!(block instanceof BlockChest) && !(block instanceof BlockEnderChest) && !(block instanceof BlockSign) && !(block instanceof BlockSkull))
+ if (!hasBreak)
{
if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D)
{
@@ -1949,13 +1976,16 @@
if (p_174961_1_ != null)
{
ItemRecord itemrecord = ItemRecord.func_150926_b(p_72702_1_);
ItemRecord itemrecord = ItemRecord.func_150926_b(p_174961_1_);
+ ResourceLocation resource = null;
if (itemrecord != null)
{
this.field_72777_q.field_71456_v.func_73833_a(itemrecord.func_150927_i());
+ resource = itemrecord.getRecordResource(p_72702_1_);
+ resource = itemrecord.getRecordResource(p_174961_1_);
}
- PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(new ResourceLocation(p_72702_1_), (float)p_72702_2_, (float)p_72702_3_, (float)p_72702_4_);
+ if (resource == null) resource = new ResourceLocation(p_72702_1_);
+ PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(resource, (float)p_72702_2_, (float)p_72702_3_, (float)p_72702_4_);
this.field_147593_P.put(chunkcoordinates, positionedsoundrecord);
- PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(new ResourceLocation(p_174961_1_), (float)p_174961_2_.func_177958_n(), (float)p_174961_2_.func_177956_o(), (float)p_174961_2_.func_177952_p());
+ if (resource == null) resource = new ResourceLocation(p_174961_1_);
+ PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(resource, (float)p_174961_2_.func_177958_n(), (float)p_174961_2_.func_177956_o(), (float)p_174961_2_.func_177952_p());
this.field_147593_P.put(p_174961_2_, positionedsoundrecord);
this.field_72777_q.func_147118_V().func_147682_a(positionedsoundrecord);
}

View File

@ -1,145 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/Tessellator.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/Tessellator.java
@@ -7,6 +7,7 @@
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.nio.ShortBuffer;
+import java.util.Arrays;
import java.util.PriorityQueue;
import net.minecraft.client.shader.TesselatorVertexState;
import net.minecraft.client.util.QuadComparator;
@@ -15,10 +16,17 @@
@SideOnly(Side.CLIENT)
public class Tessellator
{
- private ByteBuffer field_78394_d;
- private IntBuffer field_147568_c;
- private FloatBuffer field_147566_d;
- private ShortBuffer field_147567_e;
+ private static int nativeBufferSize = 0x200000;
+ private static int trivertsInBuffer = (nativeBufferSize / 48) * 6;
+ public static boolean renderingWorldRenderer = false;
+ public boolean defaultTexture = false;
+ private int rawBufferSize = 0;
+ public int textureID = 0;
+
+ private static ByteBuffer field_78394_d = GLAllocation.func_74524_c(nativeBufferSize * 4);
+ private static IntBuffer field_147568_c = field_78394_d.asIntBuffer();
+ private static FloatBuffer field_147566_d = field_78394_d.asFloatBuffer();
+ private static ShortBuffer field_147567_e = field_78394_d.asShortBuffer();
private int[] field_78405_h;
private int field_78406_i;
private double field_78403_j;
@@ -44,14 +52,17 @@
private Tessellator(int p_i1250_1_)
{
- this.field_78388_E = p_i1250_1_;
- this.field_78394_d = GLAllocation.func_74524_c(p_i1250_1_ * 4);
- this.field_147568_c = this.field_78394_d.asIntBuffer();
- this.field_147566_d = this.field_78394_d.asFloatBuffer();
- this.field_147567_e = this.field_78394_d.asShortBuffer();
- this.field_78405_h = new int[p_i1250_1_];
}
+ public Tessellator()
+ {
+ }
+
+ static
+ {
+ field_78398_a.defaultTexture = true;
+ }
+
public int func_78381_a()
{
if (!this.field_78415_z)
@@ -62,12 +73,15 @@
{
this.field_78415_z = false;
- if (this.field_78406_i > 0)
+ int offs = 0;
+ while (offs < field_78406_i)
{
+ int vtc = Math.min(field_78406_i - offs, nativeBufferSize >> 5);
this.field_147568_c.clear();
- this.field_147568_c.put(this.field_78405_h, 0, this.field_147569_p);
+ this.field_147568_c.put(this.field_78405_h, offs * 8, vtc * 8);
this.field_78394_d.position(0);
- this.field_78394_d.limit(this.field_147569_p * 4);
+ this.field_78394_d.limit(vtc * 32);
+ offs += vtc;
if (this.field_78400_o)
{
@@ -102,7 +116,7 @@
this.field_147566_d.position(0);
GL11.glVertexPointer(3, 32, this.field_147566_d);
GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
- GL11.glDrawArrays(this.field_78409_u, 0, this.field_78406_i);
+ GL11.glDrawArrays(this.field_78409_u, 0, vtc);
GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
if (this.field_78400_o)
@@ -128,6 +142,12 @@
}
}
+ if (rawBufferSize > 0x20000 && field_147569_p < (rawBufferSize << 3))
+ {
+ rawBufferSize = 0x10000;
+ field_78405_h = new int[rawBufferSize];
+ }
+
int i = this.field_147569_p * 4;
this.func_78379_d();
return i;
@@ -162,6 +182,14 @@
public void func_147565_a(TesselatorVertexState p_147565_1_)
{
+ while (p_147565_1_.func_147572_a().length > rawBufferSize && rawBufferSize > 0)
+ {
+ rawBufferSize <<= 1;
+ }
+ if (rawBufferSize > field_78405_h.length)
+ {
+ field_78405_h = new int[rawBufferSize];
+ }
System.arraycopy(p_147565_1_.func_147572_a(), 0, this.field_78405_h, 0, p_147565_1_.func_147572_a().length);
this.field_147569_p = p_147565_1_.func_147576_b();
this.field_78406_i = p_147565_1_.func_147575_c();
@@ -301,6 +329,19 @@
public void func_78377_a(double p_78377_1_, double p_78377_3_, double p_78377_5_)
{
+ if (field_147569_p >= rawBufferSize - 32)
+ {
+ if (rawBufferSize == 0)
+ {
+ rawBufferSize = 0x10000;
+ field_78405_h = new int[rawBufferSize];
+ }
+ else
+ {
+ rawBufferSize *= 2;
+ field_78405_h = Arrays.copyOf(field_78405_h, rawBufferSize);
+ }
+ }
++this.field_78411_s;
if (this.field_78400_o)
@@ -329,12 +370,6 @@
this.field_78405_h[this.field_147569_p + 2] = Float.floatToRawIntBits((float)(p_78377_5_ + this.field_78417_x));
this.field_147569_p += 8;
++this.field_78406_i;
-
- if (this.field_78406_i % 4 == 0 && this.field_147569_p >= this.field_78388_E - 32)
- {
- this.func_78381_a();
- this.field_78415_z = true;
- }
}
public void func_78378_d(int p_78378_1_)

View File

@ -1,85 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/WorldRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/WorldRenderer.java
@@ -28,7 +28,7 @@
private TesselatorVertexState field_147894_y;
public World field_78924_a;
private int field_78942_y = -1;
- private static Tessellator field_78941_z = Tessellator.field_78398_a;
+ //private static Tessellator tessellator = Tessellator.instance;
public static int field_78922_b;
public int field_78923_c;
public int field_78920_d;
@@ -132,6 +132,7 @@
{
++field_78922_b;
RenderBlocks renderblocks = new RenderBlocks(chunkcache);
+ net.minecraftforge.client.ForgeHooksClient.setWorldRendererRB(renderblocks);
this.field_78917_C = 0;
this.field_147894_y = null;
@@ -157,7 +158,7 @@
this.func_147890_b(k2);
}
- if (k2 == 0 && block.func_149716_u())
+ if (k2 == 0 && block.hasTileEntity(chunkcache.func_72805_g(j3, l2, i3)))
{
TileEntity tileentity = chunkcache.func_147438_o(j3, l2, i3);
@@ -173,7 +174,9 @@
{
flag = true;
}
- else if (k3 == k2)
+
+ if (!block.canRenderInPass(k2)) continue;
+
{
flag1 |= renderblocks.func_147805_b(block, j3, l2, i3);
@@ -210,6 +213,7 @@
break;
}
}
+ net.minecraftforge.client.ForgeHooksClient.setWorldRendererRB(null);
}
HashSet hashset1 = new HashSet();
@@ -232,21 +236,23 @@
GL11.glTranslatef(-8.0F, -8.0F, -8.0F);
GL11.glScalef(f, f, f);
GL11.glTranslatef(8.0F, 8.0F, 8.0F);
- field_78941_z.func_78382_b();
- field_78941_z.func_78373_b((double)(-this.field_78923_c), (double)(-this.field_78920_d), (double)(-this.field_78921_e));
+ net.minecraftforge.client.ForgeHooksClient.onPreRenderWorld(this, p_147890_1_);
+ Tessellator.field_78398_a.func_78382_b();
+ Tessellator.field_78398_a.func_78373_b((double)(-this.field_78923_c), (double)(-this.field_78920_d), (double)(-this.field_78921_e));
}
private void func_147891_a(int p_147891_1_, EntityLivingBase p_147891_2_)
{
if (p_147891_1_ == 1 && !this.field_78928_m[p_147891_1_])
{
- this.field_147894_y = field_78941_z.func_147564_a((float)p_147891_2_.field_70165_t, (float)p_147891_2_.field_70163_u, (float)p_147891_2_.field_70161_v);
+ this.field_147894_y = Tessellator.field_78398_a.func_147564_a((float)p_147891_2_.field_70165_t, (float)p_147891_2_.field_70163_u, (float)p_147891_2_.field_70161_v);
}
- this.field_78917_C += field_78941_z.func_78381_a();
+ this.field_78917_C += Tessellator.field_78398_a.func_78381_a();
+ net.minecraftforge.client.ForgeHooksClient.onPostRenderWorld(this, p_147891_1_);
GL11.glPopMatrix();
GL11.glEndList();
- field_78941_z.func_78373_b(0.0D, 0.0D, 0.0D);
+ Tessellator.field_78398_a.func_78373_b(0.0D, 0.0D, 0.0D);
}
public void func_147889_b(EntityLivingBase p_147889_1_)
@@ -254,7 +260,7 @@
if (this.field_147894_y != null && !this.field_78928_m[1])
{
this.func_147890_b(1);
- field_78941_z.func_147565_a(this.field_147894_y);
+ Tessellator.field_78398_a.func_147565_a(this.field_147894_y);
this.func_147891_a(1, p_147889_1_);
}
}

View File

@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/chunk/RenderChunk.java
@@ -150,7 +150,7 @@
visgraph.func_178606_a(mutableblockpos);
}
- if (block.func_149716_u())
+ if (block.hasTileEntity(iblockstate))
{
TileEntity tileentity = regionrendercache.func_175625_s(new BlockPos(mutableblockpos));

View File

@ -1,122 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java
@@ -54,11 +54,13 @@
this.field_82425_h = new ModelBiped(0.5F);
}
+ @Deprecated //Use the more sensitive version getArmorResource below
public static ResourceLocation func_110857_a(ItemArmor p_110857_0_, int p_110857_1_)
{
return func_110858_a(p_110857_0_, p_110857_1_, (String)null);
}
+ @Deprecated //Use the more sensitive version getArmorResource below
public static ResourceLocation func_110858_a(ItemArmor p_110858_0_, int p_110858_1_, String p_110858_2_)
{
String s1 = String.format("textures/models/armor/%s_layer_%d%s.png", new Object[] {field_82424_k[p_110858_0_.field_77880_c], Integer.valueOf(p_110858_1_ == 2 ? 2 : 1), p_110858_2_ == null ? "" : String.format("_%s", new Object[]{p_110858_2_})});
@@ -84,7 +86,7 @@
if (item instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)item;
- this.func_110776_a(func_110857_a(itemarmor, p_77032_2_));
+ this.func_110776_a(getArmorResource(p_77032_1_, itemstack, p_77032_2_, null));
ModelBiped modelbiped = p_77032_2_ == 2 ? this.field_82425_h : this.field_82423_g;
modelbiped.field_78116_c.field_78806_j = p_77032_2_ == 0;
modelbiped.field_78114_d.field_78806_j = p_77032_2_ == 0;
@@ -93,14 +95,16 @@
modelbiped.field_78113_g.field_78806_j = p_77032_2_ == 1;
modelbiped.field_78123_h.field_78806_j = p_77032_2_ == 2 || p_77032_2_ == 3;
modelbiped.field_78124_i.field_78806_j = p_77032_2_ == 2 || p_77032_2_ == 3;
+ modelbiped = net.minecraftforge.client.ForgeHooksClient.getArmorModel(p_77032_1_, itemstack, p_77032_2_, modelbiped);
this.func_77042_a(modelbiped);
modelbiped.field_78095_p = this.field_77045_g.field_78095_p;
modelbiped.field_78093_q = this.field_77045_g.field_78093_q;
modelbiped.field_78091_s = this.field_77045_g.field_78091_s;
- if (itemarmor.func_82812_d() == ItemArmor.ArmorMaterial.CLOTH)
+ //Move out of if to allow for more then just CLOTH to have color
+ int j = itemarmor.func_82814_b(itemstack);
+ if (j != -1)
{
- int j = itemarmor.func_82814_b(itemstack);
float f1 = (float)(j >> 16 & 255) / 255.0F;
float f2 = (float)(j >> 8 & 255) / 255.0F;
float f3 = (float)(j & 255) / 255.0F;
@@ -138,7 +142,7 @@
if (item instanceof ItemArmor)
{
- this.func_110776_a(func_110858_a((ItemArmor)item, p_82408_2_, "overlay"));
+ this.func_110776_a(getArmorResource(p_82408_1_, itemstack, p_82408_2_, "overlay"));
float f1 = 1.0F;
GL11.glColor3f(1.0F, 1.0F, 1.0F);
}
@@ -189,9 +193,12 @@
this.field_77071_a.field_78116_c.func_78794_c(0.0625F);
item = itemstack1.func_77973_b();
+ net.minecraftforge.client.IItemRenderer customRenderer = net.minecraftforge.client.MinecraftForgeClient.getItemRenderer(itemstack1, net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED);
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED, itemstack1, net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D));
+
if (item instanceof ItemBlock)
{
- if (RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b()))
+ if (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b()))
{
f1 = 0.625F;
GL11.glTranslatef(0.0F, -0.25F, 0.0F);
@@ -243,7 +250,10 @@
this.field_77071_a.field_78112_f.func_78794_c(0.0625F);
GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
- if (item instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b()))
+ net.minecraftforge.client.IItemRenderer customRenderer = net.minecraftforge.client.MinecraftForgeClient.getItemRenderer(itemstack, net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED);
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED, itemstack, net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D));
+
+ if (item instanceof ItemBlock && (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b())))
{
f1 = 0.5F;
GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
@@ -292,7 +302,7 @@
if (itemstack.func_77973_b().func_77623_v())
{
- for (i = 0; i <= 1; ++i)
+ for (i = 0; i < itemstack.func_77973_b().getRenderPasses(itemstack.func_77960_j()); ++i)
{
int j = itemstack.func_77973_b().func_82790_a(itemstack, i);
f5 = (float)(j >> 16 & 255) / 255.0F;
@@ -350,4 +360,33 @@
{
this.func_76986_a((EntityLiving)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
+
+ /*=================================== FORGE START =========================================*/
+ /**
+ * More generic ForgeHook version of the above function, it allows for Items to have more control over what texture they provide.
+ *
+ * @param entity Entity wearing the armor
+ * @param stack ItemStack for the armor
+ * @param slot Slot ID that the item is in
+ * @param type Subtype, can be null or "overlay"
+ * @return ResourceLocation pointing at the armor's texture
+ */
+ public static ResourceLocation getArmorResource(Entity entity, ItemStack stack, int slot, String type)
+ {
+ ItemArmor item = (ItemArmor)stack.func_77973_b();
+ String s1 = String.format("textures/models/armor/%s_layer_%d%s.png",
+ field_82424_k[item.field_77880_c], (slot == 2 ? 2 : 1), type == null ? "" : String.format("_%s", type));
+
+ s1 = net.minecraftforge.client.ForgeHooksClient.getArmorTexture(entity, stack, s1, slot, type);
+ ResourceLocation resourcelocation = (ResourceLocation)field_110859_k.get(s1);
+
+ if (resourcelocation == null)
+ {
+ resourcelocation = new ResourceLocation(s1);
+ field_110859_k.put(s1, resourcelocation);
+ }
+
+ return resourcelocation;
+ }
+ /*=================================== FORGE END ===========================================*/
}

View File

@ -0,0 +1,67 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderEntityItem.java
@@ -42,7 +42,7 @@
boolean flag = p_177077_9_.func_177556_c();
int i = this.func_177078_a(itemstack);
float f1 = 0.25F;
- float f2 = MathHelper.func_76126_a(((float)p_177077_1_.func_174872_o() + p_177077_8_) / 10.0F + p_177077_1_.field_70290_d) * 0.1F + 0.1F;
+ float f2 = shouldBob() ? MathHelper.func_76126_a(((float)p_177077_1_.func_174872_o() + p_177077_8_) / 10.0F + p_177077_1_.field_70290_d) * 0.1F + 0.1F : 0.0F;
GlStateManager.func_179109_b((float)p_177077_2_, (float)p_177077_4_ + f2 + 0.25F, (float)p_177077_6_);
float f3;
@@ -109,6 +109,9 @@
IBakedModel ibakedmodel = this.field_177080_a.func_175037_a().func_178089_a(itemstack);
int i = this.func_177077_a(p_177075_1_, p_177075_2_, p_177075_4_, p_177075_6_, p_177075_9_, ibakedmodel);
+ // Forge: Call to IItemRenderer, For now Its disabled.
+ //i = net.minecraftforge.client.ForgeHooksClient.renderEntityItem(p_177075_1_, itemstack, this.field_177079_e, this.renderManager.renderEngine, i);
+
for (int j = 0; j < i; ++j)
{
if (ibakedmodel.func_177556_c())
@@ -129,8 +132,19 @@
}
else
{
+ GlStateManager.func_179094_E();
+ // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug...
+ if (j > 0 && shouldSpreadItems())
+ {
+ float f2 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
+ float f3 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
+ float f4 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
+ GlStateManager.func_179109_b(f2, f3, 0.046875F);
+ }
this.field_177080_a.func_180454_a(itemstack, ibakedmodel);
+ if (!shouldSpreadItems())
GlStateManager.func_179109_b(0.0F, 0.0F, 0.046875F);
+ GlStateManager.func_179121_F();
}
}
@@ -161,4 +175,25 @@
{
this.func_177075_a((EntityItem)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
+
+ /*==================================== FORGE START ===========================================*/
+
+ /**
+ * Items should spread out when rendered in 3d?
+ * @return
+ */
+ public boolean shouldSpreadItems()
+ {
+ return true;
+ }
+
+ /**
+ * Items should have a bob effect
+ * @return
+ */
+ public boolean shouldBob()
+ {
+ return true;
+ }
+ /*==================================== FORGE END =============================================*/
}

View File

@ -1,332 +1,57 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderItem.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderItem.java
@@ -18,6 +18,7 @@
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
+import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemCloth;
import net.minecraft.item.ItemStack;
@@ -28,6 +29,8 @@
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
+import net.minecraftforge.client.ForgeHooksClient;
+
@SideOnly(Side.CLIENT)
public class RenderItem extends Render
{
@@ -55,7 +58,7 @@
TextureUtil.func_152777_a(false, false, 1.0F);
this.field_77025_h.setSeed(187L);
GL11.glPushMatrix();
- float f2 = MathHelper.func_76126_a(((float)p_76986_1_.field_70292_b + p_76986_9_) / 10.0F + p_76986_1_.field_70290_d) * 0.1F + 0.1F;
+ float f2 = shouldBob() ? MathHelper.func_76126_a(((float)p_76986_1_.field_70292_b + p_76986_9_) / 10.0F + p_76986_1_.field_70290_d) * 0.1F + 0.1F : 0F;
float f3 = (((float)p_76986_1_.field_70292_b + p_76986_9_) / 20.0F + p_76986_1_.field_70290_d) * (180F / (float)Math.PI);
byte b0 = 1;
@@ -79,12 +82,19 @@
b0 = 5;
}
+ b0 = getMiniBlockCount(itemstack, b0);
+
GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_ + f2, (float)p_76986_6_);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
float f6;
float f7;
int k;
+ if (ForgeHooksClient.renderEntityItem(p_76986_1_, itemstack, f2, f3, field_77025_h, field_76990_c.field_78724_e, field_147909_c, b0))
+ {
+ ;
+ }
+ else // Code Style break here to prevent the patch from editing this line
if (itemstack.func_94608_d() == 0 && itemstack.func_77973_b() instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.func_77973_b()).func_149645_b()))
{
Block block = Block.func_149634_a(itemstack.func_77973_b());
@@ -139,7 +149,7 @@
{
float f5;
- if (itemstack.func_94608_d() == 1 && itemstack.func_77973_b().func_77623_v())
+ if (/*itemstack.getItemSpriteNumber() == 1 &&*/ itemstack.func_77973_b().func_77623_v())
{
if (field_82407_g)
{
@@ -151,10 +161,10 @@
GL11.glScalef(0.5F, 0.5F, 0.5F);
}
- for (int j = 0; j <= 1; ++j)
+ for (int j = 0; j < itemstack.func_77973_b().getRenderPasses(itemstack.func_77960_j()); ++j)
{
this.field_77025_h.setSeed(187L);
- IIcon iicon1 = itemstack.func_77973_b().func_77618_c(itemstack.func_77960_j(), j);
+ IIcon iicon1 = itemstack.func_77973_b().getIcon(itemstack, j);
if (this.field_77024_a)
{
@@ -163,11 +173,11 @@
f6 = (float)(k >> 8 & 255) / 255.0F;
f7 = (float)(k & 255) / 255.0F;
GL11.glColor4f(f5, f6, f7, 1.0F);
- this.func_77020_a(p_76986_1_, iicon1, b0, p_76986_9_, f5, f6, f7);
+ this.renderDroppedItem(p_76986_1_, iicon1, b0, p_76986_9_, f5, f6, f7, j);
}
else
{
- this.func_77020_a(p_76986_1_, iicon1, b0, p_76986_9_, 1.0F, 1.0F, 1.0F);
+ this.renderDroppedItem(p_76986_1_, iicon1, b0, p_76986_9_, 1.0F, 1.0F, 1.0F, j);
}
}
@@ -302,6 +302,10 @@
modelresourcelocation = new ModelResourceLocation("bow_pulling_0", "inventory");
}
@@ -226,6 +236,11 @@
private void func_77020_a(EntityItem p_77020_1_, IIcon p_77020_2_, int p_77020_3_, float p_77020_4_, float p_77020_5_, float p_77020_6_, float p_77020_7_)
{
+ this.renderDroppedItem(p_77020_1_, p_77020_2_, p_77020_3_, p_77020_4_, p_77020_5_, p_77020_6_, p_77020_7_, 0);
+ }
+
+ private void renderDroppedItem(EntityItem p_77020_1_, IIcon p_77020_2_, int p_77020_3_, float p_77020_4_, float p_77020_5_, float p_77020_6_, float p_77020_7_, int pass)
+ {
Tessellator tessellator = Tessellator.field_78398_a;
if (p_77020_2_ == null)
@@ -280,11 +295,24 @@
b0 = 4;
}
+ b0 = getMiniItemCount(itemstack, b0);
+
GL11.glTranslatef(-f7, -f8, -((f9 + f10) * (float)b0 / 2.0F));
for (int k = 0; k < b0; ++k)
{
- GL11.glTranslatef(0.0F, 0.0F, f9 + f10);
+ // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug...
+ if (k > 0 && shouldSpreadItems())
+ {
+ float x = (field_77025_h.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
+ float y = (field_77025_h.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
+ float z = (field_77025_h.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
+ GL11.glTranslatef(x, y, f9 + f10);
+ }
+ else
+ {
+ GL11.glTranslatef(0f, 0f, f9 + f10);
+ }
if (itemstack.func_94608_d() == 0)
{
@@ -298,7 +326,7 @@
GL11.glColor4f(p_77020_5_, p_77020_6_, p_77020_7_, 1.0F);
ItemRenderer.func_78439_a(tessellator, f15, f4, f14, f5, ((IIcon)p_77020_2_).func_94211_a(), ((IIcon)p_77020_2_).func_94216_b(), f9);
- if (itemstack.func_77962_s())
+ if (itemstack.hasEffect(pass))
{
GL11.glDepthFunc(GL11.GL_EQUAL);
GL11.glDisable(GL11.GL_LIGHTING);
@@ -366,6 +394,11 @@
public void func_77015_a(FontRenderer p_77015_1_, TextureManager p_77015_2_, ItemStack p_77015_3_, int p_77015_4_, int p_77015_5_)
{
+ this.renderItemIntoGUI(p_77015_1_, p_77015_2_, p_77015_3_, p_77015_4_, p_77015_5_, false);
+ }
+
+ public void renderItemIntoGUI(FontRenderer p_77015_1_, TextureManager p_77015_2_, ItemStack p_77015_3_, int p_77015_4_, int p_77015_5_, boolean renderEffect)
+ {
int k = p_77015_3_.func_77960_j();
Object object = p_77015_3_.func_77954_c();
int l;
@@ -442,11 +475,13 @@
GL11.glColorMask(true, true, true, true);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_ALPHA_TEST);
- OpenGlHelper.func_148821_a(770, 771, 1, 0);
- for (l = 0; l <= 1; ++l)
+ Item item = p_77015_3_.func_77973_b();
+ for (l = 0; l < item.getRenderPasses(k); ++l)
{
- IIcon iicon = p_77015_3_.func_77973_b().func_77618_c(k, l);
+ OpenGlHelper.func_148821_a(770, 771, 1, 0);
+ p_77015_2_.func_110577_a(item.func_94901_k() == 0 ? TextureMap.field_110575_b : TextureMap.field_110576_c);
+ IIcon iicon = item.getIcon(p_77015_3_, l);
int i1 = p_77015_3_.func_77973_b().func_82790_a(p_77015_3_, l);
f = (float)(i1 >> 16 & 255) / 255.0F;
float f1 = (float)(i1 >> 8 & 255) / 255.0F;
@@ -457,7 +492,18 @@
GL11.glColor4f(f, f1, f2, 1.0F);
}
+ GL11.glDisable(GL11.GL_LIGHTING); //Forge: Make sure that render states are reset, ad renderEffect can derp them up.
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+
this.func_94149_a(p_77015_4_, p_77015_5_, iicon, 16, 16);
+
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ GL11.glEnable(GL11.GL_LIGHTING);
+
+ if (renderEffect && p_77015_3_.hasEffect(l))
+ {
+ renderEffect(p_77015_2_, p_77015_4_, p_77015_5_);
+ }
}
GL11.glEnable(GL11.GL_LIGHTING);
@@ -485,14 +531,27 @@
GL11.glColor4f(f3, f4, f, 1.0F);
}
+ GL11.glDisable(GL11.GL_LIGHTING); //Forge: Make sure that render states are reset, a renderEffect can derp them up.
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ GL11.glEnable(GL11.GL_BLEND);
+
this.func_94149_a(p_77015_4_, p_77015_5_, (IIcon)object, 16, 16);
+
GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glDisable(GL11.GL_BLEND);
+
+ if (renderEffect && p_77015_3_.hasEffect(0))
+ else
+ {
+ renderEffect(p_77015_2_, p_77015_4_, p_77015_5_);
+ modelresourcelocation = item.getModel(p_175049_1_, entityplayer, p_175049_1_.func_77988_m() - entityplayer.func_71052_bv());
+ }
+ GL11.glEnable(GL11.GL_LIGHTING);
}
GL11.glEnable(GL11.GL_CULL_FACE);
}
+ @SuppressWarnings("unused")
public void func_82406_b(FontRenderer p_82406_1_, TextureManager p_82406_2_, final ItemStack p_82406_3_, int p_82406_4_, int p_82406_5_)
{
if (p_82406_3_ != null)
@@ -501,7 +560,10 @@
try
if (modelresourcelocation != null)
{
- this.func_77015_a(p_82406_1_, p_82406_2_, p_82406_3_, p_82406_4_, p_82406_5_);
+ if (!ForgeHooksClient.renderInventoryItem(this.field_147909_c, p_82406_2_, p_82406_3_, field_77024_a, field_77023_b, (float)p_82406_4_, (float)p_82406_5_))
+ {
+ this.renderItemIntoGUI(p_82406_1_, p_82406_2_, p_82406_3_, p_82406_4_, p_82406_5_, true);
+ }
}
catch (Throwable throwable)
{
@@ -542,7 +604,8 @@
throw new ReportedException(crashreport);
@@ -485,10 +489,11 @@
GlStateManager.func_179126_j();
}
- if (p_82406_3_.func_77962_s())
+ // Forge: Bugfix, Move this to a per-render pass, modders must handle themselves
+ if (false && p_82406_3_.func_77962_s())
- if (p_180453_2_.func_77951_h())
+ if (p_180453_2_.func_77973_b().showDurabilityBar(p_180453_2_))
{
GL11.glDepthFunc(GL11.GL_EQUAL);
GL11.glDisable(GL11.GL_LIGHTING);
@@ -562,6 +625,23 @@
}
}
+ public void renderEffect(TextureManager manager, int x, int y)
+ {
+ GL11.glDepthFunc(GL11.GL_EQUAL);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glDepthMask(false);
+ manager.func_110577_a(field_110798_h);
+ GL11.glEnable(GL11.GL_ALPHA_TEST);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F);
+ this.func_77018_a(x * 431278612 + y * 32178161, x - 2, y - 2, 20, 20);
+ GL11.glDepthMask(true);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glDisable(GL11.GL_ALPHA_TEST);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glDepthFunc(GL11.GL_LEQUAL);
+ }
+
private void func_77018_a(int p_77018_1_, int p_77018_2_, int p_77018_3_, int p_77018_4_, int p_77018_5_)
{
for (int j1 = 0; j1 < 2; ++j1)
@@ -608,10 +688,11 @@
GL11.glEnable(GL11.GL_DEPTH_TEST);
}
- if (p_94148_3_.func_77951_h())
+ if (p_94148_3_.func_77973_b().showDurabilityBar(p_94148_3_))
{
- int j1 = (int)Math.round(13.0D - (double)p_94148_3_.func_77952_i() * 13.0D / (double)p_94148_3_.func_77958_k());
- int k = (int)Math.round(255.0D - (double)p_94148_3_.func_77952_i() * 255.0D / (double)p_94148_3_.func_77958_k());
+ double health = p_94148_3_.func_77973_b().getDurabilityForDisplay(p_94148_3_);
- int j1 = (int)Math.round(13.0D - (double)p_180453_2_.func_77952_i() * 13.0D / (double)p_180453_2_.func_77958_k());
- int k = (int)Math.round(255.0D - (double)p_180453_2_.func_77952_i() * 255.0D / (double)p_180453_2_.func_77958_k());
+ double health = p_180453_2_.func_77973_b().getDurabilityForDisplay(p_180453_2_);
+ int j1 = (int)Math.round(13.0D - health * 13.0D);
+ int k = (int)Math.round(255.0D - health * 255.0D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_TEXTURE_2D);
@@ -623,7 +704,7 @@
this.func_77017_a(tessellator, p_94148_4_ + 2, p_94148_5_ + 13, 13, 2, 0);
this.func_77017_a(tessellator, p_94148_4_ + 2, p_94148_5_ + 13, 12, 1, i1);
this.func_77017_a(tessellator, p_94148_4_ + 2, p_94148_5_ + 13, j1, 1, l);
- GL11.glEnable(GL11.GL_BLEND);
+ //GL11.glEnable(GL11.GL_BLEND); // Forge: Disable Bled because it screws with a lot of things down the line.
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_LIGHTING);
@@ -664,4 +745,54 @@
GlStateManager.func_179140_f();
GlStateManager.func_179097_i();
GlStateManager.func_179090_x();
@@ -501,7 +506,7 @@
this.func_175044_a(worldrenderer, p_180453_3_ + 2, p_180453_4_ + 13, 13, 2, 0);
this.func_175044_a(worldrenderer, p_180453_3_ + 2, p_180453_4_ + 13, 12, 1, i1);
this.func_175044_a(worldrenderer, p_180453_3_ + 2, p_180453_4_ + 13, j1, 1, l);
- GlStateManager.func_179147_l();
+ //GlStateManager.enableBlend(); // Forge: Disable Bled because it screws with a lot of things down the line.
GlStateManager.func_179141_d();
GlStateManager.func_179098_w();
GlStateManager.func_179145_e();
@@ -1078,6 +1083,19 @@
{
this.func_76986_a((EntityItem)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
this.field_175059_m.func_178085_b();
}
+
+ /*==================================== FORGE START ===========================================*/
+
+ /**
+ * Items should spread out when rendered in 3d?
+ * @return
+ */
+ public boolean shouldSpreadItems()
+ {
+ return true;
+ }
+
+ /**
+ * Items should have a bob effect
+ * @return
+ */
+ public boolean shouldBob()
+ {
+ return true;
+ }
+
+ public byte getMiniBlockCount(ItemStack stack, byte original)
+ {
+ return original;
+ }
+
+ /**
+ * Allows for a subclass to override how many rendered items appear in a
+ * "mini item 3d stack"
+ * @param stack The item stack
+ * @param original The default amount vanilla would use
+ * @return
+ */
+ public byte getMiniItemCount(ItemStack stack, byte original)
+ {
+ return original;
+ }
+
+ /*==================================== FORGE START ===========================================* /
+ private static RenderItem instance;
+ /**
+ * Returns a single lazy loaded instance of RenderItem, for use in mods who
+ * don't care about the interaction of other objects on the current state of the RenderItem they are using.
+ * @return A global instance of RenderItem
+ */
+ * /
+ public static RenderItem getInstance()
+ {
+ if (instance == null) instance = new RenderItem();
+ return instance;
+ }
+ /*==================================== FORGE END =============================================*/
}
@SideOnly(Side.CLIENT)

View File

@ -1,19 +1,14 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderManager.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderManager.java
@@ -212,11 +212,13 @@
if (p_147938_4_.func_70608_bn())
{
Block block = p_147938_1_.func_147439_a(MathHelper.func_76128_c(p_147938_4_.field_70165_t), MathHelper.func_76128_c(p_147938_4_.field_70163_u), MathHelper.func_76128_c(p_147938_4_.field_70161_v));
+ int x = MathHelper.func_76128_c(p_147938_4_.field_70165_t);
+ int y = MathHelper.func_76128_c(p_147938_4_.field_70163_u);
+ int z = MathHelper.func_76128_c(p_147938_4_.field_70161_v);
@@ -241,9 +241,9 @@
IBlockState iblockstate = p_180597_1_.func_180495_p(new BlockPos(p_180597_3_));
Block block = iblockstate.func_177230_c();
- if (block == Blocks.field_150324_C)
+ if (block.isBed(p_147938_1_, x, y, z, p_147938_4_))
+ if (block.isBed(p_180597_1_, new BlockPos(p_180597_3_), (EntityLivingBase)p_180597_3_))
{
- int i = p_147938_1_.func_72805_g(MathHelper.func_76128_c(p_147938_4_.field_70165_t), MathHelper.func_76128_c(p_147938_4_.field_70163_u), MathHelper.func_76128_c(p_147938_4_.field_70161_v));
- int j = i & 3;
+ int j = block.getBedDirection(p_147938_1_, x, y, z);
this.field_78735_i = (float)(j * 90 + 180);
- int i = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_176387_N)).func_176736_b();
+ int i = block.getBedDirection(p_180597_1_, new BlockPos(p_180597_3_)).func_176736_b();
this.field_78735_i = (float)(i * 90 + 180);
this.field_78732_j = 0.0F;
}

View File

@ -1,143 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java
@@ -50,6 +50,13 @@
{
ItemStack itemstack = p_77032_1_.field_71071_by.func_70440_f(3 - p_77032_2_);
+ net.minecraftforge.client.event.RenderPlayerEvent.SetArmorModel event = new net.minecraftforge.client.event.RenderPlayerEvent.SetArmorModel(p_77032_1_, this, 3 - p_77032_2_, p_77032_3_, itemstack);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
+ if (event.result != -1)
+ {
+ return event.result;
+ }
+
if (itemstack != null)
{
Item item = itemstack.func_77973_b();
@@ -57,7 +64,7 @@
if (item instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)item;
- this.func_110776_a(RenderBiped.func_110857_a(itemarmor, p_77032_2_));
+ this.func_110776_a(RenderBiped.getArmorResource(p_77032_1_, itemstack, p_77032_2_, null));
ModelBiped modelbiped = p_77032_2_ == 2 ? this.field_77111_i : this.field_77108_b;
modelbiped.field_78116_c.field_78806_j = p_77032_2_ == 0;
modelbiped.field_78114_d.field_78806_j = p_77032_2_ == 0;
@@ -66,14 +73,16 @@
modelbiped.field_78113_g.field_78806_j = p_77032_2_ == 1;
modelbiped.field_78123_h.field_78806_j = p_77032_2_ == 2 || p_77032_2_ == 3;
modelbiped.field_78124_i.field_78806_j = p_77032_2_ == 2 || p_77032_2_ == 3;
+ modelbiped = net.minecraftforge.client.ForgeHooksClient.getArmorModel(p_77032_1_, itemstack, p_77032_2_, modelbiped);
this.func_77042_a(modelbiped);
modelbiped.field_78095_p = this.field_77045_g.field_78095_p;
modelbiped.field_78093_q = this.field_77045_g.field_78093_q;
modelbiped.field_78091_s = this.field_77045_g.field_78091_s;
- if (itemarmor.func_82812_d() == ItemArmor.ArmorMaterial.CLOTH)
+ //Move outside if to allow for more then just CLOTH
+ int j = itemarmor.func_82814_b(itemstack);
+ if (j != -1)
{
- int j = itemarmor.func_82814_b(itemstack);
float f1 = (float)(j >> 16 & 255) / 255.0F;
float f2 = (float)(j >> 8 & 255) / 255.0F;
float f3 = (float)(j & 255) / 255.0F;
@@ -111,7 +120,7 @@
if (item instanceof ItemArmor)
{
- this.func_110776_a(RenderBiped.func_110858_a((ItemArmor)item, p_82408_2_, "overlay"));
+ this.func_110776_a(RenderBiped.getArmorResource(p_82408_1_, itemstack, p_82408_2_, "overlay"));
GL11.glColor3f(1.0F, 1.0F, 1.0F);
}
}
@@ -119,6 +128,7 @@
public void func_76986_a(AbstractClientPlayer p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Pre(p_76986_1_, this, p_76986_9_))) return;
GL11.glColor3f(1.0F, 1.0F, 1.0F);
ItemStack itemstack = p_76986_1_.field_71071_by.func_70448_g();
this.field_77108_b.field_78120_m = this.field_77111_i.field_78120_m = this.field_77109_a.field_78120_m = itemstack != null ? 1 : 0;
@@ -149,6 +159,7 @@
this.field_77108_b.field_78118_o = this.field_77111_i.field_78118_o = this.field_77109_a.field_78118_o = false;
this.field_77108_b.field_78117_n = this.field_77111_i.field_78117_n = this.field_77109_a.field_78117_n = false;
this.field_77108_b.field_78120_m = this.field_77111_i.field_78120_m = this.field_77109_a.field_78120_m = 0;
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Post(p_76986_1_, this, p_76986_9_));
}
protected ResourceLocation func_110775_a(AbstractClientPlayer p_110775_1_)
@@ -158,12 +169,14 @@
protected void func_77029_c(AbstractClientPlayer p_77029_1_, float p_77029_2_)
{
+ net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre event = new net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre(p_77029_1_, this, p_77029_2_);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return;
GL11.glColor3f(1.0F, 1.0F, 1.0F);
super.func_77029_c(p_77029_1_, p_77029_2_);
super.func_85093_e(p_77029_1_, p_77029_2_);
ItemStack itemstack = p_77029_1_.field_71071_by.func_70440_f(3);
- if (itemstack != null)
+ if (itemstack != null && event.renderHelmet)
{
GL11.glPushMatrix();
this.field_77109_a.field_78116_c.func_78794_c(0.0625F);
@@ -171,7 +184,10 @@
if (itemstack.func_77973_b() instanceof ItemBlock)
{
- if (RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.func_77973_b()).func_149645_b()))
+ net.minecraftforge.client.IItemRenderer customRenderer = net.minecraftforge.client.MinecraftForgeClient.getItemRenderer(itemstack, net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED);
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED, itemstack, net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D));
+
+ if (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.func_77973_b()).func_149645_b()))
{
f1 = 0.625F;
GL11.glTranslatef(0.0F, -0.25F, 0.0F);
@@ -232,6 +248,7 @@
}
boolean flag = p_77029_1_.func_152122_n();
+ flag = event.renderCape && flag;
float f4;
if (flag && !p_77029_1_.func_82150_aj() && !p_77029_1_.func_82238_cc())
@@ -283,7 +300,7 @@
ItemStack itemstack1 = p_77029_1_.field_71071_by.func_70448_g();
- if (itemstack1 != null)
+ if (itemstack1 != null && event.renderItem)
{
GL11.glPushMatrix();
this.field_77109_a.field_78112_f.func_78794_c(0.0625F);
@@ -301,7 +318,10 @@
enumaction = itemstack1.func_77975_n();
}
- if (itemstack1.func_77973_b() instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(itemstack1.func_77973_b()).func_149645_b()))
+ net.minecraftforge.client.IItemRenderer customRenderer = net.minecraftforge.client.MinecraftForgeClient.getItemRenderer(itemstack1, net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED);
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED, itemstack1, net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D));
+
+ if (is3D || itemstack1.func_77973_b() instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(itemstack1.func_77973_b()).func_149645_b()))
{
f2 = 0.5F;
GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
@@ -358,7 +378,7 @@
if (itemstack1.func_77973_b().func_77623_v())
{
- for (k = 0; k <= 1; ++k)
+ for (k = 0; k < itemstack1.func_77973_b().getRenderPasses(itemstack1.func_77960_j()); ++k)
{
int i = itemstack1.func_77973_b().func_82790_a(itemstack1, k);
f12 = (float)(i >> 16 & 255) / 255.0F;
@@ -380,6 +400,7 @@
GL11.glPopMatrix();
}
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Specials.Post(p_77029_1_, this, p_77029_2_));
}
protected void func_77041_b(AbstractClientPlayer p_77041_1_, float p_77041_2_)

View File

@ -1,25 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java
@@ -13,6 +13,10 @@
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
+import net.minecraftforge.client.IItemRenderer;
+import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*;
+import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*;
+import net.minecraftforge.client.MinecraftForgeClient;
@SideOnly(Side.CLIENT)
public class RenderSnowMan extends RenderLiving
@@ -38,7 +42,10 @@
GL11.glPushMatrix();
this.field_77094_a.field_78195_c.func_78794_c(0.0625F);
- if (RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.func_77973_b()).func_149645_b()))
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));
+
+ if (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.func_77973_b()).func_149645_b()))
{
float f1 = 0.625F;
GL11.glTranslatef(0.0F, -0.34375F, 0.0F);

View File

@ -1,63 +1,49 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java
@@ -20,6 +20,9 @@
import net.minecraft.util.ResourceLocation;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import net.minecraftforge.client.event.RenderLivingEvent;
+import net.minecraftforge.common.MinecraftForge;
+
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
@@ -32,6 +35,9 @@
protected ModelBase field_77046_h;
@@ -40,6 +40,9 @@
protected boolean field_177098_i = false;
private static final String __OBFID = "CL_00001012";
+ public static float NAME_TAG_RANGE = 64.0f;
+ public static float NAME_TAG_RANGE_SNEAK = 32.0f;
+
public RendererLivingEntity(ModelBase p_i1261_1_, float p_i1261_2_)
public RendererLivingEntity(RenderManager p_i46156_1_, ModelBase p_i46156_2_, float p_i46156_3_)
{
this.field_77045_g = p_i1261_1_;
@@ -62,6 +68,7 @@
super(p_i46156_1_);
@@ -83,6 +86,7 @@
public void func_76986_a(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
+ if (MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Pre(p_76986_1_, this, p_76986_2_, p_76986_4_, p_76986_6_))) return;
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_CULL_FACE);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Pre(p_76986_1_, this, p_76986_2_, p_76986_4_, p_76986_6_))) return;
GlStateManager.func_179094_E();
GlStateManager.func_179129_p();
this.field_77045_g.field_78095_p = this.func_77040_d(p_76986_1_, p_76986_9_);
@@ -271,6 +278,7 @@
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix();
this.func_77033_b(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_);
+ MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Post(p_76986_1_, this, p_76986_2_, p_76986_4_, p_76986_6_));
@@ -193,6 +197,7 @@
{
super.func_76986_a(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Post(p_76986_1_, this, p_76986_2_, p_76986_4_, p_76986_6_));
}
protected void func_77036_a(EntityLivingBase p_77036_1_, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_)
@@ -416,6 +424,7 @@
protected boolean func_177088_c(EntityLivingBase p_177088_1_)
@@ -472,10 +477,11 @@
protected void func_77033_b(EntityLivingBase p_77033_1_, double p_77033_2_, double p_77033_4_, double p_77033_6_)
public void func_77033_b(EntityLivingBase p_77033_1_, double p_77033_2_, double p_77033_4_, double p_77033_6_)
{
+ if (MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Specials.Pre(p_77033_1_, this, p_77033_2_, p_77033_4_, p_77033_6_))) return;
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Pre(p_77033_1_, this, p_77033_2_, p_77033_4_, p_77033_6_))) return;
if (this.func_110813_b(p_77033_1_))
@@ -423,7 +432,7 @@
float f = 1.6F;
float f1 = 0.016666668F * f;
{
double d3 = p_77033_1_.func_70068_e(this.field_76990_c.field_78734_h);
- float f2 = p_77033_1_.func_70093_af() ? 32.0F : 64.0F;
+ float f2 = p_77033_1_.func_70093_af() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE;
- float f = p_77033_1_.func_70093_af() ? 32.0F : 64.0F;
+ float f = p_77033_1_.func_70093_af() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE;
if (d3 < (double)(f2 * f2))
if (d3 < (double)(f * f))
{
@@ -467,6 +476,7 @@
@@ -522,6 +528,7 @@
}
}
}
+ MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Specials.Post(p_77033_1_, this, p_77033_2_, p_77033_4_, p_77033_6_));
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Post(p_77033_1_, this, p_77033_2_, p_77033_4_, p_77033_6_));
}
protected boolean func_110813_b(EntityLivingBase p_110813_1_)

View File

@ -0,0 +1,95 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/entity/layers/LayerArmorBase.java
@@ -56,31 +56,32 @@
ModelBase modelbase = this.func_177175_a(p_177182_9_);
modelbase.func_178686_a(this.field_177190_a.func_177087_b());
modelbase.func_78086_a(p_177182_1_, p_177182_2_, p_177182_3_, p_177182_4_);
+ modelbase = net.minecraftforge.client.ForgeHooksClient.getArmorModel(p_177182_1_, itemstack, p_177182_9_, modelbase);
this.func_177179_a(modelbase, p_177182_9_);
boolean flag = this.func_177180_b(p_177182_9_);
- this.field_177190_a.func_110776_a(this.func_177181_a(itemarmor, flag));
+ this.field_177190_a.func_110776_a(this.getArmorResource(p_177182_1_, itemstack, flag ? 2 : 1, null));
- switch (LayerArmorBase.SwitchArmorMaterial.field_178747_a[itemarmor.func_82812_d().ordinal()])
{
- case 1:
- int j = itemarmor.func_82814_b(itemstack);
+ int j = itemarmor.func_82814_b(itemstack);
+ if (j != -1) //Allow this for anything, not only cloth.
+ {
float f7 = (float)(j >> 16 & 255) / 255.0F;
float f8 = (float)(j >> 8 & 255) / 255.0F;
float f9 = (float)(j & 255) / 255.0F;
GlStateManager.func_179131_c(this.field_177184_f * f7, this.field_177185_g * f8, this.field_177192_h * f9, this.field_177187_e);
modelbase.func_78088_a(p_177182_1_, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_);
- this.field_177190_a.func_110776_a(this.func_177178_a(itemarmor, flag, "overlay"));
- case 2:
- case 3:
- case 4:
- case 5:
+ this.field_177190_a.func_110776_a(this.getArmorResource(p_177182_1_, itemstack, flag ? 2 : 1, "overlay"));
+ }
+ { // Non-cloth
GlStateManager.func_179131_c(this.field_177184_f, this.field_177185_g, this.field_177192_h, this.field_177187_e);
modelbase.func_78088_a(p_177182_1_, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_);
- default:
+ }
+ { // Default, Why is this a switch? there were no breaks.
if (!this.field_177193_i && itemstack.func_77948_v())
{
this.func_177183_a(p_177182_1_, modelbase, p_177182_2_, p_177182_3_, p_177182_4_, p_177182_5_, p_177182_6_, p_177182_7_, p_177182_8_);
}
+ }
}
}
}
@@ -135,11 +136,13 @@
GlStateManager.func_179084_k();
}
+ @Deprecated //Use the more sensitive version getArmorResource below
private ResourceLocation func_177181_a(ItemArmor p_177181_1_, boolean p_177181_2_)
{
return this.func_177178_a(p_177181_1_, p_177181_2_, (String)null);
}
+ @Deprecated //Use the more sensitive version getArmorResource below
private ResourceLocation func_177178_a(ItemArmor p_177178_1_, boolean p_177178_2_, String p_177178_3_)
{
String s1 = String.format("textures/models/armor/%s_layer_%d%s.png", new Object[] {p_177178_1_.func_82812_d().func_179242_c(), Integer.valueOf(p_177178_2_ ? 2 : 1), p_177178_3_ == null ? "" : String.format("_%s", new Object[]{p_177178_3_})});
@@ -158,6 +161,35 @@
protected abstract void func_177179_a(ModelBase p_177179_1_, int p_177179_2_);
+ /*=================================== FORGE START =========================================*/
+ /**
+ * More generic ForgeHook version of the above function, it allows for Items to have more control over what texture they provide.
+ *
+ * @param entity Entity wearing the armor
+ * @param stack ItemStack for the armor
+ * @param slot Slot ID that the item is in
+ * @param type Subtype, can be null or "overlay"
+ * @return ResourceLocation pointing at the armor's texture
+ */
+ public ResourceLocation getArmorResource(net.minecraft.entity.Entity entity, ItemStack stack, int slot, String type)
+ {
+ ItemArmor item = (ItemArmor)stack.func_77973_b();
+ String s1 = String.format("textures/models/armor/%s_layer_%d%s.png",
+ ((ItemArmor)stack.func_77973_b()).func_82812_d().func_179242_c(), (slot == 2 ? 2 : 1), type == null ? "" : String.format("_%s", type));
+
+ s1 = net.minecraftforge.client.ForgeHooksClient.getArmorTexture(entity, stack, s1, slot, type);
+ ResourceLocation resourcelocation = (ResourceLocation)field_177191_j.get(s1);
+
+ if (resourcelocation == null)
+ {
+ resourcelocation = new ResourceLocation(s1);
+ field_177191_j.put(s1, resourcelocation);
+ }
+
+ return resourcelocation;
+ }
+ /*=================================== FORGE END ===========================================*/
+
@SideOnly(Side.CLIENT)
static final class SwitchArmorMaterial

View File

@ -1,37 +1,23 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java
@@ -8,12 +8,14 @@
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Callable;
+import net.minecraft.client.resources.IResourceManager;
import net.minecraft.client.resources.data.AnimationFrame;
import net.minecraft.client.resources.data.AnimationMetadataSection;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.util.IIcon;
import net.minecraft.util.ReportedException;
+import net.minecraft.util.ResourceLocation;
@SideOnly(Side.CLIENT)
public class TextureAtlasSprite implements IIcon
@@ -427,4 +429,28 @@
@@ -410,4 +410,30 @@
{
return "TextureAtlasSprite{name=\'" + this.field_110984_i + '\'' + ", frameCount=" + this.field_110976_a.size() + ", rotated=" + this.field_130222_e + ", x=" + this.field_110975_c + ", y=" + this.field_110974_d + ", height=" + this.field_130224_d + ", width=" + this.field_130223_c + ", u0=" + this.field_110979_l + ", u1=" + this.field_110980_m + ", v0=" + this.field_110977_n + ", v1=" + this.field_110978_o + '}';
}
+
+ /*===================================== FORGE START =====================================*/
+ /**
+ * The result of this function determines is the below 'load' function is called, and the
+ * The result of this function determines is the below 'load' function is called, and the
+ * default vanilla loading code is bypassed completely.
+ * @param manager
+ * @param location
+ * @return True to use your own custom load code and bypass vanilla loading.
+ */
+ public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location)
+ public boolean hasCustomLoader(net.minecraft.client.resources.IResourceManager manager, net.minecraft.util.ResourceLocation location)
+ {
+ return false;
+ }
+
+
+ /**
+ * Load the specified resource as this sprite's data.
+ * Returning false from this function will prevent this icon from being stitched onto the master texture.
@ -39,8 +25,9 @@
+ * @param location File resource location
+ * @return False to prevent this Icon from being stitched
+ */
+ public boolean load(IResourceManager manager, ResourceLocation location)
+ public boolean load(net.minecraft.client.resources.IResourceManager manager, net.minecraft.util.ResourceLocation location)
+ {
+ return true;
+ }
+ /*===================================== FORGE END ======================================*/
}

View File

@ -1,30 +1,15 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureMap.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureMap.java
@@ -29,6 +29,7 @@
import net.minecraft.util.MathHelper;
import net.minecraft.util.ReportedException;
import net.minecraft.util.ResourceLocation;
+import net.minecraftforge.client.ForgeHooksClient;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -91,11 +92,14 @@
public void func_110571_b(IResourceManager p_110571_1_)
{
+ func_110573_f(); //Re-gather list of Icons, allows for addition/removal of blocks/items after this map was initially constructed.
+
int i = Minecraft.func_71369_N();
Stitcher stitcher = new Stitcher(i, i, true, 0, this.field_147636_j);
this.field_94252_e.clear();
@@ -91,6 +91,7 @@
this.field_94258_i.clear();
int j = Integer.MAX_VALUE;
+ ForgeHooksClient.onTextureStitchedPre(this);
int k = 1 << this.field_147636_j;
+ net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPre(this);
Iterator iterator = this.field_110574_e.entrySet().iterator();
TextureAtlasSprite textureatlassprite;
@@ -106,6 +110,16 @@
textureatlassprite = (TextureAtlasSprite)entry.getValue();
while (iterator.hasNext())
@@ -100,6 +101,16 @@
ResourceLocation resourcelocation = new ResourceLocation(textureatlassprite.func_94215_i());
ResourceLocation resourcelocation1 = this.func_147634_a(resourcelocation, 0);
+ if (textureatlassprite.hasCustomLoader(p_110571_1_, resourcelocation))
@ -40,26 +25,19 @@
try
{
IResource iresource = p_110571_1_.func_110536_a(resourcelocation1);
@@ -274,6 +288,7 @@
textureatlassprite = (TextureAtlasSprite)iterator2.next();
textureatlassprite.func_94217_a(this.field_94249_f);
@@ -275,6 +286,9 @@
textureatlassprite2.func_94217_a(this.field_94249_f);
}
+ ForgeHooksClient.onTextureStitchedPost(this);
+ net.minecraftforge.client.ForgeHooksClient.onTextureStitchedPost(this);
+
+ if (!net.minecraftforge.common.ForgeModContainer.disableStitchedFileSaving)
TextureUtil.func_177055_a(this.field_94254_c.replaceAll("/", "_"), this.func_110552_b(), this.field_147636_j, stitcher.func_110935_a(), stitcher.func_110936_b());
}
private ResourceLocation func_147634_a(ResourceLocation p_147634_1_, int p_147634_2_)
@@ -347,7 +362,7 @@
{
throw new IllegalArgumentException("Name cannot be null!");
}
- else if (p_94245_1_.indexOf(47) == -1 && p_94245_1_.indexOf(92) == -1)
+ else if (p_94245_1_.indexOf(92) == -1) // Disable backslashes (\) in texture asset paths.
{
Object object = (TextureAtlasSprite)this.field_110574_e.get(p_94245_1_);
@@ -403,4 +418,37 @@
@@ -341,4 +355,37 @@
{
this.field_147637_k = p_147632_1_;
return this.field_94249_f;
}
+
+ //===================================================================================================

View File

@ -1,8 +1,8 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java
@@ -176,6 +176,9 @@
GL11.glTranslatef(0.16F, -0.16F, 0.0F);
}
@@ -106,6 +106,9 @@
GlStateManager.func_179114_b((float)i * 360.0F / 8.0F, 0.0F, 0.0F, 1.0F);
+ net.minecraftforge.client.event.RenderItemInFrameEvent event = new net.minecraftforge.client.event.RenderItemInFrameEvent(p_82402_1_, this);
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event))
@ -10,11 +10,11 @@
if (item == Items.field_151098_aY)
{
this.field_76990_c.field_78724_e.func_110577_a(field_110789_a);
@@ -244,6 +247,7 @@
}
@@ -165,6 +168,7 @@
textureatlassprite.func_94219_l();
}
}
+ }
GL11.glPopMatrix();
}
GlStateManager.func_179145_e();
GlStateManager.func_179121_F();

View File

@ -1,24 +0,0 @@
--- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java
@@ -1,5 +1,6 @@
package net.minecraft.client.renderer.tileentity;
+import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Calendar;
@@ -52,7 +53,14 @@
if (block instanceof BlockChest && i == 0)
{
+ try
+ {
((BlockChest)block).func_149954_e(p_147500_1_.func_145831_w(), p_147500_1_.field_145851_c, p_147500_1_.field_145848_d, p_147500_1_.field_145849_e);
+ }
+ catch (ClassCastException e)
+ {
+ FMLLog.severe("Attempted to render a chest at %d, %d, %d that was not a chest", p_147500_1_.field_145851_c, p_147500_1_.field_145848_d, p_147500_1_.field_145849_e);
+ }
i = p_147500_1_.func_145832_p();
}

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