Client side initial patch update to Fernflower and MC 1.2.3
This commit is contained in:
parent
c8fa2639aa
commit
650f92e858
|
@ -1,97 +1,113 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/client/Minecraft.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/client/Minecraft.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/client/Minecraft.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/client/Minecraft.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -1615,70 +1615,47 @@
|
@@ -1966,86 +1966,54 @@
|
||||||
|
*/
|
||||||
public void usePortal(int i)
|
public void usePortal(int par1)
|
||||||
{
|
{
|
||||||
+ usePortal(i, new Teleporter());
|
+ usePortal(par1, new Teleporter());
|
||||||
+ }
|
+ }
|
||||||
+ public void usePortal(int i, Teleporter teleporter)
|
|
||||||
+ {
|
|
||||||
int j = thePlayer.dimension;
|
|
||||||
thePlayer.dimension = i;
|
|
||||||
theWorld.setEntityDead(thePlayer);
|
|
||||||
thePlayer.isDead = false;
|
|
||||||
+ WorldProvider pNew = WorldProvider.getProviderForDimension(i);
|
|
||||||
+ WorldProvider pOld = WorldProvider.getProviderForDimension(j);
|
|
||||||
double d = thePlayer.posX;
|
|
||||||
double d1 = thePlayer.posZ;
|
|
||||||
- double d2 = 1.0D;
|
|
||||||
- if (j > -1 && thePlayer.dimension == -1)
|
|
||||||
- {
|
|
||||||
- d2 = 0.125D;
|
|
||||||
- }
|
|
||||||
- else if (j == -1 && thePlayer.dimension > -1)
|
|
||||||
- {
|
|
||||||
- d2 = 8D;
|
|
||||||
- }
|
|
||||||
+ double d2 = pOld.getMovementFactor() / pNew.getMovementFactor();
|
|
||||||
d *= d2;
|
|
||||||
d1 *= d2;
|
|
||||||
- if (thePlayer.dimension == -1)
|
|
||||||
+
|
+
|
||||||
+ World world = new World(theWorld, pNew);
|
+ public void usePortal(int par1, Teleporter teleporter)
|
||||||
+ if (thePlayer.isEntityAlive())
|
+ {
|
||||||
{
|
int var2 = this.thePlayer.dimension;
|
||||||
- thePlayer.setLocationAndAngles(d, thePlayer.posY, d1, thePlayer.rotationYaw, thePlayer.rotationPitch);
|
this.thePlayer.dimension = par1;
|
||||||
- if (thePlayer.isEntityAlive())
|
this.theWorld.setEntityDead(this.thePlayer);
|
||||||
- {
|
this.thePlayer.isDead = false;
|
||||||
- theWorld.updateEntityWithOptionalForce(thePlayer, false);
|
+ WorldProvider pNew = WorldProvider.getProviderForDimension(par1);
|
||||||
- }
|
+ WorldProvider pOld = WorldProvider.getProviderForDimension(var2);
|
||||||
- World world = null;
|
double var3 = this.thePlayer.posX;
|
||||||
- world = new World(theWorld, WorldProvider.getProviderForDimension(thePlayer.dimension));
|
double var5 = this.thePlayer.posZ;
|
||||||
- changeWorld(world, "Entering the Nether", thePlayer);
|
- double var7 = 1.0D;
|
||||||
- }
|
-
|
||||||
- else if (thePlayer.dimension == 0)
|
- if (var2 > -1 && this.thePlayer.dimension == -1)
|
||||||
- {
|
- {
|
||||||
- if (thePlayer.isEntityAlive())
|
- var7 = 0.125D;
|
||||||
|
- }
|
||||||
|
- else if (var2 == -1 && this.thePlayer.dimension > -1)
|
||||||
|
- {
|
||||||
|
- var7 = 8.0D;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
+ double var7 = pOld.getMovementFactor() / pNew.getMovementFactor();
|
||||||
|
var3 *= var7;
|
||||||
|
var5 *= var7;
|
||||||
|
- World var9;
|
||||||
|
+ World var9 = new World(theWorld, pNew);
|
||||||
|
|
||||||
|
- if (this.thePlayer.dimension == -1)
|
||||||
|
+ if (this.thePlayer.isEntityAlive())
|
||||||
|
{
|
||||||
|
- this.thePlayer.setLocationAndAngles(var3, this.thePlayer.posY, var5, this.thePlayer.rotationYaw, this.thePlayer.rotationPitch);
|
||||||
|
-
|
||||||
|
- if (this.thePlayer.isEntityAlive())
|
||||||
- {
|
- {
|
||||||
- thePlayer.setLocationAndAngles(d, thePlayer.posY, d1, thePlayer.rotationYaw, thePlayer.rotationPitch);
|
- this.theWorld.updateEntityWithOptionalForce(this.thePlayer, false);
|
||||||
- theWorld.updateEntityWithOptionalForce(thePlayer, false);
|
|
||||||
- }
|
- }
|
||||||
- World world1 = null;
|
-
|
||||||
- world1 = new World(theWorld, WorldProvider.getProviderForDimension(thePlayer.dimension));
|
- var9 = null;
|
||||||
- if (j == -1)
|
- var9 = new World(this.theWorld, WorldProvider.getProviderForDimension(this.thePlayer.dimension));
|
||||||
|
- this.changeWorld(var9, "Entering the Nether", this.thePlayer);
|
||||||
|
- }
|
||||||
|
- else if (this.thePlayer.dimension == 0)
|
||||||
|
- {
|
||||||
|
- if (this.thePlayer.isEntityAlive())
|
||||||
- {
|
- {
|
||||||
- changeWorld(world1, "Leaving the Nether", thePlayer);
|
- this.thePlayer.setLocationAndAngles(var3, this.thePlayer.posY, var5, this.thePlayer.rotationYaw, this.thePlayer.rotationPitch);
|
||||||
|
- this.theWorld.updateEntityWithOptionalForce(this.thePlayer, false);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- var9 = null;
|
||||||
|
- var9 = new World(this.theWorld, WorldProvider.getProviderForDimension(this.thePlayer.dimension));
|
||||||
|
-
|
||||||
|
- if (var2 == -1)
|
||||||
|
- {
|
||||||
|
- this.changeWorld(var9, "Leaving the Nether", this.thePlayer);
|
||||||
- }
|
- }
|
||||||
- else
|
- else
|
||||||
- {
|
- {
|
||||||
- changeWorld(world1, "Leaving the End", thePlayer);
|
- this.changeWorld(var9, "Leaving the End", this.thePlayer);
|
||||||
- }
|
- }
|
||||||
+ theWorld.updateEntityWithOptionalForce(thePlayer, false);
|
+ this.theWorld.updateEntityWithOptionalForce(this.thePlayer, false);
|
||||||
}
|
}
|
||||||
- else
|
- else
|
||||||
+
|
+
|
||||||
+ if (thePlayer.dimension == 1)
|
+ if (thePlayer.dimension == 1)
|
||||||
{
|
{
|
||||||
- World world2 = null;
|
- var9 = null;
|
||||||
- world2 = new World(theWorld, WorldProvider.getProviderForDimension(thePlayer.dimension));
|
- var9 = new World(this.theWorld, WorldProvider.getProviderForDimension(this.thePlayer.dimension));
|
||||||
- ChunkCoordinates chunkcoordinates = world2.getEntrancePortalLocation();
|
ChunkCoordinates var10 = var9.getEntrancePortalLocation();
|
||||||
+ ChunkCoordinates chunkcoordinates = world.getEntrancePortalLocation();
|
var3 = (double)var10.posX;
|
||||||
d = chunkcoordinates.posX;
|
this.thePlayer.posY = (double)var10.posY;
|
||||||
thePlayer.posY = chunkcoordinates.posY;
|
var5 = (double)var10.posZ;
|
||||||
d1 = chunkcoordinates.posZ;
|
- this.thePlayer.setLocationAndAngles(var3, this.thePlayer.posY, var5, 90.0F, 0.0F);
|
||||||
- thePlayer.setLocationAndAngles(d, thePlayer.posY, d1, 90F, 0.0F);
|
-
|
||||||
- if (thePlayer.isEntityAlive())
|
- if (this.thePlayer.isEntityAlive())
|
||||||
- {
|
- {
|
||||||
- world2.updateEntityWithOptionalForce(thePlayer, false);
|
- var9.updateEntityWithOptionalForce(this.thePlayer, false);
|
||||||
- }
|
- }
|
||||||
- changeWorld(world2, "Entering the End", thePlayer);
|
-
|
||||||
|
- this.changeWorld(var9, "Entering the End", this.thePlayer);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (thePlayer.dimension == 0)
|
+ if (thePlayer.dimension == 0)
|
||||||
+ {
|
+ {
|
||||||
+ changeWorld(world, pOld.getDepartMessage(), thePlayer);
|
+ changeWorld(var9, pOld.getDepartMessage(), thePlayer);
|
||||||
+ }
|
+ }
|
||||||
+ else
|
+ else
|
||||||
+ {
|
+ {
|
||||||
+ changeWorld(world, pNew.getWelcomeMessage(), thePlayer);
|
+ changeWorld(var9, pOld.getWelcomeMessage(), thePlayer);
|
||||||
}
|
}
|
||||||
thePlayer.worldObj = theWorld;
|
|
||||||
System.out.println((new StringBuilder()).append("Teleported to ").append(theWorld.worldProvider.worldType).toString());
|
this.thePlayer.worldObj = this.theWorld;
|
||||||
- if (thePlayer.isEntityAlive() && j < 1)
|
System.out.println("Teleported to " + this.theWorld.worldProvider.worldType);
|
||||||
+ if (thePlayer.isEntityAlive())
|
|
||||||
|
- if (this.thePlayer.isEntityAlive() && var2 < 1)
|
||||||
|
+ if (this.thePlayer.isEntityAlive())
|
||||||
{
|
{
|
||||||
thePlayer.setLocationAndAngles(d, thePlayer.posY, d1, thePlayer.rotationYaw, thePlayer.rotationPitch);
|
this.thePlayer.setLocationAndAngles(var3, this.thePlayer.posY, var5, this.thePlayer.rotationYaw, this.thePlayer.rotationPitch);
|
||||||
theWorld.updateEntityWithOptionalForce(thePlayer, false);
|
this.theWorld.updateEntityWithOptionalForce(this.thePlayer, false);
|
||||||
|
- (new Teleporter()).placeInPortal(this.theWorld, this.thePlayer);
|
||||||
|
+ teleporter.placeInPortal(this.theWorld, this.thePlayer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,181 +7,277 @@
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@@ -277,12 +278,12 @@
|
@@ -361,7 +362,7 @@
|
||||||
|
|
||||||
public float getBlockBrightness(IBlockAccess iblockaccess, int i, int j, int k)
|
public static boolean func_48206_g(int par0)
|
||||||
{
|
{
|
||||||
- return iblockaccess.getBrightness(i, j, k, lightValue[blockID]);
|
- Block var1 = blocksList[par0];
|
||||||
+ return iblockaccess.getBrightness(i, j, k, getLightValue(iblockaccess,i,j,k));
|
+ Block var1 = blocksList[par0];
|
||||||
|
return var1 == null ? false : var1.blockMaterial.isOpaque() && var1.renderAsNormalBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMixedBrightnessForBlock(IBlockAccess iblockaccess, int i, int j, int k)
|
@@ -434,7 +435,7 @@
|
||||||
|
|
||||||
|
public boolean func_48205_p()
|
||||||
{
|
{
|
||||||
- return iblockaccess.getLightBrightnessForSkyBlocks(i, j, k, lightValue[blockID]);
|
- return this.field_48207_bU;
|
||||||
+ return iblockaccess.getLightBrightnessForSkyBlocks(i, j, k, getLightValue(iblockaccess,i,j,k));
|
+ return hasTileEntity(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
|
/**
|
||||||
@@ -410,20 +411,15 @@
|
@@ -455,7 +456,7 @@
|
||||||
return blockID;
|
*/
|
||||||
|
public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||||
|
{
|
||||||
|
- return par1IBlockAccess.getBrightness(par2, par3, par4, lightValue[this.blockID]);
|
||||||
|
+ return par1IBlockAccess.getBrightness(par2, par3, par4, getLightValue(par1IBlockAccess, par2, par3, par4));
|
||||||
}
|
}
|
||||||
|
|
||||||
+ /**
|
/**
|
||||||
|
@@ -463,7 +464,7 @@
|
||||||
|
*/
|
||||||
|
public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||||
|
{
|
||||||
|
- return par1IBlockAccess.getLightBrightnessForSkyBlocks(par2, par3, par4, lightValue[this.blockID]);
|
||||||
|
+ return par1IBlockAccess.getLightBrightnessForSkyBlocks(par2, par3, par4, getLightValue(par1IBlockAccess, par2, par3, par4));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@@ -620,11 +621,14 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
- * Defines whether or not a play can break the block with current tool.
|
||||||
+ * Deprecated in favor of a metadata sensitive version
|
+ * Deprecated in favor of a metadata sensitive version
|
||||||
+ * @param entityplayer Entity attacking the block
|
+ * @param entityplayer Entity attacking the block
|
||||||
+ * @return
|
+ * @return
|
||||||
+ */
|
*/
|
||||||
+ @Deprecated
|
+ @Deprecated
|
||||||
public float blockStrength(EntityPlayer entityplayer)
|
public float blockStrength(EntityPlayer par1EntityPlayer)
|
||||||
{
|
{
|
||||||
- if (blockHardness < 0.0F)
|
- return this.blockHardness < 0.0F ? 0.0F : (!par1EntityPlayer.canHarvestBlock(this) ? 1.0F / this.blockHardness / 100.0F : par1EntityPlayer.getCurrentPlayerStrVsBlock(this) / this.blockHardness / 30.0F);
|
||||||
- {
|
+ return blockStrength(par1EntityPlayer, 0);
|
||||||
- return 0.0F;
|
|
||||||
- }
|
|
||||||
- if (!entityplayer.canHarvestBlock(this))
|
|
||||||
- {
|
|
||||||
- return 1.0F / blockHardness / 100F;
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- return entityplayer.getCurrentPlayerStrVsBlock(this) / blockHardness / 30F;
|
|
||||||
- }
|
|
||||||
+ return blockStrength(entityplayer, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void dropBlockAsItem(World world, int i, int j, int k, int l, int i1)
|
/**
|
||||||
@@ -437,18 +433,15 @@
|
@@ -644,16 +648,12 @@
|
||||||
{
|
{
|
||||||
return;
|
int var8 = this.quantityDroppedWithBonus(par7, par1World.rand);
|
||||||
}
|
|
||||||
- int j1 = quantityDroppedWithBonus(i1, world.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)
|
||||||
+ ArrayList<ItemStack> items = getBlockDropped(world, i, j, k, l, i1);
|
|
||||||
+ for(ItemStack item : items)
|
|
||||||
{
|
|
||||||
if (world.rand.nextFloat() > f)
|
|
||||||
{
|
{
|
||||||
continue;
|
if (par1World.rand.nextFloat() <= par6)
|
||||||
|
{
|
||||||
|
- int var10 = this.idDropped(par5, par1World.rand, par7);
|
||||||
|
-
|
||||||
|
- if (var10 > 0)
|
||||||
|
- {
|
||||||
|
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var10, 1, this.damageDropped(par5)));
|
||||||
|
- }
|
||||||
|
+ this.dropBlockAsItem_do(par1World, par2, par3, par4, item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
- int l1 = idDropped(l, world.rand, i1);
|
|
||||||
- if (l1 > 0)
|
|
||||||
- {
|
|
||||||
- dropBlockAsItem_do(world, i, j, k, new ItemStack(l1, 1, damageDropped(l)));
|
|
||||||
- }
|
|
||||||
+ dropBlockAsItem_do(world, i, j, k, item);
|
|
||||||
}
|
}
|
||||||
}
|
@@ -963,7 +963,7 @@
|
||||||
|
par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
|
||||||
|
par2EntityPlayer.addExhaustion(0.025F);
|
||||||
|
|
||||||
@@ -696,7 +689,7 @@
|
- if (this.renderAsNormalBlock() && !this.field_48207_bU && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer.inventory))
|
||||||
{
|
+ if (this.renderAsNormalBlock() && !hasTileEntity(par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer.inventory))
|
||||||
entityplayer.addStat(StatList.mineBlockStatArray[blockID], 1);
|
|
||||||
entityplayer.addExhaustion(0.025F);
|
|
||||||
- if (renderAsNormalBlock() && !isBlockContainer[blockID] && EnchantmentHelper.getSilkTouchModifier(entityplayer.inventory))
|
|
||||||
+ if (renderAsNormalBlock() && !hasTileEntity(l) && EnchantmentHelper.getSilkTouchModifier(entityplayer.inventory))
|
|
||||||
{
|
{
|
||||||
ItemStack itemstack = createStackedBlock(l);
|
ItemStack var8 = this.createStackedBlock(par6);
|
||||||
if (itemstack != null)
|
|
||||||
@@ -780,6 +773,273 @@
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* FORGE: Allow a block to set illumination on a coordinate basis.
|
@@ -1077,6 +1077,361 @@
|
||||||
|
*/
|
||||||
|
public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6) {}
|
||||||
|
|
||||||
|
+ /**
|
||||||
|
+ * Get a light value for this block, normal ranges are between 0 and 15
|
||||||
|
+ *
|
||||||
|
+ * @param world The current world
|
||||||
|
+ * @param x X Position
|
||||||
|
+ * @param y Y position
|
||||||
|
+ * @param z Z position
|
||||||
|
+ * @return The light value
|
||||||
+ */
|
+ */
|
||||||
+ public int getLightValue(IBlockAccess iba, int i, int j, int k) {
|
+ public int getLightValue(IBlockAccess world, int x, int y, int z)
|
||||||
|
+ {
|
||||||
+ return lightValue[blockID];
|
+ return lightValue[blockID];
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /* FORGE: Implement and return true if you wish this block to behave
|
+ /**
|
||||||
+ * like a ladder when the player is inside.
|
+ * Checks if a player or entity can use this block to 'climb' like a ladder.
|
||||||
|
+ *
|
||||||
|
+ * @param world The current world
|
||||||
|
+ * @param x X Position
|
||||||
|
+ * @param y Y position
|
||||||
|
+ * @param z Z position
|
||||||
|
+ * @return True if the block should act like a ladder
|
||||||
+ */
|
+ */
|
||||||
+ public boolean isLadder(World world, int i, int j, int k) {
|
+ public boolean isLadder(World world, int x, int y, int z)
|
||||||
|
+ {
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /* FORGE: Return true if the block is a normal, solid cube. This
|
+ /**
|
||||||
|
+ * Return true if the block is a normal, solid cube. This
|
||||||
+ * determines indirect power state, entity ejection from blocks, and a few
|
+ * determines indirect power state, entity ejection from blocks, and a few
|
||||||
+ * others.
|
+ * others.
|
||||||
|
+ *
|
||||||
|
+ * @param world The current world
|
||||||
|
+ * @param x X Position
|
||||||
|
+ * @param y Y position
|
||||||
|
+ * @param z Z position
|
||||||
|
+ * @return True if the block is a full cube
|
||||||
+ */
|
+ */
|
||||||
+ public boolean isBlockNormalCube(World world, int i, int j, int k) {
|
+ public boolean isBlockNormalCube(World world, int x, int y, int z)
|
||||||
|
+ {
|
||||||
+ return blockMaterial.isOpaque() && renderAsNormalBlock();
|
+ return blockMaterial.isOpaque() && renderAsNormalBlock();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /* FORGE: Return true if the block is solid on the given side. This
|
+ /**
|
||||||
+ * is used by placement logic. */
|
+ * Checks if the block is a solid face on the given side, used by placement logic.
|
||||||
+ public boolean isBlockSolidOnSide( World world, int i, int j, int k,
|
+ *
|
||||||
+ int side ) {
|
+ * @param world The current world
|
||||||
+ return isBlockNormalCube(world,i,j,k);
|
+ * @param x X Position
|
||||||
|
+ * @param y Y position
|
||||||
|
+ * @param z Z position
|
||||||
|
+ * @param size The side to check
|
||||||
|
+ * @return True if the block is solid on the specified side.
|
||||||
|
+ */
|
||||||
|
+ public boolean isBlockSolidOnSide(World world, int x, int y, int z, int side)
|
||||||
|
+ {
|
||||||
|
+ return isBlockNormalCube(world, x, y, z);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /* FORGE: Return true if the player can place a new block in the block
|
+ /**
|
||||||
+ * occupied by this one, like water, lava, fire, etc.
|
+ * Determines if a new block can be replace the space occupied by this one,
|
||||||
|
+ * Used in the player's placement code to make the block act like water, and lava.
|
||||||
|
+ *
|
||||||
|
+ * @param world The current world
|
||||||
|
+ * @param x X Position
|
||||||
|
+ * @param y Y position
|
||||||
|
+ * @param z Z position
|
||||||
|
+ * @return True if the block is replaceable by another block
|
||||||
+ */
|
+ */
|
||||||
+ public boolean isBlockReplaceable( World world, int i, int j, int k ) {
|
+ public boolean isBlockReplaceable(World world, int x, int y, int z)
|
||||||
|
+ {
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /* FORGE: Return true if this block should set fire and deal fire damage
|
+ /**
|
||||||
+ * to entities coming into contact with it, false otherwise.
|
+ * Determines if this block should set fire and deal fire damage
|
||||||
|
+ * to entities coming into contact with it.
|
||||||
|
+ *
|
||||||
|
+ * @param world The current world
|
||||||
|
+ * @param x X Position
|
||||||
|
+ * @param y Y position
|
||||||
|
+ * @param z Z position
|
||||||
|
+ * @return True if the block should deal damage
|
||||||
+ */
|
+ */
|
||||||
+ public boolean isBlockBurning( World world, int i, int j, int k ) {
|
+ public boolean isBlockBurning(World world, int x, int y, int z)
|
||||||
|
+ {
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /* FORGE: Return true if this block should be treated as an air block
|
+ /**
|
||||||
+ * by the rest of the code, false otherwise. This method is primarily
|
+ * Determines this block should be treated as an air block
|
||||||
|
+ * by the rest of the code. This method is primarily
|
||||||
+ * useful for creating pure logic-blocks that will be invisible
|
+ * useful for creating pure logic-blocks that will be invisible
|
||||||
+ * to the player and otherwise interact as air would.
|
+ * to the player and otherwise interact as air would.
|
||||||
|
+ *
|
||||||
|
+ * @param world The current world
|
||||||
|
+ * @param x X Position
|
||||||
|
+ * @param y Y position
|
||||||
|
+ * @param z Z position
|
||||||
|
+ * @return True if the block considered air
|
||||||
+ */
|
+ */
|
||||||
+ public boolean isAirBlock( World world, int i, int j, int k ) {
|
+ public boolean isAirBlock(World world, int x, int y, int z)
|
||||||
|
+ {
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /* FORGE: Return the block hardness with metadata md.
|
+ /**
|
||||||
|
+ * Metadata sensitive version of the default getHardness function.
|
||||||
|
+ *
|
||||||
|
+ * @param meta The block's current metatdata
|
||||||
|
+ * @return Block hardness
|
||||||
+ */
|
+ */
|
||||||
+ public float getHardness(int md) {
|
+ public float getHardness(int meta)
|
||||||
|
+ {
|
||||||
+ return blockHardness;
|
+ return blockHardness;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /* FORGE: Return the block strength of the block at i,j,k against the
|
+ /**
|
||||||
+ * player.
|
+ * Determines this block's strength against being destroyed by a player.
|
||||||
|
+ *
|
||||||
|
+ * @param world The current world
|
||||||
|
+ * @param player The player damaging the block, may be null
|
||||||
|
+ * @param x X Position
|
||||||
|
+ * @param y Y position
|
||||||
|
+ * @param z Z position
|
||||||
|
+ * @return A value
|
||||||
+ */
|
+ */
|
||||||
+ public float blockStrength(World world, EntityPlayer player,
|
+ public float blockStrength(World world, EntityPlayer player, int x, int y, int z)
|
||||||
+ int i, int j, int k) {
|
+ {
|
||||||
+ int md=world.getBlockMetadata(i,j,k);
|
+ return blockStrength(player, world.getBlockMetadata(x, y, z));
|
||||||
+ return blockStrength(player,md);
|
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /* FORGE: Return the block strength of a prototypical block with metadata
|
+ /**
|
||||||
+ * md against the player.
|
+ * Determines this block's strength against being destroyed by a player.
|
||||||
|
+ *
|
||||||
|
+ * @param player The player damaging the block, may be null
|
||||||
|
+ * @param meta The block's current metadata
|
||||||
|
+ * @return The larger the value, the faster it breaks.
|
||||||
+ */
|
+ */
|
||||||
+ public float blockStrength(EntityPlayer player, int md) {
|
+ public float blockStrength(EntityPlayer player, int meta)
|
||||||
+ return ForgeHooks.blockStrength(this,player,md);
|
+ {
|
||||||
|
+ return ForgeHooks.blockStrength(this, player, meta);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /* FORGE: Return true if the player can harvest a prototypical block with
|
+ /**
|
||||||
+ * metadata md.
|
+ * Determines if the player can harvest this block, obtaining it's drops when the block is destroyed.
|
||||||
|
+ *
|
||||||
|
+ * @param player The player damaging the block, may be null
|
||||||
|
+ * @param meta The block's current metadata
|
||||||
|
+ * @return True tospawn the drops
|
||||||
+ */
|
+ */
|
||||||
+ public boolean canHarvestBlock(EntityPlayer player, int md) {
|
+ public boolean canHarvestBlock(EntityPlayer player, int meta)
|
||||||
+ return ForgeHooks.canHarvestBlock(this,player,md);
|
+ {
|
||||||
|
+ return ForgeHooks.canHarvestBlock(this, player, meta);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /* FORGE: Called when a player removes a block. This is responsible for
|
+ /**
|
||||||
|
+ * Called when a player removes a block. This is responsible for
|
||||||
+ * actually destroying the block, and the block is intact at time of call.
|
+ * actually destroying the block, and the block is intact at time of call.
|
||||||
+ * This is called regardless of whether the player can harvest the block or
|
+ * This is called regardless of whether the player can harvest the block or
|
||||||
+ * not. Return true if the block is actually destroyed.
|
+ * not.
|
||||||
|
+ *
|
||||||
|
+ * Return true if the block is actually destroyed.
|
||||||
+ *
|
+ *
|
||||||
+ * Note: When used in multiplayer, this is called on both client and
|
+ * Note: When used in multiplayer, this is called on both client and
|
||||||
+ * server sides!
|
+ * server sides!
|
||||||
|
+ *
|
||||||
|
+ * @param world The current world
|
||||||
|
+ * @param player The player damaging the block, may be null
|
||||||
|
+ * @param x X Position
|
||||||
|
+ * @param y Y position
|
||||||
|
+ * @param z Z position
|
||||||
|
+ * @return True if the block is actually destroyed.
|
||||||
+ */
|
+ */
|
||||||
+ public boolean removeBlockByPlayer(World world, EntityPlayer player,
|
+ public boolean removeBlockByPlayer(World world, EntityPlayer player, int x, int y, int z)
|
||||||
+ int i, int j, int k) {
|
+ {
|
||||||
+ return world.setBlockWithNotify(i, j, k, 0);
|
+ return world.setBlockWithNotify(x, y, z, 0);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /* FORGE: Called when a new CreativeContainer is opened, populate the list
|
+ /**
|
||||||
|
+ * Called when a new CreativeContainer is opened, populate the list
|
||||||
+ * with all of the items for this block you want a player in creative mode
|
+ * with all of the items for this block you want a player in creative mode
|
||||||
+ * to have access to.
|
+ * to have access to.
|
||||||
|
+ *
|
||||||
|
+ * @param itemList The list of items to display on the creative inventory.
|
||||||
+ */
|
+ */
|
||||||
+ public void addCreativeItems(ArrayList itemList)
|
+ public void addCreativeItems(ArrayList itemList)
|
||||||
+ {
|
+ {
|
||||||
|
@ -291,7 +387,7 @@
|
||||||
+ */
|
+ */
|
||||||
+ public boolean hasTileEntity(int metadata)
|
+ public boolean hasTileEntity(int metadata)
|
||||||
+ {
|
+ {
|
||||||
+ return isBlockContainer[blockID];
|
+ return field_48207_bU;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
@ -329,14 +425,14 @@
|
||||||
+ * This returns a complete list of items dropped from this block.
|
+ * This returns a complete list of items dropped from this block.
|
||||||
+ *
|
+ *
|
||||||
+ * @param world The current world
|
+ * @param world The current world
|
||||||
+ * @param X X Position
|
+ * @param x X Position
|
||||||
+ * @param Y Y Position
|
+ * @param Y Y Position
|
||||||
+ * @param Z Z Position
|
+ * @param Z Z Position
|
||||||
+ * @param metadata Current metadata
|
+ * @param metadata Current metadata
|
||||||
+ * @param fortune Breakers fortune level
|
+ * @param fortune Breakers fortune level
|
||||||
+ * @return A ArrayList containing all items this block drops
|
+ * @return A ArrayList containing all items this block drops
|
||||||
+ */
|
+ */
|
||||||
+ public ArrayList<ItemStack> getBlockDropped(World world, int X, int Y, int Z, int metadata, int fortune)
|
+ public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
|
||||||
+ {
|
+ {
|
||||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||||
+
|
+
|
||||||
|
@ -352,7 +448,6 @@
|
||||||
+ return ret;
|
+ return ret;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+
|
static
|
||||||
static Class _mthclass$(String s)
|
|
||||||
{
|
{
|
||||||
try
|
Item.itemsList[cloth.blockID] = (new ItemCloth(cloth.blockID - 256)).setItemName("cloth");
|
||||||
|
|
|
@ -1,119 +1,90 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/BlockButton.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/BlockButton.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/BlockButton.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/BlockButton.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -32,36 +32,36 @@
|
@@ -46,7 +46,10 @@
|
||||||
|
|
||||||
public boolean canPlaceBlockOnSide(World world, int i, int j, int k, int l)
|
public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5)
|
||||||
{
|
{
|
||||||
- if (l == 2 && world.isBlockNormalCube(i, j, k + 1))
|
- return par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)));
|
||||||
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
+ return (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) ||
|
||||||
{
|
+ (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) ||
|
||||||
return true;
|
+ (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) ||
|
||||||
}
|
+ (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5));
|
||||||
- if (l == 3 && world.isBlockNormalCube(i, j, k - 1))
|
|
||||||
+ if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- if (l == 4 && world.isBlockNormalCube(i + 1, j, k))
|
|
||||||
+ if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- return l == 5 && world.isBlockNormalCube(i - 1, j, k);
|
|
||||||
+ return l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
/**
|
||||||
|
@@ -54,7 +57,10 @@
|
||||||
|
*/
|
||||||
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
- if (world.isBlockNormalCube(i - 1, j, k))
|
- return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : par1World.isBlockNormalCube(par2, par3, par4 + 1)));
|
||||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
+ return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) ||
|
||||||
{
|
+ par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) ||
|
||||||
return true;
|
+ par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) ||
|
||||||
}
|
+ par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2);
|
||||||
- if (world.isBlockNormalCube(i + 1, j, k))
|
|
||||||
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- if (world.isBlockNormalCube(i, j, k - 1))
|
|
||||||
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- return world.isBlockNormalCube(i, j, k + 1);
|
|
||||||
+ return world.isBlockSolidOnSide(i, j, k + 1, 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onBlockPlaced(World world, int i, int j, int k, int l)
|
/**
|
||||||
@@ -69,19 +69,19 @@
|
@@ -67,19 +73,19 @@
|
||||||
int i1 = world.getBlockMetadata(i, j, k);
|
int var7 = var6 & 8;
|
||||||
int j1 = i1 & 8;
|
var6 &= 7;
|
||||||
i1 &= 7;
|
|
||||||
- if (l == 2 && world.isBlockNormalCube(i, j, k + 1))
|
|
||||||
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
|
||||||
{
|
|
||||||
i1 = 4;
|
|
||||||
}
|
|
||||||
- else if (l == 3 && world.isBlockNormalCube(i, j, k - 1))
|
|
||||||
+ else if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
|
||||||
{
|
|
||||||
i1 = 3;
|
|
||||||
}
|
|
||||||
- else if (l == 4 && world.isBlockNormalCube(i + 1, j, k))
|
|
||||||
+ else if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
|
||||||
{
|
|
||||||
i1 = 2;
|
|
||||||
}
|
|
||||||
- else if (l == 5 && world.isBlockNormalCube(i - 1, j, k))
|
|
||||||
+ else if (l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5))
|
|
||||||
{
|
|
||||||
i1 = 1;
|
|
||||||
}
|
|
||||||
@@ -94,19 +94,19 @@
|
|
||||||
|
|
||||||
private int getOrientation(World world, int i, int j, int k)
|
- if (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1))
|
||||||
|
+ if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2))
|
||||||
|
{
|
||||||
|
var6 = 4;
|
||||||
|
}
|
||||||
|
- else if (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||||
|
+ else if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3))
|
||||||
|
{
|
||||||
|
var6 = 3;
|
||||||
|
}
|
||||||
|
- else if (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||||
|
+ else if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4))
|
||||||
|
{
|
||||||
|
var6 = 2;
|
||||||
|
}
|
||||||
|
- else if (par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||||
|
+ else if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5))
|
||||||
|
{
|
||||||
|
var6 = 1;
|
||||||
|
}
|
||||||
|
@@ -96,7 +102,11 @@
|
||||||
|
*/
|
||||||
|
private int getOrientation(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
- if (world.isBlockNormalCube(i - 1, j, k))
|
- return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? 1 : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? 2 : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? 3 : (par1World.isBlockNormalCube(par2, par3, par4 + 1) ? 4 : 1)));
|
||||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
+ if (par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5)) return 1;
|
||||||
{
|
+ if (par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) return 2;
|
||||||
return 1;
|
+ if (par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) return 3;
|
||||||
}
|
+ if (par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) return 4;
|
||||||
- if (world.isBlockNormalCube(i + 1, j, k))
|
+ return 1;
|
||||||
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
|
||||||
{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
- if (world.isBlockNormalCube(i, j, k - 1))
|
|
||||||
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
|
||||||
{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
- return !world.isBlockNormalCube(i, j, k + 1) ? 1 : 4;
|
|
||||||
+ return !world.isBlockSolidOnSide(i, j, k + 1, 2) ? 1 : 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
|
/**
|
||||||
@@ -115,19 +115,19 @@
|
@@ -110,22 +120,22 @@
|
||||||
{
|
int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7;
|
||||||
int i1 = world.getBlockMetadata(i, j, k) & 7;
|
boolean var7 = false;
|
||||||
boolean flag = false;
|
|
||||||
- if (!world.isBlockNormalCube(i - 1, j, k) && i1 == 1)
|
- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var6 == 1)
|
||||||
+ if (!world.isBlockSolidOnSide(i - 1, j, k, 5) && i1 == 1)
|
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) && var6 == 1)
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
- if (!world.isBlockNormalCube(i + 1, j, k) && i1 == 2)
|
|
||||||
+ if (!world.isBlockSolidOnSide(i + 1, j, k, 4) && i1 == 2)
|
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var6 == 2)
|
||||||
|
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) && var6 == 2)
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
- if (!world.isBlockNormalCube(i, j, k - 1) && i1 == 3)
|
|
||||||
+ if (!world.isBlockSolidOnSide(i, j, k - 1, 3) && i1 == 3)
|
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var6 == 3)
|
||||||
|
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) && var6 == 3)
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
- if (!world.isBlockNormalCube(i, j, k + 1) && i1 == 4)
|
|
||||||
+ if (!world.isBlockSolidOnSide(i, j, k + 1, 2) && i1 == 4)
|
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var6 == 4)
|
||||||
|
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2) && var6 == 4)
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +1,31 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/BlockChest.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/BlockChest.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/BlockChest.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/BlockChest.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -424,23 +424,23 @@
|
@@ -494,23 +494,23 @@
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
- if (world.isBlockNormalCube(i, j + 1, k))
|
- else if (par1World.isBlockNormalCube(par2, par3 + 1, par4))
|
||||||
+ if (world.isBlockSolidOnSide(i, j + 1, k, 0))
|
+ else if (par1World.isBlockSolidOnSide(par2, par3 + 1, par4, 0))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
- if (world.getBlockId(i - 1, j, k) == blockID && world.isBlockNormalCube(i - 1, j + 1, k))
|
- else if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID && par1World.isBlockNormalCube(par2 - 1, par3 + 1, par4))
|
||||||
+ if (world.getBlockId(i - 1, j, k) == blockID && world.isBlockSolidOnSide(i - 1, j + 1, k, 0))
|
+ else if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID && par1World.isBlockSolidOnSide(par2 - 1, par3 + 1, par4, 0))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
- if (world.getBlockId(i + 1, j, k) == blockID && world.isBlockNormalCube(i + 1, j + 1, k))
|
- else if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID && par1World.isBlockNormalCube(par2 + 1, par3 + 1, par4))
|
||||||
+ if (world.getBlockId(i + 1, j, k) == blockID && world.isBlockSolidOnSide(i + 1, j + 1, k, 0))
|
+ else if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID && par1World.isBlockSolidOnSide(par2 + 1, par3 + 1, par4, 0))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
- if (world.getBlockId(i, j, k - 1) == blockID && world.isBlockNormalCube(i, j + 1, k - 1))
|
- else if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID && par1World.isBlockNormalCube(par2, par3 + 1, par4 - 1))
|
||||||
+ if (world.getBlockId(i, j, k - 1) == blockID && world.isBlockSolidOnSide(i, j + 1, k - 1, 0))
|
+ else if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID && par1World.isBlockSolidOnSide(par2, par3 + 1, par4 - 1, 0))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
- if (world.getBlockId(i, j, k + 1) == blockID && world.isBlockNormalCube(i, j + 1, k + 1))
|
- else if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID && par1World.isBlockNormalCube(par2, par3 + 1, par4 + 1))
|
||||||
+ if (world.getBlockId(i, j, k + 1) == blockID && world.isBlockSolidOnSide(i, j + 1, k + 1, 0))
|
+ else if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID && par1World.isBlockSolidOnSide(par2, par3 + 1, par4 + 1, 0))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,30 +1,26 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/BlockContainer.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/BlockContainer.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/BlockContainer.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/BlockContainer.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -17,7 +17,7 @@
|
@@ -20,7 +20,7 @@
|
||||||
public void onBlockAdded(World world, int i, int j, int k)
|
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
super.onBlockAdded(world, i, j, k);
|
super.onBlockAdded(par1World, par2, par3, par4);
|
||||||
- world.setBlockTileEntity(i, j, k, getBlockEntity());
|
- par1World.setBlockTileEntity(par2, par3, par4, this.getBlockEntity());
|
||||||
+ world.setBlockTileEntity(i, j, k, getBlockEntity(world.getBlockMetadata(i,j,k)));
|
+ par1World.setBlockTileEntity(par2, par3, par4, this.getBlockEntity(par1World.getBlockMetadata(par2, par3, par4)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onBlockRemoval(World world, int i, int j, int k)
|
/**
|
||||||
@@ -28,6 +28,18 @@
|
@@ -47,4 +47,14 @@
|
||||||
|
var7.onTileEntityPowered(par5, par6);
|
||||||
public abstract TileEntity getBlockEntity();
|
}
|
||||||
|
}
|
||||||
+ /* FORGE: Metadata-sensitive version, to fix 1.8.1 regression.
|
+
|
||||||
+ */
|
|
||||||
+ /**
|
+ /**
|
||||||
+ * Metadata-sensitive version, to fix 1.8.1 regression.
|
+ * Metadata-sensitive version, to fix 1.8.1 regression.
|
||||||
+ * @param metadata The current Metadata
|
+ * @param meta The current Metadata
|
||||||
+ * @return And instance of the TileEntity class for this block
|
+ * @return And instance of the TileEntity class for this block
|
||||||
+ */
|
+ */
|
||||||
+ public TileEntity getBlockEntity(int md)
|
+ public TileEntity getBlockEntity(int meta)
|
||||||
+ {
|
+ {
|
||||||
+ return getBlockEntity();
|
+ return getBlockEntity();
|
||||||
+ }
|
+ }
|
||||||
+
|
}
|
||||||
public void powerBlock(World world, int i, int j, int k, int l, int i1)
|
|
||||||
{
|
|
||||||
super.powerBlock(world, i, j, k, l, i1);
|
|
||||||
|
|
|
@ -8,41 +8,48 @@
|
||||||
|
|
||||||
public class BlockCrops extends BlockFlower
|
public class BlockCrops extends BlockFlower
|
||||||
{
|
{
|
||||||
@@ -98,27 +99,23 @@
|
@@ -129,31 +130,24 @@
|
||||||
return 6;
|
return 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
- public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int i1)
|
- /**
|
||||||
|
- * Drops the block items with a specified chance of dropping the specified items
|
||||||
|
- */
|
||||||
|
- public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int meta, int fortune)
|
+ public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
|
||||||
{
|
{
|
||||||
- super.dropBlockAsItemWithChance(world, i, j, k, l, f, 0);
|
- super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);
|
||||||
- if (world.isRemote)
|
-
|
||||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
- if (!par1World.isRemote)
|
||||||
+ if (meta == 7)
|
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||||
|
+ if (metadata == 7)
|
||||||
{
|
{
|
||||||
- return;
|
- int var8 = 3 + par7;
|
||||||
+ ret.add(new ItemStack(Item.wheat));
|
-
|
||||||
}
|
- for (int var9 = 0; var9 < var8; ++var9)
|
||||||
- int j1 = 3 + i1;
|
+ ret.add(new ItemStack(Item.wheat));
|
||||||
- for (int k1 = 0; k1 < j1; k1++)
|
+ }
|
||||||
+
|
+
|
||||||
+ for (int n = 0; n < 3 + fortune; n++)
|
+ for (int n = 0; n < 3 + fortune; n++)
|
||||||
{
|
+ {
|
||||||
- if (world.rand.nextInt(15) <= l)
|
+ if (world.rand.nextInt(15) <= metadata)
|
||||||
+ if (world.rand.nextInt(15) <= meta)
|
|
||||||
{
|
{
|
||||||
- float f1 = 0.7F;
|
- if (par1World.rand.nextInt(15) <= par5)
|
||||||
- float f2 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
|
- {
|
||||||
- float f3 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
|
- float var10 = 0.7F;
|
||||||
- float f4 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
|
- float var11 = par1World.rand.nextFloat() * var10 + (1.0F - var10) * 0.5F;
|
||||||
- EntityItem entityitem = new EntityItem(world, (float)i + f2, (float)j + f3, (float)k + f4, new ItemStack(Item.seeds));
|
- float var12 = par1World.rand.nextFloat() * var10 + (1.0F - var10) * 0.5F;
|
||||||
- entityitem.delayBeforeCanPickup = 10;
|
- float var13 = par1World.rand.nextFloat() * var10 + (1.0F - var10) * 0.5F;
|
||||||
- world.spawnEntityInWorld(entityitem);
|
- EntityItem var14 = new EntityItem(par1World, (double)((float)par2 + var11), (double)((float)par3 + var12), (double)((float)par4 + var13), new ItemStack(Item.seeds));
|
||||||
|
- var14.delayBeforeCanPickup = 10;
|
||||||
|
- par1World.spawnEntityInWorld(var14);
|
||||||
|
- }
|
||||||
+ ret.add(new ItemStack(Item.seeds));
|
+ ret.add(new ItemStack(Item.seeds));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
+
|
||||||
+ return ret;
|
+ return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int idDropped(int i, Random random, int j)
|
/**
|
||||||
|
|
|
@ -1,29 +1,29 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/BlockDoor.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/BlockDoor.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/BlockDoor.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/BlockDoor.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -101,7 +101,7 @@
|
@@ -240,7 +240,7 @@
|
||||||
{
|
{
|
||||||
if (blockMaterial == Material.iron)
|
if (this.blockMaterial == Material.iron)
|
||||||
{
|
{
|
||||||
- return true;
|
- return true;
|
||||||
+ return false;
|
+ return false;
|
||||||
}
|
|
||||||
int l = world.getBlockMetadata(i, j, k);
|
|
||||||
if ((l & 8) != 0)
|
|
||||||
@@ -169,7 +169,7 @@
|
|
||||||
world.setBlockWithNotify(i, j, k, 0);
|
|
||||||
flag = true;
|
|
||||||
}
|
|
||||||
- if (!world.isBlockNormalCube(i, j - 1, k))
|
|
||||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1))
|
|
||||||
{
|
|
||||||
world.setBlockWithNotify(i, j, k, 0);
|
|
||||||
flag = true;
|
|
||||||
@@ -238,7 +238,7 @@
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
- return world.isBlockNormalCube(i, j - 1, k) && super.canPlaceBlockAt(world, i, j, k) && super.canPlaceBlockAt(world, i, j + 1, k);
|
@@ -322,7 +322,7 @@
|
||||||
+ return world.isBlockSolidOnSide(i, j - 1, k, 1) && super.canPlaceBlockAt(world, i, j, k) && super.canPlaceBlockAt(world, i, j + 1, k);
|
var7 = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4))
|
||||||
|
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1))
|
||||||
|
{
|
||||||
|
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||||
|
var7 = true;
|
||||||
|
@@ -375,7 +375,7 @@
|
||||||
|
*/
|
||||||
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||||
|
{
|
||||||
|
- return par3 >= 255 ? false : par1World.isBlockNormalCube(par2, par3 - 1, par4) && super.canPlaceBlockAt(par1World, par2, par3, par4) && super.canPlaceBlockAt(par1World, par2, par3 + 1, par4);
|
||||||
|
+ return par3 >= 255 ? false : par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && super.canPlaceBlockAt(par1World, par2, par3, par4) && super.canPlaceBlockAt(par1World, par2, par3 + 1, par4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
|
@ -1,297 +1,280 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/BlockFire.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/BlockFire.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/BlockFire.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/BlockFire.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -10,8 +10,8 @@
|
@@ -5,13 +5,13 @@
|
||||||
protected BlockFire(int i, int j)
|
public class BlockFire extends Block
|
||||||
|
{
|
||||||
|
/** The chance this block will encourage nearby blocks to catch on fire */
|
||||||
|
- private int[] chanceToEncourageFire = new int[256];
|
||||||
|
+ private int[] chanceToEncourageFire = Block.blockFireSpreadSpeed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is an array indexed by block ID the larger the number in the array the more likely a block type will catch
|
||||||
|
* fires
|
||||||
|
*/
|
||||||
|
- private int[] abilityToCatchFire = new int[256];
|
||||||
|
+ private int[] abilityToCatchFire = Block.blockFlammability;
|
||||||
|
|
||||||
|
protected BlockFire(int par1, int par2)
|
||||||
{
|
{
|
||||||
super(i, j, Material.fire);
|
@@ -44,8 +44,7 @@
|
||||||
- chanceToEncourageFire = new int[256];
|
*/
|
||||||
- abilityToCatchFire = new int[256];
|
private void setBurnRate(int par1, int par2, int par3)
|
||||||
+ chanceToEncourageFire = Block.blockFireSpreadSpeed;
|
{
|
||||||
+ abilityToCatchFire = Block.blockFlammability;
|
- this.chanceToEncourageFire[par1] = par2;
|
||||||
setTickOnLoad(true);
|
- this.abilityToCatchFire[par1] = par3;
|
||||||
|
+ Block.setBurnProperties(par1, par2, par3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,11 +28,10 @@
|
/**
|
||||||
setBurnRate(Block.cloth.blockID, 30, 60);
|
@@ -103,8 +102,9 @@
|
||||||
setBurnRate(Block.vine.blockID, 15, 100);
|
*/
|
||||||
}
|
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
||||||
|
{
|
||||||
|
- boolean var6 = par1World.getBlockId(par2, par3 - 1, par4) == Block.netherrack.blockID;
|
||||||
-
|
-
|
||||||
|
+ 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), 0));
|
||||||
+
|
+
|
||||||
private void setBurnRate(int i, int j, int k)
|
if (par1World.worldProvider instanceof WorldProviderEnd && par1World.getBlockId(par2, par3 - 1, par4) == Block.bedrock.blockID)
|
||||||
{
|
|
||||||
- chanceToEncourageFire[i] = j;
|
|
||||||
- abilityToCatchFire[i] = k;
|
|
||||||
+ Block.setBurnProperties(i, j, k);
|
|
||||||
}
|
|
||||||
|
|
||||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
|
|
||||||
@@ -67,7 +66,9 @@
|
|
||||||
|
|
||||||
public void updateTick(World world, int i, int j, int k, Random random)
|
|
||||||
{
|
|
||||||
- boolean flag = world.getBlockId(i, j - 1, k) == Block.netherrack.blockID;
|
|
||||||
+ Block base = Block.blocksList[world.getBlockId(i, j - 1, k)];
|
|
||||||
+ boolean flag = (base != null && base.isFireSource(world, i, j - 1, k, world.getBlockMetadata(i, j - 1, k), 0));
|
|
||||||
+
|
|
||||||
if ((world.worldProvider instanceof WorldProviderEnd) && world.getBlockId(i, j - 1, k) == Block.bedrock.blockID)
|
|
||||||
{
|
{
|
||||||
flag = true;
|
var6 = true;
|
||||||
@@ -89,23 +90,23 @@
|
@@ -132,12 +132,12 @@
|
||||||
world.scheduleBlockUpdate(i, j, k, blockID, tickRate());
|
|
||||||
if (!flag && !canNeighborBurn(world, i, j, k))
|
if (!var6 && !this.canNeighborBurn(par1World, par2, par3, par4))
|
||||||
{
|
|
||||||
- if (!world.isBlockNormalCube(i, j - 1, k) || l > 3)
|
|
||||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) || l > 3)
|
|
||||||
{
|
{
|
||||||
world.setBlockWithNotify(i, j, k, 0);
|
- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) || var7 > 3)
|
||||||
|
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) || var7 > 3)
|
||||||
|
{
|
||||||
|
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
- 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, 1) && var7 == 15 && par5Random.nextInt(4) == 0)
|
||||||
- if (!flag && !canBlockCatchFire(world, i, j - 1, k) && l == 15 && random.nextInt(4) == 0)
|
{
|
||||||
+ if (!flag && !canBlockCatchFire(world, i, j - 1, k, 1) && l == 15 && random.nextInt(4) == 0)
|
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||||
{
|
}
|
||||||
world.setBlockWithNotify(i, j, k, 0);
|
@@ -151,12 +151,12 @@
|
||||||
return;
|
var9 = -50;
|
||||||
}
|
}
|
||||||
- tryToCatchBlockOnFire(world, i + 1, j, k, 300, random, l);
|
|
||||||
- tryToCatchBlockOnFire(world, i - 1, j, k, 300, random, l);
|
- this.func_48211_a(par1World, par2 + 1, par3, par4, 300 + var9, par5Random, var7);
|
||||||
- tryToCatchBlockOnFire(world, i, j - 1, k, 250, random, l);
|
- this.func_48211_a(par1World, par2 - 1, par3, par4, 300 + var9, par5Random, var7);
|
||||||
- tryToCatchBlockOnFire(world, i, j + 1, k, 250, random, l);
|
- this.func_48211_a(par1World, par2, par3 - 1, par4, 250 + var9, par5Random, var7);
|
||||||
- tryToCatchBlockOnFire(world, i, j, k - 1, 300, random, l);
|
- this.func_48211_a(par1World, par2, par3 + 1, par4, 250 + var9, par5Random, var7);
|
||||||
- tryToCatchBlockOnFire(world, i, j, k + 1, 300, random, l);
|
- this.func_48211_a(par1World, par2, par3, par4 - 1, 300 + var9, par5Random, var7);
|
||||||
+ tryToCatchBlockOnFire(world, i + 1, j, k, 300, random, l, 4);
|
- this.func_48211_a(par1World, par2, par3, par4 + 1, 300 + var9, par5Random, var7);
|
||||||
+ tryToCatchBlockOnFire(world, i - 1, j, k, 300, random, l, 5);
|
+ this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + var9, par5Random, var7, 4);
|
||||||
+ tryToCatchBlockOnFire(world, i, j - 1, k, 250, random, l, 1);
|
+ this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + var9, par5Random, var7, 5);
|
||||||
+ tryToCatchBlockOnFire(world, i, j + 1, k, 250, random, l, 0);
|
+ this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + var9, par5Random, var7, 1);
|
||||||
+ tryToCatchBlockOnFire(world, i, j, k - 1, 300, random, l, 3);
|
+ this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + var9, par5Random, var7, 0);
|
||||||
+ tryToCatchBlockOnFire(world, i, j, k + 1, 300, random, l, 2);
|
+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + var9, par5Random, var7, 3);
|
||||||
for (int i1 = i - 1; i1 <= i + 1; i1++)
|
+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + var9, par5Random, var7, 2);
|
||||||
{
|
|
||||||
for (int j1 = k - 1; j1 <= k + 1; j1++)
|
for (int var10 = par2 - 1; var10 <= par2 + 1; ++var10)
|
||||||
@@ -142,9 +143,24 @@
|
{
|
||||||
|
@@ -204,9 +204,21 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+ /**
|
+ /** Deprecated for a side-sensitive version */
|
||||||
+ * Deprecated for a side-sensitive version
|
|
||||||
+ */
|
|
||||||
+ @Deprecated
|
+ @Deprecated
|
||||||
private void tryToCatchBlockOnFire(World world, int i, int j, int k, int l, Random random, int i1)
|
private void func_48211_a(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7)
|
||||||
{
|
{
|
||||||
- int j1 = abilityToCatchFire[world.getBlockId(i, j, k)];
|
- int var8 = this.abilityToCatchFire[par1World.getBlockId(par2, par3, par4)];
|
||||||
+ tryToCatchBlockOnFire(world, i, j, k, l, random, i1, 0);
|
+ tryToCatchBlockOnFire(par1World, par2, par3, par4, par5, par6Random, par7, 0);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ private void tryToCatchBlockOnFire(World world, int i, int j, int k, int l, Random random, int i1, int face)
|
+ private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7, int face)
|
||||||
+ {
|
+ {
|
||||||
+ int j1 = 0;
|
+ int var8 = 0;
|
||||||
+ Block block = Block.blocksList[world.getBlockId(i, j, k)];
|
+ Block block = Block.blocksList[par1World.getBlockId(par2, par3, par4)];
|
||||||
+ if (block != null)
|
+ if (block != null)
|
||||||
+ {
|
+ {
|
||||||
+ j1 = block.getFlammability(world, i, j, k, world.getBlockMetadata(i, j, k), face);
|
+ var8 = block.getFlammability(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), face);
|
||||||
+ }
|
+ }
|
||||||
+
|
|
||||||
if (random.nextInt(l) < j1)
|
|
||||||
{
|
|
||||||
boolean flag = world.getBlockId(i, j, k) == Block.tnt.blockID;
|
|
||||||
@@ -170,27 +186,27 @@
|
|
||||||
|
|
||||||
private boolean canNeighborBurn(World world, int i, int j, int k)
|
if (par6Random.nextInt(par5) < var8)
|
||||||
|
{
|
||||||
|
@@ -240,7 +252,12 @@
|
||||||
|
*/
|
||||||
|
private boolean canNeighborBurn(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
- if (canBlockCatchFire(world, i + 1, j, k))
|
- return this.canBlockCatchFire(par1World, par2 + 1, par3, par4) ? true : (this.canBlockCatchFire(par1World, par2 - 1, par3, par4) ? true : (this.canBlockCatchFire(par1World, par2, par3 - 1, par4) ? true : (this.canBlockCatchFire(par1World, par2, par3 + 1, par4) ? true : (this.canBlockCatchFire(par1World, par2, par3, par4 - 1) ? true : this.canBlockCatchFire(par1World, par2, par3, par4 + 1)))));
|
||||||
+ if (canBlockCatchFire(world, i + 1, j, k, 4))
|
+ return canBlockCatchFire(par1World, par2 + 1, par3, par4, 4) ||
|
||||||
{
|
+ canBlockCatchFire(par1World, par2 - 1, par3, par4, 5) ||
|
||||||
return true;
|
+ canBlockCatchFire(par1World, par2, par3 - 1, par4, 1) ||
|
||||||
}
|
+ canBlockCatchFire(par1World, par2, par3 + 1, par4, 0) ||
|
||||||
- if (canBlockCatchFire(world, i - 1, j, k))
|
+ canBlockCatchFire(par1World, par2, par3, par4 - 1, 3) ||
|
||||||
+ if (canBlockCatchFire(world, i - 1, j, k, 5))
|
+ canBlockCatchFire(par1World, par2, par3, par4 + 1, 2);
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- if (canBlockCatchFire(world, i, j - 1, k))
|
|
||||||
+ if (canBlockCatchFire(world, i, j - 1, k, 1))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- if (canBlockCatchFire(world, i, j + 1, k))
|
|
||||||
+ if (canBlockCatchFire(world, i, j + 1, k, 0))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- if (canBlockCatchFire(world, i, j, k - 1))
|
|
||||||
+ if (canBlockCatchFire(world, i, j, k - 1, 3))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- return canBlockCatchFire(world, i, j, k + 1);
|
|
||||||
+ return canBlockCatchFire(world, i, j, k + 1, 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getChanceOfNeighborsEncouragingFire(World world, int i, int j, int k)
|
/**
|
||||||
@@ -202,12 +218,12 @@
|
@@ -256,12 +273,12 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
- l = getChanceToEncourageFire(world, i + 1, j, k, l);
|
- int var6 = this.getChanceToEncourageFire(par1World, par2 + 1, par3, par4, var5);
|
||||||
- l = getChanceToEncourageFire(world, i - 1, j, k, l);
|
- var6 = this.getChanceToEncourageFire(par1World, par2 - 1, par3, par4, var6);
|
||||||
- l = getChanceToEncourageFire(world, i, j - 1, k, l);
|
- var6 = this.getChanceToEncourageFire(par1World, par2, par3 - 1, par4, var6);
|
||||||
- l = getChanceToEncourageFire(world, i, j + 1, k, l);
|
- var6 = this.getChanceToEncourageFire(par1World, par2, par3 + 1, par4, var6);
|
||||||
- l = getChanceToEncourageFire(world, i, j, k - 1, l);
|
- var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 - 1, var6);
|
||||||
- l = getChanceToEncourageFire(world, i, j, k + 1, l);
|
- var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 + 1, var6);
|
||||||
+ l = getChanceToEncourageFire(world, i + 1, j, k, l, 4);
|
+ int var6 = this.getChanceToEncourageFire(par1World, par2 + 1, par3, par4, var5, 4);
|
||||||
+ l = getChanceToEncourageFire(world, i - 1, j, k, l, 5);
|
+ var6 = this.getChanceToEncourageFire(par1World, par2 - 1, par3, par4, var6, 5);
|
||||||
+ l = getChanceToEncourageFire(world, i, j - 1, k, l, 1);
|
+ var6 = this.getChanceToEncourageFire(par1World, par2, par3 - 1, par4, var6, 1);
|
||||||
+ l = getChanceToEncourageFire(world, i, j + 1, k, l, 0);
|
+ var6 = this.getChanceToEncourageFire(par1World, par2, par3 + 1, par4, var6, 0);
|
||||||
+ l = getChanceToEncourageFire(world, i, j, k - 1, l, 3);
|
+ var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 - 1, var6, 3);
|
||||||
+ l = getChanceToEncourageFire(world, i, j, k + 1, l, 2);
|
+ var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 + 1, var6, 2);
|
||||||
return l;
|
return var6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -217,32 +233,32 @@
|
@@ -276,21 +293,24 @@
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /**
|
/**
|
||||||
|
* Checks the specified block coordinate to see if it can catch fire. Args: blockAccess, x, y, z
|
||||||
+ * Deprecated for a side-sensitive version
|
+ * Deprecated for a side-sensitive version
|
||||||
+ */
|
*/
|
||||||
+ @Deprecated
|
+ @Deprecated
|
||||||
public boolean canBlockCatchFire(IBlockAccess iblockaccess, int i, int j, int k)
|
public boolean canBlockCatchFire(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
- return chanceToEncourageFire[iblockaccess.getBlockId(i, j, k)] > 0;
|
- return this.chanceToEncourageFire[par1IBlockAccess.getBlockId(par2, par3, par4)] > 0;
|
||||||
+ return canBlockCatchFire(iblockaccess, i, j, k, 0);
|
+ return canBlockCatchFire(par1IBlockAccess, par2, par3, par4, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ /**
|
/**
|
||||||
|
* Retrieves a specified block's chance to encourage their neighbors to burn and if the number is greater than the
|
||||||
|
* current number passed in it will return its number instead of the passed in one. Args: world, x, y, z,
|
||||||
|
* curChanceToEncourageFire
|
||||||
+ * Deprecated for a side-sensitive version
|
+ * Deprecated for a side-sensitive version
|
||||||
+ */
|
*/
|
||||||
+ @Deprecated
|
+ @Deprecated
|
||||||
public int getChanceToEncourageFire(World world, int i, int j, int k, int l)
|
public int getChanceToEncourageFire(World par1World, int par2, int par3, int par4, int par5)
|
||||||
{
|
{
|
||||||
- int i1 = chanceToEncourageFire[world.getBlockId(i, j, k)];
|
- int var6 = this.chanceToEncourageFire[par1World.getBlockId(par2, par3, par4)];
|
||||||
- if (i1 > l)
|
- return var6 > par5 ? var6 : par5;
|
||||||
- {
|
+ return getChanceToEncourageFire(par1World, par2, par3, par4, par5, 0);
|
||||||
- return i1;
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- return l;
|
|
||||||
- }
|
|
||||||
+ return getChanceToEncourageFire(world, i, j, k, l, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
/**
|
||||||
|
@@ -298,7 +318,7 @@
|
||||||
|
*/
|
||||||
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
- return world.isBlockNormalCube(i, j - 1, k) || canNeighborBurn(world, i, j, k);
|
- return par1World.isBlockNormalCube(par2, par3 - 1, par4) || this.canNeighborBurn(par1World, par2, par3, par4);
|
||||||
+ return world.isBlockSolidOnSide(i, j - 1, k, 1) || canNeighborBurn(world, i, j, k);
|
+ return par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) || this.canNeighborBurn(par1World, par2, par3, par4);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
|
/**
|
||||||
|
@@ -307,7 +327,7 @@
|
||||||
|
*/
|
||||||
|
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
|
||||||
{
|
{
|
||||||
- if (!world.isBlockNormalCube(i, j - 1, k) && !canNeighborBurn(world, i, j, k))
|
- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) && !this.canNeighborBurn(par1World, par2, par3, par4))
|
||||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && !canNeighborBurn(world, i, j, k))
|
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && !this.canNeighborBurn(par1World, par2, par3, par4))
|
||||||
{
|
{
|
||||||
world.setBlockWithNotify(i, j, k, 0);
|
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||||
return;
|
|
||||||
@@ -259,7 +275,7 @@
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
- if (!world.isBlockNormalCube(i, j - 1, k) && !canNeighborBurn(world, i, j, k))
|
@@ -320,7 +340,7 @@
|
||||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && !canNeighborBurn(world, i, j, k))
|
{
|
||||||
|
if (par1World.worldProvider.worldType > 0 || par1World.getBlockId(par2, par3 - 1, par4) != Block.obsidian.blockID || !Block.portal.tryToCreatePortal(par1World, par2, par3, par4))
|
||||||
{
|
{
|
||||||
world.setBlockWithNotify(i, j, k, 0);
|
- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) && !this.canNeighborBurn(par1World, par2, par3, par4))
|
||||||
return;
|
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && !this.canNeighborBurn(par1World, par2, par3, par4))
|
||||||
@@ -277,7 +293,7 @@
|
|
||||||
{
|
|
||||||
world.playSoundEffect((float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, "fire.fire", 1.0F + random.nextFloat(), random.nextFloat() * 0.7F + 0.3F);
|
|
||||||
}
|
|
||||||
- if (world.isBlockNormalCube(i, j - 1, k) || Block.fire.canBlockCatchFire(world, i, j - 1, k))
|
|
||||||
+ if (world.isBlockSolidOnSide(i, j - 1, k, 1) || Block.fire.canBlockCatchFire(world, i, j - 1, k, 1))
|
|
||||||
{
|
|
||||||
for (int l = 0; l < 3; l++)
|
|
||||||
{
|
{
|
||||||
@@ -289,7 +305,7 @@
|
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||||
}
|
}
|
||||||
else
|
@@ -346,9 +366,9 @@
|
||||||
|
float var8;
|
||||||
|
float var9;
|
||||||
|
|
||||||
|
- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(par1World, par2, par3 - 1, par4))
|
||||||
|
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && !Block.fire.canBlockCatchFire(par1World, par2, par3 - 1, par4, 1))
|
||||||
{
|
{
|
||||||
- if (Block.fire.canBlockCatchFire(world, i - 1, j, k))
|
- if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4))
|
||||||
+ if (Block.fire.canBlockCatchFire(world, i - 1, j, k, 5))
|
+ if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4, 5))
|
||||||
{
|
{
|
||||||
for (int i1 = 0; i1 < 2; i1++)
|
for (var6 = 0; var6 < 2; ++var6)
|
||||||
{
|
{
|
||||||
@@ -299,7 +315,7 @@
|
@@ -359,7 +379,7 @@
|
||||||
world.spawnParticle("largesmoke", f1, f7, f13, 0.0D, 0.0D, 0.0D);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
- if (Block.fire.canBlockCatchFire(world, i + 1, j, k))
|
|
||||||
+ if (Block.fire.canBlockCatchFire(world, i + 1, j, k, 4))
|
- if (Block.fire.canBlockCatchFire(par1World, par2 + 1, par3, par4))
|
||||||
|
+ if (Block.fire.canBlockCatchFire(par1World, par2 + 1, par3, par4, 4))
|
||||||
{
|
{
|
||||||
for (int j1 = 0; j1 < 2; j1++)
|
for (var6 = 0; var6 < 2; ++var6)
|
||||||
{
|
{
|
||||||
@@ -309,7 +325,7 @@
|
@@ -370,7 +390,7 @@
|
||||||
world.spawnParticle("largesmoke", f2, f8, f14, 0.0D, 0.0D, 0.0D);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
- if (Block.fire.canBlockCatchFire(world, i, j, k - 1))
|
|
||||||
+ if (Block.fire.canBlockCatchFire(world, i, j, k - 1, 3))
|
- if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 - 1))
|
||||||
|
+ if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 - 1, 3))
|
||||||
{
|
{
|
||||||
for (int k1 = 0; k1 < 2; k1++)
|
for (var6 = 0; var6 < 2; ++var6)
|
||||||
{
|
{
|
||||||
@@ -319,7 +335,7 @@
|
@@ -381,7 +401,7 @@
|
||||||
world.spawnParticle("largesmoke", f3, f9, f15, 0.0D, 0.0D, 0.0D);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
- if (Block.fire.canBlockCatchFire(world, i, j, k + 1))
|
|
||||||
+ if (Block.fire.canBlockCatchFire(world, i, j, k + 1, 2))
|
- if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 + 1))
|
||||||
|
+ if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 + 1, 2))
|
||||||
{
|
{
|
||||||
for (int l1 = 0; l1 < 2; l1++)
|
for (var6 = 0; var6 < 2; ++var6)
|
||||||
{
|
{
|
||||||
@@ -329,7 +345,7 @@
|
@@ -392,7 +412,7 @@
|
||||||
world.spawnParticle("largesmoke", f4, f10, f16, 0.0D, 0.0D, 0.0D);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
- if (Block.fire.canBlockCatchFire(world, i, j + 1, k))
|
|
||||||
+ if (Block.fire.canBlockCatchFire(world, i, j + 1, k, 0))
|
- if (Block.fire.canBlockCatchFire(par1World, par2, par3 + 1, par4))
|
||||||
|
+ if (Block.fire.canBlockCatchFire(par1World, par2, par3 + 1, par4, 0))
|
||||||
{
|
{
|
||||||
for (int i2 = 0; i2 < 2; i2++)
|
for (var6 = 0; var6 < 2; ++var6)
|
||||||
{
|
{
|
||||||
@@ -341,4 +357,39 @@
|
@@ -414,4 +434,46 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Forge: Side sensitive version
|
+ * Side sensitive version that calls the block function.
|
||||||
|
+ *
|
||||||
|
+ * @param world The current world
|
||||||
|
+ * @param x X Position
|
||||||
|
+ * @param y Y Position
|
||||||
|
+ * @param z Z Position
|
||||||
|
+ * @param face The side the fire is coming from
|
||||||
|
+ * @return True if the face can catch fire.
|
||||||
+ */
|
+ */
|
||||||
+ public boolean canBlockCatchFire(IBlockAccess world, int i, int j, int k, int face)
|
+ public boolean canBlockCatchFire(IBlockAccess world, int x, int y, int z, int face)
|
||||||
+ {
|
+ {
|
||||||
+ Block block = Block.blocksList[world.getBlockId(i, j, k)];
|
+ Block block = Block.blocksList[world.getBlockId(x, y, z)];
|
||||||
+ if (block != null)
|
+ if (block != null)
|
||||||
+ {
|
+ {
|
||||||
+ return block.isFlammable(world, i, j, k, world.getBlockMetadata(i, j, k), face);
|
+ return block.isFlammable(world, x, y, z, world.getBlockMetadata(x, y, z), face);
|
||||||
+ }
|
+ }
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Forge: Side sensitive version
|
+ * Side sensitive version that calls the block function.
|
||||||
|
+ *
|
||||||
|
+ * @param world The current world
|
||||||
|
+ * @param x X Position
|
||||||
|
+ * @param y Y Position
|
||||||
|
+ * @param z Z Position
|
||||||
|
+ * @param oldChance The previous maximum chance.
|
||||||
|
+ * @param face The side the fire is coming from
|
||||||
|
+ * @return The chance of the block catching fire, or oldChance if it is higher
|
||||||
+ */
|
+ */
|
||||||
+ public int getChanceToEncourageFire(World world, int i, int j, int k, int l, int face)
|
+ public int getChanceToEncourageFire(World world, int x, int y, int z, int oldChance, int face)
|
||||||
+ {
|
+ {
|
||||||
+ int i1 = 0;
|
+ int newChance = 0;
|
||||||
+ Block block = Block.blocksList[world.getBlockId(i, j, k)];
|
+ Block block = Block.blocksList[world.getBlockId(x, y, z)];
|
||||||
+ if (block != null)
|
+ if (block != null)
|
||||||
+ {
|
+ {
|
||||||
+ i1 = block.getFireSpreadSpeed(world, i, j, k, world.getBlockMetadata(i, j, k), face);
|
+ newChance = block.getFireSpreadSpeed(world, x, y, z, world.getBlockMetadata(x, y, z), face);
|
||||||
+ }
|
+ }
|
||||||
+
|
+ return (newChance > oldChance ? newChance : oldChance);
|
||||||
+ if (i1 > l)
|
|
||||||
+ {
|
|
||||||
+ return i1;
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ return l;
|
|
||||||
+ }
|
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,92 +1,78 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/BlockLadder.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/BlockLadder.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/BlockLadder.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/BlockLadder.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -35,7 +35,7 @@
|
@@ -102,7 +102,10 @@
|
||||||
setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
|
*/
|
||||||
}
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||||
return super.getSelectedBoundingBoxFromPool(world, i, j, k);
|
|
||||||
- }
|
|
||||||
+ }
|
|
||||||
|
|
||||||
public boolean isOpaqueCube()
|
|
||||||
{
|
{
|
||||||
@@ -54,37 +54,37 @@
|
- return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : par1World.isBlockNormalCube(par2, par3, par4 + 1)));
|
||||||
|
+ return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) ||
|
||||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
+ par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) ||
|
||||||
{
|
+ par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) ||
|
||||||
- if (world.isBlockNormalCube(i - 1, j, k))
|
+ par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2);
|
||||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- if (world.isBlockNormalCube(i + 1, j, k))
|
|
||||||
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- if (world.isBlockNormalCube(i, j, k - 1))
|
|
||||||
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- return world.isBlockNormalCube(i, j, k + 1);
|
|
||||||
+ return world.isBlockSolidOnSide(i, j, k + 1, 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onBlockPlaced(World world, int i, int j, int k, int l)
|
/**
|
||||||
|
@@ -113,22 +116,22 @@
|
||||||
{
|
{
|
||||||
int i1 = world.getBlockMetadata(i, j, k);
|
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
||||||
- if ((i1 == 0 || l == 2) && world.isBlockNormalCube(i, j, k + 1))
|
|
||||||
+ if ((i1 == 0 || l == 2) && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
- if ((var6 == 0 || par5 == 2) && par1World.isBlockNormalCube(par2, par3, par4 + 1))
|
||||||
|
+ if ((var6 == 0 || par5 == 2) && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2))
|
||||||
{
|
{
|
||||||
i1 = 2;
|
var6 = 2;
|
||||||
}
|
}
|
||||||
- if ((i1 == 0 || l == 3) && world.isBlockNormalCube(i, j, k - 1))
|
|
||||||
+ if ((i1 == 0 || l == 3) && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
- if ((var6 == 0 || par5 == 3) && par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||||
|
+ if ((var6 == 0 || par5 == 3) && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3))
|
||||||
{
|
{
|
||||||
i1 = 3;
|
var6 = 3;
|
||||||
}
|
}
|
||||||
- if ((i1 == 0 || l == 4) && world.isBlockNormalCube(i + 1, j, k))
|
|
||||||
+ if ((i1 == 0 || l == 4) && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
- if ((var6 == 0 || par5 == 4) && par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||||
|
+ if ((var6 == 0 || par5 == 4) && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4))
|
||||||
{
|
{
|
||||||
i1 = 4;
|
var6 = 4;
|
||||||
}
|
}
|
||||||
- if ((i1 == 0 || l == 5) && world.isBlockNormalCube(i - 1, j, k))
|
|
||||||
+ if ((i1 == 0 || l == 5) && world.isBlockSolidOnSide(i - 1, j, k, 5))
|
- if ((var6 == 0 || par5 == 5) && par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||||
|
+ if ((var6 == 0 || par5 == 5) && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5))
|
||||||
{
|
{
|
||||||
i1 = 5;
|
var6 = 5;
|
||||||
}
|
}
|
||||||
@@ -95,19 +95,19 @@
|
@@ -145,22 +148,22 @@
|
||||||
{
|
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
||||||
int i1 = world.getBlockMetadata(i, j, k);
|
boolean var7 = false;
|
||||||
boolean flag = false;
|
|
||||||
- if (i1 == 2 && world.isBlockNormalCube(i, j, k + 1))
|
- if (var6 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1))
|
||||||
+ if (i1 == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
+ if (var6 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2))
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
- if (i1 == 3 && world.isBlockNormalCube(i, j, k - 1))
|
|
||||||
+ if (i1 == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
- if (var6 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||||
|
+ if (var6 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3))
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
- if (i1 == 4 && world.isBlockNormalCube(i + 1, j, k))
|
|
||||||
+ if (i1 == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
- if (var6 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||||
|
+ if (var6 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4))
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
- if (i1 == 5 && world.isBlockNormalCube(i - 1, j, k))
|
|
||||||
+ if (i1 == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5))
|
- if (var6 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||||
|
+ if (var6 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5))
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
@@ -123,4 +123,11 @@
|
@@ -181,4 +184,10 @@
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ /* FORGE: Implemented base method, see Block.isLadder */
|
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean isLadder(World world, int X, int Y, int Z)
|
+ public boolean isLadder(World world, int x, int y, int z)
|
||||||
+ {
|
+ {
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
|
|
|
@ -11,41 +11,41 @@
|
||||||
+
|
+
|
||||||
+public class BlockLeaves extends BlockLeavesBase implements IShearable
|
+public class BlockLeaves extends BlockLeavesBase implements IShearable
|
||||||
{
|
{
|
||||||
private int baseIndexInPNG;
|
/**
|
||||||
int adjacentTreeBlocks[];
|
* The base index in terrain.png corresponding to the fancy version of the leaf texture. This is stored so we can
|
||||||
@@ -213,15 +216,7 @@
|
@@ -268,15 +271,7 @@
|
||||||
|
*/
|
||||||
public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
|
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
|
||||||
{
|
{
|
||||||
- if (!world.isRemote && entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex)
|
- if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex)
|
||||||
- {
|
- {
|
||||||
- entityplayer.addStat(StatList.mineBlockStatArray[blockID], 1);
|
- par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
|
||||||
- dropBlockAsItem_do(world, i, j, k, new ItemStack(Block.leaves.blockID, 1, l & 3));
|
- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.leaves.blockID, 1, par6 & 3));
|
||||||
- }
|
- }
|
||||||
- else
|
- else
|
||||||
- {
|
- {
|
||||||
- super.harvestBlock(world, entityplayer, i, j, k, l);
|
- super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||||
- }
|
- }
|
||||||
+ super.harvestBlock(world, entityplayer, i, j, k, l);
|
+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int damageDropped(int i)
|
/**
|
||||||
@@ -256,4 +251,18 @@
|
@@ -320,4 +315,18 @@
|
||||||
{
|
{
|
||||||
super.onEntityWalking(world, i, j, k, entity);
|
super.onEntityWalking(par1World, par2, par3, par4, par5Entity);
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean isShearable(ItemStack item, World world, int X, int Y, int Z)
|
+ public boolean isShearable(ItemStack item, World world, int x, int y, int z)
|
||||||
+ {
|
+ {
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public ArrayList<ItemStack> onSheared(ItemStack item, World world, int X, int Y, int Z, int fortune)
|
+ public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune)
|
||||||
+ {
|
+ {
|
||||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||||
+ ret.add(new ItemStack(this, 1, world.getBlockMetadata(X, Y, Z) & 3));
|
+ ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3));
|
||||||
+ return ret;
|
+ return ret;
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,120 +1,100 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/BlockLever.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/BlockLever.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/BlockLever.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/BlockLever.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -31,44 +31,44 @@
|
@@ -43,7 +43,11 @@
|
||||||
|
|
||||||
public boolean canPlaceBlockOnSide(World world, int i, int j, int k, int l)
|
public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5)
|
||||||
{
|
{
|
||||||
- if (l == 1 && world.isBlockNormalCube(i, j - 1, k))
|
- return par5 == 1 && par1World.isBlockNormalCube(par2, par3 - 1, par4) ? true : (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))));
|
||||||
+ if (l == 1 && world.isBlockSolidOnSide(i, j - 1, k, 1))
|
+ return (par5 == 1 && par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1)) ||
|
||||||
{
|
+ (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2)) ||
|
||||||
return true;
|
+ (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3)) ||
|
||||||
}
|
+ (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4)) ||
|
||||||
- if (l == 2 && world.isBlockNormalCube(i, j, k + 1))
|
+ (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5));
|
||||||
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- if (l == 3 && world.isBlockNormalCube(i, j, k - 1))
|
|
||||||
+ if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- if (l == 4 && world.isBlockNormalCube(i + 1, j, k))
|
|
||||||
+ if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- return l == 5 && world.isBlockNormalCube(i - 1, j, k);
|
|
||||||
+ return l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
/**
|
||||||
|
@@ -51,7 +55,11 @@
|
||||||
|
*/
|
||||||
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
- if (world.isBlockNormalCube(i - 1, j, k))
|
- return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : par1World.isBlockNormalCube(par2, par3 - 1, par4))));
|
||||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
+ return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) ||
|
||||||
{
|
+ par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) ||
|
||||||
return true;
|
+ par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) ||
|
||||||
}
|
+ par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2) ||
|
||||||
- if (world.isBlockNormalCube(i + 1, j, k))
|
+ par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1);
|
||||||
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- if (world.isBlockNormalCube(i, j, k - 1))
|
|
||||||
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- if (world.isBlockNormalCube(i, j, k + 1))
|
|
||||||
+ if (world.isBlockSolidOnSide(i, j, k + 1, 2))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- return world.isBlockNormalCube(i, j - 1, k);
|
|
||||||
+ return world.isBlockSolidOnSide(i, j - 1, k, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onBlockPlaced(World world, int i, int j, int k, int l)
|
/**
|
||||||
@@ -77,23 +77,23 @@
|
@@ -65,27 +73,27 @@
|
||||||
int j1 = i1 & 8;
|
var6 &= 7;
|
||||||
i1 &= 7;
|
var6 = -1;
|
||||||
i1 = -1;
|
|
||||||
- if (l == 1 && world.isBlockNormalCube(i, j - 1, k))
|
- if (par5 == 1 && par1World.isBlockNormalCube(par2, par3 - 1, par4))
|
||||||
+ if (l == 1 && world.isBlockSolidOnSide(i, j - 1, k, 1))
|
+ if (par5 == 1 && par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1))
|
||||||
{
|
{
|
||||||
i1 = 5 + world.rand.nextInt(2);
|
var6 = 5 + par1World.rand.nextInt(2);
|
||||||
}
|
}
|
||||||
- if (l == 2 && world.isBlockNormalCube(i, j, k + 1))
|
|
||||||
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
- if (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1))
|
||||||
|
+ if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2))
|
||||||
{
|
{
|
||||||
i1 = 4;
|
var6 = 4;
|
||||||
}
|
}
|
||||||
- if (l == 3 && world.isBlockNormalCube(i, j, k - 1))
|
|
||||||
+ if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
- if (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||||
|
+ if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3))
|
||||||
{
|
{
|
||||||
i1 = 3;
|
var6 = 3;
|
||||||
}
|
}
|
||||||
- if (l == 4 && world.isBlockNormalCube(i + 1, j, k))
|
|
||||||
+ if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
- if (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||||
|
+ if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4))
|
||||||
{
|
{
|
||||||
i1 = 2;
|
var6 = 2;
|
||||||
}
|
}
|
||||||
- if (l == 5 && world.isBlockNormalCube(i - 1, j, k))
|
|
||||||
+ if (l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5))
|
- if (par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||||
|
+ if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5))
|
||||||
{
|
{
|
||||||
i1 = 1;
|
var6 = 1;
|
||||||
}
|
}
|
||||||
@@ -116,27 +116,27 @@
|
@@ -112,32 +120,32 @@
|
||||||
{
|
int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7;
|
||||||
int i1 = world.getBlockMetadata(i, j, k) & 7;
|
boolean var7 = false;
|
||||||
boolean flag = false;
|
|
||||||
- if (!world.isBlockNormalCube(i - 1, j, k) && i1 == 1)
|
- if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var6 == 1)
|
||||||
+ if (!world.isBlockSolidOnSide(i - 1, j, k, 5) && i1 == 1)
|
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 1) && var6 == 1)
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
- if (!world.isBlockNormalCube(i + 1, j, k) && i1 == 2)
|
|
||||||
+ if (!world.isBlockSolidOnSide(i + 1, j, k, 4) && i1 == 2)
|
- if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var6 == 2)
|
||||||
|
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 2) && var6 == 2)
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
- if (!world.isBlockNormalCube(i, j, k - 1) && i1 == 3)
|
|
||||||
+ if (!world.isBlockSolidOnSide(i, j, k - 1, 3) && i1 == 3)
|
- if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var6 == 3)
|
||||||
|
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) && var6 == 3)
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
- if (!world.isBlockNormalCube(i, j, k + 1) && i1 == 4)
|
|
||||||
+ if (!world.isBlockSolidOnSide(i, j, k + 1, 2) && i1 == 4)
|
- if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var6 == 4)
|
||||||
|
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 4) && var6 == 4)
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
- if (!world.isBlockNormalCube(i, j - 1, k) && i1 == 5)
|
|
||||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && i1 == 5)
|
- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) && var6 == 5)
|
||||||
|
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 5) && var6 == 5)
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
- if (!world.isBlockNormalCube(i, j - 1, k) && i1 == 6)
|
|
||||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && i1 == 6)
|
- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) && var6 == 6)
|
||||||
|
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 6) && var6 == 6)
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,37 +7,46 @@
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
public class BlockNetherStalk extends BlockFlower
|
public class BlockNetherStalk extends BlockFlower
|
||||||
@@ -57,25 +58,24 @@
|
@@ -66,30 +67,22 @@
|
||||||
return 6;
|
return 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
- public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int i1)
|
- /**
|
||||||
|
- * Drops the block items with a specified chance of dropping the specified items
|
||||||
|
- */
|
||||||
|
- public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int meta, int fortune)
|
+ public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune)
|
||||||
{
|
{
|
||||||
- if (world.isRemote)
|
- if (!par1World.isRemote)
|
||||||
- {
|
- {
|
||||||
- return;
|
- int var8 = 1;
|
||||||
- }
|
|
||||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||||
int j1 = 1;
|
+ int var8 = 1;
|
||||||
- if (l >= 3)
|
|
||||||
+ if (meta >= 3)
|
- if (par5 >= 3)
|
||||||
{
|
- {
|
||||||
j1 = 2 + world.rand.nextInt(3);
|
- var8 = 2 + par1World.rand.nextInt(3);
|
||||||
- if (i1 > 0)
|
-
|
||||||
+ if (fortune > 0)
|
- if (par7 > 0)
|
||||||
{
|
- {
|
||||||
- j1 += world.rand.nextInt(i1 + 1);
|
- var8 += par1World.rand.nextInt(par7 + 1);
|
||||||
+ j1 += world.rand.nextInt(fortune + 1);
|
- }
|
||||||
}
|
- }
|
||||||
}
|
+ if (metadata >= 3)
|
||||||
for (int k1 = 0; k1 < j1; k1++)
|
+ {
|
||||||
{
|
+ var8 = 2 + world.rand.nextInt(3) + (fortune > 0 ? world.rand.nextInt(fortune + 1) : 0);
|
||||||
- dropBlockAsItem_do(world, i, j, k, new ItemStack(Item.netherStalkSeeds));
|
+ }
|
||||||
|
|
||||||
|
- for (int var9 = 0; var9 < var8; ++var9)
|
||||||
|
- {
|
||||||
|
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.netherStalkSeeds));
|
||||||
|
- }
|
||||||
|
+ for (int var9 = 0; var9 < var8; ++var9)
|
||||||
|
+ {
|
||||||
+ ret.add(new ItemStack(Item.netherStalkSeeds));
|
+ ret.add(new ItemStack(Item.netherStalkSeeds));
|
||||||
}
|
}
|
||||||
+ return ret;
|
+ return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int idDropped(int i, Random random, int j)
|
/**
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/BlockPistonBase.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/BlockPistonBase.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/BlockPistonBase.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/BlockPistonBase.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -355,7 +355,7 @@
|
@@ -364,7 +364,7 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- return !(Block.blocksList[par0] instanceof BlockContainer);
|
||||||
|
+ return !(Block.blocksList[par0] != null && Block.blocksList[par0].hasTileEntity(par1World.getBlockMetadata(par2, par3, par4)));
|
||||||
}
|
}
|
||||||
- return !(Block.blocksList[i] instanceof BlockContainer);
|
|
||||||
+ return !(Block.blocksList[i] != null && Block.blocksList[i].hasTileEntity(world.getBlockMetadata(j, k, l)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean canExtend(World world, int i, int j, int k, int l)
|
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/BlockPressurePlate.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/BlockPressurePlate.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/BlockPressurePlate.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/BlockPressurePlate.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -38,7 +38,7 @@
|
@@ -61,7 +61,7 @@
|
||||||
|
*/
|
||||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
- return world.isBlockNormalCube(i, j - 1, k) || world.getBlockId(i, j - 1, k) == Block.fence.blockID;
|
- return par1World.isBlockNormalCube(par2, par3 - 1, par4) || par1World.getBlockId(par2, par3 - 1, par4) == Block.fence.blockID;
|
||||||
+ return world.isBlockSolidOnSide(i, j - 1, k, 1) || world.getBlockId(i, j - 1, k) == Block.fence.blockID;
|
+ return par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) || par1World.getBlockId(par2, par3 - 1, par4) == Block.fence.blockID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onBlockAdded(World world, int i, int j, int k)
|
/**
|
||||||
@@ -48,7 +48,7 @@
|
@@ -77,7 +77,7 @@
|
||||||
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
|
|
||||||
{
|
{
|
||||||
boolean flag = false;
|
boolean var6 = false;
|
||||||
- if (!world.isBlockNormalCube(i, j - 1, k) && world.getBlockId(i, j - 1, k) != Block.fence.blockID)
|
|
||||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && world.getBlockId(i, j - 1, k) != Block.fence.blockID)
|
- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4) && par1World.getBlockId(par2, par3 - 1, par4) != Block.fence.blockID)
|
||||||
|
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) && par1World.getBlockId(par2, par3 - 1, par4) != Block.fence.blockID)
|
||||||
{
|
{
|
||||||
flag = true;
|
var6 = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/BlockRail.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/BlockRail.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/BlockRail.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/BlockRail.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -5,16 +5,29 @@
|
@@ -6,6 +6,19 @@
|
||||||
public class BlockRail extends Block
|
|
||||||
{
|
{
|
||||||
|
/** Power related rails have this field at true. */
|
||||||
private final boolean isPowered;
|
private final boolean isPowered;
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
@ -15,93 +15,103 @@
|
||||||
+
|
+
|
||||||
+ public void setRenderType(int value)
|
+ public void setRenderType(int value)
|
||||||
+ {
|
+ {
|
||||||
+ renderType = value;
|
+ renderType = value;
|
||||||
+ }
|
+ }
|
||||||
|
|
||||||
public static final boolean isRailBlockAt(World world, int i, int j, int k)
|
/**
|
||||||
|
* Returns true if the block at the coordinates of world passed is a valid rail block (current is rail, powered or
|
||||||
|
@@ -14,7 +27,7 @@
|
||||||
|
public static final boolean isRailBlockAt(World par0World, int par1, int par2, int par3)
|
||||||
{
|
{
|
||||||
int l = world.getBlockId(i, j, k);
|
int var4 = par0World.getBlockId(par1, par2, par3);
|
||||||
- return l == Block.rail.blockID || l == Block.railPowered.blockID || l == Block.railDetector.blockID;
|
- return var4 == Block.rail.blockID || var4 == Block.railPowered.blockID || var4 == Block.railDetector.blockID;
|
||||||
+ return Block.blocksList[l] instanceof BlockRail;
|
+ return Block.blocksList[var4] instanceof BlockRail;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final boolean isRailBlock(int i)
|
/**
|
||||||
|
@@ -22,7 +35,7 @@
|
||||||
|
*/
|
||||||
|
public static final boolean isRailBlock(int par0)
|
||||||
{
|
{
|
||||||
- return i == Block.rail.blockID || i == Block.railPowered.blockID || i == Block.railDetector.blockID;
|
- return par0 == Block.rail.blockID || par0 == Block.railPowered.blockID || par0 == Block.railDetector.blockID;
|
||||||
+ return Block.blocksList[i] instanceof BlockRail;
|
+ return Block.blocksList[par0] instanceof BlockRail;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected BlockRail(int i, int j, boolean flag)
|
protected BlockRail(int par1, int par2, boolean par3)
|
||||||
@@ -81,7 +94,7 @@
|
@@ -118,7 +131,7 @@
|
||||||
|
*/
|
||||||
public int getRenderType()
|
public int getRenderType()
|
||||||
{
|
{
|
||||||
- return 9;
|
- return 9;
|
||||||
+ return renderType;
|
+ return renderType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int quantityDropped(Random random)
|
/**
|
||||||
@@ -91,7 +104,7 @@
|
@@ -134,7 +147,7 @@
|
||||||
|
*/
|
||||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
- return world.isBlockNormalCube(i, j - 1, k);
|
- return par1World.isBlockNormalCube(par2, par3 - 1, par4);
|
||||||
+ return world.isBlockSolidOnSide(i, j - 1, k, 1);
|
+ return par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onBlockAdded(World world, int i, int j, int k)
|
/**
|
||||||
@@ -119,23 +132,23 @@
|
@@ -171,27 +184,27 @@
|
||||||
j1 &= 7;
|
|
||||||
}
|
boolean var8 = false;
|
||||||
boolean flag = false;
|
|
||||||
- if (!world.isBlockNormalCube(i, j - 1, k))
|
- if (!par1World.isBlockNormalCube(par2, par3 - 1, par4))
|
||||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1))
|
+ if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1))
|
||||||
{
|
{
|
||||||
flag = true;
|
var8 = true;
|
||||||
}
|
}
|
||||||
- if (j1 == 2 && !world.isBlockNormalCube(i + 1, j, k))
|
|
||||||
+ if (j1 == 2 && !world.isBlockSolidOnSide(i + 1, j, k, 1))
|
- if (var7 == 2 && !par1World.isBlockNormalCube(par2 + 1, par3, par4))
|
||||||
{
|
+ if (var7 == 2 && !par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 1))
|
||||||
flag = true;
|
{
|
||||||
}
|
var8 = true;
|
||||||
- if (j1 == 3 && !world.isBlockNormalCube(i - 1, j, k))
|
}
|
||||||
+ if (j1 == 3 && !world.isBlockSolidOnSide(i - 1, j, k, 1))
|
|
||||||
{
|
- if (var7 == 3 && !par1World.isBlockNormalCube(par2 - 1, par3, par4))
|
||||||
flag = true;
|
+ if (var7 == 3 && !par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 1))
|
||||||
}
|
{
|
||||||
- if (j1 == 4 && !world.isBlockNormalCube(i, j, k - 1))
|
var8 = true;
|
||||||
+ if (j1 == 4 && !world.isBlockSolidOnSide(i, j, k - 1, 1))
|
}
|
||||||
{
|
|
||||||
flag = true;
|
- if (var7 == 4 && !par1World.isBlockNormalCube(par2, par3, par4 - 1))
|
||||||
}
|
+ if (var7 == 4 && !par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 1))
|
||||||
- if (j1 == 5 && !world.isBlockNormalCube(i, j, k + 1))
|
{
|
||||||
+ if (j1 == 5 && !world.isBlockSolidOnSide(i, j, k + 1, 1))
|
var8 = true;
|
||||||
{
|
}
|
||||||
flag = true;
|
|
||||||
}
|
- if (var7 == 5 && !par1World.isBlockNormalCube(par2, par3, par4 + 1))
|
||||||
@@ -317,8 +330,119 @@
|
+ if (var7 == 5 && !par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 1))
|
||||||
return 0;
|
{
|
||||||
|
var8 = true;
|
||||||
|
}
|
||||||
|
@@ -396,10 +409,120 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
+ /**
|
/**
|
||||||
|
- * Return true if the blocks passed is a power related rail.
|
||||||
+ * This function is no longer called by Minecraft
|
+ * This function is no longer called by Minecraft
|
||||||
+ */
|
*/
|
||||||
+ @Deprecated
|
+ @Deprecated
|
||||||
static boolean isPoweredBlockRail(BlockRail blockrail)
|
static boolean isPoweredBlockRail(BlockRail par0BlockRail)
|
||||||
{
|
{
|
||||||
return blockrail.isPowered;
|
return par0BlockRail.isPowered;
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Return true if the rail can make corners.
|
+ * Return true if the rail can make corners.
|
||||||
+ * Used by placement logic.
|
+ * Used by placement logic.
|
||||||
+ * @param world The world.
|
+ * @param world The world.
|
||||||
+ * @param i The rail X coordinate.
|
+ * @param x The rail X coordinate.
|
||||||
+ * @param j The rail Y coordinate.
|
+ * @param y The rail Y coordinate.
|
||||||
+ * @param k The rail Z coordinate.
|
+ * @param z The rail Z coordinate.
|
||||||
+ * @return True if the rail can make corners.
|
+ * @return True if the rail can make corners.
|
||||||
+ */
|
+ */
|
||||||
+ public boolean isFlexibleRail(World world, int i, int j, int k)
|
+ public boolean isFlexibleRail(World world, int y, int x, int z)
|
||||||
+ {
|
+ {
|
||||||
+ return !isPowered;
|
+ return !isPowered;
|
||||||
+ }
|
+ }
|
||||||
|
@ -110,12 +120,12 @@
|
||||||
+ * Returns true if the rail can make up and down slopes.
|
+ * Returns true if the rail can make up and down slopes.
|
||||||
+ * Used by placement logic.
|
+ * Used by placement logic.
|
||||||
+ * @param world The world.
|
+ * @param world The world.
|
||||||
+ * @param i The rail X coordinate.
|
+ * @param x The rail X coordinate.
|
||||||
+ * @param j The rail Y coordinate.
|
+ * @param y The rail Y coordinate.
|
||||||
+ * @param k The rail Z coordinate.
|
+ * @param z The rail Z coordinate.
|
||||||
+ * @return True if the rail can make slopes.
|
+ * @return True if the rail can make slopes.
|
||||||
+ */
|
+ */
|
||||||
+ public boolean canMakeSlopes(World world, int i, int j, int k)
|
+ public boolean canMakeSlopes(World world, int x, int y, int z)
|
||||||
+ {
|
+ {
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
|
@ -141,32 +151,34 @@
|
||||||
+ * All directions are Notch defined.
|
+ * All directions are Notch defined.
|
||||||
+ * In MC Beta 1.8.3 the Sun rises in the North.
|
+ * In MC Beta 1.8.3 the Sun rises in the North.
|
||||||
+ * In MC 1.0.0 the Sun rises in the East.
|
+ * In MC 1.0.0 the Sun rises in the East.
|
||||||
|
+ *
|
||||||
+ * @param world The world.
|
+ * @param world The world.
|
||||||
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
|
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
|
||||||
+ * @param i The rail X coordinate.
|
+ * @param y The rail X coordinate.
|
||||||
+ * @param j The rail Y coordinate.
|
+ * @param x The rail Y coordinate.
|
||||||
+ * @param k The rail Z coordinate.
|
+ * @param z The rail Z coordinate.
|
||||||
+ * @return The metadata.
|
+ * @return The metadata.
|
||||||
+ */
|
+ */
|
||||||
+ public int getBasicRailMetadata(IBlockAccess world, EntityMinecart cart, int i, int j, int k)
|
+ public int getBasicRailMetadata(IBlockAccess world, EntityMinecart cart, int x, int y, int z)
|
||||||
+ {
|
+ {
|
||||||
+ int meta = world.getBlockMetadata(i, j, k);
|
+ int meta = world.getBlockMetadata(x, y, z);
|
||||||
+ if(isPowered) {
|
+ if(isPowered)
|
||||||
|
+ {
|
||||||
+ meta = meta & 7;
|
+ meta = meta & 7;
|
||||||
+ }
|
+ }
|
||||||
+ return meta;
|
+ return meta;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Returns the max speed of the rail at [i, j, k].
|
+ * Returns the max speed of the rail at the specified position.
|
||||||
+ * @param world The world.
|
+ * @param world The world.
|
||||||
+ * @param cart The cart on the rail, may be null.
|
+ * @param cart The cart on the rail, may be null.
|
||||||
+ * @param i The rail X coordinate.
|
+ * @param x The rail X coordinate.
|
||||||
+ * @param j The rail Y coordinate.
|
+ * @param y The rail Y coordinate.
|
||||||
+ * @param k The rail Z coordinate.
|
+ * @param z The rail Z coordinate.
|
||||||
+ * @return The max speed of the current rail.
|
+ * @return The max speed of the current rail.
|
||||||
+ */
|
+ */
|
||||||
+ public float getRailMaxSpeed(World world, EntityMinecart cart, int i, int j, int k)
|
+ public float getRailMaxSpeed(World world, EntityMinecart cart, int y, int x, int z)
|
||||||
+ {
|
+ {
|
||||||
+ return 0.4f;
|
+ return 0.4f;
|
||||||
+ }
|
+ }
|
||||||
|
@ -176,11 +188,11 @@
|
||||||
+ * It is called once per update tick that the minecart is on the rail.
|
+ * It is called once per update tick that the minecart is on the rail.
|
||||||
+ * @param world The world.
|
+ * @param world The world.
|
||||||
+ * @param cart The cart on the rail.
|
+ * @param cart The cart on the rail.
|
||||||
+ * @param i The rail X coordinate.
|
+ * @param y The rail X coordinate.
|
||||||
+ * @param j The rail Y coordinate.
|
+ * @param x The rail Y coordinate.
|
||||||
+ * @param k The rail Z coordinate.
|
+ * @param z The rail Z coordinate.
|
||||||
+ */
|
+ */
|
||||||
+ public void onMinecartPass(World world, EntityMinecart cart, int i, int j, int k)
|
+ public void onMinecartPass(World world, EntityMinecart cart, int y, int x, int z)
|
||||||
+ {
|
+ {
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -189,12 +201,12 @@
|
||||||
+ * Avoid using this function when getBasicRailMetadata() can be used instead.
|
+ * Avoid using this function when getBasicRailMetadata() can be used instead.
|
||||||
+ * The only reason to use this function is if you wish to change the rails metadata.
|
+ * The only reason to use this function is if you wish to change the rails metadata.
|
||||||
+ * @param world The world.
|
+ * @param world The world.
|
||||||
+ * @param i The rail X coordinate.
|
+ * @param x The rail X coordinate.
|
||||||
+ * @param j The rail Y coordinate.
|
+ * @param y The rail Y coordinate.
|
||||||
+ * @param k The rail Z coordinate.
|
+ * @param z The rail Z coordinate.
|
||||||
+ * @return True if the 4th bit is a power bit.
|
+ * @return True if the 4th bit is a power bit.
|
||||||
+ */
|
+ */
|
||||||
+ public boolean hasPowerBit(World world, int i, int j, int k)
|
+ public boolean hasPowerBit(World world, int x, int y, int z)
|
||||||
+ {
|
+ {
|
||||||
+ return isPowered;
|
+ return isPowered;
|
||||||
+ }
|
+ }
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/BlockRedstoneRepeater.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/BlockRedstoneRepeater.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/BlockRedstoneRepeater.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/BlockRedstoneRepeater.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -28,7 +28,7 @@
|
@@ -33,7 +33,7 @@
|
||||||
|
*/
|
||||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
- if (!world.isBlockNormalCube(i, j - 1, k))
|
- return !par1World.isBlockNormalCube(par2, par3 - 1, par4) ? false : super.canPlaceBlockAt(par1World, par2, par3, par4);
|
||||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1))
|
+ return !par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) ? false : super.canPlaceBlockAt(par1World, par2, par3, par4);
|
||||||
{
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
@@ -40,7 +40,7 @@
|
|
||||||
|
|
||||||
public boolean canBlockStay(World world, int i, int j, int k)
|
/**
|
||||||
|
@@ -41,7 +41,7 @@
|
||||||
|
*/
|
||||||
|
public boolean canBlockStay(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
- if (!world.isBlockNormalCube(i, j - 1, k))
|
- return !par1World.isBlockNormalCube(par2, par3 - 1, par4) ? false : super.canBlockStay(par1World, par2, par3, par4);
|
||||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1))
|
+ return !par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) ? false : super.canBlockStay(par1World, par2, par3, par4);
|
||||||
{
|
}
|
||||||
return false;
|
|
||||||
}
|
/**
|
||||||
|
|
|
@ -1,33 +1,31 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/BlockRedstoneWire.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/BlockRedstoneWire.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/BlockRedstoneWire.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/BlockRedstoneWire.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -2,6 +2,8 @@
|
@@ -5,6 +5,8 @@
|
||||||
|
import java.util.Random;
|
||||||
import java.util.*;
|
import java.util.Set;
|
||||||
|
|
||||||
+import net.minecraft.src.forge.IConnectRedstone;
|
+import net.minecraft.src.forge.IConnectRedstone;
|
||||||
+
|
+
|
||||||
public class BlockRedstoneWire extends Block
|
public class BlockRedstoneWire extends Block
|
||||||
{
|
{
|
||||||
private boolean wiresProvidePower;
|
/**
|
||||||
@@ -47,7 +49,7 @@
|
@@ -76,7 +78,7 @@
|
||||||
|
*/
|
||||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
- return world.isBlockNormalCube(i, j - 1, k);
|
- return par1World.isBlockNormalCube(par2, par3 - 1, par4) || par1World.getBlockId(par2, par3 - 1, par4) == Block.glowStone.blockID;
|
||||||
+ return world.isBlockSolidOnSide(i, j - 1, k, 1);
|
+ return par1World.isBlockSolidOnSide(par2, par3 - 1, par4, 1) || par1World.getBlockId(par2, par3 - 1, par4) == Block.glowStone.blockID;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateAndPropagateCurrentStrength(World world, int i, int j, int k)
|
/**
|
||||||
@@ -467,6 +469,12 @@
|
@@ -548,6 +550,10 @@
|
||||||
int j1 = iblockaccess.getBlockMetadata(i, j, k);
|
|
||||||
return l == (j1 & 3) || l == Direction.footInvisibleFaceRemap[j1 & 3];
|
|
||||||
}
|
}
|
||||||
+
|
else if (var5 != Block.redstoneRepeaterIdle.blockID && var5 != Block.redstoneRepeaterActive.blockID)
|
||||||
+ if (Block.blocksList[i1] instanceof IConnectRedstone)
|
{
|
||||||
+ {
|
+ if (Block.blocksList[var5] instanceof IConnectRedstone)
|
||||||
+ return ((IConnectRedstone)Block.blocksList[i1]).canConnectRedstone(iblockaccess, i, j, k, l);
|
+ {
|
||||||
+ }
|
+ return ((IConnectRedstone)Block.blocksList[var5]).canConnectRedstone(par0IBlockAccess, par1, par2, par3, par4);
|
||||||
+
|
+ }
|
||||||
return Block.blocksList[i1].canProvidePower() && l != -1;
|
return Block.blocksList[var5].canProvidePower() && par4 != -1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
|
|
@ -1,43 +1,44 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/BlockSnow.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/BlockSnow.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/BlockSnow.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/BlockSnow.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -63,7 +63,6 @@
|
@@ -73,7 +73,6 @@
|
||||||
{
|
{
|
||||||
if (!canPlaceBlockAt(world, i, j, k))
|
if (!this.canPlaceBlockAt(par1World, par2, par3, par4))
|
||||||
{
|
{
|
||||||
- dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
|
- this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||||
world.setBlockWithNotify(i, j, k, 0);
|
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -75,15 +74,7 @@
|
@@ -89,15 +88,7 @@
|
||||||
|
*/
|
||||||
public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
|
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
|
||||||
{
|
{
|
||||||
- int i1 = Item.snowball.shiftedIndex;
|
- int var7 = Item.snowball.shiftedIndex;
|
||||||
- float f = 0.7F;
|
- float var8 = 0.7F;
|
||||||
- double d = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
- double var9 = (double)(par1World.rand.nextFloat() * var8) + (double)(1.0F - var8) * 0.5D;
|
||||||
- double d1 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
- double var11 = (double)(par1World.rand.nextFloat() * var8) + (double)(1.0F - var8) * 0.5D;
|
||||||
- double d2 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
- double var13 = (double)(par1World.rand.nextFloat() * var8) + (double)(1.0F - var8) * 0.5D;
|
||||||
- EntityItem entityitem = new EntityItem(world, (double)i + d, (double)j + d1, (double)k + d2, new ItemStack(i1, 1, 0));
|
- EntityItem var15 = new EntityItem(par1World, (double)par3 + var9, (double)par4 + var11, (double)par5 + var13, new ItemStack(var7, 1, 0));
|
||||||
- entityitem.delayBeforeCanPickup = 10;
|
- var15.delayBeforeCanPickup = 10;
|
||||||
- world.spawnEntityInWorld(entityitem);
|
- par1World.spawnEntityInWorld(var15);
|
||||||
- world.setBlockWithNotify(i, j, k, 0);
|
- par1World.setBlockWithNotify(par3, par4, par5, 0);
|
||||||
+ dropBlockAsItem(world, i, j, k, l, 0);
|
+ dropBlockAsItem(par1World, par3, par4, par5, par6, 0);
|
||||||
entityplayer.addStat(StatList.mineBlockStatArray[blockID], 1);
|
par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,14 +85,13 @@
|
@@ -114,7 +105,7 @@
|
||||||
|
*/
|
||||||
public int quantityDropped(Random random)
|
public int quantityDropped(Random par1Random)
|
||||||
{
|
{
|
||||||
- return 0;
|
- return 0;
|
||||||
+ return 1;
|
+ return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateTick(World world, int i, int j, int k, Random random)
|
/**
|
||||||
|
@@ -124,7 +115,6 @@
|
||||||
{
|
{
|
||||||
if (world.getSavedLightValue(EnumSkyBlock.Block, i, j, k) > 11)
|
if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11)
|
||||||
{
|
{
|
||||||
- dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
|
- this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
||||||
world.setBlockWithNotify(i, j, k, 0);
|
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,70 +12,59 @@
|
||||||
+
|
+
|
||||||
+public class BlockTallGrass extends BlockFlower implements IShearable
|
+public class BlockTallGrass extends BlockFlower implements IShearable
|
||||||
{
|
{
|
||||||
protected BlockTallGrass(int i, int j)
|
protected BlockTallGrass(int par1, int par2)
|
||||||
{
|
{
|
||||||
@@ -65,14 +69,7 @@
|
@@ -49,7 +53,7 @@
|
||||||
|
*/
|
||||||
public int idDropped(int i, Random random, int j)
|
public int idDropped(int par1, Random par2Random, int par3)
|
||||||
{
|
{
|
||||||
- if (random.nextInt(8) == 0)
|
- return par2Random.nextInt(8) == 0 ? Item.seeds.shiftedIndex : -1;
|
||||||
- {
|
|
||||||
- return Item.seeds.shiftedIndex;
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- return -1;
|
|
||||||
- }
|
|
||||||
+ return -1;
|
+ return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int quantityDroppedWithBonus(int i, Random random)
|
/**
|
||||||
@@ -80,16 +77,39 @@
|
@@ -66,14 +70,39 @@
|
||||||
return 1 + random.nextInt(i * 2 + 1);
|
*/
|
||||||
}
|
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
|
||||||
|
|
||||||
+ @Override
|
|
||||||
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int md, int fortune)
|
|
||||||
+ {
|
|
||||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
|
||||||
+ if (world.rand.nextInt(8) != 0)
|
|
||||||
+ {
|
|
||||||
+ return ret;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ ItemStack item = ForgeHooks.getGrassSeed(world);
|
|
||||||
+ if (item != null)
|
|
||||||
+ {
|
|
||||||
+ ret.add(item);
|
|
||||||
+ }
|
|
||||||
+ return ret;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
|
|
||||||
{
|
{
|
||||||
- if (!world.isRemote && entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex)
|
- if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex)
|
||||||
- {
|
+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||||
- entityplayer.addStat(StatList.mineBlockStatArray[blockID], 1);
|
|
||||||
- dropBlockAsItem_do(world, i, j, k, new ItemStack(Block.tallGrass, 1, l));
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- super.harvestBlock(world, entityplayer, i, j, k, l);
|
|
||||||
- }
|
|
||||||
+ super.harvestBlock(world, entityplayer, i, j, k, l);
|
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean isShearable(ItemStack item, World world, int X, int Y, int Z)
|
+ public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int meta, int fortune)
|
||||||
|
+ {
|
||||||
|
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||||
|
+ if (world.rand.nextInt(8) != 0)
|
||||||
|
{
|
||||||
|
- par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
|
||||||
|
- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.tallGrass, 1, par6));
|
||||||
|
+ return ret;
|
||||||
|
}
|
||||||
|
- else
|
||||||
|
+
|
||||||
|
+ ItemStack item = ForgeHooks.getGrassSeed(world);
|
||||||
|
+ if (item != null)
|
||||||
|
{
|
||||||
|
- super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||||
|
+ ret.add(item);
|
||||||
|
}
|
||||||
|
+ return ret;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean isShearable(ItemStack item, World world, int x, int y, int z)
|
||||||
+ {
|
+ {
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public ArrayList<ItemStack> onSheared(ItemStack item, World world, int X, int Y, int Z, int fortune)
|
+ public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune)
|
||||||
+ {
|
+ {
|
||||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||||
+ ret.add(new ItemStack(this, 1, world.getBlockMetadata(X, Y, Z)));
|
+ ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z)));
|
||||||
+ return ret;
|
+ return ret;
|
||||||
}
|
}
|
||||||
|
+
|
||||||
|
+
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,107 +1,102 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/BlockTorch.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/BlockTorch.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/BlockTorch.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/BlockTorch.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -32,7 +32,7 @@
|
@@ -49,7 +49,7 @@
|
||||||
|
*/
|
||||||
private boolean canPlaceTorchOn(World world, int i, int j, int k)
|
private boolean canPlaceTorchOn(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
- if (world.isBlockNormalCubeDefault(i, j, k, true))
|
- if (par1World.isBlockNormalCubeDefault(par2, par3, par4, true))
|
||||||
+ if (world.isBlockSolidOnSide(i, j, k, 1))
|
+ if (par1World.isBlockSolidOnSide(par2, par3, par4, 1))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -45,19 +45,19 @@
|
@@ -83,7 +83,11 @@
|
||||||
|
*/
|
||||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
- if (world.isBlockNormalCubeDefault(i - 1, j, k, true))
|
- return par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) ? true : (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) ? true : (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) ? true : (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) ? true : this.canPlaceTorchOn(par1World, par2, par3 - 1, par4))));
|
||||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
+ return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) ||
|
||||||
{
|
+ par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) ||
|
||||||
return true;
|
+ par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) ||
|
||||||
}
|
+ par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2) ||
|
||||||
- if (world.isBlockNormalCubeDefault(i + 1, j, k, true))
|
+ canPlaceTorchOn(par1World, par2, par3 - 1, par4);
|
||||||
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
}
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- if (world.isBlockNormalCubeDefault(i, j, k - 1, true))
|
|
||||||
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
- if (world.isBlockNormalCubeDefault(i, j, k + 1, true))
|
|
||||||
+ if (world.isBlockSolidOnSide(i, j, k + 1, 2))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@@ -71,19 +71,19 @@
|
|
||||||
{
|
|
||||||
i1 = 5;
|
|
||||||
}
|
|
||||||
- if (l == 2 && world.isBlockNormalCubeDefault(i, j, k + 1, true))
|
|
||||||
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
|
||||||
{
|
|
||||||
i1 = 4;
|
|
||||||
}
|
|
||||||
- if (l == 3 && world.isBlockNormalCubeDefault(i, j, k - 1, true))
|
|
||||||
+ if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
|
||||||
{
|
|
||||||
i1 = 3;
|
|
||||||
}
|
|
||||||
- if (l == 4 && world.isBlockNormalCubeDefault(i + 1, j, k, true))
|
|
||||||
+ if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
|
||||||
{
|
|
||||||
i1 = 2;
|
|
||||||
}
|
|
||||||
- if (l == 5 && world.isBlockNormalCubeDefault(i - 1, j, k, true))
|
|
||||||
+ if (l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5))
|
|
||||||
{
|
|
||||||
i1 = 1;
|
|
||||||
}
|
|
||||||
@@ -101,19 +101,19 @@
|
|
||||||
|
|
||||||
public void onBlockAdded(World world, int i, int j, int k)
|
/**
|
||||||
|
@@ -99,22 +103,22 @@
|
||||||
|
var6 = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (par5 == 2 && par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true))
|
||||||
|
+ if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2))
|
||||||
|
{
|
||||||
|
var6 = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (par5 == 3 && par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true))
|
||||||
|
+ if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3))
|
||||||
|
{
|
||||||
|
var6 = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (par5 == 4 && par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true))
|
||||||
|
+ if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4))
|
||||||
|
{
|
||||||
|
var6 = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (par5 == 5 && par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true))
|
||||||
|
+ if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5))
|
||||||
|
{
|
||||||
|
var6 = 1;
|
||||||
|
}
|
||||||
|
@@ -140,19 +144,19 @@
|
||||||
|
*/
|
||||||
|
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
- if (world.isBlockNormalCubeDefault(i - 1, j, k, true))
|
- if (par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true))
|
||||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
+ if (par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5))
|
||||||
{
|
{
|
||||||
world.setBlockMetadataWithNotify(i, j, k, 1);
|
par1World.setBlockMetadataWithNotify(par2, par3, par4, 1);
|
||||||
}
|
}
|
||||||
- else if (world.isBlockNormalCubeDefault(i + 1, j, k, true))
|
- else if (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true))
|
||||||
+ else if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
+ else if (par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4))
|
||||||
{
|
{
|
||||||
world.setBlockMetadataWithNotify(i, j, k, 2);
|
par1World.setBlockMetadataWithNotify(par2, par3, par4, 2);
|
||||||
}
|
}
|
||||||
- else if (world.isBlockNormalCubeDefault(i, j, k - 1, true))
|
- else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true))
|
||||||
+ else if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
+ else if (par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3))
|
||||||
{
|
{
|
||||||
world.setBlockMetadataWithNotify(i, j, k, 3);
|
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3);
|
||||||
}
|
}
|
||||||
- else if (world.isBlockNormalCubeDefault(i, j, k + 1, true))
|
- else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true))
|
||||||
+ else if (world.isBlockSolidOnSide(i, j, k + 1, 2))
|
+ else if (par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2))
|
||||||
{
|
{
|
||||||
world.setBlockMetadataWithNotify(i, j, k, 4);
|
par1World.setBlockMetadataWithNotify(par2, par3, par4, 4);
|
||||||
}
|
}
|
||||||
@@ -130,19 +130,19 @@
|
@@ -175,22 +179,22 @@
|
||||||
{
|
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
||||||
int i1 = world.getBlockMetadata(i, j, k);
|
boolean var7 = false;
|
||||||
boolean flag = false;
|
|
||||||
- if (!world.isBlockNormalCubeDefault(i - 1, j, k, true) && i1 == 1)
|
- if (!par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) && var6 == 1)
|
||||||
+ if (!world.isBlockSolidOnSide(i - 1, j, k, 5) && i1 == 1)
|
+ if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, 5) && var6 == 1)
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
- if (!world.isBlockNormalCubeDefault(i + 1, j, k, true) && i1 == 2)
|
|
||||||
+ if (!world.isBlockSolidOnSide(i + 1, j, k, 4) && i1 == 2)
|
- if (!par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) && var6 == 2)
|
||||||
|
+ if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, 4) && var6 == 2)
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
- if (!world.isBlockNormalCubeDefault(i, j, k - 1, true) && i1 == 3)
|
|
||||||
+ if (!world.isBlockSolidOnSide(i, j, k - 1, 3) && i1 == 3)
|
- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) && var6 == 3)
|
||||||
|
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, 3) && var6 == 3)
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
- if (!world.isBlockNormalCubeDefault(i, j, k + 1, true) && i1 == 4)
|
|
||||||
+ if (!world.isBlockSolidOnSide(i, j, k + 1, 2) && i1 == 4)
|
- if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) && var6 == 4)
|
||||||
|
+ if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, 2) && var6 == 4)
|
||||||
{
|
{
|
||||||
flag = true;
|
var7 = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,50 +4,50 @@
|
||||||
|
|
||||||
public class BlockTrapDoor extends Block
|
public class BlockTrapDoor extends Block
|
||||||
{
|
{
|
||||||
+ /* FORGE: Set this to allow trapdoors to remain free-floating */
|
+ /** Set this to allow trapdoors to remain free-floating */
|
||||||
+ public static boolean disableValidation = false;
|
+ public static boolean disableValidation = false;
|
||||||
+
|
+
|
||||||
protected BlockTrapDoor(int i, Material material)
|
protected BlockTrapDoor(int par1, Material par2Material)
|
||||||
{
|
{
|
||||||
super(i, material);
|
super(par1, par2Material);
|
||||||
@@ -139,7 +142,7 @@
|
@@ -183,7 +186,7 @@
|
||||||
{
|
--var7;
|
||||||
j1--;
|
}
|
||||||
}
|
|
||||||
- if (!isValidSupportBlock(world.getBlockId(j1, j, k1)))
|
|
||||||
+ if (!(isValidSupportBlock(world.getBlockId(j1, j, k1)) || world.isBlockSolidOnSide(j1, j, k1, (i1 & 3) + 2)))
|
|
||||||
{
|
|
||||||
world.setBlockWithNotify(i, j, k, 0);
|
|
||||||
dropBlockAsItem(world, i, j, k, i1, 0);
|
|
||||||
@@ -181,6 +184,10 @@
|
|
||||||
|
|
||||||
public boolean canPlaceBlockOnSide(World world, int i, int j, int k, int l)
|
- if (!isValidSupportBlock(par1World.getBlockId(var7, par3, var8)))
|
||||||
|
+ if (!(isValidSupportBlock(par1World.getBlockId(var7, par3, var8)) || par1World.isBlockSolidOnSide(var7, par3, var8, (var6 & 3) + 2)))
|
||||||
|
{
|
||||||
|
par1World.setBlockWithNotify(par2, par3, par4, 0);
|
||||||
|
this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0);
|
||||||
|
@@ -241,6 +244,10 @@
|
||||||
|
|
||||||
|
public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5)
|
||||||
{
|
{
|
||||||
+ if (disableValidation)
|
+ if (disableValidation)
|
||||||
+ {
|
+ {
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
if (l == 0)
|
if (par5 == 0)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -205,7 +212,7 @@
|
@@ -271,7 +278,7 @@
|
||||||
{
|
--par2;
|
||||||
i--;
|
}
|
||||||
|
|
||||||
|
- return isValidSupportBlock(par1World.getBlockId(par2, par3, par4));
|
||||||
|
+ return isValidSupportBlock(par1World.getBlockId(par2, par3, par4)) || par1World.isBlockSolidOnSide(par2, par3, par4, 1);
|
||||||
}
|
}
|
||||||
- return isValidSupportBlock(world.getBlockId(i, j, k));
|
|
||||||
+ return isValidSupportBlock(world.getBlockId(i, j, k)) || world.isBlockSolidOnSide(i, j, k, l);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isTrapdoorOpen(int i)
|
@@ -286,6 +293,11 @@
|
||||||
@@ -215,6 +222,11 @@
|
*/
|
||||||
|
private static boolean isValidSupportBlock(int par0)
|
||||||
private static boolean isValidSupportBlock(int i)
|
|
||||||
{
|
{
|
||||||
+ if (disableValidation)
|
+ if (disableValidation)
|
||||||
+ {
|
+ {
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
if (i <= 0)
|
if (par0 <= 0)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -11,35 +11,41 @@
|
||||||
+
|
+
|
||||||
+public class BlockVine extends Block implements IShearable
|
+public class BlockVine extends Block implements IShearable
|
||||||
{
|
{
|
||||||
public BlockVine(int i)
|
public BlockVine(int par1)
|
||||||
{
|
{
|
||||||
@@ -345,14 +348,20 @@
|
@@ -429,14 +432,26 @@
|
||||||
|
*/
|
||||||
public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
|
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
|
||||||
{
|
{
|
||||||
- if (!world.isRemote && entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex)
|
- if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex)
|
||||||
- {
|
- {
|
||||||
- entityplayer.addStat(StatList.mineBlockStatArray[blockID], 1);
|
- par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
|
||||||
- dropBlockAsItem_do(world, i, j, k, new ItemStack(Block.vine, 1, 0));
|
- this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.vine, 1, 0));
|
||||||
- }
|
- }
|
||||||
- else
|
- else
|
||||||
- {
|
- {
|
||||||
- super.harvestBlock(world, entityplayer, i, j, k, l);
|
- super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||||
- }
|
- }
|
||||||
+ super.harvestBlock(world, entityplayer, i, j, k, l);
|
+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean isShearable(ItemStack item, World world, int X, int Y, int Z)
|
+ public boolean isShearable(ItemStack item, World world, int x, int y, int z)
|
||||||
+ {
|
+ {
|
||||||
+ return true;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public ArrayList<ItemStack> onSheared(ItemStack item, World world, int X, int Y, int Z, int fortune)
|
+ public ArrayList<ItemStack> onSheared(ItemStack item, World world, int x, int y, int z, int fortune)
|
||||||
+ {
|
+ {
|
||||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||||
+ ret.add(new ItemStack(this, 1, 0));
|
+ ret.add(new ItemStack(this, 1, 0));
|
||||||
+ return ret;
|
+ return ret;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean isLadder(World world, int x, int y, int z)
|
||||||
|
+ {
|
||||||
|
+ return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,232 +1,190 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/Chunk.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/Chunk.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/Chunk.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/Chunk.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -338,7 +338,7 @@
|
@@ -546,7 +546,7 @@
|
||||||
{
|
|
||||||
Block.blocksList[l1].onBlockRemoval(worldObj, i2, j, j2);
|
|
||||||
}
|
|
||||||
- else if ((Block.blocksList[l1] instanceof BlockContainer) && l1 != l)
|
|
||||||
+ else if (Block.blocksList[l1] != null && Block.blocksList[l1].hasTileEntity(getBlockMetadata(i, j, k)))
|
|
||||||
{
|
|
||||||
worldObj.removeBlockTileEntity(i2, j, j2);
|
|
||||||
}
|
|
||||||
@@ -368,12 +368,12 @@
|
|
||||||
{
|
|
||||||
Block.blocksList[l].onBlockAdded(worldObj, i2, j, j2);
|
|
||||||
}
|
|
||||||
- if (Block.blocksList[l] instanceof BlockContainer)
|
|
||||||
+ if (Block.blocksList[l] != null && Block.blocksList[l].hasTileEntity(i1))
|
|
||||||
{
|
|
||||||
TileEntity tileentity = getChunkBlockTileEntity(i, j, k);
|
|
||||||
if (tileentity == null)
|
|
||||||
{
|
{
|
||||||
- tileentity = ((BlockContainer)Block.blocksList[l]).getBlockEntity();
|
Block.blocksList[var8].onBlockRemoval(this.worldObj, var11, par2, var12);
|
||||||
+ tileentity = Block.blocksList[l].getTileEntity(i1);
|
|
||||||
worldObj.setBlockTileEntity(i2, j, j2, tileentity);
|
|
||||||
}
|
}
|
||||||
if (tileentity != null)
|
- else if (Block.blocksList[var8] instanceof BlockContainer && var8 != par4)
|
||||||
@@ -382,14 +382,6 @@
|
+ else if (Block.blocksList[var8] != null && Block.blocksList[var8].hasTileEntity(getBlockMetadata(par1, par2, par3)))
|
||||||
|
{
|
||||||
|
this.worldObj.removeBlockTileEntity(var11, par2, var12);
|
||||||
|
}
|
||||||
|
@@ -584,32 +584,23 @@
|
||||||
|
Block.blocksList[par4].onBlockAdded(this.worldObj, var11, par2, var12);
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (Block.blocksList[par4] instanceof BlockContainer)
|
||||||
|
+ if (Block.blocksList[par4] != null && Block.blocksList[par4].hasTileEntity(par5))
|
||||||
|
{
|
||||||
|
var13 = this.getChunkBlockTileEntity(par1, par2, par3);
|
||||||
|
|
||||||
|
if (var13 == null)
|
||||||
|
{
|
||||||
|
- var13 = ((BlockContainer)Block.blocksList[par4]).getBlockEntity();
|
||||||
|
+ var13 = Block.blocksList[par4].getTileEntity(par5);
|
||||||
|
this.worldObj.setBlockTileEntity(var11, par2, var12, var13);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (var13 != null)
|
||||||
|
{
|
||||||
|
var13.updateContainingBlockInfo();
|
||||||
|
+ var13.blockMetadata = par5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
- else if (var8 > 0 && Block.blocksList[var8] instanceof BlockContainer)
|
||||||
- else if (l1 > 0 && (Block.blocksList[l1] instanceof BlockContainer))
|
|
||||||
- {
|
|
||||||
- TileEntity tileentity1 = getChunkBlockTileEntity(i, j, k);
|
|
||||||
- if (tileentity1 != null)
|
|
||||||
- {
|
- {
|
||||||
- tileentity1.updateContainingBlockInfo();
|
- var13 = this.getChunkBlockTileEntity(par1, par2, par3);
|
||||||
|
-
|
||||||
|
- if (var13 != null)
|
||||||
|
- {
|
||||||
|
- var13.updateContainingBlockInfo();
|
||||||
|
- }
|
||||||
- }
|
- }
|
||||||
- }
|
-
|
||||||
isModified = true;
|
this.isModified = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
@@ -413,7 +405,11 @@
|
|
||||||
blocks[i << worldObj.xShift | k << worldObj.heightShift | j] = (byte)(byte0 & 0xff);
|
|
||||||
if (k1 != 0)
|
|
||||||
{
|
|
||||||
- Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2);
|
|
||||||
+ if (!worldObj.isRemote)
|
|
||||||
+ {
|
|
||||||
+ Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2);
|
|
||||||
+ }
|
|
||||||
+ removeChunkBlockTileEntity(i, j, k);
|
|
||||||
}
|
}
|
||||||
data.set(i, j, k, 0);
|
@@ -640,7 +631,7 @@
|
||||||
if (Block.lightOpacity[byte0 & 0xff] != 0)
|
var5.func_48690_b(par1, par2 & 15, par3, par4);
|
||||||
@@ -436,28 +432,22 @@
|
int var7 = var5.func_48703_a(par1, par2 & 15, par3);
|
||||||
{
|
|
||||||
Block.blocksList[l].onBlockAdded(worldObj, l1, j, i2);
|
- if (var7 > 0 && Block.blocksList[var7] instanceof BlockContainer)
|
||||||
}
|
+ if (var7 > 0 && Block.blocksList[var7] != null && Block.blocksList[var7].hasTileEntity(var5.func_48694_b(par1, par3 & 15, par3)))
|
||||||
- if (l > 0 && (Block.blocksList[l] instanceof BlockContainer))
|
|
||||||
+ int meta = getBlockMetadata(i, j, k);
|
|
||||||
+ if (l > 0 && Block.blocksList[l] != null && Block.blocksList[l].hasTileEntity(meta))
|
|
||||||
{
|
|
||||||
TileEntity tileentity = getChunkBlockTileEntity(i, j, k);
|
|
||||||
if (tileentity == null)
|
|
||||||
{
|
{
|
||||||
- tileentity = ((BlockContainer)Block.blocksList[l]).getBlockEntity();
|
TileEntity var8 = this.getChunkBlockTileEntity(par1, par2, par3);
|
||||||
+ tileentity = Block.blocksList[l].getTileEntity(meta);
|
|
||||||
worldObj.setBlockTileEntity(l1, j, i2, tileentity);
|
@@ -807,33 +798,31 @@
|
||||||
}
|
ChunkPosition var4 = new ChunkPosition(par1, par2, par3);
|
||||||
if (tileentity != null)
|
TileEntity var5 = (TileEntity)this.chunkTileEntityMap.get(var4);
|
||||||
{
|
|
||||||
tileentity.updateContainingBlockInfo();
|
+ if (var5 != null && var5.isInvalid())
|
||||||
+ tileentity.blockMetadata = meta;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- else if (k1 > 0 && (Block.blocksList[k1] instanceof BlockContainer))
|
|
||||||
- {
|
|
||||||
- TileEntity tileentity1 = getChunkBlockTileEntity(i, j, k);
|
|
||||||
- if (tileentity1 != null)
|
|
||||||
- {
|
|
||||||
- tileentity1.updateContainingBlockInfo();
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
isModified = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@@ -477,7 +467,7 @@
|
|
||||||
}
|
|
||||||
data.set(i, j, k, l);
|
|
||||||
int j1 = getBlockID(i, j, k);
|
|
||||||
- if (j1 > 0 && (Block.blocksList[j1] instanceof BlockContainer))
|
|
||||||
+ if (j1 > 0 && Block.blocksList[j1] != null && Block.blocksList[j1].hasTileEntity(i1))
|
|
||||||
{
|
|
||||||
TileEntity tileentity = getChunkBlockTileEntity(i, j, k);
|
|
||||||
if (tileentity != null)
|
|
||||||
@@ -594,29 +584,27 @@
|
|
||||||
{
|
|
||||||
ChunkPosition chunkposition = new ChunkPosition(i, j, k);
|
|
||||||
TileEntity tileentity = (TileEntity)chunkTileEntityMap.get(chunkposition);
|
|
||||||
+ if (tileentity != null && tileentity.isInvalid())
|
|
||||||
+ {
|
+ {
|
||||||
+ chunkTileEntityMap.remove(chunkposition);
|
+ chunkTileEntityMap.remove(var4);
|
||||||
+ tileentity = null;
|
+ var5 = null;
|
||||||
+ }
|
+ }
|
||||||
if (tileentity == null)
|
+
|
||||||
|
if (var5 == null)
|
||||||
{
|
{
|
||||||
int l = getBlockID(i, j, k);
|
int var6 = this.getBlockID(par1, par2, par3);
|
||||||
- if (!Block.isBlockContainer[l])
|
-
|
||||||
+ int meta = getBlockMetadata(i, j, k);
|
- if (var6 <= 0 || !Block.blocksList[var6].func_48205_p())
|
||||||
+ if (Block.blocksList[l] == null || !Block.blocksList[l].hasTileEntity(meta))
|
+ int meta = getBlockMetadata(par1, par2, par3);
|
||||||
|
+ if (var6 <= 0 || Block.blocksList[var6] == null || !Block.blocksList[var6].hasTileEntity(meta))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (tileentity == null)
|
|
||||||
|
if (var5 == null)
|
||||||
{
|
{
|
||||||
- tileentity = ((BlockContainer)Block.blocksList[l]).getBlockEntity();
|
- var5 = ((BlockContainer)Block.blocksList[var6]).getBlockEntity();
|
||||||
+ tileentity = Block.blocksList[l].getTileEntity(meta);
|
+ var5 = Block.blocksList[var6].getTileEntity(meta);
|
||||||
worldObj.setBlockTileEntity(xPosition * 16 + i, j, zPosition * 16 + k, tileentity);
|
this.worldObj.setBlockTileEntity(this.xPosition * 16 + par1, par2, this.zPosition * 16 + par3, var5);
|
||||||
}
|
}
|
||||||
tileentity = (TileEntity)chunkTileEntityMap.get(chunkposition);
|
|
||||||
|
var5 = (TileEntity)this.chunkTileEntityMap.get(var4);
|
||||||
}
|
}
|
||||||
- if (tileentity != null && tileentity.isInvalid())
|
|
||||||
|
- if (var5 != null && var5.isInvalid())
|
||||||
- {
|
- {
|
||||||
- chunkTileEntityMap.remove(chunkposition);
|
- this.chunkTileEntityMap.remove(var4);
|
||||||
- return null;
|
- return null;
|
||||||
- }
|
- }
|
||||||
- else
|
- else
|
||||||
- {
|
- {
|
||||||
- return tileentity;
|
- return var5;
|
||||||
- }
|
- }
|
||||||
+ return tileentity;
|
+ return var5;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addTileEntity(TileEntity tileentity)
|
/**
|
||||||
@@ -627,7 +615,7 @@
|
@@ -848,7 +837,7 @@
|
||||||
setChunkBlockTileEntity(i, j, k, tileentity);
|
|
||||||
if (isChunkLoaded)
|
if (this.isChunkLoaded)
|
||||||
{
|
{
|
||||||
- worldObj.loadedTileEntityList.add(tileentity);
|
- this.worldObj.loadedTileEntityList.add(par1TileEntity);
|
||||||
+ worldObj.addTileEntity(tileentity);
|
+ this.worldObj.addTileEntity(par1TileEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -638,12 +626,18 @@
|
@@ -863,8 +852,14 @@
|
||||||
tileentity.xCoord = xPosition * 16 + i;
|
par4TileEntity.yCoord = par2;
|
||||||
tileentity.yCoord = j;
|
par4TileEntity.zCoord = this.zPosition * 16 + par3;
|
||||||
tileentity.zCoord = zPosition * 16 + k;
|
|
||||||
- if (getBlockID(i, j, k) == 0 || !(Block.blocksList[getBlockID(i, j, k)] instanceof BlockContainer))
|
|
||||||
+ int id = getBlockID(i, j, k);
|
|
||||||
+ if (id == 0 || Block.blocksList[id] == null || !Block.blocksList[id].hasTileEntity(getBlockMetadata(i, j, k)))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
+ TileEntity old = (TileEntity)chunkTileEntityMap.get(chunkposition);
|
|
||||||
+ if (old != null)
|
|
||||||
+ {
|
|
||||||
+ old.invalidate();
|
|
||||||
+ }
|
|
||||||
tileentity.validate();
|
|
||||||
chunkTileEntityMap.put(chunkposition, tileentity);
|
|
||||||
return;
|
|
||||||
@@ -790,6 +784,16 @@
|
|
||||||
public int setChunkData(byte abyte0[], int i, int j, int k, int l, int i1, int j1,
|
|
||||||
int k1)
|
|
||||||
{
|
|
||||||
+ TileEntity te;
|
|
||||||
+ Iterator iterator = chunkTileEntityMap.values().iterator();
|
|
||||||
+ while (iterator.hasNext())
|
|
||||||
+ {
|
|
||||||
+ te = (TileEntity)iterator.next();
|
|
||||||
+ te.updateContainingBlockInfo();
|
|
||||||
+ te.getBlockMetadata();
|
|
||||||
+ te.getBlockType();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
for (int l1 = i; l1 < l; l1++)
|
|
||||||
{
|
|
||||||
for (int l2 = k; l2 < j1; l2++)
|
|
||||||
@@ -835,10 +839,29 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- TileEntity tileentity;
|
- if (this.getBlockID(par1, par2, par3) != 0 && Block.blocksList[this.getBlockID(par1, par2, par3)] instanceof BlockContainer)
|
||||||
- for (Iterator iterator = chunkTileEntityMap.values().iterator(); iterator.hasNext(); tileentity.updateContainingBlockInfo())
|
+ int id = getBlockID(par1, par2, par3);
|
||||||
+ List<TileEntity> invalidList=new ArrayList();
|
+ if (id > 0 && Block.blocksList[id] != null && Block.blocksList[id].hasTileEntity(getBlockMetadata(par1, par2, par3)))
|
||||||
+ iterator = chunkTileEntityMap.values().iterator();
|
|
||||||
+ while(iterator.hasNext())
|
|
||||||
{
|
{
|
||||||
- tileentity = (TileEntity)iterator.next();
|
+ TileEntity old = (TileEntity)chunkTileEntityMap.get(var5);
|
||||||
+ te = (TileEntity)iterator.next();
|
+ if (old != null)
|
||||||
+ if ((te.xCoord & 15) >= i && (te.xCoord & 15) <= l &&
|
|
||||||
+ (te.yCoord >= j) && (te.yCoord <= i1) &&
|
|
||||||
+ (te.zCoord & 15) >= k && (te.zCoord & 15) <=j1)
|
|
||||||
+ {
|
+ {
|
||||||
|
+ old.invalidate();
|
||||||
|
+ }
|
||||||
|
par4TileEntity.validate();
|
||||||
|
this.chunkTileEntityMap.put(var5, par4TileEntity);
|
||||||
|
}
|
||||||
|
@@ -1178,6 +1173,16 @@
|
||||||
|
|
||||||
|
public void func_48494_a(byte[] par1ArrayOfByte, int par2, int par3, boolean par4)
|
||||||
|
{
|
||||||
+
|
+
|
||||||
+ Block bl = te.getBlockType();
|
+ Iterator iterator = chunkTileEntityMap.values().iterator();
|
||||||
+ if (bl != null &&
|
+ while(iterator.hasNext())
|
||||||
+ bl.blockID == worldObj.getBlockId(te.xCoord, te.yCoord, te.zCoord) &&
|
+ {
|
||||||
+ te.getBlockMetadata() == worldObj.getBlockMetadata(te.xCoord, te.yCoord, te.zCoord))
|
+ TileEntity tileEntity = (TileEntity)iterator.next();
|
||||||
+ continue;
|
+ tileEntity.updateContainingBlockInfo();
|
||||||
|
+ tileEntity.getBlockMetadata();
|
||||||
|
+ tileEntity.getBlockType();
|
||||||
|
+ }
|
||||||
+
|
+
|
||||||
+ invalidList.add(te);
|
int var5 = 0;
|
||||||
|
int var6;
|
||||||
|
|
||||||
|
@@ -1281,6 +1286,29 @@
|
||||||
|
TileEntity var9 = (TileEntity)var10.next();
|
||||||
|
var9.updateContainingBlockInfo();
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ List<TileEntity> invalidList = new ArrayList<TileEntity>();
|
||||||
|
+ iterator = chunkTileEntityMap.values().iterator();
|
||||||
|
+ while (iterator.hasNext())
|
||||||
|
+ {
|
||||||
|
+ TileEntity tileEntity = (TileEntity)iterator.next();
|
||||||
|
+ int x = tileEntity.xCoord & 15;
|
||||||
|
+ int y = tileEntity.yCoord;
|
||||||
|
+ int z = tileEntity.zCoord & 15;
|
||||||
|
+ /* This function is called when an entire chunk is sent, so we don't need to check the bounds.
|
||||||
|
+ if (x >= xStart && x <= xStop && y >= yStart && y <= yEnd && z >= zStart && z <= zStop)
|
||||||
|
+ */
|
||||||
|
+ Block block = tileEntity.getBlockType();
|
||||||
|
+ if (block == null || block.blockID != getBlockID(x, y, z) || tileEntity.getBlockMetadata() != getBlockMetadata(x, y, z))
|
||||||
|
+ {
|
||||||
|
+ invalidList.add(tileEntity);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ for(TileEntity te2 : invalidList)
|
+ for (TileEntity tileEntity : invalidList)
|
||||||
+ {
|
+ {
|
||||||
+ te2.invalidate();
|
+ tileEntity.invalidate();
|
||||||
}
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
return k1;
|
public BiomeGenBase func_48490_a(int par1, int par2, WorldChunkManager par3WorldChunkManager)
|
||||||
@@ -917,4 +940,18 @@
|
@@ -1369,4 +1397,18 @@
|
||||||
{
|
}
|
||||||
return new ChunkCoordIntPair(xPosition, zPosition);
|
}
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ /* FORGE: Used to remove only invalid TileEntities */
|
+ /** FORGE: Used to remove only invalid TileEntities */
|
||||||
+ public void cleanChunkBlockTileEntity(int i, int j, int k)
|
+ public void cleanChunkBlockTileEntity(int x, int y, int z)
|
||||||
+ {
|
+ {
|
||||||
+ ChunkPosition chunkposition = new ChunkPosition(i, j, k);
|
+ ChunkPosition position = new ChunkPosition(x, y, z);
|
||||||
+ if (isChunkLoaded)
|
+ if (isChunkLoaded)
|
||||||
+ {
|
+ {
|
||||||
+ TileEntity tileentity = (TileEntity)chunkTileEntityMap.get(chunkposition);
|
+ TileEntity entity = (TileEntity)chunkTileEntityMap.get(position);
|
||||||
+ if (tileentity != null && tileentity.isInvalid())
|
+ if (entity != null && entity.isInvalid())
|
||||||
+ {
|
+ {
|
||||||
+ chunkTileEntityMap.remove(chunkposition);
|
+ chunkTileEntityMap.remove(position);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
|
|
|
@ -1,28 +1,27 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/ContainerCreative.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/ContainerCreative.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/ContainerCreative.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/ContainerCreative.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -65,17 +65,20 @@
|
@@ -57,12 +57,20 @@
|
||||||
itemList.add(new ItemStack(ablock[l1], 1, k2));
|
|
||||||
}
|
|
||||||
|
|
||||||
- for (int i2 = 256; i2 < Item.itemsList.length; i2++)
|
this.itemList.add(new ItemStack(var2[var10], 1, var11));
|
||||||
+ for(int x = 0; x < Block.blocksList.length; x++)
|
}
|
||||||
|
-
|
||||||
|
- for (var10 = 256; var10 < Item.itemsList.length; ++var10)
|
||||||
|
+
|
||||||
|
+ for (Block block : Block.blocksList)
|
||||||
|
+ {
|
||||||
|
+ if (block != null)
|
||||||
|
+ {
|
||||||
|
+ block.addCreativeItems((ArrayList)itemList);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ for (Item item : Item.itemsList)
|
||||||
{
|
{
|
||||||
- if (Item.itemsList[i2] != null && Item.itemsList[i2].shiftedIndex != Item.potion.shiftedIndex && Item.itemsList[i2].shiftedIndex != Item.monsterPlacer.shiftedIndex)
|
- if (Item.itemsList[var10] != null && Item.itemsList[var10].shiftedIndex != Item.potion.shiftedIndex && Item.itemsList[var10].shiftedIndex != Item.monsterPlacer.shiftedIndex)
|
||||||
+ if (Block.blocksList[x] != null)
|
+ if (item != null)
|
||||||
{
|
{
|
||||||
- itemList.add(new ItemStack(Item.itemsList[i2]));
|
- this.itemList.add(new ItemStack(Item.itemsList[var10]));
|
||||||
+ Block.blocksList[x].addCreativeItems((ArrayList)itemList);
|
+ item.addCreativeItems((ArrayList)itemList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- for (int j2 = 1; j2 < 16; j2++)
|
|
||||||
+ for (int i2 = Block.blocksList.length; i2 < Item.itemsList.length; i2++)
|
|
||||||
{
|
|
||||||
- itemList.add(new ItemStack(Item.dyePowder.shiftedIndex, 1, j2));
|
|
||||||
+ if (Item.itemsList[i2] != null)
|
|
||||||
+ {
|
|
||||||
+ Item.itemsList[i2].addCreativeItems((ArrayList)itemList);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
Integer integer;
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/CraftingManager.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/CraftingManager.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/CraftingManager.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/CraftingManager.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -423,7 +423,7 @@
|
@@ -239,7 +239,7 @@
|
||||||
i++;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- if (i == 2 && itemstack.itemID == itemstack1.itemID && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && Item.itemsList[itemstack.itemID].isDamageable())
|
- if (var2 == 2 && var3.itemID == var4.itemID && var3.stackSize == 1 && var4.stackSize == 1 && Item.itemsList[var3.itemID].isDamageable())
|
||||||
+ if (i == 2 && itemstack.itemID == itemstack1.itemID && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && Item.itemsList[itemstack.itemID].isRepairable())
|
+ if (var2 == 2 && var3.itemID == var4.itemID && var3.stackSize == 1 && var4.stackSize == 1 && Item.itemsList[var3.itemID].isRepairable())
|
||||||
{
|
{
|
||||||
Item item = Item.itemsList[itemstack.itemID];
|
Item var11 = Item.itemsList[var3.itemID];
|
||||||
int l = item.getMaxDamage() - itemstack.getItemDamageForDisplay();
|
int var10 = var11.getMaxDamage() - var3.getItemDamageForDisplay();
|
||||||
|
|
|
@ -1,30 +1,24 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/EffectRenderer.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/EffectRenderer.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/EffectRenderer.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/EffectRenderer.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -1,17 +1,23 @@
|
@@ -5,6 +5,8 @@
|
||||||
package net.minecraft.src;
|
import java.util.Random;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
+
|
|
||||||
+import net.minecraft.src.forge.BlockTextureParticles;
|
|
||||||
+import net.minecraft.src.forge.ITextureProvider;
|
|
||||||
+
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
+import net.minecraft.src.forge.*;
|
||||||
|
+
|
||||||
public class EffectRenderer
|
public class EffectRenderer
|
||||||
{
|
{
|
||||||
protected World worldObj;
|
/** Reference to the World object. */
|
||||||
private List fxLayers[];
|
@@ -15,6 +17,8 @@
|
||||||
+ private List effectList;
|
/** RNG. */
|
||||||
private RenderEngine renderer;
|
private Random rand = new Random();
|
||||||
private Random rand;
|
|
||||||
|
|
||||||
public EffectRenderer(World world, RenderEngine renderengine)
|
+ private List effectList = new ArrayList();
|
||||||
|
+
|
||||||
|
public EffectRenderer(World par1World, RenderEngine par2RenderEngine)
|
||||||
{
|
{
|
||||||
+ effectList = new ArrayList();
|
if (par1World != null)
|
||||||
fxLayers = new List[4];
|
@@ -57,6 +61,23 @@
|
||||||
rand = new Random();
|
|
||||||
if (world != null)
|
|
||||||
@@ -49,6 +55,23 @@
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +28,7 @@
|
||||||
+ BlockTextureParticles entry = (BlockTextureParticles)effectList.get(x);
|
+ BlockTextureParticles entry = (BlockTextureParticles)effectList.get(x);
|
||||||
+ for (int y = 0; y < entry.effects.size(); y++)
|
+ for (int y = 0; y < entry.effects.size(); y++)
|
||||||
+ {
|
+ {
|
||||||
+ EntityFX entityfx = (EntityFX) entry.effects.get(y);
|
+ EntityFX entityfx = (EntityFX)entry.effects.get(y);
|
||||||
+ if (entityfx.isDead)
|
+ if (entityfx.isDead)
|
||||||
+ {
|
+ {
|
||||||
+ entry.effects.remove(y--);
|
+ entry.effects.remove(y--);
|
||||||
|
@ -47,42 +41,40 @@
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderParticles(Entity entity, float f)
|
/**
|
||||||
@@ -87,12 +110,31 @@
|
@@ -102,12 +123,29 @@
|
||||||
for (int k = 0; k < fxLayers[i].size(); k++)
|
for (int var11 = 0; var11 < this.fxLayers[var8].size(); ++var11)
|
||||||
{
|
{
|
||||||
EntityFX entityfx = (EntityFX)fxLayers[i].get(k);
|
EntityFX var12 = (EntityFX)this.fxLayers[var8].get(var11);
|
||||||
+ if (entityfx instanceof EntityDiggingFX)
|
+ if (var12 instanceof EntityDiggingFX)
|
||||||
+ {
|
+ {
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
tessellator.setBrightness(entityfx.getEntityBrightnessForRender(f));
|
var10.setBrightness(var12.getEntityBrightnessForRender(par2));
|
||||||
entityfx.renderParticle(tessellator, f, f1, f5, f2, f3, f4);
|
var12.renderParticle(var10, par2, var3, var7, var4, var5, var6);
|
||||||
}
|
}
|
||||||
|
|
||||||
tessellator.draw();
|
var10.draw();
|
||||||
}
|
}
|
||||||
+
|
+ Tessellator tessallator = Tessellator.instance;
|
||||||
+ Tessellator tessellator = Tessellator.instance;
|
+ for (int x = 0; x < effectList.size(); x++)
|
||||||
+ for (int x = 0; x < effectList.size(); x++)
|
|
||||||
+ {
|
|
||||||
+ BlockTextureParticles entry = (BlockTextureParticles) effectList.get(x);
|
|
||||||
+ GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, renderer.getTexture(entry.texture));
|
|
||||||
+ tessellator.startDrawingQuads();
|
|
||||||
+ for (int y = 0; y < entry.effects.size(); y++)
|
|
||||||
+ {
|
+ {
|
||||||
+ EntityFX entityfx = (EntityFX) entry.effects.get(y);
|
+ BlockTextureParticles entry = (BlockTextureParticles)effectList.get(x);
|
||||||
+ tessellator.setBrightness(entityfx.getEntityBrightnessForRender(f));
|
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, renderer.getTexture(entry.texture));
|
||||||
+ entityfx.renderParticle(tessellator, f, f1, f5, f2, f3, f4);
|
+ tessallator.startDrawingQuads();
|
||||||
|
+ for (int y = 0; y < entry.effects.size(); y++)
|
||||||
|
+ {
|
||||||
|
+ EntityFX entryfx = (EntityFX)entry.effects.get(y);
|
||||||
|
+ tessallator.setBrightness(entryfx.getEntityBrightnessForRender(par2));
|
||||||
|
+ entryfx.renderParticle(tessallator, par2, var3, var7, var4, var5, var6);
|
||||||
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ tessellator.draw();
|
}
|
||||||
+ }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void func_1187_b(Entity entity, float f)
|
@@ -131,6 +169,12 @@
|
||||||
@@ -123,6 +165,12 @@
|
var11.renderParticle(var9, par2, var3, var7, var4, var5, var6);
|
||||||
{
|
}
|
||||||
fxLayers[i].clear();
|
|
||||||
}
|
}
|
||||||
+ for (int x = 0; x < effectList.size(); x++)
|
+ for (int x = 0; x < effectList.size(); x++)
|
||||||
+ {
|
+ {
|
||||||
|
@ -92,62 +84,67 @@
|
||||||
+ effectList.clear();
|
+ effectList.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addBlockDestroyEffects(int i, int j, int k, int l, int i1)
|
public void clearEffects(World par1World)
|
||||||
@@ -143,7 +191,11 @@
|
@@ -141,6 +185,13 @@
|
||||||
double d1 = (double)j + ((double)l1 + 0.5D) / (double)j1;
|
|
||||||
double d2 = (double)k + ((double)i2 + 0.5D) / (double)j1;
|
|
||||||
int j2 = rand.nextInt(6);
|
|
||||||
- addEffect((new EntityDiggingFX(worldObj, d, d1, d2, d - (double)i - 0.5D, d1 - (double)j - 0.5D, d2 - (double)k - 0.5D, block, j2, i1)).func_4041_a(i, j, k));
|
|
||||||
+ EntityDiggingFX dig_effect = new EntityDiggingFX(worldObj, d, d1, d2,
|
|
||||||
+ d - (double)i - 0.5D, d1 - (double)j - 0.5D,
|
|
||||||
+ d2 - (double)k - 0.5D, block, j2, i1);
|
|
||||||
+ dig_effect.func_4041_a(i, j, k);
|
|
||||||
+ addDigParticleEffect(dig_effect, block);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -185,11 +237,43 @@
|
|
||||||
{
|
{
|
||||||
d = (double)i + block.maxX + (double)f;
|
this.fxLayers[var2].clear();
|
||||||
}
|
}
|
||||||
- addEffect((new EntityDiggingFX(worldObj, d, d1, d2, 0.0D, 0.0D, 0.0D, block, l, worldObj.getBlockMetadata(i, j, k))).func_4041_a(i, j, k).multiplyVelocity(0.2F).func_405_d(0.6F));
|
|
||||||
+ EntityDiggingFX dig_effect = new EntityDiggingFX(worldObj, d, d1, d2, 0.0D, 0.0D, 0.0D, block, l, worldObj.getBlockMetadata(i, j, k));
|
|
||||||
+ dig_effect.func_4041_a(i, j, k);
|
|
||||||
+ dig_effect.multiplyVelocity(0.4F);
|
|
||||||
+ dig_effect.func_405_d(0.6F);
|
|
||||||
+ addDigParticleEffect(dig_effect, block);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatistics()
|
|
||||||
{
|
|
||||||
return (new StringBuilder()).append("").append(fxLayers[0].size() + fxLayers[1].size() + fxLayers[2].size()).toString();
|
|
||||||
}
|
|
||||||
+
|
+
|
||||||
+ public void addDigParticleEffect(EntityDiggingFX dig_effect, Block block)
|
|
||||||
+ {
|
|
||||||
+ boolean added = false;
|
|
||||||
+ String comp = "/terrain.png";
|
|
||||||
+
|
|
||||||
+ if (block instanceof ITextureProvider)
|
|
||||||
+ {
|
|
||||||
+ comp = ((ITextureProvider)block).getTextureFile();
|
|
||||||
+ }
|
|
||||||
+ for (int x = 0; x < effectList.size(); x++)
|
+ for (int x = 0; x < effectList.size(); x++)
|
||||||
+ {
|
+ {
|
||||||
+ BlockTextureParticles entry = (BlockTextureParticles)effectList.get(x);
|
+ BlockTextureParticles entry = (BlockTextureParticles)effectList.get(x);
|
||||||
+ if (entry.texture.equals(comp))
|
+ entry.effects.clear();
|
||||||
|
+ }
|
||||||
|
+ effectList.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addBlockDestroyEffects(int par1, int par2, int par3, int par4, int par5)
|
||||||
|
@@ -160,7 +211,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_4041_a(par1, par2, par3));
|
||||||
|
+ addDigParticleEffect((EntityDiggingFX)(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_4041_a(par1, par2, par3), var6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -212,7 +263,7 @@
|
||||||
|
var8 = (double)par1 + var6.maxX + (double)var7;
|
||||||
|
}
|
||||||
|
|
||||||
|
- this.addEffect((new EntityDiggingFX(this.worldObj, var8, var10, var12, 0.0D, 0.0D, 0.0D, var6, par4, this.worldObj.getBlockMetadata(par1, par2, par3))).func_4041_a(par1, par2, par3).multiplyVelocity(0.2F).func_405_d(0.6F));
|
||||||
|
+ addDigParticleEffect((EntityDiggingFX)(new EntityDiggingFX(this.worldObj, var8, var10, var12, 0.0D, 0.0D, 0.0D, var6, par4, this.worldObj.getBlockMetadata(par1, par2, par3))).func_4041_a(par1, par2, par3).multiplyVelocity(0.2F).func_405_d(0.6F), var6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -220,4 +271,30 @@
|
||||||
|
{
|
||||||
|
return "" + (this.fxLayers[0].size() + this.fxLayers[1].size() + this.fxLayers[2].size());
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ public void addDigParticleEffect(EntityDiggingFX effect, Block block)
|
||||||
|
+ {
|
||||||
|
+ boolean added = false;
|
||||||
|
+ String texture = ForgeHooksClient.getTexture("/terrain.png", block);
|
||||||
|
+
|
||||||
|
+ for (int x = 0; x < effectList.size(); x++)
|
||||||
|
+ {
|
||||||
|
+ BlockTextureParticles entry = (BlockTextureParticles)effectList.get(x);
|
||||||
|
+ if (entry.texture.equals(texture))
|
||||||
+ {
|
+ {
|
||||||
+ entry.effects.add(dig_effect);
|
+ entry.effects.add(effect);
|
||||||
+ added = true;
|
+ added = true;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
|
+
|
||||||
+ if (!added)
|
+ if (!added)
|
||||||
+ {
|
+ {
|
||||||
+ BlockTextureParticles entry = new BlockTextureParticles();
|
+ BlockTextureParticles entry = new BlockTextureParticles();
|
||||||
+ entry.texture = comp;
|
+ entry.texture = texture;
|
||||||
+ entry.effects.add(dig_effect);
|
+ entry.effects.add(effect);
|
||||||
+ effectList.add(entry);
|
+ effectList.add(entry);
|
||||||
+ }
|
+ }
|
||||||
+ addEffect(dig_effect);
|
+
|
||||||
|
+ addEffect(effect);
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,17 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/Enchantment.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/Enchantment.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/Enchantment.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/Enchantment.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -102,6 +102,16 @@
|
@@ -192,4 +192,14 @@
|
||||||
return (new StringBuilder()).append(s).append(" ").append(StatCollector.translateToLocal((new StringBuilder()).append("enchantment.level.").append(i).toString())).toString();
|
String var2 = StatCollector.translateToLocal(this.getName());
|
||||||
|
return var2 + " " + StatCollector.translateToLocal("enchantment.level." + par1);
|
||||||
}
|
}
|
||||||
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Called to determine if this enchantment can be applied to a ItemStack
|
+ * Called to determine if this enchantment can be applied to a ItemStack
|
||||||
+ * @param item The ItemStack that the enchantment might be put on
|
+ * @param item The ItemStack that the enchantment might be put on
|
||||||
+ * @return True if the item is valid, false otherwise
|
+ * @return True if the item is valid, false otherwise
|
||||||
+ */
|
+ */
|
||||||
+ public boolean canEnchantItem(ItemStack item)
|
+ public boolean canEnchantItem(ItemStack item)
|
||||||
+ {
|
+ {
|
||||||
+ return type.canEnchantItem(item.getItem());
|
+ return type.canEnchantItem(item.getItem());
|
||||||
+ }
|
+ }
|
||||||
+
|
}
|
||||||
static
|
|
||||||
{
|
|
||||||
looting = new EnchantmentLootBonus(21, 2, EnumEnchantmentType.weapon);
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/EnchantmentHelper.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/EnchantmentHelper.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/EnchantmentHelper.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/EnchantmentHelper.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -261,7 +261,7 @@
|
@@ -354,7 +354,7 @@
|
||||||
for (int k = 0; k < j; k++)
|
|
||||||
{
|
{
|
||||||
Enchantment enchantment = aenchantment[k];
|
Enchantment var7 = var4[var6];
|
||||||
- if (enchantment == null || !enchantment.type.canEnchantItem(item))
|
|
||||||
+ if (enchantment == null || !enchantment.canEnchantItem(itemstack))
|
- if (var7 != null && var7.type.canEnchantItem(var2))
|
||||||
|
+ if (var7 != null && var7.canEnchantItem(par1ItemStack))
|
||||||
{
|
{
|
||||||
continue;
|
for (int var8 = var7.getMinLevel(); var8 <= var7.getMaxLevel(); ++var8)
|
||||||
}
|
{
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/Entity.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/Entity.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/Entity.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/Entity.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -70,6 +70,9 @@
|
@@ -177,6 +177,9 @@
|
||||||
public int serverPosZ;
|
*/
|
||||||
public boolean ignoreFrustrumCheck;
|
public boolean ignoreFrustrumCheck;
|
||||||
public boolean isAirBorne;
|
public boolean isAirBorne;
|
||||||
+
|
+
|
||||||
+ //Forge: Used to store custom data for each entity.
|
+ /** Forge: Used to store custom data for each entity. */
|
||||||
+ private NBTTagCompound customEntityData;
|
+ private NBTTagCompound customEntityData;
|
||||||
|
|
||||||
public Entity(World world)
|
public Entity(World par1World)
|
||||||
{
|
{
|
||||||
@@ -110,6 +113,20 @@
|
@@ -218,6 +221,20 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void entityInit();
|
protected abstract void entityInit();
|
||||||
|
@ -31,25 +31,25 @@
|
||||||
|
|
||||||
public DataWatcher getDataWatcher()
|
public DataWatcher getDataWatcher()
|
||||||
{
|
{
|
||||||
@@ -967,6 +984,10 @@
|
@@ -1290,6 +1307,10 @@
|
||||||
nbttagcompound.setShort("Fire", (short)fire);
|
par1NBTTagCompound.setShort("Fire", (short)this.fire);
|
||||||
nbttagcompound.setShort("Air", (short)getAir());
|
par1NBTTagCompound.setShort("Air", (short)this.getAir());
|
||||||
nbttagcompound.setBoolean("OnGround", onGround);
|
par1NBTTagCompound.setBoolean("OnGround", this.onGround);
|
||||||
+ if (customEntityData != null)
|
+ if (customEntityData != null)
|
||||||
+ {
|
+ {
|
||||||
+ nbttagcompound.setCompoundTag("ForgeData", customEntityData);
|
+ par1NBTTagCompound.setCompoundTag("ForgeData", customEntityData);
|
||||||
+ }
|
|
||||||
writeEntityToNBT(nbttagcompound);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1001,6 +1022,10 @@
|
|
||||||
onGround = nbttagcompound.getBoolean("OnGround");
|
|
||||||
setPosition(posX, posY, posZ);
|
|
||||||
setRotation(rotationYaw, rotationPitch);
|
|
||||||
+ if (nbttagcompound.hasKey("ForgeData"))
|
|
||||||
+ {
|
|
||||||
+ customEntityData = nbttagcompound.getCompoundTag("ForgeData");
|
|
||||||
+ }
|
+ }
|
||||||
readEntityFromNBT(nbttagcompound);
|
this.writeEntityToNBT(par1NBTTagCompound);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1331,6 +1352,10 @@
|
||||||
|
this.onGround = par1NBTTagCompound.getBoolean("OnGround");
|
||||||
|
this.setPosition(this.posX, this.posY, this.posZ);
|
||||||
|
this.setRotation(this.rotationYaw, this.rotationPitch);
|
||||||
|
+ if (par1NBTTagCompound.hasKey("ForgeData"))
|
||||||
|
+ {
|
||||||
|
+ customEntityData = par1NBTTagCompound.getCompoundTag("ForgeData");
|
||||||
|
+ }
|
||||||
|
this.readEntityFromNBT(par1NBTTagCompound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,30 +1,33 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/EntityItem.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/EntityItem.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/EntityItem.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/EntityItem.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -2,6 +2,8 @@
|
@@ -1,5 +1,7 @@
|
||||||
|
package net.minecraft.src;
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
+import net.minecraft.src.forge.ForgeHooks;
|
+import net.minecraft.src.forge.ForgeHooks;
|
||||||
+
|
+
|
||||||
public class EntityItem extends Entity
|
public class EntityItem extends Entity
|
||||||
{
|
{
|
||||||
public ItemStack item;
|
/** The item stack of this EntityItem. */
|
||||||
@@ -139,6 +141,18 @@
|
@@ -170,7 +172,21 @@
|
||||||
return;
|
if (!this.worldObj.isRemote)
|
||||||
}
|
|
||||||
int i = item.stackSize;
|
|
||||||
+ if (delayBeforeCanPickup == 0 && !ForgeHooks.onItemPickup(entityplayer, this))
|
|
||||||
+ {
|
|
||||||
+ ModLoader.OnItemPickup(entityplayer, item);
|
|
||||||
+ worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
|
||||||
+ entityplayer.onItemPickup(this, i);
|
|
||||||
+ if (item.stackSize <= 0)
|
|
||||||
+ {
|
|
||||||
+ setEntityDead();
|
|
||||||
+ }
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ i = item.stackSize;
|
|
||||||
if (delayBeforeCanPickup == 0 && entityplayer.inventory.addItemStackToInventory(item))
|
|
||||||
{
|
{
|
||||||
if (item.itemID == Block.wood.blockID)
|
int var2 = this.item.stackSize;
|
||||||
|
-
|
||||||
|
+
|
||||||
|
+ if (delayBeforeCanPickup == 0 && !ForgeHooks.onItemPickup(par1EntityPlayer, this))
|
||||||
|
+ {
|
||||||
|
+ ModLoader.onItemPickup(par1EntityPlayer, item);
|
||||||
|
+ this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
|
||||||
|
+ par1EntityPlayer.onItemPickup(this, var2);
|
||||||
|
+ if (item.stackSize <= 0)
|
||||||
|
+ {
|
||||||
|
+ setEntityDead();
|
||||||
|
+ }
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ var2 = item.stackSize;
|
||||||
|
+
|
||||||
|
if (this.delayBeforeCanPickup == 0 && par1EntityPlayer.inventory.addItemStackToInventory(this.item))
|
||||||
|
{
|
||||||
|
if (this.item.itemID == Block.wood.blockID)
|
||||||
|
|
|
@ -1,26 +1,20 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/EntityLiving.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/EntityLiving.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/EntityLiving.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/EntityLiving.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -29,7 +29,7 @@
|
@@ -49,7 +49,7 @@
|
||||||
public float swingProgress;
|
* in each step in the damage calculations, this is set to the 'carryover' that would result if someone was damaged
|
||||||
protected int health;
|
* .25 hearts (for example), and added to the damage in the next step
|
||||||
public int prevHealth;
|
*/
|
||||||
- protected int carryoverDamage;
|
- protected int carryoverDamage;
|
||||||
+ public int carryoverDamage;
|
+ public int carryoverDamage;
|
||||||
|
|
||||||
|
/** Number of ticks since this EntityLiving last produced its sound */
|
||||||
private int livingSoundTime;
|
private int livingSoundTime;
|
||||||
public int hurtTime;
|
@@ -1286,7 +1286,7 @@
|
||||||
public int maxHurtTime;
|
int var2 = MathHelper.floor_double(this.boundingBox.minY);
|
||||||
@@ -835,7 +835,13 @@
|
int var3 = MathHelper.floor_double(this.posZ);
|
||||||
int i = MathHelper.floor_double(posX);
|
int var4 = this.worldObj.getBlockId(var1, var2, var3);
|
||||||
int j = MathHelper.floor_double(boundingBox.minY);
|
- return var4 == Block.ladder.blockID || var4 == Block.vine.blockID;
|
||||||
int k = MathHelper.floor_double(posZ);
|
+ return Block.blocksList[var4] != null && Block.blocksList[var4].isLadder(worldObj, var1, var2, var3);
|
||||||
- return worldObj.getBlockId(i, j, k) == Block.ladder.blockID;
|
|
||||||
+
|
|
||||||
+ Block block = Block.blocksList[worldObj.getBlockId(i, j, k)];
|
|
||||||
+ if (block == null)
|
|
||||||
+ {
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+ return block.isLadder(worldObj, i, j, k);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
|
/**
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -10,44 +10,50 @@
|
||||||
+
|
+
|
||||||
+public class EntityMooshroom extends EntityCow implements IShearable
|
+public class EntityMooshroom extends EntityCow implements IShearable
|
||||||
{
|
{
|
||||||
public EntityMooshroom(World world)
|
public EntityMooshroom(World par1World)
|
||||||
{
|
{
|
||||||
@@ -17,30 +21,36 @@
|
@@ -21,31 +25,7 @@
|
||||||
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, new ItemStack(Item.bowlSoup));
|
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, new ItemStack(Item.bowlSoup));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
- if (itemstack != null && itemstack.itemID == Item.shears.shiftedIndex && getDelay() >= 0)
|
- else if (var2 != null && var2.itemID == Item.shears.shiftedIndex && this.func_48123_at() >= 0)
|
||||||
- {
|
- {
|
||||||
- setEntityDead();
|
- this.setEntityDead();
|
||||||
- EntityCow entitycow = new EntityCow(worldObj);
|
- this.worldObj.spawnParticle("largeexplode", this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D);
|
||||||
- entitycow.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch);
|
-
|
||||||
- entitycow.setEntityHealth(getEntityHealth());
|
- if (!this.worldObj.isRemote)
|
||||||
- entitycow.renderYawOffset = renderYawOffset;
|
|
||||||
- worldObj.spawnEntityInWorld(entitycow);
|
|
||||||
- worldObj.spawnParticle("largeexplode", posX, posY + (double)(height / 2.0F), posZ, 0.0D, 0.0D, 0.0D);
|
|
||||||
- for (int i = 0; i < 5; i++)
|
|
||||||
- {
|
- {
|
||||||
- worldObj.spawnEntityInWorld(new EntityItem(worldObj, posX, posY + (double)height, posZ, new ItemStack(Block.mushroomRed)));
|
- EntityCow var3 = new EntityCow(this.worldObj);
|
||||||
|
- var3.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
|
||||||
|
- var3.setEntityHealth(this.getEntityHealth());
|
||||||
|
- var3.renderYawOffset = this.renderYawOffset;
|
||||||
|
- this.worldObj.spawnEntityInWorld(var3);
|
||||||
|
-
|
||||||
|
- for (int var4 = 0; var4 < 5; ++var4)
|
||||||
|
- {
|
||||||
|
- this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY + (double)this.height, this.posZ, new ItemStack(Block.mushroomRed)));
|
||||||
|
- }
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
- return true;
|
- return true;
|
||||||
- }
|
- }
|
||||||
- else
|
- else
|
||||||
- {
|
- {
|
||||||
- return super.interact(entityplayer);
|
- return super.interact(par1EntityPlayer);
|
||||||
- }
|
- }
|
||||||
+ return super.interact(entityplayer);
|
+ return super.interact(par1EntityPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EntityAnimal spawnBabyAnimal(EntityAnimal entityanimal)
|
/**
|
||||||
|
@@ -55,4 +35,29 @@
|
||||||
{
|
{
|
||||||
return new EntityMooshroom(worldObj);
|
return new EntityMooshroom(this.worldObj);
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean isShearable(ItemStack item, World world, int X, int Y, int Z)
|
+ public boolean isShearable(ItemStack item, World world, int X, int Y, int Z)
|
||||||
+ {
|
+ {
|
||||||
+ return getDelay() >= 0;
|
+ return func_48123_at() >= 0;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
|
|
|
@ -1,158 +1,112 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/EntityPlayer.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/EntityPlayer.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/EntityPlayer.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/EntityPlayer.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -2,6 +2,12 @@
|
@@ -3,6 +3,8 @@
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import java.util.*;
|
+import net.minecraft.src.forge.*;
|
||||||
|
|
||||||
+import net.minecraft.src.forge.ArmorProperties;
|
|
||||||
+import net.minecraft.src.forge.ForgeHooks;
|
|
||||||
+import net.minecraft.src.forge.IGuiHandler;
|
|
||||||
+import net.minecraft.src.forge.ISpecialArmor;
|
|
||||||
+import net.minecraft.src.forge.MinecraftForge;
|
|
||||||
+
|
+
|
||||||
public abstract class EntityPlayer extends EntityLiving
|
public abstract class EntityPlayer extends EntityLiving
|
||||||
{
|
{
|
||||||
public InventoryPlayer inventory;
|
/** Inventory of the player */
|
||||||
@@ -149,6 +155,7 @@
|
@@ -206,6 +208,7 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
+ itemInUse.getItem().onUsingItemTick(itemInUse, this, itemInUseCount);
|
+ itemInUse.getItem().onUsingItemTick(itemInUse, this, itemInUseCount);
|
||||||
if (itemInUseCount <= 25 && itemInUseCount % 4 == 0)
|
if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0)
|
||||||
{
|
{
|
||||||
func_35201_a(itemstack, 5);
|
this.func_35201_a(var1, 5);
|
||||||
@@ -490,7 +497,16 @@
|
@@ -605,7 +608,16 @@
|
||||||
|
|
||||||
public void dropCurrentItem()
|
public EntityItem func_48152_as()
|
||||||
{
|
{
|
||||||
- dropPlayerItemWithRandomChoice(inventory.decrStackSize(inventory.currentItem, 1), false);
|
- return this.func_48151_a(this.inventory.decrStackSize(this.inventory.currentItem, 1), false);
|
||||||
+ ItemStack stack = inventory.getCurrentItem();
|
+ ItemStack stack = inventory.getCurrentItem();
|
||||||
+ if (stack == null)
|
+ if (stack == null)
|
||||||
+ {
|
+ {
|
||||||
+ return;
|
+ return null;
|
||||||
+ }
|
+ }
|
||||||
+
|
+ if (stack.getItem().onDroppedByPlayer(stack, this))
|
||||||
+ if (stack.getItem().onDroppedByPlayer(stack, this))
|
+ {
|
||||||
+ {
|
+ return func_48151_a(inventory.decrStackSize(inventory.currentItem, 1), false);
|
||||||
+ dropPlayerItemWithRandomChoice(inventory.decrStackSize(inventory.currentItem, 1), false);
|
+ }
|
||||||
+ }
|
+ return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dropPlayerItem(ItemStack itemstack)
|
public EntityItem func_48153_a(ItemStack par1ItemStack)
|
||||||
@@ -537,6 +553,9 @@
|
@@ -664,14 +676,22 @@
|
||||||
worldObj.spawnEntityInWorld(entityitem);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* FORGE: This isnt called anymore
|
/**
|
||||||
+ */
|
* Returns how strong the player is against the specified block at this moment
|
||||||
|
+ * Deprecated in favor of the metadata-sensitive version
|
||||||
|
*/
|
||||||
+ @Deprecated
|
+ @Deprecated
|
||||||
public float getCurrentPlayerStrVsBlock(Block block)
|
public float getCurrentPlayerStrVsBlock(Block par1Block)
|
||||||
{
|
{
|
||||||
float f = inventory.getStrVsBlock(block);
|
- float var2 = this.inventory.getStrVsBlock(par1Block);
|
||||||
@@ -565,6 +584,45 @@
|
+ return getCurrentPlayerStrVsBlock(par1Block, 0);
|
||||||
return f1;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* FORGE: Extended to allow metadata.
|
|
||||||
+ */
|
|
||||||
+ public float getCurrentPlayerStrVsBlock(Block block, int md)
|
|
||||||
+ {
|
|
||||||
+ float f = 1.0F;
|
|
||||||
+ ItemStack ist = inventory.getCurrentItem();
|
|
||||||
+ if(ist != null)
|
|
||||||
+ {
|
|
||||||
+ f = ist.getItem().getStrVsBlock(ist, block, md);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ int i = EnchantmentHelper.getEfficiencyModifier(inventory);
|
|
||||||
+ if (i > 0 && ForgeHooks.canHarvestBlock(block, this, md))
|
|
||||||
+ {
|
|
||||||
+ f += i * i + 1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if(isPotionActive(Potion.digSpeed))
|
|
||||||
+ {
|
|
||||||
+ f *= 1.0F + (float)(getActivePotionEffect(Potion.digSpeed).getAmplifier() + 1) * 0.2F;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if(isPotionActive(Potion.digSlowdown))
|
|
||||||
+ {
|
|
||||||
+ f *= 1.0F - (float)(getActivePotionEffect(Potion.digSlowdown).getAmplifier() + 1) * 0.2F;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if(isInsideOfMaterial(Material.water) && !EnchantmentHelper.getAquaAffinityModifier(inventory))
|
|
||||||
+ {
|
|
||||||
+ f /= 5F;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if(!onGround)
|
|
||||||
+ {
|
|
||||||
+ f /= 5F;
|
|
||||||
+ }
|
|
||||||
+ return f;
|
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
public boolean canHarvestBlock(Block block)
|
+ public float getCurrentPlayerStrVsBlock(Block par1Block, int meta)
|
||||||
{
|
+ {
|
||||||
return inventory.canHarvestBlock(block);
|
+ ItemStack stack = inventory.getCurrentItem();
|
||||||
@@ -768,7 +826,11 @@
|
+ float var2 = (stack == null ? 1.0F : stack.getItem().getStrVsBlock(stack, par1Block, meta));
|
||||||
|
float var3 = var2;
|
||||||
|
int var4 = EnchantmentHelper.getEfficiencyModifier(this.inventory);
|
||||||
|
|
||||||
|
- if (var4 > 0 && this.inventory.canHarvestBlock(par1Block))
|
||||||
|
+ if (var4 > 0 && ForgeHooks.canHarvestBlock(par1Block, this, meta))
|
||||||
{
|
{
|
||||||
i = 1 + i >> 1;
|
var3 = var2 + (float)(var4 * var4 + 1);
|
||||||
}
|
}
|
||||||
- i = applyArmorCalculations(damagesource, i);
|
@@ -960,7 +980,11 @@
|
||||||
+ i = ArmorProperties.ApplyArmor(this, inventory.armorInventory, damagesource, i);
|
par2 = 1 + par2 >> 1;
|
||||||
+ if (i <= 0)
|
}
|
||||||
|
|
||||||
|
- par2 = this.applyArmorCalculations(par1DamageSource, par2);
|
||||||
|
+ par2 = ArmorProperties.ApplyArmor(this, inventory.armorInventory, par1DamageSource, par2);
|
||||||
|
+ if (par2 <= 0)
|
||||||
+ {
|
+ {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
i = applyPotionDamageCalculations(damagesource, i);
|
par2 = this.applyPotionDamageCalculations(par1DamageSource, par2);
|
||||||
addExhaustion(damagesource.getHungerDamage());
|
this.addExhaustion(par1DamageSource.getHungerDamage());
|
||||||
health -= i;
|
this.health -= par2;
|
||||||
@@ -815,7 +877,9 @@
|
@@ -1021,7 +1045,9 @@
|
||||||
|
*/
|
||||||
public void destroyCurrentEquippedItem()
|
public void destroyCurrentEquippedItem()
|
||||||
{
|
{
|
||||||
+ ItemStack orig = inventory.getCurrentItem();
|
+ ItemStack orig = inventory.getCurrentItem();
|
||||||
inventory.setInventorySlotContents(inventory.currentItem, null);
|
this.inventory.setInventorySlotContents(this.inventory.currentItem, (ItemStack)null);
|
||||||
+ ForgeHooks.onDestroyCurrentItem(this, orig);
|
+ ForgeHooks.onDestroyCurrentItem(this, orig);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getYOffset()
|
/**
|
||||||
@@ -834,6 +898,11 @@
|
@@ -1050,6 +1076,12 @@
|
||||||
|
*/
|
||||||
public void attackTargetEntityWithCurrentItem(Entity entity)
|
public void attackTargetEntityWithCurrentItem(Entity par1Entity)
|
||||||
{
|
{
|
||||||
+ ItemStack stack = getCurrentEquippedItem();
|
+ ItemStack stack = getCurrentEquippedItem();
|
||||||
+ if (stack != null && stack.getItem().onLeftClickEntity(stack, this, entity))
|
+ if (stack != null && stack.getItem().onLeftClickEntity(stack, this, par1Entity))
|
||||||
+ {
|
+ {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
int i = inventory.getDamageVsEntity(entity);
|
+
|
||||||
if (isPotionActive(Potion.damageBoost))
|
if (par1Entity.func_48080_j())
|
||||||
{
|
{
|
||||||
@@ -947,6 +1016,11 @@
|
int var2 = this.inventory.getDamageVsEntity(par1Entity);
|
||||||
|
@@ -1674,6 +1706,7 @@
|
||||||
public EnumStatus sleepInBedAt(int i, int j, int k)
|
|
||||||
{
|
|
||||||
+ EnumStatus customSleep = ForgeHooks.sleepInBedAt(this, i, j, k);
|
|
||||||
+ if (customSleep != null)
|
|
||||||
+ {
|
|
||||||
+ return customSleep;
|
|
||||||
+ }
|
|
||||||
if (!worldObj.isRemote)
|
|
||||||
{
|
|
||||||
if (isPlayerSleeping() || !isEntityAlive())
|
|
||||||
@@ -1341,6 +1415,7 @@
|
|
||||||
return 101;
|
return 101;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+ j = itemstack.getItem().getIconIndex(itemstack, i, this, itemInUse, itemInUseCount);
|
+ var3 = par1ItemStack.getItem().getIconIndex(par1ItemStack, par2, this, itemInUse, itemInUseCount);
|
||||||
}
|
}
|
||||||
return j;
|
|
||||||
}
|
return var3;
|
||||||
@@ -1473,4 +1548,30 @@
|
@@ -1841,4 +1874,30 @@
|
||||||
experience = entityplayer.experience;
|
{
|
||||||
score = entityplayer.score;
|
return !this.capabilities.isFlying;
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
|
|
@ -1,48 +1,50 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/EntityRenderer.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/EntityRenderer.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/EntityRenderer.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/EntityRenderer.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -4,6 +4,8 @@
|
@@ -5,6 +5,8 @@
|
||||||
import java.nio.FloatBuffer;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
+import net.minecraft.src.forge.ForgeHooksClient;
|
+import net.minecraft.src.forge.ForgeHooksClient;
|
||||||
+
|
+
|
||||||
import org.lwjgl.input.Mouse;
|
import org.lwjgl.input.Mouse;
|
||||||
import org.lwjgl.opengl.ContextCapabilities;
|
|
||||||
import org.lwjgl.opengl.Display;
|
import org.lwjgl.opengl.Display;
|
||||||
@@ -911,8 +913,11 @@
|
import org.lwjgl.opengl.GL11;
|
||||||
EntityPlayer entityplayer = (EntityPlayer)entityliving;
|
@@ -1106,8 +1108,11 @@
|
||||||
GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
|
var20 = (EntityPlayer)var4;
|
||||||
|
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||||
Profiler.endStartSection("outline");
|
Profiler.endStartSection("outline");
|
||||||
- renderglobal.drawBlockBreaking(entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f);
|
- var5.drawBlockBreaking(var20, this.mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1);
|
||||||
- renderglobal.drawSelectionBox(entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f);
|
- var5.drawSelectionBox(var20, this.mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1);
|
||||||
+ if (!ForgeHooksClient.onBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f))
|
+ if (!ForgeHooksClient.onBlockHighlight(var5, var20, mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1))
|
||||||
+ {
|
+ {
|
||||||
+ renderglobal.drawBlockBreaking(entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f);
|
+ var5.drawBlockBreaking(var20, this.mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1);
|
||||||
+ renderglobal.drawSelectionBox(entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f);
|
+ var5.drawSelectionBox(var20, this.mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1);
|
||||||
+ }
|
+ }
|
||||||
GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
|
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -967,8 +972,11 @@
|
@@ -1171,8 +1176,12 @@
|
||||||
EntityPlayer entityplayer1 = (EntityPlayer)entityliving;
|
var20 = (EntityPlayer)var4;
|
||||||
GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
|
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||||
Profiler.endStartSection("outline");
|
Profiler.endStartSection("outline");
|
||||||
- renderglobal.drawBlockBreaking(entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f);
|
- var5.drawBlockBreaking(var20, this.mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1);
|
||||||
- renderglobal.drawSelectionBox(entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f);
|
- var5.drawSelectionBox(var20, this.mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1);
|
||||||
+ if (!ForgeHooksClient.onBlockHighlight(renderglobal, entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f))
|
+
|
||||||
|
+ if (!ForgeHooksClient.onBlockHighlight(var5, var20, mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1))
|
||||||
+ {
|
+ {
|
||||||
+ renderglobal.drawBlockBreaking(entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f);
|
+ var5.drawBlockBreaking(var20, this.mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1);
|
||||||
+ renderglobal.drawSelectionBox(entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f);
|
+ var5.drawSelectionBox(var20, this.mc.objectMouseOver, 0, var20.inventory.getCurrentItem(), par1);
|
||||||
+ }
|
+ }
|
||||||
GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
|
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||||
}
|
}
|
||||||
Profiler.endStartSection("weather");
|
|
||||||
@@ -986,6 +994,8 @@
|
@@ -1196,6 +1205,9 @@
|
||||||
setupFog(1, f);
|
this.setupFog(1, par1);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
|
+
|
||||||
+ Profiler.endStartSection("fhooks");
|
+ Profiler.endStartSection("fhooks");
|
||||||
+ ForgeHooksClient.onRenderWorldLast(renderglobal,f);
|
+ ForgeHooksClient.onRenderWorldLast(var5, par1);
|
||||||
|
|
||||||
Profiler.endStartSection("hand");
|
Profiler.endStartSection("hand");
|
||||||
if (cameraZoom == 1.0D)
|
|
||||||
{
|
|
||||||
|
|
|
@ -11,35 +11,39 @@
|
||||||
+
|
+
|
||||||
+public class EntitySheep extends EntityAnimal implements IShearable
|
+public class EntitySheep extends EntityAnimal implements IShearable
|
||||||
{
|
{
|
||||||
public static final float fleeceColorTable[][] =
|
/**
|
||||||
|
* Holds the RGB table of the sheep colors - in OpenGL glColor3f values - used to render the sheep colored fleece.
|
||||||
|
@@ -127,27 +130,6 @@
|
||||||
|
*/
|
||||||
|
public boolean interact(EntityPlayer par1EntityPlayer)
|
||||||
{
|
{
|
||||||
@@ -194,23 +197,6 @@
|
- ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem();
|
||||||
|
-
|
||||||
public boolean interact(EntityPlayer entityplayer)
|
- if (var2 != null && var2.itemID == Item.shears.shiftedIndex && !this.getSheared() && !this.isChild())
|
||||||
{
|
|
||||||
- ItemStack itemstack = entityplayer.inventory.getCurrentItem();
|
|
||||||
- if (itemstack != null && itemstack.itemID == Item.shears.shiftedIndex && !getSheared() && !isChild())
|
|
||||||
- {
|
- {
|
||||||
- if (!worldObj.isRemote)
|
- if (!this.worldObj.isRemote)
|
||||||
- {
|
- {
|
||||||
- setSheared(true);
|
- this.setSheared(true);
|
||||||
- int i = 1 + rand.nextInt(3);
|
- int var3 = 1 + this.rand.nextInt(3);
|
||||||
- for (int j = 0; j < i; j++)
|
-
|
||||||
|
- for (int var4 = 0; var4 < var3; ++var4)
|
||||||
- {
|
- {
|
||||||
- EntityItem entityitem = entityDropItem(new ItemStack(Block.cloth.blockID, 1, getFleeceColor()), 1.0F);
|
- EntityItem var5 = this.entityDropItem(new ItemStack(Block.cloth.blockID, 1, this.getFleeceColor()), 1.0F);
|
||||||
- entityitem.motionY += rand.nextFloat() * 0.05F;
|
- var5.motionY += (double)(this.rand.nextFloat() * 0.05F);
|
||||||
- entityitem.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
|
- var5.motionX += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F);
|
||||||
- entityitem.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
|
- var5.motionZ += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F);
|
||||||
- }
|
- }
|
||||||
- }
|
- }
|
||||||
- itemstack.damageItem(1, entityplayer);
|
-
|
||||||
|
- var2.damageItem(1, par1EntityPlayer);
|
||||||
- }
|
- }
|
||||||
return super.interact(entityplayer);
|
-
|
||||||
|
return super.interact(par1EntityPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,4 +294,23 @@
|
@@ -276,4 +258,23 @@
|
||||||
|
this.func_48122_d(var1);
|
||||||
}
|
}
|
||||||
return entitysheep1;
|
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
|
|
|
@ -1,27 +1,28 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/Explosion.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/Explosion.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/Explosion.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/Explosion.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -1,6 +1,7 @@
|
@@ -6,6 +6,8 @@
|
||||||
package net.minecraft.src;
|
import java.util.Random;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
+import net.minecraft.src.forge.ISpecialResistance;
|
+import net.minecraft.src.forge.ISpecialResistance;
|
||||||
|
+
|
||||||
public class Explosion
|
public class Explosion
|
||||||
{
|
{
|
||||||
@@ -66,7 +67,15 @@
|
public boolean isFlaming = false;
|
||||||
int k3 = worldObj.getBlockId(l2, i3, j3);
|
@@ -71,7 +73,15 @@
|
||||||
if (k3 > 0)
|
|
||||||
{
|
if (var25 > 0)
|
||||||
- f1 -= (Block.blocksList[k3].getExplosionResistance(exploder) + 0.3F) * f2;
|
{
|
||||||
+ if (Block.blocksList[k3] instanceof ISpecialResistance)
|
- var14 -= (Block.blocksList[var25].getExplosionResistance(this.exploder) + 0.3F) * var21;
|
||||||
+ {
|
+ if (Block.blocksList[var25] instanceof ISpecialResistance)
|
||||||
+ ISpecialResistance isr = (ISpecialResistance)Block.blocksList[k3];
|
+ {
|
||||||
+ f1 -= (isr.getSpecialExplosionResistance(worldObj, l2, i3, j3, explosionX, explosionY, explosionZ, exploder) + 0.3F) * f2;
|
+ ISpecialResistance isr = (ISpecialResistance)Block.blocksList[var25];
|
||||||
+ }
|
+ var14 -= (isr.getSpecialExplosionResistance(worldObj, var22, var23, var24, explosionX, explosionY, explosionZ, exploder) + 0.3F) * var21;
|
||||||
+ else
|
+ }
|
||||||
+ {
|
+ else
|
||||||
+ f1 -= (Block.blocksList[k3].getExplosionResistance(exploder) + 0.3F) * f2;
|
+ {
|
||||||
+ }
|
+ var14 -= (Block.blocksList[var25].getExplosionResistance(this.exploder) + 0.3F) * var21;
|
||||||
}
|
+ }
|
||||||
if (f1 > 0.0F)
|
}
|
||||||
{
|
|
||||||
|
if (var14 > 0.0F)
|
||||||
|
|
|
@ -1,31 +1,35 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/FurnaceRecipes.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/FurnaceRecipes.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/FurnaceRecipes.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/FurnaceRecipes.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -2,11 +2,13 @@
|
@@ -1,5 +1,6 @@
|
||||||
|
package net.minecraft.src;
|
||||||
|
|
||||||
|
+import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
+import java.util.Arrays;
|
|
||||||
|
|
||||||
public class FurnaceRecipes
|
@@ -9,6 +10,7 @@
|
||||||
{
|
|
||||||
private static final FurnaceRecipes smeltingBase = new FurnaceRecipes();
|
|
||||||
private Map smeltingList;
|
|
||||||
+ private Map metaSmeltingList;
|
|
||||||
|
|
||||||
public static final FurnaceRecipes smelting()
|
/** The list of smelting results. */
|
||||||
|
private Map smeltingList = new HashMap();
|
||||||
|
+ private Map metaSmeltingList = new HashMap();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to call methods addSmelting and getSmeltingResult.
|
||||||
|
@@ -47,7 +49,9 @@
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the smelting result of an item.
|
||||||
|
+ * Deprecated in favor of a metadata sensitive version
|
||||||
|
*/
|
||||||
|
+ @Deprecated
|
||||||
|
public ItemStack getSmeltingResult(int par1)
|
||||||
{
|
{
|
||||||
@@ -16,6 +18,7 @@
|
return (ItemStack)this.smeltingList.get(Integer.valueOf(par1));
|
||||||
private FurnaceRecipes()
|
@@ -57,4 +61,34 @@
|
||||||
{
|
{
|
||||||
smeltingList = new HashMap();
|
return this.smeltingList;
|
||||||
+ metaSmeltingList = new HashMap();
|
|
||||||
addSmelting(Block.oreIron.blockID, new ItemStack(Item.ingotIron));
|
|
||||||
addSmelting(Block.oreGold.blockID, new ItemStack(Item.ingotGold));
|
|
||||||
addSmelting(Block.oreDiamond.blockID, new ItemStack(Item.diamond));
|
|
||||||
@@ -38,11 +41,43 @@
|
|
||||||
smeltingList.put(Integer.valueOf(i), itemstack);
|
|
||||||
}
|
}
|
||||||
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Add a metadata-sensitive furnace recipe
|
+ * Add a metadata-sensitive furnace recipe
|
||||||
+ * @param itemID The Item ID
|
+ * @param itemID The Item ID
|
||||||
|
@ -37,13 +41,6 @@
|
||||||
+ metaSmeltingList.put(Arrays.asList(itemID, metadata), itemstack);
|
+ metaSmeltingList.put(Arrays.asList(itemID, metadata), itemstack);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /* FORGE: Not used anymore, now uses a metadata sensitive version */
|
|
||||||
+ @Deprecated
|
|
||||||
public ItemStack getSmeltingResult(int i)
|
|
||||||
{
|
|
||||||
return (ItemStack)smeltingList.get(Integer.valueOf(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /**
|
+ /**
|
||||||
+ * Used to get the resulting ItemStack form a source ItemStack
|
+ * Used to get the resulting ItemStack form a source ItemStack
|
||||||
+ * @param item The Source ItemStack
|
+ * @param item The Source ItemStack
|
||||||
|
@ -51,18 +48,15 @@
|
||||||
+ */
|
+ */
|
||||||
+ public ItemStack getSmeltingResult(ItemStack item)
|
+ public ItemStack getSmeltingResult(ItemStack item)
|
||||||
+ {
|
+ {
|
||||||
+ if (item == null)
|
+ if (item == null)
|
||||||
+ {
|
+ {
|
||||||
+ return null;
|
+ return null;
|
||||||
+ }
|
+ }
|
||||||
+ ItemStack ret = (ItemStack)metaSmeltingList.get(Arrays.asList(item.itemID, item.getItemDamage()));
|
+ ItemStack ret = (ItemStack)metaSmeltingList.get(Arrays.asList(item.itemID, item.getItemDamage()));
|
||||||
+ if (ret != null)
|
+ if (ret != null)
|
||||||
+ {
|
+ {
|
||||||
+ return ret;
|
+ return ret;
|
||||||
+ }
|
+ }
|
||||||
+ return (ItemStack)smeltingList.get(Integer.valueOf(item.itemID));
|
+ return (ItemStack)smeltingList.get(Integer.valueOf(item.itemID));
|
||||||
+ }
|
+ }
|
||||||
+
|
}
|
||||||
public Map getSmeltingList()
|
|
||||||
{
|
|
||||||
return smeltingList;
|
|
||||||
|
|
|
@ -1,122 +1,135 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/GuiControls.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/GuiControls.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/GuiControls.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/GuiControls.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -2,6 +2,7 @@
|
@@ -1,5 +1,7 @@
|
||||||
|
package net.minecraft.src;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
+import net.minecraft.src.forge.GuiControlsScrollPanel;
|
+import net.minecraft.src.forge.GuiControlsScrollPanel;
|
||||||
|
+
|
||||||
public class GuiControls extends GuiScreen
|
public class GuiControls extends GuiScreen
|
||||||
{
|
{
|
||||||
@@ -9,6 +10,7 @@
|
/**
|
||||||
protected String screenTitle;
|
@@ -15,6 +17,8 @@
|
||||||
private GameSettings options;
|
|
||||||
private int buttonId;
|
/** The ID of the button that has been pressed. */
|
||||||
|
private int buttonId = -1;
|
||||||
|
+
|
||||||
+ private GuiControlsScrollPanel scrollPane;
|
+ private GuiControlsScrollPanel scrollPane;
|
||||||
|
|
||||||
public GuiControls(GuiScreen guiscreen, GameSettings gamesettings)
|
public GuiControls(GuiScreen par1GuiScreen, GameSettings par2GameSettings)
|
||||||
{
|
{
|
||||||
@@ -25,60 +27,30 @@
|
@@ -32,15 +36,12 @@
|
||||||
|
*/
|
||||||
public void initGui()
|
public void initGui()
|
||||||
{
|
{
|
||||||
+ scrollPane = new GuiControlsScrollPanel(this, options, mc);
|
+ scrollPane = new GuiControlsScrollPanel(this, options, mc);
|
||||||
StringTranslate stringtranslate = StringTranslate.getInstance();
|
StringTranslate var1 = StringTranslate.getInstance();
|
||||||
int i = func_20080_j();
|
int var2 = this.func_20080_j();
|
||||||
- for (int j = 0; j < options.keyBindings.length; j++)
|
|
||||||
|
- for (int var3 = 0; var3 < this.options.keyBindings.length; ++var3)
|
||||||
- {
|
- {
|
||||||
- controlList.add(new GuiSmallButton(j, i + (j % 2) * 160, height / 6 + 24 * (j >> 1), 70, 20, options.getOptionDisplayString(j)));
|
- this.controlList.add(new GuiSmallButton(var3, var2 + var3 % 2 * 160, this.height / 6 + 24 * (var3 >> 1), 70, 20, this.options.getOptionDisplayString(var3)));
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
- controlList.add(new GuiButton(200, width / 2 - 100, height / 6 + 168, stringtranslate.translateKey("gui.done")));
|
- this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, var1.translateKey("gui.done")));
|
||||||
+ controlList.add(new GuiButton(200, width / 2 - 100, height - 28, stringtranslate.translateKey("gui.done")));
|
+ this.controlList.add(new GuiButton(200, this.width / 2 - 100, this.height - 28, var1.translateKey("gui.done")));
|
||||||
+ scrollPane.registerScrollButtons(controlList, 7, 8);
|
+ scrollPane.registerScrollButtons(controlList, 7, 8);
|
||||||
screenTitle = stringtranslate.translateKey("controls.title");
|
this.screenTitle = var1.translateKey("controls.title");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void actionPerformed(GuiButton guibutton)
|
@@ -49,20 +50,10 @@
|
||||||
|
*/
|
||||||
|
protected void actionPerformed(GuiButton par1GuiButton)
|
||||||
{
|
{
|
||||||
- for (int i = 0; i < options.keyBindings.length; i++)
|
- for (int var2 = 0; var2 < this.options.keyBindings.length; ++var2)
|
||||||
- {
|
- {
|
||||||
- ((GuiButton)controlList.get(i)).displayString = options.getOptionDisplayString(i);
|
- ((GuiButton)this.controlList.get(var2)).displayString = this.options.getOptionDisplayString(var2);
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
if (guibutton.id == 200)
|
if (par1GuiButton.id == 200)
|
||||||
{
|
{
|
||||||
mc.displayGuiScreen(parentScreen);
|
this.mc.displayGuiScreen(this.parentScreen);
|
||||||
}
|
}
|
||||||
- else
|
- else
|
||||||
- {
|
- {
|
||||||
- buttonId = guibutton.id;
|
- this.buttonId = par1GuiButton.id;
|
||||||
- guibutton.displayString = (new StringBuilder()).append("> ").append(options.getOptionDisplayString(guibutton.id)).append(" <").toString();
|
- par1GuiButton.displayString = "> " + this.options.getOptionDisplayString(par1GuiButton.id) + " <";
|
||||||
- }
|
- }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void mouseClicked(int i, int j, int k)
|
/**
|
||||||
|
@@ -70,17 +61,7 @@
|
||||||
|
*/
|
||||||
|
protected void mouseClicked(int par1, int par2, int par3)
|
||||||
{
|
{
|
||||||
- if (buttonId >= 0)
|
- if (this.buttonId >= 0)
|
||||||
- {
|
- {
|
||||||
- options.setKeyBinding(buttonId, -100 + k);
|
- this.options.setKeyBinding(this.buttonId, -100 + par3);
|
||||||
- ((GuiButton)controlList.get(buttonId)).displayString = options.getOptionDisplayString(buttonId);
|
- ((GuiButton)this.controlList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId);
|
||||||
- buttonId = -1;
|
- this.buttonId = -1;
|
||||||
- KeyBinding.resetKeyBindingArrayAndHash();
|
- KeyBinding.resetKeyBindingArrayAndHash();
|
||||||
- }
|
- }
|
||||||
- else
|
- else
|
||||||
- {
|
- {
|
||||||
- super.mouseClicked(i, j, k);
|
- super.mouseClicked(par1, par2, par3);
|
||||||
- }
|
- }
|
||||||
+ super.mouseClicked(i, j, k);
|
+ super.mouseClicked(par1, par2, par3);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void keyTyped(char c, int i)
|
/**
|
||||||
|
@@ -88,14 +69,7 @@
|
||||||
|
*/
|
||||||
|
protected void keyTyped(char par1, int par2)
|
||||||
{
|
{
|
||||||
- if (buttonId >= 0)
|
- if (this.buttonId >= 0)
|
||||||
- {
|
- {
|
||||||
- options.setKeyBinding(buttonId, i);
|
- this.options.setKeyBinding(this.buttonId, par2);
|
||||||
- ((GuiButton)controlList.get(buttonId)).displayString = options.getOptionDisplayString(buttonId);
|
- ((GuiButton)this.controlList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId);
|
||||||
- buttonId = -1;
|
- this.buttonId = -1;
|
||||||
- KeyBinding.resetKeyBindingArrayAndHash();
|
- KeyBinding.resetKeyBindingArrayAndHash();
|
||||||
- }
|
- }
|
||||||
- else
|
- else
|
||||||
+ if (scrollPane.keyTyped(c, i))
|
+ if (scrollPane.keyTyped(par1, par2))
|
||||||
{
|
{
|
||||||
super.keyTyped(c, i);
|
super.keyTyped(par1, par2);
|
||||||
}
|
}
|
||||||
@@ -87,35 +59,8 @@
|
@@ -107,37 +81,9 @@
|
||||||
public void drawScreen(int i, int j, float f)
|
public void drawScreen(int par1, int par2, float par3)
|
||||||
{
|
{
|
||||||
drawDefaultBackground();
|
this.drawDefaultBackground();
|
||||||
- drawCenteredString(fontRenderer, screenTitle, width / 2, 20, 0xffffff);
|
- this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215);
|
||||||
- int k = func_20080_j();
|
- int var4 = this.func_20080_j();
|
||||||
- for (int l = 0; l < options.keyBindings.length; l++)
|
-
|
||||||
|
- for (int var5 = 0; var5 < this.options.keyBindings.length; ++var5)
|
||||||
- {
|
- {
|
||||||
- boolean flag = false;
|
- boolean var6 = false;
|
||||||
- for (int i1 = 0; i1 < options.keyBindings.length; i1++)
|
-
|
||||||
|
- for (int var7 = 0; var7 < this.options.keyBindings.length; ++var7)
|
||||||
- {
|
- {
|
||||||
- if (i1 != l && options.keyBindings[l].keyCode == options.keyBindings[i1].keyCode)
|
- if (var7 != var5 && this.options.keyBindings[var5].keyCode == this.options.keyBindings[var7].keyCode)
|
||||||
- {
|
- {
|
||||||
- flag = true;
|
- var6 = true;
|
||||||
- }
|
- }
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
- int j1 = l;
|
- if (this.buttonId == var5)
|
||||||
- if (buttonId == l)
|
|
||||||
- {
|
- {
|
||||||
- ((GuiButton)controlList.get(j1)).displayString = "\247f> \247e??? \247f<";
|
- ((GuiButton)this.controlList.get(var5)).displayString = "\u00a7f> \u00a7e??? \u00a7f<";
|
||||||
- }
|
- }
|
||||||
- else if (flag)
|
- else if (var6)
|
||||||
- {
|
- {
|
||||||
- ((GuiButton)controlList.get(j1)).displayString = (new StringBuilder()).append("\247c").append(options.getOptionDisplayString(j1)).toString();
|
- ((GuiButton)this.controlList.get(var5)).displayString = "\u00a7c" + this.options.getOptionDisplayString(var5);
|
||||||
- }
|
- }
|
||||||
- else
|
- else
|
||||||
- {
|
- {
|
||||||
- ((GuiButton)controlList.get(j1)).displayString = options.getOptionDisplayString(j1);
|
- ((GuiButton)this.controlList.get(var5)).displayString = this.options.getOptionDisplayString(var5);
|
||||||
- }
|
- }
|
||||||
- drawString(fontRenderer, options.getKeyBindingDescription(l), k + (l % 2) * 160 + 70 + 6, height / 6 + 24 * (l >> 1) + 7, -1);
|
-
|
||||||
|
- this.drawString(this.fontRenderer, this.options.getKeyBindingDescription(var5), var4 + var5 % 2 * 160 + 70 + 6, this.height / 6 + 24 * (var5 >> 1) + 7, -1);
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
+ scrollPane.drawScreen(i, j, f);
|
+
|
||||||
|
+ scrollPane.drawScreen(par1, par2, par3);
|
||||||
+ drawCenteredString(fontRenderer, screenTitle, width / 2, 4, 0xffffff);
|
+ drawCenteredString(fontRenderer, screenTitle, width / 2, 4, 0xffffff);
|
||||||
super.drawScreen(i, j, f);
|
super.drawScreen(par1, par2, par3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +1,32 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/GuiIngame.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/GuiIngame.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/GuiIngame.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/GuiIngame.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -5,6 +5,7 @@
|
@@ -8,6 +8,8 @@
|
||||||
import java.util.Random;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
+import net.minecraft.src.forge.ISpecialArmor;
|
import org.lwjgl.opengl.GL12;
|
||||||
|
|
||||||
|
+import net.minecraft.src.forge.*;
|
||||||
|
+
|
||||||
public class GuiIngame extends Gui
|
public class GuiIngame extends Gui
|
||||||
{
|
{
|
||||||
@@ -106,7 +107,19 @@
|
private static RenderItem itemRenderer = new RenderItem();
|
||||||
}
|
@@ -139,7 +141,19 @@
|
||||||
int k8 = l - 39;
|
|
||||||
int j9 = k8 - 10;
|
var51 = var7 - 39;
|
||||||
- int i10 = mc.thePlayer.getTotalArmorValue();
|
var22 = var51 - 10;
|
||||||
+ int i10 = 0;
|
- var23 = this.mc.thePlayer.getTotalArmorValue();
|
||||||
|
+ var23 = 0;
|
||||||
+ for (int x = 0; x < mc.thePlayer.inventory.armorInventory.length; x++)
|
+ for (int x = 0; x < mc.thePlayer.inventory.armorInventory.length; x++)
|
||||||
+ {
|
+ {
|
||||||
+ ItemStack stack = mc.thePlayer.inventory.armorInventory[x];
|
+ ItemStack stack = mc.thePlayer.inventory.armorInventory[x];
|
||||||
+ if (stack != null && stack.getItem() instanceof ISpecialArmor)
|
+ if (stack != null && stack.getItem() instanceof ISpecialArmor)
|
||||||
+ {
|
+ {
|
||||||
+ i10 += ((ISpecialArmor)stack.getItem()).getArmorDisplay(mc.thePlayer, stack, x);
|
+ var23 += ((ISpecialArmor)stack.getItem()).getArmorDisplay(mc.thePlayer, stack, x);
|
||||||
+ }
|
+ }
|
||||||
+ else if (stack != null && stack.getItem() instanceof ItemArmor)
|
+ else if (stack != null && stack.getItem() instanceof ItemArmor)
|
||||||
+ {
|
+ {
|
||||||
+ i10 += ((ItemArmor)stack.getItem()).damageReduceAmount;
|
+ var23 += ((ItemArmor)stack.getItem()).damageReduceAmount;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
int j10 = -1;
|
int var24 = -1;
|
||||||
if (mc.thePlayer.isPotionActive(Potion.regeneration))
|
|
||||||
{
|
if (this.mc.thePlayer.isPotionActive(Potion.regeneration))
|
||||||
|
|
|
@ -1,35 +1,36 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -1,6 +1,7 @@
|
@@ -1,5 +1,6 @@
|
||||||
package net.minecraft.src;
|
package net.minecraft.src;
|
||||||
|
|
||||||
import java.io.PrintStream;
|
|
||||||
+import java.util.ArrayList;
|
+import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@@ -157,6 +158,9 @@
|
@@ -188,7 +189,10 @@
|
||||||
private String potionEffect;
|
|
||||||
private String itemName;
|
|
||||||
|
|
||||||
+ // FORGE: To disable repair recipes.
|
/** full name of item from language file */
|
||||||
|
private String itemName;
|
||||||
|
-
|
||||||
|
+
|
||||||
|
+ /** FORGE: To disable repair recipes. */
|
||||||
+ protected boolean canRepair = true;
|
+ protected boolean canRepair = true;
|
||||||
+
|
+
|
||||||
protected Item(int i)
|
protected Item(int par1)
|
||||||
{
|
{
|
||||||
maxStackSize = 64;
|
this.shiftedIndex = 256 + par1;
|
||||||
@@ -449,7 +453,7 @@
|
@@ -542,7 +546,7 @@
|
||||||
float f7 = f4 * f5;
|
float var17 = MathHelper.sin(-var5 * 0.017453292F);
|
||||||
float f8 = f6;
|
float var18 = var15 * var16;
|
||||||
float f9 = f3 * f5;
|
float var20 = var14 * var16;
|
||||||
- double d3 = 5D;
|
- double var21 = 5.0D;
|
||||||
+ double d3 = ModLoader.getMinecraftInstance().playerController.getBlockReachDistance();
|
+ double var21 = ModLoader.getMinecraftInstance().playerController.getBlockReachDistance();
|
||||||
Vec3D vec3d1 = vec3d.addVector((double)f7 * d3, (double)f8 * d3, (double)f9 * d3);
|
Vec3D var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
|
||||||
MovingObjectPosition movingobjectposition = world.rayTraceBlocks_do_do(vec3d, vec3d1, flag, !flag);
|
MovingObjectPosition var24 = par1World.rayTraceBlocks_do_do(var13, var23, par3, !par3);
|
||||||
return movingobjectposition;
|
return var24;
|
||||||
@@ -469,6 +473,149 @@
|
@@ -570,4 +574,147 @@
|
||||||
{
|
{
|
||||||
return getIconFromDamage(i);
|
StatList.initStats();
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
@ -41,10 +42,10 @@
|
||||||
+ */
|
+ */
|
||||||
+ public void addCreativeItems(ArrayList itemList)
|
+ public void addCreativeItems(ArrayList itemList)
|
||||||
+ {
|
+ {
|
||||||
+ if (this.shiftedIndex != Item.potion.shiftedIndex && this.shiftedIndex != Item.monsterPlacer.shiftedIndex)
|
+ if (this.shiftedIndex != Item.potion.shiftedIndex && this.shiftedIndex != Item.monsterPlacer.shiftedIndex)
|
||||||
+ {
|
+ {
|
||||||
+ itemList.add(new ItemStack(this, 1));
|
+ itemList.add(new ItemStack(this, 1));
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
@ -58,7 +59,7 @@
|
||||||
+ */
|
+ */
|
||||||
+ public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player)
|
+ public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player)
|
||||||
+ {
|
+ {
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
@ -74,7 +75,7 @@
|
||||||
+ */
|
+ */
|
||||||
+ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int X, int Y, int Z, int side)
|
+ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int X, int Y, int Z, int side)
|
||||||
+ {
|
+ {
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
@ -86,7 +87,7 @@
|
||||||
+ */
|
+ */
|
||||||
+ public float getStrVsBlock(ItemStack itemstack, Block block, int metadata)
|
+ public float getStrVsBlock(ItemStack itemstack, Block block, int metadata)
|
||||||
+ {
|
+ {
|
||||||
+ return getStrVsBlock(itemstack, block);
|
+ return getStrVsBlock(itemstack, block);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
@ -95,7 +96,7 @@
|
||||||
+ */
|
+ */
|
||||||
+ public boolean isRepairable()
|
+ public boolean isRepairable()
|
||||||
+ {
|
+ {
|
||||||
+ return canRepair && isDamageable();
|
+ return canRepair && isDamageable();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
@ -104,8 +105,8 @@
|
||||||
+ */
|
+ */
|
||||||
+ public Item setNoRepair()
|
+ public Item setNoRepair()
|
||||||
+ {
|
+ {
|
||||||
+ canRepair = false;
|
+ canRepair = false;
|
||||||
+ return this;
|
+ return this;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
@ -122,7 +123,7 @@
|
||||||
+ */
|
+ */
|
||||||
+ public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player)
|
+ public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player)
|
||||||
+ {
|
+ {
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
@ -174,6 +175,4 @@
|
||||||
+ */
|
+ */
|
||||||
+ return getIconIndex(stack);
|
+ return getIconIndex(stack);
|
||||||
+ }
|
+ }
|
||||||
|
}
|
||||||
static
|
|
||||||
{
|
|
||||||
|
|
|
@ -1,35 +1,35 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/ItemBow.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/ItemBow.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/ItemBow.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/ItemBow.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -2,6 +2,8 @@
|
@@ -1,5 +1,7 @@
|
||||||
|
package net.minecraft.src;
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
+import net.minecraft.src.forge.ForgeHooks;
|
+import net.minecraft.src.forge.ForgeHooks;
|
||||||
+
|
+
|
||||||
public class ItemBow extends Item
|
public class ItemBow extends Item
|
||||||
{
|
{
|
||||||
public ItemBow(int i)
|
public ItemBow(int par1)
|
||||||
@@ -13,6 +15,11 @@
|
@@ -14,6 +16,11 @@
|
||||||
|
*/
|
||||||
public void onPlayerStoppedUsing(ItemStack itemstack, World world, EntityPlayer entityplayer, int i)
|
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
|
||||||
{
|
{
|
||||||
+ boolean handled = ForgeHooks.onArrowLoose(itemstack, world, entityplayer, getMaxItemUseDuration(itemstack) - i);
|
+ if (ForgeHooks.onArrowLoose(par1ItemStack, par2World, par3EntityPlayer, getMaxItemUseDuration(par1ItemStack) - par4))
|
||||||
+ if (handled)
|
|
||||||
+ {
|
+ {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
boolean flag = entityplayer.capabilities.depleteBuckets || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, itemstack) > 0;
|
+
|
||||||
if (flag || entityplayer.inventory.hasItem(Item.arrow.shiftedIndex))
|
boolean var5 = par3EntityPlayer.capabilities.depleteBuckets || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;
|
||||||
{
|
|
||||||
@@ -80,6 +87,11 @@
|
|
||||||
|
|
||||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
|
if (var5 || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex))
|
||||||
|
@@ -97,6 +104,12 @@
|
||||||
|
*/
|
||||||
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||||
{
|
{
|
||||||
+ ItemStack stack = ForgeHooks.onArrowNock(itemstack, world, entityplayer);
|
+ ItemStack stack = ForgeHooks.onArrowNock(par1ItemStack, par2World, par3EntityPlayer);
|
||||||
+ if (stack != null)
|
+ if (stack != null)
|
||||||
+ {
|
+ {
|
||||||
+ return stack;
|
+ return stack;
|
||||||
+ }
|
+ }
|
||||||
if (entityplayer.capabilities.depleteBuckets || entityplayer.inventory.hasItem(Item.arrow.shiftedIndex))
|
+
|
||||||
|
if (par3EntityPlayer.capabilities.depleteBuckets || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex))
|
||||||
{
|
{
|
||||||
entityplayer.setItemInUse(itemstack, getMaxItemUseDuration(itemstack));
|
par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/ItemBucket.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/ItemBucket.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/ItemBucket.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/ItemBucket.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -2,6 +2,8 @@
|
@@ -1,5 +1,7 @@
|
||||||
|
package net.minecraft.src;
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
+import net.minecraft.src.forge.MinecraftForge;
|
+import net.minecraft.src.forge.MinecraftForge;
|
||||||
+
|
+
|
||||||
public class ItemBucket extends Item
|
public class ItemBucket extends Item
|
||||||
{
|
{
|
||||||
private int isFull;
|
/** field for checking if the bucket has been filled. */
|
||||||
@@ -40,6 +42,11 @@
|
@@ -47,6 +49,12 @@
|
||||||
{
|
{
|
||||||
return itemstack;
|
return par1ItemStack;
|
||||||
}
|
}
|
||||||
+ ItemStack customBucket = MinecraftForge.fillCustomBucket(world, i, j, k);
|
+
|
||||||
+ if (customBucket != null)
|
+ ItemStack stack = MinecraftForge.fillCustomBucket(par2World, var13, var14, var15);
|
||||||
+ {
|
+ if (stack != null)
|
||||||
+ return customBucket;
|
+ {
|
||||||
+ }
|
+ return stack;
|
||||||
if (world.getBlockMaterial(i, j, k) == Material.water && world.getBlockMetadata(i, j, k) == 0)
|
+ }
|
||||||
{
|
|
||||||
world.setBlockWithNotify(i, j, k, 0);
|
if (par2World.getBlockMaterial(var13, var14, var15) == Material.water && par2World.getBlockMetadata(var13, var14, var15) == 0)
|
||||||
|
{
|
||||||
|
|
|
@ -1,70 +1,65 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/ItemDye.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/ItemDye.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/ItemDye.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/ItemDye.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -1,7 +1,10 @@
|
@@ -1,5 +1,9 @@
|
||||||
package net.minecraft.src;
|
package net.minecraft.src;
|
||||||
|
|
||||||
+import java.util.ArrayList;
|
+import java.util.ArrayList;
|
||||||
import java.util.Random;
|
+
|
||||||
|
|
||||||
+import net.minecraft.src.forge.ForgeHooks;
|
+import net.minecraft.src.forge.ForgeHooks;
|
||||||
+
|
+
|
||||||
public class ItemDye extends Item
|
public class ItemDye extends Item
|
||||||
{
|
{
|
||||||
public static final String dyeColorNames[] =
|
/** List of dye color names */
|
||||||
@@ -43,6 +46,16 @@
|
@@ -43,6 +47,15 @@
|
||||||
if (itemstack.getItemDamage() == 15)
|
if (par1ItemStack.getItemDamage() == 15)
|
||||||
{
|
|
||||||
int i1 = world.getBlockId(i, j, k);
|
|
||||||
+
|
|
||||||
+ if (ForgeHooks.onUseBonemeal(world, i1, i, j, k))
|
|
||||||
+ {
|
|
||||||
+ if (!world.isRemote)
|
|
||||||
+ {
|
|
||||||
+ itemstack.stackSize--;
|
|
||||||
+ }
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if (i1 == Block.sapling.blockID)
|
|
||||||
{
|
{
|
||||||
if (!world.isRemote)
|
int var8 = par3World.getBlockId(par4, par5, par6);
|
||||||
@@ -109,14 +122,7 @@
|
+
|
||||||
world.setBlockAndMetadataWithNotify(k1, l1, i2, Block.tallGrass.blockID, 1);
|
+ if (ForgeHooks.onUseBonemeal(par3World, var8, par4, par5, par6))
|
||||||
continue;
|
+ {
|
||||||
}
|
+ if (!par3World.isRemote)
|
||||||
- if (itemRand.nextInt(3) != 0)
|
+ {
|
||||||
- {
|
+ par1ItemStack.stackSize--;
|
||||||
- world.setBlockWithNotify(k1, l1, i2, Block.plantYellow.blockID);
|
+ }
|
||||||
- }
|
+ return true;
|
||||||
- else
|
+ }
|
||||||
- {
|
|
||||||
- world.setBlockWithNotify(k1, l1, i2, Block.plantRed.blockID);
|
|
||||||
- }
|
|
||||||
+ ForgeHooks.plantGrassPlant(world, k1, l1, i2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
@@ -125,6 +131,23 @@
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (var8 == Block.sapling.blockID)
|
||||||
|
{
|
||||||
|
@@ -118,14 +131,7 @@
|
||||||
|
{
|
||||||
|
par3World.setBlockAndMetadataWithNotify(var10, var11, var12, Block.tallGrass.blockID, 1);
|
||||||
|
}
|
||||||
|
- else if (itemRand.nextInt(3) != 0)
|
||||||
|
- {
|
||||||
|
- par3World.setBlockWithNotify(var10, var11, var12, Block.plantYellow.blockID);
|
||||||
|
- }
|
||||||
|
- else
|
||||||
|
- {
|
||||||
|
- par3World.setBlockWithNotify(var10, var11, var12, Block.plantRed.blockID);
|
||||||
|
- }
|
||||||
|
+ ForgeHooks.plantGrassPlant(par3World, var10, var11, var12);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -155,4 +161,20 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Called when a new CreativeContainer is opened, populate the list
|
+ * Called when a new CreativeContainer is opened, populate the list
|
||||||
+ * with all of the items for this item you want a player in creative mode
|
+ * with all of the items for this item you want a player in creative mode
|
||||||
+ * to have access to.
|
+ * to have access to.
|
||||||
+ *
|
+ *
|
||||||
+ * @param itemList The list of items currently in the creative inventory
|
+ * @param itemList The list of items currently in the creative inventory
|
||||||
+ */
|
+ */
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void addCreativeItems(ArrayList itemList)
|
+ public void addCreativeItems(ArrayList itemList)
|
||||||
+ {
|
+ {
|
||||||
+ for (int x = 0; x < 16; x++)
|
+ for (int x = 0; x < 16; x++)
|
||||||
+ {
|
+ {
|
||||||
+ itemList.add(new ItemStack(this, 1, x));
|
+ itemList.add(new ItemStack(this, 1, x));
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
}
|
||||||
public void useItemOnEntity(ItemStack itemstack, EntityLiving entityliving)
|
|
||||||
{
|
|
||||||
if (entityliving instanceof EntitySheep)
|
|
||||||
|
|
|
@ -7,16 +7,16 @@
|
||||||
+
|
+
|
||||||
public class ItemHoe extends Item
|
public class ItemHoe extends Item
|
||||||
{
|
{
|
||||||
public ItemHoe(int i, EnumToolMaterial enumtoolmaterial)
|
public ItemHoe(int par1, EnumToolMaterial par2EnumToolMaterial)
|
||||||
@@ -15,6 +17,11 @@
|
@@ -21,6 +23,11 @@
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
+ if(ForgeHooks.onUseHoe(itemstack, entityplayer, world, i, j, k))
|
else
|
||||||
+ {
|
{
|
||||||
+ itemstack.damageItem(1, entityplayer);
|
+ if (ForgeHooks.onUseHoe(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6))
|
||||||
+ return true;
|
+ {
|
||||||
+ }
|
+ par1ItemStack.damageItem(1, par2EntityPlayer);
|
||||||
int i1 = world.getBlockId(i, j, k);
|
+ return true;
|
||||||
int j1 = world.getBlockId(i, j + 1, k);
|
+ }
|
||||||
if (l != 0 && j1 == 0 && i1 == Block.grass.blockID || i1 == Block.dirt.blockID)
|
int var8 = par3World.getBlockId(par4, par5, par6);
|
||||||
|
int var9 = par3World.getBlockId(par4, par5 + 1, par6);
|
||||||
|
|
||||||
|
|
|
@ -9,41 +9,37 @@
|
||||||
+import net.minecraft.src.forge.MinecraftForgeClient;
|
+import net.minecraft.src.forge.MinecraftForgeClient;
|
||||||
+
|
+
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import org.lwjgl.opengl.GL12;
|
||||||
|
|
||||||
public class ItemRenderer
|
@@ -33,21 +37,27 @@
|
||||||
@@ -27,20 +31,31 @@
|
public void renderItem(EntityLiving par1EntityLiving, ItemStack par2ItemStack, int par3)
|
||||||
public void renderItem(EntityLiving entityliving, ItemStack itemstack, int i)
|
|
||||||
{
|
{
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
- if (itemstack.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
+ ICustomItemRenderer customRenderer = MinecraftForgeClient.getCustomItemRenderer(par2ItemStack.itemID);
|
||||||
+ ICustomItemRenderer customRenderer = MinecraftForgeClient.getCustomItemRenderer(itemstack.itemID);
|
|
||||||
+
|
- if (par2ItemStack.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType()))
|
||||||
+ if (customRenderer != null)
|
+ if (customRenderer != null)
|
||||||
+ {
|
+ {
|
||||||
+ String tex = ForgeHooksClient.getTexture("/terrain.png", itemstack.getItem());
|
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(ForgeHooksClient.getTexture("/terrain.png", par2ItemStack.getItem())));
|
||||||
+ GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture(tex));
|
+ ForgeHooksClient.renderCustomItem(customRenderer, renderBlocksInstance, par2ItemStack.itemID, par2ItemStack.getItemDamage(), par1EntityLiving.getEntityBrightness(1.0F));
|
||||||
+ ForgeHooksClient.renderCustomItem(customRenderer, renderBlocksInstance, itemstack.itemID, itemstack.getItemDamage(), entityliving.getEntityBrightness(1.0F));
|
|
||||||
+ }
|
+ }
|
||||||
+ else if(itemstack.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
+ else if (par2ItemStack.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[par2ItemStack.itemID].getRenderType()))
|
||||||
{
|
{
|
||||||
- GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/terrain.png"));
|
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
|
||||||
+ String tex = ForgeHooksClient.getTexture("/terrain.png", Block.blocksList[itemstack.itemID]);
|
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(ForgeHooksClient.getTexture("/terrain.png", par2ItemStack.getItem())));
|
||||||
+ GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture(tex));
|
this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F);
|
||||||
renderBlocksInstance.renderBlockAsItem(Block.blocksList[itemstack.itemID], itemstack.getItemDamage(), 1.0F);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (itemstack.itemID < 256)
|
if (par2ItemStack.itemID < 256)
|
||||||
{
|
{
|
||||||
- GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/terrain.png"));
|
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/terrain.png"));
|
||||||
+ String tex = ForgeHooksClient.getTexture("/terrain.png", Block.blocksList[itemstack.itemID]);
|
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(ForgeHooksClient.getTexture("/terrain.png", Block.blocksList[par2ItemStack.itemID])));
|
||||||
+ GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture(tex));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
- GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/gui/items.png"));
|
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/items.png"));
|
||||||
+ String tex = ForgeHooksClient.getTexture("/gui/items.png", Item.itemsList[itemstack.itemID]);
|
+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture(ForgeHooksClient.getTexture("/gui/items.png", Item.itemsList[par2ItemStack.itemID])));
|
||||||
+ GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture(tex));
|
|
||||||
}
|
}
|
||||||
Tessellator tessellator = Tessellator.instance;
|
|
||||||
int j = entityliving.getItemIcon(itemstack, i);
|
Tessellator var4 = Tessellator.instance;
|
||||||
|
|
|
@ -1,33 +1,32 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/ItemShears.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/ItemShears.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/ItemShears.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/ItemShears.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -1,5 +1,9 @@
|
@@ -1,5 +1,8 @@
|
||||||
package net.minecraft.src;
|
package net.minecraft.src;
|
||||||
|
|
||||||
+import java.util.ArrayList;
|
+import java.util.ArrayList;
|
||||||
+
|
|
||||||
+import net.minecraft.src.forge.IShearable;
|
+import net.minecraft.src.forge.IShearable;
|
||||||
+
|
+
|
||||||
public class ItemShears extends Item
|
public class ItemShears extends Item
|
||||||
{
|
{
|
||||||
public ItemShears(int i)
|
public ItemShears(int par1)
|
||||||
@@ -11,12 +15,11 @@
|
@@ -11,13 +14,12 @@
|
||||||
|
|
||||||
public boolean onBlockDestroyed(ItemStack itemstack, int i, int j, int k, int l, EntityLiving entityliving)
|
public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving)
|
||||||
{
|
{
|
||||||
- if (i == Block.leaves.blockID || i == Block.web.blockID || i == Block.tallGrass.blockID || i == Block.vine.blockID)
|
- if (par2 != Block.leaves.blockID && par2 != Block.web.blockID && par2 != Block.tallGrass.blockID && par2 != Block.vine.blockID)
|
||||||
+ if (i == Block.leaves.blockID || i == Block.web.blockID || i == Block.tallGrass.blockID || i == Block.vine.blockID || Block.blocksList[i] instanceof IShearable)
|
+ if (par2 != Block.leaves.blockID && par2 != Block.web.blockID && par2 != Block.tallGrass.blockID && par2 != Block.vine.blockID && Block.blocksList[par2] instanceof IShearable)
|
||||||
{
|
{
|
||||||
- itemstack.damageItem(1, entityliving);
|
return super.onBlockDestroyed(par1ItemStack, par2, par3, par4, par5, par6EntityLiving);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
- par1ItemStack.damageItem(1, par6EntityLiving);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
- else
|
}
|
||||||
+ else
|
@@ -38,4 +40,62 @@
|
||||||
{
|
{
|
||||||
return super.onBlockDestroyed(itemstack, i, j, k, l, entityliving);
|
return par2Block.blockID != Block.web.blockID && par2Block.blockID != Block.leaves.blockID ? (par2Block.blockID == Block.cloth.blockID ? 5.0F : super.getStrVsBlock(par1ItemStack, par2Block)) : 15.0F;
|
||||||
}
|
|
||||||
@@ -42,4 +45,62 @@
|
|
||||||
return super.getStrVsBlock(itemstack, block);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
|
@ -57,19 +56,19 @@
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player)
|
+ public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player)
|
||||||
+ {
|
+ {
|
||||||
+ if (player.worldObj.isRemote)
|
+ if (player.worldObj.isRemote)
|
||||||
+ {
|
+ {
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+ int id = player.worldObj.getBlockId(X, Y, Z);
|
+ int id = player.worldObj.getBlockId(x, y, z);
|
||||||
+ if (Block.blocksList[id] != null && Block.blocksList[id] instanceof IShearable)
|
+ if (Block.blocksList[id] != null && Block.blocksList[id] instanceof IShearable)
|
||||||
+ {
|
+ {
|
||||||
+ IShearable target = (IShearable)Block.blocksList[id];
|
+ IShearable target = (IShearable)Block.blocksList[id];
|
||||||
+ if (target.isShearable(itemstack, player.worldObj, X, Y, Z))
|
+ if (target.isShearable(itemstack, player.worldObj, x, y, z))
|
||||||
+ {
|
+ {
|
||||||
+ ArrayList<ItemStack> drops = target.onSheared(itemstack, player.worldObj, X, Y, Z,
|
+ ArrayList<ItemStack> drops = target.onSheared(itemstack, player.worldObj, x, y, z,
|
||||||
+ EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
|
+ EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
|
||||||
+ for(ItemStack stack : drops)
|
+ for(ItemStack stack : drops)
|
||||||
+ {
|
+ {
|
||||||
|
@ -77,7 +76,7 @@
|
||||||
+ double d = (double)(player.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
+ double d = (double)(player.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||||
+ double d1 = (double)(player.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
+ double d1 = (double)(player.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||||
+ double d2 = (double)(player.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
+ double d2 = (double)(player.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||||
+ EntityItem entityitem = new EntityItem(player.worldObj, (double)X + d, (double)Y + d1, (double)Z + d2, stack);
|
+ EntityItem entityitem = new EntityItem(player.worldObj, (double)x + d, (double)y + d1, (double)z + d2, stack);
|
||||||
+ entityitem.delayBeforeCanPickup = 10;
|
+ entityitem.delayBeforeCanPickup = 10;
|
||||||
+ player.worldObj.spawnEntityInWorld(entityitem);
|
+ player.worldObj.spawnEntityInWorld(entityitem);
|
||||||
+ }
|
+ }
|
||||||
|
|
|
@ -1,35 +1,34 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/ItemTool.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/ItemTool.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/ItemTool.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/ItemTool.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -1,10 +1,12 @@
|
@@ -1,11 +1,13 @@
|
||||||
package net.minecraft.src;
|
package net.minecraft.src;
|
||||||
|
|
||||||
+import net.minecraft.src.forge.ForgeHooks;
|
+import net.minecraft.src.forge.ForgeHooks;
|
||||||
+
|
+
|
||||||
public class ItemTool extends Item
|
public class ItemTool extends Item
|
||||||
{
|
{
|
||||||
private Block blocksEffectiveAgainst[];
|
/** Array of blocks the tool has extra effect against. */
|
||||||
- protected float efficiencyOnProperMaterial;
|
private Block[] blocksEffectiveAgainst;
|
||||||
|
- protected float efficiencyOnProperMaterial = 4.0F;
|
||||||
- private int damageVsEntity;
|
- private int damageVsEntity;
|
||||||
+ public float efficiencyOnProperMaterial;
|
+ public float efficiencyOnProperMaterial = 4.0F;
|
||||||
+ public int damageVsEntity;
|
+ public int damageVsEntity;
|
||||||
|
|
||||||
|
/** The material this tool is made from. */
|
||||||
protected EnumToolMaterial toolMaterial;
|
protected EnumToolMaterial toolMaterial;
|
||||||
|
@@ -77,4 +79,15 @@
|
||||||
protected ItemTool(int i, int j, EnumToolMaterial enumtoolmaterial, Block ablock[])
|
|
||||||
@@ -32,6 +34,17 @@
|
|
||||||
return 1.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* FORGE: Overridden to allow custom tool effectiveness */
|
|
||||||
+ @Override
|
|
||||||
+ public float getStrVsBlock(ItemStack itemstack, Block block, int md)
|
|
||||||
+ {
|
|
||||||
+ if (ForgeHooks.isToolEffective(itemstack, block, md))
|
|
||||||
+ {
|
|
||||||
+ return efficiencyOnProperMaterial;
|
|
||||||
+ }
|
|
||||||
+ return getStrVsBlock(itemstack,block);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1)
|
|
||||||
{
|
{
|
||||||
itemstack.damageItem(2, entityliving1);
|
return this.toolMaterial.getEnchantability();
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ /** FORGE: Overridden to allow custom tool effectiveness */
|
||||||
|
+ @Override
|
||||||
|
+ public float getStrVsBlock(ItemStack stack, Block block, int meta)
|
||||||
|
+ {
|
||||||
|
+ if (ForgeHooks.isToolEffective(stack, block, meta))
|
||||||
|
+ {
|
||||||
|
+ return efficiencyOnProperMaterial;
|
||||||
|
+ }
|
||||||
|
+ return getStrVsBlock(stack, block);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/MovingObjectPosition.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/MovingObjectPosition.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/MovingObjectPosition.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/MovingObjectPosition.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -9,6 +9,9 @@
|
@@ -25,6 +25,9 @@
|
||||||
public int sideHit;
|
|
||||||
public Vec3D hitVec;
|
/** The hit entity */
|
||||||
public Entity entityHit;
|
public Entity entityHit;
|
||||||
+
|
+
|
||||||
+ //Added for RedPower subblocks
|
+ /** Used to determine what sub-segment is hit */
|
||||||
+ public int subHit = -1;
|
+ public int subHit = -1;
|
||||||
|
|
||||||
public MovingObjectPosition(int i, int j, int k, int l, Vec3D vec3d)
|
public MovingObjectPosition(int par1, int par2, int par3, int par4, Vec3D par5Vec3D)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,16 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/NetClientHandler.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/NetClientHandler.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/NetClientHandler.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/NetClientHandler.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -7,6 +7,9 @@
|
@@ -5,6 +5,7 @@
|
||||||
import java.util.*;
|
import java.io.DataInputStream;
|
||||||
import java.util.logging.Logger;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
+import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.Socket;
|
||||||
|
import java.net.URL;
|
||||||
|
@@ -15,6 +16,9 @@
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Random;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
+import net.minecraft.src.forge.ForgeHooks;
|
+import net.minecraft.src.forge.ForgeHooks;
|
||||||
+import net.minecraft.src.forge.MessageManager;
|
+import net.minecraft.src.forge.MessageManager;
|
||||||
|
@ -10,21 +18,21 @@
|
||||||
|
|
||||||
public class NetClientHandler extends NetHandler
|
public class NetClientHandler extends NetHandler
|
||||||
{
|
{
|
||||||
@@ -35,6 +38,8 @@
|
@@ -46,6 +50,8 @@
|
||||||
mc = minecraft;
|
this.mc = par1Minecraft;
|
||||||
Socket socket = new Socket(InetAddress.getByName(s), i);
|
Socket var4 = new Socket(InetAddress.getByName(par2Str), par3);
|
||||||
netManager = new NetworkManager(socket, "Client", this);
|
this.netManager = new NetworkManager(var4, "Client", this);
|
||||||
+
|
+
|
||||||
+ ForgeHooks.onConnect(netManager);
|
+ ForgeHooks.onConnect(netManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void processReadPackets()
|
/**
|
||||||
@@ -58,6 +63,27 @@
|
@@ -73,6 +79,29 @@
|
||||||
mc.thePlayer.entityId = packet1login.protocolVersion;
|
this.mc.thePlayer.entityId = par1Packet1Login.protocolVersion;
|
||||||
currentServerMaxPlayers = packet1login.maxPlayers;
|
this.currentServerMaxPlayers = par1Packet1Login.maxPlayers;
|
||||||
((PlayerControllerMP)mc.playerController).setCreative(packet1login.serverMode == 1);
|
((PlayerControllerMP)this.mc.playerController).setCreative(par1Packet1Login.serverMode == 1);
|
||||||
+
|
+
|
||||||
+ ForgeHooks.onLogin(netManager, packet1login);
|
+ ForgeHooks.onLogin(netManager, par1Packet1Login);
|
||||||
+
|
+
|
||||||
+ String[] channels = MessageManager.getInstance().getRegisteredChannels(netManager);
|
+ String[] channels = MessageManager.getInstance().getRegisteredChannels(netManager);
|
||||||
+ StringBuilder tmp = new StringBuilder();
|
+ StringBuilder tmp = new StringBuilder();
|
||||||
|
@ -36,22 +44,24 @@
|
||||||
+ }
|
+ }
|
||||||
+ Packet250CustomPayload pkt = new Packet250CustomPayload();
|
+ Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||||
+ pkt.channel = "REGISTER";
|
+ pkt.channel = "REGISTER";
|
||||||
+ try {
|
+ try
|
||||||
|
+ {
|
||||||
+ pkt.data = tmp.toString().getBytes("UTF8");
|
+ pkt.data = tmp.toString().getBytes("UTF8");
|
||||||
+ } catch (UnsupportedEncodingException e) {
|
+ }
|
||||||
|
+ catch (UnsupportedEncodingException e)
|
||||||
|
+ {
|
||||||
+ e.printStackTrace();
|
+ e.printStackTrace();
|
||||||
+ }
|
+ }
|
||||||
+ pkt.length = pkt.data.length;
|
+ pkt.length = pkt.data.length;
|
||||||
+ addToSendQueue(pkt);
|
+ addToSendQueue(pkt);
|
||||||
+
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handlePickupSpawn(Packet21PickupSpawn packet21pickupspawn)
|
public void handlePickupSpawn(Packet21PickupSpawn par1Packet21PickupSpawn)
|
||||||
@@ -608,7 +634,19 @@
|
@@ -630,7 +659,19 @@
|
||||||
}
|
}
|
||||||
else if (packet2handshake.username.equals("-"))
|
else if (par1Packet2Handshake.username.equals("-"))
|
||||||
{
|
{
|
||||||
- addToSendQueue(new Packet1Login(mc.session.username, 23));
|
- this.addToSendQueue(new Packet1Login(this.mc.session.username, 28));
|
||||||
+ /**
|
+ /**
|
||||||
+ * We use some of the unused fields in Packet 001 Login to identify the user as having Forge installed.
|
+ * We use some of the unused fields in Packet 001 Login to identify the user as having Forge installed.
|
||||||
+ * This allows modded clients to connect to Vanilla server without crashing.
|
+ * This allows modded clients to connect to Vanilla server without crashing.
|
||||||
|
@ -59,20 +69,20 @@
|
||||||
+ * Its a bit of a dirty hack, but it doesnt interrupt the login flow, and its unused data.
|
+ * Its a bit of a dirty hack, but it doesnt interrupt the login flow, and its unused data.
|
||||||
+ * The C->S serverMode is set to the hash code of the string "Forge", this should provide a fairly unique
|
+ * The C->S serverMode is set to the hash code of the string "Forge", this should provide a fairly unique
|
||||||
+ * identifier so we are certain it is not random, and it is Forge installed.
|
+ * identifier so we are certain it is not random, and it is Forge installed.
|
||||||
+ * The C->S mapSeed is set to the current Forge build number, in case we need to do any quick version checks.
|
+ * The C->S dimension is set to the current Forge build number, in case we need to do any quick version checks.
|
||||||
+ */
|
+ */
|
||||||
+ Packet1Login pkt = new Packet1Login(mc.session.username, 23);
|
+ Packet1Login pkt = new Packet1Login(mc.session.username, 28);
|
||||||
+ pkt.serverMode = ForgePacket.FORGE_ID;
|
+ pkt.serverMode = ForgePacket.FORGE_ID;
|
||||||
+ pkt.mapSeed = ForgeHooks.buildVersion;
|
+ pkt.field_48170_e = ForgeHooks.buildVersion;
|
||||||
+ addToSendQueue(pkt);
|
+ addToSendQueue(pkt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -620,7 +658,19 @@
|
@@ -643,7 +684,19 @@
|
||||||
bufferedreader.close();
|
|
||||||
if (s1.equalsIgnoreCase("ok"))
|
if (var6.equalsIgnoreCase("ok"))
|
||||||
{
|
{
|
||||||
- addToSendQueue(new Packet1Login(mc.session.username, 23));
|
- this.addToSendQueue(new Packet1Login(this.mc.session.username, 28));
|
||||||
+ /**
|
+ /**
|
||||||
+ * We use some of the unused fields in Packet 001 Login to identify the user as having Forge installed.
|
+ * We use some of the unused fields in Packet 001 Login to identify the user as having Forge installed.
|
||||||
+ * This allows modded clients to connect to Vanilla server without crashing.
|
+ * This allows modded clients to connect to Vanilla server without crashing.
|
||||||
|
@ -80,18 +90,18 @@
|
||||||
+ * Its a bit of a dirty hack, but it doesnt interrupt the login flow, and its unused data.
|
+ * Its a bit of a dirty hack, but it doesnt interrupt the login flow, and its unused data.
|
||||||
+ * The C->S serverMode is set to the hash code of the string "Forge", this should provide a fairly unique
|
+ * The C->S serverMode is set to the hash code of the string "Forge", this should provide a fairly unique
|
||||||
+ * identifier so we are certain it is not random, and it is Forge installed.
|
+ * identifier so we are certain it is not random, and it is Forge installed.
|
||||||
+ * The C->S mapSeed is set to the current Forge build number, in case we need to do any quick version checks.
|
+ * The C->S dimension is set to the current Forge build number, in case we need to do any quick version checks.
|
||||||
+ */
|
+ */
|
||||||
+ Packet1Login pkt = new Packet1Login(mc.session.username, 23);
|
+ Packet1Login pkt = new Packet1Login(mc.session.username, 28);
|
||||||
+ pkt.serverMode = ForgePacket.FORGE_ID;
|
+ pkt.serverMode = ForgePacket.FORGE_ID;
|
||||||
+ pkt.mapSeed = ForgeHooks.buildVersion;
|
+ pkt.field_48170_e = ForgeHooks.buildVersion;
|
||||||
+ addToSendQueue(pkt);
|
+ addToSendQueue(pkt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1017,4 +1067,44 @@
|
@@ -1074,4 +1127,44 @@
|
||||||
{
|
{
|
||||||
addToSendQueue(new Packet0KeepAlive(packet0keepalive.randomId));
|
this.addToSendQueue(new Packet0KeepAlive(par1Packet0KeepAlive.randomId));
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
|
@ -110,7 +120,7 @@
|
||||||
+ }
|
+ }
|
||||||
+ catch (UnsupportedEncodingException ex)
|
+ catch (UnsupportedEncodingException ex)
|
||||||
+ {
|
+ {
|
||||||
+ ModLoader.ThrowException("NetClientHandler.handleCustomPayload", ex);
|
+ ModLoader.throwException("NetClientHandler.handleCustomPayload", ex);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ else if (pkt.channel.equals("UNREGISTER"))
|
+ else if (pkt.channel.equals("UNREGISTER"))
|
||||||
|
@ -125,7 +135,7 @@
|
||||||
+ }
|
+ }
|
||||||
+ catch (UnsupportedEncodingException ex)
|
+ catch (UnsupportedEncodingException ex)
|
||||||
+ {
|
+ {
|
||||||
+ ModLoader.ThrowException("NetClientHandler.handleCustomPayload", ex);
|
+ ModLoader.throwException("NetClientHandler.handleCustomPayload", ex);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ else
|
+ else
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/NetworkManager.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/NetworkManager.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/NetworkManager.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/NetworkManager.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -4,6 +4,8 @@
|
@@ -11,6 +11,8 @@
|
||||||
import java.net.*;
|
import java.util.Collections;
|
||||||
import java.util.*;
|
import java.util.List;
|
||||||
|
|
||||||
+import net.minecraft.src.forge.ForgeHooks;
|
+import net.minecraft.src.forge.ForgeHooks;
|
||||||
+
|
+
|
||||||
public class NetworkManager
|
public class NetworkManager
|
||||||
{
|
{
|
||||||
public static final Object threadSyncObject = new Object();
|
/** Synchronization object used for read and write threads. */
|
||||||
@@ -201,6 +203,7 @@
|
@@ -307,6 +309,7 @@
|
||||||
networkSocket = null;
|
{
|
||||||
|
;
|
||||||
|
}
|
||||||
|
+ ForgeHooks.onDisconnect(this, par1Str, par2ArrayOfObj);
|
||||||
}
|
}
|
||||||
catch (Throwable throwable2) { }
|
|
||||||
+ ForgeHooks.onDisconnect(this, s, aobj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void processReadPackets()
|
@@ -427,4 +430,14 @@
|
||||||
@@ -293,4 +296,14 @@
|
|
||||||
{
|
{
|
||||||
return networkmanager.writeThread;
|
return par0NetworkManager.writeThread;
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
|
|
@ -8,25 +8,20 @@
|
||||||
|
|
||||||
public abstract class PlayerController
|
public abstract class PlayerController
|
||||||
{
|
{
|
||||||
@@ -29,10 +30,10 @@
|
@@ -39,7 +40,7 @@
|
||||||
}
|
|
||||||
world.playAuxSFX(2001, i, j, k, block.blockID + world.getBlockMetadata(i, j, k) * 256);
|
|
||||||
int i1 = world.getBlockMetadata(i, j, k);
|
|
||||||
- boolean flag = world.setBlockWithNotify(i, j, k, 0);
|
|
||||||
- if (block != null && flag)
|
|
||||||
+ boolean flag = block.removeBlockByPlayer(world, mc.thePlayer, i, j, k);
|
|
||||||
+ if (flag)
|
|
||||||
{
|
{
|
||||||
- block.onBlockDestroyedByPlayer(world, i, j, k, i1);
|
var5.playAuxSFX(2001, par1, par2, par3, var6.blockID + (var5.getBlockMetadata(par1, par2, par3) << 12));
|
||||||
+ block.onBlockDestroyedByPlayer(world, i, j, k, i1);
|
int var7 = var5.getBlockMetadata(par1, par2, par3);
|
||||||
}
|
- boolean var8 = var5.setBlockWithNotify(par1, par2, par3, 0);
|
||||||
return flag;
|
+ boolean var8 = var6.removeBlockByPlayer(var5, mc.thePlayer, par1, par2, par3);
|
||||||
}
|
|
||||||
@@ -57,6 +58,7 @@
|
if (var6 != null && var8)
|
||||||
if (itemstack1.stackSize == 0)
|
|
||||||
{
|
{
|
||||||
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = null;
|
@@ -86,6 +87,7 @@
|
||||||
+ ForgeHooks.onDestroyCurrentItem(entityplayer,itemstack1);
|
if (var5.stackSize == 0)
|
||||||
|
{
|
||||||
|
par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = null;
|
||||||
|
+ ForgeHooks.onDestroyCurrentItem(par1EntityPlayer, var5);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
|
@ -1,27 +1,28 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/PlayerControllerCreative.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/PlayerControllerCreative.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/PlayerControllerCreative.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/PlayerControllerCreative.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -43,11 +43,24 @@
|
@@ -52,6 +52,11 @@
|
||||||
public static void clickBlockCreative(Minecraft minecraft, PlayerController playercontroller, int i, int j, int k, int l)
|
*/
|
||||||
|
public static void clickBlockCreative(Minecraft par0Minecraft, PlayerController par1PlayerController, int par2, int par3, int par4, int par5)
|
||||||
{
|
{
|
||||||
minecraft.theWorld.onBlockHit(minecraft.thePlayer, i, j, k, l);
|
+ ItemStack itemstack = par0Minecraft.thePlayer.getCurrentEquippedItem();
|
||||||
+ ItemStack itemstack = minecraft.thePlayer.getCurrentEquippedItem();
|
+ if (itemstack != null && itemstack.getItem().onBlockStartBreak(itemstack, par2, par3, par4, par0Minecraft.thePlayer))
|
||||||
+ if (itemstack != null && itemstack.getItem().onBlockStartBreak(itemstack, i, j, k, minecraft.thePlayer))
|
|
||||||
+ {
|
+ {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
playercontroller.onPlayerDestroyBlock(i, j, k, l);
|
if (!par0Minecraft.theWorld.func_48457_a(par0Minecraft.thePlayer, par2, par3, par4, par5))
|
||||||
}
|
|
||||||
|
|
||||||
public boolean onPlayerRightClick(EntityPlayer entityplayer, World world, ItemStack itemstack, int i, int j, int k, int l)
|
|
||||||
{
|
|
||||||
+ if (itemstack != null)
|
|
||||||
+ {
|
|
||||||
+ Item item = itemstack.getItem();
|
|
||||||
+ if (item.onItemUseFirst(itemstack, entityplayer, world, i, j, k, l))
|
|
||||||
+ {
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
int i1 = world.getBlockId(i, j, k);
|
|
||||||
if (i1 > 0 && Block.blocksList[i1].blockActivated(world, i, j, k, entityplayer))
|
|
||||||
{
|
{
|
||||||
|
par1PlayerController.onPlayerDestroyBlock(par2, par3, par4, par5);
|
||||||
|
@@ -63,6 +68,13 @@
|
||||||
|
*/
|
||||||
|
public boolean onPlayerRightClick(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7)
|
||||||
|
{
|
||||||
|
+ if (par3ItemStack != null &&
|
||||||
|
+ par3ItemStack.getItem() != null &&
|
||||||
|
+ par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7))
|
||||||
|
+ {
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
int var8 = par2World.getBlockId(par4, par5, par6);
|
||||||
|
|
||||||
|
if (var8 > 0 && Block.blocksList[var8].blockActivated(par2World, par4, par5, par6, par1EntityPlayer))
|
||||||
|
|
|
@ -8,76 +8,65 @@
|
||||||
|
|
||||||
public class PlayerControllerMP extends PlayerController
|
public class PlayerControllerMP extends PlayerController
|
||||||
{
|
{
|
||||||
@@ -56,13 +57,19 @@
|
@@ -75,6 +76,11 @@
|
||||||
|
*/
|
||||||
public boolean onPlayerDestroyBlock(int i, int j, int k, int l)
|
public boolean onPlayerDestroyBlock(int par1, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
+ ItemStack itemstack = mc.thePlayer.getCurrentEquippedItem();
|
+ ItemStack stack = mc.thePlayer.getCurrentEquippedItem();
|
||||||
+ if (itemstack != null && itemstack.getItem().onBlockStartBreak(itemstack, i, j, k, mc.thePlayer))
|
+ if (stack != null && stack.getItem().onBlockStartBreak(stack, par1, par2, par3, mc.thePlayer))
|
||||||
+ {
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if (creativeMode)
|
|
||||||
{
|
|
||||||
return super.onPlayerDestroyBlock(i, j, k, l);
|
|
||||||
}
|
|
||||||
int i1 = mc.theWorld.getBlockId(i, j, k);
|
|
||||||
boolean flag = super.onPlayerDestroyBlock(i, j, k, l);
|
|
||||||
- ItemStack itemstack = mc.thePlayer.getCurrentEquippedItem();
|
|
||||||
+
|
|
||||||
if (itemstack != null)
|
|
||||||
{
|
|
||||||
itemstack.onDestroyBlock(i1, i, j, k, mc.thePlayer);
|
|
||||||
@@ -91,7 +98,7 @@
|
|
||||||
{
|
|
||||||
Block.blocksList[i1].onBlockClicked(mc.theWorld, i, j, k, mc.thePlayer);
|
|
||||||
}
|
|
||||||
- if (i1 > 0 && Block.blocksList[i1].blockStrength(mc.thePlayer) >= 1.0F)
|
|
||||||
+ if(i1 > 0 && Block.blocksList[i1].blockStrength(mc.theWorld, mc.thePlayer, i, j, k) >= 1.0F)
|
|
||||||
{
|
|
||||||
onPlayerDestroyBlock(i, j, k, l);
|
|
||||||
}
|
|
||||||
@@ -138,7 +145,7 @@
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Block block = Block.blocksList[i1];
|
|
||||||
- curBlockDamageMP += block.blockStrength(mc.thePlayer);
|
|
||||||
+ curBlockDamageMP += block.blockStrength(mc.theWorld, mc.thePlayer, i, j, k);
|
|
||||||
if (stepSoundTickCounter % 4F == 0.0F && block != null)
|
|
||||||
{
|
|
||||||
mc.sndManager.playSound(block.stepSound.getStepSound(), (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, (block.stepSound.getVolume() + 1.0F) / 8F, block.stepSound.getPitch() * 0.5F);
|
|
||||||
@@ -207,6 +214,16 @@
|
|
||||||
{
|
|
||||||
syncCurrentPlayItem();
|
|
||||||
netClientHandler.addToSendQueue(new Packet15Place(i, j, k, l, entityplayer.inventory.getCurrentItem()));
|
|
||||||
+
|
|
||||||
+ if (itemstack != null)
|
|
||||||
+ {
|
+ {
|
||||||
+ Item item = itemstack.getItem();
|
+ return false;
|
||||||
+ if (item.onItemUseFirst(itemstack, entityplayer, world, i, j, k, l))
|
+ }
|
||||||
+ {
|
if (this.creativeMode)
|
||||||
+ return true;
|
{
|
||||||
+ }
|
return super.onPlayerDestroyBlock(par1, par2, par3, par4);
|
||||||
|
@@ -121,7 +127,7 @@
|
||||||
|
Block.blocksList[var5].onBlockClicked(this.mc.theWorld, par1, par2, par3, this.mc.thePlayer);
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (var5 > 0 && Block.blocksList[var5].blockStrength(this.mc.thePlayer) >= 1.0F)
|
||||||
|
+ if (var5 > 0 && Block.blocksList[var5].blockStrength(mc.theWorld, mc.thePlayer, par1, par2, par3) >= 1.0F)
|
||||||
|
{
|
||||||
|
this.onPlayerDestroyBlock(par1, par2, par3, par4);
|
||||||
|
}
|
||||||
|
@@ -177,7 +183,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
Block var6 = Block.blocksList[var5];
|
||||||
|
- this.curBlockDamageMP += var6.blockStrength(this.mc.thePlayer);
|
||||||
|
+ this.curBlockDamageMP += var6.blockStrength(mc.theWorld, mc.thePlayer, par1, par2, par3);
|
||||||
|
|
||||||
|
if (this.stepSoundTickCounter % 4.0F == 0.0F && var6 != null)
|
||||||
|
{
|
||||||
|
@@ -263,6 +269,14 @@
|
||||||
|
{
|
||||||
|
this.syncCurrentPlayItem();
|
||||||
|
this.netClientHandler.addToSendQueue(new Packet15Place(par4, par5, par6, par7, par1EntityPlayer.inventory.getCurrentItem()));
|
||||||
|
+
|
||||||
|
+ if (par3ItemStack != null &&
|
||||||
|
+ par3ItemStack.getItem() != null &&
|
||||||
|
+ par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7))
|
||||||
|
+ {
|
||||||
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
int i1 = world.getBlockId(i, j, k);
|
int var8 = par2World.getBlockId(par4, par5, par6);
|
||||||
if (i1 > 0 && Block.blocksList[i1].blockActivated(world, i, j, k, entityplayer))
|
|
||||||
{
|
if (var8 > 0 && Block.blocksList[var8].blockActivated(par2World, par4, par5, par6, par1EntityPlayer))
|
||||||
@@ -227,7 +244,15 @@
|
@@ -284,7 +298,15 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
- return itemstack.useItem(entityplayer, world, i, j, k, l);
|
- return par3ItemStack.useItem(par1EntityPlayer, par2World, par4, par5, par6, par7);
|
||||||
+ if (!itemstack.useItem(entityplayer, world, i, j, k, l))
|
+ if (!par3ItemStack.useItem(par1EntityPlayer, par2World, par4, par5, par6, par7))
|
||||||
+ {
|
+ {
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+ if (itemstack.stackSize == 0)
|
+ if (par3ItemStack.stackSize <= 0)
|
||||||
+ {
|
+ {
|
||||||
+ ForgeHooks.onDestroyCurrentItem(entityplayer, itemstack);
|
+ ForgeHooks.onDestroyCurrentItem(par1EntityPlayer, par3ItemStack);
|
||||||
+ }
|
+ }
|
||||||
+ return true;
|
+ return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,73 +8,67 @@
|
||||||
|
|
||||||
public class PlayerControllerSP extends PlayerController
|
public class PlayerControllerSP extends PlayerController
|
||||||
{
|
{
|
||||||
@@ -36,11 +37,16 @@
|
@@ -35,11 +36,17 @@
|
||||||
|
*/
|
||||||
public boolean onPlayerDestroyBlock(int i, int j, int k, int l)
|
public boolean onPlayerDestroyBlock(int par1, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
+ ItemStack itemstack = mc.thePlayer.getCurrentEquippedItem();
|
+ ItemStack stack = mc.thePlayer.getCurrentEquippedItem();
|
||||||
+ if (itemstack != null && itemstack.getItem().onBlockStartBreak(itemstack, i, j, k, mc.thePlayer))
|
+ if (stack != null && stack.getItem().onBlockStartBreak(stack, par1, par2, par3, mc.thePlayer))
|
||||||
+ {
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
int i1 = mc.theWorld.getBlockId(i, j, k);
|
|
||||||
int j1 = mc.theWorld.getBlockMetadata(i, j, k);
|
|
||||||
boolean flag = super.onPlayerDestroyBlock(i, j, k, l);
|
|
||||||
- ItemStack itemstack = mc.thePlayer.getCurrentEquippedItem();
|
|
||||||
- boolean flag1 = mc.thePlayer.canHarvestBlock(Block.blocksList[i1]);
|
|
||||||
+ boolean flag1 = Block.blocksList[i1].canHarvestBlock(mc.thePlayer, j1);
|
|
||||||
if (itemstack != null)
|
|
||||||
{
|
|
||||||
itemstack.onDestroyBlock(i1, i, j, k, mc.thePlayer);
|
|
||||||
@@ -69,7 +75,7 @@
|
|
||||||
{
|
|
||||||
Block.blocksList[i1].onBlockClicked(mc.theWorld, i, j, k, mc.thePlayer);
|
|
||||||
}
|
|
||||||
- if (i1 > 0 && Block.blocksList[i1].blockStrength(mc.thePlayer) >= 1.0F)
|
|
||||||
+ if (i1 > 0 && Block.blocksList[i1].blockStrength(mc.theWorld, mc.thePlayer, i, j, k) >= 1.0F)
|
|
||||||
{
|
|
||||||
onPlayerDestroyBlock(i, j, k, l);
|
|
||||||
}
|
|
||||||
@@ -100,7 +106,7 @@
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Block block = Block.blocksList[i1];
|
|
||||||
- curBlockDamage += block.blockStrength(mc.thePlayer);
|
|
||||||
+ curBlockDamage += block.blockStrength(mc.theWorld, mc.thePlayer, i, j, k);
|
|
||||||
if (blockDestroySoundCounter % 4F == 0.0F && block != null)
|
|
||||||
{
|
|
||||||
mc.sndManager.playSound(block.stepSound.getStepSound(), (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, (block.stepSound.getVolume() + 1.0F) / 8F, block.stepSound.getPitch() * 0.5F);
|
|
||||||
@@ -165,6 +171,14 @@
|
|
||||||
|
|
||||||
public boolean onPlayerRightClick(EntityPlayer entityplayer, World world, ItemStack itemstack, int i, int j, int k, int l)
|
|
||||||
{
|
|
||||||
+ if (itemstack != null)
|
|
||||||
+ {
|
+ {
|
||||||
+ Item item = itemstack.getItem();
|
+ return false;
|
||||||
+ if (item.onItemUseFirst(itemstack, entityplayer, world, i, j, k, l))
|
|
||||||
+ {
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+ }
|
+ }
|
||||||
int i1 = world.getBlockId(i, j, k);
|
|
||||||
if (i1 > 0 && Block.blocksList[i1].blockActivated(world, i, j, k, entityplayer))
|
|
||||||
{
|
|
||||||
@@ -176,7 +190,16 @@
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
- return itemstack.useItem(entityplayer, world, i, j, k, l);
|
|
||||||
+ if (!itemstack.useItem(entityplayer, world, i, j, k, l))
|
|
||||||
+ {
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+
|
+
|
||||||
+ if(itemstack.stackSize == 0)
|
int var5 = this.mc.theWorld.getBlockId(par1, par2, par3);
|
||||||
+ {
|
int var6 = this.mc.theWorld.getBlockMetadata(par1, par2, par3);
|
||||||
+ ForgeHooks.onDestroyCurrentItem(entityplayer, itemstack);
|
boolean var7 = super.onPlayerDestroyBlock(par1, par2, par3, par4);
|
||||||
+ }
|
ItemStack var8 = this.mc.thePlayer.getCurrentEquippedItem();
|
||||||
|
- boolean var9 = this.mc.thePlayer.canHarvestBlock(Block.blocksList[var5]);
|
||||||
|
+ boolean var9 = Block.blocksList[var5].canHarvestBlock(mc.thePlayer, var6);
|
||||||
|
|
||||||
|
if (var8 != null)
|
||||||
|
{
|
||||||
|
@@ -75,7 +82,7 @@
|
||||||
|
Block.blocksList[var5].onBlockClicked(this.mc.theWorld, par1, par2, par3, this.mc.thePlayer);
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (var5 > 0 && Block.blocksList[var5].blockStrength(this.mc.thePlayer) >= 1.0F)
|
||||||
|
+ if (var5 > 0 && Block.blocksList[var5].blockStrength(mc.theWorld, mc.thePlayer, par1, par2, par3) >= 1.0F)
|
||||||
|
{
|
||||||
|
this.onPlayerDestroyBlock(par1, par2, par3, par4);
|
||||||
|
}
|
||||||
|
@@ -195,8 +202,34 @@
|
||||||
|
*/
|
||||||
|
public boolean onPlayerRightClick(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7)
|
||||||
|
{
|
||||||
|
+ if (par3ItemStack != null &&
|
||||||
|
+ par3ItemStack.getItem() != null &&
|
||||||
|
+ par3ItemStack.getItem().onItemUseFirst(par3ItemStack, par1EntityPlayer, par2World, par4, par5, par6, par7))
|
||||||
|
+ {
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
int var8 = par2World.getBlockId(par4, par5, par6);
|
||||||
|
- return var8 > 0 && Block.blocksList[var8].blockActivated(par2World, par4, par5, par6, par1EntityPlayer) ? true : (par3ItemStack == null ? false : par3ItemStack.useItem(par1EntityPlayer, par2World, par4, par5, par6, par7));
|
||||||
|
+ if (var8 > 0 && Block.blocksList[var8].blockActivated(par2World, par4, par5, par6, par1EntityPlayer))
|
||||||
|
+ {
|
||||||
+ return true;
|
+ return true;
|
||||||
}
|
+ }
|
||||||
|
+
|
||||||
|
+ if (par3ItemStack == null)
|
||||||
|
+ {
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (!par3ItemStack.useItem(par1EntityPlayer, par2World, par4, par5, par6, par7))
|
||||||
|
+ {
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (par3ItemStack.stackSize <= 0)
|
||||||
|
+ {
|
||||||
|
+ ForgeHooks.onDestroyCurrentItem(par1EntityPlayer, par3ItemStack);
|
||||||
|
+ }
|
||||||
|
+ return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean func_35642_f()
|
||||||
|
|
|
@ -7,81 +7,83 @@
|
||||||
-class RailLogic
|
-class RailLogic
|
||||||
+public class RailLogic
|
+public class RailLogic
|
||||||
{
|
{
|
||||||
|
/** Reference to the World object. */
|
||||||
private World worldObj;
|
private World worldObj;
|
||||||
private int trackX;
|
@@ -18,6 +18,7 @@
|
||||||
@@ -12,6 +12,7 @@
|
|
||||||
private final boolean isPoweredRail;
|
|
||||||
private List connectedTracks;
|
private List connectedTracks;
|
||||||
|
|
||||||
final BlockRail rail;
|
final BlockRail rail;
|
||||||
+ private final boolean canMakeSlopes;
|
+ private final boolean canMakeSlopes;
|
||||||
|
|
||||||
public RailLogic(BlockRail blockrail, World world, int i, int j, int k)
|
public RailLogic(BlockRail par1BlockRail, World par2World, int par3, int par4, int par5)
|
||||||
{
|
{
|
||||||
@@ -23,16 +24,12 @@
|
@@ -28,18 +29,12 @@
|
||||||
trackY = j;
|
this.trackY = par4;
|
||||||
trackZ = k;
|
this.trackZ = par5;
|
||||||
int l = world.getBlockId(i, j, k);
|
int var6 = par2World.getBlockId(par3, par4, par5);
|
||||||
- int i1 = world.getBlockMetadata(i, j, k);
|
- int var7 = par2World.getBlockMetadata(par3, par4, par5);
|
||||||
- if (BlockRail.isPoweredBlockRail((BlockRail)Block.blocksList[l]))
|
-
|
||||||
|
- if (BlockRail.isPoweredBlockRail((BlockRail)Block.blocksList[var6]))
|
||||||
- {
|
- {
|
||||||
- isPoweredRail = true;
|
- this.isPoweredRail = true;
|
||||||
- i1 &= -9;
|
- var7 &= -9;
|
||||||
- }
|
- }
|
||||||
- else
|
- else
|
||||||
- {
|
- {
|
||||||
- isPoweredRail = false;
|
- this.isPoweredRail = false;
|
||||||
- }
|
- }
|
||||||
|
-
|
||||||
+
|
+
|
||||||
+ BlockRail target = (BlockRail)Block.blocksList[l];
|
+ BlockRail target = (BlockRail)Block.blocksList[var6];
|
||||||
+ int i1 = target.getBasicRailMetadata(world, null, i, j, k);
|
+ int var7 = target.getBasicRailMetadata(par2World, null, par3, par4, par5);
|
||||||
+ isPoweredRail = !target.isFlexibleRail(world, i, j, k);
|
+ isPoweredRail = !target.isFlexibleRail(par2World, par3, par4, par5);
|
||||||
+ canMakeSlopes = target.canMakeSlopes(world, i, j, k);
|
+ canMakeSlopes = target.canMakeSlopes(par2World, par3, par4, par5);
|
||||||
+
|
+
|
||||||
setConnections(i1);
|
this.setConnections(var7);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,7 +240,7 @@
|
@@ -258,7 +253,7 @@
|
||||||
byte0 = 9;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
- if (byte0 == 0)
|
|
||||||
+ if (byte0 == 0 && canMakeSlopes)
|
|
||||||
{
|
|
||||||
if (BlockRail.isRailBlockAt(worldObj, trackX, trackY + 1, trackZ - 1))
|
|
||||||
{
|
|
||||||
@@ -254,7 +251,7 @@
|
|
||||||
byte0 = 5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- if (byte0 == 1)
|
|
||||||
+ if (byte0 == 1 && canMakeSlopes)
|
|
||||||
{
|
|
||||||
if (BlockRail.isRailBlockAt(worldObj, trackX + 1, trackY + 1, trackZ))
|
|
||||||
{
|
|
||||||
@@ -377,7 +374,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- if (byte0 == 0)
|
|
||||||
+ if (byte0 == 0 && canMakeSlopes)
|
|
||||||
{
|
|
||||||
if (BlockRail.isRailBlockAt(worldObj, trackX, trackY + 1, trackZ - 1))
|
|
||||||
{
|
|
||||||
@@ -388,7 +385,7 @@
|
|
||||||
byte0 = 5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- if (byte0 == 1)
|
|
||||||
+ if (byte0 == 1 && canMakeSlopes)
|
|
||||||
{
|
|
||||||
if (BlockRail.isRailBlockAt(worldObj, trackX + 1, trackY + 1, trackZ))
|
|
||||||
{
|
|
||||||
@@ -428,7 +425,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- static int getNAdjacentTracks(RailLogic raillogic)
|
- if (var6 == 0)
|
||||||
+ public static int getNAdjacentTracks(RailLogic raillogic)
|
+ if (var6 == 0 && canMakeSlopes)
|
||||||
|
{
|
||||||
|
if (BlockRail.isRailBlockAt(this.worldObj, this.trackX, this.trackY + 1, this.trackZ - 1))
|
||||||
|
{
|
||||||
|
@@ -271,7 +266,7 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (var6 == 1)
|
||||||
|
+ if (var6 == 1 && canMakeSlopes)
|
||||||
|
{
|
||||||
|
if (BlockRail.isRailBlockAt(this.worldObj, this.trackX + 1, this.trackY + 1, this.trackZ))
|
||||||
|
{
|
||||||
|
@@ -422,7 +417,7 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (var7 == 0)
|
||||||
|
+ if (var7 == 0 && canMakeSlopes)
|
||||||
|
{
|
||||||
|
if (BlockRail.isRailBlockAt(this.worldObj, this.trackX, this.trackY + 1, this.trackZ - 1))
|
||||||
|
{
|
||||||
|
@@ -435,7 +430,7 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (var7 == 1)
|
||||||
|
+ if (var7 == 1 && canMakeSlopes)
|
||||||
|
{
|
||||||
|
if (BlockRail.isRailBlockAt(this.worldObj, this.trackX + 1, this.trackY + 1, this.trackZ))
|
||||||
|
{
|
||||||
|
@@ -485,7 +480,7 @@
|
||||||
|
/**
|
||||||
|
* get number of adjacent tracks
|
||||||
|
*/
|
||||||
|
- static int getNAdjacentTracks(RailLogic par0RailLogic)
|
||||||
|
+ public static int getNAdjacentTracks(RailLogic par0RailLogic)
|
||||||
{
|
{
|
||||||
return raillogic.getAdjacentTracks();
|
return par0RailLogic.getAdjacentTracks();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,128 +1,128 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/RenderBlocks.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/RenderBlocks.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/RenderBlocks.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/RenderBlocks.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -1323,7 +1323,7 @@
|
@@ -1375,7 +1375,7 @@
|
||||||
double d2 = (float)j1 / 256F;
|
double var28;
|
||||||
double d3 = ((float)j1 + 15.99F) / 256F;
|
double var30;
|
||||||
float f = 1.4F;
|
|
||||||
- if (!blockAccess.isBlockNormalCube(i, j - 1, k) && !Block.fire.canBlockCatchFire(blockAccess, i, j - 1, k))
|
- if (!this.blockAccess.isBlockNormalCube(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 - 1, par4))
|
||||||
+ if (!blockAccess.isBlockNormalCube(i, j - 1, k) && !Block.fire.canBlockCatchFire(blockAccess, i, j - 1, k, 1))
|
+ if (!this.blockAccess.isBlockNormalCube(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 - 1, par4, 1))
|
||||||
{
|
{
|
||||||
float f1 = 0.2F;
|
float var36 = 0.2F;
|
||||||
float f2 = 0.0625F;
|
float var33 = 0.0625F;
|
||||||
@@ -1340,7 +1340,7 @@
|
@@ -1395,7 +1395,7 @@
|
||||||
d1 = d;
|
var9 = var18;
|
||||||
d = d4;
|
|
||||||
}
|
}
|
||||||
- if (Block.fire.canBlockCatchFire(blockAccess, i - 1, j, k))
|
|
||||||
+ if (Block.fire.canBlockCatchFire(blockAccess, i - 1, j, k, 5))
|
- if (Block.fire.canBlockCatchFire(this.blockAccess, par2 - 1, par3, par4))
|
||||||
|
+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2 - 1, par3, par4, 5))
|
||||||
{
|
{
|
||||||
tessellator.addVertexWithUV((float)i + f1, (float)j + f + f2, k + 1, d1, d2);
|
var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var33), (double)(par4 + 1), var11, var13);
|
||||||
tessellator.addVertexWithUV(i + 0, (float)(j + 0) + f2, k + 1, d1, d3);
|
var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var33), (double)(par4 + 1), var11, var15);
|
||||||
@@ -1351,7 +1351,7 @@
|
@@ -1407,7 +1407,7 @@
|
||||||
tessellator.addVertexWithUV(i + 0, (float)(j + 0) + f2, k + 1, d1, d3);
|
var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var33), (double)(par4 + 1), var11, var13);
|
||||||
tessellator.addVertexWithUV((float)i + f1, (float)j + f + f2, k + 1, d1, d2);
|
|
||||||
}
|
}
|
||||||
- if (Block.fire.canBlockCatchFire(blockAccess, i + 1, j, k))
|
|
||||||
+ if (Block.fire.canBlockCatchFire(blockAccess, i + 1, j, k, 4))
|
- if (Block.fire.canBlockCatchFire(this.blockAccess, par2 + 1, par3, par4))
|
||||||
|
+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2 + 1, par3, par4, 4))
|
||||||
{
|
{
|
||||||
tessellator.addVertexWithUV((float)(i + 1) - f1, (float)j + f + f2, k + 0, d, d2);
|
var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var33), (double)(par4 + 0), var9, var13);
|
||||||
tessellator.addVertexWithUV((i + 1) - 0, (float)(j + 0) + f2, k + 0, d, d3);
|
var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var33), (double)(par4 + 0), var9, var15);
|
||||||
@@ -1362,7 +1362,7 @@
|
@@ -1419,7 +1419,7 @@
|
||||||
tessellator.addVertexWithUV((i + 1) - 0, (float)(j + 0) + f2, k + 0, d, d3);
|
var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var33), (double)(par4 + 0), var9, var13);
|
||||||
tessellator.addVertexWithUV((float)(i + 1) - f1, (float)j + f + f2, k + 0, d, d2);
|
|
||||||
}
|
}
|
||||||
- if (Block.fire.canBlockCatchFire(blockAccess, i, j, k - 1))
|
|
||||||
+ if (Block.fire.canBlockCatchFire(blockAccess, i, j, k - 1, 3))
|
- if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 - 1))
|
||||||
|
+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 - 1, 3))
|
||||||
{
|
{
|
||||||
tessellator.addVertexWithUV(i + 0, (float)j + f + f2, (float)k + f1, d1, d2);
|
var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var33), (double)((float)par4 + var36), var11, var13);
|
||||||
tessellator.addVertexWithUV(i + 0, (float)(j + 0) + f2, k + 0, d1, d3);
|
var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var33), (double)(par4 + 0), var11, var15);
|
||||||
@@ -1373,7 +1373,7 @@
|
@@ -1431,7 +1431,7 @@
|
||||||
tessellator.addVertexWithUV(i + 0, (float)(j + 0) + f2, k + 0, d1, d3);
|
var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var33), (double)((float)par4 + var36), var11, var13);
|
||||||
tessellator.addVertexWithUV(i + 0, (float)j + f + f2, (float)k + f1, d1, d2);
|
|
||||||
}
|
}
|
||||||
- if (Block.fire.canBlockCatchFire(blockAccess, i, j, k + 1))
|
|
||||||
+ if (Block.fire.canBlockCatchFire(blockAccess, i, j, k + 1, 2))
|
- if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 + 1))
|
||||||
|
+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 + 1, 2))
|
||||||
{
|
{
|
||||||
tessellator.addVertexWithUV(i + 1, (float)j + f + f2, (float)(k + 1) - f1, d, d2);
|
var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var33), (double)((float)(par4 + 1) - var36), var9, var13);
|
||||||
tessellator.addVertexWithUV(i + 1, (float)(j + 0) + f2, (k + 1) - 0, d, d3);
|
var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var33), (double)(par4 + 1 - 0), var9, var15);
|
||||||
@@ -1384,7 +1384,7 @@
|
@@ -1443,7 +1443,7 @@
|
||||||
tessellator.addVertexWithUV(i + 1, (float)(j + 0) + f2, (k + 1) - 0, d, d3);
|
var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var33), (double)((float)(par4 + 1) - var36), var9, var13);
|
||||||
tessellator.addVertexWithUV(i + 1, (float)j + f + f2, (float)(k + 1) - f1, d, d2);
|
|
||||||
}
|
}
|
||||||
- if (Block.fire.canBlockCatchFire(blockAccess, i, j + 1, k))
|
|
||||||
+ if (Block.fire.canBlockCatchFire(blockAccess, i, j + 1, k, 0))
|
- if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 + 1, par4))
|
||||||
|
+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 + 1, par4, 0))
|
||||||
{
|
{
|
||||||
double d5 = (double)i + 0.5D + 0.5D;
|
var18 = (double)par2 + 0.5D + 0.5D;
|
||||||
double d7 = ((double)i + 0.5D) - 0.5D;
|
var20 = (double)par2 + 0.5D - 0.5D;
|
||||||
@@ -3324,7 +3324,7 @@
|
@@ -3601,7 +3601,7 @@
|
||||||
colorBlueTopRight *= f27;
|
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
|
||||||
int k2 = block.getBlockTexture(blockAccess, i, j, k, 2);
|
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
|
||||||
renderEastFace(block, i, j, k, k2);
|
|
||||||
- if (cfgGrassFix && k2 == 3 && overrideBlockTexture < 0)
|
- if (cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0)
|
||||||
+ if (Tessellator.instance.defaultTexture && cfgGrassFix && k2 == 3 && overrideBlockTexture < 0)
|
+ if (Tessellator.instance.defaultTexture && cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0)
|
||||||
{
|
{
|
||||||
colorRedTopLeft *= f;
|
this.colorRedTopLeft *= par5;
|
||||||
colorRedBottomLeft *= f;
|
this.colorRedBottomLeft *= par5;
|
||||||
@@ -3440,7 +3440,7 @@
|
@@ -3724,7 +3724,7 @@
|
||||||
colorBlueTopRight *= f28;
|
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3);
|
||||||
int l2 = block.getBlockTexture(blockAccess, i, j, k, 3);
|
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3));
|
||||||
renderWestFace(block, i, j, k, block.getBlockTexture(blockAccess, i, j, k, 3));
|
|
||||||
- if (cfgGrassFix && l2 == 3 && overrideBlockTexture < 0)
|
- if (cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0)
|
||||||
+ if (Tessellator.instance.defaultTexture && cfgGrassFix && l2 == 3 && overrideBlockTexture < 0)
|
+ if (Tessellator.instance.defaultTexture && cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0)
|
||||||
{
|
{
|
||||||
colorRedTopLeft *= f;
|
this.colorRedTopLeft *= par5;
|
||||||
colorRedBottomLeft *= f;
|
this.colorRedBottomLeft *= par5;
|
||||||
@@ -3556,7 +3556,7 @@
|
@@ -3847,7 +3847,7 @@
|
||||||
colorBlueTopRight *= f29;
|
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
|
||||||
int i3 = block.getBlockTexture(blockAccess, i, j, k, 4);
|
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
|
||||||
renderNorthFace(block, i, j, k, i3);
|
|
||||||
- if (cfgGrassFix && i3 == 3 && overrideBlockTexture < 0)
|
- if (cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0)
|
||||||
+ if (Tessellator.instance.defaultTexture && cfgGrassFix && i3 == 3 && overrideBlockTexture < 0)
|
+ if (Tessellator.instance.defaultTexture && cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0)
|
||||||
{
|
{
|
||||||
colorRedTopLeft *= f;
|
this.colorRedTopLeft *= par5;
|
||||||
colorRedBottomLeft *= f;
|
this.colorRedBottomLeft *= par5;
|
||||||
@@ -3672,7 +3672,7 @@
|
@@ -3970,7 +3970,7 @@
|
||||||
colorBlueTopRight *= f30;
|
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
|
||||||
int j3 = block.getBlockTexture(blockAccess, i, j, k, 5);
|
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
|
||||||
renderSouthFace(block, i, j, k, j3);
|
|
||||||
- if (cfgGrassFix && j3 == 3 && overrideBlockTexture < 0)
|
- if (cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0)
|
||||||
+ if (Tessellator.instance.defaultTexture && cfgGrassFix && j3 == 3 && overrideBlockTexture < 0)
|
+ if (Tessellator.instance.defaultTexture && cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0)
|
||||||
{
|
{
|
||||||
colorRedTopLeft *= f;
|
this.colorRedTopLeft *= par5;
|
||||||
colorRedBottomLeft *= f;
|
this.colorRedBottomLeft *= par5;
|
||||||
@@ -3765,7 +3765,7 @@
|
@@ -4082,7 +4082,7 @@
|
||||||
tessellator.setColorOpaque_F(f11, f14, f17);
|
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
|
||||||
int i1 = block.getBlockTexture(blockAccess, i, j, k, 2);
|
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
|
||||||
renderEastFace(block, i, j, k, i1);
|
|
||||||
- if (cfgGrassFix && i1 == 3 && overrideBlockTexture < 0)
|
- if (cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0)
|
||||||
+ if (Tessellator.instance.defaultTexture && cfgGrassFix && i1 == 3 && overrideBlockTexture < 0)
|
+ if (Tessellator.instance.defaultTexture && cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0)
|
||||||
{
|
{
|
||||||
tessellator.setColorOpaque_F(f11 * f, f14 * f1, f17 * f2);
|
var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7);
|
||||||
renderEastFace(block, i, j, k, 38);
|
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
|
||||||
@@ -3778,7 +3778,7 @@
|
@@ -4098,7 +4098,7 @@
|
||||||
tessellator.setColorOpaque_F(f11, f14, f17);
|
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3);
|
||||||
int j1 = block.getBlockTexture(blockAccess, i, j, k, 3);
|
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
|
||||||
renderWestFace(block, i, j, k, j1);
|
|
||||||
- if (cfgGrassFix && j1 == 3 && overrideBlockTexture < 0)
|
- if (cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0)
|
||||||
+ if (Tessellator.instance.defaultTexture && cfgGrassFix && j1 == 3 && overrideBlockTexture < 0)
|
+ if (Tessellator.instance.defaultTexture && cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0)
|
||||||
{
|
{
|
||||||
tessellator.setColorOpaque_F(f11 * f, f14 * f1, f17 * f2);
|
var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7);
|
||||||
renderWestFace(block, i, j, k, 38);
|
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
|
||||||
@@ -3791,7 +3791,7 @@
|
@@ -4114,7 +4114,7 @@
|
||||||
tessellator.setColorOpaque_F(f12, f15, f18);
|
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
|
||||||
int k1 = block.getBlockTexture(blockAccess, i, j, k, 4);
|
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
|
||||||
renderNorthFace(block, i, j, k, k1);
|
|
||||||
- if (cfgGrassFix && k1 == 3 && overrideBlockTexture < 0)
|
- if (cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0)
|
||||||
+ if (Tessellator.instance.defaultTexture && cfgGrassFix && k1 == 3 && overrideBlockTexture < 0)
|
+ if (Tessellator.instance.defaultTexture && cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0)
|
||||||
{
|
{
|
||||||
tessellator.setColorOpaque_F(f12 * f, f15 * f1, f18 * f2);
|
var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7);
|
||||||
renderNorthFace(block, i, j, k, 38);
|
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
|
||||||
@@ -3804,7 +3804,7 @@
|
@@ -4130,7 +4130,7 @@
|
||||||
tessellator.setColorOpaque_F(f12, f15, f18);
|
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
|
||||||
int l1 = block.getBlockTexture(blockAccess, i, j, k, 5);
|
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
|
||||||
renderSouthFace(block, i, j, k, l1);
|
|
||||||
- if (cfgGrassFix && l1 == 3 && overrideBlockTexture < 0)
|
- if (cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0)
|
||||||
+ if (Tessellator.instance.defaultTexture && cfgGrassFix && l1 == 3 && overrideBlockTexture < 0)
|
+ if (Tessellator.instance.defaultTexture && cfgGrassFix && var27 == 3 && this.overrideBlockTexture < 0)
|
||||||
{
|
{
|
||||||
tessellator.setColorOpaque_F(f12 * f, f15 * f1, f18 * f2);
|
var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7);
|
||||||
renderSouthFace(block, i, j, k, 38);
|
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/RenderEngine.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/RenderEngine.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/RenderEngine.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/RenderEngine.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -30,7 +30,7 @@
|
@@ -48,7 +48,7 @@
|
||||||
private GameSettings options;
|
public boolean blurTexture = false;
|
||||||
public boolean clampTexture;
|
|
||||||
public boolean blurTexture;
|
/** Texture pack */
|
||||||
- private TexturePackList texturePack;
|
- private TexturePackList texturePack;
|
||||||
+ public TexturePackList texturePack;
|
+ public TexturePackList texturePack;
|
||||||
private BufferedImage missingTextureImage;
|
|
||||||
|
|
||||||
public RenderEngine(TexturePackList texturepacklist, GameSettings gamesettings)
|
/** Missing texture image */
|
||||||
@@ -135,6 +135,10 @@
|
private BufferedImage missingTextureImage = new BufferedImage(64, 64, 2);
|
||||||
}
|
@@ -156,6 +156,10 @@
|
||||||
try
|
|
||||||
{
|
{
|
||||||
+ if(Tessellator.renderingWorldRenderer)
|
try
|
||||||
+ {
|
{
|
||||||
+ System.out.printf("Warning: Texture %s not preloaded, will cause render glitches!\n", s);
|
+ if (Tessellator.renderingWorldRenderer)
|
||||||
+ }
|
+ {
|
||||||
singleIntBuffer.clear();
|
+ System.out.printf("Warning: Texture %s not preloaded, will cause render glitches!\n", par1Str);
|
||||||
GLAllocation.generateTextureNames(singleIntBuffer);
|
+ }
|
||||||
int i = singleIntBuffer.get(0);
|
this.singleIntBuffer.clear();
|
||||||
|
GLAllocation.generateTextureNames(this.singleIntBuffer);
|
||||||
|
int var6 = this.singleIntBuffer.get(0);
|
||||||
|
|
|
@ -1,24 +1,28 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/RenderGlobal.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/RenderGlobal.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/RenderGlobal.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/RenderGlobal.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -10,8 +10,8 @@
|
@@ -15,10 +15,10 @@
|
||||||
implements IWorldAccess
|
public List tileEntities = new ArrayList();
|
||||||
{
|
|
||||||
public List tileEntities;
|
/** A reference to the World object. */
|
||||||
- private World worldObj;
|
- private World worldObj;
|
||||||
- private RenderEngine renderEngine;
|
|
||||||
+ public World worldObj;
|
+ public World worldObj;
|
||||||
|
|
||||||
|
/** The RenderEngine instance used by RenderGlobal */
|
||||||
|
- private RenderEngine renderEngine;
|
||||||
+ public RenderEngine renderEngine;
|
+ public RenderEngine renderEngine;
|
||||||
private List worldRenderersToUpdate;
|
private List worldRenderersToUpdate = new ArrayList();
|
||||||
private WorldRenderer sortedWorldRenderers[];
|
private WorldRenderer[] sortedWorldRenderers;
|
||||||
private WorldRenderer worldRenderers[];
|
private WorldRenderer[] worldRenderers;
|
||||||
@@ -19,8 +19,8 @@
|
@@ -30,10 +30,10 @@
|
||||||
private int renderChunksTall;
|
|
||||||
private int renderChunksDeep;
|
|
||||||
private int glRenderListBase;
|
private int glRenderListBase;
|
||||||
|
|
||||||
|
/** A reference to the Minecraft object. */
|
||||||
- private Minecraft mc;
|
- private Minecraft mc;
|
||||||
- private RenderBlocks globalRenderBlocks;
|
|
||||||
+ public Minecraft mc;
|
+ public Minecraft mc;
|
||||||
|
|
||||||
|
/** Global render blocks */
|
||||||
|
- private RenderBlocks globalRenderBlocks;
|
||||||
+ public RenderBlocks globalRenderBlocks;
|
+ public RenderBlocks globalRenderBlocks;
|
||||||
|
|
||||||
|
/** OpenGL occlusion query base */
|
||||||
private IntBuffer glOcclusionQueryBase;
|
private IntBuffer glOcclusionQueryBase;
|
||||||
private boolean occlusionEnabled;
|
|
||||||
private int cloudOffsetX;
|
|
||||||
|
|
|
@ -10,133 +10,125 @@
|
||||||
+import net.minecraft.src.forge.MinecraftForgeClient;
|
+import net.minecraft.src.forge.MinecraftForgeClient;
|
||||||
+
|
+
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import org.lwjgl.opengl.GL12;
|
||||||
|
|
||||||
public class RenderItem extends Render
|
@@ -54,11 +59,31 @@
|
||||||
@@ -43,10 +48,33 @@
|
float var19;
|
||||||
}
|
float var18;
|
||||||
GL11.glTranslatef((float)d, (float)d1 + f2, (float)d2);
|
float var23;
|
||||||
GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/);
|
-
|
||||||
- if (itemstack.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
- if (var10.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var10.itemID].getRenderType()))
|
||||||
+ ICustomItemRenderer customRenderer = MinecraftForgeClient.getCustomItemRenderer(itemstack.itemID);
|
|
||||||
+
|
+
|
||||||
|
+ ICustomItemRenderer customRenderer = MinecraftForgeClient.getCustomItemRenderer(var10.itemID);
|
||||||
+ if (customRenderer != null)
|
+ if (customRenderer != null)
|
||||||
+ {
|
+ {
|
||||||
+ GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
|
+ GL11.glRotatef(var12, 0.0F, 1.0F, 0.0F);
|
||||||
+ loadTexture(ForgeHooksClient.getTexture("/terrain.png", itemstack.getItem()));
|
+ loadTexture(ForgeHooksClient.getTexture("/terrain.png", var10.getItem()));
|
||||||
+ float f4 = 0.25F;
|
+ GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||||
+ f4 = 0.5F;
|
+ for(int j = 0; j < var13; j++)
|
||||||
+ GL11.glScalef(f4, f4, f4);
|
|
||||||
+ for(int j = 0; j < byte0; j++)
|
|
||||||
+ {
|
+ {
|
||||||
+ GL11.glPushMatrix();
|
+ GL11.glPushMatrix();
|
||||||
+ if(j > 0)
|
+ if (j > 0)
|
||||||
+ {
|
+ {
|
||||||
+ float f5 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / f4;
|
+ GL11.glTranslatef(
|
||||||
+ float f7 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / f4;
|
+ ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / 0.5F,
|
||||||
+ float f9 = ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / f4;
|
+ ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / 0.5F,
|
||||||
+ GL11.glTranslatef(f5, f7, f9);
|
+ ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / 0.5F);
|
||||||
+ }
|
+ }
|
||||||
+ ForgeHooksClient.renderCustomItem(customRenderer, renderBlocks, itemstack.itemID, itemstack.getItemDamage(), entityitem.getEntityBrightness(f1));
|
+ ForgeHooksClient.renderCustomItem(customRenderer, renderBlocks, var10.itemID, var10.getItemDamage(), par1EntityItem.getEntityBrightness(par9));
|
||||||
+ GL11.glPopMatrix();
|
+ GL11.glPopMatrix();
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ else if (itemstack.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
+ else if (var10.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var10.itemID].getRenderType()))
|
||||||
{
|
{
|
||||||
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
|
GL11.glRotatef(var12, 0.0F, 1.0F, 0.0F);
|
||||||
- loadTexture("/terrain.png");
|
- this.loadTexture("/terrain.png");
|
||||||
+ loadTexture(ForgeHooksClient.getTexture("/terrain.png", Block.blocksList[itemstack.itemID]));
|
+ this.loadTexture(ForgeHooksClient.getTexture("/terrain.png", Block.blocksList[var10.itemID]));
|
||||||
float f4 = 0.25F;
|
float var21 = 0.25F;
|
||||||
int k = Block.blocksList[itemstack.itemID].getRenderType();
|
var15 = Block.blocksList[var10.itemID].getRenderType();
|
||||||
if (k == 1 || k == 19 || k == 12 || k == 2)
|
|
||||||
@@ -72,7 +100,7 @@
|
|
||||||
else if (itemstack.getItem().func_46058_c())
|
|
||||||
{
|
|
||||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
|
||||||
- loadTexture("/gui/items.png");
|
|
||||||
+ loadTexture(ForgeHooksClient.getTexture("/gui/items.png", Item.itemsList[itemstack.itemID]));
|
|
||||||
for (int i = 0; i <= 1; i++)
|
|
||||||
{
|
|
||||||
int l = itemstack.getItem().func_46057_a(itemstack.getItemDamage(), i);
|
|
||||||
@@ -94,11 +122,11 @@
|
|
||||||
int j = itemstack.getIconIndex();
|
|
||||||
if (itemstack.itemID < 256)
|
|
||||||
{
|
|
||||||
- loadTexture("/terrain.png");
|
|
||||||
+ loadTexture(ForgeHooksClient.getTexture("/terrain.png", Block.blocksList[itemstack.itemID]));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
- loadTexture("/gui/items.png");
|
|
||||||
+ loadTexture(ForgeHooksClient.getTexture("/gui/items.png", Item.itemsList[itemstack.itemID]));
|
|
||||||
}
|
|
||||||
if (field_27004_a)
|
|
||||||
{
|
|
||||||
@@ -149,10 +177,39 @@
|
|
||||||
|
|
||||||
public void drawItemIntoGui(FontRenderer fontrenderer, RenderEngine renderengine, int i, int j, int k, int l, int i1)
|
@@ -94,7 +119,7 @@
|
||||||
{
|
if (var10.getItem().func_46058_c())
|
||||||
- if (i < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[i].getRenderType()))
|
|
||||||
+ ICustomItemRenderer customRenderer = MinecraftForgeClient.getCustomItemRenderer(i);
|
|
||||||
+ if (customRenderer != null)
|
|
||||||
+ {
|
|
||||||
+ int j1 = i;
|
|
||||||
+ String tex = ForgeHooksClient.getTexture("/terrain.png", Item.itemsList[i]);
|
|
||||||
+ renderengine.bindTexture(renderengine.getTexture(tex));
|
|
||||||
+ Item item = Item.itemsList[i];
|
|
||||||
+ GL11.glPushMatrix();
|
|
||||||
+ GL11.glTranslatef(l - 2, i1 + 3, -3F + zLevel);
|
|
||||||
+ GL11.glScalef(10F, 10F, 10F);
|
|
||||||
+ GL11.glTranslatef(1.0F, 0.5F, 1.0F);
|
|
||||||
+ GL11.glScalef(1.0F, 1.0F, -1F);
|
|
||||||
+ GL11.glRotatef(210F, 1.0F, 0.0F, 0.0F);
|
|
||||||
+ GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);
|
|
||||||
+ int l1 = Item.itemsList[i].getColorFromDamage(j, 0);
|
|
||||||
+ float f2 = (float)(l1 >> 16 & 0xff) / 255F;
|
|
||||||
+ float f4 = (float)(l1 >> 8 & 0xff) / 255F;
|
|
||||||
+ float f5 = (float)(l1 & 0xff) / 255F;
|
|
||||||
+ if(field_27004_a)
|
|
||||||
+ {
|
|
||||||
+ GL11.glColor4f(f2, f4, f5, 1.0F);
|
|
||||||
+ }
|
|
||||||
+ GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);
|
|
||||||
+ renderBlocks.useInventoryTint = field_27004_a;
|
|
||||||
+ ForgeHooksClient.renderCustomItem(customRenderer, renderBlocks, i, j, 1.0F);
|
|
||||||
+ renderBlocks.useInventoryTint = true;
|
|
||||||
+ GL11.glPopMatrix();
|
|
||||||
+ }
|
|
||||||
+ else if(i < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[i].getRenderType()))
|
|
||||||
{
|
|
||||||
int j1 = i;
|
|
||||||
- renderengine.bindTexture(renderengine.getTexture("/terrain.png"));
|
|
||||||
+ String tex = ForgeHooksClient.getTexture("/terrain.png", Block.blocksList[i]);
|
|
||||||
+ renderengine.bindTexture(renderengine.getTexture(tex));
|
|
||||||
Block block = Block.blocksList[j1];
|
|
||||||
GL11.glPushMatrix();
|
|
||||||
GL11.glTranslatef(l - 2, i1 + 3, -3F + zLevel);
|
|
||||||
@@ -178,7 +235,8 @@
|
|
||||||
else if (Item.itemsList[i].func_46058_c())
|
|
||||||
{
|
|
||||||
GL11.glDisable(2896 /*GL_LIGHTING*/);
|
|
||||||
- renderengine.bindTexture(renderengine.getTexture("/gui/items.png"));
|
|
||||||
+ String tex = ForgeHooksClient.getTexture("/gui/items.png", Item.itemsList[i]);
|
|
||||||
+ renderengine.bindTexture(renderengine.getTexture(tex));
|
|
||||||
for (int k1 = 0; k1 <= 1; k1++)
|
|
||||||
{
|
{
|
||||||
int i2 = Item.itemsList[i].func_46057_a(j, k1);
|
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||||
@@ -200,11 +258,13 @@
|
- this.loadTexture("/gui/items.png");
|
||||||
GL11.glDisable(2896 /*GL_LIGHTING*/);
|
+ this.loadTexture(ForgeHooksClient.getTexture("/gui/items.png", Item.itemsList[var10.itemID]));
|
||||||
if (i < 256)
|
|
||||||
{
|
for (var14 = 0; var14 <= 1; ++var14)
|
||||||
- renderengine.bindTexture(renderengine.getTexture("/terrain.png"));
|
{
|
||||||
- }
|
@@ -120,11 +145,11 @@
|
||||||
+ String tex = ForgeHooksClient.getTexture("/terrain.png", Block.blocksList[i]);
|
|
||||||
+ renderengine.bindTexture(renderengine.getTexture(tex));
|
if (var10.itemID < 256)
|
||||||
|
{
|
||||||
|
- this.loadTexture("/terrain.png");
|
||||||
|
+ this.loadTexture(ForgeHooksClient.getTexture("/terrain.png", Block.blocksList[var10.itemID]));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
- this.loadTexture("/gui/items.png");
|
||||||
|
+ this.loadTexture(ForgeHooksClient.getTexture("/gui/items.png", Item.itemsList[var10.itemID]));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.field_27004_a)
|
||||||
|
@@ -186,10 +211,35 @@
|
||||||
|
float var11;
|
||||||
|
float var12;
|
||||||
|
float var13;
|
||||||
|
-
|
||||||
|
- if (par3 < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[par3].getRenderType()))
|
||||||
|
+
|
||||||
|
+ ICustomItemRenderer customRenderer = MinecraftForgeClient.getCustomItemRenderer(par3);
|
||||||
|
+ if (customRenderer != null)
|
||||||
|
+ {
|
||||||
|
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(ForgeHooksClient.getTexture("/terrain.png", Item.itemsList[par3])));
|
||||||
|
+ GL11.glPushMatrix();
|
||||||
|
+ GL11.glTranslatef(par4 - 2, par7 + 3, -3F + zLevel);
|
||||||
|
+ GL11.glScalef(10F, 10F, 10F);
|
||||||
|
+ GL11.glTranslatef(1.0F, 0.5F, 1.0F);
|
||||||
|
+ GL11.glScalef(1.0F, 1.0F, -1F);
|
||||||
|
+ GL11.glRotatef(210F, 1.0F, 0.0F, 0.0F);
|
||||||
|
+ GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F);
|
||||||
|
+ int l1 = Item.itemsList[par3].getColorFromDamage(par4, 0);
|
||||||
|
+ float f2 = (float)(l1 >> 16 & 0xff) / 255F;
|
||||||
|
+ float f4 = (float)(l1 >> 8 & 0xff) / 255F;
|
||||||
|
+ float f5 = (float)(l1 & 0xff) / 255F;
|
||||||
|
+ if(field_27004_a)
|
||||||
|
+ {
|
||||||
|
+ GL11.glColor4f(f2, f4, f5, 1.0F);
|
||||||
+ }
|
+ }
|
||||||
else
|
+ GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);
|
||||||
|
+ renderBlocks.useInventoryTint = field_27004_a;
|
||||||
|
+ ForgeHooksClient.renderCustomItem(customRenderer, renderBlocks, par3, par4, 1.0F);
|
||||||
|
+ renderBlocks.useInventoryTint = true;
|
||||||
|
+ GL11.glPopMatrix();
|
||||||
|
+ }
|
||||||
|
+ else if (par3 < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[par3].getRenderType()))
|
||||||
|
{
|
||||||
|
- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/terrain.png"));
|
||||||
|
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(ForgeHooksClient.getTexture("/terrain.png", Block.blocksList[par3])));
|
||||||
|
Block var15 = Block.blocksList[par3];
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslatef((float)(par6 - 2), (float)(par7 + 3), -3.0F + this.zLevel);
|
||||||
|
@@ -221,7 +271,7 @@
|
||||||
|
if (Item.itemsList[par3].func_46058_c())
|
||||||
{
|
{
|
||||||
- renderengine.bindTexture(renderengine.getTexture("/gui/items.png"));
|
GL11.glDisable(GL11.GL_LIGHTING);
|
||||||
+ String tex = ForgeHooksClient.getTexture("/gui/items.png", Item.itemsList[i]);
|
- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/gui/items.png"));
|
||||||
+ renderengine.bindTexture(renderengine.getTexture(tex));
|
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(ForgeHooksClient.getTexture("/gui/items.png", Item.itemsList[par3])));
|
||||||
}
|
|
||||||
int l1 = Item.itemsList[i].getColorFromDamage(j, 0);
|
for (var8 = 0; var8 <= 1; ++var8)
|
||||||
float f = (float)(l1 >> 16 & 0xff) / 255F;
|
{
|
||||||
|
@@ -247,11 +297,11 @@
|
||||||
|
|
||||||
|
if (par3 < 256)
|
||||||
|
{
|
||||||
|
- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/terrain.png"));
|
||||||
|
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(ForgeHooksClient.getTexture("/terrain.png", Block.blocksList[par3])));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/gui/items.png"));
|
||||||
|
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(ForgeHooksClient.getTexture("/gui/items.png", Item.itemsList[par3])));
|
||||||
|
}
|
||||||
|
|
||||||
|
var8 = Item.itemsList[par3].getColorFromDamage(par4, 0);
|
||||||
|
|
|
@ -8,19 +8,19 @@
|
||||||
|
|
||||||
public class RenderPlayer extends RenderLiving
|
public class RenderPlayer extends RenderLiving
|
||||||
{
|
{
|
||||||
@@ -30,7 +31,14 @@
|
@@ -32,7 +33,14 @@
|
||||||
if (item instanceof ItemArmor)
|
if (var5 instanceof ItemArmor)
|
||||||
{
|
{
|
||||||
ItemArmor itemarmor = (ItemArmor)item;
|
ItemArmor var6 = (ItemArmor)var5;
|
||||||
- loadTexture((new StringBuilder()).append("/armor/").append(armorFilenamePrefix[itemarmor.renderIndex]).append("_").append(i != 2 ? 1 : 2).append(".png").toString());
|
- this.loadTexture("/armor/" + armorFilenamePrefix[var6.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png");
|
||||||
+ if (item instanceof IArmorTextureProvider)
|
+ if (var5 instanceof IArmorTextureProvider)
|
||||||
+ {
|
+ {
|
||||||
+ loadTexture( ((IArmorTextureProvider)item).getArmorTextureFile(itemstack) );
|
+ loadTexture(((IArmorTextureProvider)var5).getArmorTextureFile(var4));
|
||||||
+ }
|
+ }
|
||||||
+ else
|
+ else
|
||||||
+ {
|
+ {
|
||||||
+ loadTexture((new StringBuilder()).append("/armor/").append(armorFilenamePrefix[itemarmor.renderIndex]).append("_").append(i != 2 ? 1 : 2).append(".png").toString());
|
+ this.loadTexture("/armor/" + armorFilenamePrefix[var6.renderIndex] + "_" + (par2 == 2 ? 2 : 1) + ".png");
|
||||||
+ }
|
+ }
|
||||||
ModelBiped modelbiped = i != 2 ? modelArmorChestplate : modelArmor;
|
ModelBiped var7 = par2 == 2 ? this.modelArmor : this.modelArmorChestplate;
|
||||||
modelbiped.bipedHead.showModel = i == 0;
|
var7.bipedHead.showModel = par2 == 0;
|
||||||
modelbiped.bipedHeadwear.showModel = i == 0;
|
var7.bipedHeadwear.showModel = par2 == 0;
|
||||||
|
|
|
@ -7,12 +7,12 @@
|
||||||
+
|
+
|
||||||
public class SlotCrafting extends Slot
|
public class SlotCrafting extends Slot
|
||||||
{
|
{
|
||||||
private final IInventory craftMatrix;
|
/** The craft matrix inventory linked to this result slot. */
|
||||||
@@ -61,6 +63,7 @@
|
@@ -91,6 +93,7 @@
|
||||||
thePlayer.addStat(AchievementList.bookcase, 1);
|
|
||||||
}
|
}
|
||||||
ModLoader.TakenFromCrafting(thePlayer, itemstack, craftMatrix);
|
|
||||||
+ ForgeHooks.onTakenFromCrafting(thePlayer, itemstack, craftMatrix);
|
ModLoader.takenFromCrafting(this.thePlayer, par1ItemStack, this.craftMatrix);
|
||||||
for (int i = 0; i < craftMatrix.getSizeInventory(); i++)
|
+ ForgeHooks.onTakenFromCrafting(thePlayer, par1ItemStack, craftMatrix);
|
||||||
{
|
}
|
||||||
ItemStack itemstack1 = craftMatrix.getStackInSlot(i);
|
|
||||||
|
/**
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
--- ../src_base/minecraft/net/minecraft/src/SpawnerAnimals.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
|
+++ ../src_work/minecraft/net/minecraft/src/SpawnerAnimals.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
|
@@ -202,7 +202,8 @@
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int var5 = par1World.getBlockId(par2, par3 - 1, par4);
|
||||||
|
- return Block.func_48206_g(var5) && var5 != Block.bedrock.blockID && !par1World.isBlockNormalCube(par2, par3, par4) && !par1World.getBlockMaterial(par2, par3, par4).isLiquid() && !par1World.isBlockNormalCube(par2, par3 + 1, par4);
|
||||||
|
+ //Fix for 1.2.3 change.. Why guys.. why?
|
||||||
|
+ return par1World.isBlockNormalCube(par2, par3, par4) && var5 != Block.bedrock.blockID && !par1World.isBlockNormalCube(par2, par3, par4) && !par1World.getBlockMaterial(par2, par3, par4).isLiquid() && !par1World.isBlockNormalCube(par2, par3 + 1, par4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,192 +1,218 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/Tessellator.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/Tessellator.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/Tessellator.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/Tessellator.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -1,16 +1,14 @@
|
@@ -5,12 +5,19 @@
|
||||||
package net.minecraft.src;
|
import java.nio.FloatBuffer;
|
||||||
|
import java.nio.IntBuffer;
|
||||||
import java.nio.*;
|
import java.nio.ShortBuffer;
|
||||||
+import java.util.*;
|
+import java.util.Arrays;
|
||||||
import org.lwjgl.opengl.*;
|
+
|
||||||
|
import org.lwjgl.opengl.ARBVertexBufferObject;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import org.lwjgl.opengl.GLContext;
|
||||||
|
|
||||||
public class Tessellator
|
public class Tessellator
|
||||||
{
|
{
|
||||||
private static boolean convertQuadsToTriangles = false;
|
+ private static int nativeBufferSize = 0x200000;
|
||||||
|
+ private static int trivertsInBuffer = (nativeBufferSize / 48) * 6;
|
||||||
|
+ public static boolean renderingWorldRenderer = false;
|
||||||
|
+ public boolean defaultTexture = true;
|
||||||
|
+ private int rawBufferSize = 0;
|
||||||
|
/**
|
||||||
|
* Boolean used to check whether quads should be drawn as four triangles. Initialized to true and never changed.
|
||||||
|
*/
|
||||||
|
@@ -22,16 +29,16 @@
|
||||||
private static boolean tryVBO = false;
|
private static boolean tryVBO = false;
|
||||||
|
|
||||||
|
/** The byte buffer used for GL allocation. */
|
||||||
- private ByteBuffer byteBuffer;
|
- private ByteBuffer byteBuffer;
|
||||||
|
+ private static ByteBuffer byteBuffer = GLAllocation.createDirectByteBuffer(nativeBufferSize * 4);
|
||||||
|
|
||||||
|
/** The same memory as byteBuffer, but referenced as an integer buffer. */
|
||||||
- private IntBuffer intBuffer;
|
- private IntBuffer intBuffer;
|
||||||
|
+ private static IntBuffer intBuffer = byteBuffer.asIntBuffer();
|
||||||
|
|
||||||
|
/** The same memory as byteBuffer, but referenced as an float buffer. */
|
||||||
- private FloatBuffer floatBuffer;
|
- private FloatBuffer floatBuffer;
|
||||||
|
+ private static FloatBuffer floatBuffer = byteBuffer.asFloatBuffer();
|
||||||
|
|
||||||
|
/** Short buffer */
|
||||||
- private ShortBuffer shortBuffer;
|
- private ShortBuffer shortBuffer;
|
||||||
+ private static boolean useVBO = false;
|
+ private static ShortBuffer shortBuffer = byteBuffer.asShortBuffer();
|
||||||
private int rawBuffer[];
|
|
||||||
private int vertexCount;
|
/** Raw integer array. */
|
||||||
private double textureU;
|
private int[] rawBuffer;
|
||||||
@@ -24,21 +22,47 @@
|
@@ -80,37 +87,37 @@
|
||||||
private int rawBufferIndex;
|
private boolean isColorDisabled = false;
|
||||||
private int addedVertices;
|
|
||||||
private boolean isColorDisabled;
|
/** The draw mode currently being used by the tessellator. */
|
||||||
- private int drawMode;
|
- private int drawMode;
|
||||||
- private double xOffset;
|
|
||||||
- private double yOffset;
|
|
||||||
- private double zOffset;
|
|
||||||
+ public int drawMode;
|
+ public int drawMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An offset to be applied along the x-axis for all vertices in this draw call.
|
||||||
|
*/
|
||||||
|
- private double xOffset;
|
||||||
+ public double xOffset;
|
+ public double xOffset;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An offset to be applied along the y-axis for all vertices in this draw call.
|
||||||
|
*/
|
||||||
|
- private double yOffset;
|
||||||
+ public double yOffset;
|
+ public double yOffset;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An offset to be applied along the z-axis for all vertices in this draw call.
|
||||||
|
*/
|
||||||
|
- private double zOffset;
|
||||||
+ public double zOffset;
|
+ public double zOffset;
|
||||||
|
|
||||||
|
/** The normal to be applied to the face being drawn. */
|
||||||
private int normal;
|
private int normal;
|
||||||
- public static final Tessellator instance = new Tessellator(0x200000);
|
|
||||||
- private boolean isDrawing;
|
/** The static instance of the Tessellator. */
|
||||||
- private boolean useVBO;
|
- public static final Tessellator instance = new Tessellator(2097152);
|
||||||
|
+ public static Tessellator instance = new Tessellator();
|
||||||
|
|
||||||
|
/** Whether this tessellator is currently in draw mode. */
|
||||||
|
- private boolean isDrawing = false;
|
||||||
|
+ public boolean isDrawing = false;
|
||||||
|
|
||||||
|
/** Whether we are currently using VBO or not. */
|
||||||
|
- private boolean useVBO = false;
|
||||||
|
+ private static boolean useVBO = false;
|
||||||
|
|
||||||
|
/** An IntBuffer used to store the indices of vertex buffer objects. */
|
||||||
- private IntBuffer vertexBuffers;
|
- private IntBuffer vertexBuffers;
|
||||||
+ public boolean isDrawing;
|
|
||||||
private int vboIndex;
|
|
||||||
- private int vboCount;
|
|
||||||
- private int bufferSize;
|
|
||||||
+
|
|
||||||
+ public static boolean renderingWorldRenderer=false;
|
|
||||||
+ public boolean defaultTexture=false;
|
|
||||||
+ private int rawBufferSize;
|
|
||||||
+ private static int vboCount;
|
|
||||||
+ private static IntBuffer vertexBuffers;
|
+ private static IntBuffer vertexBuffers;
|
||||||
+ private static int nativeBufferSize;
|
|
||||||
+ private static int trivertsInBuffer;
|
/**
|
||||||
+ private static ByteBuffer byteBuffer;
|
* The index of the last VBO used. This is used in round-robin fashion, sequentially, through the vboCount vertex
|
||||||
+ private static IntBuffer intBuffer;
|
@@ -119,27 +126,23 @@
|
||||||
+ private static FloatBuffer floatBuffer;
|
private int vboIndex = 0;
|
||||||
+ private static ShortBuffer shortBuffer;
|
|
||||||
+ public static Tessellator instance;
|
/** Number of vertex buffer objects allocated for use. */
|
||||||
+
|
- private int vboCount = 10;
|
||||||
+ static {
|
-
|
||||||
+ instance = new Tessellator();
|
- /** The size of the buffers used (in integers). */
|
||||||
+ instance.defaultTexture = true;
|
- private int bufferSize;
|
||||||
+
|
+ private static int vboCount = 10;
|
||||||
+ nativeBufferSize = 0x200000;
|
|
||||||
+ trivertsInBuffer = (nativeBufferSize / 48) * 6;
|
- private Tessellator(int par1)
|
||||||
+ byteBuffer = GLAllocation.createDirectByteBuffer(nativeBufferSize * 4);
|
+ static
|
||||||
+ intBuffer = byteBuffer.asIntBuffer();
|
{
|
||||||
+ floatBuffer = byteBuffer.asFloatBuffer();
|
- this.bufferSize = par1;
|
||||||
+ shortBuffer = byteBuffer.asShortBuffer();
|
- this.byteBuffer = GLAllocation.createDirectByteBuffer(par1 * 4);
|
||||||
|
- this.intBuffer = this.byteBuffer.asIntBuffer();
|
||||||
|
- this.floatBuffer = this.byteBuffer.asFloatBuffer();
|
||||||
|
- this.shortBuffer = this.byteBuffer.asShortBuffer();
|
||||||
|
- this.rawBuffer = new int[par1];
|
||||||
|
- this.useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object;
|
||||||
|
-
|
||||||
|
- if (this.useVBO)
|
||||||
+ useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object;
|
+ useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object;
|
||||||
+ vboCount = 10;
|
+ if (useVBO)
|
||||||
+ if(useVBO)
|
{
|
||||||
+ {
|
- this.vertexBuffers = GLAllocation.createDirectIntBuffer(this.vboCount);
|
||||||
|
- ARBVertexBufferObject.glGenBuffersARB(this.vertexBuffers);
|
||||||
+ vertexBuffers = GLAllocation.createDirectIntBuffer(vboCount);
|
+ vertexBuffers = GLAllocation.createDirectIntBuffer(vboCount);
|
||||||
+ ARBVertexBufferObject.glGenBuffersARB(vertexBuffers);
|
+ ARBVertexBufferObject.glGenBuffersARB(vertexBuffers);
|
||||||
+ }
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ public Tessellator()
|
||||||
|
+ {
|
||||||
|
+ this.rawBuffer = null;
|
||||||
|
+ defaultTexture = false;
|
||||||
+ }
|
+ }
|
||||||
|
|
||||||
- private Tessellator(int i)
|
/**
|
||||||
- {
|
* Draws the data set up in this tessellator and resets the state to prepare for new drawing.
|
||||||
+ public Tessellator() {
|
@@ -154,12 +157,23 @@
|
||||||
vertexCount = 0;
|
|
||||||
hasColor = false;
|
|
||||||
hasTexture = false;
|
|
||||||
@@ -48,21 +72,9 @@
|
|
||||||
addedVertices = 0;
|
|
||||||
isColorDisabled = false;
|
|
||||||
isDrawing = false;
|
|
||||||
- useVBO = false;
|
|
||||||
vboIndex = 0;
|
|
||||||
- vboCount = 10;
|
|
||||||
- bufferSize = i;
|
|
||||||
- byteBuffer = GLAllocation.createDirectByteBuffer(i * 4);
|
|
||||||
- intBuffer = byteBuffer.asIntBuffer();
|
|
||||||
- floatBuffer = byteBuffer.asFloatBuffer();
|
|
||||||
- shortBuffer = byteBuffer.asShortBuffer();
|
|
||||||
- rawBuffer = new int[i];
|
|
||||||
- useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object;
|
|
||||||
- if (useVBO)
|
|
||||||
- {
|
|
||||||
- vertexBuffers = GLAllocation.createDirectIntBuffer(vboCount);
|
|
||||||
- ARBVertexBufferObject.glGenBuffersARB(vertexBuffers);
|
|
||||||
- }
|
|
||||||
+ rawBuffer = null;
|
|
||||||
+ rawBufferSize = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int draw()
|
|
||||||
@@ -72,12 +84,25 @@
|
|
||||||
throw new IllegalStateException("Not tesselating!");
|
|
||||||
}
|
|
||||||
isDrawing = false;
|
|
||||||
- if (vertexCount > 0)
|
|
||||||
+ int offs = 0;
|
|
||||||
+ while (offs < vertexCount)
|
|
||||||
{
|
{
|
||||||
+ int vtc;
|
this.isDrawing = false;
|
||||||
+ if (drawMode == 7 && convertQuadsToTriangles)
|
|
||||||
|
- if (this.vertexCount > 0)
|
||||||
|
+ int offs = 0;
|
||||||
|
+ while (offs < vertexCount)
|
||||||
|
{
|
||||||
|
+ int vtc = 0;
|
||||||
|
+ if (drawMode == 7 && convertQuadsToTriangles)
|
||||||
|
+ {
|
||||||
|
+ Math.min(vertexCount - offs, trivertsInBuffer);
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ vtc = Math.min(vertexCount - offs, nativeBufferSize >> 5);
|
||||||
|
+ }
|
||||||
|
this.intBuffer.clear();
|
||||||
|
- this.intBuffer.put(this.rawBuffer, 0, this.rawBufferIndex);
|
||||||
|
+ intBuffer.put(rawBuffer, offs * 8, vtc * 8);
|
||||||
|
this.byteBuffer.position(0);
|
||||||
|
- this.byteBuffer.limit(this.rawBufferIndex * 4);
|
||||||
|
+ byteBuffer.limit(vtc * 32);
|
||||||
|
+ offs += vtc;
|
||||||
|
|
||||||
|
if (this.useVBO)
|
||||||
|
{
|
||||||
|
@@ -245,11 +259,11 @@
|
||||||
|
|
||||||
|
if (this.drawMode == 7 && convertQuadsToTriangles)
|
||||||
|
{
|
||||||
|
- GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, this.vertexCount);
|
||||||
|
+ GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, vtc);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
- GL11.glDrawArrays(this.drawMode, 0, this.vertexCount);
|
||||||
|
+ GL11.glDrawArrays(this.drawMode, 0, vtc);
|
||||||
|
}
|
||||||
|
|
||||||
|
GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
|
||||||
|
@@ -276,7 +290,13 @@
|
||||||
|
GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
-
|
||||||
|
+
|
||||||
|
+ if (rawBufferSize > 0x20000 && rawBufferIndex < (rawBufferSize << 3))
|
||||||
+ {
|
+ {
|
||||||
+ vtc = Math.min(vertexCount - offs, trivertsInBuffer);
|
+ rawBufferSize = 0;
|
||||||
|
+ rawBuffer = null;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
int var1 = this.rawBufferIndex * 4;
|
||||||
|
this.reset();
|
||||||
|
return var1;
|
||||||
|
@@ -439,6 +459,19 @@
|
||||||
|
*/
|
||||||
|
public void addVertex(double par1, double par3, double par5)
|
||||||
|
{
|
||||||
|
+ if (rawBufferIndex >= rawBufferSize - 32)
|
||||||
|
+ {
|
||||||
|
+ if (rawBufferSize == 0)
|
||||||
|
+ {
|
||||||
|
+ rawBufferSize = 0x10000;
|
||||||
|
+ rawBuffer = new int[rawBufferSize];
|
||||||
+ }
|
+ }
|
||||||
+ else
|
+ else
|
||||||
+ {
|
+ {
|
||||||
+ vtc = Math.min(vertexCount - offs, nativeBufferSize >> 5);
|
+ rawBufferSize *= 2;
|
||||||
|
+ rawBuffer = Arrays.copyOf(rawBuffer, rawBufferSize);
|
||||||
+ }
|
+ }
|
||||||
+
|
|
||||||
intBuffer.clear();
|
|
||||||
- intBuffer.put(rawBuffer, 0, rawBufferIndex);
|
|
||||||
+ intBuffer.put(rawBuffer, offs * 8, vtc * 8);
|
|
||||||
byteBuffer.position(0);
|
|
||||||
- byteBuffer.limit(rawBufferIndex * 4);
|
|
||||||
+ byteBuffer.limit(vtc * 32);
|
|
||||||
+ offs += vtc;
|
|
||||||
+
|
|
||||||
if (useVBO)
|
|
||||||
{
|
|
||||||
vboIndex = (vboIndex + 1) % vboCount;
|
|
||||||
@@ -150,11 +175,11 @@
|
|
||||||
GL11.glEnableClientState(32884 /*GL_VERTEX_ARRAY_EXT*/);
|
|
||||||
if (drawMode == 7 && convertQuadsToTriangles)
|
|
||||||
{
|
|
||||||
- GL11.glDrawArrays(4, 0, vertexCount);
|
|
||||||
+ GL11.glDrawArrays(4, 0, vtc);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
- GL11.glDrawArrays(drawMode, 0, vertexCount);
|
|
||||||
+ GL11.glDrawArrays(drawMode, 0, vtc);
|
|
||||||
}
|
|
||||||
GL11.glDisableClientState(32884 /*GL_VERTEX_ARRAY_EXT*/);
|
|
||||||
if (hasTexture)
|
|
||||||
@@ -176,6 +201,11 @@
|
|
||||||
GL11.glDisableClientState(32885 /*GL_NORMAL_ARRAY_EXT*/);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ if (rawBufferSize > 0x20000 && rawBufferIndex < (rawBufferSize << 3))
|
|
||||||
+ {
|
|
||||||
+ rawBufferSize = 0;
|
|
||||||
+ rawBuffer = null;
|
|
||||||
+ }
|
+ }
|
||||||
int i = rawBufferIndex * 4;
|
++this.addedVertices;
|
||||||
reset();
|
|
||||||
return i;
|
|
||||||
@@ -299,6 +329,19 @@
|
|
||||||
|
|
||||||
public void addVertex(double d, double d1, double d2)
|
if (this.drawMode == 7 && convertQuadsToTriangles && this.addedVertices % 4 == 0)
|
||||||
{
|
@@ -497,12 +530,6 @@
|
||||||
+ if (rawBufferIndex >= rawBufferSize - 32)
|
this.rawBuffer[this.rawBufferIndex + 2] = Float.floatToRawIntBits((float)(par5 + this.zOffset));
|
||||||
+ {
|
this.rawBufferIndex += 8;
|
||||||
+ if (rawBufferSize == 0)
|
++this.vertexCount;
|
||||||
+ {
|
-
|
||||||
+ rawBufferSize = 0x10000;
|
- if (this.vertexCount % 4 == 0 && this.rawBufferIndex >= this.bufferSize - 32)
|
||||||
+ rawBuffer = new int[rawBufferSize];
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ rawBufferSize *= 2;
|
|
||||||
+ rawBuffer = Arrays.copyOf(rawBuffer, rawBufferSize);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
addedVertices++;
|
|
||||||
if (drawMode == 7 && convertQuadsToTriangles && addedVertices % 4 == 0)
|
|
||||||
{
|
|
||||||
@@ -347,11 +390,6 @@
|
|
||||||
rawBuffer[rawBufferIndex + 2] = Float.floatToRawIntBits((float)(d2 + zOffset));
|
|
||||||
rawBufferIndex += 8;
|
|
||||||
vertexCount++;
|
|
||||||
- if (vertexCount % 4 == 0 && rawBufferIndex >= bufferSize - 32)
|
|
||||||
- {
|
- {
|
||||||
- draw();
|
- this.draw();
|
||||||
- isDrawing = true;
|
- this.isDrawing = true;
|
||||||
- }
|
- }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setColorOpaque_I(int i)
|
/**
|
||||||
|
|
|
@ -1,18 +1,16 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/TileEntity.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/TileEntity.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/TileEntity.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/TileEntity.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -63,6 +63,15 @@
|
@@ -207,4 +207,13 @@
|
||||||
{
|
addMapping(TileEntityEnchantmentTable.class, "EnchantTable");
|
||||||
|
addMapping(TileEntityEndPortal.class, "Airportal");
|
||||||
}
|
}
|
||||||
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Determines if this TileEntity requires update calls.
|
+ * Determines if this TileEntity requires update calls.
|
||||||
+ * @return True if you want updateEntity() to be called, false if not
|
+ * @return True if you want updateEntity() to be called, false if not
|
||||||
+ */
|
+ */
|
||||||
+ public boolean canUpdate()
|
+ public boolean canUpdate()
|
||||||
+ {
|
+ {
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
+
|
}
|
||||||
public static TileEntity createAndLoadEntity(NBTTagCompound nbttagcompound)
|
|
||||||
{
|
|
||||||
TileEntity tileentity = null;
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/TileEntityBrewingStand.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/TileEntityBrewingStand.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/TileEntityBrewingStand.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/TileEntityBrewingStand.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -1,7 +1,9 @@
|
@@ -2,7 +2,9 @@
|
||||||
package net.minecraft.src;
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
-public class TileEntityBrewingStand extends TileEntity implements IInventory
|
||||||
+import net.minecraft.src.forge.ISidedInventory;
|
+import net.minecraft.src.forge.ISidedInventory;
|
||||||
+
|
+
|
||||||
public class TileEntityBrewingStand extends TileEntity
|
+public class TileEntityBrewingStand extends TileEntity implements IInventory, ISidedInventory
|
||||||
- implements IInventory
|
|
||||||
+ implements IInventory, ISidedInventory
|
|
||||||
{
|
{
|
||||||
private ItemStack brewingItemStacks[];
|
/** The itemstacks currently placed in the slots of the brewing stand */
|
||||||
private int brewTime;
|
private ItemStack[] brewingItemStacks = new ItemStack[4];
|
||||||
@@ -273,4 +275,16 @@
|
@@ -318,4 +320,16 @@
|
||||||
|
|
||||||
return i;
|
return var1;
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
|
|
|
@ -1,84 +1,71 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/TileEntityFurnace.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/TileEntityFurnace.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/TileEntityFurnace.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/TileEntityFurnace.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -1,7 +1,9 @@
|
@@ -1,6 +1,8 @@
|
||||||
package net.minecraft.src;
|
package net.minecraft.src;
|
||||||
|
|
||||||
|
-public class TileEntityFurnace extends TileEntity implements IInventory
|
||||||
+import net.minecraft.src.forge.ISidedInventory;
|
+import net.minecraft.src.forge.ISidedInventory;
|
||||||
+
|
+
|
||||||
public class TileEntityFurnace extends TileEntity
|
+public class TileEntityFurnace extends TileEntity implements IInventory, ISidedInventory
|
||||||
- implements IInventory
|
|
||||||
+ implements IInventory, ISidedInventory
|
|
||||||
{
|
{
|
||||||
private ItemStack furnaceItemStacks[];
|
/**
|
||||||
public int furnaceBurnTime;
|
* The ItemStacks that hold the items currently being used in the furnace
|
||||||
@@ -21,6 +23,20 @@
|
@@ -275,8 +277,12 @@
|
||||||
return furnaceItemStacks.length;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
- ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().shiftedIndex);
|
||||||
|
- 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;
|
||||||
|
+ 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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -287,13 +293,13 @@
|
||||||
|
{
|
||||||
|
if (this.canSmelt())
|
||||||
|
{
|
||||||
|
- ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().shiftedIndex);
|
||||||
|
+ ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);
|
||||||
|
|
||||||
|
if (this.furnaceItemStacks[2] == null)
|
||||||
|
{
|
||||||
|
this.furnaceItemStacks[2] = var1.copy();
|
||||||
|
}
|
||||||
|
- else if (this.furnaceItemStacks[2].itemID == var1.itemID)
|
||||||
|
+ else if (this.furnaceItemStacks[2].isItemEqual(var1))
|
||||||
|
{
|
||||||
|
this.furnaceItemStacks[2].stackSize += var1.stackSize;
|
||||||
|
}
|
||||||
|
@@ -318,7 +324,7 @@
|
||||||
|
* Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't
|
||||||
|
* fuel
|
||||||
|
*/
|
||||||
|
- private int getItemBurnTime(ItemStack par1ItemStack)
|
||||||
|
+ public int getItemBurnTime(ItemStack par1ItemStack)
|
||||||
|
{
|
||||||
|
if (par1ItemStack == null)
|
||||||
|
{
|
||||||
|
@@ -342,4 +348,18 @@
|
||||||
|
public void openChest() {}
|
||||||
|
|
||||||
|
public void closeChest() {}
|
||||||
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public int getStartInventorySide(int side)
|
+ public int getStartInventorySide(int side)
|
||||||
+ {
|
+ {
|
||||||
+ if (side == 0) return 1;
|
+ if (side == 0) return 1;
|
||||||
+ if (side == 1) return 0;
|
+ if (side == 1) return 0;
|
||||||
+ return 2;
|
+ return 2;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public int getSizeInventorySide(int side)
|
+ public int getSizeInventorySide(int side)
|
||||||
+ {
|
+ {
|
||||||
+ return 1;
|
+ return 1;
|
||||||
+ }
|
+ }
|
||||||
+
|
}
|
||||||
public ItemStack getStackInSlot(int i)
|
|
||||||
{
|
|
||||||
return furnaceItemStacks[i];
|
|
||||||
@@ -192,7 +208,7 @@
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
- ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(furnaceItemStacks[0].getItem().shiftedIndex);
|
|
||||||
+ ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(furnaceItemStacks[0]);
|
|
||||||
if (itemstack == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
@@ -205,11 +221,8 @@
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
- if (furnaceItemStacks[2].stackSize < getInventoryStackLimit() && furnaceItemStacks[2].stackSize < furnaceItemStacks[2].getMaxStackSize())
|
|
||||||
- {
|
|
||||||
- return true;
|
|
||||||
- }
|
|
||||||
- return furnaceItemStacks[2].stackSize < itemstack.getMaxStackSize();
|
|
||||||
+ int result = furnaceItemStacks[2].stackSize + itemstack.stackSize;
|
|
||||||
+ return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void smeltItem()
|
|
||||||
@@ -218,14 +231,14 @@
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
- ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(furnaceItemStacks[0].getItem().shiftedIndex);
|
|
||||||
+ ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(furnaceItemStacks[0]);
|
|
||||||
if (furnaceItemStacks[2] == null)
|
|
||||||
{
|
|
||||||
furnaceItemStacks[2] = itemstack.copy();
|
|
||||||
}
|
|
||||||
- else if (furnaceItemStacks[2].itemID == itemstack.itemID)
|
|
||||||
+ else if (furnaceItemStacks[2].isItemEqual(itemstack))
|
|
||||||
{
|
|
||||||
- furnaceItemStacks[2].stackSize++;
|
|
||||||
+ furnaceItemStacks[2].stackSize += itemstack.stackSize;
|
|
||||||
}
|
|
||||||
if (furnaceItemStacks[0].getItem().func_46056_k())
|
|
||||||
{
|
|
||||||
@@ -241,7 +254,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- private int getItemBurnTime(ItemStack itemstack)
|
|
||||||
+ public static int getItemBurnTime(ItemStack itemstack)
|
|
||||||
{
|
|
||||||
if (itemstack == null)
|
|
||||||
{
|
|
||||||
|
|
|
@ -9,19 +9,20 @@
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
public class TileEntityRendererPiston extends TileEntitySpecialRenderer
|
public class TileEntityRendererPiston extends TileEntitySpecialRenderer
|
||||||
@@ -31,6 +33,7 @@
|
@@ -29,7 +31,7 @@
|
||||||
{
|
{
|
||||||
GL11.glShadeModel(7424 /*GL_FLAT*/);
|
GL11.glShadeModel(GL11.GL_FLAT);
|
||||||
}
|
}
|
||||||
+ ForgeHooksClient.beforeBlockRender(block, field_31071_b);
|
-
|
||||||
tessellator.startDrawingQuads();
|
+ ForgeHooksClient.beforeBlockRender(var9, blockRenderer);
|
||||||
tessellator.setTranslationD(((float)d - (float)tileentitypiston.xCoord) + tileentitypiston.func_31017_b(f), ((float)d1 - (float)tileentitypiston.yCoord) + tileentitypiston.func_31014_c(f), ((float)d2 - (float)tileentitypiston.zCoord) + tileentitypiston.func_31013_d(f));
|
var10.startDrawingQuads();
|
||||||
tessellator.setColorOpaque(1, 1, 1);
|
var10.setTranslationD((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)));
|
||||||
@@ -52,6 +55,7 @@
|
var10.setColorOpaque(1, 1, 1);
|
||||||
}
|
@@ -53,6 +55,7 @@
|
||||||
tessellator.setTranslationD(0.0D, 0.0D, 0.0D);
|
|
||||||
tessellator.draw();
|
var10.setTranslationD(0.0D, 0.0D, 0.0D);
|
||||||
+ ForgeHooksClient.afterBlockRender(block, field_31071_b);
|
var10.draw();
|
||||||
|
+ ForgeHooksClient.afterBlockRender(var9, blockRenderer);
|
||||||
RenderHelper.enableStandardItemLighting();
|
RenderHelper.enableStandardItemLighting();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,89 +1,85 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/World.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/World.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/World.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/World.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -33,7 +33,7 @@
|
@@ -67,7 +67,7 @@
|
||||||
public int lightningFlash;
|
* Contains a timestamp from when the World object was created. Is used in the session.lock file
|
||||||
public boolean editingBlocks;
|
*/
|
||||||
private long lockTimestamp;
|
private long lockTimestamp;
|
||||||
- protected int autosavePeriod;
|
- protected int autosavePeriod;
|
||||||
+ public int autosavePeriod;
|
+ public int autosavePeriod;
|
||||||
public int difficultySetting;
|
|
||||||
public Random rand;
|
|
||||||
public boolean isNewWorld;
|
|
||||||
@@ -399,7 +399,12 @@
|
|
||||||
|
|
||||||
public boolean isAirBlock(int i, int j, int k)
|
/** Option > Difficulty setting (0 - 3) */
|
||||||
|
public int difficultySetting;
|
||||||
|
@@ -539,7 +539,8 @@
|
||||||
|
*/
|
||||||
|
public boolean isAirBlock(int par1, int par2, int par3)
|
||||||
{
|
{
|
||||||
- return getBlockId(i, j, k) == 0;
|
- return this.getBlockId(par1, par2, par3) == 0;
|
||||||
+ int iBlockID = getBlockId(i, j, k);
|
+ int id = getBlockId(par1, par2, par3);
|
||||||
+ if (iBlockID == 0)
|
+ return id == 0 || Block.blocksList[id] == null || Block.blocksList[id].isAirBlock(this, par1, par2, par3);
|
||||||
+ {
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
+ return Block.blocksList[iBlockID].isAirBlock(this, i, j, k);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean blockExists(int i, int j, int k)
|
/**
|
||||||
@@ -1576,7 +1581,7 @@
|
@@ -2037,7 +2038,7 @@
|
||||||
Chunk chunk = getChunkFromChunkCoords(tileentity.xCoord >> 4, tileentity.zCoord >> 4);
|
|
||||||
if (chunk != null)
|
if (var7 != null)
|
||||||
{
|
{
|
||||||
- chunk.removeChunkBlockTileEntity(tileentity.xCoord & 0xf, tileentity.yCoord, tileentity.zCoord & 0xf);
|
- var7.removeChunkBlockTileEntity(var5.xCoord & 15, var5.yCoord, var5.zCoord & 15);
|
||||||
+ chunk.cleanChunkBlockTileEntity(tileentity.xCoord & 0xf, tileentity.yCoord, tileentity.zCoord & 0xf);
|
+ var7.cleanChunkBlockTileEntity(var5.xCoord & 15, var5.yCoord, var5.zCoord & 15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1605,15 +1610,17 @@
|
@@ -2067,18 +2068,18 @@
|
||||||
{
|
{
|
||||||
loadedTileEntityList.add(tileentity1);
|
this.loadedTileEntityList.add(var8);
|
||||||
}
|
}
|
||||||
|
-
|
||||||
+ }
|
+ }
|
||||||
+ else
|
+ else
|
||||||
+ {
|
+ {
|
||||||
if (chunkExists(tileentity1.xCoord >> 4, tileentity1.zCoord >> 4))
|
if (this.chunkExists(var8.xCoord >> 4, var8.zCoord >> 4))
|
||||||
{
|
{
|
||||||
Chunk chunk1 = getChunkFromChunkCoords(tileentity1.xCoord >> 4, tileentity1.zCoord >> 4);
|
Chunk var9 = this.getChunkFromChunkCoords(var8.xCoord >> 4, var8.zCoord >> 4);
|
||||||
if (chunk1 != null)
|
|
||||||
|
if (var9 != null)
|
||||||
{
|
{
|
||||||
- chunk1.setChunkBlockTileEntity(tileentity1.xCoord & 0xf, tileentity1.yCoord, tileentity1.zCoord & 0xf, tileentity1);
|
- var9.setChunkBlockTileEntity(var8.xCoord & 15, var8.yCoord, var8.zCoord & 15, var8);
|
||||||
+ chunk1.cleanChunkBlockTileEntity(tileentity1.xCoord & 0xf, tileentity1.yCoord, tileentity1.zCoord & 0xf);
|
+ var9.cleanChunkBlockTileEntity(var8.xCoord & 15, var8.yCoord, var8.zCoord & 15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
- markBlockNeedsUpdate(tileentity1.xCoord, tileentity1.yCoord, tileentity1.zCoord);
|
-
|
||||||
|
- this.markBlockNeedsUpdate(var8.xCoord, var8.yCoord, var8.zCoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (true);
|
|
||||||
@@ -1625,14 +1632,14 @@
|
|
||||||
|
|
||||||
public void addTileEntity(Collection collection)
|
@@ -2091,13 +2092,13 @@
|
||||||
|
|
||||||
|
public void addTileEntity(Collection par1Collection)
|
||||||
{
|
{
|
||||||
- if (scanningTileEntities)
|
- if (this.scanningTileEntities)
|
||||||
- {
|
- {
|
||||||
- addedTileEntityList.addAll(collection);
|
- this.addedTileEntityList.addAll(par1Collection);
|
||||||
- }
|
- }
|
||||||
- else
|
- else
|
||||||
- {
|
+ List dest = scanningTileEntities ? addedTileEntityList : loadedTileEntityList;
|
||||||
- loadedTileEntityList.addAll(collection);
|
+ for(Object entity : par1Collection)
|
||||||
- }
|
{
|
||||||
+ List dest = scanningTileEntities ? addedTileEntityList : loadedTileEntityList;
|
- this.loadedTileEntityList.addAll(par1Collection);
|
||||||
+ for(Object entity : collection)
|
+ if(((TileEntity)entity).canUpdate())
|
||||||
+ {
|
+ {
|
||||||
+ if(((TileEntity)entity).canUpdate())
|
+ dest.add(entity);
|
||||||
+ {
|
+ }
|
||||||
+ dest.add(entity);
|
}
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateEntity(Entity entity)
|
@@ -2296,7 +2297,14 @@
|
||||||
@@ -1793,7 +1800,14 @@
|
if (var11 == Block.fire.blockID || var11 == Block.lavaMoving.blockID || var11 == Block.lavaStill.blockID)
|
||||||
if (j2 == Block.fire.blockID || j2 == Block.lavaMoving.blockID || j2 == Block.lavaStill.blockID)
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
- }
|
- }
|
||||||
+ }
|
+ }
|
||||||
+ else
|
+ else
|
||||||
+ {
|
+ {
|
||||||
+ if(j2 > 0 && Block.blocksList[j2].isBlockBurning(this, k1, l1, i2))
|
+ if(var11 > 0 && Block.blocksList[var11].isBlockBurning(this, var8, var9, var10))
|
||||||
+ {
|
+ {
|
||||||
+ return true;
|
+ return true;
|
||||||
+ }
|
+ }
|
||||||
|
@ -91,106 +87,116 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2038,48 +2052,29 @@
|
@@ -2597,25 +2605,19 @@
|
||||||
|
*/
|
||||||
public void setBlockTileEntity(int i, int j, int k, TileEntity tileentity)
|
public void setBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity)
|
||||||
{
|
{
|
||||||
- if (tileentity != null && !tileentity.isInvalid())
|
- if (par4TileEntity != null && !par4TileEntity.isInvalid())
|
||||||
- {
|
+ if (par4TileEntity == null || par4TileEntity.isInvalid())
|
||||||
- if (scanningTileEntities)
|
{
|
||||||
|
- if (this.scanningTileEntities)
|
||||||
- {
|
- {
|
||||||
- tileentity.xCoord = i;
|
- par4TileEntity.xCoord = par1;
|
||||||
- tileentity.yCoord = j;
|
- par4TileEntity.yCoord = par2;
|
||||||
- tileentity.zCoord = k;
|
- par4TileEntity.zCoord = par3;
|
||||||
- addedTileEntityList.add(tileentity);
|
- this.addedTileEntityList.add(par4TileEntity);
|
||||||
- }
|
- }
|
||||||
- else
|
- else
|
||||||
- {
|
- {
|
||||||
- loadedTileEntityList.add(tileentity);
|
- this.loadedTileEntityList.add(par4TileEntity);
|
||||||
- Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4);
|
- Chunk var5 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4);
|
||||||
- if (chunk != null)
|
-
|
||||||
|
- if (var5 != null)
|
||||||
- {
|
- {
|
||||||
- chunk.setChunkBlockTileEntity(i & 0xf, j, k & 0xf, tileentity);
|
- var5.setChunkBlockTileEntity(par1 & 15, par2, par3 & 15, par4TileEntity);
|
||||||
- }
|
- }
|
||||||
- }
|
- }
|
||||||
- }
|
+ return;
|
||||||
+ if (tileentity == null || tileentity.isInvalid())
|
+ }
|
||||||
+ {
|
+ List dest = scanningTileEntities ? addedTileEntityList : loadedTileEntityList;
|
||||||
+ return;
|
+ if (par4TileEntity.canUpdate())
|
||||||
+ }
|
+ {
|
||||||
+ List dest = scanningTileEntities ? addedTileEntityList : loadedTileEntityList;
|
+ dest.add(par4TileEntity);
|
||||||
+ if (tileentity.canUpdate())
|
+ }
|
||||||
+ {
|
+ Chunk chunk = getChunkFromChunkCoords(par1 >> 4, par3 >> 4);
|
||||||
+ dest.add(tileentity);
|
+ if (chunk != null)
|
||||||
+ }
|
+ {
|
||||||
+ Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4);
|
+ chunk.setChunkBlockTileEntity(par1 & 15, par2, par3 & 15, par4TileEntity);
|
||||||
+ if (chunk != null)
|
}
|
||||||
+ {
|
|
||||||
+ chunk.setChunkBlockTileEntity(i & 0xf, j, k & 0xf, tileentity);
|
|
||||||
+ }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeBlockTileEntity(int i, int j, int k)
|
@@ -2624,27 +2626,10 @@
|
||||||
|
*/
|
||||||
|
public void removeBlockTileEntity(int par1, int par2, int par3)
|
||||||
{
|
{
|
||||||
- TileEntity tileentity = getBlockTileEntity(i, j, k);
|
- TileEntity var4 = this.getBlockTileEntity(par1, par2, par3);
|
||||||
- if (tileentity != null && scanningTileEntities)
|
-
|
||||||
|
- if (var4 != null && this.scanningTileEntities)
|
||||||
- {
|
- {
|
||||||
- tileentity.invalidate();
|
- var4.invalidate();
|
||||||
- addedTileEntityList.remove(tileentity);
|
- this.addedTileEntityList.remove(var4);
|
||||||
- }
|
- }
|
||||||
- else
|
- else
|
||||||
- {
|
+ Chunk chunk = getChunkFromChunkCoords(par1 >> 4, par3 >> 4);
|
||||||
- if (tileentity != null)
|
+ if (chunk != null)
|
||||||
- {
|
|
||||||
- addedTileEntityList.remove(tileentity);
|
|
||||||
- loadedTileEntityList.remove(tileentity);
|
|
||||||
- }
|
|
||||||
- Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4);
|
|
||||||
- if (chunk != null)
|
|
||||||
- {
|
|
||||||
- chunk.removeChunkBlockTileEntity(i & 0xf, j, k & 0xf);
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
+ Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4);
|
|
||||||
+ if (chunk != null)
|
|
||||||
+ {
|
|
||||||
+ chunk.removeChunkBlockTileEntity(i & 0xf, j, k & 0xf);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
public void markTileEntityForDespawn(TileEntity tileentity)
|
|
||||||
@@ -2109,7 +2104,7 @@
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
- return block.blockMaterial.isOpaque() && block.renderAsNormalBlock();
|
- if (var4 != null)
|
||||||
+ return block.isBlockNormalCube(this, i, j, k);
|
- {
|
||||||
|
- this.addedTileEntityList.remove(var4);
|
||||||
|
- this.loadedTileEntityList.remove(var4);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- Chunk var5 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4);
|
||||||
|
-
|
||||||
|
- if (var5 != null)
|
||||||
|
- {
|
||||||
|
- var5.removeChunkBlockTileEntity(par1 & 15, par2, par3 & 15);
|
||||||
|
- }
|
||||||
|
+ chunk.removeChunkBlockTileEntity(par1 & 15, par2, par3 & 15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2535,7 +2530,7 @@
|
@@ -2670,7 +2655,15 @@
|
||||||
|
*/
|
||||||
private int computeBlockLightValue(int i, int j, int k, int l, int i1, int j1)
|
public boolean isBlockNormalCube(int par1, int par2, int par3)
|
||||||
{
|
{
|
||||||
- int k1 = Block.lightValue[i1];
|
- return Block.func_48206_g(this.getBlockId(par1, par2, par3));
|
||||||
+ int k1 = (i1 == 0) ? 0 : Block.blocksList[i1].getLightValue(this, j, k, l);
|
+ Block block = Block.blocksList[getBlockId(par1, par2, par3)];
|
||||||
int l1 = getSavedLightValue(EnumSkyBlock.Block, j - 1, k, l) - j1;
|
+ if (block != null)
|
||||||
int i2 = getSavedLightValue(EnumSkyBlock.Block, j + 1, k, l) - j1;
|
|
||||||
int j2 = getSavedLightValue(EnumSkyBlock.Block, j, k - 1, l) - j1;
|
|
||||||
@@ -2945,6 +2940,10 @@
|
|
||||||
{
|
|
||||||
block = null;
|
|
||||||
}
|
|
||||||
+ if (block != null && block.isBlockReplaceable(this, j, k, l))
|
|
||||||
+ {
|
+ {
|
||||||
+ block = null;
|
+ return block.isBlockNormalCube(this, par1, par2, par3);
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
return i > 0 && block == null && block1.canPlaceBlockOnSide(this, j, k, l, i1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3493,4 +3492,39 @@
|
/**
|
||||||
|
@@ -3263,7 +3256,7 @@
|
||||||
|
|
||||||
|
private int computeBlockLightValue(int par1, int par2, int par3, int par4, int par5, int par6)
|
||||||
{
|
{
|
||||||
return worldInfo.getTerrainType() != EnumWorldType.FLAT ? 63D : 0.0D;
|
- int var7 = Block.lightValue[par5];
|
||||||
|
+ int var7 = (par5 == 0 || Block.blocksList[par5] == null ? 0 : Block.blocksList[par5].getLightValue(this, par2, par3, par4));
|
||||||
|
int var8 = this.getSavedLightValue(EnumSkyBlock.Block, par2 - 1, par3, par4) - par6;
|
||||||
|
int var9 = this.getSavedLightValue(EnumSkyBlock.Block, par2 + 1, par3, par4) - par6;
|
||||||
|
int var10 = this.getSavedLightValue(EnumSkyBlock.Block, par2, par3 - 1, par4) - par6;
|
||||||
|
@@ -3789,7 +3782,10 @@
|
||||||
|
{
|
||||||
|
var8 = null;
|
||||||
|
}
|
||||||
|
-
|
||||||
|
+ if (var8 != null && var8.isBlockReplaceable(this, par2, par3, par4))
|
||||||
|
+ {
|
||||||
|
+ var8 = null;
|
||||||
|
+ }
|
||||||
|
return par1 > 0 && var8 == null && var9.canPlaceBlockOnSide(this, par2, par3, par4, par6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -4378,4 +4374,39 @@
|
||||||
|
{
|
||||||
|
return this.worldInfo.getTerrainType() == WorldType.field_48636_c ? 0.0D : 63.0D;
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+
|
+
|
||||||
|
|
|
@ -1,34 +1,23 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/WorldGenDungeons.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/WorldGenDungeons.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/WorldGenDungeons.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/WorldGenDungeons.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -3,6 +3,8 @@
|
@@ -2,6 +2,8 @@
|
||||||
import java.io.PrintStream;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
+import net.minecraft.src.forge.MinecraftForge;
|
+import net.minecraft.src.forge.MinecraftForge;
|
||||||
+
|
+
|
||||||
public class WorldGenDungeons extends WorldGenerator
|
public class WorldGenDungeons extends WorldGenerator
|
||||||
{
|
{
|
||||||
public WorldGenDungeons()
|
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
|
||||||
@@ -118,11 +120,11 @@
|
@@ -117,9 +119,9 @@
|
||||||
int k4 = 0;
|
|
||||||
do
|
if (var16 != null)
|
||||||
{
|
{
|
||||||
- if (k4 >= 8)
|
- for (int var17 = 0; var17 < 8; ++var17)
|
||||||
+ if (k4 >= MinecraftForge.getDungeonLootTries())
|
+ for (int var17 = 0; var17 < MinecraftForge.getDungeonLootTries(); ++var17)
|
||||||
{
|
{
|
||||||
break label0;
|
- ItemStack var18 = this.pickCheckLootItem(par2Random);
|
||||||
}
|
+ ItemStack var18 = MinecraftForge.getRandomDungeonLoot(par2Random);
|
||||||
- ItemStack itemstack = pickCheckLootItem(random);
|
|
||||||
+ ItemStack itemstack = MinecraftForge.getRandomDungeonLoot(random);
|
if (var18 != null)
|
||||||
if (itemstack != null)
|
{
|
||||||
{
|
|
||||||
tileentitychest.setInventorySlotContents(random.nextInt(tileentitychest.getSizeInventory()), itemstack);
|
|
||||||
@@ -137,7 +139,7 @@
|
|
||||||
TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner)world.getBlockTileEntity(i, j, k);
|
|
||||||
if (tileentitymobspawner != null)
|
|
||||||
{
|
|
||||||
- tileentitymobspawner.setMobID(pickMobSpawner(random));
|
|
||||||
+ tileentitymobspawner.setMobID(MinecraftForge.getRandomDungeonMob(random));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
|
@ -7,34 +7,19 @@
|
||||||
+
|
+
|
||||||
public abstract class WorldProvider
|
public abstract class WorldProvider
|
||||||
{
|
{
|
||||||
public World worldObj;
|
/** world object being used */
|
||||||
@@ -142,22 +144,7 @@
|
@@ -181,7 +183,7 @@
|
||||||
|
|
||||||
public static WorldProvider getProviderForDimension(int i)
|
public static WorldProvider getProviderForDimension(int par0)
|
||||||
{
|
{
|
||||||
- if (i == -1)
|
- return (WorldProvider)(par0 == -1 ? new WorldProviderHell() : (par0 == 0 ? new WorldProviderSurface() : (par0 == 1 ? new WorldProviderEnd() : null)));
|
||||||
- {
|
+ return DimensionManager.getProvider(par0);
|
||||||
- return new WorldProviderHell();
|
|
||||||
- }
|
|
||||||
- if (i == 0)
|
|
||||||
- {
|
|
||||||
- return new WorldProviderSurface();
|
|
||||||
- }
|
|
||||||
- if (i == 1)
|
|
||||||
- {
|
|
||||||
- return new WorldProviderEnd();
|
|
||||||
- }
|
|
||||||
- else
|
|
||||||
- {
|
|
||||||
- return null;
|
|
||||||
- }
|
|
||||||
+ return DimensionManager.getProvider(i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getCloudHeight()
|
/**
|
||||||
@@ -196,4 +183,36 @@
|
@@ -227,4 +229,36 @@
|
||||||
{
|
{
|
||||||
return terrainType != EnumWorldType.FLAT ? 0.03125D : 1.0D;
|
return false;
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/WorldProviderEnd.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/WorldProviderEnd.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/WorldProviderEnd.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/WorldProviderEnd.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -87,4 +87,22 @@
|
@@ -115,4 +115,22 @@
|
||||||
{
|
{
|
||||||
return 50;
|
return true;
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/WorldProviderHell.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/WorldProviderHell.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/WorldProviderHell.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/WorldProviderHell.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -49,4 +49,28 @@
|
@@ -76,4 +76,28 @@
|
||||||
{
|
{
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/WorldProviderSurface.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/WorldProviderSurface.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/WorldProviderSurface.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/WorldProviderSurface.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -5,4 +5,22 @@
|
@@ -2,4 +2,22 @@
|
||||||
public WorldProviderSurface()
|
|
||||||
{
|
public class WorldProviderSurface extends WorldProvider
|
||||||
}
|
{
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public String getSaveFolder()
|
+ public String getSaveFolder()
|
||||||
|
|
|
@ -1,80 +1,71 @@
|
||||||
--- ../src_base/minecraft/net/minecraft/src/WorldRenderer.java 0000-00-00 00:00:00.000000000 -0000
|
--- ../src_base/minecraft/net/minecraft/src/WorldRenderer.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
+++ ../src_work/minecraft/net/minecraft/src/WorldRenderer.java 0000-00-00 00:00:00.000000000 -0000
|
+++ ../src_work/minecraft/net/minecraft/src/WorldRenderer.java 0000-00-00 00:00:00.000000000 -0000
|
||||||
@@ -1,13 +1,15 @@
|
@@ -3,6 +3,9 @@
|
||||||
package net.minecraft.src;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.*;
|
import java.util.List;
|
||||||
+
|
+
|
||||||
+import net.minecraft.src.forge.ForgeHooksClient;
|
+import net.minecraft.src.forge.ForgeHooksClient;
|
||||||
+
|
+
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
public class WorldRenderer
|
public class WorldRenderer
|
||||||
{
|
@@ -10,7 +13,6 @@
|
||||||
|
/** Reference to the World object. */
|
||||||
public World worldObj;
|
public World worldObj;
|
||||||
private int glRenderList;
|
private int glRenderList = -1;
|
||||||
- private static Tessellator tessellator;
|
- private static Tessellator tessellator = Tessellator.instance;
|
||||||
public static int chunksUpdated = 0;
|
public static int chunksUpdated = 0;
|
||||||
public int posX;
|
public int posX;
|
||||||
public int posY;
|
public int posY;
|
||||||
@@ -150,10 +152,11 @@
|
@@ -179,11 +181,12 @@
|
||||||
GL11.glTranslatef((float)(-sizeDepth) / 2.0F, (float)(-sizeHeight) / 2.0F, (float)(-sizeDepth) / 2.0F);
|
GL11.glTranslatef(-8.0F, -8.0F, -8.0F);
|
||||||
GL11.glScalef(f, f, f);
|
GL11.glScalef(var19, var19, var19);
|
||||||
GL11.glTranslatef((float)sizeDepth / 2.0F, (float)sizeHeight / 2.0F, (float)sizeDepth / 2.0F);
|
GL11.glTranslatef(8.0F, 8.0F, 8.0F);
|
||||||
- tessellator.startDrawingQuads();
|
- tessellator.startDrawingQuads();
|
||||||
- tessellator.setTranslationD(-posX, -posY, -posZ);
|
- tessellator.setTranslationD((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ));
|
||||||
+ ForgeHooksClient.beforeRenderPass(i2);
|
+ ForgeHooksClient.beforeRenderPass(var11);
|
||||||
+ Tessellator.instance.startDrawingQuads();
|
+ Tessellator.instance.startDrawingQuads();
|
||||||
+ Tessellator.instance.setTranslationD(-posX, -posY, -posZ);
|
+ Tessellator.instance.setTranslationD((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ));
|
||||||
}
|
}
|
||||||
- if (i2 == 0 && Block.isBlockContainer[i3])
|
|
||||||
+ if (i2 == 0 && Block.blocksList[i3] != null && Block.blocksList[i3].hasTileEntity(chunkcache.getBlockMetadata(l2, j2, k2)))
|
|
||||||
{
|
|
||||||
TileEntity tileentity = chunkcache.getBlockTileEntity(l2, j2, k2);
|
|
||||||
if (TileEntityRenderer.instance.hasSpecialRenderer(tileentity))
|
|
||||||
@@ -167,25 +170,29 @@
|
|
||||||
{
|
|
||||||
flag1 = true;
|
|
||||||
}
|
|
||||||
- if (j3 != i2)
|
|
||||||
+ if (j3 > i2)
|
|
||||||
{
|
|
||||||
flag = true;
|
|
||||||
- continue;
|
|
||||||
}
|
|
||||||
- if (j3 == i2)
|
|
||||||
+ if(!ForgeHooksClient.canRenderInPass(block, i2))
|
|
||||||
{
|
|
||||||
- flag1 |= renderblocks.renderBlockByRenderType(block, l2, j2, k2);
|
|
||||||
+ continue;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ ForgeHooksClient.beforeBlockRender(block, renderblocks);
|
|
||||||
+ flag1 |= renderblocks.renderBlockByRenderType(block, l2, j2, k2);
|
|
||||||
+ ForgeHooksClient.afterBlockRender(block, renderblocks);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flag2)
|
- if (var11 == 0 && Block.blocksList[var18].func_48205_p())
|
||||||
{
|
+ if (var11 == 0 && Block.blocksList[var18] != null && Block.blocksList[var18].hasTileEntity(var9.getBlockMetadata(var17, var15, var16)))
|
||||||
- bytesDrawn += tessellator.draw();
|
{
|
||||||
+ ForgeHooksClient.afterRenderPass(i2);
|
TileEntity var23 = var9.getBlockTileEntity(var17, var15, var16);
|
||||||
+ bytesDrawn += Tessellator.instance.draw();
|
|
||||||
GL11.glPopMatrix();
|
@@ -196,14 +199,17 @@
|
||||||
GL11.glEndList();
|
Block var24 = Block.blocksList[var18];
|
||||||
- tessellator.setTranslationD(0.0D, 0.0D, 0.0D);
|
int var20 = var24.getRenderBlockPass();
|
||||||
+ Tessellator.instance.setTranslationD(0.0D, 0.0D, 0.0D);
|
|
||||||
}
|
- if (var20 != var11)
|
||||||
else
|
+ if (var20 > var11)
|
||||||
{
|
{
|
||||||
@@ -279,9 +286,4 @@
|
var12 = true;
|
||||||
{
|
}
|
||||||
needsUpdate = true;
|
- else if (var20 == var11)
|
||||||
}
|
+ if (!ForgeHooksClient.canRenderInPass(var24, var11))
|
||||||
-
|
{
|
||||||
- static
|
- var13 |= var10.renderBlockByRenderType(var24, var17, var15, var16);
|
||||||
- {
|
+ continue;
|
||||||
- tessellator = Tessellator.instance;
|
}
|
||||||
- }
|
+ ForgeHooksClient.beforeBlockRender(var24, var10);
|
||||||
}
|
+ var13 |= var10.renderBlockByRenderType(var24, var17, var15, var16);
|
||||||
|
+ ForgeHooksClient.afterBlockRender(var24, var10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -211,10 +217,11 @@
|
||||||
|
|
||||||
|
if (var14)
|
||||||
|
{
|
||||||
|
- this.bytesDrawn += tessellator.draw();
|
||||||
|
+ ForgeHooksClient.afterRenderPass(var11);
|
||||||
|
+ this.bytesDrawn += Tessellator.instance.draw();
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
GL11.glEndList();
|
||||||
|
- tessellator.setTranslationD(0.0D, 0.0D, 0.0D);
|
||||||
|
+ Tessellator.instance.setTranslationD(0.0D, 0.0D, 0.0D);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
Loading…
Reference in New Issue