Fixed Slow Rift Regeneration and Various Improvements #173

Merged
SenseiKiwi merged 12 commits from master into master 2014-07-11 20:12:08 +00:00
2 changed files with 13 additions and 24 deletions
Showing only changes of commit 29c8a09218 - Show all commits

View File

@@ -306,7 +306,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
{ {
if (world.getBlockId(x, y - 1, z) != this.blockID) if (world.getBlockId(x, y - 1, z) != this.blockID)
{ {
world.setBlock(x, y, z, 0); world.setBlockToAir(x, y, z);
} }
if (neighborID > 0 && neighborID != this.blockID) if (neighborID > 0 && neighborID != this.blockID)
@@ -318,7 +318,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
{ {
if (world.getBlockId(x, y + 1, z) != this.blockID) if (world.getBlockId(x, y + 1, z) != this.blockID)
{ {
world.setBlock(x, y, z, 0); world.setBlockToAir(x, y, z);
if (!world.isRemote) if (!world.isRemote)
{ {
this.dropBlockAsItem(world, x, y, z, metadata, 0); this.dropBlockAsItem(world, x, y, z, metadata, 0);
@@ -354,18 +354,6 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
return isUpperDoorBlock(metadata) ? 0 : this.getDrops(); return isUpperDoorBlock(metadata) ? 0 : this.getDrops();
} }
/**
* Called when the block is attempted to be harvested
*/
@Override
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer)
{
if (par6EntityPlayer.capabilities.isCreativeMode && (par5 & 8) != 0 && par1World.getBlockId(par2, par3 - 1, par4) == this.blockID)
{
par1World.setBlock(par2, par3 - 1, par4, 0);
}
}
@Override @Override
public TileEntity createNewTileEntity(World world) public TileEntity createNewTileEntity(World world)
{ {
@@ -445,4 +433,15 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
world.setBlockTileEntity(x, y, z, te); world.setBlockTileEntity(x, y, z, te);
return te; return te;
} }
@Override
public void breakBlock(World world, int x, int y, int z, int oldBlockID, int oldMeta)
{
// This function runs on the server side after a block is replaced
// We MUST call super.breakBlock() since it involves removing tile entities
super.breakBlock(world, x, y, z, oldBlockID, oldMeta);
// Schedule rift regeneration for this block
mod_pocketDim.riftRegenerator.scheduleFastRegeneration(x, y, z, world);
}
} }

View File

@@ -34,16 +34,6 @@ public class TileEntityDimDoor extends DDTileEntityBase
return null; return null;
} }
@Override
public void invalidate()
{
super.invalidate();
if (!worldObj.isRemote && worldObj.getBlockId(xCoord, yCoord, zCoord) == 0)
{
mod_pocketDim.riftRegenerator.scheduleFastRegeneration(xCoord, yCoord, zCoord, worldObj);
}
}
@Override @Override
public void readFromNBT(NBTTagCompound nbt) public void readFromNBT(NBTTagCompound nbt)
{ {