Skip to content

Commit

Permalink
Merge pull request #3973 from iTwins/fix/generate_geo_resources
Browse files Browse the repository at this point in the history
fix generating geo resources every scan (fixes #3974)
  • Loading branch information
TheBusyBiscuit authored Sep 18, 2023
2 parents d683a63 + 62cb0b2 commit 37681ca
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public void scan(@Nonnull Player p, @Nonnull Block block, int page) {
for (int i = page * 28; i < resources.size() && i < (page + 1) * 28; i++) {
GEOResource resource = resources.get(i);
OptionalInt optional = getSupplies(resource, block.getWorld(), x, z);
int supplies = optional.orElse(generate(resource, block.getWorld(), x, block.getY(), z));
int supplies = optional.orElseGet(() -> generate(resource, block.getWorld(), x, block.getY(), z));
String suffix = Slimefun.getLocalization().getResourceString(p, ChatUtils.checkPlurality("tooltips.unit", supplies));

ItemStack item = new CustomItemStack(resource.getItem(), "&f" + resource.getName(p), "&8\u21E8 &e" + supplies + ' ' + suffix);
Expand Down

0 comments on commit 37681ca

Please sign in to comment.