NP ~ Data Objects

Most people won’t need to know this stuff.

Voxels

Each world is divided into a 3D grid of voxels, each of which can be assigned to one or zero properties. A voxel may be configured to be any size, but is currently set to be the same size as a chunk (16 x 256 x 16). Therefore, the word voxel may be used interchangeably with chunk.

Value

Each voxel has a value which is the total value of each block in the voxel. Natural blocks like stone, dirt, grass, etc. have 0 value, so these will not help with claiming land. Most blocks have a value of 1. Important blocks like chests, furnaces, anvils, etc. have a value of 8. Mineral blocks (not ore) have a value of 4.

When a voxel is first interacted with, Natural Protection will calculate the value of the voxel, and set that as the natural value. This is a suboptimal solution to natural structures being claimable without players building anything. In the future, Natural Protection will use block logger data from BlocksHub to calculate value, if it is installed.

Artificial value is the natural value subtracted from the total value of a voxel. A voxel needs 64 artificial value to be claimable. That’s a stack of planks or 8 chests. Voxels within a radius of 1 are protected from grief and included as part of the property.

An existing property will automatically expand when a voxel within a radius of 2 becomes claimable. A voxel will be automatically unclaimed when it is no longer claimable, but it may still be protected if it is near a claimed voxel.

Table: np_voxels

  • world: The world that the voxel exists in.
  • x, y, z: The coordinates of the voxel. This is not the same as block/entity coordinates!
  • value: The total value of the property.
  • natvalue: The portion of the value which is part of a naturally generated structure.
  • property_id: An integer representing a property.

Properties

An area of protected land. Voxels don’t need to be connected.

Table: np_properties

  • property_id: An integer representing the property.
  • name: The property’s name. May contain color codes.
  • owner: An integer representing the user who owns this property.
  • icon: The material to use as an icon for this property.
  • is_admin: 0 if a normal property, 1 if it belongs to an administrator.
  • is_public: 0 if a normal property, 1 to make it public and disable all protections.
  • allow_tnt: 0 to cancel TNT explosions, 1 to allow TNT explosions.
  • allow_mobgrief: 0 to cancel mob griefing, 1 to allow mob griefing.
  • allow_escape: 0 to always allow teleports, 1 to prevent non-members from teleporting away.

Users

Most users are players, but it is also possible to add a “fake” user. This is useful for NPCs or testing the plugin without friends. :(

Table: np_users

  • user_id: An integer representing the user.
  • uuid: The player’s UUID given by Mojang, if this user is a player.
  • name: The user’s name.
  • is_fake: 0 if a player, 1 if a fake user (NPC).
  • skinname: The name to use to load a skin.

Trusts

An object which allows a player to access a property. The owner of a property does not need a trust. (See also: Roles)

Table: np_trusts

  • user_id: An integer representing a user.
  • property_id: An integer representing a property.
  • role: The role assigned to this player (non-owner).
  • date_added: The date and time that this trust was created or edited.
  • date_expire: The date and time that this trust will expire.