Try to fix crafting

This commit is contained in:
Bruno Rybársky 2024-11-04 15:31:36 +01:00
parent c1648f1e13
commit fb52a6580f
No known key found for this signature in database
GPG Key ID: 6C9206A821C70598
3 changed files with 10 additions and 9 deletions

@ -5,13 +5,13 @@ org.gradle.jvmargs=-Xmx1G
minecraft_version=1.21.3 minecraft_version=1.21.3
yarn_mappings=1.21.3+build.2 yarn_mappings=1.21.3+build.2
loader_version=0.16.8 loader_version=0.16.9
# Fabric API # Fabric API
fabric_version=0.107.0+1.21.3 fabric_version=0.107.0+1.21.3
# Mod Properties # Mod Properties
mod_version=3.3.0 mod_version=3.3.1
maven_group=systems.brn maven_group=systems.brn
archives_base_name=Serverstorage archives_base_name=Serverstorage

@ -56,7 +56,7 @@ public class ServerStorage implements ModInitializer {
public static BlockEntityType<InventoryInterfaceBlockEntity> INVENTORY_INTERFACE_BLOCK_ENTITY; public static BlockEntityType<InventoryInterfaceBlockEntity> INVENTORY_INTERFACE_BLOCK_ENTITY;
public static final GameRules.Key<GameRules.BooleanRule> ServerStorage_Crafting_Enable = public static final GameRules.Key<GameRules.BooleanRule> ServerStorage_Crafting_Enable =
GameRuleRegistry.register("serverstorage_crafting_module", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(false)); GameRuleRegistry.register("serverstorage_crafting_module", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true));
public static final GameRules.Key<GameRules.BooleanRule> ServerStorage_Terminal_Enable = public static final GameRules.Key<GameRules.BooleanRule> ServerStorage_Terminal_Enable =
GameRuleRegistry.register("serverstorage_terminal_module", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true)); GameRuleRegistry.register("serverstorage_terminal_module", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true));

@ -180,12 +180,13 @@ public class Util {
canMake = false; canMake = false;
break; break;
} }
int occurrences = ingredientCounts.getOrDefault(ingredient.getMatchingItems().getFirst(),0); // int occurrences = ingredientCounts.getOrDefault(ingredient.getMatchingItems().getFirst(),0);
if (occurrences == 0) { // if (occurrences == 0) {
canMake = false; // canMake = false;
break; // break;
} // }
maxAmount = Math.min(maxAmount, totalAvailable / occurrences); // maxAmount = Math.min(maxAmount, totalAvailable / occurrences);
maxAmount = Math.min(maxAmount, totalAvailable);
for (Map.Entry<ItemStack, Integer> entry : inputsTemp.entrySet()) { for (Map.Entry<ItemStack, Integer> entry : inputsTemp.entrySet()) {
ItemStack stackIn = entry.getKey(); ItemStack stackIn = entry.getKey();