diff --git a/buildAndRunClient.sh b/buildAndRunClient.sh new file mode 100755 index 00000000000..2740ba29990 --- /dev/null +++ b/buildAndRunClient.sh @@ -0,0 +1,34 @@ +gnome-terminal -- bash -c " +while true; do + # Run the build command and capture output + output=\$(./gradlew build 2>&1) + echo \"\$output\" + + # Check if the build was successful + if [[ \$? -eq 0 ]]; then + ./gradlew runClient + read -p 'Press Enter to close...' + break + fi + + # Check for Spotless error + if echo \"\$output\" | grep -q 'spotlessJavaCheck FAILED'; then + echo 'Spotless check failed. Press a to apply spotless fixes and retry, or q to quit.' + read -n 1 -s -r key + if [[ \"\$key\" == \"a\" ]]; then + ./gradlew spotlessApply + echo 'Spotless fixes applied. Retrying build...' + elif [[ \"\$key\" == \"q\" ]]; then + echo 'Exiting.' + exit 1 + else + echo 'Invalid option. Exiting.' + exit 1 + fi + else + echo 'Build failed for other reasons. Press Enter to exit.' + read -p 'Press Enter to close...' + exit 1 + fi +done +" \ No newline at end of file diff --git a/src/main/java/org/cyclops/integrateddynamics/blockentity/BlockEntitySqueezer.java b/src/main/java/org/cyclops/integrateddynamics/blockentity/BlockEntitySqueezer.java index 184eb2e8973..558b5c08b46 100644 --- a/src/main/java/org/cyclops/integrateddynamics/blockentity/BlockEntitySqueezer.java +++ b/src/main/java/org/cyclops/integrateddynamics/blockentity/BlockEntitySqueezer.java @@ -164,7 +164,7 @@ protected void update(Level level, BlockPos pos, BlockState blockState, BlockEnt ItemStack oldItem = blockEntity.getInventory().getItem(0); blockEntity.getInventory().setItem(0, ItemStack.EMPTY); for (RecipeSqueezer.IngredientChance itemStackChance : recipe.assemble(oldItem)) { - if (itemStackChance.getChance() == 1.0F || itemStackChance.getChance() >= level.random.nextFloat()) { + if (itemStackChance.getChance() == 1.0F || itemStackChance.getChance() >= level.random.nextFloat()) { ItemStack resultStack = itemStackChance.getIngredientFirst().copy(); for (Direction side : Direction.values()) { if (!resultStack.isEmpty() && side != Direction.UP) { diff --git a/src/main/resources/data/integrateddynamics/recipes/mechanical_squeezer/convenience/mechanical_facade_squeeze.json b/src/main/resources/data/integrateddynamics/recipes/mechanical_squeezer/convenience/mechanical_facade_squeeze.json index cd756306f18..1ca3ae19c37 100644 --- a/src/main/resources/data/integrateddynamics/recipes/mechanical_squeezer/convenience/mechanical_facade_squeeze.json +++ b/src/main/resources/data/integrateddynamics/recipes/mechanical_squeezer/convenience/mechanical_facade_squeeze.json @@ -1,19 +1,25 @@ { "type": "integrateddynamics:mechanical_squeezer", - "item": "integrateddynamics:facade", + "item": { + "item": "integrateddynamics:facade" + }, "result": { - "items": [ - { - "item": "integrateddynamics:facade", - "chance": 1, - "count": 1 - }, - { - "item": "integrateddynamics:facade", - "chance": 1, - "count": 1 - } - ] + "items": [ + { + "item": { + "item": "integrateddynamics:facade", + "chance": 1, + "count": 1 + } + }, + { + "item": { + "item": "integrateddynamics:facade", + "chance": 1, + "count": 5 + } + } + ] }, "duration": 20 } \ No newline at end of file diff --git a/src/main/resources/data/integrateddynamics/recipes/squeezer/convenience/facade_squeeze.json b/src/main/resources/data/integrateddynamics/recipes/squeezer/convenience/facade_squeeze.json index d68dfa42d40..4786ef76054 100644 --- a/src/main/resources/data/integrateddynamics/recipes/squeezer/convenience/facade_squeeze.json +++ b/src/main/resources/data/integrateddynamics/recipes/squeezer/convenience/facade_squeeze.json @@ -1,18 +1,24 @@ { - "type": "integrateddynamics:squeezer", - "item": "integrateddynamics:facade", + "type": "integrateddynamics:mechanical_squeezer", + "item": { + "item": "integrateddynamics:facade" + }, "result": { "items": [ { - "item": "integrateddynamics:facade", - "chance": 1, - "count": 1 + "item": { + "item": "integrateddynamics:facade", + "chance": 1, + "count": 1 + } }, { - "item": "integrateddynamics:facade", - "chance": 1, - "count": 1 - } - ] + "item": { + "item": "integrateddynamics:facade", + "chance": 1, + "count": 5 + } + } + ] } } \ No newline at end of file