Advertisement
onnowhere

Random blockstate id from coordinate

Sep 8th, 2019
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import java.util.Random;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. get_variant(7, 6, 19, 724);
  6. }
  7.  
  8. public static void get_variant(int x, int y, int z, int weight) {
  9. Random random = new Randomget_random_seed(x, y, z));
  10. int output = Math.abs((int)random.nextLong()) % weight;
  11. System.out.println(output);
  12. }
  13.  
  14. public static long get_random_seed(int x, int y, int z) {
  15. long long4 = (long)(x * 3129871) ^ z * 116129781L ^ (long)y;
  16. long4 = long4 * long4 * 42317861L + long4 * 11L;
  17. return long4 >> 16;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement