Rules API

Read what the server allows BuildPrint to do, and the printer's limits.

For a mod that does a similar job, such as breaking blocks a build does not want, and wants to keep to the same rules as BuildPrint on this server. From BuildPrint 0.1.19.

Java
if (!BuildprintRules.allows("EASY_DESTROY")) return;
int range = BuildprintRules.printerRange();
double reach = BuildprintRules.printerReach();

Good to know #

  • Features are the ones a server can turn off with BuildPrint Policy: EASY_PLACE, DRAG_PLACE, EASY_DESTROY, ANGEL_PLACEMENT, AUTO_ROTATE, PRINTER, CREATE_SCHEMATICS and PASTE. Case does not matter.
  • A feature the server does not mention is allowed, and so is a name this BuildPrint does not know.
  • The printer numbers are the player's settings after the server's caps.
  • printerReach() is measured from the eyes to the nearest point of the clicked block. On a server it is learned from which clicks the server accepted.

Reference #

BuildprintRulesWhat it does
isAvailable()In a world.
serverHasPolicy()Whether the server runs BuildPrint Policy.
allows(String feature) / blocked()Whether a feature is allowed, and the features that are not.
printerBlocksPerTick() / printerRange()Most blocks the printer places per tick, and how far out, in blocks.
printerReach()How far the printer clicks right now. 0 outside a world.
pasteMaxBlocks()Most blocks one paste may change here. 0 means no cap.

Something missing or wrong on this page? Say so on Discord.