Some general cleanup
This commit is contained in:
parent
bbc9dd3b37
commit
b5707b144e
20 changed files with 29 additions and 59 deletions
|
@ -93,7 +93,6 @@ public class IronAlloyFurnaceBlockEntity extends AbstractIronMachineBlockEntity
|
|||
return;
|
||||
}
|
||||
|
||||
ItemStack outputStack = ItemStack.EMPTY;
|
||||
RebornRecipe currentRecipe = null;
|
||||
for (RebornRecipe recipeType : ModRecipes.ALLOY_SMELTER.getRecipes(world)) {
|
||||
if (hasAllInputs(recipeType)) {
|
||||
|
@ -104,7 +103,7 @@ public class IronAlloyFurnaceBlockEntity extends AbstractIronMachineBlockEntity
|
|||
if (currentRecipe == null) {
|
||||
return;
|
||||
}
|
||||
outputStack = currentRecipe.getOutputs().get(0);
|
||||
ItemStack outputStack = currentRecipe.getOutputs().get(0);
|
||||
if (outputStack.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import net.minecraft.entity.ExperienceOrbEntity;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.recipe.AbstractCookingRecipe;
|
||||
import net.minecraft.recipe.RecipeType;
|
||||
import net.minecraft.recipe.SmeltingRecipe;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
|
@ -76,10 +77,7 @@ public class IronFurnaceBlockEntity extends AbstractIronMachineBlockEntity imple
|
|||
|
||||
private float getExperienceFor(ItemStack stack) {
|
||||
Optional<SmeltingRecipe> recipe = world.getRecipeManager().getFirstMatch(RecipeType.SMELTING, this, world);
|
||||
if (recipe.isPresent()) {
|
||||
return recipe.get().getExperience();
|
||||
}
|
||||
return 0;
|
||||
return recipe.map(AbstractCookingRecipe::getExperience).orElse(0F);
|
||||
}
|
||||
|
||||
// AbstractIronMachineBlockEntity
|
||||
|
|
|
@ -344,11 +344,10 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
|
|||
.boxed().collect(Collectors.toList());
|
||||
|
||||
boolean needsBalance = false;
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
int required = split[i];
|
||||
for (int required : split) {
|
||||
if (slotEnvTyperubution.contains(required)) {
|
||||
//We need to remove the int, not at the int, this seems to work around that
|
||||
slotEnvTyperubution.remove(new Integer(required));
|
||||
slotEnvTyperubution.remove(Integer.valueOf(required));
|
||||
} else {
|
||||
needsBalance = true;
|
||||
}
|
||||
|
|
|
@ -246,11 +246,10 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
|
|||
.boxed().collect(Collectors.toList());
|
||||
|
||||
boolean needsBalance = false;
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
int required = split[i];
|
||||
for (int required : split) {
|
||||
if (slotEnvTyperubution.contains(required)) {
|
||||
//We need to remove the int, not at the int, this seems to work around that
|
||||
slotEnvTyperubution.remove(new Integer(required));
|
||||
slotEnvTyperubution.remove(Integer.valueOf(required));
|
||||
} else {
|
||||
needsBalance = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue