1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Remove nested condition

This commit is contained in:
FN-FAL113 2022-01-31 10:11:00 +08:00 committed by GitHub
parent 45b4268871
commit 6cc4695e8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -311,19 +311,17 @@ class MiningTask implements Runnable {
for (MachineFuel fuelType : miner.fuelTypes) { for (MachineFuel fuelType : miner.fuelTypes) {
ItemStack item = inv.getContents()[i]; ItemStack item = inv.getContents()[i];
if (fuelType.test(item)) {
/* /*
* Fixes #3336 * Fixes #3336
* Respects the state of the miner if there are * Respects the state of the miner if there are
* no any errors during #setPistonState * no any errors during #setPistonState
*/ */
if (running) { if (fuelType.test(item) && running) {
ItemUtils.consumeItem(item, false); ItemUtils.consumeItem(item, false);
if (miner instanceof AdvancedIndustrialMiner) { if (miner instanceof AdvancedIndustrialMiner) {
inv.addItem(new ItemStack(Material.BUCKET)); inv.addItem(new ItemStack(Material.BUCKET));
} }
}
return fuelType.getTicks(); return fuelType.getTicks();
} }