mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-25 14:34:54 +00:00
Update buildscript & apply automatic formatting rules
This commit is contained in:
1 parent
a7683b885d
commit
f7a900e910
173 files changed
+4581
-5321
No files matched your search
@@ -1,23 +1,19 @@
|
||||
package codechicken.nei.recipe;
|
||||
|
||||
import static codechicken.nei.NEIClientUtils.translate;
|
||||
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static codechicken.nei.NEIClientUtils.translate;
|
||||
|
||||
public class FuelRecipeHandler extends FurnaceRecipeHandler
|
||||
{
|
||||
public class CachedFuelRecipe extends CachedRecipe
|
||||
{
|
||||
public class FuelRecipeHandler extends FurnaceRecipeHandler {
|
||||
public class CachedFuelRecipe extends CachedRecipe {
|
||||
public final FuelPair fuel;
|
||||
|
||||
public CachedFuelRecipe(FuelPair fuel) {
|
||||
@@ -54,29 +50,26 @@ public class FuelRecipeHandler extends FurnaceRecipeHandler
|
||||
@SuppressWarnings("unchecked")
|
||||
private void loadAllSmelting() {
|
||||
// Note: Not safe as written for parallelStream
|
||||
final Map<ItemStack, ItemStack> smeltingRecipes = (Map<ItemStack, ItemStack>) FurnaceRecipes.smelting().getSmeltingList();
|
||||
final Map<ItemStack, ItemStack> smeltingRecipes =
|
||||
(Map<ItemStack, ItemStack>) FurnaceRecipes.smelting().getSmeltingList();
|
||||
smeltingRecipes.entrySet().stream()
|
||||
.map(recipe -> new SmeltingPair(recipe.getKey(), recipe.getValue()))
|
||||
.collect(Collectors.toCollection(() -> mfurnace));
|
||||
|
||||
.map(recipe -> new SmeltingPair(recipe.getKey(), recipe.getValue()))
|
||||
.collect(Collectors.toCollection(() -> mfurnace));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
// Note: Not safe as written for parallelStream
|
||||
if (outputId.equals("fuel") && getClass() == FuelRecipeHandler.class)
|
||||
afuels.stream()
|
||||
.map(CachedFuelRecipe::new)
|
||||
.collect(Collectors.toCollection(() -> arecipes));
|
||||
afuels.stream().map(CachedFuelRecipe::new).collect(Collectors.toCollection(() -> arecipes));
|
||||
}
|
||||
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
// Note: Not safe as written for parallelStream
|
||||
afuels.stream()
|
||||
.filter(fuel -> fuel != null && fuel.stack != null && fuel.stack.contains(ingredient))
|
||||
.map(CachedFuelRecipe::new)
|
||||
.collect(Collectors.toCollection(() -> arecipes));
|
||||
|
||||
.filter(fuel -> fuel != null && fuel.stack != null && fuel.stack.contains(ingredient))
|
||||
.map(CachedFuelRecipe::new)
|
||||
.collect(Collectors.toCollection(() -> arecipes));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -96,6 +89,8 @@ public class FuelRecipeHandler extends FurnaceRecipeHandler
|
||||
NumberFormat numberInstance = NumberFormat.getNumberInstance();
|
||||
numberInstance.setMaximumFractionDigits(2);
|
||||
String smeltCount = numberInstance.format(fuel.burnTime / 200f);
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(translate("recipe.fuel.smeltCount", smeltCount), 73, 51, 0xFF000000);
|
||||
Minecraft.getMinecraft()
|
||||
.fontRenderer
|
||||
.drawString(translate("recipe.fuel.smeltCount", smeltCount), 73, 51, 0xFF000000);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user