Skip to content

Commit

Permalink
Prevent non-items being put into chests. Update to 1.21.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Aug 12, 2024
1 parent 0f1f629 commit fa439ed
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
24 changes: 18 additions & 6 deletions src/main/java/world/bentobox/skygrid/generators/SkyGridPop.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,28 @@ public SkyGridPop(SkyGrid addon) {
this.islandHeight = addon.getSettings().getIslandHeight();
// Load the chest items
for (Entry<Material, Integer> en : addon.getSettings().getChestItemsOverworld().entrySet()) {
worldTotal += en.getValue();
chestItemsWorld.put(worldTotal, en.getKey());
if (en.getKey().isItem()) {
worldTotal += en.getValue();
chestItemsWorld.put(worldTotal, en.getKey());
} else {
addon.logWarning(en.getKey() + " is not an item so cannot go in a chest.");
}
}
for (Entry<Material, Integer> en : addon.getSettings().getChestItemsNether().entrySet()) {
netherTotal += en.getValue();
chestItemsNether.put(netherTotal, en.getKey());
if (en.getKey().isItem()) {
netherTotal += en.getValue();
chestItemsNether.put(netherTotal, en.getKey());
} else {
addon.logWarning(en.getKey() + " is not an item so cannot go in a chest.");
}
}
for (Entry<Material, Integer> en : addon.getSettings().getChestItemsEnd().entrySet()) {
endTotal += en.getValue();
chestItemsEnd.put(endTotal, en.getKey());
if (en.getKey().isItem()) {
endTotal += en.getValue();
chestItemsEnd.put(endTotal, en.getKey());
} else {
addon.logWarning(en.getKey() + " is not an item so cannot go in a chest.");
}
}
addon.log(LOADED + chestItemsWorld.size() + " chest items for world");
addon.log(LOADED + chestItemsNether.size() + " chest items for nether world");
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ world:
SALMON_BUCKET: 10
SALMON_SPAWN_EGG: 10
SALMON: 10
SCUTE: 100
TURTLE_SCUTE: 100
ARMADILLO_SCUTE: 100
WOLF_ARMOR: 100
SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE: 10
SHEARS: 10
SHEEP_SPAWN_EGG: 10
Expand Down

0 comments on commit fa439ed

Please sign in to comment.