Fix chunk damage during terrain gen
This commit is contained in:
parent
6fb8ee7ba5
commit
535437f51e
@ -128,6 +128,7 @@ namespace TrueCraft.Core.World
|
|||||||
public void SetBlockID(Coordinates3D coordinates, byte value)
|
public void SetBlockID(Coordinates3D coordinates, byte value)
|
||||||
{
|
{
|
||||||
IsModified = true;
|
IsModified = true;
|
||||||
|
if (ParentRegion != null)
|
||||||
ParentRegion.DamageChunk(Coordinates);
|
ParentRegion.DamageChunk(Coordinates);
|
||||||
int index = coordinates.Y + (coordinates.Z * Height) + (coordinates.X * Height * Width);
|
int index = coordinates.Y + (coordinates.Z * Height) + (coordinates.X * Height * Width);
|
||||||
Data[index] = value;
|
Data[index] = value;
|
||||||
@ -166,6 +167,7 @@ namespace TrueCraft.Core.World
|
|||||||
public void SetMetadata(Coordinates3D coordinates, byte value)
|
public void SetMetadata(Coordinates3D coordinates, byte value)
|
||||||
{
|
{
|
||||||
IsModified = true;
|
IsModified = true;
|
||||||
|
if (ParentRegion != null)
|
||||||
ParentRegion.DamageChunk(Coordinates);
|
ParentRegion.DamageChunk(Coordinates);
|
||||||
int index = coordinates.Y + (coordinates.Z * Height) + (coordinates.X * Height * Width);
|
int index = coordinates.Y + (coordinates.Z * Height) + (coordinates.X * Height * Width);
|
||||||
Metadata[index] = value;
|
Metadata[index] = value;
|
||||||
@ -178,6 +180,7 @@ namespace TrueCraft.Core.World
|
|||||||
public void SetSkyLight(Coordinates3D coordinates, byte value)
|
public void SetSkyLight(Coordinates3D coordinates, byte value)
|
||||||
{
|
{
|
||||||
IsModified = true;
|
IsModified = true;
|
||||||
|
if (ParentRegion != null)
|
||||||
ParentRegion.DamageChunk(Coordinates);
|
ParentRegion.DamageChunk(Coordinates);
|
||||||
int index = coordinates.Y + (coordinates.Z * Height) + (coordinates.X * Height * Width);
|
int index = coordinates.Y + (coordinates.Z * Height) + (coordinates.X * Height * Width);
|
||||||
SkyLight[index] = value;
|
SkyLight[index] = value;
|
||||||
@ -190,6 +193,7 @@ namespace TrueCraft.Core.World
|
|||||||
public void SetBlockLight(Coordinates3D coordinates, byte value)
|
public void SetBlockLight(Coordinates3D coordinates, byte value)
|
||||||
{
|
{
|
||||||
IsModified = true;
|
IsModified = true;
|
||||||
|
if (ParentRegion != null)
|
||||||
ParentRegion.DamageChunk(Coordinates);
|
ParentRegion.DamageChunk(Coordinates);
|
||||||
int index = coordinates.Y + (coordinates.Z * Height) + (coordinates.X * Height * Width);
|
int index = coordinates.Y + (coordinates.Z * Height) + (coordinates.X * Height * Width);
|
||||||
BlockLight[index] = value;
|
BlockLight[index] = value;
|
||||||
@ -215,6 +219,7 @@ namespace TrueCraft.Core.World
|
|||||||
else
|
else
|
||||||
TileEntities[coordinates] = value;
|
TileEntities[coordinates] = value;
|
||||||
IsModified = true;
|
IsModified = true;
|
||||||
|
if (ParentRegion != null)
|
||||||
ParentRegion.DamageChunk(Coordinates);
|
ParentRegion.DamageChunk(Coordinates);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user