|
|
|
@ -256,7 +256,6 @@ public abstract class World implements IBlockAccess
|
|
|
|
|
*/
|
|
|
|
|
public int getBlockId(BigInteger par1, int par2, BigInteger par3)
|
|
|
|
|
{
|
|
|
|
|
if(par2 > 256 || par2 < 0) return 0;
|
|
|
|
|
return this.getChunkFromChunkCoords(par1.shiftRight(4), par3.shiftRight(4)).getBlockID(par1.intValue() & 0xF, par2, par3.intValue() & 0xF);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -345,29 +344,18 @@ public abstract class World implements IBlockAccess
|
|
|
|
|
*/
|
|
|
|
|
public boolean setBlockAndMetadataWithUpdate(BigInteger par1, int par2, BigInteger par3, int par4, int par5, boolean par6)
|
|
|
|
|
{
|
|
|
|
|
if (par2 < 0)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else if (par2 >= 256)
|
|
|
|
|
Chunk var7 = this.getChunkFromChunkCoords(par1.shiftRight(4), par3.shiftRight(4));
|
|
|
|
|
boolean var8 = var7.setBlockIDWithMetadata(par1.intValue() & 0xF, par2, par3.intValue() & 0xF, par4, par5);
|
|
|
|
|
this.theProfiler.startSection("checkLight");
|
|
|
|
|
this.updateAllLightTypes(par1, par2, par3);
|
|
|
|
|
this.theProfiler.endSection();
|
|
|
|
|
|
|
|
|
|
if (par6 && var8 && (this.isRemote || var7.deferRender))
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
this.markBlockNeedsUpdate(par1, par2, par3);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Chunk var7 = this.getChunkFromChunkCoords(par1.shiftRight(4), par3.shiftRight(4));
|
|
|
|
|
boolean var8 = var7.setBlockIDWithMetadata(par1.intValue() & 0xF, par2, par3.intValue() & 0xF, par4, par5);
|
|
|
|
|
this.theProfiler.startSection("checkLight");
|
|
|
|
|
this.updateAllLightTypes(par1, par2, par3);
|
|
|
|
|
this.theProfiler.endSection();
|
|
|
|
|
|
|
|
|
|
if (par6 && var8 && (this.isRemote || var7.deferRender))
|
|
|
|
|
{
|
|
|
|
|
this.markBlockNeedsUpdate(par1, par2, par3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return var8;
|
|
|
|
|
}
|
|
|
|
|
return var8;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -375,29 +363,18 @@ public abstract class World implements IBlockAccess
|
|
|
|
|
*/
|
|
|
|
|
public boolean setBlock(BigInteger par1, int par2, BigInteger par3, int par4)
|
|
|
|
|
{
|
|
|
|
|
if (par2 < 0)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else if (par2 >= 256)
|
|
|
|
|
Chunk var5 = this.getChunkFromChunkCoords(par1.shiftRight(4), par3.shiftRight(4));
|
|
|
|
|
boolean var6 = var5.setBlockID(par1.intValue() & 0xF, par2, par3.intValue() & 0xF, par4);
|
|
|
|
|
this.theProfiler.startSection("checkLight");
|
|
|
|
|
this.updateAllLightTypes(par1, par2, par3);
|
|
|
|
|
this.theProfiler.endSection();
|
|
|
|
|
|
|
|
|
|
if (var6 && (this.isRemote || var5.deferRender))
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
this.markBlockNeedsUpdate(par1, par2, par3);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Chunk var5 = this.getChunkFromChunkCoords(par1.shiftRight(4), par3.shiftRight(4));
|
|
|
|
|
boolean var6 = var5.setBlockID(par1.intValue() & 0xF, par2, par3.intValue() & 0xF, par4);
|
|
|
|
|
this.theProfiler.startSection("checkLight");
|
|
|
|
|
this.updateAllLightTypes(par1, par2, par3);
|
|
|
|
|
this.theProfiler.endSection();
|
|
|
|
|
|
|
|
|
|
if (var6 && (this.isRemote || var5.deferRender))
|
|
|
|
|
{
|
|
|
|
|
this.markBlockNeedsUpdate(par1, par2, par3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return var6;
|
|
|
|
|
}
|
|
|
|
|
return var6;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -414,19 +391,8 @@ public abstract class World implements IBlockAccess
|
|
|
|
|
*/
|
|
|
|
|
public int getBlockMetadata(BigInteger par1, int par2, BigInteger par3)
|
|
|
|
|
{
|
|
|
|
|
if (par2 < 0)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else if (par2 >= 256)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Chunk var4 = this.getChunkFromChunkCoords(par1.shiftRight(4), par3.shiftRight(4));
|
|
|
|
|
return var4.getBlockMetadata(par1.intValue() & 0xF, par2, par3.intValue() & 0xF);
|
|
|
|
|
}
|
|
|
|
|
Chunk var4 = this.getChunkFromChunkCoords(par1.shiftRight(4), par3.shiftRight(4));
|
|
|
|
|
return var4.getBlockMetadata(par1.intValue() & 0xF, par2, par3.intValue() & 0xF);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -445,28 +411,17 @@ public abstract class World implements IBlockAccess
|
|
|
|
|
*/
|
|
|
|
|
public boolean setBlockMetadata(BigInteger par1, int par2, BigInteger par3, int par4)
|
|
|
|
|
{
|
|
|
|
|
if (par2 < 0)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else if (par2 >= 256)
|
|
|
|
|
Chunk var5 = this.getChunkFromChunkCoords(par1.shiftRight(4), par3.shiftRight(4));
|
|
|
|
|
int var6 = par1.intValue() & 0xF;
|
|
|
|
|
int var7 = par3.intValue() & 0xF;
|
|
|
|
|
boolean var8 = var5.setBlockMetadata(var6, par2, var7, par4);
|
|
|
|
|
|
|
|
|
|
if (var8 && (this.isRemote || var5.deferRender && Block.requiresSelfNotify[var5.getBlockID(var6, par2, var7) & 4095]))
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
this.markBlockNeedsUpdate(par1, par2, par3);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Chunk var5 = this.getChunkFromChunkCoords(par1.shiftRight(4), par3.shiftRight(4));
|
|
|
|
|
int var6 = par1.intValue() & 0xF;
|
|
|
|
|
int var7 = par3.intValue() & 0xF;
|
|
|
|
|
boolean var8 = var5.setBlockMetadata(var6, par2, var7, par4);
|
|
|
|
|
|
|
|
|
|
if (var8 && (this.isRemote || var5.deferRender && Block.requiresSelfNotify[var5.getBlockID(var6, par2, var7) & 4095]))
|
|
|
|
|
{
|
|
|
|
|
this.markBlockNeedsUpdate(par1, par2, par3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return var8;
|
|
|
|
|
}
|
|
|
|
|
return var8;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|