Skip to content

Commit

Permalink
Fixed bug with duplicate keys for entity spawns.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Aug 20, 2020
1 parent ba46720 commit 30644f5
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/main/java/world/bentobox/skygrid/generators/WorldStyles.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private TreeMap<Integer,EntityType> normalSpawns() {
types.add(EntityType.TURTLE);
types.add(EntityType.VEX);

int step = 1000 / types.size();
int step = 10000 / types.size();
int i = step;
for (EntityType type: types) {
s.put(i, type);
Expand All @@ -184,18 +184,19 @@ private TreeMap<Integer,EntityType> normalSpawns() {
*/
private TreeMap<Integer,EntityType> netherSpawns() {
TreeMap<Integer,EntityType> s = new TreeMap<>();
// Keys should increment and cannot be the same!
s.put(25, EntityType.BLAZE);
s.put(50, EntityType.MAGMA_CUBE);
s.put(75, EntityType.SKELETON);
s.put(100, EntityType.WITHER_SKELETON);
s.put(150, EntityType.SKELETON_HORSE);
s.put(25, EntityType.ENDERMAN);
s.put(175, EntityType.ENDERMAN);
if (Enums.getIfPresent(EntityType.class, "ZOMBIFIED_PIGLIN").isPresent()) {
s.put(125, EntityType.ZOMBIFIED_PIGLIN);
s.put(50, EntityType.STRIDER);
s.put(125, EntityType.PIGLIN);
s.put(125, EntityType.ZOGLIN);
s.put(125, EntityType.HOGLIN);
s.put(300, EntityType.ZOMBIFIED_PIGLIN);
s.put(350, EntityType.STRIDER);
s.put(475, EntityType.PIGLIN);
s.put(600, EntityType.ZOGLIN);
s.put(725, EntityType.HOGLIN);
}
return s;
}
Expand All @@ -208,7 +209,7 @@ private TreeMap<Integer,EntityType> endSpawns() {
TreeMap<Integer,EntityType> s = new TreeMap<>();
s.put(50, EntityType.ENDERMAN);
s.put(55, EntityType.ENDERMITE);
s.put(10, EntityType.SHULKER);
s.put(65, EntityType.SHULKER);
return s;
}

Expand Down

0 comments on commit 30644f5

Please sign in to comment.