Update for MC 1.4.7

Update FML: f7cc50b
This commit is contained in:
Christian 2012-12-28 12:06:56 -05:00
parent 0c5563fbf5
commit 19347c5322
54 changed files with 364 additions and 366 deletions

View file

@ -10,7 +10,7 @@ public class ForgeVersion
//This number is incremented every time we remove deprecated code/major API changes, never reset //This number is incremented every time we remove deprecated code/major API changes, never reset
public static final int majorVersion = 6; public static final int majorVersion = 6;
//This number is incremented every minecraft release, never reset //This number is incremented every minecraft release, never reset
public static final int minorVersion = 5; public static final int minorVersion = 6;
//This number is incremented every time a interface changes or new major feature is added, and reset every Minecraft version //This number is incremented every time a interface changes or new major feature is added, and reset every Minecraft version
public static final int revisionVersion = 0; public static final int revisionVersion = 0;
//This number is incremented every time Jenkins builds Forge, and never reset. Should always be 0 in the repo code. //This number is incremented every time Jenkins builds Forge, and never reset. Should always be 0 in the repo code.

View file

@ -22,7 +22,7 @@ public class LiquidStack {
} }
public LiquidStack(Item item, int amount) { public LiquidStack(Item item, int amount) {
this(item.shiftedIndex, amount, 0); this(item.itemID, amount, 0);
} }
public LiquidStack(Block block, int amount) { public LiquidStack(Block block, int amount) {
@ -56,13 +56,13 @@ public class LiquidStack {
} }
/** /**
* @param other * @param other
* @return true if this LiquidStack contains the same liquid as the one passed in. * @return true if this LiquidStack contains the same liquid as the one passed in.
*/ */
public boolean isLiquidEqual(LiquidStack other) { public boolean isLiquidEqual(LiquidStack other) {
if(other == null) if(other == null)
return false; return false;
return itemID == other.itemID && itemMeta == other.itemMeta; return itemID == other.itemID && itemMeta == other.itemMeta;
} }
@ -73,21 +73,21 @@ public class LiquidStack {
public boolean containsLiquid(LiquidStack other) { public boolean containsLiquid(LiquidStack other) {
if(!isLiquidEqual(other)) if(!isLiquidEqual(other))
return false; return false;
return amount >= other.amount; return amount >= other.amount;
} }
/** /**
* @param other ItemStack containing liquids. * @param other ItemStack containing liquids.
* @return true if this LiquidStack contains the same liquid as the one passed in. * @return true if this LiquidStack contains the same liquid as the one passed in.
*/ */
public boolean isLiquidEqual(ItemStack other) { public boolean isLiquidEqual(ItemStack other) {
if(other == null) if(other == null)
return false; return false;
return itemID == other.itemID && itemMeta == other.getItemDamage(); return itemID == other.itemID && itemMeta == other.getItemDamage();
} }
/** /**
* @return ItemStack representation of this LiquidStack * @return ItemStack representation of this LiquidStack
*/ */
@ -97,7 +97,7 @@ public class LiquidStack {
/** /**
* Reads a liquid stack from the passed nbttagcompound and returns it. * Reads a liquid stack from the passed nbttagcompound and returns it.
* *
* @param nbttagcompound * @param nbttagcompound
* @return * @return
*/ */

View file

@ -46,7 +46,7 @@
/** /**
* used as foreach item, if item.tab = current tab, display it on the screen * used as foreach item, if item.tab = current tab, display it on the screen
*/ */
@@ -319,6 +333,7 @@ @@ -321,6 +335,7 @@
lightOpacity[par1] = this.isOpaqueCube() ? 255 : 0; lightOpacity[par1] = this.isOpaqueCube() ? 255 : 0;
canBlockGrass[par1] = !par2Material.getCanBlockGrass(); canBlockGrass[par1] = !par2Material.getCanBlockGrass();
} }
@ -54,7 +54,7 @@
} }
/** /**
@@ -457,9 +472,10 @@ @@ -459,9 +474,10 @@
return this.needsRandomTick; return this.needsRandomTick;
} }
@ -66,7 +66,7 @@
} }
/** /**
@@ -482,7 +498,7 @@ @@ -484,7 +500,7 @@
*/ */
public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{ {
@ -75,7 +75,7 @@
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@@ -492,7 +508,7 @@ @@ -494,7 +510,7 @@
*/ */
public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{ {
@ -84,7 +84,7 @@
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@@ -637,7 +653,13 @@ @@ -639,7 +655,13 @@
/** /**
* ejects contained items into the world, and notifies neighbours of an update, as appropriate * ejects contained items into the world, and notifies neighbours of an update, as appropriate
*/ */
@ -99,7 +99,7 @@
/** /**
* Returns the quantity of items to drop on block destruction. * Returns the quantity of items to drop on block destruction.
@@ -661,8 +683,7 @@ @@ -663,8 +685,7 @@
*/ */
public float getPlayerRelativeBlockHardness(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5) public float getPlayerRelativeBlockHardness(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5)
{ {
@ -109,7 +109,7 @@
} }
/** /**
@@ -680,18 +701,13 @@ @@ -682,18 +703,13 @@
{ {
if (!par1World.isRemote) if (!par1World.isRemote)
{ {
@ -132,7 +132,7 @@
} }
} }
} }
@@ -1076,7 +1092,7 @@ @@ -1081,7 +1097,7 @@
par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
par2EntityPlayer.addExhaustion(0.025F); par2EntityPlayer.addExhaustion(0.025F);
@ -141,7 +141,7 @@
{ {
ItemStack var8 = this.createStackedBlock(par6); ItemStack var8 = this.createStackedBlock(par6);
@@ -1356,4 +1372,835 @@ @@ -1364,4 +1380,835 @@
canBlockGrass[0] = true; canBlockGrass[0] = true;
StatList.initBreakableStats(); StatList.initBreakableStats();
} }
@ -734,7 +734,7 @@
+ * @param side The side that is trying to make the connection + * @param side The side that is trying to make the connection
+ * @return True to make the connection + * @return True to make the connection
+ */ + */
+ public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) + public boolean canMakeRedstoneConnectionOnSide(IBlockAccess world, int x, int y, int z, int side)
+ { + {
+ return Block.blocksList[blockID].canProvidePower() && side != -1; + return Block.blocksList[blockID].canProvidePower() && side != -1;
+ } + }

View file

@ -34,8 +34,8 @@
+ (par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH)); + (par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH));
} }
public int func_85104_a(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) /**
@@ -80,19 +90,22 @@ @@ -83,19 +93,22 @@
int var11 = var10 & 8; int var11 = var10 & 8;
var10 &= 7; var10 &= 7;
@ -62,7 +62,7 @@
{ {
var10 = 1; var10 = 1;
} }
@@ -109,7 +122,11 @@ @@ -112,7 +125,11 @@
*/ */
private int getOrientation(World par1World, int par2, int par3, int par4) private int getOrientation(World par1World, int par2, int par3, int par4)
{ {
@ -75,7 +75,7 @@
} }
/** /**
@@ -123,22 +140,22 @@ @@ -126,22 +143,22 @@
int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7; int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7;
boolean var7 = false; boolean var7 = false;

View file

@ -9,7 +9,7 @@
import java.util.Random; import java.util.Random;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
@@ -172,7 +174,14 @@ @@ -175,7 +177,14 @@
*/ */
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{ {
@ -25,7 +25,7 @@
byte var9 = 1; byte var9 = 1;
if (var8 >= 2) if (var8 >= 2)
@@ -182,8 +191,9 @@ @@ -185,8 +194,9 @@
for (int var10 = 0; var10 < var9; ++var10) for (int var10 = 0; var10 < var9; ++var10)
{ {
@ -37,7 +37,7 @@
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@@ -203,4 +213,10 @@ @@ -206,4 +216,10 @@
{ {
return 3; return 3;
} }

View file

@ -10,7 +10,7 @@
public class BlockLadder extends Block public class BlockLadder extends Block
{ {
@@ -104,29 +107,32 @@ @@ -104,7 +107,10 @@
*/ */
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{ {
@ -21,7 +21,8 @@
+ par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH); + par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH);
} }
public int func_85104_a(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) /**
@@ -114,22 +120,22 @@
{ {
int var10 = par9; int var10 = par9;
@ -48,7 +49,7 @@
{ {
var10 = 5; var10 = 5;
} }
@@ -143,22 +149,22 @@ @@ -146,22 +152,22 @@
int var6 = par1World.getBlockMetadata(par2, par3, par4); int var6 = par1World.getBlockMetadata(par2, par3, par4);
boolean var7 = false; boolean var7 = false;
@ -75,7 +76,7 @@
{ {
var7 = true; var7 = true;
} }
@@ -179,4 +185,10 @@ @@ -182,4 +188,10 @@
{ {
return 1; return 1;
} }

View file

@ -53,7 +53,7 @@
*/ */
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
{ {
- if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex) - if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID)
- { - {
- par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); - par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.leaves.blockID, 1, par6 & 3)); - this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.leaves.blockID, 1, par6 & 3));
@ -70,15 +70,15 @@
{ {
return new ItemStack(this.blockID, 1, par1 & 3); return new ItemStack(this.blockID, 1, par1 & 3);
} }
+ +
+ @Override + @Override
+ public boolean isShearable(ItemStack item, World world, int x, int y, int z) + public boolean isShearable(ItemStack item, World world, int x, int y, int z)
+ { + {
+ return true; + return true;
+ } + }
+ +
+ @Override + @Override
+ public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune) + public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune)
+ { + {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>(); + ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3)); + ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3));

View file

@ -38,8 +38,8 @@
+ par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN ); + par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN );
} }
public int func_85104_a(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) /**
@@ -71,32 +85,32 @@ @@ -74,32 +88,32 @@
int var10 = par9 & 7; int var10 = par9 & 7;
var10 = -1; var10 = -1;
@ -78,7 +78,7 @@
{ {
var10 = 1; var10 = 1;
} }
@@ -139,42 +153,42 @@ @@ -142,42 +156,42 @@
int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7; int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7;
boolean var7 = false; boolean var7 = false;

View file

@ -17,7 +17,7 @@
} }
} }
} }
@@ -148,4 +143,16 @@ @@ -151,4 +146,16 @@
{ {
return new ItemStack(this.blockID, 1, limitToValidMetadata(par1)); return new ItemStack(this.blockID, 1, limitToValidMetadata(par1));
} }

View file

@ -54,7 +54,7 @@
/** /**
@@ -119,4 +105,23 @@ @@ -119,4 +105,23 @@
{ {
return Item.netherStalkSeeds.shiftedIndex; return Item.netherStalkSeeds.itemID;
} }
+ +
+ @Override + @Override

View file

@ -1,11 +1,11 @@
--- ../src_base/minecraft/net/minecraft/block/BlockRedstoneWire.java --- ../src_base/minecraft/net/minecraft/block/BlockRedstoneWire.java
+++ ../src_work/minecraft/net/minecraft/block/BlockRedstoneWire.java +++ ../src_work/minecraft/net/minecraft/block/BlockRedstoneWire.java
@@ -564,7 +564,7 @@ @@ -565,7 +565,7 @@
} }
else if (var5 != Block.redstoneRepeaterIdle.blockID && var5 != Block.redstoneRepeaterActive.blockID) else if (var5 != Block.redstoneRepeaterIdle.blockID && var5 != Block.redstoneRepeaterActive.blockID)
{ {
- return Block.blocksList[var5].canProvidePower() && par4 != -1; - return Block.blocksList[var5].canProvidePower() && par4 != -1;
+ return (Block.blocksList[var5] != null && Block.blocksList[var5].canConnectRedstone(par0IBlockAccess, par1, par2, par3, par4)); + return (Block.blocksList[var5] != null && Block.blocksList[var5].canMakeRedstoneConnectionOnSide(par0IBlockAccess, par1, par2, par3, par4));
} }
else else
{ {

View file

@ -26,7 +26,7 @@
/** /**
@@ -139,4 +143,22 @@ @@ -139,4 +143,22 @@
{ {
return Item.reed.shiftedIndex; return Item.reed.itemID;
} }
+ +
+ @Override + @Override

View file

@ -30,7 +30,7 @@
super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer);
} }
@@ -156,26 +155,31 @@ @@ -156,24 +155,30 @@
*/ */
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
{ {
@ -38,13 +38,13 @@
- { - {
- if ((par6 & 8) == 0) - if ((par6 & 8) == 0)
- { - {
- ItemStack var7 = new ItemStack(Item.skull.shiftedIndex, 1, this.getDamageValue(par1World, par2, par3, par4)); - ItemStack var7 = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(par1World, par2, par3, par4));
- TileEntitySkull var8 = (TileEntitySkull)par1World.getBlockTileEntity(par2, par3, par4); - TileEntitySkull var8 = (TileEntitySkull)par1World.getBlockTileEntity(par2, par3, par4);
- -
- if (var8.func_82117_a() == 3 && var8.func_82120_c() != null && var8.func_82120_c().length() > 0) - if (var8.getSkullType() == 3 && var8.getExtraType() != null && var8.getExtraType().length() > 0)
- { - {
- var7.setTagCompound(new NBTTagCompound()); - var7.setTagCompound(new NBTTagCompound());
- var7.getTagCompound().setString("SkullOwner", var8.func_82120_c()); - var7.getTagCompound().setString("SkullOwner", var8.getExtraType());
- } - }
- -
- this.dropBlockAsItem_do(par1World, par2, par3, par4, var7); - this.dropBlockAsItem_do(par1World, par2, par3, par4, var7);
@ -52,8 +52,6 @@
- -
- super.breakBlock(par1World, par2, par3, par4, par5, par6); - super.breakBlock(par1World, par2, par3, par4, par5, par6);
- } - }
- }
-
+ super.breakBlock(par1World, par2, par3, par4, par5, par6); + super.breakBlock(par1World, par2, par3, par4, par5, par6);
+ } + }
+ +
@ -63,22 +61,21 @@
+ ArrayList<ItemStack> drops = new ArrayList<ItemStack>(); + ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
+ if ((metadata & 8) == 0) + if ((metadata & 8) == 0)
+ { + {
+ ItemStack var7 = new ItemStack(Item.skull.shiftedIndex, 1, this.getDamageValue(world, x, y, z)); + ItemStack var7 = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(world, x, y, z));
+ TileEntitySkull var8 = (TileEntitySkull)world.getBlockTileEntity(x, y, z); + TileEntitySkull var8 = (TileEntitySkull)world.getBlockTileEntity(x, y, z);
+ +
+ if (var8 == null) + if (var8 == null)
+ { + {
+ return drops; + return drops;
+ } + }
+ if (var8.func_82117_a() == 3 && var8.func_82120_c() != null && var8.func_82120_c().length() > 0) + if (var8.getSkullType() == 3 && var8.getExtraType() != null && var8.getExtraType().length() > 0)
+ { + {
+ var7.setTagCompound(new NBTTagCompound()); + var7.setTagCompound(new NBTTagCompound());
+ var7.getTagCompound().setString("SkullOwner", var8.func_82120_c()); + var7.getTagCompound().setString("SkullOwner", var8.getExtraType());
+ } + }
+ drops.add(var7); + drops.add(var7);
+ } + }
+ return drops; + return drops;
+ } }
/** /**
* Returns the ID of the items to drop on destruction.
*/

View file

@ -22,7 +22,7 @@
*/ */
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
{ {
- int var7 = Item.snowball.shiftedIndex; - int var7 = Item.snowball.itemID;
- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(var7, 1, 0)); - this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(var7, 1, 0));
+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); + super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
par1World.setBlockWithNotify(par3, par4, par5, 0); par1World.setBlockWithNotify(par3, par4, par5, 0);

View file

@ -25,7 +25,7 @@
*/ */
public int idDropped(int par1, Random par2Random, int par3) public int idDropped(int par1, Random par2Random, int par3)
{ {
- return par2Random.nextInt(8) == 0 ? Item.seeds.shiftedIndex : -1; - return par2Random.nextInt(8) == 0 ? Item.seeds.itemID : -1;
+ return -1; + return -1;
} }
@ -34,7 +34,7 @@
*/ */
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
{ {
- if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex) - if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID)
- { - {
- par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); - par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.tallGrass, 1, par6)); - this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.tallGrass, 1, par6));
@ -70,13 +70,13 @@
+ } + }
+ +
+ @Override + @Override
+ public boolean isShearable(ItemStack item, World world, int x, int y, int z) + public boolean isShearable(ItemStack item, World world, int x, int y, int z)
+ { + {
+ return true; + return true;
+ } + }
+ +
+ @Override + @Override
+ public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune) + public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune)
+ { + {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>(); + ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z))); + ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z)));

View file

@ -31,8 +31,8 @@
+ canPlaceTorchOn(par1World, par2, par3 - 1, par4); + canPlaceTorchOn(par1World, par2, par3 - 1, par4);
} }
public int func_85104_a(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) /**
@@ -86,22 +93,22 @@ @@ -89,22 +96,22 @@
var10 = 5; var10 = 5;
} }
@ -59,7 +59,7 @@
{ {
var10 = 1; var10 = 1;
} }
@@ -129,19 +136,19 @@ @@ -132,19 +139,19 @@
{ {
if (par1World.getBlockMetadata(par2, par3, par4) == 0) if (par1World.getBlockMetadata(par2, par3, par4) == 0)
{ {
@ -83,7 +83,7 @@
{ {
par1World.setBlockMetadataWithNotify(par2, par3, par4, 4); par1World.setBlockMetadataWithNotify(par2, par3, par4, 4);
} }
@@ -165,22 +172,22 @@ @@ -168,22 +175,22 @@
int var6 = par1World.getBlockMetadata(par2, par3, par4); int var6 = par1World.getBlockMetadata(par2, par3, par4);
boolean var7 = false; boolean var7 = false;

View file

@ -23,7 +23,7 @@
{ {
par1World.setBlockWithNotify(par2, par3, par4, 0); par1World.setBlockWithNotify(par2, par3, par4, 0);
this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0);
@@ -263,6 +268,10 @@ @@ -266,6 +271,10 @@
*/ */
public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5)
{ {
@ -34,7 +34,7 @@
if (par5 == 0) if (par5 == 0)
{ {
return false; return false;
@@ -293,7 +302,7 @@ @@ -296,7 +305,7 @@
--par2; --par2;
} }
@ -43,7 +43,7 @@
} }
} }
@@ -308,6 +317,10 @@ @@ -311,6 +320,10 @@
*/ */
private static boolean isValidSupportBlock(int par0) private static boolean isValidSupportBlock(int par0)
{ {

View file

@ -23,7 +23,7 @@
} }
/** /**
@@ -72,29 +79,32 @@ @@ -72,7 +79,10 @@
*/ */
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{ {
@ -34,7 +34,8 @@
+ par1World.isBlockSolidOnSide(par2, par3, par4 + 1, WEST ); + par1World.isBlockSolidOnSide(par2, par3, par4 + 1, WEST );
} }
public int func_85104_a(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) /**
@@ -82,22 +92,22 @@
{ {
byte var10 = 0; byte var10 = 0;
@ -61,7 +62,7 @@
{ {
var10 = 3; var10 = 3;
} }
@@ -121,22 +131,22 @@ @@ -127,22 +137,22 @@
int var7 = var6 & 3; int var7 = var6 & 3;
boolean var8 = false; boolean var8 = false;
@ -88,7 +89,7 @@
{ {
var8 = true; var8 = true;
} }
@@ -157,7 +167,7 @@ @@ -163,7 +173,7 @@
boolean var12 = (par6 & 8) == 8; boolean var12 = (par6 & 8) == 8;
boolean var13 = par5 == Block.tripWireSource.blockID; boolean var13 = par5 == Block.tripWireSource.blockID;
boolean var14 = false; boolean var14 = false;

View file

@ -20,11 +20,11 @@
{ {
public BlockVine(int par1) public BlockVine(int par1)
{ {
@@ -436,14 +440,26 @@ @@ -439,14 +443,26 @@
*/ */
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
{ {
- if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex) - if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID)
- { - {
- par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); - par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.vine, 1, 0)); - this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.vine, 1, 0));
@ -33,26 +33,27 @@
- { - {
- super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); - super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
- } - }
- }
+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); + super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
+ } + }
+ +
+ @Override + @Override
+ public boolean isShearable(ItemStack item, World world, int x, int y, int z) + public boolean isShearable(ItemStack item, World world, int x, int y, int z)
+ { + {
+ return true; + return true;
+ } + }
+ +
+ @Override + @Override
+ public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune) + public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune)
+ { + {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>(); + ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ ret.add(new ItemStack(this, 1, 0)); + ret.add(new ItemStack(this, 1, 0));
+ return ret; + return ret;
+ } + }
+ +
+ @Override + @Override
+ public boolean isLadder(World world, int x, int y, int z) + public boolean isLadder(World world, int x, int y, int z)
+ { + {
+ return true; + return true;
} + }
} }

View file

@ -100,7 +100,7 @@
- -
- if (this.objectMouseOver.entityHit instanceof EntityPainting) - if (this.objectMouseOver.entityHit instanceof EntityPainting)
- { - {
- var2 = Item.painting.shiftedIndex; - var2 = Item.painting.itemID;
- } - }
- else if (this.objectMouseOver.entityHit instanceof EntityItemFrame) - else if (this.objectMouseOver.entityHit instanceof EntityItemFrame)
- { - {
@ -108,7 +108,7 @@
- -
- if (var10.getDisplayedItem() == null) - if (var10.getDisplayedItem() == null)
- { - {
- var2 = Item.itemFrame.shiftedIndex; - var2 = Item.itemFrame.itemID;
- } - }
- else - else
- { - {
@ -123,24 +123,24 @@
- -
- if (var11.minecartType == 2) - if (var11.minecartType == 2)
- { - {
- var2 = Item.minecartPowered.shiftedIndex; - var2 = Item.minecartPowered.itemID;
- } - }
- else if (var11.minecartType == 1) - else if (var11.minecartType == 1)
- { - {
- var2 = Item.minecartCrate.shiftedIndex; - var2 = Item.minecartCrate.itemID;
- } - }
- else - else
- { - {
- var2 = Item.minecartEmpty.shiftedIndex; - var2 = Item.minecartEmpty.itemID;
- } - }
- } - }
- else if (this.objectMouseOver.entityHit instanceof EntityBoat) - else if (this.objectMouseOver.entityHit instanceof EntityBoat)
- { - {
- var2 = Item.boat.shiftedIndex; - var2 = Item.boat.itemID;
- } - }
- else - else
- { - {
- var2 = Item.monsterPlacer.shiftedIndex; - var2 = Item.monsterPlacer.itemID;
- var3 = EntityList.getEntityID(this.objectMouseOver.entityHit); - var3 = EntityList.getEntityID(this.objectMouseOver.entityHit);
- var4 = true; - var4 = true;
- -

View file

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java --- ../src_base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
+++ ../src_work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java +++ ../src_work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
@@ -331,7 +331,7 @@ @@ -333,7 +333,7 @@
if (var6 >= 0) if (var6 >= 0)
{ {
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);

View file

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java --- ../src_base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java
+++ ../src_work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java +++ ../src_work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java
@@ -50,6 +50,8 @@ @@ -55,6 +55,8 @@
private Slot field_74235_v = null; private Slot field_74235_v = null;
private boolean field_74234_w = false; private boolean field_74234_w = false;
private CreativeCrafting field_82324_x; private CreativeCrafting field_82324_x;
@ -9,8 +9,8 @@
public GuiContainerCreative(EntityPlayer par1EntityPlayer) public GuiContainerCreative(EntityPlayer par1EntityPlayer)
{ {
@@ -224,6 +226,13 @@ @@ -229,6 +231,13 @@
this.func_74227_b(CreativeTabs.creativeTabArray[var1]); this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[var1]);
this.field_82324_x = new CreativeCrafting(this.mc); this.field_82324_x = new CreativeCrafting(this.mc);
this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_82324_x); this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_82324_x);
+ int tabCount = CreativeTabs.creativeTabArray.length; + int tabCount = CreativeTabs.creativeTabArray.length;
@ -23,7 +23,7 @@
} }
else else
{ {
@@ -358,7 +367,7 @@ @@ -363,7 +372,7 @@
{ {
CreativeTabs var3 = CreativeTabs.creativeTabArray[selectedTabIndex]; CreativeTabs var3 = CreativeTabs.creativeTabArray[selectedTabIndex];
@ -32,16 +32,16 @@
{ {
this.fontRenderer.drawString(var3.getTranslatedTabLabel(), 8, 6, 4210752); this.fontRenderer.drawString(var3.getTranslatedTabLabel(), 8, 6, 4210752);
} }
@@ -380,7 +389,7 @@ @@ -385,7 +394,7 @@
{ {
CreativeTabs var9 = var6[var8]; CreativeTabs var9 = var6[var8];
- if (this.func_74232_a(var9, var4, var5)) - if (this.func_74232_a(var9, var4, var5))
+ if (var9 != null && func_74232_a(var9, var4, var5)) + if (var9 != null && func_74232_a(var9, var4, var5))
{ {
this.func_74227_b(var9); this.setCurrentCreativeTab(var9);
return; return;
@@ -396,11 +405,17 @@ @@ -401,11 +410,17 @@
*/ */
private boolean needsScrollBars() private boolean needsScrollBars()
{ {
@ -49,7 +49,7 @@
return selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && CreativeTabs.creativeTabArray[selectedTabIndex].shouldHidePlayerInventory() && ((ContainerCreative)this.inventorySlots).hasMoreThan1PageOfItemsInList(); return selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && CreativeTabs.creativeTabArray[selectedTabIndex].shouldHidePlayerInventory() && ((ContainerCreative)this.inventorySlots).hasMoreThan1PageOfItemsInList();
} }
private void func_74227_b(CreativeTabs par1CreativeTabs) private void setCurrentCreativeTab(CreativeTabs par1CreativeTabs)
{ {
+ if (par1CreativeTabs == null) + if (par1CreativeTabs == null)
+ { + {
@ -59,7 +59,7 @@
int var2 = selectedTabIndex; int var2 = selectedTabIndex;
selectedTabIndex = par1CreativeTabs.getTabIndex(); selectedTabIndex = par1CreativeTabs.getTabIndex();
ContainerCreative var3 = (ContainerCreative)this.inventorySlots; ContainerCreative var3 = (ContainerCreative)this.inventorySlots;
@@ -570,21 +585,42 @@ @@ -575,21 +590,42 @@
super.drawScreen(par1, par2, par3); super.drawScreen(par1, par2, par3);
CreativeTabs[] var11 = CreativeTabs.creativeTabArray; CreativeTabs[] var11 = CreativeTabs.creativeTabArray;
@ -89,7 +89,7 @@
+ renderCreativeInventoryHoveringText(CreativeTabs.tabInventory, par1, par2); + renderCreativeInventoryHoveringText(CreativeTabs.tabInventory, par1, par2);
+ } + }
+ +
if (this.field_74235_v != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.func_74188_c(this.field_74235_v.xDisplayPosition, this.field_74235_v.yDisplayPosition, 16, 16, par1, par2)) if (this.field_74235_v != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.isPointInRegion(this.field_74235_v.xDisplayPosition, this.field_74235_v.yDisplayPosition, 16, 16, par1, par2))
{ {
this.drawCreativeTabHoveringText(StringTranslate.getInstance().translateKey("inventory.binSlot"), par1, par2); this.drawCreativeTabHoveringText(StringTranslate.getInstance().translateKey("inventory.binSlot"), par1, par2);
+ } + }
@ -107,7 +107,7 @@
} }
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
@@ -605,14 +641,32 @@ @@ -610,14 +646,32 @@
int var8 = var7.length; int var8 = var7.length;
int var9; int var9;
@ -142,7 +142,7 @@
} }
} }
@@ -630,6 +684,14 @@ @@ -635,6 +689,14 @@
this.drawTexturedModalRect(var11, var8 + (int)((float)(var9 - var8 - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15); this.drawTexturedModalRect(var11, var8 + (int)((float)(var9 - var8 - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15);
} }
@ -157,7 +157,7 @@
this.renderCreativeTab(var5); this.renderCreativeTab(var5);
if (var5 == CreativeTabs.tabInventory) if (var5 == CreativeTabs.tabInventory)
@@ -640,6 +702,15 @@ @@ -645,6 +707,15 @@
protected boolean func_74232_a(CreativeTabs par1CreativeTabs, int par2, int par3) protected boolean func_74232_a(CreativeTabs par1CreativeTabs, int par2, int par3)
{ {
@ -173,7 +173,7 @@
int var4 = par1CreativeTabs.getTabColumn(); int var4 = par1CreativeTabs.getTabColumn();
int var5 = 28 * var4; int var5 = 28 * var4;
byte var6 = 0; byte var6 = 0;
@@ -754,7 +825,7 @@ @@ -759,7 +830,7 @@
var8 += 8 + (var3 ? 1 : -1); var8 += 8 + (var3 ? 1 : -1);
GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL12.GL_RESCALE_NORMAL);
@ -182,7 +182,7 @@
itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.renderEngine, var10, var7, var8); itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.renderEngine, var10, var7, var8);
itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.renderEngine, var10, var7, var8); itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.renderEngine, var10, var7, var8);
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
@@ -776,6 +847,15 @@ @@ -781,6 +852,15 @@
{ {
this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter)); this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter));
} }

View file

@ -12,7 +12,7 @@
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class NetClientHandler extends NetHandler public class NetClientHandler extends NetHandler
{ {
@@ -741,7 +746,7 @@ @@ -744,7 +749,7 @@
public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect) public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect)
{ {
@ -21,7 +21,7 @@
this.disconnected = true; this.disconnected = true;
this.mc.loadWorld((WorldClient)null); this.mc.loadWorld((WorldClient)null);
this.mc.displayGuiScreen(new GuiDisconnected("disconnect.disconnected", "disconnect.genericReason", new Object[] {par1Packet255KickDisconnect.reason})); this.mc.displayGuiScreen(new GuiDisconnected("disconnect.disconnected", "disconnect.genericReason", new Object[] {par1Packet255KickDisconnect.reason}));
@@ -807,7 +812,11 @@ @@ -810,7 +815,11 @@
public void handleChat(Packet3Chat par1Packet3Chat) public void handleChat(Packet3Chat par1Packet3Chat)
{ {
par1Packet3Chat = FMLNetworkHandler.handleChatMessage(this, par1Packet3Chat); par1Packet3Chat = FMLNetworkHandler.handleChatMessage(this, par1Packet3Chat);
@ -34,7 +34,7 @@
} }
public void handleAnimation(Packet18Animation par1Packet18Animation) public void handleAnimation(Packet18Animation par1Packet18Animation)
@@ -1189,6 +1198,10 @@ @@ -1192,6 +1201,10 @@
{ {
var2.readFromNBT(par1Packet132TileEntityData.customParam1); var2.readFromNBT(par1Packet132TileEntityData.customParam1);
} }

View file

@ -94,7 +94,7 @@
this.renderRainSnow(par1); this.renderRainSnow(par1);
@@ -1222,6 +1232,9 @@ @@ -1222,6 +1232,9 @@
{ {
this.func_82829_a(var5, par1); this.renderCloudsCheck(var5, par1);
} }
+ +
+ this.mc.mcProfiler.endStartSection("FRenderLast"); + this.mc.mcProfiler.endStartSection("FRenderLast");

View file

@ -64,7 +64,7 @@
Render var24; Render var24;
RenderPlayer var26; RenderPlayer var26;
- if (var17 != null && var17.itemID == Item.map.shiftedIndex) - if (var17 != null && var17.itemID == Item.map.itemID)
- { - {
+ if (var17 != null && var17.getItem() instanceof ItemMap) + if (var17 != null && var17.getItem() instanceof ItemMap)
+ { + {

View file

@ -9,7 +9,7 @@
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderBlocks public class RenderBlocks
@@ -617,9 +619,8 @@ @@ -620,9 +622,8 @@
public boolean renderBlockBed(Block par1Block, int par2, int par3, int par4) public boolean renderBlockBed(Block par1Block, int par2, int par3, int par4)
{ {
Tessellator var5 = Tessellator.instance; Tessellator var5 = Tessellator.instance;
@ -21,7 +21,7 @@
float var9 = 0.5F; float var9 = 0.5F;
float var10 = 1.0F; float var10 = 1.0F;
float var11 = 0.8F; float var11 = 0.8F;
@@ -628,6 +629,7 @@ @@ -631,6 +632,7 @@
var5.setBrightness(var25); var5.setBrightness(var25);
var5.setColorOpaque_F(var9, var9, var9); var5.setColorOpaque_F(var9, var9, var9);
int var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 0); int var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 0);
@ -29,7 +29,7 @@
int var28 = (var27 & 15) << 4; int var28 = (var27 & 15) << 4;
int var29 = var27 & 240; int var29 = var27 & 240;
double var30 = (double)((float)var28 / 256.0F); double var30 = (double)((float)var28 / 256.0F);
@@ -646,6 +648,7 @@ @@ -649,6 +651,7 @@
var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4)); var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4));
var5.setColorOpaque_F(var10, var10, var10); var5.setColorOpaque_F(var10, var10, var10);
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 1); var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 1);
@ -37,7 +37,7 @@
var28 = (var27 & 15) << 4; var28 = (var27 & 15) << 4;
var29 = var27 & 240; var29 = var27 & 240;
var30 = (double)((float)var28 / 256.0F); var30 = (double)((float)var28 / 256.0F);
@@ -2384,7 +2387,7 @@ @@ -2387,7 +2390,7 @@
double var28; double var28;
double var30; double var30;
@ -46,7 +46,7 @@
{ {
float var36 = 0.2F; float var36 = 0.2F;
float var19 = 0.0625F; float var19 = 0.0625F;
@@ -2404,7 +2407,7 @@ @@ -2407,7 +2410,7 @@
var9 = var20; var9 = var20;
} }
@ -55,7 +55,7 @@
{ {
var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13); var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13);
var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var11, var15); var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var11, var15);
@@ -2416,7 +2419,7 @@ @@ -2419,7 +2422,7 @@
var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13); var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13);
} }
@ -64,7 +64,7 @@
{ {
var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13); var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13);
var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15);
@@ -2428,7 +2431,7 @@ @@ -2431,7 +2434,7 @@
var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13); var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13);
} }
@ -73,7 +73,7 @@
{ {
var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var11, var13); var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var11, var13);
var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var11, var15); var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var11, var15);
@@ -2440,7 +2443,7 @@ @@ -2443,7 +2446,7 @@
var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var11, var13); var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var11, var13);
} }
@ -82,7 +82,7 @@
{ {
var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var13); var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var13);
var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var9, var15); var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var9, var15);
@@ -2452,7 +2455,7 @@ @@ -2455,7 +2458,7 @@
var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var13); var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var13);
} }
@ -91,7 +91,7 @@
{ {
var20 = (double)par2 + 0.5D + 0.5D; var20 = (double)par2 + 0.5D + 0.5D;
var22 = (double)par2 + 0.5D - 0.5D; var22 = (double)par2 + 0.5D - 0.5D;
@@ -4651,7 +4654,7 @@ @@ -4654,7 +4657,7 @@
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2); var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var27); this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
@ -100,7 +100,7 @@
{ {
this.colorRedTopLeft *= par5; this.colorRedTopLeft *= par5;
this.colorRedBottomLeft *= par5; this.colorRedBottomLeft *= par5;
@@ -4774,7 +4777,7 @@ @@ -4777,7 +4780,7 @@
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3); var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3);
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3)); this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3));
@ -109,7 +109,7 @@
{ {
this.colorRedTopLeft *= par5; this.colorRedTopLeft *= par5;
this.colorRedBottomLeft *= par5; this.colorRedBottomLeft *= par5;
@@ -4897,7 +4900,7 @@ @@ -4900,7 +4903,7 @@
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4); var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var27); this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
@ -118,7 +118,7 @@
{ {
this.colorRedTopLeft *= par5; this.colorRedTopLeft *= par5;
this.colorRedBottomLeft *= par5; this.colorRedBottomLeft *= par5;
@@ -5020,7 +5023,7 @@ @@ -5023,7 +5026,7 @@
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5); var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var27); this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
@ -127,7 +127,7 @@
{ {
this.colorRedTopLeft *= par5; this.colorRedTopLeft *= par5;
this.colorRedBottomLeft *= par5; this.colorRedBottomLeft *= par5;
@@ -5132,7 +5135,7 @@ @@ -5135,7 +5138,7 @@
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2); var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var28); this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
@ -136,7 +136,7 @@
{ {
var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7); var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7);
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, 38); this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
@@ -5148,7 +5151,7 @@ @@ -5151,7 +5154,7 @@
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3); var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3);
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, var28); this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
@ -145,7 +145,7 @@
{ {
var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7); var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7);
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, 38); this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
@@ -5164,7 +5167,7 @@ @@ -5167,7 +5170,7 @@
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4); var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var28); this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
@ -154,7 +154,7 @@
{ {
var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7); var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7);
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, 38); this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
@@ -5180,7 +5183,7 @@ @@ -5183,7 +5186,7 @@
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5); var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var28); this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var28);

View file

@ -48,7 +48,7 @@
{ {
double var4 = par2EntityPlayer.lastTickPosX + (par2EntityPlayer.posX - par2EntityPlayer.lastTickPosX) * (double)par3; double var4 = par2EntityPlayer.lastTickPosX + (par2EntityPlayer.posX - par2EntityPlayer.lastTickPosX) * (double)par3;
double var6 = par2EntityPlayer.lastTickPosY + (par2EntityPlayer.posY - par2EntityPlayer.lastTickPosY) * (double)par3; double var6 = par2EntityPlayer.lastTickPosY + (par2EntityPlayer.posY - par2EntityPlayer.lastTickPosY) * (double)par3;
@@ -1870,6 +1890,7 @@ @@ -1873,6 +1893,7 @@
double var17 = this.mc.renderViewEntity.posY - par4; double var17 = this.mc.renderViewEntity.posY - par4;
double var19 = this.mc.renderViewEntity.posZ - par6; double var19 = this.mc.renderViewEntity.posZ - par6;
EntityFX var21 = null; EntityFX var21 = null;
@ -56,7 +56,7 @@
if (par1Str.equals("hugeexplosion")) if (par1Str.equals("hugeexplosion"))
{ {
@@ -2006,6 +2027,7 @@ @@ -2009,6 +2030,7 @@
else if (par1Str.equals("snowballpoof")) else if (par1Str.equals("snowballpoof"))
{ {
var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, Item.snowball); var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, Item.snowball);
@ -64,7 +64,7 @@
} }
else if (par1Str.equals("dripWater")) else if (par1Str.equals("dripWater"))
{ {
@@ -2022,6 +2044,7 @@ @@ -2025,6 +2047,7 @@
else if (par1Str.equals("slime")) else if (par1Str.equals("slime"))
{ {
var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, Item.slimeBall); var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, Item.slimeBall);
@ -72,7 +72,7 @@
} }
else if (par1Str.equals("heart")) else if (par1Str.equals("heart"))
{ {
@@ -2043,6 +2066,7 @@ @@ -2046,6 +2069,7 @@
{ {
int var27 = Integer.parseInt(par1Str.substring(par1Str.indexOf("_") + 1)); int var27 = Integer.parseInt(par1Str.substring(par1Str.indexOf("_") + 1));
var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Item.itemsList[var27]); var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Item.itemsList[var27]);
@ -80,10 +80,10 @@
} }
else if (par1Str.startsWith("tilecrack_")) else if (par1Str.startsWith("tilecrack_"))
{ {
@@ -2050,11 +2074,12 @@ @@ -2053,11 +2077,12 @@
int var25 = Integer.parseInt(var28[1]); int var25 = Integer.parseInt(var28[1]);
int var26 = Integer.parseInt(var28[2]); int var26 = Integer.parseInt(var28[2]);
var21 = (new EntityDiggingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Block.blocksList[var25], 0, var26)).func_90019_g(var26); var21 = (new EntityDiggingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Block.blocksList[var25], 0, var26)).applyRenderColor(var26);
+ effectObject = Block.blocksList[var25]; + effectObject = Block.blocksList[var25];
} }

View file

@ -29,7 +29,7 @@
GL11.glPushMatrix(); GL11.glPushMatrix();
this.modelBipedMain.bipedHead.postRender(0.0625F); this.modelBipedMain.bipedHead.postRender(0.0625F);
- if (var5.getItem().shiftedIndex < 256) - if (var5.getItem().itemID < 256)
- { - {
- if (RenderBlocks.renderItemIn3d(Block.blocksList[var5.itemID].getRenderType())) - if (RenderBlocks.renderItemIn3d(Block.blocksList[var5.itemID].getRenderType()))
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var5, EQUIPPED); + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var5, EQUIPPED);

View file

@ -78,8 +78,8 @@
} }
var24 = 1.0F; var24 = 1.0F;
- this.renderBlocks.renderBlockAsItem(var14, var10.getItemDamage(), var24); - this.itemRenderBlocks.renderBlockAsItem(var14, var10.getItemDamage(), var24);
+ this.renderBlocks.renderBlockAsItem(Block.blocksList[var10.itemID], var10.getItemDamage(), var24); + this.itemRenderBlocks.renderBlockAsItem(Block.blocksList[var10.itemID], var10.getItemDamage(), var24);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
} }

View file

@ -58,7 +58,7 @@
this.modelBipedMain.bipedHead.postRender(0.0625F); this.modelBipedMain.bipedHead.postRender(0.0625F);
float var5; float var5;
- if (var4.getItem().shiftedIndex < 256) - if (var4.getItem().itemID < 256)
- { - {
- if (RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) - if (RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType()))
+ if (var4 != null && var4.getItem() instanceof ItemBlock) + if (var4 != null && var4.getItem() instanceof ItemBlock)

View file

@ -19,7 +19,7 @@
super.renderEquippedItems(par1EntitySnowman, par2); super.renderEquippedItems(par1EntitySnowman, par2);
ItemStack var3 = new ItemStack(Block.pumpkin, 1); ItemStack var3 = new ItemStack(Block.pumpkin, 1);
- if (var3 != null && var3.getItem().shiftedIndex < 256) - if (var3 != null && var3.getItem().itemID < 256)
+ if (var3 != null && var3.getItem() instanceof ItemBlock) + if (var3 != null && var3.getItem() instanceof ItemBlock)
{ {
GL11.glPushMatrix(); GL11.glPushMatrix();

View file

@ -26,4 +26,4 @@
+ +
if (var6 > -1) if (var6 > -1)
{ {
EntityPlayerMP[] var7 = PlayerSelector.func_82380_c(par1ICommandSender, var3[var6]); EntityPlayerMP[] var7 = PlayerSelector.matchPlayers(par1ICommandSender, var3[var6]);

View file

@ -59,7 +59,7 @@
- if (var5 != null && var5.getCreativeTab() == this) - if (var5 != null && var5.getCreativeTab() == this)
- { - {
- var5.getSubItems(var5.shiftedIndex, this, par1List); - var5.getSubItems(var5.itemID, this, par1List);
- } - }
- } - }
+ if (var5 == null) + if (var5 == null)
@ -71,7 +71,7 @@
+ { + {
+ if (tab == this) + if (tab == this)
+ { + {
+ var5.getSubItems(var5.shiftedIndex, this, par1List); + var5.getSubItems(var5.itemID, this, par1List);
+ } + }
+ } + }
+ } + }

View file

@ -37,7 +37,7 @@
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
@@ -222,6 +232,11 @@ @@ -222,6 +232,11 @@
protected int field_82152_aq; protected int field_82152_aq;
private boolean field_83001_bt; private boolean invulnerable;
public EnumEntitySize myEntitySize; public EnumEntitySize myEntitySize;
+ /** Forge: Used to store custom data for each entity. */ + /** Forge: Used to store custom data for each entity. */
+ private NBTTagCompound customEntityData; + private NBTTagCompound customEntityData;
@ -75,7 +75,7 @@
this.worldObj.theProfiler.endSection(); this.worldObj.theProfiler.endSection();
@@ -1514,6 +1532,15 @@ @@ -1514,6 +1532,15 @@
par1NBTTagCompound.setInteger("Dimension", this.dimension); par1NBTTagCompound.setInteger("Dimension", this.dimension);
par1NBTTagCompound.setBoolean("Invulnerable", this.field_83001_bt); par1NBTTagCompound.setBoolean("Invulnerable", this.invulnerable);
par1NBTTagCompound.setInteger("PortalCooldown", this.timeUntilPortal); par1NBTTagCompound.setInteger("PortalCooldown", this.timeUntilPortal);
+ if (persistentID != null) + if (persistentID != null)
+ { + {
@ -129,7 +129,7 @@
} }
/** /**
@@ -2356,7 +2398,7 @@ @@ -2359,7 +2401,7 @@
public float func_82146_a(Explosion par1Explosion, Block par2Block, int par3, int par4, int par5) public float func_82146_a(Explosion par1Explosion, Block par2Block, int par3, int par4, int par5)
{ {
@ -138,7 +138,7 @@
} }
public int func_82143_as() public int func_82143_as()
@@ -2396,4 +2438,84 @@ @@ -2399,4 +2441,84 @@
{ {
return this.isBurning(); return this.isBurning();
} }

View file

@ -57,12 +57,12 @@
+ return false; + return false;
+ } + }
+ +
if (this.func_85032_ar()) if (this.isEntityInvulnerable())
{ {
return false; return false;
@@ -1188,6 +1206,11 @@ @@ -1188,6 +1206,11 @@
{ {
if (!this.func_85032_ar()) if (!this.isEntityInvulnerable())
{ {
+ par2 = ForgeHooks.onLivingHurt(this, par1DamageSource, par2); + par2 = ForgeHooks.onLivingHurt(this, par1DamageSource, par2);
+ if (par2 <= 0) + if (par2 <= 0)
@ -121,7 +121,7 @@
} }
this.worldObj.setEntityState(this, (byte)3); this.worldObj.setEntityState(this, (byte)3);
@@ -1333,6 +1375,12 @@ @@ -1334,6 +1376,12 @@
*/ */
protected void fall(float par1) protected void fall(float par1)
{ {
@ -134,7 +134,7 @@
super.fall(par1); super.fall(par1);
int var2 = MathHelper.ceiling_float_int(par1 - 3.0F); int var2 = MathHelper.ceiling_float_int(par1 - 3.0F);
@@ -1535,7 +1583,7 @@ @@ -1536,7 +1584,7 @@
int var2 = MathHelper.floor_double(this.boundingBox.minY); int var2 = MathHelper.floor_double(this.boundingBox.minY);
int var3 = MathHelper.floor_double(this.posZ); int var3 = MathHelper.floor_double(this.posZ);
int var4 = this.worldObj.getBlockId(var1, var2, var3); int var4 = this.worldObj.getBlockId(var1, var2, var3);
@ -143,7 +143,7 @@
} }
/** /**
@@ -1948,6 +1996,7 @@ @@ -1949,6 +1997,7 @@
} }
this.isAirBorne = true; this.isAirBorne = true;
@ -151,7 +151,7 @@
} }
/** /**
@@ -2485,8 +2534,6 @@ @@ -2486,8 +2535,6 @@
return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD; return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD;
} }
@ -160,7 +160,7 @@
/** /**
* Remove the speified potion effect from this entity. * Remove the speified potion effect from this entity.
*/ */
@@ -2943,4 +2990,42 @@ @@ -2944,4 +2991,42 @@
{ {
this.dataWatcher.updateObject(10, Byte.valueOf((byte)par1)); this.dataWatcher.updateObject(10, Byte.valueOf((byte)par1));
} }
@ -191,10 +191,10 @@
+ } + }
+ } + }
+ +
+ /** + /**
+ * Returns true if the entity's rider (EntityPlayer) should face forward when mounted. + * Returns true if the entity's rider (EntityPlayer) should face forward when mounted.
+ * currently only used in vanilla code by pigs. + * currently only used in vanilla code by pigs.
+ * + *
+ * @param player The player who is riding the entity. + * @param player The player who is riding the entity.
+ * @return If the player should orient the same direction as this entity. + * @return If the player should orient the same direction as this entity.
+ */ + */

View file

@ -21,7 +21,7 @@
public class EntityMinecart extends Entity implements IInventory public class EntityMinecart extends Entity implements IInventory
{ {
/** Array of item stacks stored in minecart (for storage minecarts). */ /** Array of item stacks stored in minecart (for storage minecarts). */
@@ -52,6 +59,25 @@ @@ -54,6 +61,25 @@
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
protected double velocityZ; protected double velocityZ;
@ -47,7 +47,7 @@
public EntityMinecart(World par1World) public EntityMinecart(World par1World)
{ {
super(par1World); super(par1World);
@@ -63,6 +89,18 @@ @@ -65,6 +91,18 @@
this.setSize(0.98F, 0.7F); this.setSize(0.98F, 0.7F);
this.yOffset = this.height / 2.0F; this.yOffset = this.height / 2.0F;
this.field_82344_g = par1World != null ? par1World.func_82735_a(this) : null; this.field_82344_g = par1World != null ? par1World.func_82735_a(this) : null;
@ -66,7 +66,7 @@
} }
/** /**
@@ -88,6 +126,10 @@ @@ -90,6 +128,10 @@
*/ */
public AxisAlignedBB getCollisionBox(Entity par1Entity) public AxisAlignedBB getCollisionBox(Entity par1Entity)
{ {
@ -77,7 +77,7 @@
return par1Entity.canBePushed() ? par1Entity.boundingBox : null; return par1Entity.canBePushed() ? par1Entity.boundingBox : null;
} }
@@ -96,6 +138,10 @@ @@ -98,6 +140,10 @@
*/ */
public AxisAlignedBB getBoundingBox() public AxisAlignedBB getBoundingBox()
{ {
@ -88,7 +88,7 @@
return null; return null;
} }
@@ -104,7 +150,7 @@ @@ -106,7 +152,7 @@
*/ */
public boolean canBePushed() public boolean canBePushed()
{ {
@ -97,11 +97,11 @@
} }
public EntityMinecart(World par1World, double par2, double par4, double par6, int par8) public EntityMinecart(World par1World, double par2, double par4, double par6, int par8)
@@ -159,48 +205,7 @@ @@ -161,48 +207,7 @@
} }
this.setDead(); this.setDead();
- this.dropItemWithOffset(Item.minecartEmpty.shiftedIndex, 1, 0.0F); - this.dropItemWithOffset(Item.minecartEmpty.itemID, 1, 0.0F);
- -
- if (this.minecartType == 1) - if (this.minecartType == 1)
- { - {
@ -147,7 +147,7 @@
} }
return true; return true;
@@ -318,7 +323,7 @@ @@ -320,7 +325,7 @@
this.kill(); this.kill();
} }
@ -156,7 +156,7 @@
{ {
this.worldObj.spawnParticle("largesmoke", this.posX, this.posY + 0.8D, this.posZ, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle("largesmoke", this.posX, this.posY + 0.8D, this.posZ, 0.0D, 0.0D, 0.0D);
} }
@@ -416,18 +421,18 @@ @@ -418,18 +423,18 @@
double var6 = 0.0078125D; double var6 = 0.0078125D;
int var8 = this.worldObj.getBlockId(var45, var2, var47); int var8 = this.worldObj.getBlockId(var45, var2, var47);
@ -178,7 +178,7 @@
var12 = !var11; var12 = !var11;
} }
@@ -441,25 +446,7 @@ @@ -443,25 +448,7 @@
this.posY = (double)(var2 + 1); this.posY = (double)(var2 + 1);
} }
@ -203,9 +203,9 @@
- } - }
+ adjustSlopeVelocities(var10); + adjustSlopeVelocities(var10);
int[][] var13 = field_70500_g[var10]; int[][] var13 = matrix[var10];
double var14 = (double)(var13[1][0] - var13[0][0]); double var14 = (double)(var13[1][0] - var13[0][0]);
@@ -492,7 +479,7 @@ @@ -494,7 +481,7 @@
} }
} }
@ -214,7 +214,7 @@
{ {
var24 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); var24 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
@@ -540,36 +527,8 @@ @@ -542,36 +529,8 @@
this.posX = var26 + var14 * var24; this.posX = var26 + var14 * var24;
this.posZ = var28 + var16 * var24; this.posZ = var28 + var16 * var24;
this.setPosition(this.posX, this.posY + (double)this.yOffset, this.posZ); this.setPosition(this.posX, this.posY + (double)this.yOffset, this.posZ);
@ -253,7 +253,7 @@
if (var13[0][1] != 0 && MathHelper.floor_double(this.posX) - var45 == var13[0][0] && MathHelper.floor_double(this.posZ) - var47 == var13[0][2]) if (var13[0][1] != 0 && MathHelper.floor_double(this.posX) - var45 == var13[0][0] && MathHelper.floor_double(this.posZ) - var47 == var13[0][2])
{ {
@@ -580,42 +539,7 @@ @@ -582,42 +541,7 @@
this.setPosition(this.posX, this.posY + (double)var13[1][1], this.posZ); this.setPosition(this.posX, this.posY + (double)var13[1][1], this.posZ);
} }
@ -297,7 +297,7 @@
Vec3 var54 = this.func_70489_a(this.posX, this.posY, this.posZ); Vec3 var54 = this.func_70489_a(this.posX, this.posY, this.posZ);
@@ -645,30 +569,14 @@ @@ -647,30 +571,14 @@
double var41; double var41;
@ -336,7 +336,7 @@
{ {
var41 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); var41 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
@@ -704,41 +612,7 @@ @@ -706,41 +614,7 @@
} }
else else
{ {
@ -379,7 +379,7 @@
} }
this.doBlockCollisions(); this.doBlockCollisions();
@@ -765,7 +639,18 @@ @@ -767,7 +641,18 @@
} }
this.setRotation(this.rotationYaw, this.rotationPitch); this.setRotation(this.rotationYaw, this.rotationPitch);
@ -399,7 +399,7 @@
if (var15 != null && !var15.isEmpty()) if (var15 != null && !var15.isEmpty())
{ {
@@ -790,17 +675,8 @@ @@ -792,17 +677,8 @@
this.riddenByEntity = null; this.riddenByEntity = null;
} }
@ -419,7 +419,7 @@
} }
} }
@@ -824,12 +700,7 @@ @@ -826,12 +702,7 @@
} }
else else
{ {
@ -433,7 +433,7 @@
par3 = (double)var10; par3 = (double)var10;
@@ -875,13 +746,8 @@ @@ -877,13 +748,8 @@
if (BlockRail.isRailBlock(var10)) if (BlockRail.isRailBlock(var10))
{ {
@ -448,7 +448,7 @@
if (var11 >= 2 && var11 <= 5) if (var11 >= 2 && var11 <= 5)
{ {
@@ -946,13 +812,14 @@ @@ -948,13 +814,14 @@
{ {
par1NBTTagCompound.setInteger("Type", this.minecartType); par1NBTTagCompound.setInteger("Type", this.minecartType);
@ -467,7 +467,7 @@
{ {
NBTTagList var2 = new NBTTagList(); NBTTagList var2 = new NBTTagList();
@@ -978,13 +845,21 @@ @@ -980,13 +847,21 @@
{ {
this.minecartType = par1NBTTagCompound.getInteger("Type"); this.minecartType = par1NBTTagCompound.getInteger("Type");
@ -493,7 +493,7 @@
{ {
NBTTagList var2 = par1NBTTagCompound.getTagList("Items"); NBTTagList var2 = par1NBTTagCompound.getTagList("Items");
this.cargoItems = new ItemStack[this.getSizeInventory()]; this.cargoItems = new ItemStack[this.getSizeInventory()];
@@ -1013,11 +888,17 @@ @@ -1015,11 +890,17 @@
*/ */
public void applyEntityCollision(Entity par1Entity) public void applyEntityCollision(Entity par1Entity)
{ {
@ -512,7 +512,7 @@
{ {
par1Entity.mountEntity(this); par1Entity.mountEntity(this);
} }
@@ -1063,7 +944,7 @@ @@ -1065,7 +946,7 @@
double var18 = par1Entity.motionX + this.motionX; double var18 = par1Entity.motionX + this.motionX;
double var20 = par1Entity.motionZ + this.motionZ; double var20 = par1Entity.motionZ + this.motionZ;
@ -521,7 +521,7 @@
{ {
this.motionX *= 0.20000000298023224D; this.motionX *= 0.20000000298023224D;
this.motionZ *= 0.20000000298023224D; this.motionZ *= 0.20000000298023224D;
@@ -1071,7 +952,7 @@ @@ -1073,7 +954,7 @@
par1Entity.motionX *= 0.949999988079071D; par1Entity.motionX *= 0.949999988079071D;
par1Entity.motionZ *= 0.949999988079071D; par1Entity.motionZ *= 0.949999988079071D;
} }
@ -530,7 +530,7 @@
{ {
par1Entity.motionX *= 0.20000000298023224D; par1Entity.motionX *= 0.20000000298023224D;
par1Entity.motionZ *= 0.20000000298023224D; par1Entity.motionZ *= 0.20000000298023224D;
@@ -1106,7 +987,7 @@ @@ -1108,7 +989,7 @@
*/ */
public int getSizeInventory() public int getSizeInventory()
{ {
@ -539,7 +539,7 @@
} }
/** /**
@@ -1209,7 +1090,12 @@ @@ -1211,7 +1092,12 @@
*/ */
public boolean interact(EntityPlayer par1EntityPlayer) public boolean interact(EntityPlayer par1EntityPlayer)
{ {
@ -553,7 +553,7 @@
{ {
if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer) if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer)
{ {
@@ -1221,14 +1107,14 @@ @@ -1223,14 +1109,14 @@
par1EntityPlayer.mountEntity(this); par1EntityPlayer.mountEntity(this);
} }
} }
@ -570,7 +570,7 @@
{ {
ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem();
@@ -1352,4 +1238,375 @@ @@ -1354,4 +1240,375 @@
{ {
return this.dataWatcher.getWatchableObjectInt(18); return this.dataWatcher.getWatchableObjectInt(18);
} }

View file

@ -17,7 +17,7 @@
} }
} }
- if (var2 != null && var2.itemID == Item.shears.shiftedIndex && this.getGrowingAge() >= 0) - if (var2 != null && var2.itemID == Item.shears.itemID && this.getGrowingAge() >= 0)
- { - {
- this.setDead(); - this.setDead();
- this.worldObj.spawnParticle("largeexplode", this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D); - this.worldObj.spawnParticle("largeexplode", this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D);
@ -50,15 +50,15 @@
{ {
return this.spawnBabyAnimal(par1EntityAgeable); return this.spawnBabyAnimal(par1EntityAgeable);
} }
+ +
+ @Override + @Override
+ public boolean isShearable(ItemStack item, World world, int X, int Y, int Z) + public boolean isShearable(ItemStack item, World world, int X, int Y, int Z)
+ { + {
+ return getGrowingAge() >= 0; + return getGrowingAge() >= 0;
+ } + }
+ +
+ @Override + @Override
+ public ArrayList<ItemStack> onSheared(ItemStack item, World world, int X, int Y, int Z, int fortune) + public ArrayList<ItemStack> onSheared(ItemStack item, World world, int X, int Y, int Z, int fortune)
+ { + {
+ setDead(); + setDead();
+ EntityCow entitycow = new EntityCow(worldObj); + EntityCow entitycow = new EntityCow(worldObj);
@ -67,7 +67,7 @@
+ entitycow.renderYawOffset = renderYawOffset; + entitycow.renderYawOffset = renderYawOffset;
+ worldObj.spawnEntityInWorld(entitycow); + worldObj.spawnEntityInWorld(entitycow);
+ worldObj.spawnParticle("largeexplode", posX, posY + (double)(height / 2.0F), posZ, 0.0D, 0.0D, 0.0D); + worldObj.spawnParticle("largeexplode", posX, posY + (double)(height / 2.0F), posZ, 0.0D, 0.0D, 0.0D);
+ +
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>(); + ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ for (int x = 0; x < 5; x++) + for (int x = 0; x < 5; x++)
+ { + {

View file

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/entity/passive/EntityOcelot.java --- ../src_base/minecraft/net/minecraft/entity/passive/EntityOcelot.java
+++ ../src_work/minecraft/net/minecraft/entity/passive/EntityOcelot.java +++ ../src_work/minecraft/net/minecraft/entity/passive/EntityOcelot.java
@@ -354,8 +354,9 @@ @@ -355,8 +355,9 @@
} }
int var4 = this.worldObj.getBlockId(var1, var2 - 1, var3); int var4 = this.worldObj.getBlockId(var1, var2 - 1, var3);

View file

@ -20,13 +20,13 @@
{ {
private final InventoryCrafting field_90016_e = new InventoryCrafting(new ContainerSheep(this), 2, 1); private final InventoryCrafting field_90016_e = new InventoryCrafting(new ContainerSheep(this), 2, 1);
@@ -138,28 +142,6 @@ @@ -139,28 +143,6 @@
*/ */
public boolean interact(EntityPlayer par1EntityPlayer) public boolean interact(EntityPlayer par1EntityPlayer)
{ {
- ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem();
- -
- if (var2 != null && var2.itemID == Item.shears.shiftedIndex && !this.getSheared() && !this.isChild()) - if (var2 != null && var2.itemID == Item.shears.itemID && !this.getSheared() && !this.isChild())
- { - {
- if (!this.worldObj.isRemote) - if (!this.worldObj.isRemote)
- { - {
@ -43,13 +43,13 @@
- } - }
- -
- var2.damageItem(1, par1EntityPlayer); - var2.damageItem(1, par1EntityPlayer);
- this.func_85030_a("mob.sheep.shear", 1.0F, 1.0F); - this.playSound("mob.sheep.shear", 1.0F, 1.0F);
- } - }
- -
return super.interact(par1EntityPlayer); return super.interact(par1EntityPlayer);
} }
@@ -348,4 +330,24 @@ @@ -349,4 +331,24 @@
{ {
return this.func_90015_b(par1EntityAgeable); return this.func_90015_b(par1EntityAgeable);
} }

View file

@ -44,7 +44,7 @@
} }
} }
@@ -624,6 +638,9 @@ @@ -630,6 +644,9 @@
this.setPosition(this.posX, this.posY, this.posZ); this.setPosition(this.posX, this.posY, this.posZ);
this.motionY = 0.10000000149011612D; this.motionY = 0.10000000149011612D;
@ -54,7 +54,7 @@
if (this.username.equals("Notch")) if (this.username.equals("Notch"))
{ {
this.dropPlayerItemWithRandomChoice(new ItemStack(Item.appleRed, 1), true); this.dropPlayerItemWithRandomChoice(new ItemStack(Item.appleRed, 1), true);
@@ -632,6 +649,20 @@ @@ -638,6 +655,20 @@
if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory"))
{ {
this.inventory.dropAllItems(); this.inventory.dropAllItems();
@ -75,7 +75,7 @@
} }
if (par1DamageSource != null) if (par1DamageSource != null)
@@ -671,7 +702,20 @@ @@ -677,7 +708,20 @@
*/ */
public EntityItem dropOneItem(boolean par1) public EntityItem dropOneItem(boolean par1)
{ {
@ -97,7 +97,7 @@
} }
/** /**
@@ -680,7 +724,7 @@ @@ -686,7 +730,7 @@
*/ */
public EntityItem dropPlayerItem(ItemStack par1ItemStack) public EntityItem dropPlayerItem(ItemStack par1ItemStack)
{ {
@ -106,7 +106,7 @@
} }
/** /**
@@ -732,23 +776,39 @@ @@ -738,23 +782,39 @@
*/ */
public void joinEntityItemWithWorld(EntityItem par1EntityItem) public void joinEntityItemWithWorld(EntityItem par1EntityItem)
{ {
@ -151,7 +151,7 @@
{ {
var2 += var5 * 0.08F; var2 += var5 * 0.08F;
} }
@@ -778,7 +838,8 @@ @@ -784,7 +844,8 @@
var2 /= 5.0F; var2 /= 5.0F;
} }
@ -161,7 +161,7 @@
} }
/** /**
@@ -786,7 +847,7 @@ @@ -792,7 +853,7 @@
*/ */
public boolean canHarvestBlock(Block par1Block) public boolean canHarvestBlock(Block par1Block)
{ {
@ -170,9 +170,9 @@
} }
/** /**
@@ -1073,12 +1134,22 @@ @@ -1079,12 +1140,22 @@
{ {
if (!this.func_85032_ar()) if (!this.isEntityInvulnerable())
{ {
+ par2 = ForgeHooks.onLivingHurt(this, par1DamageSource, par2); + par2 = ForgeHooks.onLivingHurt(this, par1DamageSource, par2);
+ if (par2 <= 0) + if (par2 <= 0)
@ -194,7 +194,7 @@
par2 = this.applyPotionDamageCalculations(par1DamageSource, par2); par2 = this.applyPotionDamageCalculations(par1DamageSource, par2);
this.addExhaustion(par1DamageSource.getHungerDamage()); this.addExhaustion(par1DamageSource.getHungerDamage());
this.health -= par2; this.health -= par2;
@@ -1119,6 +1190,10 @@ @@ -1125,6 +1196,10 @@
public boolean interactWith(Entity par1Entity) public boolean interactWith(Entity par1Entity)
{ {
@ -205,7 +205,7 @@
if (par1Entity.interact(this)) if (par1Entity.interact(this))
{ {
return true; return true;
@@ -1162,7 +1237,9 @@ @@ -1168,7 +1243,9 @@
*/ */
public void destroyCurrentEquippedItem() public void destroyCurrentEquippedItem()
{ {
@ -215,7 +215,7 @@
} }
/** /**
@@ -1179,6 +1256,15 @@ @@ -1185,6 +1262,15 @@
*/ */
public void attackTargetEntityWithCurrentItem(Entity par1Entity) public void attackTargetEntityWithCurrentItem(Entity par1Entity)
{ {
@ -231,7 +231,7 @@
if (par1Entity.canAttackWithItem()) if (par1Entity.canAttackWithItem())
{ {
if (!par1Entity.func_85031_j(this)) if (!par1Entity.func_85031_j(this))
@@ -1342,6 +1428,12 @@ @@ -1348,6 +1434,12 @@
*/ */
public EnumStatus sleepInBedAt(int par1, int par2, int par3) public EnumStatus sleepInBedAt(int par1, int par2, int par3)
{ {
@ -244,7 +244,7 @@
if (!this.worldObj.isRemote) if (!this.worldObj.isRemote)
{ {
if (this.isPlayerSleeping() || !this.isEntityAlive()) if (this.isPlayerSleeping() || !this.isEntityAlive())
@@ -1381,6 +1473,11 @@ @@ -1387,6 +1479,11 @@
{ {
int var9 = this.worldObj.getBlockMetadata(par1, par2, par3); int var9 = this.worldObj.getBlockMetadata(par1, par2, par3);
int var5 = BlockBed.getDirection(var9); int var5 = BlockBed.getDirection(var9);
@ -256,7 +256,7 @@
float var10 = 0.5F; float var10 = 0.5F;
float var7 = 0.5F; float var7 = 0.5F;
@@ -1451,10 +1548,12 @@ @@ -1457,10 +1554,12 @@
ChunkCoordinates var4 = this.playerLocation; ChunkCoordinates var4 = this.playerLocation;
ChunkCoordinates var5 = this.playerLocation; ChunkCoordinates var5 = this.playerLocation;
@ -273,7 +273,7 @@
if (var5 == null) if (var5 == null)
{ {
@@ -1491,7 +1590,9 @@ @@ -1497,7 +1596,9 @@
*/ */
private boolean isInBed() private boolean isInBed()
{ {
@ -284,7 +284,7 @@
} }
/** /**
@@ -1506,9 +1607,12 @@ @@ -1512,9 +1613,12 @@
var3.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); var3.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4);
var3.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); var3.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4);
@ -300,7 +300,7 @@
return var8; return var8;
} }
else else
@@ -1530,8 +1634,11 @@ @@ -1536,8 +1640,11 @@
{ {
if (this.playerLocation != null) if (this.playerLocation != null)
{ {
@ -314,7 +314,7 @@
switch (var2) switch (var2)
{ {
@@ -1840,7 +1947,7 @@ @@ -1846,7 +1953,7 @@
{ {
if (par1ItemStack.getItem().requiresMultipleRenderPasses()) if (par1ItemStack.getItem().requiresMultipleRenderPasses())
{ {
@ -322,8 +322,8 @@
+ return par1ItemStack.getItem().getIconIndex(par1ItemStack, par2); + return par1ItemStack.getItem().getIconIndex(par1ItemStack, par2);
} }
if (this.itemInUse != null && par1ItemStack.itemID == Item.bow.shiftedIndex) if (this.itemInUse != null && par1ItemStack.itemID == Item.bow.itemID)
@@ -1862,6 +1969,7 @@ @@ -1868,6 +1975,7 @@
return 101; return 101;
} }
} }
@ -331,7 +331,7 @@
} }
return var3; return var3;
@@ -2082,6 +2190,14 @@ @@ -2088,6 +2196,14 @@
} }
this.theInventoryEnderChest = par1EntityPlayer.theInventoryEnderChest; this.theInventoryEnderChest = par1EntityPlayer.theInventoryEnderChest;

View file

@ -4,7 +4,7 @@
} }
else if (par2 != 1 && par2 != 0) else if (par2 != 1 && par2 != 0)
{ {
- if (FurnaceRecipes.smelting().getSmeltingResult(var5.getItem().shiftedIndex) != null) - if (FurnaceRecipes.smelting().getSmeltingResult(var5.getItem().itemID) != null)
+ if (FurnaceRecipes.smelting().getSmeltingResult(var5) != null) + if (FurnaceRecipes.smelting().getSmeltingResult(var5) != null)
{ {
if (!this.mergeItemStack(var5, 0, 1, false)) if (!this.mergeItemStack(var5, 0, 1, false))

View file

@ -14,15 +14,15 @@
*/ */
public int getArmorCraftingMaterial() public int getArmorCraftingMaterial()
{ {
- return this == CLOTH ? Item.leather.shiftedIndex : (this == CHAIN ? Item.ingotIron.shiftedIndex : (this == GOLD ? Item.ingotGold.shiftedIndex : (this == IRON ? Item.ingotIron.shiftedIndex : (this == DIAMOND ? Item.diamond.shiftedIndex : 0)))); - return this == CLOTH ? Item.leather.itemID : (this == CHAIN ? Item.ingotIron.itemID : (this == GOLD ? Item.ingotGold.itemID : (this == IRON ? Item.ingotIron.itemID : (this == DIAMOND ? Item.diamond.itemID : 0))));
+ switch (this) + switch (this)
+ { + {
+ case CLOTH: return Item.leather.shiftedIndex; + case CLOTH: return Item.leather.itemID;
+ case CHAIN: return Item.ingotIron.shiftedIndex; + case CHAIN: return Item.ingotIron.itemID;
+ case GOLD: return Item.ingotGold.shiftedIndex; + case GOLD: return Item.ingotGold.itemID;
+ case IRON: return Item.ingotIron.shiftedIndex; + case IRON: return Item.ingotIron.itemID;
+ case DIAMOND: return Item.diamond.shiftedIndex; + case DIAMOND: return Item.diamond.itemID;
+ default: return (customCraftingMaterial == null ? 0 : customCraftingMaterial.shiftedIndex); + default: return (customCraftingMaterial == null ? 0 : customCraftingMaterial.itemID);
+ } + }
} }
} }

View file

@ -14,15 +14,15 @@
*/ */
public int getToolCraftingMaterial() public int getToolCraftingMaterial()
{ {
- return this == WOOD ? Block.planks.blockID : (this == STONE ? Block.cobblestone.blockID : (this == GOLD ? Item.ingotGold.shiftedIndex : (this == IRON ? Item.ingotIron.shiftedIndex : (this == EMERALD ? Item.diamond.shiftedIndex : 0)))); - return this == WOOD ? Block.planks.blockID : (this == STONE ? Block.cobblestone.blockID : (this == GOLD ? Item.ingotGold.itemID : (this == IRON ? Item.ingotIron.itemID : (this == EMERALD ? Item.diamond.itemID : 0))));
+ switch (this) + switch (this)
+ { + {
+ case WOOD: return Block.planks.blockID; + case WOOD: return Block.planks.blockID;
+ case STONE: return Block.cobblestone.blockID; + case STONE: return Block.cobblestone.blockID;
+ case GOLD: return Item.ingotGold.shiftedIndex; + case GOLD: return Item.ingotGold.itemID;
+ case IRON: return Item.ingotIron.shiftedIndex; + case IRON: return Item.ingotIron.itemID;
+ case EMERALD: return Item.diamond.shiftedIndex; + case EMERALD: return Item.diamond.itemID;
+ default: return (customCraftingMaterial == null ? 0 : customCraftingMaterial.shiftedIndex); + default: return (customCraftingMaterial == null ? 0 : customCraftingMaterial.itemID);
+ } + }
} }
} }

View file

@ -27,7 +27,7 @@
+ +
public Item(int par1) public Item(int par1)
{ {
this.shiftedIndex = 256 + par1; this.itemID = 256 + par1;
if (itemsList[256 + par1] != null) if (itemsList[256 + par1] != null)
{ {

View file

@ -20,14 +20,14 @@
{ {
@@ -92,14 +94,8 @@ @@ -92,14 +94,8 @@
int var13 = this.getMetadata(par1ItemStack.getItemDamage()); int var13 = this.getMetadata(par1ItemStack.getItemDamage());
int var14 = Block.blocksList[this.blockID].func_85104_a(par3World, par4, par5, par6, par7, par8, par9, par10, var13); int var14 = Block.blocksList[this.blockID].onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, var13);
- if (par3World.setBlockAndMetadataWithNotify(par4, par5, par6, this.blockID, var14)) - if (par3World.setBlockAndMetadataWithNotify(par4, par5, par6, this.blockID, var14))
- { - {
- if (par3World.getBlockId(par4, par5, par6) == this.blockID) - if (par3World.getBlockId(par4, par5, par6) == this.blockID)
- { - {
- Block.blocksList[this.blockID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer); - Block.blocksList[this.blockID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer);
- Block.blocksList[this.blockID].func_85105_g(par3World, par4, par5, par6, var14); - Block.blocksList[this.blockID].onPostBlockPlaced(par3World, par4, par5, par6, var14);
- } - }
- -
+ if (placeBlockAt(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10, var14)) + if (placeBlockAt(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10, var14))
@ -68,7 +68,7 @@
+ if (world.getBlockId(x, y, z) == this.blockID) + if (world.getBlockId(x, y, z) == this.blockID)
+ { + {
+ Block.blocksList[this.blockID].onBlockPlacedBy(world, x, y, z, player); + Block.blocksList[this.blockID].onBlockPlacedBy(world, x, y, z, player);
+ Block.blocksList[this.blockID].func_85105_g(world, x, y, z, metadata); + Block.blocksList[this.blockID].onPostBlockPlaced(world, x, y, z, metadata);
+ } + }
+ +
+ return true; + return true;

View file

@ -16,7 +16,7 @@
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
{ {
+ int var6 = this.getMaxItemUseDuration(par1ItemStack) - par4; + int var6 = this.getMaxItemUseDuration(par1ItemStack) - par4;
+ +
+ ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, var6); + ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, var6);
+ MinecraftForge.EVENT_BUS.post(event); + MinecraftForge.EVENT_BUS.post(event);
+ if (event.isCanceled()) + if (event.isCanceled())
@ -24,10 +24,10 @@
+ return; + return;
+ } + }
+ var6 = event.charge; + var6 = event.charge;
+ +
boolean var5 = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0; boolean var5 = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;
if (var5 || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex)) if (var5 || par3EntityPlayer.inventory.hasItem(Item.arrow.itemID))
{ {
- int var6 = this.getMaxItemUseDuration(par1ItemStack) - par4; - int var6 = this.getMaxItemUseDuration(par1ItemStack) - par4;
float var7 = (float)var6 / 20.0F; float var7 = (float)var6 / 20.0F;
@ -43,7 +43,7 @@
+ { + {
+ return event.result; + return event.result;
+ } + }
+ +
if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex)) if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Item.arrow.itemID))
{ {
par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));

View file

@ -8,7 +8,7 @@
import java.util.zip.DataFormatException; import java.util.zip.DataFormatException;
import java.util.zip.Deflater; import java.util.zip.Deflater;
import java.util.zip.Inflater; import java.util.zip.Inflater;
@@ -45,6 +46,8 @@ @@ -47,6 +48,8 @@
/** A temporary storage for the compressed chunk data byte array. */ /** A temporary storage for the compressed chunk data byte array. */
private static byte[] temp = new byte[196864]; private static byte[] temp = new byte[196864];
@ -17,15 +17,15 @@
public Packet51MapChunk() public Packet51MapChunk()
{ {
this.isChunkDataPacket = true; this.isChunkDataPacket = true;
@@ -57,17 +60,22 @@ @@ -59,24 +62,29 @@
this.zCh = par1Chunk.zPosition; this.zCh = par1Chunk.zPosition;
this.includeInitialize = par2; this.includeInitialize = par2;
Packet51MapChunkData var4 = getMapChunkData(par1Chunk, par2, par3); Packet51MapChunkData var4 = getMapChunkData(par1Chunk, par2, par3);
- Deflater var5 = new Deflater(-1); - Deflater var5 = new Deflater(-1);
this.yChMax = var4.field_74581_c; this.yChMax = var4.chunkHasAddSectionFlag;
this.yChMin = var4.field_74580_b; this.yChMin = var4.chunkExistFlag;
- -
+ this.field_73596_g = var4.field_74582_a; + this.compressedChunkData = var4.compressedData;
+ this.deflateGate = new Semaphore(1); + this.deflateGate = new Semaphore(1);
+ } + }
+ +
@ -34,19 +34,28 @@
+ Deflater var5 = new Deflater(-1); + Deflater var5 = new Deflater(-1);
try try
{ {
- this.field_73596_g = var4.field_74582_a; - this.compressedChunkData = var4.compressedData;
- var5.setInput(var4.field_74582_a, 0, var4.field_74582_a.length); - var5.setInput(var4.compressedData, 0, var4.compressedData.length);
+ var5.setInput(field_73596_g, 0, field_73596_g.length); + var5.setInput(compressedChunkData, 0, compressedChunkData.length);
var5.finish(); var5.finish();
- this.chunkData = new byte[var4.field_74582_a.length]; - this.chunkData = new byte[var4.compressedData.length];
- this.tempLength = var5.deflate(this.chunkData); - this.tempLength = var5.deflate(this.chunkData);
+ byte[] deflated = new byte[field_73596_g.length]; + byte[] deflated = new byte[compressedChunkData.length];
+ this.tempLength = var5.deflate(deflated); + this.tempLength = var5.deflate(deflated);
+ this.chunkData = deflated; + this.chunkData = deflated;
} }
finally finally
{ {
@@ -95,13 +103,16 @@ var5.end();
}
- }
-
+
+ }
/**
* Abstract. Reads the raw packet data from the data stream.
*/
@@ -97,13 +105,16 @@
par1DataInputStream.readFully(temp, 0, this.tempLength); par1DataInputStream.readFully(temp, 0, this.tempLength);
int var2 = 0; int var2 = 0;
int var3; int var3;
@ -63,7 +72,7 @@
if (this.includeInitialize) if (this.includeInitialize)
{ {
@@ -131,6 +142,16 @@ @@ -133,6 +144,16 @@
*/ */
public void writePacketData(DataOutputStream par1DataOutputStream) throws IOException public void writePacketData(DataOutputStream par1DataOutputStream) throws IOException
{ {

View file

@ -8,38 +8,37 @@
import java.util.zip.DataFormatException; import java.util.zip.DataFormatException;
import java.util.zip.Deflater; import java.util.zip.Deflater;
import java.util.zip.Inflater; import java.util.zip.Inflater;
@@ -22,6 +23,9 @@ @@ -26,6 +27,9 @@
private int field_73585_g; private int dataLength;
private boolean field_92024_h; private boolean field_92024_h;
private static byte[] field_73591_h = new byte[0]; private static byte[] chunkDataNotCompressed = new byte[0];
+ private int maxLen = 0; + private int maxLen = 0;
+ +
+ private Semaphore deflateGate; + private Semaphore deflateGate;
public Packet56MapChunks() {} public Packet56MapChunks() {}
@@ -40,31 +44,37 @@ @@ -44,15 +48,6 @@
{ {
Chunk var5 = (Chunk)par1List.get(var4); Chunk var5 = (Chunk)par1List.get(var4);
Packet51MapChunkData var6 = Packet51MapChunk.getMapChunkData(var5, true, 65535); Packet51MapChunkData var6 = Packet51MapChunk.getMapChunkData(var5, true, 65535);
- -
- if (field_73591_h.length < var3 + var6.field_74582_a.length) - if (chunkDataNotCompressed.length < var3 + var6.compressedData.length)
- { - {
- byte[] var7 = new byte[var3 + var6.field_74582_a.length]; - byte[] var7 = new byte[var3 + var6.compressedData.length];
- System.arraycopy(field_73591_h, 0, var7, 0, field_73591_h.length); - System.arraycopy(chunkDataNotCompressed, 0, var7, 0, chunkDataNotCompressed.length);
- field_73591_h = var7; - chunkDataNotCompressed = var7;
- } - }
- -
- System.arraycopy(var6.field_74582_a, 0, field_73591_h, var3, var6.field_74582_a.length); - System.arraycopy(var6.compressedData, 0, chunkDataNotCompressed, var3, var6.compressedData.length);
var3 += var6.field_74582_a.length; var3 += var6.compressedData.length;
this.field_73589_c[var4] = var5.xPosition; this.chunkPostX[var4] = var5.xPosition;
this.field_73586_d[var4] = var5.zPosition; this.chunkPosZ[var4] = var5.zPosition;
this.field_73590_a[var4] = var6.field_74580_b; @@ -60,21 +55,35 @@
this.field_73588_b[var4] = var6.field_74581_c; this.field_73588_b[var4] = var6.chunkHasAddSectionFlag;
this.field_73584_f[var4] = var6.field_74582_a; this.field_73584_f[var4] = var6.compressedData;
+ deflateGate = new Semaphore(1); }
+ } + deflateGate = new Semaphore(1);
+
+ maxLen = var3; + maxLen = var3;
+ } + }
+ +
@ -51,37 +50,27 @@
+ { + {
+ System.arraycopy(field_73584_f[x], 0, data, offset, field_73584_f[x].length); + System.arraycopy(field_73584_f[x], 0, data, offset, field_73584_f[x].length);
+ offset += field_73584_f[x].length; + offset += field_73584_f[x].length;
} + }
Deflater var11 = new Deflater(-1); Deflater var11 = new Deflater(-1);
-
try try
{ {
- var11.setInput(field_73591_h, 0, var3); - var11.setInput(chunkDataNotCompressed, 0, var3);
+ var11.setInput(data, 0, maxLen); + var11.setInput(data, 0, maxLen);
var11.finish(); var11.finish();
- this.field_73587_e = new byte[var3]; - this.chunkDataBuffer = new byte[var3];
- this.field_73585_g = var11.deflate(this.field_73587_e); - this.dataLength = var11.deflate(this.chunkDataBuffer);
+ byte[] deflated = new byte[maxLen]; + byte[] deflated = new byte[maxLen];
+ this.field_73585_g = var11.deflate(deflated); + this.dataLength = var11.deflate(deflated);
+ this.field_73587_e = deflated; + this.chunkDataBuffer = deflated;
} }
finally finally
{ {
@@ -146,6 +156,16 @@ var11.end();
*/ }
public void writePacketData(DataOutputStream par1DataOutputStream) throws IOException }
{
+ if (field_73587_e == null)
+ {
+ deflateGate.acquireUninterruptibly();
+ if (field_73587_e == null)
+ {
+ deflate();
+ }
+ deflateGate.release();
+ }
+ +
par1DataOutputStream.writeShort(this.field_73589_c.length);
par1DataOutputStream.writeInt(this.field_73585_g); /**
par1DataOutputStream.writeBoolean(this.field_92024_h); * Abstract. Reads the raw packet data from the data stream.

View file

@ -12,9 +12,9 @@
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
public class PotionEffect public class PotionEffect
@@ -16,6 +21,9 @@ @@ -20,6 +25,9 @@
private boolean field_82723_d; /** Whether the potion effect came from a beacon */
private boolean field_82724_e; private boolean isAmbient;
+ /** List of ItemStack that can cure the potion effect **/ + /** List of ItemStack that can cure the potion effect **/
+ private List<ItemStack> curativeItems; + private List<ItemStack> curativeItems;
@ -22,16 +22,16 @@
public PotionEffect(int par1, int par2) public PotionEffect(int par1, int par2)
{ {
this(par1, par2, 0); this(par1, par2, 0);
@@ -32,6 +40,8 @@ @@ -36,6 +44,8 @@
this.duration = par2; this.duration = par2;
this.amplifier = par3; this.amplifier = par3;
this.field_82724_e = par4; this.isAmbient = par4;
+ this.curativeItems = new ArrayList<ItemStack>(); + this.curativeItems = new ArrayList<ItemStack>();
+ this.curativeItems.add(new ItemStack(Item.bucketMilk)); + this.curativeItems.add(new ItemStack(Item.bucketMilk));
} }
public PotionEffect(PotionEffect par1PotionEffect) public PotionEffect(PotionEffect par1PotionEffect)
@@ -39,6 +49,7 @@ @@ -43,6 +53,7 @@
this.potionID = par1PotionEffect.potionID; this.potionID = par1PotionEffect.potionID;
this.duration = par1PotionEffect.duration; this.duration = par1PotionEffect.duration;
this.amplifier = par1PotionEffect.amplifier; this.amplifier = par1PotionEffect.amplifier;
@ -39,21 +39,21 @@
} }
/** /**
@@ -83,6 +94,63 @@ @@ -87,6 +98,63 @@
public int getAmplifier() public int getAmplifier()
{ {
return this.amplifier; return this.amplifier;
+ } + }
+ +
+ /*** + /***
+ * Returns a list of curative items for the potion effect + * Returns a list of curative items for the potion effect
+ * @return The list (ItemStack) of curative items for the potion effect + * @return The list (ItemStack) of curative items for the potion effect
+ */ + */
+ public List<ItemStack> getCurativeItems() + public List<ItemStack> getCurativeItems()
+ { + {
+ return this.curativeItems; + return this.curativeItems;
+ } + }
+ +
+ /*** + /***
+ * Checks the given ItemStack to see if it is in the list of curative items for the potion effect + * Checks the given ItemStack to see if it is in the list of curative items for the potion effect
+ * @param stack The ItemStack being checked against the list of curative items for the potion effect + * @param stack The ItemStack being checked against the list of curative items for the potion effect
@ -72,16 +72,16 @@
+ +
+ return found; + return found;
+ } + }
+ +
+ /*** + /***
+ * Sets the array of curative items for the potion effect + * Sets the array of curative items for the potion effect
+ * @param curativeItems The list of ItemStacks being set to the potion effect + * @param curativeItems The list of ItemStacks being set to the potion effect
+ */ + */
+ public void setCurativeItems(List<ItemStack> curativeItems) + public void setCurativeItems(List<ItemStack> curativeItems)
+ { + {
+ this.curativeItems = curativeItems; + this.curativeItems = curativeItems;
+ } + }
+ +
+ /*** + /***
+ * Adds the given stack to list of curative items for the potion effect + * Adds the given stack to list of curative items for the potion effect
+ * @param stack The ItemStack being added to the curative item list + * @param stack The ItemStack being added to the curative item list

View file

@ -34,7 +34,7 @@
} }
else else
{ {
- ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().shiftedIndex); - ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().itemID);
- return var1 == null ? false : (this.furnaceItemStacks[2] == null ? true : (!this.furnaceItemStacks[2].isItemEqual(var1) ? false : (this.furnaceItemStacks[2].stackSize < this.getInventoryStackLimit() && this.furnaceItemStacks[2].stackSize < this.furnaceItemStacks[2].getMaxStackSize() ? true : this.furnaceItemStacks[2].stackSize < var1.getMaxStackSize()))); - return var1 == null ? false : (this.furnaceItemStacks[2] == null ? true : (!this.furnaceItemStacks[2].isItemEqual(var1) ? false : (this.furnaceItemStacks[2].stackSize < this.getInventoryStackLimit() && this.furnaceItemStacks[2].stackSize < this.furnaceItemStacks[2].getMaxStackSize() ? true : this.furnaceItemStacks[2].stackSize < var1.getMaxStackSize())));
+ ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]); + ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);
+ if (var1 == null) return false; + if (var1 == null) return false;
@ -49,7 +49,7 @@
{ {
if (this.canSmelt()) if (this.canSmelt())
{ {
- ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().shiftedIndex); - ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().itemID);
+ ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]); + ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);
if (this.furnaceItemStacks[2] == null) if (this.furnaceItemStacks[2] == null)
@ -66,7 +66,7 @@
--this.furnaceItemStacks[0].stackSize; --this.furnaceItemStacks[0].stackSize;
@@ -341,7 +348,7 @@ @@ -341,7 +348,7 @@
int var1 = par0ItemStack.getItem().shiftedIndex; int var1 = par0ItemStack.getItem().itemID;
Item var2 = par0ItemStack.getItem(); Item var2 = par0ItemStack.getItem();
- if (var1 < 256 && Block.blocksList[var1] != null) - if (var1 < 256 && Block.blocksList[var1] != null)
@ -83,7 +83,7 @@
+ public int getStartInventorySide(ForgeDirection side) + public int getStartInventorySide(ForgeDirection side)
+ { + {
+ if (side == ForgeDirection.DOWN) return 1; + if (side == ForgeDirection.DOWN) return 1;
+ if (side == ForgeDirection.UP) return 0; + if (side == ForgeDirection.UP) return 0;
+ return 2; + return 2;
+ } + }
+ +

View file

@ -31,7 +31,7 @@
/** /**
* boolean; if true updates scheduled by scheduleBlockUpdate happen immediately * boolean; if true updates scheduled by scheduleBlockUpdate happen immediately
*/ */
@@ -165,6 +187,11 @@ @@ -162,6 +184,11 @@
* Gets the biome for a given set of x/z coordinates * Gets the biome for a given set of x/z coordinates
*/ */
public BiomeGenBase getBiomeGenForCoords(int par1, int par2) public BiomeGenBase getBiomeGenForCoords(int par1, int par2)
@ -43,7 +43,7 @@
{ {
if (this.blockExists(par1, 0, par2)) if (this.blockExists(par1, 0, par2))
{ {
@@ -195,7 +222,13 @@ @@ -192,7 +219,13 @@
this.theProfiler = par5Profiler; this.theProfiler = par5Profiler;
this.worldInfo = new WorldInfo(par4WorldSettings, par2Str); this.worldInfo = new WorldInfo(par4WorldSettings, par2Str);
this.provider = par3WorldProvider; this.provider = par3WorldProvider;
@ -58,7 +58,7 @@
VillageCollection var6 = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages"); VillageCollection var6 = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages");
if (var6 == null) if (var6 == null)
@@ -209,7 +242,7 @@ @@ -206,7 +239,7 @@
this.villageCollectionObj.func_82566_a(this); this.villageCollectionObj.func_82566_a(this);
} }
@ -67,7 +67,7 @@
this.chunkProvider = this.createChunkProvider(); this.chunkProvider = this.createChunkProvider();
this.calculateInitialSkylight(); this.calculateInitialSkylight();
this.calculateInitialWeather(); this.calculateInitialWeather();
@@ -223,7 +256,7 @@ @@ -220,7 +253,7 @@
this.isRemote = false; this.isRemote = false;
this.saveHandler = par1ISaveHandler; this.saveHandler = par1ISaveHandler;
this.theProfiler = par5Profiler; this.theProfiler = par5Profiler;
@ -76,7 +76,7 @@
this.worldInfo = par1ISaveHandler.loadWorldInfo(); this.worldInfo = par1ISaveHandler.loadWorldInfo();
if (par4WorldProvider != null) if (par4WorldProvider != null)
@@ -276,12 +309,20 @@ @@ -273,12 +306,20 @@
this.worldInfo.setServerInitialized(true); this.worldInfo.setServerInitialized(true);
} }
@ -99,7 +99,7 @@
} }
else else
{ {
@@ -291,6 +332,19 @@ @@ -288,6 +329,19 @@
this.calculateInitialSkylight(); this.calculateInitialSkylight();
this.calculateInitialWeather(); this.calculateInitialWeather();
@ -119,7 +119,7 @@
} }
/** /**
@@ -379,7 +433,8 @@ @@ -376,7 +430,8 @@
*/ */
public boolean isAirBlock(int par1, int par2, int par3) public boolean isAirBlock(int par1, int par2, int par3)
{ {
@ -129,7 +129,7 @@
} }
/** /**
@@ -388,7 +443,8 @@ @@ -385,7 +440,8 @@
public boolean blockHasTileEntity(int par1, int par2, int par3) public boolean blockHasTileEntity(int par1, int par2, int par3)
{ {
int var4 = this.getBlockId(par1, par2, par3); int var4 = this.getBlockId(par1, par2, par3);
@ -139,7 +139,7 @@
} }
public int func_85175_e(int par1, int par2, int par3) public int func_85175_e(int par1, int par2, int par3)
@@ -1130,7 +1186,7 @@ @@ -1127,7 +1183,7 @@
*/ */
public boolean isDaytime() public boolean isDaytime()
{ {
@ -148,7 +148,7 @@
} }
/** /**
@@ -1162,7 +1218,7 @@ @@ -1159,7 +1215,7 @@
int var12 = this.getBlockMetadata(var8, var9, var10); int var12 = this.getBlockMetadata(var8, var9, var10);
Block var13 = Block.blocksList[var11]; Block var13 = Block.blocksList[var11];
@ -157,7 +157,7 @@
{ {
MovingObjectPosition var14 = var13.collisionRayTrace(this, var8, var9, var10, par1Vec3, par2Vec3); MovingObjectPosition var14 = var13.collisionRayTrace(this, var8, var9, var10, par1Vec3, par2Vec3);
@@ -1362,6 +1418,12 @@ @@ -1359,6 +1415,12 @@
*/ */
public void playSoundAtEntity(Entity par1Entity, String par2Str, float par3, float par4) public void playSoundAtEntity(Entity par1Entity, String par2Str, float par3, float par4)
{ {
@ -171,8 +171,8 @@
{ {
for (int var5 = 0; var5 < this.worldAccesses.size(); ++var5) for (int var5 = 0; var5 < this.worldAccesses.size(); ++var5)
@@ -1373,6 +1435,12 @@ @@ -1373,6 +1435,12 @@
*/
public void func_85173_a(EntityPlayer par1EntityPlayer, String par2Str, float par3, float par4) public void playSoundToNearExcept(EntityPlayer par1EntityPlayer, String par2Str, float par3, float par4)
{ {
+ PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(par1EntityPlayer, par2Str, par3, par4); + PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(par1EntityPlayer, par2Str, par3, par4);
+ if (MinecraftForge.EVENT_BUS.post(event)) + if (MinecraftForge.EVENT_BUS.post(event))
@ -195,7 +195,7 @@
} }
this.getChunkFromChunkCoords(var2, var3).addEntity(par1Entity); this.getChunkFromChunkCoords(var2, var3).addEntity(par1Entity);
@@ -1702,6 +1775,12 @@ @@ -1706,6 +1779,12 @@
* Calculates the color for the skybox * Calculates the color for the skybox
*/ */
public Vec3 getSkyColor(Entity par1Entity, float par2) public Vec3 getSkyColor(Entity par1Entity, float par2)
@ -208,7 +208,7 @@
{ {
float var3 = this.getCelestialAngle(par2); float var3 = this.getCelestialAngle(par2);
float var4 = MathHelper.cos(var3 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; float var4 = MathHelper.cos(var3 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
@@ -1797,6 +1876,12 @@ @@ -1801,6 +1880,12 @@
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Vec3 drawClouds(float par1) public Vec3 drawClouds(float par1)
{ {
@ -221,7 +221,7 @@
float var2 = this.getCelestialAngle(par1); float var2 = this.getCelestialAngle(par1);
float var3 = MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; float var3 = MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
@@ -1875,7 +1960,7 @@ @@ -1879,7 +1964,7 @@
{ {
int var5 = var3.getBlockID(par1, var4, par2); int var5 = var3.getBlockID(par1, var4, par2);
@ -230,7 +230,7 @@
{ {
return var4 + 1; return var4 + 1;
} }
@@ -1890,6 +1975,12 @@ @@ -1894,6 +1979,12 @@
* How bright are stars in the sky * How bright are stars in the sky
*/ */
public float getStarBrightness(float par1) public float getStarBrightness(float par1)
@ -243,7 +243,7 @@
{ {
float var2 = this.getCelestialAngle(par1); float var2 = this.getCelestialAngle(par1);
float var3 = 1.0F - (MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.25F); float var3 = 1.0F - (MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.25F);
@@ -2091,7 +2182,7 @@ @@ -2095,7 +2186,7 @@
if (var11 != null) if (var11 != null)
{ {
@ -252,7 +252,7 @@
} }
} }
} }
@@ -2100,6 +2191,10 @@ @@ -2104,6 +2195,10 @@
if (!this.entityRemoval.isEmpty()) if (!this.entityRemoval.isEmpty())
{ {
@ -263,7 +263,7 @@
this.loadedTileEntityList.removeAll(this.entityRemoval); this.loadedTileEntityList.removeAll(this.entityRemoval);
this.entityRemoval.clear(); this.entityRemoval.clear();
} }
@@ -2120,18 +2215,18 @@ @@ -2124,18 +2219,18 @@
{ {
this.loadedTileEntityList.add(var12); this.loadedTileEntityList.add(var12);
} }
@ -286,7 +286,7 @@
} }
} }
@@ -2144,13 +2239,13 @@ @@ -2148,13 +2243,13 @@
public void addTileEntity(Collection par1Collection) public void addTileEntity(Collection par1Collection)
{ {
@ -307,7 +307,7 @@
} }
} }
@@ -2170,9 +2265,17 @@ @@ -2174,9 +2269,17 @@
{ {
int var3 = MathHelper.floor_double(par1Entity.posX); int var3 = MathHelper.floor_double(par1Entity.posX);
int var4 = MathHelper.floor_double(par1Entity.posZ); int var4 = MathHelper.floor_double(par1Entity.posZ);
@ -328,7 +328,7 @@
{ {
par1Entity.lastTickPosX = par1Entity.posX; par1Entity.lastTickPosX = par1Entity.posX;
par1Entity.lastTickPosY = par1Entity.posY; par1Entity.lastTickPosY = par1Entity.posY;
@@ -2405,6 +2508,14 @@ @@ -2409,6 +2512,14 @@
{ {
return true; return true;
} }
@ -343,7 +343,7 @@
} }
} }
} }
@@ -2710,25 +2821,21 @@ @@ -2714,25 +2825,21 @@
*/ */
public void setBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity) public void setBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity)
{ {
@ -384,7 +384,7 @@
} }
} }
@@ -2737,27 +2844,10 @@ @@ -2741,27 +2848,10 @@
*/ */
public void removeBlockTileEntity(int par1, int par2, int par3) public void removeBlockTileEntity(int par1, int par2, int par3)
{ {
@ -416,7 +416,7 @@
} }
} }
@@ -2783,7 +2873,8 @@ @@ -2787,7 +2877,8 @@
*/ */
public boolean isBlockNormalCube(int par1, int par2, int par3) public boolean isBlockNormalCube(int par1, int par2, int par3)
{ {
@ -426,7 +426,7 @@
} }
public boolean func_85174_u(int par1, int par2, int par3) public boolean func_85174_u(int par1, int par2, int par3)
@@ -2806,8 +2897,7 @@ @@ -2810,8 +2901,7 @@
*/ */
public boolean doesBlockHaveSolidTopSurface(int par1, int par2, int par3) public boolean doesBlockHaveSolidTopSurface(int par1, int par2, int par3)
{ {
@ -436,7 +436,7 @@
} }
/** /**
@@ -2823,7 +2913,7 @@ @@ -2827,7 +2917,7 @@
if (var5 != null && !var5.isEmpty()) if (var5 != null && !var5.isEmpty())
{ {
Block var6 = Block.blocksList[this.getBlockId(par1, par2, par3)]; Block var6 = Block.blocksList[this.getBlockId(par1, par2, par3)];
@ -445,7 +445,7 @@
} }
else else
{ {
@@ -2854,8 +2944,7 @@ @@ -2858,8 +2948,7 @@
*/ */
public void setAllowedSpawnTypes(boolean par1, boolean par2) public void setAllowedSpawnTypes(boolean par1, boolean par2)
{ {
@ -455,7 +455,7 @@
} }
/** /**
@@ -2871,6 +2960,11 @@ @@ -2875,6 +2964,11 @@
*/ */
private void calculateInitialWeather() private void calculateInitialWeather()
{ {
@ -467,7 +467,7 @@
if (this.worldInfo.isRaining()) if (this.worldInfo.isRaining())
{ {
this.rainingStrength = 1.0F; this.rainingStrength = 1.0F;
@@ -2886,6 +2980,11 @@ @@ -2890,6 +2984,11 @@
* Updates all weather states. * Updates all weather states.
*/ */
protected void updateWeather() protected void updateWeather()
@ -479,7 +479,7 @@
{ {
if (!this.provider.hasNoSky) if (!this.provider.hasNoSky)
{ {
@@ -2983,12 +3082,14 @@ @@ -2987,12 +3086,14 @@
public void toggleRain() public void toggleRain()
{ {
@ -495,7 +495,7 @@
this.theProfiler.startSection("buildList"); this.theProfiler.startSection("buildList");
int var1; int var1;
EntityPlayer var2; EntityPlayer var2;
@@ -3095,6 +3196,11 @@ @@ -3099,6 +3200,11 @@
*/ */
public boolean canBlockFreeze(int par1, int par2, int par3, boolean par4) public boolean canBlockFreeze(int par1, int par2, int par3, boolean par4)
{ {
@ -507,7 +507,7 @@
BiomeGenBase var5 = this.getBiomeGenForCoords(par1, par3); BiomeGenBase var5 = this.getBiomeGenForCoords(par1, par3);
float var6 = var5.getFloatTemperature(); float var6 = var5.getFloatTemperature();
@@ -3152,6 +3258,11 @@ @@ -3156,6 +3262,11 @@
* Tests whether or not snow can be placed at a given location * Tests whether or not snow can be placed at a given location
*/ */
public boolean canSnowAt(int par1, int par2, int par3) public boolean canSnowAt(int par1, int par2, int par3)
@ -519,7 +519,7 @@
{ {
BiomeGenBase var4 = this.getBiomeGenForCoords(par1, par3); BiomeGenBase var4 = this.getBiomeGenForCoords(par1, par3);
float var5 = var4.getFloatTemperature(); float var5 = var4.getFloatTemperature();
@@ -3245,7 +3356,7 @@ @@ -3249,7 +3360,7 @@
private int computeBlockLightValue(int par1, int par2, int par3, int par4, int par5, int par6) private int computeBlockLightValue(int par1, int par2, int par3, int par4, int par5, int par6)
{ {
@ -528,7 +528,7 @@
int var8 = this.getSavedLightValue(EnumSkyBlock.Block, par2 - 1, par3, par4) - par6; int var8 = this.getSavedLightValue(EnumSkyBlock.Block, par2 - 1, par3, par4) - par6;
int var9 = this.getSavedLightValue(EnumSkyBlock.Block, par2 + 1, par3, par4) - par6; int var9 = this.getSavedLightValue(EnumSkyBlock.Block, par2 + 1, par3, par4) - par6;
int var10 = this.getSavedLightValue(EnumSkyBlock.Block, par2, par3 - 1, par4) - par6; int var10 = this.getSavedLightValue(EnumSkyBlock.Block, par2, par3 - 1, par4) - par6;
@@ -3380,7 +3491,7 @@ @@ -3384,7 +3495,7 @@
int var21 = var24 + (var18 / 2 + 1) % 3 / 2 * var19; int var21 = var24 + (var18 / 2 + 1) % 3 / 2 * var19;
int var22 = var12 + (var18 / 2 + 2) % 3 / 2 * var19; int var22 = var12 + (var18 / 2 + 2) % 3 / 2 * var19;
var14 = this.getSavedLightValue(par1EnumSkyBlock, var20, var21, var22); var14 = this.getSavedLightValue(par1EnumSkyBlock, var20, var21, var22);
@ -537,7 +537,7 @@
if (var23 == 0) if (var23 == 0)
{ {
@@ -3411,7 +3522,7 @@ @@ -3415,7 +3526,7 @@
var12 = (var9 >> 12 & 63) - 32 + par4; var12 = (var9 >> 12 & 63) - 32 + par4;
var13 = this.getSavedLightValue(par1EnumSkyBlock, var10, var24, var12); var13 = this.getSavedLightValue(par1EnumSkyBlock, var10, var24, var12);
var14 = this.getBlockId(var10, var24, var12); var14 = this.getBlockId(var10, var24, var12);
@ -546,7 +546,7 @@
if (var15 == 0) if (var15 == 0)
{ {
@@ -3513,10 +3624,10 @@ @@ -3517,10 +3628,10 @@
public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB) public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB)
{ {
this.entitiesWithinAABBExcludingEntity.clear(); this.entitiesWithinAABBExcludingEntity.clear();
@ -561,7 +561,7 @@
for (int var7 = var3; var7 <= var4; ++var7) for (int var7 = var3; var7 <= var4; ++var7)
{ {
@@ -3542,10 +3653,10 @@ @@ -3546,10 +3657,10 @@
public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector)
{ {
@ -576,7 +576,7 @@
ArrayList var8 = new ArrayList(); ArrayList var8 = new ArrayList();
for (int var9 = var4; var9 <= var5; ++var9) for (int var9 = var4; var9 <= var5; ++var9)
@@ -3638,11 +3749,14 @@ @@ -3642,11 +3753,14 @@
*/ */
public void addLoadedEntities(List par1List) public void addLoadedEntities(List par1List)
{ {
@ -594,7 +594,7 @@
} }
} }
@@ -3676,6 +3790,11 @@ @@ -3680,6 +3794,11 @@
else else
{ {
if (var9 != null && (var9 == Block.waterMoving || var9 == Block.waterStill || var9 == Block.lavaMoving || var9 == Block.lavaStill || var9 == Block.fire || var9.blockMaterial.isReplaceable())) if (var9 != null && (var9 == Block.waterMoving || var9 == Block.waterStill || var9 == Block.lavaMoving || var9 == Block.lavaStill || var9 == Block.fire || var9.blockMaterial.isReplaceable()))
@ -606,7 +606,7 @@
{ {
var9 = null; var9 = null;
} }
@@ -3893,7 +4012,7 @@ @@ -3897,7 +4016,7 @@
*/ */
public long getSeed() public long getSeed()
{ {
@ -615,7 +615,7 @@
} }
public long getTotalWorldTime() public long getTotalWorldTime()
@@ -3903,7 +4022,7 @@ @@ -3907,7 +4026,7 @@
public long getWorldTime() public long getWorldTime()
{ {
@ -624,7 +624,7 @@
} }
/** /**
@@ -3911,7 +4030,7 @@ @@ -3915,7 +4034,7 @@
*/ */
public void setWorldTime(long par1) public void setWorldTime(long par1)
{ {
@ -633,7 +633,7 @@
} }
/** /**
@@ -3919,13 +4038,13 @@ @@ -3923,13 +4042,13 @@
*/ */
public ChunkCoordinates getSpawnPoint() public ChunkCoordinates getSpawnPoint()
{ {
@ -649,7 +649,7 @@
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@@ -3949,7 +4068,10 @@ @@ -3953,7 +4072,10 @@
if (!this.loadedEntityList.contains(par1Entity)) if (!this.loadedEntityList.contains(par1Entity))
{ {
@ -661,7 +661,7 @@
} }
} }
@@ -3957,6 +4079,11 @@ @@ -3961,6 +4083,11 @@
* Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here. * Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here.
*/ */
public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4)
@ -673,7 +673,7 @@
{ {
return true; return true;
} }
@@ -4077,8 +4204,7 @@ @@ -4081,8 +4208,7 @@
*/ */
public boolean isBlockHighHumidity(int par1, int par2, int par3) public boolean isBlockHighHumidity(int par1, int par2, int par3)
{ {
@ -683,7 +683,7 @@
} }
/** /**
@@ -4153,7 +4279,7 @@ @@ -4157,7 +4283,7 @@
*/ */
public int getHeight() public int getHeight()
{ {
@ -692,7 +692,7 @@
} }
/** /**
@@ -4161,7 +4287,7 @@ @@ -4165,7 +4291,7 @@
*/ */
public int getActualHeight() public int getActualHeight()
{ {
@ -701,7 +701,7 @@
} }
public IUpdatePlayerListBox func_82735_a(EntityMinecart par1EntityMinecart) public IUpdatePlayerListBox func_82735_a(EntityMinecart par1EntityMinecart)
@@ -4204,7 +4330,7 @@ @@ -4208,7 +4334,7 @@
*/ */
public double getHorizon() public double getHorizon()
{ {
@ -710,7 +710,7 @@
} }
/** /**
@@ -4265,4 +4391,75 @@ @@ -4269,4 +4395,75 @@
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void func_92088_a(double par1, double par3, double par5, double par7, double par9, double par11, NBTTagCompound par13NBTTagCompound) {} public void func_92088_a(double par1, double par3, double par5, double par7, double par9, double par11, NBTTagCompound par13NBTTagCompound) {}

View file

@ -14,17 +14,17 @@
*/ */
public void unloadChunksIfNotNearSpawn(int par1, int par2) public void unloadChunksIfNotNearSpawn(int par1, int par2)
{ {
- if (this.currentServer.provider.canRespawnHere()) - if (this.worldObj.provider.canRespawnHere())
+ if (this.currentServer.provider.canRespawnHere() && DimensionManager.shouldLoadSpawn(currentServer.provider.dimensionId)) + if (this.worldObj.provider.canRespawnHere() && DimensionManager.shouldLoadSpawn(this.worldObj.provider.dimensionId))
{ {
ChunkCoordinates var3 = this.currentServer.getSpawnPoint(); ChunkCoordinates var3 = this.worldObj.getSpawnPoint();
int var4 = par1 * 16 + 8 - var3.posX; int var4 = par1 * 16 + 8 - var3.posX;
@@ -109,7 +112,11 @@ @@ -109,7 +112,11 @@
if (var5 == null) if (var5 == null)
{ {
- var5 = this.safeLoadChunk(par1, par2); - var5 = this.safeLoadChunk(par1, par2);
+ var5 = ForgeChunkManager.fetchDormantChunk(var3, currentServer); + var5 = ForgeChunkManager.fetchDormantChunk(var3, this.worldObj);
+ if (var5 == null) + if (var5 == null)
+ { + {
+ var5 = this.safeLoadChunk(par1, par2); + var5 = this.safeLoadChunk(par1, par2);
@ -34,9 +34,9 @@
{ {
@@ -306,6 +313,11 @@ @@ -306,6 +313,11 @@
{ {
if (!this.currentServer.canNotSave) if (!this.worldObj.canNotSave)
{ {
+ for (ChunkCoordIntPair forced : currentServer.getPersistentChunks().keySet()) + for (ChunkCoordIntPair forced : this.worldObj.getPersistentChunks().keySet())
+ { + {
+ this.chunksToUnload.remove(ChunkCoordIntPair.chunkXZ2Int(forced.chunkXPos, forced.chunkZPos)); + this.chunksToUnload.remove(ChunkCoordIntPair.chunkXZ2Int(forced.chunkXPos, forced.chunkZPos));
+ } + }
@ -49,8 +49,8 @@
this.loadedChunkHashMap.remove(var2.longValue()); this.loadedChunkHashMap.remove(var2.longValue());
this.loadedChunks.remove(var3); this.loadedChunks.remove(var3);
+ ForgeChunkManager.putDormantChunk(ChunkCoordIntPair.chunkXZ2Int(var3.xPosition, var3.zPosition), var3); + ForgeChunkManager.putDormantChunk(ChunkCoordIntPair.chunkXZ2Int(var3.xPosition, var3.zPosition), var3);
+ if(loadedChunks.size() == 0 && ForgeChunkManager.getPersistentChunksFor(currentServer).size() == 0 && !DimensionManager.shouldLoadSpawn(currentServer.provider.dimensionId)) { + if(loadedChunks.size() == 0 && ForgeChunkManager.getPersistentChunksFor(this.worldObj).size() == 0 && !DimensionManager.shouldLoadSpawn(this.worldObj.provider.dimensionId)) {
+ DimensionManager.unloadWorld(currentServer.provider.dimensionId); + DimensionManager.unloadWorld(this.worldObj.provider.dimensionId);
+ return currentChunkProvider.unload100OldestChunks(); + return currentChunkProvider.unload100OldestChunks();
+ } + }
} }

View file

@ -37,7 +37,7 @@
private ItemStack pickCheckLootItem(Random par1Random) private ItemStack pickCheckLootItem(Random par1Random)
{ {
- int var2 = par1Random.nextInt(12); - int var2 = par1Random.nextInt(12);
- return var2 == 0 ? new ItemStack(Item.saddle) : (var2 == 1 ? new ItemStack(Item.ingotIron, par1Random.nextInt(4) + 1) : (var2 == 2 ? new ItemStack(Item.bread) : (var2 == 3 ? new ItemStack(Item.wheat, par1Random.nextInt(4) + 1) : (var2 == 4 ? new ItemStack(Item.gunpowder, par1Random.nextInt(4) + 1) : (var2 == 5 ? new ItemStack(Item.silk, par1Random.nextInt(4) + 1) : (var2 == 6 ? new ItemStack(Item.bucketEmpty) : (var2 == 7 && par1Random.nextInt(100) == 0 ? new ItemStack(Item.appleGold) : (var2 == 8 && par1Random.nextInt(2) == 0 ? new ItemStack(Item.redstone, par1Random.nextInt(4) + 1) : (var2 == 9 && par1Random.nextInt(10) == 0 ? new ItemStack(Item.itemsList[Item.record13.shiftedIndex + par1Random.nextInt(2)]) : (var2 == 10 ? new ItemStack(Item.dyePowder, 1, 3) : (var2 == 11 ? Item.field_92053_bW.func_92055_a(par1Random) : null))))))))))); - return var2 == 0 ? new ItemStack(Item.saddle) : (var2 == 1 ? new ItemStack(Item.ingotIron, par1Random.nextInt(4) + 1) : (var2 == 2 ? new ItemStack(Item.bread) : (var2 == 3 ? new ItemStack(Item.wheat, par1Random.nextInt(4) + 1) : (var2 == 4 ? new ItemStack(Item.gunpowder, par1Random.nextInt(4) + 1) : (var2 == 5 ? new ItemStack(Item.silk, par1Random.nextInt(4) + 1) : (var2 == 6 ? new ItemStack(Item.bucketEmpty) : (var2 == 7 && par1Random.nextInt(100) == 0 ? new ItemStack(Item.appleGold) : (var2 == 8 && par1Random.nextInt(2) == 0 ? new ItemStack(Item.redstone, par1Random.nextInt(4) + 1) : (var2 == 9 && par1Random.nextInt(10) == 0 ? new ItemStack(Item.itemsList[Item.record13.itemID + par1Random.nextInt(2)]) : (var2 == 10 ? new ItemStack(Item.dyePowder, 1, 3) : (var2 == 11 ? Item.field_92053_bW.func_92055_a(par1Random) : null)))))))))));
+ return ChestGenHooks.getOneItem(ChestGenHooks.DUNGEON_CHEST, par1Random); + return ChestGenHooks.getOneItem(ChestGenHooks.DUNGEON_CHEST, par1Random);
} }