package com.github.lunatrius.core.world.chunk;

import net.minecraft.util.math.BlockPos;

import java.util.Random;

public class ChunkHelper {
    private static final Random RANDOM = new Random();

    public static boolean isSlimeChunk(final long seed, final BlockPos pos) {
        final int x = pos.getX() >> 4;
        final int z = pos.getZ() >> 4;
        RANDOM.setSeed(seed + (x * x * 4987142) + (x * 5947611) + (z * z * 4392871) + (z * 389711) ^ 987234911);
        return RANDOM.nextInt(10) == 0;
    }
}

@@ -284,19 +284,20 @@
   final 
-int
+long
  x = pos
@@ -328,11 +328,12 @@
 nal 
-int
+long
  z =
@@ -396,16 +396,17 @@
  4987142
+L
 ) + (x *
@@ -413,16 +413,17 @@
  5947611
+L
 ) + (z *
@@ -434,16 +434,17 @@
  4392871
+L
 ) + (z *
@@ -450,16 +450,17 @@
 * 389711
+L
 ) %5E 9872
@@ -464,16 +464,17 @@
 87234911
+L
 );%0A     

Use long for x/z instead of int to prevent a MAX_INT overflow. Fixes gh-40