Add in a chunk coord plus method for PS

This commit is contained in:
Olof Larsson 2013-04-11 08:48:36 +02:00
parent 6d0e2f7669
commit ac524cd559

View File

@ -206,6 +206,27 @@ public final class PS implements Cloneable, Serializable, Comparable<PS>
return builder.build();
}
// -------------------------------------------- //
// FIELDS: PLUS
// -------------------------------------------- //
public PS plusChunkCoords(int chunkX, int chunkZ)
{
PSBuilder builder = this.builder();
if (builder.chunkX() != null)
{
builder.chunkX(builder.chunkX() + chunkX);
}
if (builder.chunkZ() != null)
{
builder.chunkZ(builder.chunkZ() + chunkZ);
}
return builder.build();
}
// -------------------------------------------- //
// PRIVATE CONSTRUCTOR
// -------------------------------------------- //