Skip to content

Commit

Permalink
made elytra a bit more popular in end chests
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Jul 6, 2019
1 parent a3fd90c commit 219c2a0
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/main/java/world/bentobox/skygrid/generators/SkyGridPop.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public class SkyGridPop extends BlockPopulator {
// double format - integer part is the quantity, decimal is the probability
END_ITEMS.put(Material.FIREWORK_ROCKET, 20.2); // for elytra
END_ITEMS.put(Material.EMERALD, 1.1);
END_ITEMS.put(Material.CHORUS_FRUIT, 3.2);
END_ITEMS.put(Material.ELYTRA, 1.1);
END_ITEMS.put(Material.SHULKER_BOX, 1.2);
END_ITEMS.put(Material.CHORUS_FRUIT, 3.1);
END_ITEMS.put(Material.ELYTRA, 1.2);
END_ITEMS.put(Material.SHULKER_BOX, 1.1);
}

public SkyGridPop(SkyGrid addon) {
Expand Down Expand Up @@ -271,14 +271,20 @@ else if (rand1 < 0.5) {
set.add(new ItemStack(Material.ENDERMAN_SPAWN_EGG)); //enderman spawn egg
if (random.nextDouble() < 0.4)
set.add(itemInRange(256, 294, random)); //weapon/random
for (Material mat : Material.values()) {
if (END_ITEMS.containsKey(mat)) {
int qty = (int)((double)END_ITEMS.get(mat));
double probability = END_ITEMS.get(mat) - qty;
END_ITEMS.entrySet().forEach(en -> {
if (random.nextDouble() < en.getValue()) {
// The quantity and probability are encoded. The integer is the qty, the decimal the prob
int qty = en.getValue().intValue();
double probability = en.getValue() - qty;
if (random.nextDouble() < probability) {
set.add(new ItemStack(mat, qty));
set.add(new ItemStack(en.getKey(), qty));
}
}
});
for (Material mat : Material.values()) {
if (END_ITEMS.containsKey(mat)) {

}
}
if (random.nextDouble() < 0.2)
set.add(new ItemStack(Material.SHULKER_SPAWN_EGG)); //shulker spawn egg
Expand Down

0 comments on commit 219c2a0

Please sign in to comment.