1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

Merge pull request #3973 from iTwins/fix/generate_geo_resources

fix generating geo resources every scan (fixes #3974)
This commit is contained in:
TheBusyBiscuit 2023-09-18 18:31:43 +02:00 committed by GitHub
commit 37681caf6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -237,7 +237,7 @@ public class ResourceManager {
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);