Skip to content

Int64 5.46.0 ​

final class · pocketmine\world\generator\vanilla\math\Int64 · source

Wrapping 64-bit integer arithmetic with Java long semantics. PHP turns overflowing int + and * into floats, so these helpers work on 16/32-bit limbs instead. They are only used when seeding random sources, never in per-block loops.

Methods ​

add() ​

php
public static function add(int $a, int $b) : int

javaStringHash() ​

php
public static function javaStringHash(string $s) : int

Java's String.hashCode().

mul() ​

php
public static function mul(int $a, int $b) : int

mulInt32() ​

php
public static function mulInt32(int $a, int $b) : int

Java's 32-bit int * int with overflow.

positionSeed() ​

php
public static function positionSeed(int $x, int $y, int $z) : int

Minecraft's positional seed hash (Mth.getSeed).

rotl() ​

php
public static function rotl(int $value, int $shift) : int

sub() ​

php
public static function sub(int $a, int $b) : int

toInt32() ​

php
public static function toInt32(int $value) : int

Java's (int) cast of a long.

ushr() ​

php
public static function ushr(int $value, int $shift) : int

Java's >>>

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.