Skip to content

Instantly share code, notes, and snippets.

@mjtb49
Created February 28, 2021 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjtb49/9686285874c9ffba828c54f4776573aa to your computer and use it in GitHub Desktop.
Save mjtb49/9686285874c9ffba828c54f4776573aa to your computer and use it in GitHub Desktop.
import kaptainwutax.biomeutils.source.NetherBiomeSource;
import kaptainwutax.featureutils.structure.NetherFossil;
import kaptainwutax.seedutils.mc.MCVersion;
import java.util.Random;
public class NetherFossils {
static final NetherFossil FOSSIL = new NetherFossil(MCVersion.v1_16_1);
public static void printSomeFossilSeeds(int some) {
Random r = new Random();
int seedsFound = 0;
int seedsChecked = 0;
while (seedsFound < some) {
seedsChecked++;
long seed = r.nextLong();
NetherBiomeSource nbs = new NetherBiomeSource(MCVersion.v1_16_1, seed);
//if (FOSSIL.getInRegion(seed ,0,0, new ChunkRand()).equals(CPos.ZERO))
if (FOSSIL.canSpawn(0,0, nbs)) {
Random r2 = new Random(seed);
int x = r2.nextInt(16);
System.out.println(seed + " " + x + " " + r2.nextInt(16));
coordToStronghold(x);
seedsFound++;
}
}
System.out.println(seedsChecked);
System.out.println(seedsFound);
}
public static void coordToStronghold(int fossilX) {
double angle = 2 * Math.PI * ((1.0 / 16.0) * fossilX + (1.0 / 32.0));
System.out.print(fossilX + " s1: " + Math.round(256 * Math.cos(angle)) + " " + Math.round(256 * Math.sin(angle)));
angle += 2 * Math.PI / 3.0;
System.out.print(" s2: " + Math.round(256 * Math.cos(angle)) + " " + Math.round(256 * Math.sin(angle)));
angle += 2 * Math.PI / 3.0;
System.out.print(" s3: " + Math.round(256 * Math.cos(angle)) + " " + Math.round(256 * Math.sin(angle)));
System.out.println();
}
public static void genFirstStrongholdsForBoolFeatureWithDistance(double probability, int numDistances) {
double angle = Math.PI * probability;
int distincrement = 160 / numDistances;
int dist = 176 + 160 / numDistances / 2;
System.out.println("Table for s1 with "+probability+" chance and "+numDistances+" distance sectors");
for(int i = 0; i < numDistances; i++) {
System.out.println(i+" s1: " + Math.round(dist * Math.cos(angle)) + " " + Math.round(dist * Math.sin(angle)));
dist += distincrement;
}
System.out.println();
}
public static void genStrongholdsForBoolFeature(double probability, int dist) {
double angle = Math.PI * probability;
System.out.println("Table for "+probability+" at "+dist+" blocks out in the nether:");
System.out.print(" s1: " + Math.round(dist * Math.cos(angle)) + " " + Math.round(dist * Math.sin(angle)));
angle += 2 * Math.PI / 3.0;
System.out.print(" s2: " + Math.round(dist * Math.cos(angle)) + " " + Math.round(dist * Math.sin(angle)));
angle += 2 * Math.PI / 3.0;
System.out.print(" s3: " + Math.round(dist * Math.cos(angle)) + " " + Math.round(dist * Math.sin(angle)));
System.out.println();
System.out.println();
}
public static void main(String[] args) {
genStrongholdsForBoolFeature(.1, 256);
genFirstStrongholdsForBoolFeatureWithDistance(.1, 2);
genFirstStrongholdsForBoolFeatureWithDistance(.1, 4);
genStrongholdsForBoolFeature(.07, 256);
genFirstStrongholdsForBoolFeatureWithDistance(.07, 2);
genFirstStrongholdsForBoolFeatureWithDistance(.07, 4);
genStrongholdsForBoolFeature(1.0/50, 256);
genStrongholdsForBoolFeature(1.0/7, 256);
genStrongholdsForBoolFeature(1.0/15, 256);
genStrongholdsForBoolFeature(1.0/5, 256);
genStrongholdsForBoolFeature(1.0/4, 256);
genStrongholdsForBoolFeature(1.0/20, 256);
genFirstStrongholdsForBoolFeatureWithDistance(1.0/20, 4);
genFirstStrongholdsForBoolFeatureWithDistance(1.0/4, 8);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment