|
|
@ -1,5 +1,6 @@
|
|
|
|
package net.minecraft.src;
|
|
|
|
package net.minecraft.src;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.math.BigInteger;
|
|
|
|
import java.util.Random;
|
|
|
|
import java.util.Random;
|
|
|
|
|
|
|
|
|
|
|
|
public class BlockDragonEgg extends Block
|
|
|
|
public class BlockDragonEgg extends Block
|
|
|
@ -12,7 +13,7 @@ public class BlockDragonEgg extends Block
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Called whenever the block is added into the world. Args: world, x, y, z
|
|
|
|
* Called whenever the block is added into the world. Args: world, x, y, z
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
|
|
|
public void onBlockAdded(World par1World, BigInteger par2, int par3, BigInteger par4)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate());
|
|
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate());
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -21,7 +22,7 @@ public class BlockDragonEgg extends Block
|
|
|
|
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
|
|
|
|
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
|
|
|
|
* their own) Args: x, y, z, neighbor blockID
|
|
|
|
* their own) Args: x, y, z, neighbor blockID
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
|
|
|
|
public void onNeighborBlockChange(World par1World, BigInteger par2, int par3, BigInteger par4, int par5)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate());
|
|
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate());
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -29,7 +30,7 @@ public class BlockDragonEgg extends Block
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Ticks the block if it's been scheduled
|
|
|
|
* Ticks the block if it's been scheduled
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
|
|
public void updateTick(World par1World, BigInteger par2, int par3, BigInteger par4, Random par5Random)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.fallIfPossible(par1World, par2, par3, par4);
|
|
|
|
this.fallIfPossible(par1World, par2, par3, par4);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -37,15 +38,15 @@ public class BlockDragonEgg extends Block
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Checks if the dragon egg can fall down, and if so, makes it fall.
|
|
|
|
* Checks if the dragon egg can fall down, and if so, makes it fall.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void fallIfPossible(World par1World, int par2, int par3, int par4)
|
|
|
|
private void fallIfPossible(World par1World, BigInteger par2, int par3, BigInteger par4)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (BlockSand.canFallBelow(par1World, par2, par3 - 1, par4) && par3 >= 0)
|
|
|
|
if (BlockSand.canFallBelow(par1World, par2, par3 - 1, par4) && par3 >= 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
byte var5 = 32;
|
|
|
|
byte var5 = 32;
|
|
|
|
|
|
|
|
|
|
|
|
if (!BlockSand.fallInstantly && par1World.checkChunksExist(par2 - var5, par3 - var5, par4 - var5, par2 + var5, par3 + var5, par4 + var5))
|
|
|
|
if (!BlockSand.fallInstantly/* && par1World.checkChunksExist(par2 - var5, par3 - var5, par4 - var5, par2 + var5, par3 + var5, par4 + var5) */)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
EntityFallingSand var6 = new EntityFallingSand(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.blockID);
|
|
|
|
EntityFallingSand var6 = new EntityFallingSand(par1World, (double)((float)par2.floatValue() + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4.floatValue() + 0.5F), this.blockID);
|
|
|
|
par1World.spawnEntityInWorld(var6);
|
|
|
|
par1World.spawnEntityInWorld(var6);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -68,7 +69,7 @@ public class BlockDragonEgg extends Block
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Called upon block activation (right click on the block.)
|
|
|
|
* Called upon block activation (right click on the block.)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
|
|
|
public boolean onBlockActivated(World par1World, BigInteger par2, int par3, BigInteger par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.teleportNearby(par1World, par2, par3, par4);
|
|
|
|
this.teleportNearby(par1World, par2, par3, par4);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
@ -77,7 +78,7 @@ public class BlockDragonEgg extends Block
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Called when the block is clicked by a player. Args: x, y, z, entityPlayer
|
|
|
|
* Called when the block is clicked by a player. Args: x, y, z, entityPlayer
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
|
|
|
|
public void onBlockClicked(World par1World, BigInteger par2, int par3, BigInteger par4, EntityPlayer par5EntityPlayer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.teleportNearby(par1World, par2, par3, par4);
|
|
|
|
this.teleportNearby(par1World, par2, par3, par4);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -85,7 +86,7 @@ public class BlockDragonEgg extends Block
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Teleports the dragon egg somewhere else in a 31x19x31 area centered on the egg.
|
|
|
|
* Teleports the dragon egg somewhere else in a 31x19x31 area centered on the egg.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void teleportNearby(World par1World, int par2, int par3, int par4)
|
|
|
|
private void teleportNearby(World par1World, BigInteger par2, int par3, BigInteger par4)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (par1World.getBlockId(par2, par3, par4) == this.blockID)
|
|
|
|
if (par1World.getBlockId(par2, par3, par4) == this.blockID)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -93,9 +94,9 @@ public class BlockDragonEgg extends Block
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (int var5 = 0; var5 < 1000; ++var5)
|
|
|
|
for (int var5 = 0; var5 < 1000; ++var5)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int var6 = par2 + par1World.rand.nextInt(16) - par1World.rand.nextInt(16);
|
|
|
|
BigInteger var6 = par2.add(BigInteger.valueOf(par1World.rand.nextInt(16) - par1World.rand.nextInt(16)));
|
|
|
|
int var7 = par3 + par1World.rand.nextInt(8) - par1World.rand.nextInt(8);
|
|
|
|
int var7 = par3 + par1World.rand.nextInt(8) - par1World.rand.nextInt(8);
|
|
|
|
int var8 = par4 + par1World.rand.nextInt(16) - par1World.rand.nextInt(16);
|
|
|
|
BigInteger var8 = par4.add(BigInteger.valueOf(par1World.rand.nextInt(16) - par1World.rand.nextInt(16)));
|
|
|
|
|
|
|
|
|
|
|
|
if (par1World.getBlockId(var6, var7, var8) == 0)
|
|
|
|
if (par1World.getBlockId(var6, var7, var8) == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -109,9 +110,9 @@ public class BlockDragonEgg extends Block
|
|
|
|
float var13 = (par1World.rand.nextFloat() - 0.5F) * 0.2F;
|
|
|
|
float var13 = (par1World.rand.nextFloat() - 0.5F) * 0.2F;
|
|
|
|
float var14 = (par1World.rand.nextFloat() - 0.5F) * 0.2F;
|
|
|
|
float var14 = (par1World.rand.nextFloat() - 0.5F) * 0.2F;
|
|
|
|
float var15 = (par1World.rand.nextFloat() - 0.5F) * 0.2F;
|
|
|
|
float var15 = (par1World.rand.nextFloat() - 0.5F) * 0.2F;
|
|
|
|
double var16 = (double)var6 + (double)(par2 - var6) * var11 + (par1World.rand.nextDouble() - 0.5D) * 1.0D + 0.5D;
|
|
|
|
double var16 = (double)var6.doubleValue() + (double)(par2.subtract(var6)).doubleValue() * var11 + (par1World.rand.nextDouble() - 0.5D) * 1.0D + 0.5D;
|
|
|
|
double var18 = (double)var7 + (double)(par3 - var7) * var11 + par1World.rand.nextDouble() * 1.0D - 0.5D;
|
|
|
|
double var18 = (double)var7 + (double)(par3 - var7) * var11 + par1World.rand.nextDouble() * 1.0D - 0.5D;
|
|
|
|
double var20 = (double)var8 + (double)(par4 - var8) * var11 + (par1World.rand.nextDouble() - 0.5D) * 1.0D + 0.5D;
|
|
|
|
double var20 = (double)var8.doubleValue() + (double)(par4.subtract(var8)).doubleValue() * var11 + (par1World.rand.nextDouble() - 0.5D) * 1.0D + 0.5D;
|
|
|
|
par1World.spawnParticle("portal", var16, var18, var20, (double)var13, (double)var14, (double)var15);
|
|
|
|
par1World.spawnParticle("portal", var16, var18, var20, (double)var13, (double)var14, (double)var15);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|