mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 19:15:32 +00:00
Update patche for jad-style names.
This commit is contained in:
1 parent
3a9c7b4532
commit
3fc95b71e2
136 files changed
+2292
-2291
No files matched your search
@@ -103,8 +103,8 @@
|
||||
*/
|
||||
public float getPlayerRelativeBlockHardness(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5)
|
||||
{
|
||||
- float var6 = this.getBlockHardness(par2World, par3, par4, par5);
|
||||
- return var6 < 0.0F ? 0.0F : (!par1EntityPlayer.canHarvestBlock(this) ? 1.0F / var6 / 100.0F : par1EntityPlayer.getCurrentPlayerStrVsBlock(this) / var6 / 30.0F);
|
||||
- float f = this.getBlockHardness(par2World, par3, par4, par5);
|
||||
- return f < 0.0F ? 0.0F : (!par1EntityPlayer.canHarvestBlock(this) ? 1.0F / f / 100.0F : par1EntityPlayer.getCurrentPlayerStrVsBlock(this) / f / 30.0F);
|
||||
+ return ForgeHooks.blockStrength(this, par1EntityPlayer, par2World, par3, par4, par5);
|
||||
}
|
||||
|
||||
@@ -113,20 +113,20 @@
|
||||
{
|
||||
if (!par1World.isRemote)
|
||||
{
|
||||
- int var8 = this.quantityDroppedWithBonus(par7, par1World.rand);
|
||||
- int j1 = this.quantityDroppedWithBonus(par7, par1World.rand);
|
||||
-
|
||||
- for (int var9 = 0; var9 < var8; ++var9)
|
||||
- for (int k1 = 0; k1 < j1; ++k1)
|
||||
+ ArrayList<ItemStack> items = getBlockDropped(par1World, par2, par3, par4, par5, par7);
|
||||
+
|
||||
+ for (ItemStack item : items)
|
||||
{
|
||||
if (par1World.rand.nextFloat() <= par6)
|
||||
{
|
||||
- int var10 = this.idDropped(par5, par1World.rand, par7);
|
||||
- int l1 = this.idDropped(par5, par1World.rand, par7);
|
||||
-
|
||||
- if (var10 > 0)
|
||||
- if (l1 > 0)
|
||||
- {
|
||||
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var10, 1, this.damageDropped(par5)));
|
||||
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(l1, 1, this.damageDropped(par5)));
|
||||
- }
|
||||
+ this.dropBlockAsItem_do(par1World, par2, par3, par4, item);
|
||||
}
|
||||
@@ -139,7 +139,7 @@
|
||||
- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer))
|
||||
+ if (this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer))
|
||||
{
|
||||
ItemStack var8 = this.createStackedBlock(par6);
|
||||
ItemStack itemstack = this.createStackedBlock(par6);
|
||||
|
||||
@@ -1364,4 +1380,840 @@
|
||||
canBlockGrass[0] = true;
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
|
||||
/**
|
||||
@@ -83,19 +93,22 @@
|
||||
int var11 = var10 & 8;
|
||||
var10 &= 7;
|
||||
int k1 = j1 & 8;
|
||||
j1 &= 7;
|
||||
|
||||
- if (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1))
|
||||
+
|
||||
@@ -45,22 +45,22 @@
|
||||
+
|
||||
+ if (dir == NORTH && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH))
|
||||
{
|
||||
var10 = 4;
|
||||
j1 = 4;
|
||||
}
|
||||
- else if (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||
+ else if (dir == SOUTH && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH))
|
||||
{
|
||||
var10 = 3;
|
||||
j1 = 3;
|
||||
}
|
||||
- else if (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||
+ else if (dir == WEST && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST))
|
||||
{
|
||||
var10 = 2;
|
||||
j1 = 2;
|
||||
}
|
||||
- else if (par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||
+ else if (dir == EAST && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST))
|
||||
{
|
||||
var10 = 1;
|
||||
j1 = 1;
|
||||
}
|
||||
@@ -112,7 +125,11 @@
|
||||
*/
|
||||
@@ -76,29 +76,29 @@
|
||||
|
||||
/**
|
||||
@@ -126,22 +143,22 @@
|
||||
int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7;
|
||||
boolean var7 = false;
|
||||
int i1 = par1World.getBlockMetadata(par2, par3, par4) & 7;
|
||||
boolean flag = false;
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var6 == 1)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST) && var6 == 1)
|
||||
- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && i1 == 1)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST) && i1 == 1)
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var6 == 2)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST) && var6 == 2)
|
||||
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && i1 == 2)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST) && i1 == 2)
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var6 == 3)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) && var6 == 3)
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && i1 == 3)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) && i1 == 3)
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var6 == 4)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH) && var6 == 4)
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && i1 == 4)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH) && i1 == 4)
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
@@ -16,9 +16,9 @@
|
||||
@@ -149,7 +153,7 @@
|
||||
else
|
||||
{
|
||||
int var5 = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
- return var5 == Block.cactus.blockID || var5 == Block.sand.blockID;
|
||||
+ return blocksList[var5] != null && blocksList[var5].canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this);
|
||||
int l = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
- return l == Block.cactus.blockID || l == Block.sand.blockID;
|
||||
+ return blocksList[l] != null && blocksList[l].canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*/
|
||||
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
|
||||
{
|
||||
- int var8 = func_72219_c(par5);
|
||||
- int j1 = func_72219_c(par5);
|
||||
+ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);
|
||||
+ }
|
||||
+
|
||||
@@ -21,13 +21,13 @@
|
||||
+ public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> dropped = super.getBlockDropped(world, x, y, z, metadata, fortune);
|
||||
+ int var8 = func_72219_c(metadata);
|
||||
byte var9 = 1;
|
||||
+ int j1 = func_72219_c(metadata);
|
||||
byte b0 = 1;
|
||||
|
||||
if (var8 >= 2)
|
||||
if (j1 >= 2)
|
||||
@@ -185,8 +194,9 @@
|
||||
|
||||
for (int var10 = 0; var10 < var9; ++var10)
|
||||
for (int k1 = 0; k1 < b0; ++k1)
|
||||
{
|
||||
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.dyePowder, 1, 3));
|
||||
- }
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
@@ -40,6 +40,12 @@
|
||||
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
||||
*/
|
||||
public abstract TileEntity createNewTileEntity(World var1);
|
||||
public abstract TileEntity createNewTileEntity(World world);
|
||||
+
|
||||
+
|
||||
+ public TileEntity createNewTileEntity(World world, int metadata)
|
||||
|
||||
@@ -16,18 +16,18 @@
|
||||
public class BlockCrops extends BlockFlower
|
||||
{
|
||||
@@ -92,11 +95,11 @@
|
||||
int var19 = par1World.getBlockId(var17, par3 - 1, var18);
|
||||
float var20 = 0.0F;
|
||||
int j3 = par1World.getBlockId(l2, par3 - 1, i3);
|
||||
float f1 = 0.0F;
|
||||
|
||||
- if (var19 == Block.tilledField.blockID)
|
||||
+ if (blocksList[var19] != null && blocksList[var19].canSustainPlant(par1World, var17, par3 - 1, var18, ForgeDirection.UP, this))
|
||||
- if (j3 == Block.tilledField.blockID)
|
||||
+ if (blocksList[j3] != null && blocksList[j3].canSustainPlant(par1World, l2, par3 - 1, i3, ForgeDirection.UP, this))
|
||||
{
|
||||
var20 = 1.0F;
|
||||
f1 = 1.0F;
|
||||
|
||||
- if (par1World.getBlockMetadata(var17, par3 - 1, var18) > 0)
|
||||
+ if (blocksList[var19].isFertile(par1World, var17, par3 - 1, var18))
|
||||
- if (par1World.getBlockMetadata(l2, par3 - 1, i3) > 0)
|
||||
+ if (blocksList[j3].isFertile(par1World, l2, par3 - 1, i3))
|
||||
{
|
||||
var20 = 3.0F;
|
||||
f1 = 3.0F;
|
||||
}
|
||||
@@ -162,22 +165,25 @@
|
||||
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
|
||||
@@ -48,9 +48,9 @@
|
||||
+ {
|
||||
+ for (int n = 0; n < 3 + fortune; n++)
|
||||
{
|
||||
- int var8 = 3 + par7;
|
||||
- int j1 = 3 + par7;
|
||||
-
|
||||
- for (int var9 = 0; var9 < var8; ++var9)
|
||||
- for (int k1 = 0; k1 < j1; ++k1)
|
||||
- {
|
||||
- if (par1World.rand.nextInt(15) <= par5)
|
||||
- {
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
{
|
||||
@@ -107,7 +110,8 @@
|
||||
{
|
||||
int var8 = par1World.getBlockId(var6, par3 + 1, var7);
|
||||
int j1 = par1World.getBlockId(l, par3 + 1, i1);
|
||||
|
||||
- if (var8 == Block.crops.blockID || var8 == Block.melonStem.blockID || var8 == Block.pumpkinStem.blockID || var8 == Block.potato.blockID || var8 == Block.carrot.blockID)
|
||||
+ Block plant = blocksList[var8];
|
||||
- if (j1 == Block.crops.blockID || j1 == Block.melonStem.blockID || j1 == Block.pumpkinStem.blockID || j1 == Block.potato.blockID || j1 == Block.carrot.blockID)
|
||||
+ Block plant = blocksList[j1];
|
||||
+ if (plant instanceof IPlantable && canSustainPlant(par1World, par2, par3, par4, ForgeDirection.UP, (IPlantable)plant))
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -33,14 +33,14 @@
|
||||
{
|
||||
if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick"))
|
||||
{
|
||||
- boolean var6 = par1World.getBlockId(par2, par3 - 1, par4) == Block.netherrack.blockID;
|
||||
- boolean flag = par1World.getBlockId(par2, par3 - 1, par4) == Block.netherrack.blockID;
|
||||
-
|
||||
- if (par1World.provider instanceof WorldProviderEnd && par1World.getBlockId(par2, par3 - 1, par4) == Block.bedrock.blockID)
|
||||
- {
|
||||
- var6 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
+ Block base = Block.blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
|
||||
+ boolean var6 = (base != null && base.isFireSource(par1World, par2, par3 - 1, par4, par1World.getBlockMetadata(par2, par3 - 1, par4), UP));
|
||||
+ boolean flag = (base != null && base.isFireSource(par1World, par2, par3 - 1, par4, par1World.getBlockMetadata(par2, par3 - 1, par4), UP));
|
||||
|
||||
if (!this.canPlaceBlockAt(par1World, par2, par3, par4))
|
||||
{
|
||||
@@ -48,29 +48,29 @@
|
||||
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||
}
|
||||
}
|
||||
- else if (!var6 && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4) && var7 == 15 && par5Random.nextInt(4) == 0)
|
||||
+ else if (!var6 && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4, UP) && var7 == 15 && par5Random.nextInt(4) == 0)
|
||||
- else if (!flag && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4) && l == 15 && par5Random.nextInt(4) == 0)
|
||||
+ else if (!flag && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4, UP) && l == 15 && par5Random.nextInt(4) == 0)
|
||||
{
|
||||
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||
}
|
||||
@@ -165,12 +165,12 @@
|
||||
var9 = -50;
|
||||
b0 = -50;
|
||||
}
|
||||
|
||||
- this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + var9, par5Random, var7);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + var9, par5Random, var7);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + var9, par5Random, var7);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + var9, par5Random, var7);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + var9, par5Random, var7);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + var9, par5Random, var7);
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + var9, par5Random, var7, WEST );
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + var9, par5Random, var7, EAST );
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + var9, par5Random, var7, UP );
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + var9, par5Random, var7, DOWN );
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + var9, par5Random, var7, SOUTH);
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + var9, par5Random, var7, NORTH);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + b0, par5Random, l);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + b0, par5Random, l);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + b0, par5Random, l);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + b0, par5Random, l);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + b0, par5Random, l);
|
||||
- this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + b0, par5Random, l);
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + b0, par5Random, l, WEST );
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + b0, par5Random, l, EAST );
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + b0, par5Random, l, UP );
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + b0, par5Random, l, DOWN );
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + b0, par5Random, l, SOUTH);
|
||||
+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + b0, par5Random, l, NORTH);
|
||||
|
||||
for (int var10 = par2 - 1; var10 <= par2 + 1; ++var10)
|
||||
for (int i1 = par2 - 1; i1 <= par2 + 1; ++i1)
|
||||
{
|
||||
@@ -224,9 +224,20 @@
|
||||
return false;
|
||||
@@ -79,20 +79,20 @@
|
||||
+ @Deprecated
|
||||
private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7)
|
||||
{
|
||||
- int var8 = this.abilityToCatchFire[par1World.getBlockId(par2, par3, par4)];
|
||||
- int j1 = this.abilityToCatchFire[par1World.getBlockId(par2, par3, par4)];
|
||||
+ tryToCatchBlockOnFire(par1World, par2, par3, par4, par5, par6Random, par7, UP);
|
||||
+ }
|
||||
+
|
||||
+ private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7, ForgeDirection face)
|
||||
+ {
|
||||
+ int var8 = 0;
|
||||
+ int j1 = 0;
|
||||
+ Block block = Block.blocksList[par1World.getBlockId(par2, par3, par4)];
|
||||
+ if (block != null)
|
||||
+ {
|
||||
+ var8 = block.getFlammability(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), face);
|
||||
+ j1 = block.getFlammability(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), face);
|
||||
+ }
|
||||
|
||||
if (par6Random.nextInt(par5) < var8)
|
||||
if (par6Random.nextInt(par5) < j1)
|
||||
{
|
||||
@@ -260,7 +271,12 @@
|
||||
*/
|
||||
@@ -112,19 +112,19 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- int var6 = this.getChanceToEncourageFire(par1World, par2 + 1, par3, par4, var5);
|
||||
- var6 = this.getChanceToEncourageFire(par1World, par2 - 1, par3, par4, var6);
|
||||
- var6 = this.getChanceToEncourageFire(par1World, par2, par3 - 1, par4, var6);
|
||||
- var6 = this.getChanceToEncourageFire(par1World, par2, par3 + 1, par4, var6);
|
||||
- var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 - 1, var6);
|
||||
- var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 + 1, var6);
|
||||
+ int var6 = this.getChanceToEncourageFire(par1World, par2 + 1, par3, par4, var5, WEST);
|
||||
+ var6 = this.getChanceToEncourageFire(par1World, par2 - 1, par3, par4, var6, EAST);
|
||||
+ var6 = this.getChanceToEncourageFire(par1World, par2, par3 - 1, par4, var6, UP);
|
||||
+ var6 = this.getChanceToEncourageFire(par1World, par2, par3 + 1, par4, var6, DOWN);
|
||||
+ var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 - 1, var6, SOUTH);
|
||||
+ var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 + 1, var6, NORTH);
|
||||
return var6;
|
||||
- int l = this.getChanceToEncourageFire(par1World, par2 + 1, par3, par4, b0);
|
||||
- l = this.getChanceToEncourageFire(par1World, par2 - 1, par3, par4, l);
|
||||
- l = this.getChanceToEncourageFire(par1World, par2, par3 - 1, par4, l);
|
||||
- l = this.getChanceToEncourageFire(par1World, par2, par3 + 1, par4, l);
|
||||
- l = this.getChanceToEncourageFire(par1World, par2, par3, par4 - 1, l);
|
||||
- l = this.getChanceToEncourageFire(par1World, par2, par3, par4 + 1, l);
|
||||
+ int l = this.getChanceToEncourageFire(par1World, par2 + 1, par3, par4, b0, WEST);
|
||||
+ l = this.getChanceToEncourageFire(par1World, par2 - 1, par3, par4, l, EAST);
|
||||
+ l = this.getChanceToEncourageFire(par1World, par2, par3 - 1, par4, l, UP);
|
||||
+ l = this.getChanceToEncourageFire(par1World, par2, par3 + 1, par4, l, DOWN);
|
||||
+ l = this.getChanceToEncourageFire(par1World, par2, par3, par4 - 1, l, SOUTH);
|
||||
+ l = this.getChanceToEncourageFire(par1World, par2, par3, par4 + 1, l, NORTH);
|
||||
return l;
|
||||
}
|
||||
}
|
||||
@@ -296,21 +312,24 @@
|
||||
@@ -151,15 +151,15 @@
|
||||
+ @Deprecated
|
||||
public int getChanceToEncourageFire(World par1World, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
- int var6 = this.chanceToEncourageFire[par1World.getBlockId(par2, par3, par4)];
|
||||
- return var6 > par5 ? var6 : par5;
|
||||
- int i1 = this.chanceToEncourageFire[par1World.getBlockId(par2, par3, par4)];
|
||||
- return i1 > par5 ? i1 : par5;
|
||||
+ return getChanceToEncourageFire(par1World, par2, par3, par4, par5, UP);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -368,9 +387,9 @@
|
||||
float var8;
|
||||
float var9;
|
||||
float f1;
|
||||
float f2;
|
||||
|
||||
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(par1World, par2, par3 - 1, par4))
|
||||
- {
|
||||
@@ -168,7 +168,7 @@
|
||||
+ {
|
||||
+ if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4, EAST))
|
||||
{
|
||||
for (var6 = 0; var6 < 2; ++var6)
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -381,7 +400,7 @@
|
||||
}
|
||||
@@ -177,7 +177,7 @@
|
||||
- if (Block.fire.canBlockCatchFire(par1World, par2 + 1, par3, par4))
|
||||
+ if (Block.fire.canBlockCatchFire(par1World, par2 + 1, par3, par4, WEST))
|
||||
{
|
||||
for (var6 = 0; var6 < 2; ++var6)
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -392,7 +411,7 @@
|
||||
}
|
||||
@@ -186,7 +186,7 @@
|
||||
- if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 - 1))
|
||||
+ if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 - 1, SOUTH))
|
||||
{
|
||||
for (var6 = 0; var6 < 2; ++var6)
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -403,7 +422,7 @@
|
||||
}
|
||||
@@ -195,7 +195,7 @@
|
||||
- if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 + 1))
|
||||
+ if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 + 1, NORTH))
|
||||
{
|
||||
for (var6 = 0; var6 < 2; ++var6)
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -414,7 +433,7 @@
|
||||
}
|
||||
@@ -204,7 +204,7 @@
|
||||
- if (Block.fire.canBlockCatchFire(par1World, par2, par3 + 1, par4))
|
||||
+ if (Block.fire.canBlockCatchFire(par1World, par2, par3 + 1, par4, DOWN))
|
||||
{
|
||||
for (var6 = 0; var6 < 2; ++var6)
|
||||
for (l = 0; l < 2; ++l)
|
||||
{
|
||||
@@ -436,4 +455,46 @@
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockFluid.java
|
||||
@@ -54,7 +54,7 @@
|
||||
{
|
||||
for (int var9 = -1; var9 <= 1; ++var9)
|
||||
for (int l1 = -1; l1 <= 1; ++l1)
|
||||
{
|
||||
- int var10 = par1IBlockAccess.getBiomeGenForCoords(par2 + var9, par4 + var8).waterColorMultiplier;
|
||||
+ int var10 = par1IBlockAccess.getBiomeGenForCoords(par2 + var9, par4 + var8).getWaterColorMultiplier();
|
||||
var5 += (var10 & 16711680) >> 16;
|
||||
var6 += (var10 & 65280) >> 8;
|
||||
var7 += var10 & 255;
|
||||
- int i2 = par1IBlockAccess.getBiomeGenForCoords(par2 + l1, par4 + k1).waterColorMultiplier;
|
||||
+ int i2 = par1IBlockAccess.getBiomeGenForCoords(par2 + l1, par4 + k1).getWaterColorMultiplier();
|
||||
l += (i2 & 16711680) >> 16;
|
||||
i1 += (i2 & 65280) >> 8;
|
||||
j1 += i2 & 255;
|
||||
@@ -10,11 +10,11 @@
|
||||
par1World.setBlockWithNotify(par2, par3, par4, Block.dirt.blockID);
|
||||
}
|
||||
@@ -113,7 +113,7 @@
|
||||
int var9 = par4 + par5Random.nextInt(3) - 1;
|
||||
int var10 = par1World.getBlockId(var7, var8 + 1, var9);
|
||||
int k1 = par4 + par5Random.nextInt(3) - 1;
|
||||
int l1 = par1World.getBlockId(i1, j1 + 1, k1);
|
||||
|
||||
- if (par1World.getBlockId(var7, var8, var9) == Block.dirt.blockID && par1World.getBlockLightValue(var7, var8 + 1, var9) >= 4 && Block.lightOpacity[var10] <= 2)
|
||||
+ if (par1World.getBlockId(var7, var8, var9) == Block.dirt.blockID && par1World.getBlockLightValue(var7, var8 + 1, var9) >= 4 && par1World.getBlockLightOpacity(var7, var8 + 1, var9) <= 2)
|
||||
- if (par1World.getBlockId(i1, j1, k1) == Block.dirt.blockID && par1World.getBlockLightValue(i1, j1 + 1, k1) >= 4 && Block.lightOpacity[l1] <= 2)
|
||||
+ if (par1World.getBlockId(i1, j1, k1) == Block.dirt.blockID && par1World.getBlockLightValue(i1, j1 + 1, k1) >= 4 && par1World.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
|
||||
{
|
||||
par1World.setBlockWithNotify(var7, var8, var9, Block.grass.blockID);
|
||||
par1World.setBlockWithNotify(i1, j1, k1, Block.grass.blockID);
|
||||
}
|
||||
@@ -24,57 +24,57 @@
|
||||
/**
|
||||
@@ -114,22 +120,22 @@
|
||||
{
|
||||
int var10 = par9;
|
||||
int j1 = par9;
|
||||
|
||||
- if ((par9 == 0 || par5 == 2) && par1World.isBlockNormalCube(par2, par3, par4 + 1))
|
||||
+ if ((var10 == 0 || par5 == 2) && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH))
|
||||
+ if ((j1 == 0 || par5 == 2) && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH))
|
||||
{
|
||||
var10 = 2;
|
||||
j1 = 2;
|
||||
}
|
||||
|
||||
- if ((var10 == 0 || par5 == 3) && par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||
+ if ((var10 == 0 || par5 == 3) && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH))
|
||||
- if ((j1 == 0 || par5 == 3) && par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||
+ if ((j1 == 0 || par5 == 3) && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH))
|
||||
{
|
||||
var10 = 3;
|
||||
j1 = 3;
|
||||
}
|
||||
|
||||
- if ((var10 == 0 || par5 == 4) && par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||
+ if ((var10 == 0 || par5 == 4) && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST))
|
||||
- if ((j1 == 0 || par5 == 4) && par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||
+ if ((j1 == 0 || par5 == 4) && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST))
|
||||
{
|
||||
var10 = 4;
|
||||
j1 = 4;
|
||||
}
|
||||
|
||||
- if ((var10 == 0 || par5 == 5) && par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||
+ if ((var10 == 0 || par5 == 5) && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST))
|
||||
- if ((j1 == 0 || par5 == 5) && par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||
+ if ((j1 == 0 || par5 == 5) && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST))
|
||||
{
|
||||
var10 = 5;
|
||||
j1 = 5;
|
||||
}
|
||||
@@ -146,22 +152,22 @@
|
||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
boolean var7 = false;
|
||||
int i1 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
boolean flag = false;
|
||||
|
||||
- if (var6 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1))
|
||||
+ if (var6 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH))
|
||||
- if (i1 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1))
|
||||
+ if (i1 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH))
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (var6 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||
+ if (var6 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH))
|
||||
- if (i1 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||
+ if (i1 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH))
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (var6 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||
+ if (var6 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST))
|
||||
- if (i1 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||
+ if (i1 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST))
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (var6 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||
+ if (var6 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST))
|
||||
- if (i1 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||
+ if (i1 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST))
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
@@ -182,4 +188,10 @@
|
||||
{
|
||||
|
||||
@@ -22,32 +22,32 @@
|
||||
* The base index in terrain.png corresponding to the fancy version of the leaf texture. This is stored so we can
|
||||
@@ -107,10 +111,9 @@
|
||||
{
|
||||
int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11);
|
||||
int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);
|
||||
|
||||
- if (var12 == Block.leaves.blockID)
|
||||
+ if (Block.blocksList[var12] != null)
|
||||
- if (j2 == Block.leaves.blockID)
|
||||
+ if (Block.blocksList[j2] != null)
|
||||
{
|
||||
- int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11);
|
||||
- par1World.setBlockMetadata(par2 + var9, par3 + var10, par4 + var11, var13 | 8);
|
||||
+ Block.blocksList[var12].beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11);
|
||||
- int k2 = par1World.getBlockMetadata(par2 + k1, par3 + l1, par4 + i2);
|
||||
- par1World.setBlockMetadata(par2 + k1, par3 + l1, par4 + i2, k2 | 8);
|
||||
+ Block.blocksList[j2].beginLeavesDecay(par1World, par2 + k1, par3 + l1, par4 + i2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,11 +159,13 @@
|
||||
{
|
||||
var15 = par1World.getBlockId(par2 + var12, par3 + var13, par4 + var14);
|
||||
k2 = par1World.getBlockId(par2 + l1, par3 + i2, par4 + j2);
|
||||
|
||||
- if (var15 == Block.wood.blockID)
|
||||
+ Block block = Block.blocksList[var15];
|
||||
- if (k2 == Block.wood.blockID)
|
||||
+ Block block = Block.blocksList[k2];
|
||||
+
|
||||
+ if (block != null && block.canSustainLeaves(par1World, par2 + var12, par3 + var13, par4 + var14))
|
||||
+ if (block != null && block.canSustainLeaves(par1World, par2 + l1, par3 + i2, par4 + j2))
|
||||
{
|
||||
this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0;
|
||||
this.adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = 0;
|
||||
}
|
||||
- else if (var15 == Block.leaves.blockID)
|
||||
+ else if (block != null && block.isLeaves(par1World, par2 + var12, par3 + var13, par4 + var14))
|
||||
- else if (k2 == Block.leaves.blockID)
|
||||
+ else if (block != null && block.isLeaves(par1World, par2 + l1, par3 + i2, par4 + j2))
|
||||
{
|
||||
this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2;
|
||||
this.adjacentTreeBlocks[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2;
|
||||
}
|
||||
@@ -303,15 +308,7 @@
|
||||
*/
|
||||
|
||||
@@ -40,120 +40,120 @@
|
||||
|
||||
/**
|
||||
@@ -74,32 +88,32 @@
|
||||
int var10 = par9 & 7;
|
||||
var10 = -1;
|
||||
int k1 = par9 & 7;
|
||||
k1 = -1;
|
||||
|
||||
- if (par5 == 0 && par1World.isBlockNormalCube(par2, par3 + 1, par4))
|
||||
+ if (par5 == 0 && par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN))
|
||||
{
|
||||
var10 = par1World.rand.nextBoolean() ? 0 : 7;
|
||||
k1 = par1World.rand.nextBoolean() ? 0 : 7;
|
||||
}
|
||||
|
||||
- if (par5 == 1 && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4))
|
||||
+ if (par5 == 1 && par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP))
|
||||
{
|
||||
var10 = 5 + par1World.rand.nextInt(2);
|
||||
k1 = 5 + par1World.rand.nextInt(2);
|
||||
}
|
||||
|
||||
- if (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1))
|
||||
+ if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH))
|
||||
{
|
||||
var10 = 4;
|
||||
k1 = 4;
|
||||
}
|
||||
|
||||
- if (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||
+ if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH))
|
||||
{
|
||||
var10 = 3;
|
||||
k1 = 3;
|
||||
}
|
||||
|
||||
- if (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||
+ if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST))
|
||||
{
|
||||
var10 = 2;
|
||||
k1 = 2;
|
||||
}
|
||||
|
||||
- if (par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||
+ if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST))
|
||||
{
|
||||
var10 = 1;
|
||||
k1 = 1;
|
||||
}
|
||||
@@ -142,42 +156,42 @@
|
||||
int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7;
|
||||
boolean var7 = false;
|
||||
int i1 = par1World.getBlockMetadata(par2, par3, par4) & 7;
|
||||
boolean flag = false;
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var6 == 1)
|
||||
- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && i1 == 1)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var6 == 2)
|
||||
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && i1 == 2)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var6 == 3)
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && i1 == 3)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var6 == 4)
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && i1 == 4)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && var6 == 5)
|
||||
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && i1 == 5)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && var6 == 6)
|
||||
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && i1 == 6)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && var6 == 0)
|
||||
- if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && i1 == 0)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && var6 == 7)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST) && var6 == 1)
|
||||
- if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && i1 == 7)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST) && i1 == 1)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST) && var6 == 2)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST) && i1 == 2)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) && var6 == 3)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) && i1 == 3)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH) && var6 == 4)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH) && i1 == 4)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) && var6 == 5)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) && i1 == 5)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) && var6 == 6)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) && i1 == 6)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN) && var6 == 0)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN) && i1 == 0)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN) && var6 == 7)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN) && i1 == 7)
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
@@ -2,18 +2,18 @@
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockLog.java
|
||||
@@ -63,14 +63,9 @@
|
||||
{
|
||||
int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11);
|
||||
int j2 = par1World.getBlockId(par2 + k1, par3 + l1, par4 + i2);
|
||||
|
||||
- if (var12 == Block.leaves.blockID)
|
||||
+ if (Block.blocksList[var12] != null)
|
||||
- if (j2 == Block.leaves.blockID)
|
||||
+ if (Block.blocksList[j2] != null)
|
||||
{
|
||||
- int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11);
|
||||
- int k2 = par1World.getBlockMetadata(par2 + k1, par3 + l1, par4 + i2);
|
||||
-
|
||||
- if ((var13 & 8) == 0)
|
||||
- if ((k2 & 8) == 0)
|
||||
- {
|
||||
- par1World.setBlockMetadata(par2 + var9, par3 + var10, par4 + var11, var13 | 8);
|
||||
- par1World.setBlockMetadata(par2 + k1, par3 + l1, par4 + i2, k2 | 8);
|
||||
- }
|
||||
+ Block.blocksList[var12].beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11);
|
||||
+ Block.blocksList[j2].beginLeavesDecay(par1World, par2 + k1, par3 + l1, par4 + i2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
@@ -96,7 +98,9 @@
|
||||
if (par3 >= 0 && par3 < 256)
|
||||
{
|
||||
int var5 = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
- return var5 == Block.mycelium.blockID || par1World.getFullBlockLightValue(par2, par3, par4) < 13 && this.canThisPlantGrowOnThisBlockID(var5);
|
||||
+ Block soil = Block.blocksList[var5];
|
||||
+ return (var5 == Block.mycelium.blockID || par1World.getFullBlockLightValue(par2, par3, par4) < 13) &&
|
||||
int l = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
- return l == Block.mycelium.blockID || par1World.getFullBlockLightValue(par2, par3, par4) < 13 && this.canThisPlantGrowOnThisBlockID(l);
|
||||
+ Block soil = Block.blocksList[l];
|
||||
+ return (l == Block.mycelium.blockID || par1World.getFullBlockLightValue(par2, par3, par4) < 13) &&
|
||||
+ (soil != null && soil.canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this));
|
||||
}
|
||||
else
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
par1World.setBlockWithNotify(par2, par3, par4, Block.dirt.blockID);
|
||||
}
|
||||
@@ -68,7 +68,7 @@
|
||||
int var9 = par4 + par5Random.nextInt(3) - 1;
|
||||
int var10 = par1World.getBlockId(var7, var8 + 1, var9);
|
||||
int k1 = par4 + par5Random.nextInt(3) - 1;
|
||||
int l1 = par1World.getBlockId(i1, j1 + 1, k1);
|
||||
|
||||
- if (par1World.getBlockId(var7, var8, var9) == Block.dirt.blockID && par1World.getBlockLightValue(var7, var8 + 1, var9) >= 4 && Block.lightOpacity[var10] <= 2)
|
||||
+ if (par1World.getBlockId(var7, var8, var9) == Block.dirt.blockID && par1World.getBlockLightValue(var7, var8 + 1, var9) >= 4 && par1World.getBlockLightOpacity(var7, var8 + 1, var9) <= 2)
|
||||
- if (par1World.getBlockId(i1, j1, k1) == Block.dirt.blockID && par1World.getBlockLightValue(i1, j1 + 1, k1) >= 4 && Block.lightOpacity[l1] <= 2)
|
||||
+ if (par1World.getBlockId(i1, j1, k1) == Block.dirt.blockID && par1World.getBlockLightValue(i1, j1 + 1, k1) >= 4 && par1World.getBlockLightOpacity(i1, j1 + 1, k1) <= 2)
|
||||
{
|
||||
par1World.setBlockWithNotify(var7, var8, var9, this.blockID);
|
||||
par1World.setBlockWithNotify(i1, j1, k1, this.blockID);
|
||||
}
|
||||
@@ -31,19 +31,19 @@
|
||||
{
|
||||
- if (!par1World.isRemote)
|
||||
- {
|
||||
- int var8 = 1;
|
||||
- int j1 = 1;
|
||||
-
|
||||
- if (par5 >= 3)
|
||||
- {
|
||||
- var8 = 2 + par1World.rand.nextInt(3);
|
||||
- j1 = 2 + par1World.rand.nextInt(3);
|
||||
-
|
||||
- if (par7 > 0)
|
||||
- {
|
||||
- var8 += par1World.rand.nextInt(par7 + 1);
|
||||
- j1 += par1World.rand.nextInt(par7 + 1);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- for (int var9 = 0; var9 < var8; ++var9)
|
||||
- for (int k1 = 0; k1 < j1; ++k1)
|
||||
- {
|
||||
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.netherStalkSeeds));
|
||||
- }
|
||||
|
||||
@@ -11,19 +11,19 @@
|
||||
|
||||
@@ -398,7 +398,7 @@
|
||||
{
|
||||
if (var8 < 13)
|
||||
if (l1 < 13)
|
||||
{
|
||||
- if (var6 <= 0 || var6 >= 255)
|
||||
+ if (var6 <= 0 || var6 >= par0World.getHeight() - 1)
|
||||
- if (j1 <= 0 || j1 >= 255)
|
||||
+ if (j1 <= 0 || j1 >= par0World.getHeight() - 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -448,7 +448,7 @@
|
||||
|
||||
if (var9 < 13)
|
||||
if (l1 < 13)
|
||||
{
|
||||
- if (var7 <= 0 || var7 >= 255)
|
||||
+ if (var7 <= 0 || var7 >= par1World.getHeight() - 1)
|
||||
- if (j1 <= 0 || j1 >= 255)
|
||||
+ if (j1 <= 0 || j1 >= par1World.getHeight() - 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -20,9 +20,9 @@
|
||||
@@ -21,7 +25,7 @@
|
||||
public static final boolean isRailBlockAt(World par0World, int par1, int par2, int par3)
|
||||
{
|
||||
int var4 = par0World.getBlockId(par1, par2, par3);
|
||||
- return var4 == Block.rail.blockID || var4 == Block.railPowered.blockID || var4 == Block.railDetector.blockID;
|
||||
+ return isRailBlock(var4);
|
||||
int l = par0World.getBlockId(par1, par2, par3);
|
||||
- return l == Block.rail.blockID || l == Block.railPowered.blockID || l == Block.railDetector.blockID;
|
||||
+ return isRailBlock(l);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,36 +55,36 @@
|
||||
/**
|
||||
@@ -179,27 +183,27 @@
|
||||
|
||||
boolean var8 = false;
|
||||
boolean flag = false;
|
||||
|
||||
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4))
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP))
|
||||
{
|
||||
var8 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (var7 == 2 && !par1World.doesBlockHaveSolidTopSurface(par2 + 1, par3, par4))
|
||||
+ if (var7 == 2 && !par1World.isBlockSolidOnSide(par2 + 1, par3, par4, UP))
|
||||
- if (j1 == 2 && !par1World.doesBlockHaveSolidTopSurface(par2 + 1, par3, par4))
|
||||
+ if (j1 == 2 && !par1World.isBlockSolidOnSide(par2 + 1, par3, par4, UP))
|
||||
{
|
||||
var8 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (var7 == 3 && !par1World.doesBlockHaveSolidTopSurface(par2 - 1, par3, par4))
|
||||
+ if (var7 == 3 && !par1World.isBlockSolidOnSide(par2 - 1, par3, par4, UP))
|
||||
- if (j1 == 3 && !par1World.doesBlockHaveSolidTopSurface(par2 - 1, par3, par4))
|
||||
+ if (j1 == 3 && !par1World.isBlockSolidOnSide(par2 - 1, par3, par4, UP))
|
||||
{
|
||||
var8 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (var7 == 4 && !par1World.doesBlockHaveSolidTopSurface(par2, par3, par4 - 1))
|
||||
+ if (var7 == 4 && !par1World.isBlockSolidOnSide(par2, par3, par4 - 1, UP))
|
||||
- if (j1 == 4 && !par1World.doesBlockHaveSolidTopSurface(par2, par3, par4 - 1))
|
||||
+ if (j1 == 4 && !par1World.isBlockSolidOnSide(par2, par3, par4 - 1, UP))
|
||||
{
|
||||
var8 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (var7 == 5 && !par1World.doesBlockHaveSolidTopSurface(par2, par3, par4 + 1))
|
||||
+ if (var7 == 5 && !par1World.isBlockSolidOnSide(par2, par3, par4 + 1, UP))
|
||||
- if (j1 == 5 && !par1World.doesBlockHaveSolidTopSurface(par2, par3, par4 + 1))
|
||||
+ if (j1 == 5 && !par1World.isBlockSolidOnSide(par2, par3, par4 + 1, UP))
|
||||
{
|
||||
var8 = true;
|
||||
flag = true;
|
||||
}
|
||||
@@ -400,9 +404,135 @@
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
+++ ../src_work/minecraft/net/minecraft/block/BlockRedstoneWire.java
|
||||
@@ -565,7 +565,7 @@
|
||||
}
|
||||
else if (var5 != Block.redstoneRepeaterIdle.blockID && var5 != Block.redstoneRepeaterActive.blockID)
|
||||
else if (i1 != Block.redstoneRepeaterIdle.blockID && i1 != Block.redstoneRepeaterActive.blockID)
|
||||
{
|
||||
- return Block.blocksList[var5].canProvidePower() && par4 != -1;
|
||||
+ return (Block.blocksList[var5] != null && Block.blocksList[var5].canConnectRedstone(par0IBlockAccess, par1, par2, par3, par4));
|
||||
- return Block.blocksList[i1].canProvidePower() && par4 != -1;
|
||||
+ return (Block.blocksList[i1] != null && Block.blocksList[i1].canConnectRedstone(par0IBlockAccess, par1, par2, par3, par4));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -17,8 +17,8 @@
|
||||
*/
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
- int var5 = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
- return var5 == this.blockID ? true : (var5 != Block.grass.blockID && var5 != Block.dirt.blockID && var5 != Block.sand.blockID ? false : (par1World.getBlockMaterial(par2 - 1, par3 - 1, par4) == Material.water ? true : (par1World.getBlockMaterial(par2 + 1, par3 - 1, par4) == Material.water ? true : (par1World.getBlockMaterial(par2, par3 - 1, par4 - 1) == Material.water ? true : par1World.getBlockMaterial(par2, par3 - 1, par4 + 1) == Material.water))));
|
||||
- int l = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
- return l == this.blockID ? true : (l != Block.grass.blockID && l != Block.dirt.blockID && l != Block.sand.blockID ? false : (par1World.getBlockMaterial(par2 - 1, par3 - 1, par4) == Material.water ? true : (par1World.getBlockMaterial(par2 + 1, par3 - 1, par4) == Material.water ? true : (par1World.getBlockMaterial(par2, par3 - 1, par4 - 1) == Material.water ? true : par1World.getBlockMaterial(par2, par3 - 1, par4 + 1) == Material.water))));
|
||||
+ Block block = Block.blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
|
||||
+ return (block != null && block.canSustainPlant(par1World, par2, par3 - 1, par4, ForgeDirection.UP, this));
|
||||
}
|
||||
|
||||
@@ -15,6 +15,6 @@
|
||||
{
|
||||
+ if (!TerrainGen.saplingGrowTree(par1World, par5Random, par2, par3, par4)) return;
|
||||
+
|
||||
int var6 = par1World.getBlockMetadata(par2, par3, par4) & 3;
|
||||
Object var7 = null;
|
||||
int var8 = 0;
|
||||
int l = par1World.getBlockMetadata(par2, par3, par4) & 3;
|
||||
Object object = null;
|
||||
int i1 = 0;
|
||||
@@ -38,16 +38,16 @@
|
||||
- {
|
||||
- if ((par6 & 8) == 0)
|
||||
- {
|
||||
- ItemStack var7 = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(par1World, par2, par3, par4));
|
||||
- TileEntitySkull var8 = (TileEntitySkull)par1World.getBlockTileEntity(par2, par3, par4);
|
||||
- ItemStack itemstack = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(par1World, par2, par3, par4));
|
||||
- TileEntitySkull tileentityskull = (TileEntitySkull)par1World.getBlockTileEntity(par2, par3, par4);
|
||||
-
|
||||
- if (var8.getSkullType() == 3 && var8.getExtraType() != null && var8.getExtraType().length() > 0)
|
||||
- if (tileentityskull.getSkullType() == 3 && tileentityskull.getExtraType() != null && tileentityskull.getExtraType().length() > 0)
|
||||
- {
|
||||
- var7.setTagCompound(new NBTTagCompound());
|
||||
- var7.getTagCompound().setString("SkullOwner", var8.getExtraType());
|
||||
- itemstack.setTagCompound(new NBTTagCompound());
|
||||
- itemstack.getTagCompound().setString("SkullOwner", tileentityskull.getExtraType());
|
||||
- }
|
||||
-
|
||||
- this.dropBlockAsItem_do(par1World, par2, par3, par4, var7);
|
||||
- this.dropBlockAsItem_do(par1World, par2, par3, par4, itemstack);
|
||||
- }
|
||||
-
|
||||
- super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
||||
@@ -61,19 +61,19 @@
|
||||
+ ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
+ if ((metadata & 8) == 0)
|
||||
+ {
|
||||
+ ItemStack var7 = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(world, x, y, z));
|
||||
+ TileEntitySkull var8 = (TileEntitySkull)world.getBlockTileEntity(x, y, z);
|
||||
+ ItemStack itemstack = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(world, x, y, z));
|
||||
+ TileEntitySkull tileentityskull = (TileEntitySkull)world.getBlockTileEntity(x, y, z);
|
||||
+
|
||||
+ if (var8 == null)
|
||||
+ if (tileentityskull == null)
|
||||
+ {
|
||||
+ return drops;
|
||||
+ }
|
||||
+ if (var8.getSkullType() == 3 && var8.getExtraType() != null && var8.getExtraType().length() > 0)
|
||||
+ if (tileentityskull.getSkullType() == 3 && tileentityskull.getExtraType() != null && tileentityskull.getExtraType().length() > 0)
|
||||
+ {
|
||||
+ var7.setTagCompound(new NBTTagCompound());
|
||||
+ var7.getTagCompound().setString("SkullOwner", var8.getExtraType());
|
||||
+ itemstack.setTagCompound(new NBTTagCompound());
|
||||
+ itemstack.getTagCompound().setString("SkullOwner", tileentityskull.getExtraType());
|
||||
+ }
|
||||
+ drops.add(var7);
|
||||
+ drops.add(itemstack);
|
||||
+ }
|
||||
+ return drops;
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
@@ -67,7 +67,8 @@
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
int var5 = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
- return var5 != 0 && (var5 == Block.leaves.blockID || Block.blocksList[var5].isOpaqueCube()) ? par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement() : false;
|
||||
+ Block block = Block.blocksList[var5];
|
||||
+ return block != null && (block.isLeaves(par1World, par2, par3 - 1, par4) || Block.blocksList[var5].isOpaqueCube()) ? par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement() : false;
|
||||
int l = par1World.getBlockId(par2, par3 - 1, par4);
|
||||
- return l != 0 && (l == Block.leaves.blockID || Block.blocksList[l].isOpaqueCube()) ? par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement() : false;
|
||||
+ Block block = Block.blocksList[l];
|
||||
+ return block != null && (block.isLeaves(par1World, par2, par3 - 1, par4) || Block.blocksList[l].isOpaqueCube()) ? par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement() : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -22,8 +22,8 @@
|
||||
*/
|
||||
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
- int var7 = Item.snowball.itemID;
|
||||
- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(var7, 1, 0));
|
||||
- int i1 = Item.snowball.itemID;
|
||||
- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(i1, 1, 0));
|
||||
+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||
par1World.setBlockWithNotify(par3, par4, par5, 0);
|
||||
- par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
|
||||
|
||||
@@ -20,27 +20,27 @@
|
||||
/** Defines if it is a Melon or a Pumpkin that the stem is producing. */
|
||||
@@ -101,7 +105,8 @@
|
||||
|
||||
int var11 = par1World.getBlockId(var9, par3 - 1, var10);
|
||||
int l1 = par1World.getBlockId(j1, par3 - 1, k1);
|
||||
|
||||
- if (par1World.getBlockId(var9, par3, var10) == 0 && (var11 == Block.tilledField.blockID || var11 == Block.dirt.blockID || var11 == Block.grass.blockID))
|
||||
+ boolean isSoil = (blocksList[var11] != null && blocksList[var11].canSustainPlant(par1World, var9, par3 - 1, var10, ForgeDirection.UP, this));
|
||||
+ if (par1World.getBlockId(var9, par3, var10) == 0 && (isSoil || var11 == Block.dirt.blockID || var11 == Block.grass.blockID))
|
||||
- if (par1World.getBlockId(j1, par3, k1) == 0 && (l1 == Block.tilledField.blockID || l1 == Block.dirt.blockID || l1 == Block.grass.blockID))
|
||||
+ boolean isSoil = (blocksList[l1] != null && blocksList[l1].canSustainPlant(par1World, j1, par3 - 1, k1, ForgeDirection.UP, this));
|
||||
+ if (par1World.getBlockId(j1, par3, k1) == 0 && (isSoil || l1 == Block.dirt.blockID || l1 == Block.grass.blockID))
|
||||
{
|
||||
par1World.setBlockWithNotify(var9, par3, var10, this.fruitType.blockID);
|
||||
par1World.setBlockWithNotify(j1, par3, k1, this.fruitType.blockID);
|
||||
}
|
||||
@@ -137,11 +142,11 @@
|
||||
int var19 = par1World.getBlockId(var17, par3 - 1, var18);
|
||||
float var20 = 0.0F;
|
||||
int j3 = par1World.getBlockId(l2, par3 - 1, i3);
|
||||
float f1 = 0.0F;
|
||||
|
||||
- if (var19 == Block.tilledField.blockID)
|
||||
+ if (blocksList[var19] != null && blocksList[var19].canSustainPlant(par1World, var17, par3 - 1, var18, ForgeDirection.UP, this))
|
||||
- if (j3 == Block.tilledField.blockID)
|
||||
+ if (blocksList[j3] != null && blocksList[j3].canSustainPlant(par1World, l2, par3 - 1, i3, ForgeDirection.UP, this))
|
||||
{
|
||||
var20 = 1.0F;
|
||||
f1 = 1.0F;
|
||||
|
||||
- if (par1World.getBlockMetadata(var17, par3 - 1, var18) > 0)
|
||||
+ if (blocksList[var19].isFertile(par1World, var17, par3 - 1, var18))
|
||||
- if (par1World.getBlockMetadata(l2, par3 - 1, i3) > 0)
|
||||
+ if (blocksList[j3].isFertile(par1World, l2, par3 - 1, i3))
|
||||
{
|
||||
var20 = 3.0F;
|
||||
f1 = 3.0F;
|
||||
}
|
||||
@@ -241,29 +246,22 @@
|
||||
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
|
||||
@@ -49,7 +49,7 @@
|
||||
-
|
||||
- if (!par1World.isRemote)
|
||||
- {
|
||||
- Item var8 = null;
|
||||
- Item item = null;
|
||||
-
|
||||
- if (this.fruitType == Block.pumpkin)
|
||||
+ }
|
||||
@@ -63,20 +63,20 @@
|
||||
+ {
|
||||
+ if (world.rand.nextInt(15) <= metadata)
|
||||
{
|
||||
- var8 = Item.pumpkinSeeds;
|
||||
- item = Item.pumpkinSeeds;
|
||||
+ ret.add(new ItemStack(fruitType == pumpkin ? Item.pumpkinSeeds : Item.melonSeeds));
|
||||
}
|
||||
-
|
||||
- if (this.fruitType == Block.melon)
|
||||
- {
|
||||
- var8 = Item.melonSeeds;
|
||||
- item = Item.melonSeeds;
|
||||
- }
|
||||
-
|
||||
- for (int var9 = 0; var9 < 3; ++var9)
|
||||
- for (int j1 = 0; j1 < 3; ++j1)
|
||||
- {
|
||||
- if (par1World.rand.nextInt(15) <= par5)
|
||||
- {
|
||||
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var8));
|
||||
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(item));
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -115,4 +112,35 @@
|
||||
par3List.add(new ItemStack(par1, 1, var4));
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
}
|
||||
}
|
||||
+
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
@@ -65,7 +68,7 @@
|
||||
else
|
||||
{
|
||||
int var5 = par1World.getBlockId(par2, par3, par4);
|
||||
- return var5 == Block.fence.blockID || var5 == Block.netherFence.blockID || var5 == Block.glass.blockID || var5 == Block.cobblestoneWall.blockID;
|
||||
+ return (Block.blocksList[var5] != null && Block.blocksList[var5].canPlaceTorchOnTop(par1World, par2, par3, par4));
|
||||
int l = par1World.getBlockId(par2, par3, par4);
|
||||
- return l == Block.fence.blockID || l == Block.netherFence.blockID || l == Block.glass.blockID || l == Block.cobblestoneWall.blockID;
|
||||
+ return (Block.blocksList[l] != null && Block.blocksList[l].canPlaceTorchOnTop(par1World, par2, par3, par4));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,31 +33,31 @@
|
||||
|
||||
/**
|
||||
@@ -89,22 +96,22 @@
|
||||
var10 = 5;
|
||||
j1 = 5;
|
||||
}
|
||||
|
||||
- if (par5 == 2 && par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true))
|
||||
+ if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true))
|
||||
{
|
||||
var10 = 4;
|
||||
j1 = 4;
|
||||
}
|
||||
|
||||
- if (par5 == 3 && par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true))
|
||||
+ if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true))
|
||||
{
|
||||
var10 = 3;
|
||||
j1 = 3;
|
||||
}
|
||||
|
||||
- if (par5 == 4 && par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true))
|
||||
+ if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true))
|
||||
{
|
||||
var10 = 2;
|
||||
j1 = 2;
|
||||
}
|
||||
|
||||
- if (par5 == 5 && par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true))
|
||||
+ if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true))
|
||||
{
|
||||
var10 = 1;
|
||||
j1 = 1;
|
||||
}
|
||||
@@ -132,19 +139,19 @@
|
||||
{
|
||||
@@ -84,41 +84,41 @@
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 4);
|
||||
}
|
||||
@@ -168,22 +175,22 @@
|
||||
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
boolean var7 = false;
|
||||
int i1 = par1World.getBlockMetadata(par2, par3, par4);
|
||||
boolean flag = false;
|
||||
|
||||
- if (!par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) && var6 == 1)
|
||||
- if (!par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) && i1 == 1)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) && var6 == 2)
|
||||
- if (!par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) && i1 == 2)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) && var6 == 3)
|
||||
- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) && i1 == 3)
|
||||
- {
|
||||
- var7 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) && var6 == 4)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true) && var6 == 1)
|
||||
- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) && i1 == 4)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true) && i1 == 1)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true) && var6 == 2)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true) && i1 == 2)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true) && var6 == 3)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true) && i1 == 3)
|
||||
+ {
|
||||
+ var7 = true;
|
||||
+ flag = true;
|
||||
+ }
|
||||
+
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true) && var6 == 4)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true) && i1 == 4)
|
||||
{
|
||||
var7 = true;
|
||||
flag = true;
|
||||
}
|
||||
@@ -15,14 +15,14 @@
|
||||
{
|
||||
super(par1, par2Material);
|
||||
@@ -201,7 +206,7 @@
|
||||
--var7;
|
||||
--j1;
|
||||
}
|
||||
|
||||
- if (!isValidSupportBlock(par1World.getBlockId(var7, par3, var8)))
|
||||
+ if (!(isValidSupportBlock(par1World.getBlockId(var7, par3, var8)) || par1World.isBlockSolidOnSide(var7, par3, var8, ForgeDirection.getOrientation((var6 & 3) + 2))))
|
||||
- if (!isValidSupportBlock(par1World.getBlockId(j1, par3, k1)))
|
||||
+ if (!(isValidSupportBlock(par1World.getBlockId(j1, par3, k1)) || par1World.isBlockSolidOnSide(j1, par3, k1, ForgeDirection.getOrientation((i1 & 3) + 2))))
|
||||
{
|
||||
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0);
|
||||
this.dropBlockAsItem(par1World, par2, par3, par4, i1, 0);
|
||||
@@ -266,6 +271,10 @@
|
||||
*/
|
||||
public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5)
|
||||
|
||||
@@ -37,64 +37,64 @@
|
||||
/**
|
||||
@@ -82,22 +92,22 @@
|
||||
{
|
||||
byte var10 = 0;
|
||||
byte b0 = 0;
|
||||
|
||||
- if (par5 == 2 && par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true))
|
||||
+ if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, WEST, true))
|
||||
{
|
||||
var10 = 2;
|
||||
b0 = 2;
|
||||
}
|
||||
|
||||
- if (par5 == 3 && par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true))
|
||||
+ if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, EAST, true))
|
||||
{
|
||||
var10 = 0;
|
||||
b0 = 0;
|
||||
}
|
||||
|
||||
- if (par5 == 4 && par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true))
|
||||
+ if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, NORTH, true))
|
||||
{
|
||||
var10 = 1;
|
||||
b0 = 1;
|
||||
}
|
||||
|
||||
- if (par5 == 5 && par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true))
|
||||
+ if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, SOUTH, true))
|
||||
{
|
||||
var10 = 3;
|
||||
b0 = 3;
|
||||
}
|
||||
@@ -127,22 +137,22 @@
|
||||
int var7 = var6 & 3;
|
||||
boolean var8 = false;
|
||||
int j1 = i1 & 3;
|
||||
boolean flag = false;
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var7 == 3)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, SOUTH) && var7 == 3)
|
||||
- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && j1 == 3)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, SOUTH) && j1 == 3)
|
||||
{
|
||||
var8 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var7 == 1)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, NORTH) && var7 == 1)
|
||||
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && j1 == 1)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, NORTH) && j1 == 1)
|
||||
{
|
||||
var8 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var7 == 0)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, EAST) && var7 == 0)
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && j1 == 0)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, EAST) && j1 == 0)
|
||||
{
|
||||
var8 = true;
|
||||
flag = true;
|
||||
}
|
||||
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var7 == 2)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, WEST) && var7 == 2)
|
||||
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && j1 == 2)
|
||||
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, WEST) && j1 == 2)
|
||||
{
|
||||
var8 = true;
|
||||
flag = true;
|
||||
}
|
||||
@@ -163,7 +173,7 @@
|
||||
boolean var12 = (par6 & 8) == 8;
|
||||
boolean var13 = par5 == Block.tripWireSource.blockID;
|
||||
boolean var14 = false;
|
||||
- boolean var15 = !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
|
||||
+ boolean var15 = !par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP);
|
||||
int var16 = Direction.offsetX[var10];
|
||||
int var17 = Direction.offsetZ[var10];
|
||||
int var18 = 0;
|
||||
boolean flag2 = (par6 & 8) == 8;
|
||||
boolean flag3 = par5 == Block.tripWireSource.blockID;
|
||||
boolean flag4 = false;
|
||||
- boolean flag5 = !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
|
||||
+ boolean flag5 = !par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP);
|
||||
int i2 = Direction.offsetX[l1];
|
||||
int j2 = Direction.offsetZ[l1];
|
||||
int k2 = 0;
|
||||
@@ -33,7 +33,6 @@
|
||||
- {
|
||||
- super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||
- }
|
||||
- }
|
||||
+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||
+ }
|
||||
+
|
||||
@@ -55,5 +54,5 @@
|
||||
+ public boolean isLadder(World world, int x, int y, int z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
@@ -11,13 +11,13 @@
|
||||
@@ -30,18 +31,11 @@
|
||||
this.trackY = par4;
|
||||
this.trackZ = par5;
|
||||
int var6 = par2World.getBlockId(par3, par4, par5);
|
||||
- int var7 = par2World.getBlockMetadata(par3, par4, par5);
|
||||
int l = par2World.getBlockId(par3, par4, par5);
|
||||
- int i1 = par2World.getBlockMetadata(par3, par4, par5);
|
||||
-
|
||||
- if (BlockRail.isPoweredBlockRail((BlockRail)Block.blocksList[var6]))
|
||||
- if (BlockRail.isPoweredBlockRail((BlockRail)Block.blocksList[l]))
|
||||
- {
|
||||
- this.isPoweredRail = true;
|
||||
- var7 &= -9;
|
||||
- i1 &= -9;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
@@ -25,19 +25,19 @@
|
||||
- }
|
||||
-
|
||||
+
|
||||
+ BlockRail target = (BlockRail)Block.blocksList[var6];
|
||||
+ int var7 = target.getBasicRailMetadata(par2World, null, par3, par4, par5);
|
||||
+ BlockRail target = (BlockRail)Block.blocksList[l];
|
||||
+ int i1 = target.getBasicRailMetadata(par2World, null, par3, par4, par5);
|
||||
+ isPoweredRail = !target.isFlexibleRail(par2World, par3, par4, par5);
|
||||
+ canMakeSlopes = target.canMakeSlopes(par2World, par3, par4, par5);
|
||||
this.setConnections(var7);
|
||||
this.setConnections(i1);
|
||||
}
|
||||
|
||||
@@ -260,7 +254,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (var6 == 0)
|
||||
+ if (var6 == 0 && canMakeSlopes)
|
||||
- if (b0 == 0)
|
||||
+ if (b0 == 0 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRail.isRailBlockAt(this.worldObj, this.trackX, this.trackY + 1, this.trackZ - 1))
|
||||
{
|
||||
@@ -45,8 +45,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (var6 == 1)
|
||||
+ if (var6 == 1 && canMakeSlopes)
|
||||
- if (b0 == 1)
|
||||
+ if (b0 == 1 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRail.isRailBlockAt(this.worldObj, this.trackX + 1, this.trackY + 1, this.trackZ))
|
||||
{
|
||||
@@ -54,8 +54,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (var7 == 0)
|
||||
+ if (var7 == 0 && canMakeSlopes)
|
||||
- if (b0 == 0)
|
||||
+ if (b0 == 0 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRail.isRailBlockAt(this.worldObj, this.trackX, this.trackY + 1, this.trackZ - 1))
|
||||
{
|
||||
@@ -63,8 +63,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (var7 == 1)
|
||||
+ if (var7 == 1 && canMakeSlopes)
|
||||
- if (b0 == 1)
|
||||
+ if (b0 == 1 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRail.isRailBlockAt(this.worldObj, this.trackX + 1, this.trackY + 1, this.trackZ))
|
||||
{
|
||||
@@ -13,30 +13,30 @@
|
||||
{
|
||||
@@ -1253,7 +1257,7 @@
|
||||
|
||||
if (this.thePlayer.canCurrentToolHarvestBlock(var3, var4, var5))
|
||||
if (this.thePlayer.canCurrentToolHarvestBlock(j, k, l))
|
||||
{
|
||||
- this.effectRenderer.addBlockHitEffects(var3, var4, var5, this.objectMouseOver.sideHit);
|
||||
+ this.effectRenderer.addBlockHitEffects(var3, var4, var5, this.objectMouseOver);
|
||||
- this.effectRenderer.addBlockHitEffects(j, k, l, this.objectMouseOver.sideHit);
|
||||
+ this.effectRenderer.addBlockHitEffects(j, k, l, this.objectMouseOver);
|
||||
this.thePlayer.swingItem();
|
||||
}
|
||||
}
|
||||
@@ -1319,7 +1323,8 @@
|
||||
{
|
||||
int var8 = var3 != null ? var3.stackSize : 0;
|
||||
int j1 = itemstack != null ? itemstack.stackSize : 0;
|
||||
|
||||
- if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, var3, var4, var5, var6, var7, this.objectMouseOver.hitVec))
|
||||
+ boolean result = !ForgeEventFactory.onPlayerInteract(thePlayer, Action.RIGHT_CLICK_BLOCK, var4, var5, var6, var7).isCanceled();
|
||||
+ if (result && this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, var3, var4, var5, var6, var7, this.objectMouseOver.hitVec))
|
||||
- if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, itemstack, j, k, l, i1, this.objectMouseOver.hitVec))
|
||||
+ boolean result = !ForgeEventFactory.onPlayerInteract(thePlayer, Action.RIGHT_CLICK_BLOCK, j, k, l, i1).isCanceled();
|
||||
+ if (result && this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, itemstack, j, k, l, i1, this.objectMouseOver.hitVec))
|
||||
{
|
||||
var2 = false;
|
||||
flag = false;
|
||||
this.thePlayer.swingItem();
|
||||
@@ -1345,7 +1350,8 @@
|
||||
{
|
||||
ItemStack var9 = this.thePlayer.inventory.getCurrentItem();
|
||||
ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem();
|
||||
|
||||
- if (var9 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, var9))
|
||||
- if (itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1))
|
||||
+ boolean result = !ForgeEventFactory.onPlayerInteract(thePlayer, Action.RIGHT_CLICK_AIR, 0, 0, 0, -1).isCanceled();
|
||||
+ if (result && var9 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, var9))
|
||||
+ if (result && itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1))
|
||||
{
|
||||
this.entityRenderer.itemRenderer.func_78445_c();
|
||||
}
|
||||
@@ -62,100 +62,100 @@
|
||||
@@ -2350,95 +2368,12 @@
|
||||
if (this.objectMouseOver != null)
|
||||
{
|
||||
boolean var1 = this.thePlayer.capabilities.isCreativeMode;
|
||||
- int var3 = 0;
|
||||
- boolean var4 = false;
|
||||
- int var2;
|
||||
int var5;
|
||||
boolean flag = this.thePlayer.capabilities.isCreativeMode;
|
||||
- int i = 0;
|
||||
- boolean flag1 = false;
|
||||
- int j;
|
||||
int k;
|
||||
|
||||
- if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE)
|
||||
- {
|
||||
- var5 = this.objectMouseOver.blockX;
|
||||
- int var6 = this.objectMouseOver.blockY;
|
||||
- int var7 = this.objectMouseOver.blockZ;
|
||||
- Block var8 = Block.blocksList[this.theWorld.getBlockId(var5, var6, var7)];
|
||||
- k = this.objectMouseOver.blockX;
|
||||
- int l = this.objectMouseOver.blockY;
|
||||
- int i1 = this.objectMouseOver.blockZ;
|
||||
- Block block = Block.blocksList[this.theWorld.getBlockId(k, l, i1)];
|
||||
-
|
||||
- if (var8 == null)
|
||||
- if (block == null)
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- var2 = var8.idPicked(this.theWorld, var5, var6, var7);
|
||||
- j = block.idPicked(this.theWorld, k, l, i1);
|
||||
-
|
||||
- if (var2 == 0)
|
||||
- if (j == 0)
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- var4 = Item.itemsList[var2].getHasSubtypes();
|
||||
- int var9 = var2 < 256 && !Block.blocksList[var8.blockID].func_82505_u_() ? var2 : var8.blockID;
|
||||
- var3 = Block.blocksList[var9].getDamageValue(this.theWorld, var5, var6, var7);
|
||||
- flag1 = Item.itemsList[j].getHasSubtypes();
|
||||
- int j1 = j < 256 && !Block.blocksList[block.blockID].func_82505_u_() ? j : block.blockID;
|
||||
- i = Block.blocksList[j1].getDamageValue(this.theWorld, k, l, i1);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- if (this.objectMouseOver.typeOfHit != EnumMovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !var1)
|
||||
- if (this.objectMouseOver.typeOfHit != EnumMovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !flag)
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (this.objectMouseOver.entityHit instanceof EntityPainting)
|
||||
- {
|
||||
- var2 = Item.painting.itemID;
|
||||
- j = Item.painting.itemID;
|
||||
- }
|
||||
- else if (this.objectMouseOver.entityHit instanceof EntityItemFrame)
|
||||
- {
|
||||
- EntityItemFrame var10 = (EntityItemFrame)this.objectMouseOver.entityHit;
|
||||
- EntityItemFrame entityitemframe = (EntityItemFrame)this.objectMouseOver.entityHit;
|
||||
-
|
||||
- if (var10.getDisplayedItem() == null)
|
||||
- if (entityitemframe.getDisplayedItem() == null)
|
||||
- {
|
||||
- var2 = Item.itemFrame.itemID;
|
||||
- j = Item.itemFrame.itemID;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- var2 = var10.getDisplayedItem().itemID;
|
||||
- var3 = var10.getDisplayedItem().getItemDamage();
|
||||
- var4 = true;
|
||||
- j = entityitemframe.getDisplayedItem().itemID;
|
||||
- i = entityitemframe.getDisplayedItem().getItemDamage();
|
||||
- flag1 = true;
|
||||
- }
|
||||
- }
|
||||
- else if (this.objectMouseOver.entityHit instanceof EntityMinecart)
|
||||
- {
|
||||
- EntityMinecart var11 = (EntityMinecart)this.objectMouseOver.entityHit;
|
||||
- EntityMinecart entityminecart = (EntityMinecart)this.objectMouseOver.entityHit;
|
||||
-
|
||||
- if (var11.minecartType == 2)
|
||||
- if (entityminecart.minecartType == 2)
|
||||
- {
|
||||
- var2 = Item.minecartPowered.itemID;
|
||||
- j = Item.minecartPowered.itemID;
|
||||
- }
|
||||
- else if (var11.minecartType == 1)
|
||||
- else if (entityminecart.minecartType == 1)
|
||||
- {
|
||||
- var2 = Item.minecartCrate.itemID;
|
||||
- j = Item.minecartCrate.itemID;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- var2 = Item.minecartEmpty.itemID;
|
||||
- j = Item.minecartEmpty.itemID;
|
||||
- }
|
||||
- }
|
||||
- else if (this.objectMouseOver.entityHit instanceof EntityBoat)
|
||||
- {
|
||||
- var2 = Item.boat.itemID;
|
||||
- j = Item.boat.itemID;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- var2 = Item.monsterPlacer.itemID;
|
||||
- var3 = EntityList.getEntityID(this.objectMouseOver.entityHit);
|
||||
- var4 = true;
|
||||
- j = Item.monsterPlacer.itemID;
|
||||
- i = EntityList.getEntityID(this.objectMouseOver.entityHit);
|
||||
- flag1 = true;
|
||||
-
|
||||
- if (var3 <= 0 || !EntityList.entityEggs.containsKey(Integer.valueOf(var3)))
|
||||
- if (i <= 0 || !EntityList.entityEggs.containsKey(Integer.valueOf(i)))
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- this.thePlayer.inventory.setCurrentItem(var2, var3, var4, var1);
|
||||
- this.thePlayer.inventory.setCurrentItem(j, i, flag1, flag);
|
||||
+ if (!ForgeHooks.onPickBlock(this.objectMouseOver, this.thePlayer, this.theWorld))
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
if (var1)
|
||||
if (flag)
|
||||
{
|
||||
@@ -39,67 +39,67 @@
|
||||
+ ModCompatibilityClient.audioModAddCodecs();
|
||||
+ MinecraftForge.EVENT_BUS.post(new SoundSetupEvent(this));
|
||||
sndSystem = new SoundSystem();
|
||||
this.options.soundVolume = var1;
|
||||
this.options.musicVolume = var2;
|
||||
this.options.soundVolume = f;
|
||||
this.options.musicVolume = f1;
|
||||
@@ -177,10 +187,12 @@
|
||||
}
|
||||
|
||||
SoundPoolEntry var1 = this.soundPoolMusic.getRandomSound();
|
||||
+ var1 = ModCompatibilityClient.audioModPickBackgroundMusic(this, var1);
|
||||
+ var1 = SoundEvent.getResult(new PlayBackgroundMusicEvent(this, var1));
|
||||
SoundPoolEntry soundpoolentry = this.soundPoolMusic.getRandomSound();
|
||||
+ soundpoolentry = ModCompatibilityClient.audioModPickBackgroundMusic(this, soundpoolentry);
|
||||
+ soundpoolentry = SoundEvent.getResult(new PlayBackgroundMusicEvent(this, soundpoolentry));
|
||||
|
||||
if (var1 != null)
|
||||
if (soundpoolentry != null)
|
||||
{
|
||||
- this.ticksBeforeMusic = this.rand.nextInt(12000) + 12000;
|
||||
+ this.ticksBeforeMusic = this.rand.nextInt(MUSIC_INTERVAL) + MUSIC_INTERVAL;
|
||||
sndSystem.backgroundMusic("BgMusic", var1.soundUrl, var1.soundName, false);
|
||||
sndSystem.backgroundMusic("BgMusic", soundpoolentry.soundUrl, soundpoolentry.soundName, false);
|
||||
sndSystem.setVolume("BgMusic", this.options.musicVolume);
|
||||
sndSystem.play("BgMusic");
|
||||
@@ -247,6 +259,7 @@
|
||||
if (par1Str != null)
|
||||
{
|
||||
SoundPoolEntry var6 = this.soundPoolStreaming.getRandomSoundFromSoundPool(par1Str);
|
||||
+ var6 = SoundEvent.getResult(new PlayStreamingEvent(this, var6, par1Str, par2, par3, par4));
|
||||
SoundPoolEntry soundpoolentry = this.soundPoolStreaming.getRandomSoundFromSoundPool(par1Str);
|
||||
+ soundpoolentry = SoundEvent.getResult(new PlayStreamingEvent(this, soundpoolentry, par1Str, par2, par3, par4));
|
||||
|
||||
if (var6 != null)
|
||||
if (soundpoolentry != null)
|
||||
{
|
||||
@@ -258,6 +271,7 @@
|
||||
float var7 = 16.0F;
|
||||
sndSystem.newStreamingSource(true, var5, var6.soundUrl, var6.soundName, false, par2, par3, par4, 2, var7 * 4.0F);
|
||||
sndSystem.setVolume(var5, 0.5F * this.options.soundVolume);
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlayStreamingSourceEvent(this, var5, par2, par3, par4));
|
||||
sndSystem.play(var5);
|
||||
float f3 = 16.0F;
|
||||
sndSystem.newStreamingSource(true, s1, soundpoolentry.soundUrl, soundpoolentry.soundName, false, par2, par3, par4, 2, f3 * 4.0F);
|
||||
sndSystem.setVolume(s1, 0.5F * this.options.soundVolume);
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlayStreamingSourceEvent(this, s1, par2, par3, par4));
|
||||
sndSystem.play(s1);
|
||||
}
|
||||
}
|
||||
@@ -437,6 +451,7 @@
|
||||
if (loaded && this.options.soundVolume != 0.0F)
|
||||
{
|
||||
SoundPoolEntry var7 = this.soundPoolSounds.getRandomSoundFromSoundPool(par1Str);
|
||||
+ var7 = SoundEvent.getResult(new PlaySoundEvent(this, var7, par1Str, par2, par3, par4, par5, par6));
|
||||
SoundPoolEntry soundpoolentry = this.soundPoolSounds.getRandomSoundFromSoundPool(par1Str);
|
||||
+ soundpoolentry = SoundEvent.getResult(new PlaySoundEvent(this, soundpoolentry, par1Str, par2, par3, par4, par5, par6));
|
||||
|
||||
if (var7 != null && par5 > 0.0F)
|
||||
if (soundpoolentry != null && par5 > 0.0F)
|
||||
{
|
||||
@@ -458,6 +473,7 @@
|
||||
}
|
||||
|
||||
sndSystem.setVolume(var8, par5 * this.options.soundVolume);
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlaySoundSourceEvent(this, var8, par2, par3, par4));
|
||||
sndSystem.play(var8);
|
||||
sndSystem.setVolume(s1, par5 * this.options.soundVolume);
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlaySoundSourceEvent(this, s1, par2, par3, par4));
|
||||
sndSystem.play(s1);
|
||||
}
|
||||
}
|
||||
@@ -472,6 +488,7 @@
|
||||
if (loaded && this.options.soundVolume != 0.0F)
|
||||
{
|
||||
SoundPoolEntry var4 = this.soundPoolSounds.getRandomSoundFromSoundPool(par1Str);
|
||||
+ var4 = SoundEvent.getResult(new PlaySoundEffectEvent(this, var4, par1Str, par2, par3));
|
||||
SoundPoolEntry soundpoolentry = this.soundPoolSounds.getRandomSoundFromSoundPool(par1Str);
|
||||
+ soundpoolentry = SoundEvent.getResult(new PlaySoundEffectEvent(this, soundpoolentry, par1Str, par2, par3));
|
||||
|
||||
if (var4 != null)
|
||||
if (soundpoolentry != null)
|
||||
{
|
||||
@@ -487,6 +504,7 @@
|
||||
par2 *= 0.25F;
|
||||
sndSystem.setPitch(var5, par3);
|
||||
sndSystem.setVolume(var5, par2 * this.options.soundVolume);
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlaySoundEffectSourceEvent(this, var5));
|
||||
sndSystem.play(var5);
|
||||
sndSystem.setPitch(s1, par3);
|
||||
sndSystem.setVolume(s1, par2 * this.options.soundVolume);
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlaySoundEffectSourceEvent(this, s1));
|
||||
sndSystem.play(s1);
|
||||
}
|
||||
}
|
||||
@@ -34,20 +34,20 @@
|
||||
+ {
|
||||
try
|
||||
{
|
||||
String var3 = par1Str;
|
||||
String s1 = par1Str;
|
||||
@@ -56,13 +77,13 @@
|
||||
this.nameToSoundPoolEntriesMapping.put(par1Str, new ArrayList());
|
||||
}
|
||||
|
||||
- SoundPoolEntry var4 = new SoundPoolEntry(var3, par2File.toURI().toURL());
|
||||
+ SoundPoolEntry var4 = new SoundPoolEntry(var3, url);
|
||||
((List)this.nameToSoundPoolEntriesMapping.get(par1Str)).add(var4);
|
||||
this.allSoundPoolEntries.add(var4);
|
||||
- SoundPoolEntry soundpoolentry = new SoundPoolEntry(s1, par2File.toURI().toURL());
|
||||
+ SoundPoolEntry soundpoolentry = new SoundPoolEntry(s1, url);
|
||||
((List)this.nameToSoundPoolEntriesMapping.get(par1Str)).add(soundpoolentry);
|
||||
this.allSoundPoolEntries.add(soundpoolentry);
|
||||
++this.numberOfSoundPoolEntries;
|
||||
return var4;
|
||||
return soundpoolentry;
|
||||
}
|
||||
- catch (MalformedURLException var5)
|
||||
+ catch (Exception var5)
|
||||
- catch (MalformedURLException malformedurlexception)
|
||||
+ catch (Exception malformedurlexception)
|
||||
{
|
||||
var5.printStackTrace();
|
||||
throw new RuntimeException(var5);
|
||||
malformedurlexception.printStackTrace();
|
||||
throw new RuntimeException(malformedurlexception);
|
||||
@@ -23,27 +23,27 @@
|
||||
public void initGui()
|
||||
{
|
||||
+ scrollPane = new GuiControlsScrollPanel(this, options, mc);
|
||||
StringTranslate var1 = StringTranslate.getInstance();
|
||||
int var2 = this.func_73907_g();
|
||||
StringTranslate stringtranslate = StringTranslate.getInstance();
|
||||
int i = this.func_73907_g();
|
||||
|
||||
- for (int var3 = 0; var3 < this.options.keyBindings.length; ++var3)
|
||||
- for (int j = 0; j < this.options.keyBindings.length; ++j)
|
||||
- {
|
||||
- this.controlList.add(new GuiSmallButton(var3, var2 + var3 % 2 * 160, this.height / 6 + 24 * (var3 >> 1), 70, 20, this.options.getOptionDisplayString(var3)));
|
||||
- this.controlList.add(new GuiSmallButton(j, i + j % 2 * 160, this.height / 6 + 24 * (j >> 1), 70, 20, this.options.getOptionDisplayString(j)));
|
||||
- }
|
||||
-
|
||||
- this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, var1.translateKey("gui.done")));
|
||||
+ this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height - 28, var1.translateKey("gui.done")));
|
||||
- this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, stringtranslate.translateKey("gui.done")));
|
||||
+ this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height - 28, stringtranslate.translateKey("gui.done")));
|
||||
+ scrollPane.registerScrollButtons(controlList, 7, 8);
|
||||
this.screenTitle = var1.translateKey("controls.title");
|
||||
this.screenTitle = stringtranslate.translateKey("controls.title");
|
||||
}
|
||||
|
||||
@@ -56,19 +57,9 @@
|
||||
*/
|
||||
protected void actionPerformed(GuiButton par1GuiButton)
|
||||
{
|
||||
- for (int var2 = 0; var2 < this.options.keyBindings.length; ++var2)
|
||||
- for (int i = 0; i < this.options.keyBindings.length; ++i)
|
||||
- {
|
||||
- ((GuiButton)this.controlList.get(var2)).displayString = this.options.getOptionDisplayString(var2);
|
||||
- ((GuiButton)this.controlList.get(i)).displayString = this.options.getOptionDisplayString(i);
|
||||
- }
|
||||
-
|
||||
if (par1GuiButton.id == 200)
|
||||
@@ -97,42 +97,42 @@
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
- this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215);
|
||||
- int var4 = this.func_73907_g();
|
||||
- int var5 = 0;
|
||||
- int k = this.func_73907_g();
|
||||
- int l = 0;
|
||||
-
|
||||
- while (var5 < this.options.keyBindings.length)
|
||||
- while (l < this.options.keyBindings.length)
|
||||
- {
|
||||
- boolean var6 = false;
|
||||
- int var7 = 0;
|
||||
- boolean flag = false;
|
||||
- int i1 = 0;
|
||||
-
|
||||
- while (true)
|
||||
- {
|
||||
- if (var7 < this.options.keyBindings.length)
|
||||
- if (i1 < this.options.keyBindings.length)
|
||||
- {
|
||||
- if (var7 == var5 || this.options.keyBindings[var5].keyCode != this.options.keyBindings[var7].keyCode)
|
||||
- if (i1 == l || this.options.keyBindings[l].keyCode != this.options.keyBindings[i1].keyCode)
|
||||
- {
|
||||
- ++var7;
|
||||
- ++i1;
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- var6 = true;
|
||||
- flag = true;
|
||||
- }
|
||||
-
|
||||
- if (this.buttonId == var5)
|
||||
- if (this.buttonId == l)
|
||||
- {
|
||||
- ((GuiButton)this.controlList.get(var5)).displayString = "\u00a7f> \u00a7e??? \u00a7f<";
|
||||
- ((GuiButton)this.controlList.get(l)).displayString = "\u00a7f> \u00a7e??? \u00a7f<";
|
||||
- }
|
||||
- else if (var6)
|
||||
- else if (flag)
|
||||
- {
|
||||
- ((GuiButton)this.controlList.get(var5)).displayString = "\u00a7c" + this.options.getOptionDisplayString(var5);
|
||||
- ((GuiButton)this.controlList.get(l)).displayString = "\u00a7c" + this.options.getOptionDisplayString(l);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- ((GuiButton)this.controlList.get(var5)).displayString = this.options.getOptionDisplayString(var5);
|
||||
- ((GuiButton)this.controlList.get(l)).displayString = this.options.getOptionDisplayString(l);
|
||||
- }
|
||||
-
|
||||
- this.drawString(this.fontRenderer, this.options.getKeyBindingDescription(var5), var4 + var5 % 2 * 160 + 70 + 6, this.height / 6 + 24 * (var5 >> 1) + 7, -1);
|
||||
- ++var5;
|
||||
- this.drawString(this.fontRenderer, this.options.getKeyBindingDescription(l), k + l % 2 * 160 + 70 + 6, this.height / 6 + 24 * (l >> 1) + 7, -1);
|
||||
- ++l;
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
{
|
||||
@@ -159,7 +161,7 @@
|
||||
|
||||
var47 = var7 - 39;
|
||||
var22 = var47 - 10;
|
||||
- var23 = this.mc.thePlayer.getTotalArmorValue();
|
||||
+ var23 = ForgeHooks.getTotalArmorValue(mc.thePlayer);
|
||||
var24 = -1;
|
||||
j3 = l - 39;
|
||||
l2 = j3 - 10;
|
||||
- k2 = this.mc.thePlayer.getTotalArmorValue();
|
||||
+ k2 = ForgeHooks.getTotalArmorValue(mc.thePlayer);
|
||||
i3 = -1;
|
||||
|
||||
if (this.mc.thePlayer.isPotionActive(Potion.regeneration))
|
||||
@@ -12,20 +12,20 @@
|
||||
@@ -332,16 +334,7 @@
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_FOG);
|
||||
Tessellator var18 = Tessellator.instance;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/background.png"));
|
||||
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
- float var17 = 32.0F;
|
||||
- var18.startDrawingQuads();
|
||||
- var18.setColorOpaque_I(2105376);
|
||||
- var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / var17), (double)((float)(this.bottom + (int)this.amountScrolled) / var17));
|
||||
- var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / var17), (double)((float)(this.bottom + (int)this.amountScrolled) / var17));
|
||||
- var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / var17), (double)((float)(this.top + (int)this.amountScrolled) / var17));
|
||||
- var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / var17), (double)((float)(this.top + (int)this.amountScrolled) / var17));
|
||||
- var18.draw();
|
||||
+ drawContainerBackground(var18);
|
||||
var9 = this.width / 2 - 92 - 16;
|
||||
var10 = this.top + 4 - (int)this.amountScrolled;
|
||||
- float f1 = 32.0F;
|
||||
- tessellator.startDrawingQuads();
|
||||
- tessellator.setColorOpaque_I(2105376);
|
||||
- tessellator.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1));
|
||||
- tessellator.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1));
|
||||
- tessellator.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1));
|
||||
- tessellator.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1));
|
||||
- tessellator.draw();
|
||||
+ drawContainerBackground(tessellator);
|
||||
j1 = this.width / 2 - 92 - 16;
|
||||
k1 = this.top + 4 - (int)this.amountScrolled;
|
||||
|
||||
@@ -470,10 +463,10 @@
|
||||
/**
|
||||
@@ -34,15 +34,15 @@
|
||||
- private void overlayBackground(int par1, int par2, int par3, int par4)
|
||||
+ protected void overlayBackground(int par1, int par2, int par3, int par4)
|
||||
{
|
||||
Tessellator var5 = Tessellator.instance;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/background.png"));
|
||||
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(BACKGROUND_IMAGE));
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
float var6 = 32.0F;
|
||||
var5.startDrawingQuads();
|
||||
float f = 32.0F;
|
||||
tessellator.startDrawingQuads();
|
||||
@@ -485,4 +478,18 @@
|
||||
var5.addVertexWithUV(0.0D, (double)par1, 0.0D, 0.0D, (double)((float)par1 / var6));
|
||||
var5.draw();
|
||||
tessellator.addVertexWithUV(0.0D, (double)par1, 0.0D, 0.0D, (double)((float)par1 / f));
|
||||
tessellator.draw();
|
||||
}
|
||||
+
|
||||
+ protected void drawContainerBackground(Tessellator tess)
|
||||
|
||||
@@ -31,9 +31,9 @@
|
||||
public GuiAchievements(StatFileWriter par1StatFileWriter)
|
||||
{
|
||||
@@ -63,6 +72,14 @@
|
||||
short var3 = 141;
|
||||
this.field_74117_m = this.guiMapX = this.field_74124_q = (double)(AchievementList.openInventory.displayColumn * 24 - var2 / 2 - 12);
|
||||
this.field_74115_n = this.guiMapY = this.field_74123_r = (double)(AchievementList.openInventory.displayRow * 24 - var3 / 2);
|
||||
short short2 = 141;
|
||||
this.field_74117_m = this.guiMapX = this.field_74124_q = (double)(AchievementList.openInventory.displayColumn * 24 - short1 / 2 - 12);
|
||||
this.field_74115_n = this.guiMapY = this.field_74123_r = (double)(AchievementList.openInventory.displayRow * 24 - short2 / 2);
|
||||
+ minecraftAchievements.clear();
|
||||
+ for (Object achievement : AchievementList.achievementList)
|
||||
+ {
|
||||
@@ -71,33 +71,33 @@
|
||||
|
||||
super.actionPerformed(par1GuiButton);
|
||||
@@ -307,11 +335,12 @@
|
||||
int var27;
|
||||
int var30;
|
||||
int k4;
|
||||
int l4;
|
||||
|
||||
- for (var22 = 0; var22 < AchievementList.achievementList.size(); ++var22)
|
||||
- for (k3 = 0; k3 < AchievementList.achievementList.size(); ++k3)
|
||||
- {
|
||||
- Achievement var33 = (Achievement)AchievementList.achievementList.get(var22);
|
||||
- Achievement achievement = (Achievement)AchievementList.achievementList.get(k3);
|
||||
-
|
||||
- if (var33.parentAchievement != null)
|
||||
- if (achievement.parentAchievement != null)
|
||||
+ List<Achievement> achievementList = (currentPage == -1 ? minecraftAchievements : AchievementPage.getAchievementPage(currentPage).getAchievements());
|
||||
+ for (var22 = 0; var22 < achievementList.size(); ++var22)
|
||||
+ for (k3 = 0; k3 < achievementList.size(); ++k3)
|
||||
+ {
|
||||
+ Achievement var33 = achievementList.get(var22);
|
||||
+ Achievement achievement = achievementList.get(k3);
|
||||
+
|
||||
+ if (var33.parentAchievement != null && achievementList.contains(var33.parentAchievement))
|
||||
+ if (achievement.parentAchievement != null && achievementList.contains(achievement.parentAchievement))
|
||||
{
|
||||
var24 = var33.displayColumn * 24 - var4 + 11 + var10;
|
||||
var25 = var33.displayRow * 24 - var5 + 11 + var11;
|
||||
i4 = achievement.displayColumn * 24 - k + 11 + i2;
|
||||
l3 = achievement.displayRow * 24 - l + 11 + j2;
|
||||
@@ -345,9 +374,9 @@
|
||||
int var42;
|
||||
int var41;
|
||||
int j5;
|
||||
int k5;
|
||||
|
||||
- for (var24 = 0; var24 < AchievementList.achievementList.size(); ++var24)
|
||||
- for (i4 = 0; i4 < AchievementList.achievementList.size(); ++i4)
|
||||
- {
|
||||
- Achievement var35 = (Achievement)AchievementList.achievementList.get(var24);
|
||||
+ for (var24 = 0; var24 < achievementList.size(); ++var24)
|
||||
- Achievement achievement2 = (Achievement)AchievementList.achievementList.get(i4);
|
||||
+ for (i4 = 0; i4 < achievementList.size(); ++i4)
|
||||
+ {
|
||||
+ Achievement var35 = achievementList.get(var24);
|
||||
var26 = var35.displayColumn * 24 - var4;
|
||||
var27 = var35.displayRow * 24 - var5;
|
||||
+ Achievement achievement2 = achievementList.get(i4);
|
||||
j4 = achievement2.displayColumn * 24 - k;
|
||||
k4 = achievement2.displayRow * 24 - l;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
--- ../src_base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java
|
||||
@@ -333,7 +333,7 @@
|
||||
if (var6 >= 0)
|
||||
if (k >= 0)
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
- this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture("/gui/items.png"));
|
||||
+ this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture(par1Slot.getBackgroundIconTexture()));
|
||||
this.drawTexturedModalRect(var2, var3, var6 % 16 * 16, var6 / 16 * 16, 16, 16);
|
||||
this.drawTexturedModalRect(i, j, k % 16 * 16, k / 16 * 16, 16, 16);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
var5 = true;
|
||||
flag = true;
|
||||
+46
-46
@@ -10,7 +10,7 @@
|
||||
public GuiContainerCreative(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
@@ -229,6 +231,13 @@
|
||||
this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[var1]);
|
||||
this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[i]);
|
||||
this.field_82324_x = new CreativeCrafting(this.mc);
|
||||
this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_82324_x);
|
||||
+ int tabCount = CreativeTabs.creativeTabArray.length;
|
||||
@@ -25,21 +25,21 @@
|
||||
{
|
||||
@@ -363,7 +372,7 @@
|
||||
{
|
||||
CreativeTabs var3 = CreativeTabs.creativeTabArray[selectedTabIndex];
|
||||
CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex];
|
||||
|
||||
- if (var3.drawInForegroundOfTab())
|
||||
+ if (var3 != null && var3.drawInForegroundOfTab())
|
||||
- if (creativetabs.drawInForegroundOfTab())
|
||||
+ if (creativetabs != null && creativetabs.drawInForegroundOfTab())
|
||||
{
|
||||
this.fontRenderer.drawString(var3.getTranslatedTabLabel(), 8, 6, 4210752);
|
||||
this.fontRenderer.drawString(creativetabs.getTranslatedTabLabel(), 8, 6, 4210752);
|
||||
}
|
||||
@@ -385,7 +394,7 @@
|
||||
{
|
||||
CreativeTabs var9 = var6[var8];
|
||||
CreativeTabs creativetabs = acreativetabs[k1];
|
||||
|
||||
- if (this.func_74232_a(var9, var4, var5))
|
||||
+ if (var9 != null && func_74232_a(var9, var4, var5))
|
||||
- if (this.func_74232_a(creativetabs, l, i1))
|
||||
+ if (creativetabs != null && func_74232_a(creativetabs, l, i1))
|
||||
{
|
||||
this.setCurrentCreativeTab(var9);
|
||||
this.setCurrentCreativeTab(creativetabs);
|
||||
return;
|
||||
@@ -401,11 +410,17 @@
|
||||
*/
|
||||
@@ -56,28 +56,28 @@
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
int var2 = selectedTabIndex;
|
||||
int i = selectedTabIndex;
|
||||
selectedTabIndex = par1CreativeTabs.getTabIndex();
|
||||
ContainerCreative var3 = (ContainerCreative)this.inventorySlots;
|
||||
ContainerCreative containercreative = (ContainerCreative)this.inventorySlots;
|
||||
@@ -575,21 +590,42 @@
|
||||
|
||||
super.drawScreen(par1, par2, par3);
|
||||
CreativeTabs[] var11 = CreativeTabs.creativeTabArray;
|
||||
- int var12 = var11.length;
|
||||
CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray;
|
||||
- int i2 = acreativetabs.length;
|
||||
-
|
||||
- for (int var13 = 0; var13 < var12; ++var13)
|
||||
- for (int j2 = 0; j2 < i2; ++j2)
|
||||
+ int start = tabPage * 10;
|
||||
+ int var12 = Math.min(var11.length, ((tabPage + 1) * 10) + 2);
|
||||
+ int i2 = Math.min(acreativetabs.length, ((tabPage + 1) * 10) + 2);
|
||||
+ if (tabPage != 0) start += 2;
|
||||
+ boolean rendered = false;
|
||||
+
|
||||
+ for (int var13 = start; var13 < var12; ++var13)
|
||||
+ for (int j2 = start; j2 < i2; ++j2)
|
||||
{
|
||||
CreativeTabs var14 = var11[var13];
|
||||
CreativeTabs creativetabs = acreativetabs[j2];
|
||||
|
||||
- if (this.renderCreativeInventoryHoveringText(var14, par1, par2))
|
||||
- if (this.renderCreativeInventoryHoveringText(creativetabs, par1, par2))
|
||||
- {
|
||||
+ if (var14 != null && renderCreativeInventoryHoveringText(var14, par1, par2))
|
||||
+ if (creativetabs != null && renderCreativeInventoryHoveringText(creativetabs, par1, par2))
|
||||
+ {
|
||||
+ rendered = true;
|
||||
break;
|
||||
@@ -108,55 +108,55 @@
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
@@ -610,14 +646,32 @@
|
||||
int var8 = var7.length;
|
||||
int var9;
|
||||
int i1 = acreativetabs.length;
|
||||
int j1;
|
||||
|
||||
- for (var9 = 0; var9 < var8; ++var9)
|
||||
- for (j1 = 0; j1 < i1; ++j1)
|
||||
+ int start = tabPage * 10;
|
||||
+ var8 = Math.min(var7.length, ((tabPage + 1) * 10 + 2));
|
||||
+ i1 = Math.min(acreativetabs.length, ((tabPage + 1) * 10 + 2));
|
||||
+ if (tabPage != 0) start += 2;
|
||||
+
|
||||
+ for (var9 = start; var9 < var8; ++var9)
|
||||
+ for (j1 = start; j1 < i1; ++j1)
|
||||
{
|
||||
CreativeTabs var10 = var7[var9];
|
||||
this.mc.renderEngine.bindTexture(var4);
|
||||
CreativeTabs creativetabs1 = acreativetabs[j1];
|
||||
this.mc.renderEngine.bindTexture(k);
|
||||
|
||||
- if (var10.getTabIndex() != selectedTabIndex)
|
||||
+ if (var10 != null && var10.getTabIndex() != selectedTabIndex)
|
||||
- if (creativetabs1.getTabIndex() != selectedTabIndex)
|
||||
+ if (creativetabs1 != null && creativetabs1.getTabIndex() != selectedTabIndex)
|
||||
{
|
||||
this.renderCreativeTab(var10);
|
||||
this.renderCreativeTab(creativetabs1);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (tabPage != 0)
|
||||
+ {
|
||||
+ if (var5 != CreativeTabs.tabAllSearch)
|
||||
+ if (creativetabs != CreativeTabs.tabAllSearch)
|
||||
+ {
|
||||
+ mc.renderEngine.bindTexture(var4);
|
||||
+ mc.renderEngine.bindTexture(k);
|
||||
+ renderCreativeTab(CreativeTabs.tabAllSearch);
|
||||
+ }
|
||||
+ if (var5 != CreativeTabs.tabInventory)
|
||||
+ if (creativetabs != CreativeTabs.tabInventory)
|
||||
+ {
|
||||
+ mc.renderEngine.bindTexture(var4);
|
||||
+ mc.renderEngine.bindTexture(k);
|
||||
+ renderCreativeTab(CreativeTabs.tabInventory);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(k1, i1 + (int)((float)(j1 - i1 - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15);
|
||||
}
|
||||
|
||||
+ if (var5 == null || var5.getTabPage() != tabPage)
|
||||
+ if (creativetabs == null || creativetabs.getTabPage() != tabPage)
|
||||
+ {
|
||||
+ if (var5 != CreativeTabs.tabAllSearch && var5 != CreativeTabs.tabInventory)
|
||||
+ if (creativetabs != CreativeTabs.tabAllSearch && creativetabs != CreativeTabs.tabInventory)
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
this.renderCreativeTab(var5);
|
||||
this.renderCreativeTab(creativetabs);
|
||||
|
||||
if (var5 == CreativeTabs.tabInventory)
|
||||
if (creativetabs == CreativeTabs.tabInventory)
|
||||
@@ -645,6 +707,15 @@
|
||||
|
||||
protected boolean func_74232_a(CreativeTabs par1CreativeTabs, int par2, int par3)
|
||||
@@ -170,17 +170,17 @@
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
int var4 = par1CreativeTabs.getTabColumn();
|
||||
int var5 = 28 * var4;
|
||||
byte var6 = 0;
|
||||
int k = par1CreativeTabs.getTabColumn();
|
||||
int l = 28 * k;
|
||||
byte b0 = 0;
|
||||
@@ -759,7 +830,7 @@
|
||||
var8 += 8 + (var3 ? 1 : -1);
|
||||
i1 += 8 + (flag1 ? 1 : -1);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
- ItemStack var10 = new ItemStack(par1CreativeTabs.getTabIconItem());
|
||||
+ ItemStack var10 = par1CreativeTabs.getIconItemStack();
|
||||
itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.renderEngine, var10, var7, var8);
|
||||
itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.renderEngine, var10, var7, var8);
|
||||
- ItemStack itemstack = new ItemStack(par1CreativeTabs.getTabIconItem());
|
||||
+ ItemStack itemstack = par1CreativeTabs.getIconItemStack();
|
||||
itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.renderEngine, itemstack, l, i1);
|
||||
itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.renderEngine, itemstack, l, i1);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
@@ -781,6 +852,15 @@
|
||||
{
|
||||
|
||||
@@ -15,4 +15,4 @@
|
||||
+ @SideOnly(Side.CLIENT)
|
||||
public void render(Tessellator par1Tessellator, float par2)
|
||||
{
|
||||
for (int var3 = 0; var3 < this.quadList.length; ++var3)
|
||||
for (int i = 0; i < this.quadList.length; ++i)
|
||||
@@ -36,11 +36,11 @@
|
||||
public void handleAnimation(Packet18Animation par1Packet18Animation)
|
||||
@@ -1192,6 +1201,10 @@
|
||||
{
|
||||
var2.readFromNBT(par1Packet132TileEntityData.customParam1);
|
||||
tileentity.readFromNBT(par1Packet132TileEntityData.customParam1);
|
||||
}
|
||||
+ else
|
||||
+ {
|
||||
+ var2.onDataPacket(netManager, par1Packet132TileEntityData);
|
||||
+ tileentity.onDataPacket(netManager, par1Packet132TileEntityData);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,20 +26,20 @@
|
||||
return false;
|
||||
@@ -138,7 +148,7 @@
|
||||
{
|
||||
var5.playAuxSFX(2001, par1, par2, par3, var6.blockID + (var5.getBlockMetadata(par1, par2, par3) << 12));
|
||||
int var7 = var5.getBlockMetadata(par1, par2, par3);
|
||||
- boolean var8 = var5.setBlockWithNotify(par1, par2, par3, 0);
|
||||
+ boolean var8 = var6.removeBlockByPlayer(var5, mc.thePlayer, par1, par2, par3);
|
||||
worldclient.playAuxSFX(2001, par1, par2, par3, block.blockID + (worldclient.getBlockMetadata(par1, par2, par3) << 12));
|
||||
int i1 = worldclient.getBlockMetadata(par1, par2, par3);
|
||||
- boolean flag = worldclient.setBlockWithNotify(par1, par2, par3, 0);
|
||||
+ boolean flag = block.removeBlockByPlayer(worldclient, mc.thePlayer, par1, par2, par3);
|
||||
|
||||
if (var8)
|
||||
if (flag)
|
||||
{
|
||||
@@ -334,6 +344,12 @@
|
||||
float var11 = (float)par8Vec3.zCoord - (float)par6;
|
||||
boolean var12 = false;
|
||||
int var13;
|
||||
float f2 = (float)par8Vec3.zCoord - (float)par6;
|
||||
boolean flag = false;
|
||||
int i1;
|
||||
+ if (par3ItemStack != null &&
|
||||
+ par3ItemStack.getItem() != null &&
|
||||
+ par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7, var9, var10, var11))
|
||||
+ par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7, f, f1, f2))
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
@@ -47,19 +47,19 @@
|
||||
if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null)
|
||||
{
|
||||
@@ -344,6 +360,7 @@
|
||||
var12 = true;
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
+
|
||||
|
||||
if (!var12 && par3ItemStack != null && par3ItemStack.getItem() instanceof ItemBlock)
|
||||
if (!flag && par3ItemStack != null && par3ItemStack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
@@ -376,7 +393,15 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- return par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, var9, var10, var11);
|
||||
+ if (!par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, var9, var10, var11))
|
||||
- return par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, f, f1, f2);
|
||||
+ if (!par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, f, f1, f2))
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
@@ -73,13 +73,13 @@
|
||||
|
||||
@@ -398,9 +423,10 @@
|
||||
{
|
||||
par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = var5;
|
||||
par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = itemstack1;
|
||||
|
||||
- if (var5.stackSize == 0)
|
||||
+ if (var5.stackSize <= 0)
|
||||
- if (itemstack1.stackSize == 0)
|
||||
+ if (itemstack1.stackSize <= 0)
|
||||
{
|
||||
par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = null;
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(par1EntityPlayer, var5));
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(par1EntityPlayer, itemstack1));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -36,21 +36,21 @@
|
||||
{
|
||||
if (par1World != null)
|
||||
@@ -59,12 +70,27 @@
|
||||
for (int var2 = 0; var2 < this.fxLayers[var1].size(); ++var2)
|
||||
for (int j = 0; j < this.fxLayers[i].size(); ++j)
|
||||
{
|
||||
EntityFX var3 = (EntityFX)this.fxLayers[var1].get(var2);
|
||||
- var3.onUpdate();
|
||||
EntityFX entityfx = (EntityFX)this.fxLayers[i].get(j);
|
||||
- entityfx.onUpdate();
|
||||
-
|
||||
- if (var3.isDead)
|
||||
- if (entityfx.isDead)
|
||||
+
|
||||
+ if (var3 != null)
|
||||
+ if (entityfx != null)
|
||||
+ {
|
||||
+ var3.onUpdate();
|
||||
+ entityfx.onUpdate();
|
||||
+ }
|
||||
+
|
||||
+ if (var3 == null || var3.isDead)
|
||||
+ if (entityfx == null || entityfx.isDead)
|
||||
{
|
||||
this.fxLayers[var1].remove(var2--);
|
||||
this.fxLayers[i].remove(j--);
|
||||
}
|
||||
+ }
|
||||
+ }
|
||||
@@ -67,12 +67,12 @@
|
||||
}
|
||||
}
|
||||
@@ -115,6 +141,7 @@
|
||||
for (int var11 = 0; var11 < this.fxLayers[var8].size(); ++var11)
|
||||
for (int k = 0; k < this.fxLayers[i].size(); ++k)
|
||||
{
|
||||
EntityFX var12 = (EntityFX)this.fxLayers[var8].get(var11);
|
||||
+ if (var12 == null) continue;
|
||||
var10.setBrightness(var12.getBrightnessForRender(par2));
|
||||
var12.renderParticle(var10, par2, var3, var7, var4, var5, var6);
|
||||
EntityFX entityfx = (EntityFX)this.fxLayers[i].get(k);
|
||||
+ if (entityfx == null) continue;
|
||||
tessellator.setBrightness(entityfx.getBrightnessForRender(par2));
|
||||
entityfx.renderParticle(tessellator, par2, f1, f5, f2, f3, f4);
|
||||
}
|
||||
@@ -123,6 +150,27 @@
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
@@ -93,7 +93,7 @@
|
||||
+ if (entry.getFXLayer() != 3)
|
||||
+ {
|
||||
+ tessallator.setBrightness(entry.getBrightnessForRender(par2));
|
||||
+ entry.renderParticle(tessallator, par2, var3, var7, var4, var5, var6);
|
||||
+ entry.renderParticle(tessallator, par2, f1, f5, f2, f3, f4);
|
||||
+ }
|
||||
+
|
||||
+ tessallator.draw();
|
||||
@@ -103,16 +103,16 @@
|
||||
}
|
||||
|
||||
@@ -142,6 +190,7 @@
|
||||
for (int var11 = 0; var11 < this.fxLayers[var9].size(); ++var11)
|
||||
for (int i = 0; i < this.fxLayers[b0].size(); ++i)
|
||||
{
|
||||
EntityFX var12 = (EntityFX)this.fxLayers[var9].get(var11);
|
||||
+ if (var12 == null) continue;
|
||||
var10.setBrightness(var12.getBrightnessForRender(par2));
|
||||
var12.renderParticle(var10, par2, var4, var8, var5, var6, var7);
|
||||
EntityFX entityfx = (EntityFX)this.fxLayers[b0].get(i);
|
||||
+ if (entityfx == null) continue;
|
||||
tessellator.setBrightness(entityfx.getBrightnessForRender(par2));
|
||||
entityfx.renderParticle(tessellator, par2, f1, f5, f2, f3, f4);
|
||||
}
|
||||
@@ -156,13 +205,15 @@
|
||||
{
|
||||
this.fxLayers[var2].clear();
|
||||
this.fxLayers[i].clear();
|
||||
}
|
||||
+
|
||||
+ effectList.clear();
|
||||
@@ -122,28 +122,28 @@
|
||||
{
|
||||
- if (par4 != 0)
|
||||
- {
|
||||
- Block var6 = Block.blocksList[par4];
|
||||
+ Block var6 = Block.blocksList[par4];
|
||||
+ if (var6 != null && !var6.addBlockDestroyEffects(worldObj, par1, par2, par3, par5, this))
|
||||
- Block block = Block.blocksList[par4];
|
||||
+ Block block = Block.blocksList[par4];
|
||||
+ if (block != null && !block.addBlockDestroyEffects(worldObj, par1, par2, par3, par5, this))
|
||||
+ {
|
||||
byte var7 = 4;
|
||||
byte b0 = 4;
|
||||
|
||||
for (int var8 = 0; var8 < var7; ++var8)
|
||||
for (int j1 = 0; j1 < b0; ++j1)
|
||||
@@ -175,7 +226,7 @@
|
||||
double var13 = (double)par2 + ((double)var9 + 0.5D) / (double)var7;
|
||||
double var15 = (double)par3 + ((double)var10 + 0.5D) / (double)var7;
|
||||
int var17 = this.rand.nextInt(6);
|
||||
- this.addEffect((new EntityDiggingFX(this.worldObj, var11, var13, var15, var11 - (double)par1 - 0.5D, var13 - (double)par2 - 0.5D, var15 - (double)par3 - 0.5D, var6, var17, par5)).func_70596_a(par1, par2, par3));
|
||||
+ this.addEffect((new EntityDiggingFX(this.worldObj, var11, var13, var15, var11 - (double)par1 - 0.5D, var13 - (double)par2 - 0.5D, var15 - (double)par3 - 0.5D, var6, var17, par5)).func_70596_a(par1, par2, par3), var6);
|
||||
double d1 = (double)par2 + ((double)k1 + 0.5D) / (double)b0;
|
||||
double d2 = (double)par3 + ((double)l1 + 0.5D) / (double)b0;
|
||||
int i2 = this.rand.nextInt(6);
|
||||
- this.addEffect((new EntityDiggingFX(this.worldObj, d0, d1, d2, d0 - (double)par1 - 0.5D, d1 - (double)par2 - 0.5D, d2 - (double)par3 - 0.5D, block, i2, par5)).func_70596_a(par1, par2, par3));
|
||||
+ this.addEffect((new EntityDiggingFX(this.worldObj, d0, d1, d2, d0 - (double)par1 - 0.5D, d1 - (double)par2 - 0.5D, d2 - (double)par3 - 0.5D, block, i2, par5)).func_70596_a(par1, par2, par3), block);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -227,12 +278,60 @@
|
||||
var8 = (double)par1 + var6.getBlockBoundsMaxX() + (double)var7;
|
||||
d0 = (double)par1 + block.getBlockBoundsMaxX() + (double)f;
|
||||
}
|
||||
|
||||
- this.addEffect((new EntityDiggingFX(this.worldObj, var8, var10, var12, 0.0D, 0.0D, 0.0D, var6, par4, this.worldObj.getBlockMetadata(par1, par2, par3))).func_70596_a(par1, par2, par3).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
|
||||
+ this.addEffect((new EntityDiggingFX(this.worldObj, var8, var10, var12, 0.0D, 0.0D, 0.0D, var6, par4, this.worldObj.getBlockMetadata(par1, par2, par3))).func_70596_a(par1, par2, par3).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F), var6);
|
||||
- this.addEffect((new EntityDiggingFX(this.worldObj, d0, d1, d2, 0.0D, 0.0D, 0.0D, block, par4, this.worldObj.getBlockMetadata(par1, par2, par3))).func_70596_a(par1, par2, par3).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
|
||||
+ this.addEffect((new EntityDiggingFX(this.worldObj, d0, d1, d2, 0.0D, 0.0D, 0.0D, block, par4, this.worldObj.getBlockMetadata(par1, par2, par3))).func_70596_a(par1, par2, par3).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F), block);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
*/
|
||||
private void updateFovModifierHand()
|
||||
{
|
||||
- EntityPlayerSP var1 = (EntityPlayerSP)this.mc.renderViewEntity;
|
||||
- this.fovMultiplierTemp = var1.getFOVMultiplier();
|
||||
- EntityPlayerSP entityplayersp = (EntityPlayerSP)this.mc.renderViewEntity;
|
||||
- this.fovMultiplierTemp = entityplayersp.getFOVMultiplier();
|
||||
+ if (mc.renderViewEntity instanceof EntityPlayerSP)
|
||||
+ {
|
||||
+ EntityPlayerSP var1 = (EntityPlayerSP)this.mc.renderViewEntity;
|
||||
+ this.fovMultiplierTemp = var1.getFOVMultiplier();
|
||||
+ EntityPlayerSP entityplayersp = (EntityPlayerSP)this.mc.renderViewEntity;
|
||||
+ this.fovMultiplierTemp = entityplayersp.getFOVMultiplier();
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
@@ -34,52 +34,52 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- EntityPlayer var3 = (EntityPlayer)this.mc.renderViewEntity;
|
||||
+ EntityLiving var3 = (EntityLiving)this.mc.renderViewEntity;
|
||||
float var4 = 70.0F;
|
||||
- EntityPlayer entityplayer = (EntityPlayer)this.mc.renderViewEntity;
|
||||
+ EntityLiving entityplayer = (EntityLiving)this.mc.renderViewEntity;
|
||||
float f1 = 70.0F;
|
||||
|
||||
if (par2)
|
||||
@@ -437,15 +449,7 @@
|
||||
|
||||
if (!this.mc.gameSettings.debugCamEnable)
|
||||
{
|
||||
- int var10 = this.mc.theWorld.getBlockId(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ));
|
||||
- int i = this.mc.theWorld.getBlockId(MathHelper.floor_double(entityliving.posX), MathHelper.floor_double(entityliving.posY), MathHelper.floor_double(entityliving.posZ));
|
||||
-
|
||||
- if (var10 == Block.bed.blockID)
|
||||
- if (i == Block.bed.blockID)
|
||||
- {
|
||||
- int var11 = this.mc.theWorld.getBlockMetadata(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ));
|
||||
- int var12 = var11 & 3;
|
||||
- GL11.glRotatef((float)(var12 * 90), 0.0F, 1.0F, 0.0F);
|
||||
- int j = this.mc.theWorld.getBlockMetadata(MathHelper.floor_double(entityliving.posX), MathHelper.floor_double(entityliving.posY), MathHelper.floor_double(entityliving.posZ));
|
||||
- int k = j & 3;
|
||||
- GL11.glRotatef((float)(k * 90), 0.0F, 1.0F, 0.0F);
|
||||
- }
|
||||
-
|
||||
+ ForgeHooksClient.orientBedCamera(mc, var2);
|
||||
GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * par1 + 180.0F, 0.0F, -1.0F, 0.0F);
|
||||
GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * par1, -1.0F, 0.0F, 0.0F);
|
||||
+ ForgeHooksClient.orientBedCamera(mc, entityliving);
|
||||
GL11.glRotatef(entityliving.prevRotationYaw + (entityliving.rotationYaw - entityliving.prevRotationYaw) * par1 + 180.0F, 0.0F, -1.0F, 0.0F);
|
||||
GL11.glRotatef(entityliving.prevRotationPitch + (entityliving.rotationPitch - entityliving.prevRotationPitch) * par1, -1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
@@ -1139,8 +1143,11 @@
|
||||
var17 = (EntityPlayer)var4;
|
||||
entityplayer = (EntityPlayer)entityliving;
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
this.mc.mcProfiler.endStartSection("outline");
|
||||
- var5.drawBlockBreaking(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
|
||||
- var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
|
||||
+ if (!ForgeHooksClient.onDrawBlockHighlight(var5, var17, mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1))
|
||||
- renderglobal.drawBlockBreaking(entityplayer, this.mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1);
|
||||
- renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1);
|
||||
+ if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1))
|
||||
+ {
|
||||
+ var5.drawBlockBreaking(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
|
||||
+ var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
|
||||
+ renderglobal.drawBlockBreaking(entityplayer, this.mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1);
|
||||
+ renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1);
|
||||
+ }
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
}
|
||||
}
|
||||
@@ -1204,15 +1211,18 @@
|
||||
var17 = (EntityPlayer)var4;
|
||||
entityplayer = (EntityPlayer)entityliving;
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
this.mc.mcProfiler.endStartSection("outline");
|
||||
- var5.drawBlockBreaking(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
|
||||
- var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
|
||||
+ if (!ForgeHooksClient.onDrawBlockHighlight(var5, var17, mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1))
|
||||
- renderglobal.drawBlockBreaking(entityplayer, this.mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1);
|
||||
- renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1);
|
||||
+ if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1))
|
||||
+ {
|
||||
+ var5.drawBlockBreaking(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
|
||||
+ var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, var17.inventory.getCurrentItem(), par1);
|
||||
+ renderglobal.drawBlockBreaking(entityplayer, this.mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1);
|
||||
+ renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), par1);
|
||||
+ }
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
}
|
||||
@@ -87,18 +87,18 @@
|
||||
this.mc.mcProfiler.endStartSection("destroyProgress");
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
- var5.drawBlockDamageTexture(Tessellator.instance, (EntityPlayer)var4, par1);
|
||||
+ var5.drawBlockDamageTexture(Tessellator.instance, var4, par1);
|
||||
- renderglobal.drawBlockDamageTexture(Tessellator.instance, (EntityPlayer)entityliving, par1);
|
||||
+ renderglobal.drawBlockDamageTexture(Tessellator.instance, entityliving, par1);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
this.mc.mcProfiler.endStartSection("weather");
|
||||
this.renderRainSnow(par1);
|
||||
@@ -1222,6 +1232,9 @@
|
||||
{
|
||||
this.renderCloudsCheck(var5, par1);
|
||||
this.renderCloudsCheck(renderglobal, par1);
|
||||
}
|
||||
+
|
||||
+ this.mc.mcProfiler.endStartSection("FRenderLast");
|
||||
+ ForgeHooksClient.dispatchRenderLast(var5, par1);
|
||||
+ ForgeHooksClient.dispatchRenderLast(renderglobal, par1);
|
||||
|
||||
this.mc.mcProfiler.endStartSection("hand");
|
||||
|
||||
@@ -24,16 +24,16 @@
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
||||
- Block var4 = null;
|
||||
- Block block = null;
|
||||
- if (par2ItemStack.itemID < Block.blocksList.length)
|
||||
- {
|
||||
- var4 = Block.blocksList[par2ItemStack.itemID];
|
||||
- block = Block.blocksList[par2ItemStack.itemID];
|
||||
- }
|
||||
-
|
||||
- if (var4 != null && RenderBlocks.renderItemIn3d(var4.getRenderType()))
|
||||
- if (block != null && RenderBlocks.renderItemIn3d(block.getRenderType()))
|
||||
- {
|
||||
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
|
||||
- this.renderBlocksInstance.renderBlockAsItem(var4, par2ItemStack.getItemDamage(), 1.0F);
|
||||
- this.renderBlocksInstance.renderBlockAsItem(block, par2ItemStack.getItemDamage(), 1.0F);
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(par2ItemStack, EQUIPPED);
|
||||
+
|
||||
+ if (customRenderer != null)
|
||||
@@ -48,7 +48,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- if (var4 != null)
|
||||
- if (block != null)
|
||||
- {
|
||||
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
|
||||
- }
|
||||
@@ -58,61 +58,61 @@
|
||||
- }
|
||||
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(par2ItemStack.getItem().getTextureFile()));
|
||||
|
||||
Tessellator var5 = Tessellator.instance;
|
||||
int var6 = par1EntityLiving.getItemIcon(par2ItemStack, par3);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int j = par1EntityLiving.getItemIcon(par2ItemStack, par3);
|
||||
@@ -279,8 +281,9 @@
|
||||
Render var24;
|
||||
RenderPlayer var26;
|
||||
Render render;
|
||||
RenderPlayer renderplayer;
|
||||
|
||||
- if (var17 != null && var17.itemID == Item.map.itemID)
|
||||
- if (itemstack != null && itemstack.itemID == Item.map.itemID)
|
||||
- {
|
||||
+ if (var17 != null && var17.getItem() instanceof ItemMap)
|
||||
+ if (itemstack != null && itemstack.getItem() instanceof ItemMap)
|
||||
+ {
|
||||
+ IItemRenderer custom = MinecraftForgeClient.getItemRenderer(var17, FIRST_PERSON_MAP);
|
||||
+ IItemRenderer custom = MinecraftForgeClient.getItemRenderer(itemstack, FIRST_PERSON_MAP);
|
||||
GL11.glPushMatrix();
|
||||
var7 = 0.8F;
|
||||
var20 = var3.getSwingProgress(par1);
|
||||
f4 = 0.8F;
|
||||
f7 = entityclientplayermp.getSwingProgress(par1);
|
||||
@@ -346,11 +349,17 @@
|
||||
var28.addVertexWithUV((double)(128 + var27), (double)(0 - var27), 0.0D, 1.0D, 0.0D);
|
||||
var28.addVertexWithUV((double)(0 - var27), (double)(0 - var27), 0.0D, 0.0D, 0.0D);
|
||||
var28.draw();
|
||||
- MapData var16 = Item.map.getMapData(var17, this.mc.theWorld);
|
||||
tessellator.addVertexWithUV((double)(128 + b0), (double)(0 - b0), 0.0D, 1.0D, 0.0D);
|
||||
tessellator.addVertexWithUV((double)(0 - b0), (double)(0 - b0), 0.0D, 0.0D, 0.0D);
|
||||
tessellator.draw();
|
||||
- MapData mapdata = Item.map.getMapData(itemstack, this.mc.theWorld);
|
||||
-
|
||||
- if (var16 != null)
|
||||
- if (mapdata != null)
|
||||
- {
|
||||
- this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, var16);
|
||||
+ MapData var16 = ((ItemMap)var17.getItem()).getMapData(var17, this.mc.theWorld);
|
||||
- this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, mapdata);
|
||||
+ MapData mapdata = ((ItemMap)itemstack.getItem()).getMapData(itemstack, this.mc.theWorld);
|
||||
+ if (custom == null)
|
||||
+ {
|
||||
+ if (var16 != null)
|
||||
+ if (mapdata != null)
|
||||
+ {
|
||||
+ this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, var16);
|
||||
+ this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, mapdata);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ custom.renderItem(FIRST_PERSON_MAP, var17, mc.thePlayer, mc.renderEngine, var16);
|
||||
+ custom.renderItem(FIRST_PERSON_MAP, itemstack, mc.thePlayer, mc.renderEngine, mapdata);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
@@ -453,12 +462,15 @@
|
||||
if (var17.getItem().requiresMultipleRenderPasses())
|
||||
if (itemstack.getItem().requiresMultipleRenderPasses())
|
||||
{
|
||||
this.renderItem(var3, var17, 0);
|
||||
- int var25 = Item.itemsList[var17.itemID].getColorFromItemStack(var17, 1);
|
||||
- var13 = (float)(var25 >> 16 & 255) / 255.0F;
|
||||
- var14 = (float)(var25 >> 8 & 255) / 255.0F;
|
||||
- var15 = (float)(var25 & 255) / 255.0F;
|
||||
- GL11.glColor4f(var6 * var13, var6 * var14, var6 * var15, 1.0F);
|
||||
- this.renderItem(var3, var17, 1);
|
||||
+ for (int x = 1; x < var17.getItem().getRenderPasses(var17.getItemDamage()); x++)
|
||||
this.renderItem(entityclientplayermp, itemstack, 0);
|
||||
- int i1 = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 1);
|
||||
- f10 = (float)(i1 >> 16 & 255) / 255.0F;
|
||||
- f11 = (float)(i1 >> 8 & 255) / 255.0F;
|
||||
- f12 = (float)(i1 & 255) / 255.0F;
|
||||
- GL11.glColor4f(f3 * f10, f3 * f11, f3 * f12, 1.0F);
|
||||
- this.renderItem(entityclientplayermp, itemstack, 1);
|
||||
+ for (int x = 1; x < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); x++)
|
||||
+ {
|
||||
+ int var25 = Item.itemsList[var17.itemID].getColorFromItemStack(var17, x);
|
||||
+ var13 = (float)(var25 >> 16 & 255) / 255.0F;
|
||||
+ var14 = (float)(var25 >> 8 & 255) / 255.0F;
|
||||
+ var15 = (float)(var25 & 255) / 255.0F;
|
||||
+ GL11.glColor4f(var6 * var13, var6 * var14, var6 * var15, 1.0F);
|
||||
+ this.renderItem(var3, var17, x);
|
||||
+ int i1 = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, x);
|
||||
+ f10 = (float)(i1 >> 16 & 255) / 255.0F;
|
||||
+ f11 = (float)(i1 >> 8 & 255) / 255.0F;
|
||||
+ f12 = (float)(i1 & 255) / 255.0F;
|
||||
+ GL11.glColor4f(f3 * f10, f3 * f11, f3 * f12, 1.0F);
|
||||
+ this.renderItem(entityclientplayermp, itemstack, x);
|
||||
+ }
|
||||
}
|
||||
else
|
||||
|
||||
@@ -12,154 +12,154 @@
|
||||
@@ -620,9 +622,8 @@
|
||||
public boolean renderBlockBed(Block par1Block, int par2, int par3, int par4)
|
||||
{
|
||||
Tessellator var5 = Tessellator.instance;
|
||||
- int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4);
|
||||
- int var7 = BlockBed.getDirection(var6);
|
||||
- boolean var8 = BlockBed.isBlockHeadOfBed(var6);
|
||||
+ int var7 = par1Block.getBedDirection(blockAccess, par2, par3, par4);
|
||||
+ boolean var8 = par1Block.isBedFoot(blockAccess, par2, par3, par4);
|
||||
float var9 = 0.5F;
|
||||
float var10 = 1.0F;
|
||||
float var11 = 0.8F;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
- int l = this.blockAccess.getBlockMetadata(par2, par3, par4);
|
||||
- int i1 = BlockBed.getDirection(l);
|
||||
- boolean flag = BlockBed.isBlockHeadOfBed(l);
|
||||
+ int i1 = par1Block.getBedDirection(blockAccess, par2, par3, par4);
|
||||
+ boolean flag = par1Block.isBedFoot(blockAccess, par2, par3, par4);
|
||||
float f = 0.5F;
|
||||
float f1 = 1.0F;
|
||||
float f2 = 0.8F;
|
||||
@@ -631,6 +632,7 @@
|
||||
var5.setBrightness(var25);
|
||||
var5.setColorOpaque_F(var9, var9, var9);
|
||||
int var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 0);
|
||||
+ if (overrideBlockTexture >= 0) var27 = overrideBlockTexture; //BugFix Proper breaking texture on underside
|
||||
int var28 = (var27 & 15) << 4;
|
||||
int var29 = var27 & 240;
|
||||
double var30 = (double)((float)var28 / 256.0F);
|
||||
tessellator.setBrightness(j1);
|
||||
tessellator.setColorOpaque_F(f, f, f);
|
||||
int k1 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 0);
|
||||
+ if (overrideBlockTexture >= 0) k1 = overrideBlockTexture; //BugFix Proper breaking texture on underside
|
||||
int l1 = (k1 & 15) << 4;
|
||||
int i2 = k1 & 240;
|
||||
double d0 = (double)((float)l1 / 256.0F);
|
||||
@@ -649,6 +651,7 @@
|
||||
var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4));
|
||||
var5.setColorOpaque_F(var10, var10, var10);
|
||||
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 1);
|
||||
+ if (overrideBlockTexture >= 0) var27 = overrideBlockTexture; //BugFix Proper breaking texture on top
|
||||
var28 = (var27 & 15) << 4;
|
||||
var29 = var27 & 240;
|
||||
var30 = (double)((float)var28 / 256.0F);
|
||||
tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4));
|
||||
tessellator.setColorOpaque_F(f1, f1, f1);
|
||||
k1 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 1);
|
||||
+ if (overrideBlockTexture >= 0) k1 = overrideBlockTexture; //BugFix Proper breaking texture on top
|
||||
l1 = (k1 & 15) << 4;
|
||||
i2 = k1 & 240;
|
||||
d0 = (double)((float)l1 / 256.0F);
|
||||
@@ -2387,7 +2390,7 @@
|
||||
double var28;
|
||||
double var30;
|
||||
double d9;
|
||||
double d10;
|
||||
|
||||
- if (!this.blockAccess.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 - 1, par4))
|
||||
+ if (!this.blockAccess.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 - 1, par4, UP))
|
||||
{
|
||||
float var36 = 0.2F;
|
||||
float var19 = 0.0625F;
|
||||
float f1 = 0.2F;
|
||||
float f2 = 0.0625F;
|
||||
@@ -2407,7 +2410,7 @@
|
||||
var9 = var20;
|
||||
d0 = d5;
|
||||
}
|
||||
|
||||
- if (Block.fire.canBlockCatchFire(this.blockAccess, par2 - 1, par3, par4))
|
||||
+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2 - 1, par3, par4, EAST))
|
||||
{
|
||||
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);
|
||||
tessellator.addVertexWithUV((double)((float)par2 + f1), (double)((float)par3 + f + f2), (double)(par4 + 1), d1, d2);
|
||||
tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + f2), (double)(par4 + 1), d1, d3);
|
||||
@@ -2419,7 +2422,7 @@
|
||||
var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13);
|
||||
tessellator.addVertexWithUV((double)((float)par2 + f1), (double)((float)par3 + f + f2), (double)(par4 + 1), d1, d2);
|
||||
}
|
||||
|
||||
- if (Block.fire.canBlockCatchFire(this.blockAccess, par2 + 1, par3, par4))
|
||||
+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2 + 1, par3, par4, WEST))
|
||||
{
|
||||
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);
|
||||
tessellator.addVertexWithUV((double)((float)(par2 + 1) - f1), (double)((float)par3 + f + f2), (double)(par4 + 0), d0, d2);
|
||||
tessellator.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + f2), (double)(par4 + 0), d0, d3);
|
||||
@@ -2431,7 +2434,7 @@
|
||||
var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13);
|
||||
tessellator.addVertexWithUV((double)((float)(par2 + 1) - f1), (double)((float)par3 + f + f2), (double)(par4 + 0), d0, d2);
|
||||
}
|
||||
|
||||
- if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 - 1))
|
||||
+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 - 1, SOUTH))
|
||||
{
|
||||
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);
|
||||
tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + f + f2), (double)((float)par4 + f1), d1, d2);
|
||||
tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + f2), (double)(par4 + 0), d1, d3);
|
||||
@@ -2443,7 +2446,7 @@
|
||||
var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var11, var13);
|
||||
tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + f + f2), (double)((float)par4 + f1), d1, d2);
|
||||
}
|
||||
|
||||
- if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 + 1))
|
||||
+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 + 1, NORTH))
|
||||
{
|
||||
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);
|
||||
tessellator.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + f + f2), (double)((float)(par4 + 1) - f1), d0, d2);
|
||||
tessellator.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + f2), (double)(par4 + 1 - 0), d0, d3);
|
||||
@@ -2455,7 +2458,7 @@
|
||||
var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var13);
|
||||
tessellator.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + f + f2), (double)((float)(par4 + 1) - f1), d0, d2);
|
||||
}
|
||||
|
||||
- if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 + 1, par4))
|
||||
+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 + 1, par4, DOWN))
|
||||
{
|
||||
var20 = (double)par2 + 0.5D + 0.5D;
|
||||
var22 = (double)par2 + 0.5D - 0.5D;
|
||||
d5 = (double)par2 + 0.5D + 0.5D;
|
||||
d6 = (double)par2 + 0.5D - 0.5D;
|
||||
@@ -4654,7 +4657,7 @@
|
||||
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
|
||||
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
|
||||
k2 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
|
||||
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, k2);
|
||||
|
||||
- if (fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
|
||||
- if (fancyGrass && k2 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && k2 == 3 && this.overrideBlockTexture < 0)
|
||||
{
|
||||
this.colorRedTopLeft *= par5;
|
||||
this.colorRedBottomLeft *= par5;
|
||||
@@ -4777,7 +4780,7 @@
|
||||
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3);
|
||||
k2 = 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));
|
||||
|
||||
- if (fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
|
||||
- if (fancyGrass && k2 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && k2 == 3 && this.overrideBlockTexture < 0)
|
||||
{
|
||||
this.colorRedTopLeft *= par5;
|
||||
this.colorRedBottomLeft *= par5;
|
||||
@@ -4900,7 +4903,7 @@
|
||||
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
|
||||
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
|
||||
k2 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
|
||||
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, k2);
|
||||
|
||||
- if (fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
|
||||
- if (fancyGrass && k2 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && k2 == 3 && this.overrideBlockTexture < 0)
|
||||
{
|
||||
this.colorRedTopLeft *= par5;
|
||||
this.colorRedBottomLeft *= par5;
|
||||
@@ -5023,7 +5026,7 @@
|
||||
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
|
||||
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
|
||||
k2 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
|
||||
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, k2);
|
||||
|
||||
- if (fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
|
||||
- if (fancyGrass && k2 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && k2 == 3 && this.overrideBlockTexture < 0)
|
||||
{
|
||||
this.colorRedTopLeft *= par5;
|
||||
this.colorRedBottomLeft *= par5;
|
||||
@@ -5135,7 +5138,7 @@
|
||||
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
|
||||
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
|
||||
i1 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
|
||||
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, i1);
|
||||
|
||||
- if (fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
|
||||
- if (fancyGrass && i1 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && i1 == 3 && this.overrideBlockTexture < 0)
|
||||
{
|
||||
var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7);
|
||||
tessellator.setColorOpaque_F(f11 * par5, f14 * par6, f17 * par7);
|
||||
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
|
||||
@@ -5151,7 +5154,7 @@
|
||||
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3);
|
||||
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
|
||||
i1 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3);
|
||||
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, i1);
|
||||
|
||||
- if (fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
|
||||
- if (fancyGrass && i1 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && i1 == 3 && this.overrideBlockTexture < 0)
|
||||
{
|
||||
var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7);
|
||||
tessellator.setColorOpaque_F(f11 * par5, f14 * par6, f17 * par7);
|
||||
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
|
||||
@@ -5167,7 +5170,7 @@
|
||||
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
|
||||
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
|
||||
i1 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
|
||||
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, i1);
|
||||
|
||||
- if (fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
|
||||
- if (fancyGrass && i1 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && i1 == 3 && this.overrideBlockTexture < 0)
|
||||
{
|
||||
var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7);
|
||||
tessellator.setColorOpaque_F(f12 * par5, f15 * par6, f18 * par7);
|
||||
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
|
||||
@@ -5183,7 +5186,7 @@
|
||||
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
|
||||
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
|
||||
i1 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
|
||||
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, i1);
|
||||
|
||||
- if (fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
|
||||
- if (fancyGrass && i1 == 3 && this.overrideBlockTexture < 0)
|
||||
+ if (Tessellator.instance.defaultTexture && fancyGrass && i1 == 3 && this.overrideBlockTexture < 0)
|
||||
{
|
||||
var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7);
|
||||
tessellator.setColorOpaque_F(f12 * par5, f15 * par6, f18 * par7);
|
||||
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
|
||||
@@ -16,12 +16,12 @@
|
||||
+ ForgeHooksClient.onTextureLoadPre(par1Str);
|
||||
this.singleIntBuffer.clear();
|
||||
GLAllocation.generateTextureNames(this.singleIntBuffer);
|
||||
int var3 = this.singleIntBuffer.get(0);
|
||||
int i = this.singleIntBuffer.get(0);
|
||||
@@ -215,6 +218,7 @@
|
||||
}
|
||||
|
||||
this.textureMap.put(par1Str, Integer.valueOf(var3));
|
||||
+ ForgeHooksClient.onTextureLoad(par1Str, var6);
|
||||
return var3;
|
||||
this.textureMap.put(par1Str, Integer.valueOf(i));
|
||||
+ ForgeHooksClient.onTextureLoad(par1Str, itexturepack);
|
||||
return i;
|
||||
}
|
||||
catch (Exception var5)
|
||||
catch (Exception exception)
|
||||
@@ -46,12 +46,12 @@
|
||||
+
|
||||
+ public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityLiving par2EntityPlayer, float par3)
|
||||
{
|
||||
double var4 = par2EntityPlayer.lastTickPosX + (par2EntityPlayer.posX - par2EntityPlayer.lastTickPosX) * (double)par3;
|
||||
double var6 = par2EntityPlayer.lastTickPosY + (par2EntityPlayer.posY - par2EntityPlayer.lastTickPosY) * (double)par3;
|
||||
double d0 = par2EntityPlayer.lastTickPosX + (par2EntityPlayer.posX - par2EntityPlayer.lastTickPosX) * (double)par3;
|
||||
double d1 = par2EntityPlayer.lastTickPosY + (par2EntityPlayer.posY - par2EntityPlayer.lastTickPosY) * (double)par3;
|
||||
@@ -1873,6 +1893,7 @@
|
||||
double var17 = this.mc.renderViewEntity.posY - par4;
|
||||
double var19 = this.mc.renderViewEntity.posZ - par6;
|
||||
EntityFX var21 = null;
|
||||
double d7 = this.mc.renderViewEntity.posY - par4;
|
||||
double d8 = this.mc.renderViewEntity.posZ - par6;
|
||||
EntityFX entityfx = null;
|
||||
+ Object effectObject = null;
|
||||
|
||||
if (par1Str.equals("hugeexplosion"))
|
||||
@@ -59,7 +59,7 @@
|
||||
@@ -2009,6 +2030,7 @@
|
||||
else if (par1Str.equals("snowballpoof"))
|
||||
{
|
||||
var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, Item.snowball);
|
||||
entityfx = new EntityBreakingFX(this.theWorld, par2, par4, par6, Item.snowball);
|
||||
+ effectObject = Item.snowball;
|
||||
}
|
||||
else if (par1Str.equals("dripWater"))
|
||||
@@ -67,30 +67,30 @@
|
||||
@@ -2025,6 +2047,7 @@
|
||||
else if (par1Str.equals("slime"))
|
||||
{
|
||||
var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, Item.slimeBall);
|
||||
entityfx = new EntityBreakingFX(this.theWorld, par2, par4, par6, Item.slimeBall);
|
||||
+ effectObject = Item.slimeBall;
|
||||
}
|
||||
else if (par1Str.equals("heart"))
|
||||
{
|
||||
@@ -2046,6 +2069,7 @@
|
||||
{
|
||||
int var27 = Integer.parseInt(par1Str.substring(par1Str.indexOf("_") + 1));
|
||||
var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Item.itemsList[var27]);
|
||||
+ effectObject = Item.itemsList[var27];
|
||||
int j = Integer.parseInt(par1Str.substring(par1Str.indexOf("_") + 1));
|
||||
entityfx = new EntityBreakingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Item.itemsList[j]);
|
||||
+ effectObject = Item.itemsList[j];
|
||||
}
|
||||
else if (par1Str.startsWith("tilecrack_"))
|
||||
{
|
||||
@@ -2053,11 +2077,12 @@
|
||||
int var25 = Integer.parseInt(var28[1]);
|
||||
int var26 = Integer.parseInt(var28[2]);
|
||||
var21 = (new EntityDiggingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Block.blocksList[var25], 0, var26)).applyRenderColor(var26);
|
||||
+ effectObject = Block.blocksList[var25];
|
||||
int k = Integer.parseInt(astring[1]);
|
||||
int l = Integer.parseInt(astring[2]);
|
||||
entityfx = (new EntityDiggingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Block.blocksList[k], 0, l)).applyRenderColor(l);
|
||||
+ effectObject = Block.blocksList[k];
|
||||
}
|
||||
|
||||
if (var21 != null)
|
||||
if (entityfx != null)
|
||||
{
|
||||
- this.mc.effectRenderer.addEffect((EntityFX)var21);
|
||||
+ this.mc.effectRenderer.addEffect((EntityFX)var21, effectObject);
|
||||
- this.mc.effectRenderer.addEffect((EntityFX)entityfx);
|
||||
+ this.mc.effectRenderer.addEffect((EntityFX)entityfx, effectObject);
|
||||
}
|
||||
|
||||
return (EntityFX)var21;
|
||||
return (EntityFX)entityfx;
|
||||
@@ -152,7 +152,7 @@
|
||||
+ rawBuffer = null;
|
||||
}
|
||||
|
||||
int var1 = this.rawBufferIndex * 4;
|
||||
int i = this.rawBufferIndex * 4;
|
||||
@@ -442,6 +470,19 @@
|
||||
*/
|
||||
public void addVertex(double par1, double par3, double par5)
|
||||
|
||||
@@ -19,51 +19,51 @@
|
||||
public int posY;
|
||||
@@ -192,15 +194,16 @@
|
||||
GL11.glTranslatef(-8.0F, -8.0F, -8.0F);
|
||||
GL11.glScalef(var19, var19, var19);
|
||||
GL11.glScalef(f, f, f);
|
||||
GL11.glTranslatef(8.0F, 8.0F, 8.0F);
|
||||
- tessellator.startDrawingQuads();
|
||||
- tessellator.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ));
|
||||
+ ForgeHooksClient.beforeRenderPass(var11);
|
||||
+ ForgeHooksClient.beforeRenderPass(l1);
|
||||
+ Tessellator.instance.startDrawingQuads();
|
||||
+ Tessellator.instance.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ));
|
||||
}
|
||||
|
||||
Block var23 = Block.blocksList[var18];
|
||||
Block block = Block.blocksList[l2];
|
||||
|
||||
if (var23 != null)
|
||||
if (block != null)
|
||||
{
|
||||
- if (var11 == 0 && var23.hasTileEntity())
|
||||
+ if (var11 == 0 && var23.hasTileEntity(var9.getBlockMetadata(var17, var15, var16)))
|
||||
- if (l1 == 0 && block.hasTileEntity())
|
||||
+ if (l1 == 0 && block.hasTileEntity(chunkcache.getBlockMetadata(k2, i2, j2)))
|
||||
{
|
||||
TileEntity var20 = var9.getBlockTileEntity(var17, var15, var16);
|
||||
TileEntity tileentity = chunkcache.getBlockTileEntity(k2, i2, j2);
|
||||
|
||||
@@ -212,14 +215,17 @@
|
||||
|
||||
int var24 = var23.getRenderBlockPass();
|
||||
int i3 = block.getRenderBlockPass();
|
||||
|
||||
- if (var24 != var11)
|
||||
+ if (var24 > var11)
|
||||
- if (i3 != l1)
|
||||
+ if (i3 > l1)
|
||||
{
|
||||
var12 = true;
|
||||
flag = true;
|
||||
}
|
||||
- else if (var24 == var11)
|
||||
+ if (!var23.canRenderInPass(var11))
|
||||
- else if (i3 == l1)
|
||||
+ if (!block.canRenderInPass(l1))
|
||||
{
|
||||
- var13 |= var10.renderBlockByRenderType(var23, var17, var15, var16);
|
||||
- flag1 |= renderblocks.renderBlockByRenderType(block, k2, i2, j2);
|
||||
+ continue;
|
||||
}
|
||||
+ ForgeHooksClient.beforeBlockRender(var23, var10);
|
||||
+ var13 |= var10.renderBlockByRenderType(var23, var17, var15, var16);
|
||||
+ ForgeHooksClient.afterBlockRender(var23, var10);
|
||||
+ ForgeHooksClient.beforeBlockRender(block, renderblocks);
|
||||
+ flag1 |= renderblocks.renderBlockByRenderType(block, k2, i2, j2);
|
||||
+ ForgeHooksClient.afterBlockRender(block, renderblocks);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -228,10 +234,11 @@
|
||||
|
||||
if (var14)
|
||||
if (flag2)
|
||||
{
|
||||
- this.bytesDrawn += tessellator.draw();
|
||||
+ ForgeHooksClient.afterRenderPass(var11);
|
||||
+ ForgeHooksClient.afterRenderPass(l1);
|
||||
+ this.bytesDrawn += Tessellator.instance.draw();
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEndList();
|
||||
|
||||
@@ -17,50 +17,50 @@
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderBiped extends RenderLiving
|
||||
@@ -59,7 +65,7 @@
|
||||
if (var5 instanceof ItemArmor)
|
||||
if (item instanceof ItemArmor)
|
||||
{
|
||||
ItemArmor var6 = (ItemArmor)var5;
|
||||
- this.loadTexture("/armor/" + bipedArmorFilenamePrefix[var6.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png");
|
||||
+ this.loadTexture(ForgeHooksClient.getArmorTexture(var4, "/armor/" + bipedArmorFilenamePrefix[var6.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png"));
|
||||
ModelBiped var7 = par2 == 2 ? this.field_82425_h : this.field_82423_g;
|
||||
var7.bipedHead.showModel = par2 == 0;
|
||||
var7.bipedHeadwear.showModel = par2 == 0;
|
||||
ItemArmor itemarmor = (ItemArmor)item;
|
||||
- this.loadTexture("/armor/" + bipedArmorFilenamePrefix[itemarmor.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png");
|
||||
+ this.loadTexture(ForgeHooksClient.getArmorTexture(itemstack, "/armor/" + bipedArmorFilenamePrefix[itemarmor.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png"));
|
||||
ModelBiped modelbiped = par2 == 2 ? this.field_82425_h : this.field_82423_g;
|
||||
modelbiped.bipedHead.showModel = par2 == 0;
|
||||
modelbiped.bipedHeadwear.showModel = par2 == 0;
|
||||
@@ -174,9 +180,12 @@
|
||||
GL11.glPushMatrix();
|
||||
this.modelBipedMain.bipedHead.postRender(0.0625F);
|
||||
|
||||
- if (var5.getItem().itemID < 256)
|
||||
- if (itemstack1.getItem().itemID < 256)
|
||||
- {
|
||||
- if (RenderBlocks.renderItemIn3d(Block.blocksList[var5.itemID].getRenderType()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var5, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, var5, BLOCK_3D));
|
||||
- if (RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack1, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack1, BLOCK_3D));
|
||||
+
|
||||
+ if (var5.getItem() instanceof ItemBlock)
|
||||
+ if (itemstack1.getItem() instanceof ItemBlock)
|
||||
+ {
|
||||
+ if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[var5.itemID].getRenderType()))
|
||||
+ if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType()))
|
||||
{
|
||||
var6 = 0.625F;
|
||||
f2 = 0.625F;
|
||||
GL11.glTranslatef(0.0F, -0.25F, 0.0F);
|
||||
@@ -218,7 +227,10 @@
|
||||
this.modelBipedMain.bipedRightArm.postRender(0.0625F);
|
||||
GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
|
||||
|
||||
- if (var4.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var4, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, var4, BLOCK_3D));
|
||||
- if (itemstack.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));
|
||||
+
|
||||
+ if (var4.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())))
|
||||
+ if (itemstack.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())))
|
||||
{
|
||||
var6 = 0.5F;
|
||||
f2 = 0.5F;
|
||||
GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
|
||||
@@ -265,7 +277,10 @@
|
||||
|
||||
if (var4.getItem().requiresMultipleRenderPasses())
|
||||
if (itemstack.getItem().requiresMultipleRenderPasses())
|
||||
{
|
||||
- this.renderManager.itemRenderer.renderItem(par1EntityLiving, var4, 1);
|
||||
+ for (int x = 1; x < var4.getItem().getRenderPasses(var4.getItemDamage()); x++)
|
||||
- this.renderManager.itemRenderer.renderItem(par1EntityLiving, itemstack, 1);
|
||||
+ for (int x = 1; x < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); x++)
|
||||
+ {
|
||||
+ this.renderManager.itemRenderer.renderItem(par1EntityLiving, var4, x);
|
||||
+ this.renderManager.itemRenderer.renderItem(par1EntityLiving, itemstack, x);
|
||||
+ }
|
||||
}
|
||||
|
||||
|
||||
@@ -16,70 +16,70 @@
|
||||
public class RenderItem extends Render
|
||||
{
|
||||
@@ -48,39 +51,22 @@
|
||||
if (var10.getItem() != null)
|
||||
if (itemstack.getItem() != null)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
- float var11 = MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F;
|
||||
+ float var11 = shouldBob() ? MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F : 0F;
|
||||
float var12 = (((float)par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float)Math.PI);
|
||||
- byte var13 = 1;
|
||||
- float f2 = MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F;
|
||||
+ float f2 = shouldBob() ? MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F : 0F;
|
||||
float f3 = (((float)par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float)Math.PI);
|
||||
- byte b0 = 1;
|
||||
-
|
||||
- if (par1EntityItem.func_92014_d().stackSize > 1)
|
||||
- {
|
||||
- var13 = 2;
|
||||
- b0 = 2;
|
||||
- }
|
||||
-
|
||||
- if (par1EntityItem.func_92014_d().stackSize > 5)
|
||||
- {
|
||||
- var13 = 3;
|
||||
- b0 = 3;
|
||||
- }
|
||||
-
|
||||
- if (par1EntityItem.func_92014_d().stackSize > 20)
|
||||
- {
|
||||
- var13 = 4;
|
||||
- b0 = 4;
|
||||
- }
|
||||
-
|
||||
- if (par1EntityItem.func_92014_d().stackSize > 40)
|
||||
- {
|
||||
- var13 = 5;
|
||||
- b0 = 5;
|
||||
- }
|
||||
+ byte var13 = getMiniBlockCountForItemStack(var10);
|
||||
+ byte b0 = getMiniBlockCountForItemStack(itemstack);
|
||||
|
||||
GL11.glTranslatef((float)par2, (float)par4 + var11, (float)par6);
|
||||
GL11.glTranslatef((float)par2, (float)par4 + f2, (float)par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
- Block var14 = Block.blocksList[var10.itemID];
|
||||
int var16;
|
||||
float var19;
|
||||
float var20;
|
||||
float var24;
|
||||
- Block block = Block.blocksList[itemstack.itemID];
|
||||
int i;
|
||||
float f4;
|
||||
float f5;
|
||||
float f6;
|
||||
|
||||
- if (var14 != null && RenderBlocks.renderItemIn3d(var14.getRenderType()))
|
||||
+ if (ForgeHooksClient.renderEntityItem(par1EntityItem, var10, var11, var12, random, renderManager.renderEngine, renderBlocks))
|
||||
- if (block != null && RenderBlocks.renderItemIn3d(block.getRenderType()))
|
||||
+ if (ForgeHooksClient.renderEntityItem(par1EntityItem, itemstack, f2, f3, random, renderManager.renderEngine, renderBlocks))
|
||||
+ {
|
||||
+ ;
|
||||
+ }
|
||||
+ else if (var10.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[var10.itemID].getRenderType()))
|
||||
+ else if (itemstack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
{
|
||||
GL11.glRotatef(var12, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
@@ -91,9 +77,9 @@
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
- this.loadTexture("/terrain.png");
|
||||
+ this.loadTexture(Block.blocksList[var10.itemID].getTextureFile());
|
||||
float var22 = 0.25F;
|
||||
- var16 = var14.getRenderType();
|
||||
+ var16 = Block.blocksList[var10.itemID].getRenderType();
|
||||
+ this.loadTexture(Block.blocksList[itemstack.itemID].getTextureFile());
|
||||
float f7 = 0.25F;
|
||||
- i = block.getRenderType();
|
||||
+ i = Block.blocksList[itemstack.itemID].getRenderType();
|
||||
|
||||
if (var16 == 1 || var16 == 19 || var16 == 12 || var16 == 2)
|
||||
if (i == 1 || i == 19 || i == 12 || i == 2)
|
||||
{
|
||||
@@ -115,7 +101,7 @@
|
||||
}
|
||||
|
||||
var24 = 1.0F;
|
||||
- this.itemRenderBlocks.renderBlockAsItem(var14, var10.getItemDamage(), var24);
|
||||
+ this.itemRenderBlocks.renderBlockAsItem(Block.blocksList[var10.itemID], var10.getItemDamage(), var24);
|
||||
f6 = 1.0F;
|
||||
- this.itemRenderBlocks.renderBlockAsItem(block, itemstack.getItemDamage(), f6);
|
||||
+ this.itemRenderBlocks.renderBlockAsItem(Block.blocksList[itemstack.itemID], itemstack.getItemDamage(), f6);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@@ -89,23 +89,23 @@
|
||||
|
||||
- this.loadTexture("/gui/items.png");
|
||||
-
|
||||
- for (var15 = 0; var15 <= 1; ++var15)
|
||||
- for (k = 0; k <= 1; ++k)
|
||||
- {
|
||||
+
|
||||
+ for (var15 = 0; var15 <= var10.getItem().getRenderPasses(var10.getItemDamage()); ++var15)
|
||||
+ for (k = 0; k <= itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++k)
|
||||
+ {
|
||||
+ this.loadTexture(Item.itemsList[var10.itemID].getTextureFile());
|
||||
+ this.loadTexture(Item.itemsList[itemstack.itemID].getTextureFile());
|
||||
this.random.setSeed(187L);
|
||||
- var16 = var10.getItem().getIconFromDamageForRenderPass(var10.getItemDamage(), var15);
|
||||
+ var16 = var10.getItem().getIconIndex(var10, var15);
|
||||
var17 = 1.0F;
|
||||
- i = itemstack.getItem().getIconFromDamageForRenderPass(itemstack.getItemDamage(), k);
|
||||
+ i = itemstack.getItem().getIconIndex(itemstack, k);
|
||||
f8 = 1.0F;
|
||||
|
||||
if (this.field_77024_a)
|
||||
@@ -173,14 +159,7 @@
|
||||
|
||||
var15 = var10.getIconIndex();
|
||||
k = itemstack.getIconIndex();
|
||||
|
||||
- if (var14 != null)
|
||||
- if (block != null)
|
||||
- {
|
||||
- this.loadTexture("/terrain.png");
|
||||
- }
|
||||
@@ -113,99 +113,99 @@
|
||||
- {
|
||||
- this.loadTexture("/gui/items.png");
|
||||
- }
|
||||
+ this.loadTexture(var10.getItem().getTextureFile());
|
||||
+ this.loadTexture(itemstack.getItem().getTextureFile());
|
||||
|
||||
if (this.field_77024_a)
|
||||
{
|
||||
@@ -232,39 +211,27 @@
|
||||
var17 = 0.021875F;
|
||||
ItemStack var18 = par1EntityItem.func_92014_d();
|
||||
int var19 = var18.stackSize;
|
||||
- byte var24;
|
||||
f11 = 0.021875F;
|
||||
ItemStack itemstack = par1EntityItem.func_92014_d();
|
||||
int k = itemstack.stackSize;
|
||||
- byte b0;
|
||||
-
|
||||
- if (var19 < 2)
|
||||
- if (k < 2)
|
||||
- {
|
||||
- var24 = 1;
|
||||
- b0 = 1;
|
||||
- }
|
||||
- else if (var19 < 16)
|
||||
- else if (k < 16)
|
||||
- {
|
||||
- var24 = 2;
|
||||
- b0 = 2;
|
||||
- }
|
||||
- else if (var19 < 32)
|
||||
- else if (k < 32)
|
||||
- {
|
||||
- var24 = 3;
|
||||
- b0 = 3;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- var24 = 4;
|
||||
- b0 = 4;
|
||||
- }
|
||||
+ byte var24 = getMiniItemCountForItemStack(var18);
|
||||
+ byte b0 = getMiniItemCountForItemStack(itemstack);
|
||||
+
|
||||
|
||||
GL11.glTranslatef(-var14, -var15, -((var16 + var17) * (float)var24 / 2.0F));
|
||||
GL11.glTranslatef(-f9, -f10, -((f12 + f11) * (float)b0 / 2.0F));
|
||||
|
||||
for (int var20 = 0; var20 < var24; ++var20)
|
||||
for (int l = 0; l < b0; ++l)
|
||||
{
|
||||
- GL11.glTranslatef(0.0F, 0.0F, var16 + var17);
|
||||
- GL11.glTranslatef(0.0F, 0.0F, f12 + f11);
|
||||
-
|
||||
- if (Block.blocksList[var18.itemID] != null)
|
||||
- if (Block.blocksList[itemstack.itemID] != null)
|
||||
- {
|
||||
- this.loadTexture("/terrain.png");
|
||||
+ // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug...
|
||||
+ if (var20 > 0 && shouldSpreadItems())
|
||||
+ if (l > 0 && shouldSpreadItems())
|
||||
+ {
|
||||
+ float x = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
|
||||
+ float y = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
|
||||
+ float z = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
|
||||
+ GL11.glTranslatef(x, y, var16 + var17);
|
||||
+ GL11.glTranslatef(x, y, f12 + f11);
|
||||
}
|
||||
else
|
||||
{
|
||||
- this.loadTexture("/gui/items.png");
|
||||
- }
|
||||
+ GL11.glTranslatef(0f, 0f, var16 + var17);
|
||||
+ GL11.glTranslatef(0f, 0f, f12 + f11);
|
||||
+ }
|
||||
+
|
||||
+ this.loadTexture(Item.itemsList[var18.itemID].getTextureFile());
|
||||
+ this.loadTexture(Item.itemsList[itemstack.itemID].getTextureFile());
|
||||
|
||||
GL11.glColor4f(par5, par6, par7, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(var8, var10, var11, var9, var12, var16);
|
||||
ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, f12);
|
||||
@@ -348,10 +315,10 @@
|
||||
float var13;
|
||||
float var16;
|
||||
float f1;
|
||||
float f2;
|
||||
|
||||
- if (var6 < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var6].getRenderType()))
|
||||
- if (k < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[k].getRenderType()))
|
||||
- {
|
||||
- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/terrain.png"));
|
||||
+ if (par3ItemStack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[par3ItemStack.itemID].getRenderType()))
|
||||
+ {
|
||||
Block var15 = Block.blocksList[var6];
|
||||
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(var15.getTextureFile()));
|
||||
Block block = Block.blocksList[k];
|
||||
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(block.getTextureFile()));
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)(par4 - 2), (float)(par5 + 3), -3.0F + this.zLevel);
|
||||
GL11.glScalef(10.0F, 10.0F, 10.0F);
|
||||
@@ -382,11 +349,11 @@
|
||||
if (Item.itemsList[var6].requiresMultipleRenderPasses())
|
||||
if (Item.itemsList[k].requiresMultipleRenderPasses())
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/gui/items.png"));
|
||||
-
|
||||
- for (var9 = 0; var9 <= 1; ++var9)
|
||||
- for (k1 = 0; k1 <= 1; ++k1)
|
||||
- {
|
||||
- var10 = Item.itemsList[var6].getIconFromDamageForRenderPass(var7, var9);
|
||||
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(Item.itemsList[var6].getTextureFile()));
|
||||
- j1 = Item.itemsList[k].getIconFromDamageForRenderPass(l, k1);
|
||||
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(Item.itemsList[k].getTextureFile()));
|
||||
+
|
||||
+ for (var9 = 0; var9 < Item.itemsList[var6].getRenderPasses(var7); ++var9)
|
||||
+ for (k1 = 0; k1 < Item.itemsList[k].getRenderPasses(l); ++k1)
|
||||
+ {
|
||||
+ var10 = Item.itemsList[var6].getIconIndex(par3ItemStack, var9);
|
||||
int var11 = Item.itemsList[var6].getColorFromItemStack(par3ItemStack, var9);
|
||||
var12 = (float)(var11 >> 16 & 255) / 255.0F;
|
||||
var13 = (float)(var11 >> 8 & 255) / 255.0F;
|
||||
+ j1 = Item.itemsList[k].getIconIndex(par3ItemStack, k1);
|
||||
int l1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, k1);
|
||||
f = (float)(l1 >> 16 & 255) / 255.0F;
|
||||
f1 = (float)(l1 >> 8 & 255) / 255.0F;
|
||||
@@ -406,14 +373,7 @@
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
- if (var6 < 256)
|
||||
- if (k < 256)
|
||||
- {
|
||||
- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/terrain.png"));
|
||||
- }
|
||||
@@ -215,8 +215,8 @@
|
||||
- }
|
||||
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(par3ItemStack.getItem().getTextureFile()));
|
||||
|
||||
var9 = Item.itemsList[var6].getColorFromItemStack(par3ItemStack, 0);
|
||||
float var17 = (float)(var9 >> 16 & 255) / 255.0F;
|
||||
k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0);
|
||||
float f4 = (float)(k1 >> 16 & 255) / 255.0F;
|
||||
@@ -440,7 +400,10 @@
|
||||
{
|
||||
if (par3ItemStack != null)
|
||||
@@ -255,27 +255,27 @@
|
||||
+
|
||||
+ public byte getMiniBlockCountForItemStack(ItemStack stack)
|
||||
+ {
|
||||
+ byte var13 = 1;
|
||||
+ byte b0 = 1;
|
||||
+ if (stack.stackSize > 1)
|
||||
+ {
|
||||
+ var13 = 2;
|
||||
+ b0 = 2;
|
||||
+ }
|
||||
+
|
||||
+ if (stack.stackSize > 5)
|
||||
+ {
|
||||
+ var13 = 3;
|
||||
+ b0 = 3;
|
||||
+ }
|
||||
+
|
||||
+ if (stack.stackSize > 20)
|
||||
+ {
|
||||
+ var13 = 4;
|
||||
+ b0 = 4;
|
||||
+ }
|
||||
+
|
||||
+ if (stack.stackSize > 40)
|
||||
+ {
|
||||
+ var13 = 5;
|
||||
+ b0 = 5;
|
||||
+ }
|
||||
+ return var13;
|
||||
+ return b0;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -286,24 +286,24 @@
|
||||
+ */
|
||||
+ public byte getMiniItemCountForItemStack(ItemStack stack)
|
||||
+ {
|
||||
+ byte var24;
|
||||
+ int var19 = stack.stackSize;
|
||||
+ if (var19 < 2)
|
||||
+ byte b0;
|
||||
+ int i = stack.stackSize;
|
||||
+ if (i < 2)
|
||||
+ {
|
||||
+ var24 = 1;
|
||||
+ b0 = 1;
|
||||
+ }
|
||||
+ else if (var19 < 16)
|
||||
+ else if (i < 16)
|
||||
+ {
|
||||
+ var24 = 2;
|
||||
+ b0 = 2;
|
||||
+ }
|
||||
+ else if (var19 < 32)
|
||||
+ else if (i < 32)
|
||||
+ {
|
||||
+ var24 = 3;
|
||||
+ b0 = 3;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ var24 = 4;
|
||||
+ b0 = 4;
|
||||
+ }
|
||||
+ return var24;
|
||||
+ return b0;
|
||||
+ }
|
||||
}
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
if (par4EntityLiving.isPlayerSleeping())
|
||||
{
|
||||
- int var7 = par1World.getBlockId(MathHelper.floor_double(par4EntityLiving.posX), MathHelper.floor_double(par4EntityLiving.posY), MathHelper.floor_double(par4EntityLiving.posZ));
|
||||
- int i = par1World.getBlockId(MathHelper.floor_double(par4EntityLiving.posX), MathHelper.floor_double(par4EntityLiving.posY), MathHelper.floor_double(par4EntityLiving.posZ));
|
||||
-
|
||||
- if (var7 == Block.bed.blockID)
|
||||
- if (i == Block.bed.blockID)
|
||||
+ int x = MathHelper.floor_double(par4EntityLiving.posX);
|
||||
+ int y = MathHelper.floor_double(par4EntityLiving.posY);
|
||||
+ int z = MathHelper.floor_double(par4EntityLiving.posZ);
|
||||
@@ -14,9 +14,9 @@
|
||||
+
|
||||
+ if (block != null && block.isBed(par1World, x, y, z, par4EntityLiving))
|
||||
{
|
||||
- int var8 = par1World.getBlockMetadata(MathHelper.floor_double(par4EntityLiving.posX), MathHelper.floor_double(par4EntityLiving.posY), MathHelper.floor_double(par4EntityLiving.posZ));
|
||||
- int var9 = var8 & 3;
|
||||
+ int var9 = block.getBedDirection(par1World, x, y, z);;
|
||||
this.playerViewY = (float)(var9 * 90 + 180);
|
||||
- int j = par1World.getBlockMetadata(MathHelper.floor_double(par4EntityLiving.posX), MathHelper.floor_double(par4EntityLiving.posY), MathHelper.floor_double(par4EntityLiving.posZ));
|
||||
- int k = j & 3;
|
||||
+ int k = block.getBedDirection(par1World, x, y, z);;
|
||||
this.playerViewY = (float)(k * 90 + 180);
|
||||
this.playerViewX = 0.0F;
|
||||
}
|
||||
@@ -28,66 +28,66 @@
|
||||
public RenderPlayer()
|
||||
{
|
||||
@@ -51,7 +60,7 @@
|
||||
if (var5 instanceof ItemArmor)
|
||||
if (item instanceof ItemArmor)
|
||||
{
|
||||
ItemArmor var6 = (ItemArmor)var5;
|
||||
- this.loadTexture("/armor/" + armorFilenamePrefix[var6.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png");
|
||||
+ this.loadTexture(ForgeHooksClient.getArmorTexture(var4, "/armor/" + armorFilenamePrefix[var6.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png"));
|
||||
ModelBiped var7 = par2 == 2 ? this.modelArmor : this.modelArmorChestplate;
|
||||
var7.bipedHead.showModel = par2 == 0;
|
||||
var7.bipedHeadwear.showModel = par2 == 0;
|
||||
ItemArmor itemarmor = (ItemArmor)item;
|
||||
- this.loadTexture("/armor/" + armorFilenamePrefix[itemarmor.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png");
|
||||
+ this.loadTexture(ForgeHooksClient.getArmorTexture(itemstack, "/armor/" + armorFilenamePrefix[itemarmor.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png"));
|
||||
ModelBiped modelbiped = par2 == 2 ? this.modelArmor : this.modelArmorChestplate;
|
||||
modelbiped.bipedHead.showModel = par2 == 0;
|
||||
modelbiped.bipedHeadwear.showModel = par2 == 0;
|
||||
@@ -120,7 +129,7 @@
|
||||
if (var5 instanceof ItemArmor)
|
||||
if (item instanceof ItemArmor)
|
||||
{
|
||||
ItemArmor var6 = (ItemArmor)var5;
|
||||
- this.loadTexture("/armor/" + armorFilenamePrefix[var6.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + "_b.png");
|
||||
+ this.loadTexture(ForgeHooksClient.getArmorTexture(var4, "/armor/" + armorFilenamePrefix[var6.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + "_b.png"));
|
||||
float var7 = 1.0F;
|
||||
GL11.glColor3f(var7, var7, var7);
|
||||
ItemArmor itemarmor = (ItemArmor)item;
|
||||
- this.loadTexture("/armor/" + armorFilenamePrefix[itemarmor.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + "_b.png");
|
||||
+ this.loadTexture(ForgeHooksClient.getArmorTexture(itemstack, "/armor/" + armorFilenamePrefix[itemarmor.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + "_b.png"));
|
||||
float f1 = 1.0F;
|
||||
GL11.glColor3f(f1, f1, f1);
|
||||
}
|
||||
@@ -172,7 +181,7 @@
|
||||
float var8 = 1.6F;
|
||||
float var9 = 0.016666668F * var8;
|
||||
double var10 = par1EntityPlayer.getDistanceSqToEntity(this.renderManager.livingPlayer);
|
||||
- float var12 = par1EntityPlayer.isSneaking() ? 32.0F : 64.0F;
|
||||
+ float var12 = par1EntityPlayer.isSneaking() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE;
|
||||
float f = 1.6F;
|
||||
float f1 = 0.016666668F * f;
|
||||
double d3 = par1EntityPlayer.getDistanceSqToEntity(this.renderManager.livingPlayer);
|
||||
- float f2 = par1EntityPlayer.isSneaking() ? 32.0F : 64.0F;
|
||||
+ float f2 = par1EntityPlayer.isSneaking() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE;
|
||||
|
||||
if (var10 < (double)(var12 * var12))
|
||||
if (d3 < (double)(f2 * f2))
|
||||
{
|
||||
@@ -239,9 +248,12 @@
|
||||
this.modelBipedMain.bipedHead.postRender(0.0625F);
|
||||
float var5;
|
||||
float f2;
|
||||
|
||||
- if (var4.getItem().itemID < 256)
|
||||
- if (itemstack.getItem().itemID < 256)
|
||||
- {
|
||||
- if (RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType()))
|
||||
+ if (var4 != null && var4.getItem() instanceof ItemBlock)
|
||||
- if (RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
+ if (itemstack != null && itemstack.getItem() instanceof ItemBlock)
|
||||
+ {
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var4, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, var4, BLOCK_3D));
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));
|
||||
+
|
||||
+ if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType()))
|
||||
+ if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
{
|
||||
var5 = 0.625F;
|
||||
f2 = 0.625F;
|
||||
GL11.glTranslatef(0.0F, -0.25F, 0.0F);
|
||||
@@ -359,7 +371,10 @@
|
||||
var23 = var21.getItemUseAction();
|
||||
enumaction = itemstack1.getItemUseAction();
|
||||
}
|
||||
|
||||
- if (var21.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var21.itemID].getRenderType()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var21, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, var21, BLOCK_3D));
|
||||
- if (itemstack1.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack1, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack1, BLOCK_3D));
|
||||
+
|
||||
+ if (var21.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[var21.itemID].getRenderType())))
|
||||
+ if (itemstack1.getItem() instanceof ItemBlock && (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack1.itemID].getRenderType())))
|
||||
{
|
||||
var7 = 0.5F;
|
||||
f3 = 0.5F;
|
||||
GL11.glTranslatef(0.0F, 0.1875F, -0.3125F);
|
||||
@@ -416,7 +431,7 @@
|
||||
|
||||
if (var21.getItem().requiresMultipleRenderPasses())
|
||||
if (itemstack1.getItem().requiresMultipleRenderPasses())
|
||||
{
|
||||
- for (var27 = 0; var27 <= 1; ++var27)
|
||||
+ for (var27 = 0; var27 < var21.getItem().getRenderPasses(var21.getItemDamage()); ++var27)
|
||||
- for (j = 0; j <= 1; ++j)
|
||||
+ for (j = 0; j < itemstack1.getItem().getRenderPasses(itemstack1.getItemDamage()); ++j)
|
||||
{
|
||||
int var26 = var21.getItem().getColorFromItemStack(var21, var27);
|
||||
var28 = (float)(var26 >> 16 & 255) / 255.0F;
|
||||
int k = itemstack1.getItem().getColorFromItemStack(itemstack1, j);
|
||||
f12 = (float)(k >> 16 & 255) / 255.0F;
|
||||
@@ -17,19 +17,19 @@
|
||||
public class RenderSnowMan extends RenderLiving
|
||||
@@ -31,12 +37,15 @@
|
||||
super.renderEquippedItems(par1EntitySnowman, par2);
|
||||
ItemStack var3 = new ItemStack(Block.pumpkin, 1);
|
||||
ItemStack itemstack = new ItemStack(Block.pumpkin, 1);
|
||||
|
||||
- if (var3 != null && var3.getItem().itemID < 256)
|
||||
+ if (var3 != null && var3.getItem() instanceof ItemBlock)
|
||||
- if (itemstack != null && itemstack.getItem().itemID < 256)
|
||||
+ if (itemstack != null && itemstack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
this.snowmanModel.head.postRender(0.0625F);
|
||||
|
||||
- if (RenderBlocks.renderItemIn3d(Block.blocksList[var3.itemID].getRenderType()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(var3, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, var3, BLOCK_3D));
|
||||
- if (RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
+ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
|
||||
+ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));
|
||||
+
|
||||
+ if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[var3.itemID].getRenderType()))
|
||||
+ if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
{
|
||||
float var4 = 0.625F;
|
||||
float f1 = 0.625F;
|
||||
GL11.glTranslatef(0.0F, -0.34375F, 0.0F);
|
||||
+7
-7
@@ -13,15 +13,15 @@
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
|
||||
+ ForgeHooksClient.beforeBlockRender(var9, blockRenderer);
|
||||
var10.startDrawingQuads();
|
||||
var10.setTranslation((double)((float)par2 - (float)par1TileEntityPiston.xCoord + par1TileEntityPiston.getOffsetX(par8)), (double)((float)par4 - (float)par1TileEntityPiston.yCoord + par1TileEntityPiston.getOffsetY(par8)), (double)((float)par6 - (float)par1TileEntityPiston.zCoord + par1TileEntityPiston.getOffsetZ(par8)));
|
||||
var10.setColorOpaque(1, 1, 1);
|
||||
+ ForgeHooksClient.beforeBlockRender(block, blockRenderer);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setTranslation((double)((float)par2 - (float)par1TileEntityPiston.xCoord + par1TileEntityPiston.getOffsetX(par8)), (double)((float)par4 - (float)par1TileEntityPiston.yCoord + par1TileEntityPiston.getOffsetY(par8)), (double)((float)par6 - (float)par1TileEntityPiston.zCoord + par1TileEntityPiston.getOffsetZ(par8)));
|
||||
tessellator.setColorOpaque(1, 1, 1);
|
||||
@@ -64,6 +67,7 @@
|
||||
|
||||
var10.setTranslation(0.0D, 0.0D, 0.0D);
|
||||
var10.draw();
|
||||
+ ForgeHooksClient.afterBlockRender(var9, blockRenderer);
|
||||
tessellator.setTranslation(0.0D, 0.0D, 0.0D);
|
||||
tessellator.draw();
|
||||
+ ForgeHooksClient.afterBlockRender(block, blockRenderer);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,9 @@
|
||||
/** Map of Strings to the ICommand objects they represent */
|
||||
@@ -40,6 +43,16 @@
|
||||
|
||||
if (var5.canCommandSenderUseCommand(par1ICommandSender))
|
||||
if (icommand.canCommandSenderUseCommand(par1ICommandSender))
|
||||
{
|
||||
+ CommandEvent event = new CommandEvent(var5, par1ICommandSender, var3);
|
||||
+ CommandEvent event = new CommandEvent(icommand, par1ICommandSender, astring);
|
||||
+ if (MinecraftForge.EVENT_BUS.post(event))
|
||||
+ {
|
||||
+ if (event.exception != null)
|
||||
@@ -24,6 +24,6 @@
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (var6 > -1)
|
||||
if (i > -1)
|
||||
{
|
||||
EntityPlayerMP[] var7 = PlayerSelector.matchPlayers(par1ICommandSender, var3[var6]);
|
||||
EntityPlayerMP[] aentityplayermp = PlayerSelector.matchPlayers(par1ICommandSender, astring[i]);
|
||||
@@ -55,23 +55,23 @@
|
||||
|
||||
@@ -149,11 +172,41 @@
|
||||
{
|
||||
Item var5 = var2[var4];
|
||||
Item item = aitem[j];
|
||||
|
||||
- if (var5 != null && var5.getCreativeTab() == this)
|
||||
- if (item != null && item.getCreativeTab() == this)
|
||||
- {
|
||||
- var5.getSubItems(var5.itemID, this, par1List);
|
||||
- item.getSubItems(item.itemID, this, par1List);
|
||||
- }
|
||||
- }
|
||||
+ if (var5 == null)
|
||||
+ if (item == null)
|
||||
+ {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ for(CreativeTabs tab : var5.getCreativeTabs())
|
||||
+ for(CreativeTabs tab : item.getCreativeTabs())
|
||||
+ {
|
||||
+ if (tab == this)
|
||||
+ {
|
||||
+ var5.getSubItems(var5.itemID, this, par1List);
|
||||
+ item.getSubItems(item.itemID, this, par1List);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
@@ -37,4 +37,4 @@
|
||||
+
|
||||
static
|
||||
{
|
||||
ArrayList var0 = new ArrayList();
|
||||
ArrayList arraylist = new ArrayList();
|
||||
@@ -2,10 +2,10 @@
|
||||
+++ ../src_work/minecraft/net/minecraft/enchantment/EnchantmentHelper.java
|
||||
@@ -463,7 +463,7 @@
|
||||
{
|
||||
Enchantment var8 = var5[var7];
|
||||
Enchantment enchantment = aenchantment[k];
|
||||
|
||||
- if (var8 != null && (var8.type.canEnchantItem(var2) || var4))
|
||||
+ if (var8 != null && (var8.canApplyAtEnchantingTable(par1ItemStack) || var4))
|
||||
- if (enchantment != null && (enchantment.type.canEnchantItem(item) || flag))
|
||||
+ if (enchantment != null && (enchantment.canApplyAtEnchantingTable(par1ItemStack) || flag))
|
||||
{
|
||||
for (int var9 = var8.getMinLevel(); var9 <= var8.getMaxLevel(); ++var9)
|
||||
for (int l = enchantment.getMinLevel(); l <= enchantment.getMaxLevel(); ++l)
|
||||
{
|
||||
@@ -57,16 +57,16 @@
|
||||
|
||||
this.firstUpdate = false;
|
||||
@@ -847,6 +862,8 @@
|
||||
par5 = var27;
|
||||
this.boundingBox.setBB(var29);
|
||||
par5 = d11;
|
||||
this.boundingBox.setBB(axisalignedbb1);
|
||||
}
|
||||
+ /* Fixes a vanilla bug where the player view would dip when stepping between certain blocks
|
||||
+ * https://mojang.atlassian.net/browse/MC-1594
|
||||
else
|
||||
{
|
||||
double var40 = this.boundingBox.minY - (double)((int)this.boundingBox.minY);
|
||||
double d13 = this.boundingBox.minY - (double)((int)this.boundingBox.minY);
|
||||
@@ -856,6 +873,7 @@
|
||||
this.ySize = (float)((double)this.ySize + var40 + 0.01D);
|
||||
this.ySize = (float)((double)this.ySize + d13 + 0.01D);
|
||||
}
|
||||
}
|
||||
+ */
|
||||
@@ -88,7 +88,7 @@
|
||||
+ }
|
||||
this.writeEntityToNBT(par1NBTTagCompound);
|
||||
}
|
||||
catch (Throwable var5)
|
||||
catch (Throwable throwable)
|
||||
@@ -1568,6 +1595,14 @@
|
||||
this.timeUntilPortal = par1NBTTagCompound.getInteger("PortalCooldown");
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
@@ -103,21 +103,21 @@
|
||||
+ }
|
||||
this.readEntityFromNBT(par1NBTTagCompound);
|
||||
}
|
||||
catch (Throwable var5)
|
||||
catch (Throwable throwable)
|
||||
@@ -1662,7 +1697,14 @@
|
||||
{
|
||||
EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY + (double)par2, this.posZ, par1ItemStack);
|
||||
var3.delayBeforeCanPickup = 10;
|
||||
- this.worldObj.spawnEntityInWorld(var3);
|
||||
EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double)par2, this.posZ, par1ItemStack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
- this.worldObj.spawnEntityInWorld(entityitem);
|
||||
+ if (captureDrops)
|
||||
+ {
|
||||
+ capturedDrops.add(var3);
|
||||
+ capturedDrops.add(entityitem);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ this.worldObj.spawnEntityInWorld(var3);
|
||||
+ this.worldObj.spawnEntityInWorld(entityitem);
|
||||
+ }
|
||||
return var3;
|
||||
return entityitem;
|
||||
}
|
||||
|
||||
@@ -2021,7 +2063,7 @@
|
||||
|
||||
@@ -81,17 +81,17 @@
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
Entity var2 = par1DamageSource.getEntity();
|
||||
Entity entity = par1DamageSource.getEntity();
|
||||
|
||||
if (this.scoreValue >= 0 && var2 != null)
|
||||
if (this.scoreValue >= 0 && entity != null)
|
||||
@@ -1274,6 +1302,10 @@
|
||||
{
|
||||
var3 = EnchantmentHelper.getLootingModifier((EntityLiving)var2);
|
||||
i = EnchantmentHelper.getLootingModifier((EntityLiving)entity);
|
||||
}
|
||||
+
|
||||
+ captureDrops = true;
|
||||
+ capturedDrops.clear();
|
||||
+ int var4 = 0;
|
||||
+ int j = 0;
|
||||
|
||||
if (!this.isChild() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot"))
|
||||
{
|
||||
@@ -99,10 +99,10 @@
|
||||
|
||||
if (this.recentlyHit > 0)
|
||||
{
|
||||
- int var4 = this.rand.nextInt(200) - var3;
|
||||
+ var4 = this.rand.nextInt(200) - var3;
|
||||
- int j = this.rand.nextInt(200) - i;
|
||||
+ j = this.rand.nextInt(200) - i;
|
||||
|
||||
if (var4 < 5)
|
||||
if (j < 5)
|
||||
{
|
||||
@@ -1290,6 +1322,16 @@
|
||||
}
|
||||
@@ -111,7 +111,7 @@
|
||||
+
|
||||
+ captureDrops = false;
|
||||
+
|
||||
+ if (!ForgeHooks.onLivingDrops(this, par1DamageSource, capturedDrops, var3, recentlyHit > 0, var4))
|
||||
+ if (!ForgeHooks.onLivingDrops(this, par1DamageSource, capturedDrops, i, recentlyHit > 0, j))
|
||||
+ {
|
||||
+ for (EntityItem item : capturedDrops)
|
||||
+ {
|
||||
@@ -132,14 +132,14 @@
|
||||
+ }
|
||||
+
|
||||
super.fall(par1);
|
||||
int var2 = MathHelper.ceiling_float_int(par1 - 3.0F);
|
||||
int i = MathHelper.ceiling_float_int(par1 - 3.0F);
|
||||
|
||||
@@ -1536,7 +1584,7 @@
|
||||
int var2 = MathHelper.floor_double(this.boundingBox.minY);
|
||||
int var3 = MathHelper.floor_double(this.posZ);
|
||||
int var4 = this.worldObj.getBlockId(var1, var2, var3);
|
||||
- return var4 == Block.ladder.blockID || var4 == Block.vine.blockID;
|
||||
+ return ForgeHooks.isLivingOnLadder(Block.blocksList[var4], worldObj, var1, var2, var3);
|
||||
int j = MathHelper.floor_double(this.boundingBox.minY);
|
||||
int k = MathHelper.floor_double(this.posZ);
|
||||
int l = this.worldObj.getBlockId(i, j, k);
|
||||
- return l == Block.ladder.blockID || l == Block.vine.blockID;
|
||||
+ return ForgeHooks.isLivingOnLadder(Block.blocksList[l], worldObj, i, j, k);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
--- ../src_base/minecraft/net/minecraft/entity/boss/EntityDragon.java
|
||||
+++ ../src_work/minecraft/net/minecraft/entity/boss/EntityDragon.java
|
||||
@@ -530,10 +530,11 @@
|
||||
for (int var12 = var4; var12 <= var7; ++var12)
|
||||
for (int i2 = k; i2 <= j1; ++i2)
|
||||
{
|
||||
int var13 = this.worldObj.getBlockId(var10, var11, var12);
|
||||
int j2 = this.worldObj.getBlockId(k1, l1, i2);
|
||||
-
|
||||
- if (var13 != 0)
|
||||
+ Block block = Block.blocksList[var13];
|
||||
- if (j2 != 0)
|
||||
+ Block block = Block.blocksList[j2];
|
||||
+
|
||||
+ if (block != null)
|
||||
{
|
||||
- if (var13 != Block.obsidian.blockID && var13 != Block.whiteStone.blockID && var13 != Block.bedrock.blockID)
|
||||
+ if (block.canDragonDestroy(worldObj, var10, var11, var12))
|
||||
- if (j2 != Block.obsidian.blockID && j2 != Block.whiteStone.blockID && j2 != Block.bedrock.blockID)
|
||||
+ if (block.canDragonDestroy(worldObj, k1, l1, i2))
|
||||
{
|
||||
var9 = true;
|
||||
this.worldObj.setBlockWithNotify(var10, var11, var12, 0);
|
||||
flag1 = true;
|
||||
this.worldObj.setBlockWithNotify(k1, l1, i2, 0);
|
||||
@@ -72,8 +72,8 @@
|
||||
if (this.func_92014_d() != null)
|
||||
{
|
||||
@@ -280,10 +314,17 @@
|
||||
NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("Item");
|
||||
this.func_92013_a(ItemStack.loadItemStackFromNBT(var2));
|
||||
NBTTagCompound nbttagcompound1 = par1NBTTagCompound.getCompoundTag("Item");
|
||||
this.func_92013_a(ItemStack.loadItemStackFromNBT(nbttagcompound1));
|
||||
|
||||
- if (this.func_92014_d() == null)
|
||||
+ ItemStack item = getDataWatcher().getWatchableObjectItemStack(10);
|
||||
@@ -106,11 +106,11 @@
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
ItemStack var2 = this.func_92014_d();
|
||||
int var3 = var2.stackSize;
|
||||
ItemStack itemstack = this.func_92014_d();
|
||||
int i = itemstack.stackSize;
|
||||
|
||||
- if (this.delayBeforeCanPickup == 0 && par1EntityPlayer.inventory.addItemStackToInventory(var2))
|
||||
+ if (this.delayBeforeCanPickup <= 0 && (event.getResult() == Result.ALLOW || var3 <= 0 || par1EntityPlayer.inventory.addItemStackToInventory(var2)))
|
||||
- if (this.delayBeforeCanPickup == 0 && par1EntityPlayer.inventory.addItemStackToInventory(itemstack))
|
||||
+ if (this.delayBeforeCanPickup <= 0 && (event.getResult() == Result.ALLOW || i <= 0 || par1EntityPlayer.inventory.addItemStackToInventory(itemstack)))
|
||||
{
|
||||
if (var2.itemID == Block.wood.blockID)
|
||||
if (itemstack.itemID == Block.wood.blockID)
|
||||
{
|
||||
@@ -105,34 +105,34 @@
|
||||
-
|
||||
- if (this.minecartType == 1)
|
||||
- {
|
||||
- EntityMinecart var3 = this;
|
||||
- EntityMinecart entityminecart = this;
|
||||
-
|
||||
- for (int var4 = 0; var4 < var3.getSizeInventory(); ++var4)
|
||||
- for (int j = 0; j < entityminecart.getSizeInventory(); ++j)
|
||||
- {
|
||||
- ItemStack var5 = var3.getStackInSlot(var4);
|
||||
- ItemStack itemstack = entityminecart.getStackInSlot(j);
|
||||
-
|
||||
- if (var5 != null)
|
||||
- if (itemstack != null)
|
||||
- {
|
||||
- float var6 = this.rand.nextFloat() * 0.8F + 0.1F;
|
||||
- float var7 = this.rand.nextFloat() * 0.8F + 0.1F;
|
||||
- float var8 = this.rand.nextFloat() * 0.8F + 0.1F;
|
||||
- float f = this.rand.nextFloat() * 0.8F + 0.1F;
|
||||
- float f1 = this.rand.nextFloat() * 0.8F + 0.1F;
|
||||
- float f2 = this.rand.nextFloat() * 0.8F + 0.1F;
|
||||
-
|
||||
- while (var5.stackSize > 0)
|
||||
- while (itemstack.stackSize > 0)
|
||||
- {
|
||||
- int var9 = this.rand.nextInt(21) + 10;
|
||||
- int k = this.rand.nextInt(21) + 10;
|
||||
-
|
||||
- if (var9 > var5.stackSize)
|
||||
- if (k > itemstack.stackSize)
|
||||
- {
|
||||
- var9 = var5.stackSize;
|
||||
- k = itemstack.stackSize;
|
||||
- }
|
||||
-
|
||||
- var5.stackSize -= var9;
|
||||
- EntityItem var10 = new EntityItem(this.worldObj, this.posX + (double)var6, this.posY + (double)var7, this.posZ + (double)var8, new ItemStack(var5.itemID, var9, var5.getItemDamage()));
|
||||
- float var11 = 0.05F;
|
||||
- var10.motionX = (double)((float)this.rand.nextGaussian() * var11);
|
||||
- var10.motionY = (double)((float)this.rand.nextGaussian() * var11 + 0.2F);
|
||||
- var10.motionZ = (double)((float)this.rand.nextGaussian() * var11);
|
||||
- this.worldObj.spawnEntityInWorld(var10);
|
||||
- itemstack.stackSize -= k;
|
||||
- EntityItem entityitem = new EntityItem(this.worldObj, this.posX + (double)f, this.posY + (double)f1, this.posZ + (double)f2, new ItemStack(itemstack.itemID, k, itemstack.getItemDamage()));
|
||||
- float f3 = 0.05F;
|
||||
- entityitem.motionX = (double)((float)this.rand.nextGaussian() * f3);
|
||||
- entityitem.motionY = (double)((float)this.rand.nextGaussian() * f3 + 0.2F);
|
||||
- entityitem.motionZ = (double)((float)this.rand.nextGaussian() * f3);
|
||||
- this.worldObj.spawnEntityInWorld(entityitem);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
@@ -157,104 +157,104 @@
|
||||
this.worldObj.spawnParticle("largesmoke", this.posX, this.posY + 0.8D, this.posZ, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
@@ -418,18 +423,18 @@
|
||||
double var6 = 0.0078125D;
|
||||
int var8 = this.worldObj.getBlockId(var45, var2, var47);
|
||||
double d5 = 0.0078125D;
|
||||
int l = this.worldObj.getBlockId(d45, i, d47);
|
||||
|
||||
- if (BlockRail.isRailBlock(var8))
|
||||
+ if (canUseRail() && BlockRail.isRailBlock(var8))
|
||||
- if (BlockRail.isRailBlock(l))
|
||||
+ if (canUseRail() && BlockRail.isRailBlock(l))
|
||||
{
|
||||
this.fallDistance = 0.0F;
|
||||
Vec3 var9 = this.func_70489_a(this.posX, this.posY, this.posZ);
|
||||
- int var10 = this.worldObj.getBlockMetadata(var45, var2, var47);
|
||||
+ int var10 = ((BlockRail)Block.blocksList[var8]).getBasicRailMetadata(worldObj, this, var45, var2, var47);
|
||||
this.posY = (double)var2;
|
||||
boolean var11 = false;
|
||||
boolean var12 = false;
|
||||
Vec3 vec3 = this.func_70489_a(this.posX, this.posY, this.posZ);
|
||||
- int i1 = this.worldObj.getBlockMetadata(d45, i, d47);
|
||||
+ int i1 = ((BlockRail)Block.blocksList[l]).getBasicRailMetadata(worldObj, this, d45, i, d47);
|
||||
this.posY = (double)i;
|
||||
boolean flag = false;
|
||||
boolean flag1 = false;
|
||||
|
||||
if (var8 == Block.railPowered.blockID)
|
||||
if (l == Block.railPowered.blockID)
|
||||
{
|
||||
- var11 = (var10 & 8) != 0;
|
||||
+ var11 = (worldObj.getBlockMetadata(var45, var2, var47) & 8) != 0;
|
||||
var12 = !var11;
|
||||
- flag = (i1 & 8) != 0;
|
||||
+ flag = (worldObj.getBlockMetadata(d45, i, d47) & 8) != 0;
|
||||
flag1 = !flag;
|
||||
}
|
||||
|
||||
@@ -443,25 +448,7 @@
|
||||
this.posY = (double)(var2 + 1);
|
||||
this.posY = (double)(i + 1);
|
||||
}
|
||||
|
||||
- if (var10 == 2)
|
||||
- if (i1 == 2)
|
||||
- {
|
||||
- this.motionX -= var6;
|
||||
- this.motionX -= d5;
|
||||
- }
|
||||
-
|
||||
- if (var10 == 3)
|
||||
- if (i1 == 3)
|
||||
- {
|
||||
- this.motionX += var6;
|
||||
- this.motionX += d5;
|
||||
- }
|
||||
-
|
||||
- if (var10 == 4)
|
||||
- if (i1 == 4)
|
||||
- {
|
||||
- this.motionZ += var6;
|
||||
- this.motionZ += d5;
|
||||
- }
|
||||
-
|
||||
- if (var10 == 5)
|
||||
- if (i1 == 5)
|
||||
- {
|
||||
- this.motionZ -= var6;
|
||||
- this.motionZ -= d5;
|
||||
- }
|
||||
+ adjustSlopeVelocities(var10);
|
||||
+ adjustSlopeVelocities(i1);
|
||||
|
||||
int[][] var13 = matrix[var10];
|
||||
double var14 = (double)(var13[1][0] - var13[0][0]);
|
||||
int[][] aint = matrix[i1];
|
||||
double d6 = (double)(aint[1][0] - aint[0][0]);
|
||||
@@ -494,7 +481,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (var12)
|
||||
+ if (var12 && shouldDoRailFunctions())
|
||||
- if (flag1)
|
||||
+ if (flag1 && shouldDoRailFunctions())
|
||||
{
|
||||
var24 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
d11 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
|
||||
@@ -542,36 +529,8 @@
|
||||
this.posX = var26 + var14 * var24;
|
||||
this.posZ = var28 + var16 * var24;
|
||||
this.posX = d12 + d6 * d11;
|
||||
this.posZ = d13 + d7 * d11;
|
||||
this.setPosition(this.posX, this.posY + (double)this.yOffset, this.posZ);
|
||||
- var34 = this.motionX;
|
||||
- var36 = this.motionZ;
|
||||
- d16 = this.motionX;
|
||||
- d17 = this.motionZ;
|
||||
-
|
||||
- if (this.riddenByEntity != null)
|
||||
- {
|
||||
- var34 *= 0.75D;
|
||||
- var36 *= 0.75D;
|
||||
- d16 *= 0.75D;
|
||||
- d17 *= 0.75D;
|
||||
- }
|
||||
-
|
||||
- if (var34 < -var4)
|
||||
- if (d16 < -d4)
|
||||
- {
|
||||
- var34 = -var4;
|
||||
- d16 = -d4;
|
||||
- }
|
||||
-
|
||||
- if (var34 > var4)
|
||||
- if (d16 > d4)
|
||||
- {
|
||||
- var34 = var4;
|
||||
- d16 = d4;
|
||||
- }
|
||||
-
|
||||
- if (var36 < -var4)
|
||||
- if (d17 < -d4)
|
||||
- {
|
||||
- var36 = -var4;
|
||||
- d17 = -d4;
|
||||
- }
|
||||
-
|
||||
- if (var36 > var4)
|
||||
- if (d17 > d4)
|
||||
- {
|
||||
- var36 = var4;
|
||||
- d17 = d4;
|
||||
- }
|
||||
-
|
||||
- this.moveEntity(var34, 0.0D, var36);
|
||||
- this.moveEntity(d16, 0.0D, d17);
|
||||
+
|
||||
+ moveMinecartOnRail(var45, var2, var47);
|
||||
+ moveMinecartOnRail(d45, i, d47);
|
||||
|
||||
if (var13[0][1] != 0 && MathHelper.floor_double(this.posX) - var45 == var13[0][0] && MathHelper.floor_double(this.posZ) - var47 == var13[0][2])
|
||||
if (aint[0][1] != 0 && MathHelper.floor_double(this.posX) - d45 == aint[0][0] && MathHelper.floor_double(this.posZ) - d47 == aint[0][2])
|
||||
{
|
||||
@@ -582,42 +541,7 @@
|
||||
this.setPosition(this.posX, this.posY + (double)var13[1][1], this.posZ);
|
||||
this.setPosition(this.posX, this.posY + (double)aint[1][1], this.posZ);
|
||||
}
|
||||
|
||||
- if (this.riddenByEntity != null)
|
||||
@@ -267,19 +267,19 @@
|
||||
- {
|
||||
- if (this.minecartType == 2)
|
||||
- {
|
||||
- double var38 = this.pushX * this.pushX + this.pushZ * this.pushZ;
|
||||
- double d18 = this.pushX * this.pushX + this.pushZ * this.pushZ;
|
||||
-
|
||||
- if (var38 > 1.0E-4D)
|
||||
- if (d18 > 1.0E-4D)
|
||||
- {
|
||||
- var38 = (double)MathHelper.sqrt_double(var38);
|
||||
- this.pushX /= var38;
|
||||
- this.pushZ /= var38;
|
||||
- double var40 = 0.04D;
|
||||
- d18 = (double)MathHelper.sqrt_double(d18);
|
||||
- this.pushX /= d18;
|
||||
- this.pushZ /= d18;
|
||||
- double d19 = 0.04D;
|
||||
- this.motionX *= 0.800000011920929D;
|
||||
- this.motionY *= 0.0D;
|
||||
- this.motionZ *= 0.800000011920929D;
|
||||
- this.motionX += this.pushX * var40;
|
||||
- this.motionZ += this.pushZ * var40;
|
||||
- this.motionX += this.pushX * d19;
|
||||
- this.motionZ += this.pushZ * d19;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
@@ -295,21 +295,21 @@
|
||||
- }
|
||||
+ applyDragAndPushForces();
|
||||
|
||||
Vec3 var54 = this.func_70489_a(this.posX, this.posY, this.posZ);
|
||||
Vec3 vec31 = this.func_70489_a(this.posX, this.posY, this.posZ);
|
||||
|
||||
@@ -647,30 +571,14 @@
|
||||
|
||||
double var41;
|
||||
double d21;
|
||||
|
||||
- if (this.minecartType == 2)
|
||||
- {
|
||||
- var41 = this.pushX * this.pushX + this.pushZ * this.pushZ;
|
||||
- d21 = this.pushX * this.pushX + this.pushZ * this.pushZ;
|
||||
-
|
||||
- if (var41 > 1.0E-4D && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.001D)
|
||||
- if (d21 > 1.0E-4D && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.001D)
|
||||
- {
|
||||
- var41 = (double)MathHelper.sqrt_double(var41);
|
||||
- this.pushX /= var41;
|
||||
- this.pushZ /= var41;
|
||||
- d21 = (double)MathHelper.sqrt_double(d21);
|
||||
- this.pushX /= d21;
|
||||
- this.pushZ /= d21;
|
||||
-
|
||||
- if (this.pushX * this.motionX + this.pushZ * this.motionZ < 0.0D)
|
||||
- {
|
||||
@@ -324,40 +324,40 @@
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (var11)
|
||||
- if (flag)
|
||||
+ updatePushForces();
|
||||
+
|
||||
+ if(shouldDoRailFunctions())
|
||||
+ {
|
||||
+ ((BlockRail)Block.blocksList[var8]).onMinecartPass(worldObj, this, var45, var2, var47);
|
||||
+ ((BlockRail)Block.blocksList[l]).onMinecartPass(worldObj, this, d45, i, d47);
|
||||
+ }
|
||||
+
|
||||
+ if (var11 && shouldDoRailFunctions())
|
||||
+ if (flag && shouldDoRailFunctions())
|
||||
{
|
||||
var41 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
d21 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
|
||||
@@ -706,41 +614,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- if (this.motionX < -var4)
|
||||
- if (this.motionX < -d4)
|
||||
- {
|
||||
- this.motionX = -var4;
|
||||
- this.motionX = -d4;
|
||||
- }
|
||||
-
|
||||
- if (this.motionX > var4)
|
||||
- if (this.motionX > d4)
|
||||
- {
|
||||
- this.motionX = var4;
|
||||
- this.motionX = d4;
|
||||
- }
|
||||
-
|
||||
- if (this.motionZ < -var4)
|
||||
- if (this.motionZ < -d4)
|
||||
- {
|
||||
- this.motionZ = -var4;
|
||||
- this.motionZ = -d4;
|
||||
- }
|
||||
-
|
||||
- if (this.motionZ > var4)
|
||||
- if (this.motionZ > d4)
|
||||
- {
|
||||
- this.motionZ = var4;
|
||||
- this.motionZ = d4;
|
||||
- }
|
||||
-
|
||||
- if (this.onGround)
|
||||
@@ -375,7 +375,7 @@
|
||||
- this.motionY *= 0.949999988079071D;
|
||||
- this.motionZ *= 0.949999988079071D;
|
||||
- }
|
||||
+ moveMinecartOffRail(var45, var2, var47);
|
||||
+ moveMinecartOffRail(d45, i, d47);
|
||||
}
|
||||
|
||||
this.doBlockCollisions();
|
||||
@@ -383,7 +383,7 @@
|
||||
}
|
||||
|
||||
this.setRotation(this.rotationYaw, this.rotationPitch);
|
||||
- List var15 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
||||
- List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
||||
+
|
||||
+ AxisAlignedBB box = null;
|
||||
+ if (getCollisionHandler() != null)
|
||||
@@ -395,9 +395,9 @@
|
||||
+ box = boundingBox.expand(0.2D, 0.0D, 0.2D);
|
||||
+ }
|
||||
+
|
||||
+ List var15 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, box);
|
||||
+ List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, box);
|
||||
|
||||
if (var15 != null && !var15.isEmpty())
|
||||
if (list != null && !list.isEmpty())
|
||||
{
|
||||
@@ -792,17 +677,8 @@
|
||||
this.riddenByEntity = null;
|
||||
@@ -415,7 +415,7 @@
|
||||
-
|
||||
- this.setMinecartPowered(this.fuel > 0);
|
||||
+ updateFuel();
|
||||
+ MinecraftForge.EVENT_BUS.post(new MinecartUpdateEvent(this, var45, var2, var47));
|
||||
+ MinecraftForge.EVENT_BUS.post(new MinecartUpdateEvent(this, d45, i, d47));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,30 +423,30 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- int var13 = this.worldObj.getBlockMetadata(var9, var10, var11);
|
||||
- int i1 = this.worldObj.getBlockMetadata(i, j, k);
|
||||
-
|
||||
- if (((BlockRail)Block.blocksList[var12]).isPowered())
|
||||
- if (((BlockRail)Block.blocksList[l]).isPowered())
|
||||
- {
|
||||
- var13 &= 7;
|
||||
- i1 &= 7;
|
||||
- }
|
||||
+ int var13 = ((BlockRail)Block.blocksList[var12]).getBasicRailMetadata(worldObj, this, var9, var10, var11);
|
||||
+ int i1 = ((BlockRail)Block.blocksList[l]).getBasicRailMetadata(worldObj, this, i, j, k);
|
||||
|
||||
par3 = (double)var10;
|
||||
par3 = (double)j;
|
||||
|
||||
@@ -877,13 +748,8 @@
|
||||
|
||||
if (BlockRail.isRailBlock(var10))
|
||||
if (BlockRail.isRailBlock(l))
|
||||
{
|
||||
- int var11 = this.worldObj.getBlockMetadata(var7, var8, var9);
|
||||
+ int var11 = ((BlockRail)Block.blocksList[var10]).getBasicRailMetadata(worldObj, this, var7, var8, var9);
|
||||
par3 = (double)var8;
|
||||
- int i1 = this.worldObj.getBlockMetadata(i, j, k);
|
||||
+ int i1 = ((BlockRail)Block.blocksList[l]).getBasicRailMetadata(worldObj, this, i, j, k);
|
||||
par3 = (double)j;
|
||||
-
|
||||
- if (((BlockRail)Block.blocksList[var10]).isPowered())
|
||||
- if (((BlockRail)Block.blocksList[l]).isPowered())
|
||||
- {
|
||||
- var11 &= 7;
|
||||
- i1 &= 7;
|
||||
- }
|
||||
|
||||
if (var11 >= 2 && var11 <= 5)
|
||||
if (i1 >= 2 && i1 <= 5)
|
||||
{
|
||||
@@ -948,13 +814,14 @@
|
||||
{
|
||||
@@ -465,7 +465,7 @@
|
||||
+
|
||||
+ if (getSizeInventory() > 0)
|
||||
{
|
||||
NBTTagList var2 = new NBTTagList();
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
@@ -980,13 +847,21 @@
|
||||
{
|
||||
@@ -491,7 +491,7 @@
|
||||
+
|
||||
+ if (getSizeInventory() > 0)
|
||||
{
|
||||
NBTTagList var2 = par1NBTTagCompound.getTagList("Items");
|
||||
NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items");
|
||||
this.cargoItems = new ItemStack[this.getSizeInventory()];
|
||||
@@ -1015,11 +890,17 @@
|
||||
*/
|
||||
@@ -513,8 +513,8 @@
|
||||
par1Entity.mountEntity(this);
|
||||
}
|
||||
@@ -1065,7 +946,7 @@
|
||||
double var18 = par1Entity.motionX + this.motionX;
|
||||
double var20 = par1Entity.motionZ + this.motionZ;
|
||||
double d7 = par1Entity.motionX + this.motionX;
|
||||
double d8 = par1Entity.motionZ + this.motionZ;
|
||||
|
||||
- if (((EntityMinecart)par1Entity).minecartType == 2 && this.minecartType != 2)
|
||||
+ if (((EntityMinecart)par1Entity).isPoweredCart() && !isPoweredCart())
|
||||
@@ -568,7 +568,7 @@
|
||||
- else if (this.minecartType == 2)
|
||||
+ else if (this.minecartType == 2 && getClass() == EntityMinecart.class)
|
||||
{
|
||||
ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem();
|
||||
ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem();
|
||||
|
||||
@@ -1354,4 +1240,375 @@
|
||||
{
|
||||
|
||||
@@ -17,20 +17,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (var2 != null && var2.itemID == Item.shears.itemID && this.getGrowingAge() >= 0)
|
||||
- if (itemstack != null && itemstack.itemID == Item.shears.itemID && this.getGrowingAge() >= 0)
|
||||
- {
|
||||
- this.setDead();
|
||||
- this.worldObj.spawnParticle("largeexplode", this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D);
|
||||
-
|
||||
- if (!this.worldObj.isRemote)
|
||||
- {
|
||||
- EntityCow var3 = new EntityCow(this.worldObj);
|
||||
- var3.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
|
||||
- var3.setEntityHealth(this.getHealth());
|
||||
- var3.renderYawOffset = this.renderYawOffset;
|
||||
- this.worldObj.spawnEntityInWorld(var3);
|
||||
- EntityCow entitycow = new EntityCow(this.worldObj);
|
||||
- entitycow.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
|
||||
- entitycow.setEntityHealth(this.getHealth());
|
||||
- entitycow.renderYawOffset = this.renderYawOffset;
|
||||
- this.worldObj.spawnEntityInWorld(entitycow);
|
||||
-
|
||||
- for (int var4 = 0; var4 < 5; ++var4)
|
||||
- for (int i = 0; i < 5; ++i)
|
||||
- {
|
||||
- this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY + (double)this.height, this.posZ, new ItemStack(Block.mushroomRed)));
|
||||
- }
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
@@ -355,8 +355,9 @@
|
||||
}
|
||||
|
||||
int var4 = this.worldObj.getBlockId(var1, var2 - 1, var3);
|
||||
int l = this.worldObj.getBlockId(i, j - 1, k);
|
||||
-
|
||||
- if (var4 == Block.grass.blockID || var4 == Block.leaves.blockID)
|
||||
+ Block block = Block.blocksList[var4];
|
||||
- if (l == Block.grass.blockID || l == Block.leaves.blockID)
|
||||
+ Block block = Block.blocksList[l];
|
||||
+
|
||||
+ if (var4 == Block.grass.blockID || (block != null && block.isLeaves(worldObj, var1, var2 - 1, var3)))
|
||||
+ if (l == Block.grass.blockID || (block != null && block.isLeaves(worldObj, i, j - 1, k)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -24,25 +24,25 @@
|
||||
*/
|
||||
public boolean interact(EntityPlayer par1EntityPlayer)
|
||||
{
|
||||
- ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem();
|
||||
- ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem();
|
||||
-
|
||||
- if (var2 != null && var2.itemID == Item.shears.itemID && !this.getSheared() && !this.isChild())
|
||||
- if (itemstack != null && itemstack.itemID == Item.shears.itemID && !this.getSheared() && !this.isChild())
|
||||
- {
|
||||
- if (!this.worldObj.isRemote)
|
||||
- {
|
||||
- this.setSheared(true);
|
||||
- int var3 = 1 + this.rand.nextInt(3);
|
||||
- int i = 1 + this.rand.nextInt(3);
|
||||
-
|
||||
- for (int var4 = 0; var4 < var3; ++var4)
|
||||
- for (int j = 0; j < i; ++j)
|
||||
- {
|
||||
- EntityItem var5 = this.entityDropItem(new ItemStack(Block.cloth.blockID, 1, this.getFleeceColor()), 1.0F);
|
||||
- var5.motionY += (double)(this.rand.nextFloat() * 0.05F);
|
||||
- var5.motionX += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F);
|
||||
- var5.motionZ += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F);
|
||||
- EntityItem entityitem = this.entityDropItem(new ItemStack(Block.cloth.blockID, 1, this.getFleeceColor()), 1.0F);
|
||||
- entityitem.motionY += (double)(this.rand.nextFloat() * 0.05F);
|
||||
- entityitem.motionX += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F);
|
||||
- entityitem.motionZ += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- var2.damageItem(1, par1EntityPlayer);
|
||||
- itemstack.damageItem(1, par1EntityPlayer);
|
||||
- this.playSound("mob.sheep.shear", 1.0F, 1.0F);
|
||||
- }
|
||||
-
|
||||
|
||||
@@ -24,21 +24,21 @@
|
||||
private InventoryEnderChest theInventoryEnderChest = new InventoryEnderChest();
|
||||
@@ -259,6 +272,7 @@
|
||||
|
||||
if (var1 == this.itemInUse)
|
||||
if (itemstack == this.itemInUse)
|
||||
{
|
||||
+ itemInUse.getItem().onUsingItemTick(itemInUse, this, itemInUseCount);
|
||||
if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0)
|
||||
{
|
||||
this.updateItemUse(var1, 5);
|
||||
this.updateItemUse(itemstack, 5);
|
||||
@@ -497,11 +511,11 @@
|
||||
this.cameraYaw = 0.0F;
|
||||
this.addMountedMovementStat(this.posX - var1, this.posY - var3, this.posZ - var5);
|
||||
this.addMountedMovementStat(this.posX - d0, this.posY - d1, this.posZ - d2);
|
||||
|
||||
- if (this.ridingEntity instanceof EntityPig)
|
||||
+ if (this.ridingEntity instanceof EntityLiving && ((EntityLiving)ridingEntity).shouldRiderFaceForward(this))
|
||||
{
|
||||
this.rotationPitch = var8;
|
||||
this.rotationYaw = var7;
|
||||
this.rotationPitch = f1;
|
||||
this.rotationYaw = f;
|
||||
- this.renderYawOffset = ((EntityPig)this.ridingEntity).renderYawOffset;
|
||||
+ this.renderYawOffset = ((EntityLiving)this.ridingEntity).renderYawOffset;
|
||||
}
|
||||
@@ -129,35 +129,35 @@
|
||||
+ @Deprecated
|
||||
public float getCurrentPlayerStrVsBlock(Block par1Block)
|
||||
{
|
||||
- float var2 = this.inventory.getStrVsBlock(par1Block);
|
||||
- float f = this.inventory.getStrVsBlock(par1Block);
|
||||
+ return getCurrentPlayerStrVsBlock(par1Block, 0);
|
||||
+ }
|
||||
+
|
||||
+ public float getCurrentPlayerStrVsBlock(Block par1Block, int meta)
|
||||
+ {
|
||||
+ ItemStack stack = inventory.getCurrentItem();
|
||||
+ float var2 = (stack == null ? 1.0F : stack.getItem().getStrVsBlock(stack, par1Block, meta));
|
||||
int var3 = EnchantmentHelper.getEfficiencyModifier(this);
|
||||
ItemStack var4 = this.inventory.getCurrentItem();
|
||||
+ float f = (stack == null ? 1.0F : stack.getItem().getStrVsBlock(stack, par1Block, meta));
|
||||
int i = EnchantmentHelper.getEfficiencyModifier(this);
|
||||
ItemStack itemstack = this.inventory.getCurrentItem();
|
||||
|
||||
if (var3 > 0 && var4 != null)
|
||||
if (i > 0 && itemstack != null)
|
||||
{
|
||||
float var5 = (float)(var3 * var3 + 1);
|
||||
float f1 = (float)(i * i + 1);
|
||||
-
|
||||
- if (!var4.canHarvestBlock(par1Block) && var2 <= 1.0F)
|
||||
+ boolean canHarvest = ForgeHooks.canToolHarvestBlock(par1Block, meta, var4);
|
||||
- if (!itemstack.canHarvestBlock(par1Block) && f <= 1.0F)
|
||||
+ boolean canHarvest = ForgeHooks.canToolHarvestBlock(par1Block, meta, itemstack);
|
||||
+
|
||||
+ if (!canHarvest && var2 <= 1.0F)
|
||||
+ if (!canHarvest && f <= 1.0F)
|
||||
{
|
||||
var2 += var5 * 0.08F;
|
||||
f += f1 * 0.08F;
|
||||
}
|
||||
@@ -784,7 +844,8 @@
|
||||
var2 /= 5.0F;
|
||||
f /= 5.0F;
|
||||
}
|
||||
|
||||
- return var2;
|
||||
+ var2 = ForgeEventFactory.getBreakSpeed(this, par1Block, meta, var2);
|
||||
+ return (var2 < 0 ? 0 : var2);
|
||||
- return f;
|
||||
+ f = ForgeEventFactory.getBreakSpeed(this, par1Block, meta, f);
|
||||
+ return (f < 0 ? 0 : f);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -246,32 +246,32 @@
|
||||
if (this.isPlayerSleeping() || !this.isEntityAlive())
|
||||
@@ -1387,6 +1479,11 @@
|
||||
{
|
||||
int var9 = this.worldObj.getBlockMetadata(par1, par2, par3);
|
||||
int var5 = BlockBed.getDirection(var9);
|
||||
int l = this.worldObj.getBlockMetadata(par1, par2, par3);
|
||||
int i1 = BlockBed.getDirection(l);
|
||||
+ Block block = Block.blocksList[worldObj.getBlockId(par1, par2, par3)];
|
||||
+ if (block != null)
|
||||
+ {
|
||||
+ var5 = block.getBedDirection(worldObj, par1, par2, par3);
|
||||
+ i1 = block.getBedDirection(worldObj, par1, par2, par3);
|
||||
+ }
|
||||
float var10 = 0.5F;
|
||||
float var7 = 0.5F;
|
||||
float f = 0.5F;
|
||||
float f1 = 0.5F;
|
||||
|
||||
@@ -1457,10 +1554,12 @@
|
||||
ChunkCoordinates var4 = this.playerLocation;
|
||||
ChunkCoordinates var5 = this.playerLocation;
|
||||
ChunkCoordinates chunkcoordinates = this.playerLocation;
|
||||
ChunkCoordinates chunkcoordinates1 = this.playerLocation;
|
||||
|
||||
- if (var4 != null && this.worldObj.getBlockId(var4.posX, var4.posY, var4.posZ) == Block.bed.blockID)
|
||||
- if (chunkcoordinates != null && this.worldObj.getBlockId(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ) == Block.bed.blockID)
|
||||
- {
|
||||
- BlockBed.setBedOccupied(this.worldObj, var4.posX, var4.posY, var4.posZ, false);
|
||||
- var5 = BlockBed.getNearestEmptyChunkCoordinates(this.worldObj, var4.posX, var4.posY, var4.posZ, 0);
|
||||
+ Block block = (var4 == null ? null : Block.blocksList[worldObj.getBlockId(var4.posX, var4.posY, var4.posZ)]);
|
||||
- BlockBed.setBedOccupied(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, false);
|
||||
- chunkcoordinates1 = BlockBed.getNearestEmptyChunkCoordinates(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, 0);
|
||||
+ Block block = (chunkcoordinates == null ? null : Block.blocksList[worldObj.getBlockId(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ)]);
|
||||
+
|
||||
+ if (var4 != null && block != null && block.isBed(worldObj, var4.posX, var4.posY, var4.posZ, this))
|
||||
+ if (chunkcoordinates != null && block != null && block.isBed(worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this))
|
||||
+ {
|
||||
+ block.setBedOccupied(this.worldObj, var4.posX, var4.posY, var4.posZ, this, false);
|
||||
+ var5 = block.getBedSpawnPosition(worldObj, var4.posX, var4.posY, var4.posZ, this);
|
||||
+ block.setBedOccupied(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this, false);
|
||||
+ chunkcoordinates1 = block.getBedSpawnPosition(worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this);
|
||||
|
||||
if (var5 == null)
|
||||
if (chunkcoordinates1 == null)
|
||||
{
|
||||
@@ -1497,7 +1596,9 @@
|
||||
*/
|
||||
@@ -285,35 +285,39 @@
|
||||
|
||||
/**
|
||||
@@ -1512,9 +1613,12 @@
|
||||
var3.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4);
|
||||
var3.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4);
|
||||
ichunkprovider.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4);
|
||||
ichunkprovider.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4);
|
||||
|
||||
- if (par0World.getBlockId(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ) == Block.bed.blockID)
|
||||
- {
|
||||
- ChunkCoordinates var8 = BlockBed.getNearestEmptyChunkCoordinates(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, 0);
|
||||
- ChunkCoordinates chunkcoordinates1 = BlockBed.getNearestEmptyChunkCoordinates(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, 0);
|
||||
+ ChunkCoordinates c = par1ChunkCoordinates;
|
||||
+ Block block = Block.blocksList[par0World.getBlockId(c.posX, c.posY, c.posZ)];
|
||||
+
|
||||
+ if (block != null && block.isBed(par0World, c.posX, c.posY, c.posZ, null))
|
||||
+ {
|
||||
+ ChunkCoordinates var8 = block.getBedSpawnPosition(par0World, c.posX, c.posY, c.posZ, null);
|
||||
return var8;
|
||||
+ ChunkCoordinates chunkcoordinates1 = block.getBedSpawnPosition(par0World, c.posX, c.posY, c.posZ, null);
|
||||
return chunkcoordinates1;
|
||||
}
|
||||
else
|
||||
@@ -1536,8 +1640,11 @@
|
||||
@@ -1536,10 +1640,13 @@
|
||||
{
|
||||
if (this.playerLocation != null)
|
||||
{
|
||||
- int var1 = this.worldObj.getBlockMetadata(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ);
|
||||
- int var2 = BlockBed.getDirection(var1);
|
||||
- int i = this.worldObj.getBlockMetadata(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ);
|
||||
- int j = BlockBed.getDirection(i);
|
||||
-
|
||||
- switch (j)
|
||||
+ int x = playerLocation.posX;
|
||||
+ int y = playerLocation.posY;
|
||||
+ int z = playerLocation.posZ;
|
||||
+ Block block = Block.blocksList[worldObj.getBlockId(x, y, z)];
|
||||
+ int var2 = (block == null ? 0 : block.getBedDirection(worldObj, x, y, z));
|
||||
|
||||
switch (var2)
|
||||
+ int i = (block == null ? 0 : block.getBedDirection(worldObj, x, y, z));
|
||||
+
|
||||
+ switch (i)
|
||||
{
|
||||
case 0:
|
||||
return 90.0F;
|
||||
@@ -1846,7 +1953,7 @@
|
||||
{
|
||||
if (par1ItemStack.getItem().requiresMultipleRenderPasses())
|
||||
@@ -327,10 +331,10 @@
|
||||
return 101;
|
||||
}
|
||||
}
|
||||
+ var3 = par1ItemStack.getItem().getIconIndex(par1ItemStack, par2, this, itemInUse, itemInUseCount);
|
||||
+ j = par1ItemStack.getItem().getIconIndex(par1ItemStack, par2, this, itemInUse, itemInUseCount);
|
||||
}
|
||||
|
||||
return var3;
|
||||
return j;
|
||||
@@ -2088,6 +2196,14 @@
|
||||
}
|
||||
|
||||
|
||||
@@ -24,39 +24,39 @@
|
||||
par4ItemInWorldManager.thisPlayerMP = this;
|
||||
this.theItemInWorldManager = par4ItemInWorldManager;
|
||||
this.renderDistance = par1MinecraftServer.getConfigurationManager().getViewDistance();
|
||||
- ChunkCoordinates var5 = par2World.getSpawnPoint();
|
||||
+ ChunkCoordinates var5 = par2World.provider.getRandomizedSpawnPoint();
|
||||
int var6 = var5.posX;
|
||||
int var7 = var5.posZ;
|
||||
int var8 = var5.posY;
|
||||
- ChunkCoordinates chunkcoordinates = par2World.getSpawnPoint();
|
||||
+ ChunkCoordinates chunkcoordinates = par2World.provider.getRandomizedSpawnPoint();
|
||||
int i = chunkcoordinates.posX;
|
||||
int j = chunkcoordinates.posZ;
|
||||
int k = chunkcoordinates.posY;
|
||||
-
|
||||
- if (!par2World.provider.hasNoSky && par2World.getWorldInfo().getGameType() != EnumGameType.ADVENTURE)
|
||||
- {
|
||||
- int var9 = Math.max(5, par1MinecraftServer.getSpawnProtectionSize() - 6);
|
||||
- var6 += this.rand.nextInt(var9 * 2) - var9;
|
||||
- var7 += this.rand.nextInt(var9 * 2) - var9;
|
||||
- var8 = par2World.getTopSolidOrLiquidBlock(var6, var7);
|
||||
- int l = Math.max(5, par1MinecraftServer.getSpawnProtectionSize() - 6);
|
||||
- i += this.rand.nextInt(l * 2) - l;
|
||||
- j += this.rand.nextInt(l * 2) - l;
|
||||
- k = par2World.getTopSolidOrLiquidBlock(i, j);
|
||||
- }
|
||||
|
||||
this.setLocationAndAngles((double)var6 + 0.5D, (double)var8, (double)var7 + 0.5D, 0.0F, 0.0F);
|
||||
this.setLocationAndAngles((double)i + 0.5D, (double)k, (double)j + 0.5D, 0.0F, 0.0F);
|
||||
this.mcServer = par1MinecraftServer;
|
||||
@@ -253,7 +251,10 @@
|
||||
if (var9 != null && this.worldObj.blockExists(var9.chunkXPos << 4, 0, var9.chunkZPos << 4))
|
||||
if (chunkcoordintpair != null && this.worldObj.blockExists(chunkcoordintpair.chunkXPos << 4, 0, chunkcoordintpair.chunkZPos << 4))
|
||||
{
|
||||
var6.add(this.worldObj.getChunkFromChunkCoords(var9.chunkXPos, var9.chunkZPos));
|
||||
- var8.addAll(((WorldServer)this.worldObj).getAllTileEntityInBox(var9.chunkXPos * 16, 0, var9.chunkZPos * 16, var9.chunkXPos * 16 + 16, 256, var9.chunkZPos * 16 + 16));
|
||||
arraylist.add(this.worldObj.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos));
|
||||
- arraylist1.addAll(((WorldServer)this.worldObj).getAllTileEntityInBox(chunkcoordintpair.chunkXPos * 16, 0, chunkcoordintpair.chunkZPos * 16, chunkcoordintpair.chunkXPos * 16 + 16, 256, chunkcoordintpair.chunkZPos * 16 + 16));
|
||||
+ //BugFix: 16 makes it load an extra chunk, which isn't associated with a player, which makes it not unload unless a player walks near it.
|
||||
+ //ToDo: Find a way to efficiently clean abandoned chunks.
|
||||
+ //var8.addAll(((WorldServer)this.worldObj).getAllTileEntityInBox(var9.chunkXPos * 16, 0, var9.chunkZPos * 16, var9.chunkXPos * 16 + 16, 256, var9.chunkZPos * 16 + 16));
|
||||
+ var8.addAll(((WorldServer)this.worldObj).getAllTileEntityInBox(var9.chunkXPos * 16, 0, var9.chunkZPos * 16, var9.chunkXPos * 16 + 15, 256, var9.chunkZPos * 16 + 15));
|
||||
+ //arraylist1.addAll(((WorldServer)this.worldObj).getAllTileEntityInBox(chunkcoordintpair.chunkXPos * 16, 0, chunkcoordintpair.chunkZPos * 16, chunkcoordintpair.chunkXPos * 16 + 16, 256, chunkcoordintpair.chunkZPos * 16 + 16));
|
||||
+ arraylist1.addAll(((WorldServer)this.worldObj).getAllTileEntityInBox(chunkcoordintpair.chunkXPos * 16, 0, chunkcoordintpair.chunkZPos * 16, chunkcoordintpair.chunkXPos * 16 + 15, 256, chunkcoordintpair.chunkZPos * 16 + 15));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,6 +275,7 @@
|
||||
{
|
||||
Chunk var10 = (Chunk)var11.next();
|
||||
this.getServerForPlayer().getEntityTracker().func_85172_a(this, var10);
|
||||
+ MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.Watch(var10.getChunkCoordIntPair(), this));
|
||||
Chunk chunk = (Chunk)iterator2.next();
|
||||
this.getServerForPlayer().getEntityTracker().func_85172_a(this, chunk);
|
||||
+ MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.Watch(chunk.getChunkCoordIntPair(), this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
}
|
||||
else if (par2 != 1 && par2 != 0)
|
||||
{
|
||||
- if (FurnaceRecipes.smelting().getSmeltingResult(var5.getItem().itemID) != null)
|
||||
+ if (FurnaceRecipes.smelting().getSmeltingResult(var5) != null)
|
||||
- if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1.getItem().itemID) != null)
|
||||
+ if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null)
|
||||
{
|
||||
if (!this.mergeItemStack(var5, 0, 1, false))
|
||||
if (!this.mergeItemStack(itemstack1, 0, 1, false))
|
||||
{
|
||||
@@ -13,19 +13,19 @@
|
||||
{
|
||||
@@ -124,9 +128,15 @@
|
||||
|
||||
if (var4.getItem().hasContainerItem())
|
||||
if (itemstack1.getItem().hasContainerItem())
|
||||
{
|
||||
- ItemStack var5 = new ItemStack(var4.getItem().getContainerItem());
|
||||
+ ItemStack var5 = var4.getItem().getContainerItemStack(var4);
|
||||
- ItemStack itemstack2 = new ItemStack(itemstack1.getItem().getContainerItem());
|
||||
+ ItemStack itemstack2 = itemstack1.getItem().getContainerItemStack(itemstack1);
|
||||
+
|
||||
+ if (var5.isItemStackDamageable() && var5.getItemDamage() > var5.getMaxDamage())
|
||||
+ if (itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage())
|
||||
+ {
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer, var5));
|
||||
+ var5 = null;
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer, itemstack2));
|
||||
+ itemstack2 = null;
|
||||
+ }
|
||||
|
||||
- if (!var4.getItem().doesContainerItemLeaveCraftingGrid(var4) || !this.thePlayer.inventory.addItemStackToInventory(var5))
|
||||
+ if (var5 != null && (!var4.getItem().doesContainerItemLeaveCraftingGrid(var4) || !this.thePlayer.inventory.addItemStackToInventory(var5)))
|
||||
- if (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1) || !this.thePlayer.inventory.addItemStackToInventory(itemstack2))
|
||||
+ if (itemstack2 != null && (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1) || !this.thePlayer.inventory.addItemStackToInventory(itemstack2)))
|
||||
{
|
||||
if (this.craftMatrix.getStackInSlot(var3) == null)
|
||||
if (this.craftMatrix.getStackInSlot(i) == null)
|
||||
{
|
||||
@@ -3,9 +3,9 @@
|
||||
@@ -69,7 +69,7 @@
|
||||
if (!this.thePlayer.worldObj.isRemote)
|
||||
{
|
||||
int var2 = this.field_75228_b;
|
||||
- float var3 = FurnaceRecipes.smelting().getExperience(par1ItemStack.itemID);
|
||||
+ float var3 = FurnaceRecipes.smelting().getExperience(par1ItemStack);
|
||||
int var4;
|
||||
int i = this.field_75228_b;
|
||||
- float f = FurnaceRecipes.smelting().getExperience(par1ItemStack.itemID);
|
||||
+ float f = FurnaceRecipes.smelting().getExperience(par1ItemStack);
|
||||
int j;
|
||||
|
||||
if (var3 == 0.0F)
|
||||
if (f == 0.0F)
|
||||
@@ -47,15 +47,15 @@
|
||||
|
||||
/**
|
||||
@@ -627,6 +638,10 @@
|
||||
float var18 = var15 * var16;
|
||||
float var20 = var14 * var16;
|
||||
double var21 = 5.0D;
|
||||
float f7 = f4 * f5;
|
||||
float f8 = f3 * f5;
|
||||
double d3 = 5.0D;
|
||||
+ if (par2EntityPlayer instanceof EntityPlayerMP)
|
||||
+ {
|
||||
+ var21 = ((EntityPlayerMP)par2EntityPlayer).theItemInWorldManager.getBlockReachDistance();
|
||||
+ d3 = ((EntityPlayerMP)par2EntityPlayer).theItemInWorldManager.getBlockReachDistance();
|
||||
+ }
|
||||
Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
|
||||
return par1World.rayTraceBlocks_do_do(var13, var23, par3, !par3);
|
||||
Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3);
|
||||
return par1World.rayTraceBlocks_do_do(vec3, vec31, par3, !par3);
|
||||
}
|
||||
@@ -701,4 +716,304 @@
|
||||
{
|
||||
|
||||
@@ -12,36 +12,36 @@
|
||||
{
|
||||
par7 = 1;
|
||||
}
|
||||
- else if (var11 != Block.vine.blockID && var11 != Block.tallGrass.blockID && var11 != Block.deadBush.blockID)
|
||||
+ else if (var11 != Block.vine.blockID && var11 != Block.tallGrass.blockID && var11 != Block.deadBush.blockID
|
||||
+ && (Block.blocksList[var11] == null || !Block.blocksList[var11].isBlockReplaceable(par3World, par4, par5, par6)))
|
||||
- else if (i1 != Block.vine.blockID && i1 != Block.tallGrass.blockID && i1 != Block.deadBush.blockID)
|
||||
+ else if (i1 != Block.vine.blockID && i1 != Block.tallGrass.blockID && i1 != Block.deadBush.blockID
|
||||
+ && (Block.blocksList[i1] == null || !Block.blocksList[i1].isBlockReplaceable(par3World, par4, par5, par6)))
|
||||
{
|
||||
if (par7 == 0)
|
||||
{
|
||||
@@ -92,14 +94,8 @@
|
||||
int var13 = this.getMetadata(par1ItemStack.getItemDamage());
|
||||
int var14 = Block.blocksList[this.blockID].onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, var13);
|
||||
int j1 = this.getMetadata(par1ItemStack.getItemDamage());
|
||||
int k1 = Block.blocksList[this.blockID].onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, j1);
|
||||
|
||||
- if (par3World.setBlockAndMetadataWithNotify(par4, par5, par6, this.blockID, var14))
|
||||
- if (par3World.setBlockAndMetadataWithNotify(par4, par5, par6, this.blockID, k1))
|
||||
- {
|
||||
- if (par3World.getBlockId(par4, par5, par6) == this.blockID)
|
||||
- {
|
||||
- Block.blocksList[this.blockID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer);
|
||||
- Block.blocksList[this.blockID].onPostBlockPlaced(par3World, par4, par5, par6, var14);
|
||||
- Block.blocksList[this.blockID].onPostBlockPlaced(par3World, par4, par5, par6, k1);
|
||||
- }
|
||||
-
|
||||
+ 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, k1))
|
||||
+ {
|
||||
par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F);
|
||||
par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), block.stepSound.getPlaceSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
|
||||
--par1ItemStack.stackSize;
|
||||
}
|
||||
@@ -125,7 +121,8 @@
|
||||
{
|
||||
par5 = 1;
|
||||
}
|
||||
- else if (var8 != Block.vine.blockID && var8 != Block.tallGrass.blockID && var8 != Block.deadBush.blockID)
|
||||
+ else if (var8 != Block.vine.blockID && var8 != Block.tallGrass.blockID && var8 != Block.deadBush.blockID
|
||||
+ && (Block.blocksList[var8] == null || !Block.blocksList[var8].isBlockReplaceable(par1World, par2, par3, par4)))
|
||||
- else if (i1 != Block.vine.blockID && i1 != Block.tallGrass.blockID && i1 != Block.deadBush.blockID)
|
||||
+ else if (i1 != Block.vine.blockID && i1 != Block.tallGrass.blockID && i1 != Block.deadBush.blockID
|
||||
+ && (Block.blocksList[i1] == null || !Block.blocksList[i1].isBlockReplaceable(par1World, par2, par3, par4)))
|
||||
{
|
||||
if (par5 == 0)
|
||||
{
|
||||
|
||||
@@ -15,23 +15,23 @@
|
||||
*/
|
||||
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
|
||||
{
|
||||
+ int var6 = this.getMaxItemUseDuration(par1ItemStack) - par4;
|
||||
+ int j = this.getMaxItemUseDuration(par1ItemStack) - par4;
|
||||
+
|
||||
+ ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, var6);
|
||||
+ ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, j);
|
||||
+ MinecraftForge.EVENT_BUS.post(event);
|
||||
+ if (event.isCanceled())
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+ var6 = event.charge;
|
||||
+ j = event.charge;
|
||||
+
|
||||
boolean var5 = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;
|
||||
boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;
|
||||
|
||||
if (var5 || par3EntityPlayer.inventory.hasItem(Item.arrow.itemID))
|
||||
if (flag || par3EntityPlayer.inventory.hasItem(Item.arrow.itemID))
|
||||
{
|
||||
- int var6 = this.getMaxItemUseDuration(par1ItemStack) - par4;
|
||||
float var7 = (float)var6 / 20.0F;
|
||||
var7 = (var7 * var7 + var7 * 2.0F) / 3.0F;
|
||||
- int j = this.getMaxItemUseDuration(par1ItemStack) - par4;
|
||||
float f = (float)j / 20.0F;
|
||||
f = (f * f + f * 2.0F) / 3.0F;
|
||||
|
||||
@@ -111,6 +124,13 @@
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
+ FillBucketEvent event = new FillBucketEvent(par3EntityPlayer, par1ItemStack, par2World, var12);
|
||||
+ FillBucketEvent event = new FillBucketEvent(par3EntityPlayer, par1ItemStack, par2World, movingobjectposition);
|
||||
+ if (MinecraftForge.EVENT_BUS.post(event))
|
||||
+ {
|
||||
+ return par1ItemStack;
|
||||
@@ -41,6 +41,6 @@
|
||||
+ return par1ItemStack;
|
||||
+ }
|
||||
+
|
||||
if (var12.typeOfHit == EnumMovingObjectType.TILE)
|
||||
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
|
||||
{
|
||||
int var13 = var12.blockX;
|
||||
int i = movingobjectposition.blockX;
|
||||
@@ -15,9 +15,9 @@
|
||||
@@ -68,6 +73,21 @@
|
||||
if (par1ItemStack.getItemDamage() == 15)
|
||||
{
|
||||
var11 = par3World.getBlockId(par4, par5, par6);
|
||||
i1 = par3World.getBlockId(par4, par5, par6);
|
||||
+
|
||||
+ BonemealEvent event = new BonemealEvent(par2EntityPlayer, par3World, var11, par4, par5, par6);
|
||||
+ BonemealEvent event = new BonemealEvent(par2EntityPlayer, par3World, i1, par4, par5, par6);
|
||||
+ if (MinecraftForge.EVENT_BUS.post(event))
|
||||
+ {
|
||||
+ return false;
|
||||
@@ -32,24 +32,24 @@
|
||||
+ return true;
|
||||
+ }
|
||||
|
||||
if (var11 == Block.sapling.blockID)
|
||||
if (i1 == Block.sapling.blockID)
|
||||
{
|
||||
@@ -167,16 +187,9 @@
|
||||
par3World.setBlockAndMetadataWithNotify(var13, var14, var15, Block.tallGrass.blockID, 1);
|
||||
par3World.setBlockAndMetadataWithNotify(k1, l1, i2, Block.tallGrass.blockID, 1);
|
||||
}
|
||||
}
|
||||
- else if (itemRand.nextInt(3) != 0)
|
||||
+ else
|
||||
{
|
||||
- if (Block.plantYellow.canBlockStay(par3World, var13, var14, var15))
|
||||
- if (Block.plantYellow.canBlockStay(par3World, k1, l1, i2))
|
||||
- {
|
||||
- par3World.setBlockWithNotify(var13, var14, var15, Block.plantYellow.blockID);
|
||||
- par3World.setBlockWithNotify(k1, l1, i2, Block.plantYellow.blockID);
|
||||
- }
|
||||
- }
|
||||
- else if (Block.plantRed.canBlockStay(par3World, var13, var14, var15))
|
||||
- else if (Block.plantRed.canBlockStay(par3World, k1, l1, i2))
|
||||
- {
|
||||
- par3World.setBlockWithNotify(var13, var14, var15, Block.plantRed.blockID);
|
||||
+ ForgeHooks.plantGrass(par3World, var13, var14, var15);
|
||||
- par3World.setBlockWithNotify(k1, l1, i2, Block.plantRed.blockID);
|
||||
+ ForgeHooks.plantGrass(par3World, k1, l1, i2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,6 @@
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
int var11 = par3World.getBlockId(par4, par5, par6);
|
||||
int var12 = par3World.getBlockId(par4, par5 + 1, par6);
|
||||
int i1 = par3World.getBlockId(par4, par5, par6);
|
||||
int j1 = par3World.getBlockId(par4, par5 + 1, par6);
|
||||
|
||||
@@ -40,14 +40,14 @@
|
||||
{
|
||||
- this.theWorld.extinguishFire(this.thisPlayerMP, par1, par2, par3, par4);
|
||||
this.initialDamage = this.curblockDamage;
|
||||
float var5 = 1.0F;
|
||||
int var6 = this.theWorld.getBlockId(par1, par2, par3);
|
||||
float f = 1.0F;
|
||||
int i1 = this.theWorld.getBlockId(par1, par2, par3);
|
||||
-
|
||||
- if (var6 > 0)
|
||||
- if (i1 > 0)
|
||||
- {
|
||||
- Block.blocksList[var6].onBlockClicked(this.theWorld, par1, par2, par3, this.thisPlayerMP);
|
||||
- var5 = Block.blocksList[var6].getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, par1, par2, par3);
|
||||
+ Block block = Block.blocksList[var6];
|
||||
- Block.blocksList[i1].onBlockClicked(this.theWorld, par1, par2, par3, this.thisPlayerMP);
|
||||
- f = Block.blocksList[i1].getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, par1, par2, par3);
|
||||
+ Block block = Block.blocksList[i1];
|
||||
+
|
||||
+ if (block != null)
|
||||
+ {
|
||||
@@ -60,27 +60,27 @@
|
||||
+ {
|
||||
+ thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(par1, par2, par3, theWorld));
|
||||
+ }
|
||||
+ var5 = block.getPlayerRelativeBlockHardness(thisPlayerMP, thisPlayerMP.worldObj, par1, par2, par3);
|
||||
+ f = block.getPlayerRelativeBlockHardness(thisPlayerMP, thisPlayerMP.worldObj, par1, par2, par3);
|
||||
+ }
|
||||
+
|
||||
+ if (event.useItem == Event.Result.DENY)
|
||||
+ {
|
||||
+ if (var5 >= 1.0f)
|
||||
+ if (f >= 1.0f)
|
||||
+ {
|
||||
+ thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(par1, par2, par3, theWorld));
|
||||
+ }
|
||||
+ return;
|
||||
}
|
||||
|
||||
if (var6 > 0 && var5 >= 1.0F)
|
||||
if (i1 > 0 && f >= 1.0F)
|
||||
@@ -236,7 +271,7 @@
|
||||
var4.onBlockHarvested(this.theWorld, par1, par2, par3, var5, this.thisPlayerMP);
|
||||
block.onBlockHarvested(this.theWorld, par1, par2, par3, l, this.thisPlayerMP);
|
||||
}
|
||||
|
||||
- boolean var6 = this.theWorld.setBlockWithNotify(par1, par2, par3, 0);
|
||||
+ boolean var6 = (var4 != null && var4.removeBlockByPlayer(theWorld, thisPlayerMP, par1, par2, par3));
|
||||
- boolean flag = this.theWorld.setBlockWithNotify(par1, par2, par3, 0);
|
||||
+ boolean flag = (block != null && block.removeBlockByPlayer(theWorld, thisPlayerMP, par1, par2, par3));
|
||||
|
||||
if (var4 != null && var6)
|
||||
if (block != null && flag)
|
||||
{
|
||||
@@ -257,19 +292,30 @@
|
||||
}
|
||||
@@ -91,43 +91,43 @@
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
int var4 = this.theWorld.getBlockId(par1, par2, par3);
|
||||
int var5 = this.theWorld.getBlockMetadata(par1, par2, par3);
|
||||
this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, par1, par2, par3, var4 + (this.theWorld.getBlockMetadata(par1, par2, par3) << 12));
|
||||
- boolean var6 = this.removeBlock(par1, par2, par3);
|
||||
+ boolean var6 = false;
|
||||
int l = this.theWorld.getBlockId(par1, par2, par3);
|
||||
int i1 = this.theWorld.getBlockMetadata(par1, par2, par3);
|
||||
this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, par1, par2, par3, l + (this.theWorld.getBlockMetadata(par1, par2, par3) << 12));
|
||||
- boolean flag = this.removeBlock(par1, par2, par3);
|
||||
+ boolean flag = false;
|
||||
|
||||
if (this.isCreative())
|
||||
{
|
||||
+ var6 = this.removeBlock(par1, par2, par3);
|
||||
+ flag = this.removeBlock(par1, par2, par3);
|
||||
this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(par1, par2, par3, this.theWorld));
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemStack var7 = this.thisPlayerMP.getCurrentEquippedItem();
|
||||
- boolean var8 = this.thisPlayerMP.canHarvestBlock(Block.blocksList[var4]);
|
||||
+ boolean var8 = false;
|
||||
+ Block block = Block.blocksList[var4];
|
||||
ItemStack itemstack = this.thisPlayerMP.getCurrentEquippedItem();
|
||||
- boolean flag1 = this.thisPlayerMP.canHarvestBlock(Block.blocksList[l]);
|
||||
+ boolean flag1 = false;
|
||||
+ Block block = Block.blocksList[l];
|
||||
+ if (block != null)
|
||||
+ {
|
||||
+ var8 = block.canHarvestBlock(thisPlayerMP, var5);
|
||||
+ flag1 = block.canHarvestBlock(thisPlayerMP, i1);
|
||||
+ }
|
||||
|
||||
if (var7 != null)
|
||||
if (itemstack != null)
|
||||
{
|
||||
@@ -281,6 +327,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ var6 = this.removeBlock(par1, par2, par3);
|
||||
if (var6 && var8)
|
||||
+ flag = this.removeBlock(par1, par2, par3);
|
||||
if (flag && flag1)
|
||||
{
|
||||
Block.blocksList[var4].harvestBlock(this.theWorld, this.thisPlayerMP, par1, par2, par3, var5);
|
||||
Block.blocksList[l].harvestBlock(this.theWorld, this.thisPlayerMP, par1, par2, par3, i1);
|
||||
@@ -321,6 +368,7 @@
|
||||
if (var6.stackSize == 0)
|
||||
if (itemstack1.stackSize == 0)
|
||||
{
|
||||
par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = null;
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thisPlayerMP, var6));
|
||||
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thisPlayerMP, itemstack1));
|
||||
}
|
||||
|
||||
if (!par1EntityPlayer.isUsingItem())
|
||||
@@ -135,13 +135,13 @@
|
||||
*/
|
||||
public boolean activateBlockOrUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
- int var11;
|
||||
- int i1;
|
||||
-
|
||||
- if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null)
|
||||
- {
|
||||
- var11 = par2World.getBlockId(par4, par5, par6);
|
||||
- i1 = par2World.getBlockId(par4, par5, par6);
|
||||
-
|
||||
- if (var11 > 0 && Block.blocksList[var11].onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, par8, par9, par10))
|
||||
- if (i1 > 0 && Block.blocksList[i1].onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, par8, par9, par10))
|
||||
- {
|
||||
- return true;
|
||||
- }
|
||||
@@ -157,12 +157,12 @@
|
||||
}
|
||||
- else if (this.isCreative())
|
||||
- {
|
||||
- var11 = par3ItemStack.getItemDamage();
|
||||
- int var12 = par3ItemStack.stackSize;
|
||||
- boolean var13 = par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10);
|
||||
- par3ItemStack.setItemDamage(var11);
|
||||
- par3ItemStack.stackSize = var12;
|
||||
- return var13;
|
||||
- i1 = par3ItemStack.getItemDamage();
|
||||
- int j1 = par3ItemStack.stackSize;
|
||||
- boolean flag = par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10);
|
||||
- par3ItemStack.setItemDamage(i1);
|
||||
- par3ItemStack.stackSize = j1;
|
||||
- return flag;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
@@ -176,8 +176,8 @@
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ int var11 = par2World.getBlockId(par4, par5, par6);
|
||||
+ Block block = Block.blocksList[var11];
|
||||
+ int i1 = par2World.getBlockId(par4, par5, par6);
|
||||
+ Block block = Block.blocksList[i1];
|
||||
+ boolean result = false;
|
||||
+
|
||||
+ if (block != null && (!par1EntityPlayer.isSneaking() || ( par1EntityPlayer.getHeldItem() == null || par1EntityPlayer.getHeldItem().getItem().shouldPassSneakingClickToBlock(par2World, par4, par5, par6))))
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
--- ../src_base/minecraft/net/minecraft/item/ItemMap.java
|
||||
+++ ../src_work/minecraft/net/minecraft/item/ItemMap.java
|
||||
@@ -98,7 +98,7 @@
|
||||
boolean var21 = var19 * var19 + var20 * var20 > (var11 - 2) * (var11 - 2);
|
||||
int var22 = (var7 / var6 + var13 - var4 / 2) * var6;
|
||||
int var23 = (var8 / var6 + var18 - var5 / 2) * var6;
|
||||
- int[] var24 = new int[256];
|
||||
+ int[] var24 = new int[Block.blocksList.length];
|
||||
Chunk var25 = par1World.getChunkFromBlockCoords(var22, var23);
|
||||
boolean flag = k2 * k2 + l2 * l2 > (j1 - 2) * (j1 - 2);
|
||||
int i3 = (j / i + k1 - short1 / 2) * i;
|
||||
int j3 = (k / i + j2 - short2 / 2) * i;
|
||||
- int[] aint = new int[256];
|
||||
+ int[] aint = new int[Block.blocksList.length];
|
||||
Chunk chunk = par1World.getChunkFromBlockCoords(i3, j3);
|
||||
|
||||
if (!var25.isEmpty())
|
||||
if (!chunk.isEmpty())
|
||||
@@ -194,7 +194,7 @@
|
||||
var31 = 0;
|
||||
var32 = 0;
|
||||
j4 = 0;
|
||||
k4 = 0;
|
||||
|
||||
- for (var33 = 0; var33 < 256; ++var33)
|
||||
+ for (var33 = 0; var33 < Block.blocksList.length; ++var33)
|
||||
- for (l4 = 0; l4 < 256; ++l4)
|
||||
+ for (l4 = 0; l4 < Block.blocksList.length; ++l4)
|
||||
{
|
||||
if (var24[var33] > var31)
|
||||
if (aint[l4] > j4)
|
||||
{
|
||||
@@ -20,10 +20,10 @@
|
||||
@@ -35,8 +40,9 @@
|
||||
else if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack))
|
||||
{
|
||||
int var11 = par3World.getBlockId(par4, par5, par6);
|
||||
+ Block soil = Block.blocksList[var11];
|
||||
int i1 = par3World.getBlockId(par4, par5, par6);
|
||||
+ Block soil = Block.blocksList[i1];
|
||||
|
||||
- if (var11 == this.soilBlockID && par3World.isAirBlock(par4, par5 + 1, par6))
|
||||
- if (i1 == this.soilBlockID && par3World.isAirBlock(par4, par5 + 1, par6))
|
||||
+ if (soil != null && soil.canSustainPlant(par3World, par4, par5, par6, ForgeDirection.UP, this) && par3World.isAirBlock(par4, par5 + 1, par6))
|
||||
{
|
||||
par3World.setBlockWithNotify(par4, par5 + 1, par6, this.blockType);
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (var3 == 2 && var4.itemID == var5.itemID && var4.stackSize == 1 && var5.stackSize == 1 && Item.itemsList[var4.itemID].isDamageable())
|
||||
+ if (var3 == 2 && var4.itemID == var5.itemID && var4.stackSize == 1 && var5.stackSize == 1 && Item.itemsList[var4.itemID].isRepairable())
|
||||
- if (i == 2 && itemstack.itemID == itemstack1.itemID && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && Item.itemsList[itemstack.itemID].isDamageable())
|
||||
+ if (i == 2 && itemstack.itemID == itemstack1.itemID && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && Item.itemsList[itemstack.itemID].isRepairable())
|
||||
{
|
||||
Item var11 = Item.itemsList[var4.itemID];
|
||||
int var13 = var11.getMaxDamage() - var4.getItemDamageForDisplay();
|
||||
Item item = Item.itemsList[itemstack.itemID];
|
||||
int k = item.getMaxDamage() - itemstack.getItemDamageForDisplay();
|
||||
@@ -4,23 +4,23 @@
|
||||
{
|
||||
this.field_92050_a = new ItemStack(Item.field_92052_bU);
|
||||
|
||||
+ var15 = new NBTTagCompound();
|
||||
if (var6 > 0)
|
||||
+ nbttagcompound = new NBTTagCompound();
|
||||
if (l > 0)
|
||||
{
|
||||
- var15 = new NBTTagCompound();
|
||||
var18 = new NBTTagCompound("Fireworks");
|
||||
NBTTagList var25 = new NBTTagList("Explosions");
|
||||
- nbttagcompound = new NBTTagCompound();
|
||||
nbttagcompound1 = new NBTTagCompound("Fireworks");
|
||||
NBTTagList nbttaglist = new NBTTagList("Explosions");
|
||||
|
||||
@@ -110,9 +110,9 @@
|
||||
var18.setTag("Explosions", var25);
|
||||
var18.setByte("Flight", (byte)var4);
|
||||
var15.setTag("Fireworks", var18);
|
||||
- this.field_92050_a.setTagCompound(var15);
|
||||
nbttagcompound1.setTag("Explosions", nbttaglist);
|
||||
nbttagcompound1.setByte("Flight", (byte)j);
|
||||
nbttagcompound.setTag("Fireworks", nbttagcompound1);
|
||||
- this.field_92050_a.setTagCompound(nbttagcompound);
|
||||
- }
|
||||
-
|
||||
+ }
|
||||
+
|
||||
+ this.field_92050_a.setTagCompound(var15);
|
||||
+ this.field_92050_a.setTagCompound(nbttagcompound);
|
||||
return true;
|
||||
}
|
||||
else if (var4 == 1 && var3 == 0 && var6 == 0 && var5 > 0 && var8 <= 1)
|
||||
else if (j == 1 && i == 0 && l == 0 && k > 0 && j1 <= 1)
|
||||
@@ -7,7 +7,7 @@
|
||||
- @SideOnly(Side.CLIENT)
|
||||
public static void write(NBTTagCompound par0NBTTagCompound, File par1File) throws IOException
|
||||
{
|
||||
DataOutputStream var2 = new DataOutputStream(new FileOutputStream(par1File));
|
||||
DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(par1File));
|
||||
@@ -155,7 +154,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,9 @@
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
this.playerEntity.moveEntity(var13, var15, var17);
|
||||
this.playerEntity.moveEntity(d4, d6, d7);
|
||||
this.playerEntity.onGround = par1Packet10Flying.onGround;
|
||||
this.playerEntity.addMovementStat(var13, var15, var17);
|
||||
this.playerEntity.addMovementStat(d4, d6, d7);
|
||||
@@ -349,10 +366,15 @@
|
||||
logger.warning(this.playerEntity.username + " moved wrongly!");
|
||||
}
|
||||
@@ -47,22 +47,22 @@
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
this.playerEntity.setPositionAndRotation(var5, var7, var9, var11, var12);
|
||||
boolean var32 = var2.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.boundingBox.copy().contract((double)var27, (double)var27, (double)var27)).isEmpty();
|
||||
this.playerEntity.setPositionAndRotation(d1, d2, d3, f2, f3);
|
||||
boolean flag2 = worldserver.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.boundingBox.copy().contract((double)f4, (double)f4, (double)f4)).isEmpty();
|
||||
|
||||
- if (var28 && (var31 || !var32) && !this.playerEntity.isPlayerSleeping())
|
||||
+ if (var28 && (var31 || !var32) && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.noClip)
|
||||
- if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping())
|
||||
+ if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.noClip)
|
||||
{
|
||||
this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, var11, var12);
|
||||
this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, f2, f3);
|
||||
return;
|
||||
@@ -360,7 +382,7 @@
|
||||
|
||||
AxisAlignedBB var33 = this.playerEntity.boundingBox.copy().expand((double)var27, (double)var27, (double)var27).addCoord(0.0D, -0.55D, 0.0D);
|
||||
AxisAlignedBB axisalignedbb = this.playerEntity.boundingBox.copy().expand((double)f4, (double)f4, (double)f4).addCoord(0.0D, -0.55D, 0.0D);
|
||||
|
||||
- if (!this.mcServer.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !var2.isAABBNonEmpty(var33))
|
||||
+ if (!this.mcServer.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !var2.isAABBNonEmpty(var33) && !this.playerEntity.capabilities.allowFlying)
|
||||
- if (!this.mcServer.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !worldserver.isAABBNonEmpty(axisalignedbb))
|
||||
+ if (!this.mcServer.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !worldserver.isAABBNonEmpty(axisalignedbb) && !this.playerEntity.capabilities.allowFlying)
|
||||
{
|
||||
if (var29 >= -0.03125D)
|
||||
if (d12 >= -0.03125D)
|
||||
{
|
||||
@@ -379,6 +401,11 @@
|
||||
this.ticksForFloatKick = 0;
|
||||
@@ -75,65 +75,65 @@
|
||||
+
|
||||
this.playerEntity.onGround = par1Packet10Flying.onGround;
|
||||
this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity);
|
||||
this.playerEntity.updateFlyingState(this.playerEntity.posY - var3, par1Packet10Flying.onGround);
|
||||
this.playerEntity.updateFlyingState(this.playerEntity.posY - d0, par1Packet10Flying.onGround);
|
||||
@@ -447,7 +474,10 @@
|
||||
double var13 = this.playerEntity.posZ - ((double)var8 + 0.5D);
|
||||
double var15 = var9 * var9 + var11 * var11 + var13 * var13;
|
||||
double d2 = this.playerEntity.posZ - ((double)l + 0.5D);
|
||||
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
|
||||
|
||||
- if (var15 > 36.0D)
|
||||
- if (d3 > 36.0D)
|
||||
+ double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 1;
|
||||
+ dist *= dist;
|
||||
+
|
||||
+ if (var15 > dist)
|
||||
+ if (d3 > dist)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -471,6 +501,7 @@
|
||||
{
|
||||
if (var18 <= var3 && !var4)
|
||||
if (j1 <= i && !flag)
|
||||
{
|
||||
+ ForgeEventFactory.onPlayerInteract(playerEntity, Action.LEFT_CLICK_BLOCK, var6, var7, var8, 0);
|
||||
this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var6, var7, var8, var2));
|
||||
+ ForgeEventFactory.onPlayerInteract(playerEntity, Action.LEFT_CLICK_BLOCK, j, k, l, 0);
|
||||
this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(j, k, l, worldserver));
|
||||
}
|
||||
else
|
||||
@@ -518,7 +549,11 @@
|
||||
return;
|
||||
}
|
||||
|
||||
- this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, var2, var3);
|
||||
- this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, worldserver, itemstack);
|
||||
+ PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(playerEntity, PlayerInteractEvent.Action.RIGHT_CLICK_AIR, 0, 0, 0, -1);
|
||||
+ if (event.useItem != Event.Result.DENY)
|
||||
+ {
|
||||
+ this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, var2, var3);
|
||||
+ this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, worldserver, itemstack);
|
||||
+ }
|
||||
}
|
||||
else if (par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit() - 1 && (par1Packet15Place.getDirection() == 1 || par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit()))
|
||||
{
|
||||
@@ -536,7 +571,9 @@
|
||||
var13 = var12;
|
||||
k1 = j1;
|
||||
}
|
||||
|
||||
- if (this.hasMoved && this.playerEntity.getDistanceSq((double)var5 + 0.5D, (double)var6 + 0.5D, (double)var7 + 0.5D) < 64.0D && (var13 > var9 || var10))
|
||||
- if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < 64.0D && (k1 > i1 || flag1))
|
||||
+ double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 1;
|
||||
+ dist *= dist;
|
||||
+ if (this.hasMoved && this.playerEntity.getDistanceSq((double)var5 + 0.5D, (double)var6 + 0.5D, (double)var7 + 0.5D) < dist && (var13 > var9 || var10))
|
||||
+ if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < dist && (k1 > i1 || flag1))
|
||||
{
|
||||
this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, var2, var3, var5, var6, var7, var8, par1Packet15Place.getXOffset(), par1Packet15Place.getYOffset(), par1Packet15Place.getZOffset());
|
||||
this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, i, j, k, l, par1Packet15Place.getXOffset(), par1Packet15Place.getYOffset(), par1Packet15Place.getZOffset());
|
||||
}
|
||||
@@ -703,8 +740,12 @@
|
||||
this.sendPacketToPlayer(new Packet3Chat("Cannot send chat message."));
|
||||
return;
|
||||
}
|
||||
-
|
||||
- var2 = "<" + this.playerEntity.username + "> " + var2;
|
||||
+ ServerChatEvent event = new ServerChatEvent(this.playerEntity, var2, "<" + this.playerEntity.username + "> " + var2);
|
||||
- s = "<" + this.playerEntity.username + "> " + s;
|
||||
+ ServerChatEvent event = new ServerChatEvent(this.playerEntity, s, "<" + this.playerEntity.username + "> " + s);
|
||||
+ if (MinecraftForge.EVENT_BUS.post(event))
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+ var2 = event.line;
|
||||
logger.info(var2);
|
||||
this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet3Chat(var2, false));
|
||||
+ s = event.line;
|
||||
logger.info(s);
|
||||
this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet3Chat(s, false));
|
||||
}
|
||||
@@ -835,7 +876,7 @@
|
||||
return;
|
||||
|
||||
@@ -20,46 +20,46 @@
|
||||
@@ -59,17 +62,22 @@
|
||||
this.zCh = par1Chunk.zPosition;
|
||||
this.includeInitialize = par2;
|
||||
Packet51MapChunkData var4 = getMapChunkData(par1Chunk, par2, par3);
|
||||
- Deflater var5 = new Deflater(-1);
|
||||
this.yChMax = var4.chunkHasAddSectionFlag;
|
||||
this.yChMin = var4.chunkExistFlag;
|
||||
Packet51MapChunkData packet51mapchunkdata = getMapChunkData(par1Chunk, par2, par3);
|
||||
- Deflater deflater = new Deflater(-1);
|
||||
this.yChMax = packet51mapchunkdata.chunkHasAddSectionFlag;
|
||||
this.yChMin = packet51mapchunkdata.chunkExistFlag;
|
||||
-
|
||||
+ this.compressedChunkData = var4.compressedData;
|
||||
+ this.compressedChunkData = packet51mapchunkdata.compressedData;
|
||||
+ this.deflateGate = new Semaphore(1);
|
||||
+ }
|
||||
+
|
||||
+ private void deflate()
|
||||
+ {
|
||||
+ Deflater var5 = new Deflater(-1);
|
||||
+ Deflater deflater = new Deflater(-1);
|
||||
try
|
||||
{
|
||||
- this.compressedChunkData = var4.compressedData;
|
||||
- var5.setInput(var4.compressedData, 0, var4.compressedData.length);
|
||||
+ var5.setInput(compressedChunkData, 0, compressedChunkData.length);
|
||||
var5.finish();
|
||||
- this.chunkData = new byte[var4.compressedData.length];
|
||||
- this.tempLength = var5.deflate(this.chunkData);
|
||||
- this.compressedChunkData = packet51mapchunkdata.compressedData;
|
||||
- deflater.setInput(packet51mapchunkdata.compressedData, 0, packet51mapchunkdata.compressedData.length);
|
||||
+ deflater.setInput(compressedChunkData, 0, compressedChunkData.length);
|
||||
deflater.finish();
|
||||
- this.chunkData = new byte[packet51mapchunkdata.compressedData.length];
|
||||
- this.tempLength = deflater.deflate(this.chunkData);
|
||||
+ byte[] deflated = new byte[compressedChunkData.length];
|
||||
+ this.tempLength = var5.deflate(deflated);
|
||||
+ this.tempLength = deflater.deflate(deflated);
|
||||
+ this.chunkData = deflated;
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -97,13 +105,16 @@
|
||||
par1DataInputStream.readFully(temp, 0, this.tempLength);
|
||||
int var2 = 0;
|
||||
int var3;
|
||||
int i = 0;
|
||||
int j;
|
||||
+ int msb = 0; //BugFix: MC does not read the MSB array from the packet properly, causing issues for servers that use blocks > 256
|
||||
|
||||
for (var3 = 0; var3 < 16; ++var3)
|
||||
for (j = 0; j < 16; ++j)
|
||||
{
|
||||
var2 += this.yChMin >> var3 & 1;
|
||||
+ msb += this.yChMax >> var3 & 1;
|
||||
i += this.yChMin >> j & 1;
|
||||
+ msb += this.yChMax >> j & 1;
|
||||
}
|
||||
|
||||
var3 = 12288 * var2;
|
||||
+ var3 += 2048 * msb;
|
||||
j = 12288 * i;
|
||||
+ j += 2048 * msb;
|
||||
|
||||
if (this.includeInitialize)
|
||||
{
|
||||
|
||||
@@ -20,26 +20,26 @@
|
||||
|
||||
@@ -44,15 +48,6 @@
|
||||
{
|
||||
Chunk var5 = (Chunk)par1List.get(var4);
|
||||
Packet51MapChunkData var6 = Packet51MapChunk.getMapChunkData(var5, true, 65535);
|
||||
Chunk chunk = (Chunk)par1List.get(k);
|
||||
Packet51MapChunkData packet51mapchunkdata = Packet51MapChunk.getMapChunkData(chunk, true, 65535);
|
||||
-
|
||||
- if (chunkDataNotCompressed.length < var3 + var6.compressedData.length)
|
||||
- if (chunkDataNotCompressed.length < j + packet51mapchunkdata.compressedData.length)
|
||||
- {
|
||||
- byte[] var7 = new byte[var3 + var6.compressedData.length];
|
||||
- System.arraycopy(chunkDataNotCompressed, 0, var7, 0, chunkDataNotCompressed.length);
|
||||
- chunkDataNotCompressed = var7;
|
||||
- byte[] abyte = new byte[j + packet51mapchunkdata.compressedData.length];
|
||||
- System.arraycopy(chunkDataNotCompressed, 0, abyte, 0, chunkDataNotCompressed.length);
|
||||
- chunkDataNotCompressed = abyte;
|
||||
- }
|
||||
-
|
||||
- System.arraycopy(var6.compressedData, 0, chunkDataNotCompressed, var3, var6.compressedData.length);
|
||||
var3 += var6.compressedData.length;
|
||||
this.chunkPostX[var4] = var5.xPosition;
|
||||
this.chunkPosZ[var4] = var5.zPosition;
|
||||
- System.arraycopy(packet51mapchunkdata.compressedData, 0, chunkDataNotCompressed, j, packet51mapchunkdata.compressedData.length);
|
||||
j += packet51mapchunkdata.compressedData.length;
|
||||
this.chunkPostX[k] = chunk.xPosition;
|
||||
this.chunkPosZ[k] = chunk.zPosition;
|
||||
@@ -60,15 +55,29 @@
|
||||
this.field_73588_b[var4] = var6.chunkHasAddSectionFlag;
|
||||
this.field_73584_f[var4] = var6.compressedData;
|
||||
this.field_73588_b[k] = packet51mapchunkdata.chunkHasAddSectionFlag;
|
||||
this.field_73584_f[k] = packet51mapchunkdata.compressedData;
|
||||
}
|
||||
+ deflateGate = new Semaphore(1);
|
||||
+ maxLen = var3;
|
||||
+ maxLen = j;
|
||||
+ }
|
||||
+
|
||||
+ private void deflate()
|
||||
@@ -52,17 +52,17 @@
|
||||
+ offset += field_73584_f[x].length;
|
||||
+ }
|
||||
|
||||
Deflater var11 = new Deflater(-1);
|
||||
Deflater deflater = new Deflater(-1);
|
||||
|
||||
try
|
||||
{
|
||||
- var11.setInput(chunkDataNotCompressed, 0, var3);
|
||||
+ var11.setInput(data, 0, maxLen);
|
||||
var11.finish();
|
||||
- this.chunkDataBuffer = new byte[var3];
|
||||
- this.dataLength = var11.deflate(this.chunkDataBuffer);
|
||||
- deflater.setInput(chunkDataNotCompressed, 0, j);
|
||||
+ deflater.setInput(data, 0, maxLen);
|
||||
deflater.finish();
|
||||
- this.chunkDataBuffer = new byte[j];
|
||||
- this.dataLength = deflater.deflate(this.chunkDataBuffer);
|
||||
+ byte[] deflated = new byte[maxLen];
|
||||
+ this.dataLength = var11.deflate(deflated);
|
||||
+ this.dataLength = deflater.deflate(deflated);
|
||||
+ this.chunkDataBuffer = deflated;
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -35,53 +35,53 @@
|
||||
this.setUserMessage("menu.loadingLevel");
|
||||
- this.worldServers = new WorldServer[3];
|
||||
- this.timeOfLastDimensionTick = new long[this.worldServers.length][100];
|
||||
ISaveHandler var7 = this.anvilConverterForAnvilFile.getSaveLoader(par1Str, true);
|
||||
WorldInfo var9 = var7.loadWorldInfo();
|
||||
WorldSettings var8;
|
||||
ISaveHandler isavehandler = this.anvilConverterForAnvilFile.getSaveLoader(par1Str, true);
|
||||
WorldInfo worldinfo = isavehandler.loadWorldInfo();
|
||||
WorldSettings worldsettings;
|
||||
@@ -259,46 +263,23 @@
|
||||
var8.enableBonusChest();
|
||||
worldsettings.enableBonusChest();
|
||||
}
|
||||
|
||||
- for (int var10 = 0; var10 < this.worldServers.length; ++var10)
|
||||
- for (int j = 0; j < this.worldServers.length; ++j)
|
||||
- {
|
||||
- byte var11 = 0;
|
||||
- byte b0 = 0;
|
||||
-
|
||||
- if (var10 == 1)
|
||||
- if (j == 1)
|
||||
- {
|
||||
- var11 = -1;
|
||||
- b0 = -1;
|
||||
- }
|
||||
-
|
||||
- if (var10 == 2)
|
||||
- if (j == 2)
|
||||
- {
|
||||
- var11 = 1;
|
||||
- b0 = 1;
|
||||
- }
|
||||
-
|
||||
- if (var10 == 0)
|
||||
- if (j == 0)
|
||||
- {
|
||||
- if (this.isDemo())
|
||||
- {
|
||||
- this.worldServers[var10] = new DemoWorldServer(this, var7, par2Str, var11, this.theProfiler);
|
||||
- this.worldServers[j] = new DemoWorldServer(this, isavehandler, par2Str, b0, this.theProfiler);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- this.worldServers[var10] = new WorldServer(this, var7, par2Str, var11, var8, this.theProfiler);
|
||||
- this.worldServers[j] = new WorldServer(this, isavehandler, par2Str, b0, worldsettings, this.theProfiler);
|
||||
- }
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- this.worldServers[var10] = new WorldServerMulti(this, var7, par2Str, var11, var8, this.worldServers[0], this.theProfiler);
|
||||
- this.worldServers[j] = new WorldServerMulti(this, isavehandler, par2Str, b0, worldsettings, this.worldServers[0], this.theProfiler);
|
||||
- }
|
||||
-
|
||||
- this.worldServers[var10].addWorldAccess(new WorldManager(this, this.worldServers[var10]));
|
||||
+ WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, var7, par2Str, 0, theProfiler) : new WorldServer(this, var7, par2Str, 0, var8, theProfiler));
|
||||
- this.worldServers[j].addWorldAccess(new WorldManager(this, this.worldServers[j]));
|
||||
+ WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, par2Str, 0, theProfiler) : new WorldServer(this, isavehandler, par2Str, 0, worldsettings, theProfiler));
|
||||
+ for (int dim : DimensionManager.getStaticDimensionIDs())
|
||||
+ {
|
||||
+ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, var7, par2Str, dim, var8, overWorld, theProfiler));
|
||||
+ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, par2Str, dim, worldsettings, overWorld, theProfiler));
|
||||
+ world.addWorldAccess(new WorldManager(this, world));
|
||||
|
||||
if (!this.isSinglePlayer())
|
||||
{
|
||||
- this.worldServers[var10].getWorldInfo().setGameType(this.getGameType());
|
||||
- this.worldServers[j].getWorldInfo().setGameType(this.getGameType());
|
||||
+ world.getWorldInfo().setGameType(this.getGameType());
|
||||
}
|
||||
|
||||
@@ -97,11 +97,11 @@
|
||||
this.initialWorldChunkLoad();
|
||||
}
|
||||
@@ -427,7 +408,14 @@
|
||||
for (int var1 = 0; var1 < this.worldServers.length; ++var1)
|
||||
for (int i = 0; i < this.worldServers.length; ++i)
|
||||
{
|
||||
WorldServer var2 = this.worldServers[var1];
|
||||
+ MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(var2));
|
||||
var2.flush();
|
||||
WorldServer worldserver = this.worldServers[i];
|
||||
+ MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(worldserver));
|
||||
worldserver.flush();
|
||||
+ }
|
||||
+
|
||||
+ WorldServer[] tmp = worldServers;
|
||||
@@ -113,33 +113,33 @@
|
||||
if (this.usageSnooper != null && this.usageSnooper.isSnooperRunning())
|
||||
@@ -651,13 +639,15 @@
|
||||
this.theProfiler.startSection("levels");
|
||||
int var1;
|
||||
int i;
|
||||
|
||||
- for (var1 = 0; var1 < this.worldServers.length; ++var1)
|
||||
- for (i = 0; i < this.worldServers.length; ++i)
|
||||
- {
|
||||
+ Integer[] ids = DimensionManager.getIDs();
|
||||
+ for (int x = 0; x < ids.length; x++)
|
||||
+ {
|
||||
+ int id = ids[x];
|
||||
long var2 = System.nanoTime();
|
||||
long j = System.nanoTime();
|
||||
|
||||
- if (var1 == 0 || this.getAllowNether())
|
||||
- if (i == 0 || this.getAllowNether())
|
||||
- {
|
||||
- WorldServer var4 = this.worldServers[var1];
|
||||
- WorldServer worldserver = this.worldServers[i];
|
||||
+ if (id == 0 || this.getAllowNether())
|
||||
+ {
|
||||
+ WorldServer var4 = DimensionManager.getWorld(id);
|
||||
this.theProfiler.startSection(var4.getWorldInfo().getWorldName());
|
||||
+ WorldServer worldserver = DimensionManager.getWorld(id);
|
||||
this.theProfiler.startSection(worldserver.getWorldInfo().getWorldName());
|
||||
this.theProfiler.startSection("pools");
|
||||
var4.getWorldVec3Pool().clear();
|
||||
worldserver.getWorldVec3Pool().clear();
|
||||
@@ -704,9 +694,11 @@
|
||||
this.theProfiler.endSection();
|
||||
}
|
||||
|
||||
- this.timeOfLastDimensionTick[var1][this.tickCounter % 100] = System.nanoTime() - var2;
|
||||
- this.timeOfLastDimensionTick[i][this.tickCounter % 100] = System.nanoTime() - j;
|
||||
- }
|
||||
-
|
||||
+ worldTickTimes.get(id)[this.tickCounter % 100] = System.nanoTime() - var2;
|
||||
+ worldTickTimes.get(id)[this.tickCounter % 100] = System.nanoTime() - j;
|
||||
+ }
|
||||
+
|
||||
+ this.theProfiler.endStartSection("dim_unloading");
|
||||
@@ -164,9 +164,9 @@
|
||||
@SideOnly(Side.SERVER)
|
||||
@@ -1131,6 +1129,7 @@
|
||||
|
||||
if (var2 != null)
|
||||
if (worldserver != null)
|
||||
{
|
||||
+ MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(var2));
|
||||
var2.flush();
|
||||
+ MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(worldserver));
|
||||
worldserver.flush();
|
||||
}
|
||||
}
|
||||
@@ -14,30 +14,30 @@
|
||||
private void updateStats()
|
||||
{
|
||||
+ this.displayStrings = new String[5 + DimensionManager.getIDs().length];
|
||||
long var1 = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
|
||||
long i = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
|
||||
System.gc();
|
||||
this.displayStrings[0] = "Memory use: " + var1 / 1024L / 1024L + " mb (" + Runtime.getRuntime().freeMemory() * 100L / Runtime.getRuntime().maxMemory() + "% free)";
|
||||
this.displayStrings[0] = "Memory use: " + i / 1024L / 1024L + " mb (" + Runtime.getRuntime().freeMemory() * 100L / Runtime.getRuntime().maxMemory() + "% free)";
|
||||
@@ -53,15 +56,18 @@
|
||||
|
||||
if (this.field_79017_e.worldServers != null)
|
||||
{
|
||||
- for (int var3 = 0; var3 < this.field_79017_e.worldServers.length; ++var3)
|
||||
+ int var3 = 0;
|
||||
- for (int j = 0; j < this.field_79017_e.worldServers.length; ++j)
|
||||
+ int j = 0;
|
||||
+ for (Integer id : DimensionManager.getIDs())
|
||||
{
|
||||
- this.displayStrings[5 + var3] = "Lvl " + var3 + " tick: " + field_79020_a.format(this.func_79015_a(this.field_79017_e.timeOfLastDimensionTick[var3]) * 1.0E-6D) + " ms";
|
||||
+ this.displayStrings[5 + var3] = "Lvl " + id + " tick: " + field_79020_a.format(this.func_79015_a(this.field_79017_e.worldTickTimes.get(id)) * 1.0E-6D) + " ms";
|
||||
- this.displayStrings[5 + j] = "Lvl " + j + " tick: " + field_79020_a.format(this.func_79015_a(this.field_79017_e.timeOfLastDimensionTick[j]) * 1.0E-6D) + " ms";
|
||||
+ this.displayStrings[5 + j] = "Lvl " + id + " tick: " + field_79020_a.format(this.func_79015_a(this.field_79017_e.worldTickTimes.get(id)) * 1.0E-6D) + " ms";
|
||||
|
||||
- if (this.field_79017_e.worldServers[var3] != null && this.field_79017_e.worldServers[var3].theChunkProviderServer != null)
|
||||
- if (this.field_79017_e.worldServers[j] != null && this.field_79017_e.worldServers[j].theChunkProviderServer != null)
|
||||
+ WorldServer world = DimensionManager.getWorld(id);
|
||||
+ if (world != null && world.theChunkProviderServer != null)
|
||||
{
|
||||
- this.displayStrings[5 + var3] = this.displayStrings[5 + var3] + ", " + this.field_79017_e.worldServers[var3].theChunkProviderServer.makeString();
|
||||
- this.displayStrings[5 + var3] = this.displayStrings[5 + var3] + ", Vec3: " + this.field_79017_e.worldServers[var3].getWorldVec3Pool().func_82590_d() + " / " + this.field_79017_e.worldServers[var3].getWorldVec3Pool().getPoolSize();
|
||||
+ this.displayStrings[5 + var3] = this.displayStrings[5 + var3] + ", " + world.theChunkProviderServer.makeString();
|
||||
+ this.displayStrings[5 + var3] = this.displayStrings[5 + var3] + ", Vec3: " + world.getWorldVec3Pool().func_82590_d() + " / " + world.getWorldVec3Pool().getPoolSize();
|
||||
- this.displayStrings[5 + j] = this.displayStrings[5 + j] + ", " + this.field_79017_e.worldServers[j].theChunkProviderServer.makeString();
|
||||
- this.displayStrings[5 + j] = this.displayStrings[5 + j] + ", Vec3: " + this.field_79017_e.worldServers[j].getWorldVec3Pool().func_82590_d() + " / " + this.field_79017_e.worldServers[j].getWorldVec3Pool().getPoolSize();
|
||||
+ this.displayStrings[5 + j] = this.displayStrings[5 + j] + ", " + world.theChunkProviderServer.makeString();
|
||||
+ this.displayStrings[5 + j] = this.displayStrings[5 + j] + ", Vec3: " + world.getWorldVec3Pool().func_82590_d() + " / " + world.getWorldVec3Pool().getPoolSize();
|
||||
}
|
||||
+ var3++;
|
||||
+ j++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,46 +17,46 @@
|
||||
this.convertMapIfNeeded(par1Str);
|
||||
- this.worldServers = new WorldServer[3];
|
||||
- this.timeOfLastDimensionTick = new long[this.worldServers.length][100];
|
||||
ISaveHandler var7 = this.getActiveAnvilConverter().getSaveLoader(par1Str, true);
|
||||
ISaveHandler isavehandler = this.getActiveAnvilConverter().getSaveLoader(par1Str, true);
|
||||
|
||||
- for (int var8 = 0; var8 < this.worldServers.length; ++var8)
|
||||
- for (int j = 0; j < this.worldServers.length; ++j)
|
||||
- {
|
||||
- byte var9 = 0;
|
||||
- byte b0 = 0;
|
||||
-
|
||||
- if (var8 == 1)
|
||||
+ WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, var7, par2Str, 0, theProfiler) : new WorldServer(this, var7, par2Str, 0, theWorldSettings, theProfiler));
|
||||
- if (j == 1)
|
||||
+ WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, par2Str, 0, theProfiler) : new WorldServer(this, isavehandler, par2Str, 0, theWorldSettings, theProfiler));
|
||||
+ for (int dim : DimensionManager.getStaticDimensionIDs())
|
||||
+ {
|
||||
+ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, var7, par2Str, dim, theWorldSettings, overWorld, theProfiler));
|
||||
+ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, par2Str, dim, theWorldSettings, overWorld, theProfiler));
|
||||
+ world.addWorldAccess(new WorldManager(this, world));
|
||||
+ if (!this.isSinglePlayer())
|
||||
{
|
||||
- var9 = -1;
|
||||
- b0 = -1;
|
||||
+ world.getWorldInfo().setGameType(this.getGameType());
|
||||
}
|
||||
|
||||
- if (var8 == 2)
|
||||
- if (j == 2)
|
||||
- {
|
||||
- var9 = 1;
|
||||
- b0 = 1;
|
||||
- }
|
||||
-
|
||||
- if (var8 == 0)
|
||||
- if (j == 0)
|
||||
- {
|
||||
- if (this.isDemo())
|
||||
- {
|
||||
- this.worldServers[var8] = new DemoWorldServer(this, var7, par2Str, var9, this.theProfiler);
|
||||
- this.worldServers[j] = new DemoWorldServer(this, isavehandler, par2Str, b0, this.theProfiler);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- this.worldServers[var8] = new WorldServer(this, var7, par2Str, var9, this.theWorldSettings, this.theProfiler);
|
||||
- this.worldServers[j] = new WorldServer(this, isavehandler, par2Str, b0, this.theWorldSettings, this.theProfiler);
|
||||
- }
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- this.worldServers[var8] = new WorldServerMulti(this, var7, par2Str, var9, this.theWorldSettings, this.worldServers[0], this.theProfiler);
|
||||
- this.worldServers[j] = new WorldServerMulti(this, isavehandler, par2Str, b0, this.theWorldSettings, this.worldServers[0], this.theProfiler);
|
||||
- }
|
||||
-
|
||||
- this.worldServers[var8].addWorldAccess(new WorldManager(this, this.worldServers[var8]));
|
||||
- this.worldServers[j].addWorldAccess(new WorldManager(this, this.worldServers[j]));
|
||||
- this.getConfigurationManager().setPlayerManager(this.worldServers);
|
||||
- }
|
||||
-
|
||||
|
||||
@@ -24,14 +24,14 @@
|
||||
if (this.playersInChunk.isEmpty())
|
||||
{
|
||||
@@ -144,7 +149,10 @@
|
||||
if ((this.field_73260_f & 1 << var3) != 0)
|
||||
if ((this.field_73260_f & 1 << k) != 0)
|
||||
{
|
||||
var4 = var3 << 4;
|
||||
- List var5 = PlayerManager.getWorldServer(this.myManager).getAllTileEntityInBox(var1, var4, var2, var1 + 16, var4 + 16, var2 + 16);
|
||||
l = k << 4;
|
||||
- List list = PlayerManager.getWorldServer(this.myManager).getAllTileEntityInBox(i, l, j, i + 16, l + 16, j + 16);
|
||||
+ //BugFix: 16 makes it load an extra chunk, which isn't associated with a player, which makes it not unload unless a player walks near it.
|
||||
+ //ToDo: Find a way to efficiently clean abandoned chunks.
|
||||
+ //List var5 = PlayerManager.getWorldServer(this.myManager).getAllTileEntityInBox(var1, var4, var2, var1 + 16, var4 + 16, var2 + 16);
|
||||
+ List var5 = PlayerManager.getWorldServer(this.myManager).getAllTileEntityInBox(var1, var4, var2, var1 + 15, var4 + 16, var2 + 15);
|
||||
+ //List list = PlayerManager.getWorldServer(this.myManager).getAllTileEntityInBox(i, l, j, i + 16, l + 16, j + 16);
|
||||
+ List list = PlayerManager.getWorldServer(this.myManager).getAllTileEntityInBox(i, l, j, i + 15, l + 16, j + 15);
|
||||
|
||||
for (int var6 = 0; var6 < var5.size(); ++var6)
|
||||
for (int i1 = 0; i1 < list.size(); ++i1)
|
||||
{
|
||||
+35
-35
@@ -33,13 +33,13 @@
|
||||
par1EntityPlayerMP.getServerForPlayer().getEntityTracker().removeEntityFromAllTrackingPlayers(par1EntityPlayerMP);
|
||||
par1EntityPlayerMP.getServerForPlayer().getPlayerManager().removePlayer(par1EntityPlayerMP);
|
||||
@@ -345,6 +359,7 @@
|
||||
EntityPlayerMP var7 = new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension), par1EntityPlayerMP.username, (ItemInWorldManager)var6);
|
||||
var7.playerNetServerHandler = par1EntityPlayerMP.playerNetServerHandler;
|
||||
var7.clonePlayer(par1EntityPlayerMP, par3);
|
||||
+ var7.dimension = par2;
|
||||
var7.entityId = par1EntityPlayerMP.entityId;
|
||||
WorldServer var8 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
|
||||
this.func_72381_a(var7, par1EntityPlayerMP, var8);
|
||||
EntityPlayerMP entityplayermp1 = new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension), par1EntityPlayerMP.username, (ItemInWorldManager)object);
|
||||
entityplayermp1.playerNetServerHandler = par1EntityPlayerMP.playerNetServerHandler;
|
||||
entityplayermp1.clonePlayer(par1EntityPlayerMP, par3);
|
||||
+ entityplayermp1.dimension = par2;
|
||||
entityplayermp1.entityId = par1EntityPlayerMP.entityId;
|
||||
WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
|
||||
this.func_72381_a(entityplayermp1, par1EntityPlayerMP, worldserver);
|
||||
@@ -388,14 +403,20 @@
|
||||
|
||||
public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2)
|
||||
@@ -49,26 +49,26 @@
|
||||
+
|
||||
+ public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2, Teleporter teleporter)
|
||||
+ {
|
||||
int var3 = par1EntityPlayerMP.dimension;
|
||||
WorldServer var4 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
|
||||
int j = par1EntityPlayerMP.dimension;
|
||||
WorldServer worldserver = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
|
||||
par1EntityPlayerMP.dimension = par2;
|
||||
WorldServer var5 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
|
||||
WorldServer worldserver1 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
|
||||
+
|
||||
par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet9Respawn(par1EntityPlayerMP.dimension, (byte)par1EntityPlayerMP.worldObj.difficultySetting, var5.getWorldInfo().getTerrainType(), var5.getHeight(), par1EntityPlayerMP.theItemInWorldManager.getGameType()));
|
||||
var4.removeEntity(par1EntityPlayerMP);
|
||||
par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet9Respawn(par1EntityPlayerMP.dimension, (byte)par1EntityPlayerMP.worldObj.difficultySetting, worldserver1.getWorldInfo().getTerrainType(), worldserver1.getHeight(), par1EntityPlayerMP.theItemInWorldManager.getGameType()));
|
||||
worldserver.removeEntity(par1EntityPlayerMP);
|
||||
par1EntityPlayerMP.isDead = false;
|
||||
- this.transferEntityToWorld(par1EntityPlayerMP, var3, var4, var5);
|
||||
+ this.transferEntityToWorld(par1EntityPlayerMP, var3, var4, var5, teleporter);
|
||||
this.func_72375_a(par1EntityPlayerMP, var4);
|
||||
- this.transferEntityToWorld(par1EntityPlayerMP, j, worldserver, worldserver1);
|
||||
+ this.transferEntityToWorld(par1EntityPlayerMP, j, worldserver, worldserver1, teleporter);
|
||||
this.func_72375_a(par1EntityPlayerMP, worldserver);
|
||||
par1EntityPlayerMP.playerNetServerHandler.setPlayerLocation(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch);
|
||||
par1EntityPlayerMP.theItemInWorldManager.setWorld(var5);
|
||||
par1EntityPlayerMP.theItemInWorldManager.setWorld(worldserver1);
|
||||
@@ -417,38 +438,23 @@
|
||||
*/
|
||||
public void transferEntityToWorld(Entity par1Entity, int par2, WorldServer par3WorldServer, WorldServer par4WorldServer)
|
||||
{
|
||||
- double var5 = par1Entity.posX;
|
||||
- double var7 = par1Entity.posZ;
|
||||
- double var9 = 8.0D;
|
||||
- double d0 = par1Entity.posX;
|
||||
- double d1 = par1Entity.posZ;
|
||||
- double d2 = 8.0D;
|
||||
+ transferEntityToWorld(par1Entity, par2, par3WorldServer, par4WorldServer, par4WorldServer.func_85176_s());
|
||||
+ }
|
||||
+
|
||||
@@ -77,19 +77,19 @@
|
||||
+ WorldProvider pOld = par3WorldServer.provider;
|
||||
+ WorldProvider pNew = par4WorldServer.provider;
|
||||
+ double moveFactor = pOld.getMovementFactor() / pNew.getMovementFactor();
|
||||
+ double var5 = par1Entity.posX * moveFactor;
|
||||
+ double var7 = par1Entity.posZ * moveFactor;
|
||||
double var11 = par1Entity.posX;
|
||||
double var13 = par1Entity.posY;
|
||||
double var15 = par1Entity.posZ;
|
||||
float var17 = par1Entity.rotationYaw;
|
||||
+ double d0 = par1Entity.posX * moveFactor;
|
||||
+ double d1 = par1Entity.posZ * moveFactor;
|
||||
double d3 = par1Entity.posX;
|
||||
double d4 = par1Entity.posY;
|
||||
double d5 = par1Entity.posZ;
|
||||
float f = par1Entity.rotationYaw;
|
||||
par3WorldServer.theProfiler.startSection("moving");
|
||||
|
||||
- if (par1Entity.dimension == -1)
|
||||
- {
|
||||
- var5 /= var9;
|
||||
- var7 /= var9;
|
||||
- par1Entity.setLocationAndAngles(var5, par1Entity.posY, var7, par1Entity.rotationYaw, par1Entity.rotationPitch);
|
||||
- d0 /= d2;
|
||||
- d1 /= d2;
|
||||
- par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch);
|
||||
-
|
||||
- if (par1Entity.isEntityAlive())
|
||||
- {
|
||||
@@ -98,9 +98,9 @@
|
||||
- }
|
||||
- else if (par1Entity.dimension == 0)
|
||||
- {
|
||||
- var5 *= var9;
|
||||
- var7 *= var9;
|
||||
- par1Entity.setLocationAndAngles(var5, par1Entity.posY, var7, par1Entity.rotationYaw, par1Entity.rotationPitch);
|
||||
- d0 *= d2;
|
||||
- d1 *= d2;
|
||||
- par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch);
|
||||
-
|
||||
- if (par1Entity.isEntityAlive())
|
||||
- {
|
||||
@@ -110,14 +110,14 @@
|
||||
- else
|
||||
+ if (par1Entity.dimension == 1)
|
||||
{
|
||||
ChunkCoordinates var18;
|
||||
ChunkCoordinates chunkcoordinates;
|
||||
|
||||
@@ -485,7 +491,7 @@
|
||||
par4WorldServer.spawnEntityInWorld(par1Entity);
|
||||
par1Entity.setLocationAndAngles(var5, par1Entity.posY, var7, par1Entity.rotationYaw, par1Entity.rotationPitch);
|
||||
par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch);
|
||||
par4WorldServer.updateEntityWithOptionalForce(par1Entity, false);
|
||||
- par4WorldServer.func_85176_s().placeInPortal(par1Entity, var11, var13, var15, var17);
|
||||
+ teleporter.placeInPortal(par1Entity, var11, var13, var15, var17);
|
||||
- par4WorldServer.func_85176_s().placeInPortal(par1Entity, d3, d4, d5, f);
|
||||
+ teleporter.placeInPortal(par1Entity, d3, d4, d5, f);
|
||||
}
|
||||
|
||||
par3WorldServer.theProfiler.endSection();
|
||||
@@ -4,12 +4,12 @@
|
||||
*/
|
||||
private static StatBase[] initMinableStats(String par0Str, int par1)
|
||||
{
|
||||
- StatBase[] var2 = new StatBase[256];
|
||||
- StatBase[] astatbase = new StatBase[256];
|
||||
-
|
||||
- for (int var3 = 0; var3 < 256; ++var3)
|
||||
+ StatBase[] var2 = new StatBase[Block.blocksList.length];
|
||||
- for (int j = 0; j < 256; ++j)
|
||||
+ StatBase[] astatbase = new StatBase[Block.blocksList.length];
|
||||
+
|
||||
+ for (int var3 = 0; var3 < Block.blocksList.length; ++var3)
|
||||
+ for (int j = 0; j < Block.blocksList.length; ++j)
|
||||
{
|
||||
if (Block.blocksList[var3] != null && Block.blocksList[var3].getEnableStats())
|
||||
if (Block.blocksList[j] != null && Block.blocksList[j].getEnableStats())
|
||||
{
|
||||
@@ -1,14 +1,14 @@
|
||||
--- ../src_base/minecraft/net/minecraft/tileentity/TileEntityBeacon.java
|
||||
+++ ../src_work/minecraft/net/minecraft/tileentity/TileEntityBeacon.java
|
||||
@@ -114,8 +114,9 @@
|
||||
for (int var5 = this.zCoord - var1; var5 <= this.zCoord + var1; ++var5)
|
||||
for (int l = this.zCoord - i; l <= this.zCoord + i; ++l)
|
||||
{
|
||||
int var6 = this.worldObj.getBlockId(var4, var2, var5);
|
||||
int i1 = this.worldObj.getBlockId(k, j, l);
|
||||
-
|
||||
- if (var6 != Block.blockEmerald.blockID && var6 != Block.blockGold.blockID && var6 != Block.blockDiamond.blockID && var6 != Block.blockSteel.blockID)
|
||||
+ Block block = Block.blocksList[var6];
|
||||
- if (i1 != Block.blockEmerald.blockID && i1 != Block.blockGold.blockID && i1 != Block.blockDiamond.blockID && i1 != Block.blockSteel.blockID)
|
||||
+ Block block = Block.blocksList[i1];
|
||||
+
|
||||
+ if (block == null || !block.isBeaconBase(worldObj, var4, var2, var5, xCoord, yCoord, zCoord))
|
||||
+ if (block == null || !block.isBeaconBase(worldObj, k, j, l, xCoord, yCoord, zCoord))
|
||||
{
|
||||
var3 = false;
|
||||
flag = false;
|
||||
break;
|
||||
@@ -14,16 +14,16 @@
|
||||
private ItemStack[] brewingItemStacks = new ItemStack[4];
|
||||
@@ -166,7 +169,7 @@
|
||||
|
||||
if (Item.itemsList[var1.itemID].hasContainerItem())
|
||||
if (Item.itemsList[itemstack.itemID].hasContainerItem())
|
||||
{
|
||||
- this.brewingItemStacks[3] = new ItemStack(Item.itemsList[var1.itemID].getContainerItem());
|
||||
+ this.brewingItemStacks[3] = Item.itemsList[var1.itemID].getContainerItemStack(brewingItemStacks[3]);
|
||||
- this.brewingItemStacks[3] = new ItemStack(Item.itemsList[itemstack.itemID].getContainerItem());
|
||||
+ this.brewingItemStacks[3] = Item.itemsList[itemstack.itemID].getContainerItemStack(brewingItemStacks[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -333,4 +336,16 @@
|
||||
|
||||
return var1;
|
||||
return i;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
|
||||
if (this.furnaceItemStacks[1].stackSize == 0)
|
||||
{
|
||||
- Item var3 = this.furnaceItemStacks[1].getItem().getContainerItem();
|
||||
- this.furnaceItemStacks[1] = var3 != null ? new ItemStack(var3) : null;
|
||||
- Item item = this.furnaceItemStacks[1].getItem().getContainerItem();
|
||||
- this.furnaceItemStacks[1] = item != null ? new ItemStack(item) : null;
|
||||
+ this.furnaceItemStacks[1] = this.furnaceItemStacks[1].getItem().getContainerItemStack(furnaceItemStacks[1]);
|
||||
}
|
||||
}
|
||||
@@ -34,14 +34,14 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- 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())));
|
||||
+ ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);
|
||||
+ if (var1 == null) return false;
|
||||
- ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().itemID);
|
||||
- return itemstack == null ? false : (this.furnaceItemStacks[2] == null ? true : (!this.furnaceItemStacks[2].isItemEqual(itemstack) ? false : (this.furnaceItemStacks[2].stackSize < this.getInventoryStackLimit() && this.furnaceItemStacks[2].stackSize < this.furnaceItemStacks[2].getMaxStackSize() ? true : this.furnaceItemStacks[2].stackSize < itemstack.getMaxStackSize())));
|
||||
+ ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);
|
||||
+ if (itemstack == null) return false;
|
||||
+ if (this.furnaceItemStacks[2] == null) return true;
|
||||
+ if (!this.furnaceItemStacks[2].isItemEqual(var1)) return false;
|
||||
+ int result = furnaceItemStacks[2].stackSize + var1.stackSize;
|
||||
+ return (result <= getInventoryStackLimit() && result <= var1.getMaxStackSize());
|
||||
+ if (!this.furnaceItemStacks[2].isItemEqual(itemstack)) return false;
|
||||
+ int result = furnaceItemStacks[2].stackSize + itemstack.stackSize;
|
||||
+ return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,30 +49,30 @@
|
||||
{
|
||||
if (this.canSmelt())
|
||||
{
|
||||
- ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().itemID);
|
||||
+ ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);
|
||||
- ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().itemID);
|
||||
+ ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);
|
||||
|
||||
if (this.furnaceItemStacks[2] == null)
|
||||
{
|
||||
this.furnaceItemStacks[2] = var1.copy();
|
||||
this.furnaceItemStacks[2] = itemstack.copy();
|
||||
}
|
||||
- else if (this.furnaceItemStacks[2].itemID == var1.itemID)
|
||||
- else if (this.furnaceItemStacks[2].itemID == itemstack.itemID)
|
||||
- {
|
||||
- ++this.furnaceItemStacks[2].stackSize;
|
||||
+ else if (this.furnaceItemStacks[2].isItemEqual(var1))
|
||||
+ else if (this.furnaceItemStacks[2].isItemEqual(itemstack))
|
||||
+ {
|
||||
+ furnaceItemStacks[2].stackSize += var1.stackSize;
|
||||
+ furnaceItemStacks[2].stackSize += itemstack.stackSize;
|
||||
}
|
||||
|
||||
--this.furnaceItemStacks[0].stackSize;
|
||||
@@ -341,7 +348,7 @@
|
||||
int var1 = par0ItemStack.getItem().itemID;
|
||||
Item var2 = par0ItemStack.getItem();
|
||||
int i = par0ItemStack.getItem().itemID;
|
||||
Item item = par0ItemStack.getItem();
|
||||
|
||||
- if (var1 < 256 && Block.blocksList[var1] != null)
|
||||
+ if (par0ItemStack.getItem() instanceof ItemBlock && Block.blocksList[var1] != null)
|
||||
- if (i < 256 && Block.blocksList[i] != null)
|
||||
+ if (par0ItemStack.getItem() instanceof ItemBlock && Block.blocksList[i] != null)
|
||||
{
|
||||
Block var3 = Block.blocksList[var1];
|
||||
Block block = Block.blocksList[i];
|
||||
|
||||
@@ -387,4 +394,18 @@
|
||||
public void openChest() {}
|
||||
|
||||
@@ -10,28 +10,28 @@
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -48,7 +50,11 @@
|
||||
URL var1 = new URL("http://s3.amazonaws.com/MinecraftResources/");
|
||||
DocumentBuilderFactory var2 = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder var3 = var2.newDocumentBuilder();
|
||||
- Document var4 = var3.parse(var1.openStream());
|
||||
URL url = new URL("http://s3.amazonaws.com/MinecraftResources/");
|
||||
DocumentBuilderFactory documentbuilderfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder documentbuilder = documentbuilderfactory.newDocumentBuilder();
|
||||
- Document document = documentbuilder.parse(url.openStream());
|
||||
+ //Add a timeout of 60 seconds to getting the list, MC stalls without sound for some users.
|
||||
+ URLConnection con = var1.openConnection();
|
||||
+ URLConnection con = url.openConnection();
|
||||
+ con.setConnectTimeout(60000);
|
||||
+ con.setReadTimeout(60000);
|
||||
+ Document var4 = var3.parse(con.getInputStream());
|
||||
NodeList var5 = var4.getElementsByTagName("Contents");
|
||||
+ Document document = documentbuilder.parse(con.getInputStream());
|
||||
NodeList nodelist = document.getElementsByTagName("Contents");
|
||||
|
||||
for (int var6 = 0; var6 < 2; ++var6)
|
||||
for (int i = 0; i < 2; ++i)
|
||||
@@ -168,7 +174,11 @@
|
||||
private void downloadResource(URL par1URL, File par2File, long par3) throws IOException
|
||||
{
|
||||
byte[] var5 = new byte[4096];
|
||||
- DataInputStream var6 = new DataInputStream(par1URL.openStream());
|
||||
byte[] abyte = new byte[4096];
|
||||
- DataInputStream datainputstream = new DataInputStream(par1URL.openStream());
|
||||
+ //Add a timeout of 60 seconds to getting the list, MC stalls without sound for some users.
|
||||
+ URLConnection con = par1URL.openConnection();
|
||||
+ con.setConnectTimeout(60000);
|
||||
+ con.setReadTimeout(60000);
|
||||
+ DataInputStream var6 = new DataInputStream(con.getInputStream());
|
||||
DataOutputStream var7 = new DataOutputStream(new FileOutputStream(par2File));
|
||||
boolean var8 = false;
|
||||
+ DataInputStream datainputstream = new DataInputStream(con.getInputStream());
|
||||
DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(par2File));
|
||||
boolean flag = false;
|
||||
|
||||
@@ -21,59 +21,59 @@
|
||||
+ @SuppressWarnings("deprecation")
|
||||
public static void generateChestContents(Random par0Random, WeightedRandomChestContent[] par1ArrayOfWeightedRandomChestContent, TileEntityChest par2TileEntityChest, int par3)
|
||||
{
|
||||
for (int var4 = 0; var4 < par3; ++var4)
|
||||
for (int j = 0; j < par3; ++j)
|
||||
{
|
||||
WeightedRandomChestContent var5 = (WeightedRandomChestContent)WeightedRandom.getRandomItem(par0Random, par1ArrayOfWeightedRandomChestContent);
|
||||
- int var6 = var5.theMinimumChanceToGenerateItem + par0Random.nextInt(var5.theMaximumChanceToGenerateItem - var5.theMinimumChanceToGenerateItem + 1);
|
||||
WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(par0Random, par1ArrayOfWeightedRandomChestContent);
|
||||
- int k = weightedrandomchestcontent.theMinimumChanceToGenerateItem + par0Random.nextInt(weightedrandomchestcontent.theMaximumChanceToGenerateItem - weightedrandomchestcontent.theMinimumChanceToGenerateItem + 1);
|
||||
|
||||
- if (var5.theItemId.getMaxStackSize() >= var6)
|
||||
+ if (var5 instanceof DungeonHooks.DungeonLoot)
|
||||
- if (weightedrandomchestcontent.theItemId.getMaxStackSize() >= k)
|
||||
+ if (weightedrandomchestcontent instanceof DungeonHooks.DungeonLoot)
|
||||
{
|
||||
- ItemStack var7 = var5.theItemId.copy();
|
||||
- var7.stackSize = var6;
|
||||
- par2TileEntityChest.setInventorySlotContents(par0Random.nextInt(par2TileEntityChest.getSizeInventory()), var7);
|
||||
+ DungeonHooks.DungeonLoot loot = (DungeonHooks.DungeonLoot)var5;
|
||||
- ItemStack itemstack = weightedrandomchestcontent.theItemId.copy();
|
||||
- itemstack.stackSize = k;
|
||||
- par2TileEntityChest.setInventorySlotContents(par0Random.nextInt(par2TileEntityChest.getSizeInventory()), itemstack);
|
||||
+ DungeonHooks.DungeonLoot loot = (DungeonHooks.DungeonLoot)weightedrandomchestcontent;
|
||||
+ par2TileEntityChest.setInventorySlotContents(par0Random.nextInt(par2TileEntityChest.getSizeInventory()), loot.generateStack(par0Random));
|
||||
+ FMLLog.warning("Some mod is still using DungeonHooks.DungonLoot, tell them to stop! %s", loot);
|
||||
+ continue;
|
||||
}
|
||||
- else
|
||||
+
|
||||
+ ItemStack[] stacks = ChestGenHooks.generateStacks(par0Random, var5.theItemId, var5.theMinimumChanceToGenerateItem, var5.theMaximumChanceToGenerateItem);
|
||||
+ ItemStack[] stacks = ChestGenHooks.generateStacks(par0Random, weightedrandomchestcontent.theItemId, weightedrandomchestcontent.theMinimumChanceToGenerateItem, weightedrandomchestcontent.theMaximumChanceToGenerateItem);
|
||||
+
|
||||
+ for (ItemStack item : stacks)
|
||||
{
|
||||
- for (int var9 = 0; var9 < var6; ++var9)
|
||||
- for (int l = 0; l < k; ++l)
|
||||
- {
|
||||
- ItemStack var8 = var5.theItemId.copy();
|
||||
- var8.stackSize = 1;
|
||||
- par2TileEntityChest.setInventorySlotContents(par0Random.nextInt(par2TileEntityChest.getSizeInventory()), var8);
|
||||
- ItemStack itemstack1 = weightedrandomchestcontent.theItemId.copy();
|
||||
- itemstack1.stackSize = 1;
|
||||
- par2TileEntityChest.setInventorySlotContents(par0Random.nextInt(par2TileEntityChest.getSizeInventory()), itemstack1);
|
||||
- }
|
||||
+ par2TileEntityChest.setInventorySlotContents(par0Random.nextInt(par2TileEntityChest.getSizeInventory()), item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,22 +71,11 @@
|
||||
for (int var4 = 0; var4 < par3; ++var4)
|
||||
for (int j = 0; j < par3; ++j)
|
||||
{
|
||||
WeightedRandomChestContent var5 = (WeightedRandomChestContent)WeightedRandom.getRandomItem(par0Random, par1ArrayOfWeightedRandomChestContent);
|
||||
- int var6 = var5.theMinimumChanceToGenerateItem + par0Random.nextInt(var5.theMaximumChanceToGenerateItem - var5.theMinimumChanceToGenerateItem + 1);
|
||||
+ ItemStack[] stacks = ChestGenHooks.generateStacks(par0Random, var5.theItemId, var5.theMinimumChanceToGenerateItem, var5.theMaximumChanceToGenerateItem);
|
||||
WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(par0Random, par1ArrayOfWeightedRandomChestContent);
|
||||
- int k = weightedrandomchestcontent.theMinimumChanceToGenerateItem + par0Random.nextInt(weightedrandomchestcontent.theMaximumChanceToGenerateItem - weightedrandomchestcontent.theMinimumChanceToGenerateItem + 1);
|
||||
+ ItemStack[] stacks = ChestGenHooks.generateStacks(par0Random, weightedrandomchestcontent.theItemId, weightedrandomchestcontent.theMinimumChanceToGenerateItem, weightedrandomchestcontent.theMaximumChanceToGenerateItem);
|
||||
|
||||
- if (var5.theItemId.getMaxStackSize() >= var6)
|
||||
- if (weightedrandomchestcontent.theItemId.getMaxStackSize() >= k)
|
||||
+ for (ItemStack item : stacks)
|
||||
{
|
||||
- ItemStack var7 = var5.theItemId.copy();
|
||||
- var7.stackSize = var6;
|
||||
- par2TileEntityDispenser.setInventorySlotContents(par0Random.nextInt(par2TileEntityDispenser.getSizeInventory()), var7);
|
||||
- ItemStack itemstack = weightedrandomchestcontent.theItemId.copy();
|
||||
- itemstack.stackSize = k;
|
||||
- par2TileEntityDispenser.setInventorySlotContents(par0Random.nextInt(par2TileEntityDispenser.getSizeInventory()), itemstack);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- for (int var9 = 0; var9 < var6; ++var9)
|
||||
- for (int l = 0; l < k; ++l)
|
||||
- {
|
||||
- ItemStack var8 = var5.theItemId.copy();
|
||||
- var8.stackSize = 1;
|
||||
- par2TileEntityDispenser.setInventorySlotContents(par0Random.nextInt(par2TileEntityDispenser.getSizeInventory()), var8);
|
||||
- ItemStack itemstack1 = weightedrandomchestcontent.theItemId.copy();
|
||||
- itemstack1.stackSize = 1;
|
||||
- par2TileEntityDispenser.setInventorySlotContents(par0Random.nextInt(par2TileEntityDispenser.getSizeInventory()), itemstack1);
|
||||
- }
|
||||
+ par2TileEntityDispenser.setInventorySlotContents(par0Random.nextInt(par2TileEntityDispenser.getSizeInventory()), item);
|
||||
}
|
||||
|
||||
Loaded 100 of 136 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user