mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-26 15:03:10 +00:00
Hopefully fix backwards compat
* Revert an unnecessary field movement
This commit is contained in:
1 parent
237c96e7e5
commit
f67ddeecc4
4 files changed
+11
-21
No files matched your search
+1
-1
@@ -2,4 +2,4 @@ mc_version=1.7.10
|
||||
forge_version=10.13.4.1614-1.7.10
|
||||
ccl_version=1.1.3.138
|
||||
ccc_version=1.0.7.+
|
||||
mod_version=2.1.0-GTNH-beta7
|
||||
mod_version=2.1.0-GTNH-beta8
|
||||
@@ -17,9 +17,9 @@ public class FuelRecipeHandler extends FurnaceRecipeHandler
|
||||
{
|
||||
public class CachedFuelRecipe extends CachedRecipe
|
||||
{
|
||||
public final TemplateFuelPair fuel;
|
||||
public final FuelPair fuel;
|
||||
|
||||
public CachedFuelRecipe(TemplateFuelPair fuel) {
|
||||
public CachedFuelRecipe(FuelPair fuel) {
|
||||
this.fuel = fuel;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public class FuelRecipeHandler extends FurnaceRecipeHandler
|
||||
@Override
|
||||
public List<String> handleItemTooltip(GuiRecipe gui, ItemStack stack, List<String> currenttip, int recipe) {
|
||||
CachedFuelRecipe crecipe = (CachedFuelRecipe) arecipes.get(recipe);
|
||||
TemplateFuelPair fuel = crecipe.fuel;
|
||||
FuelPair fuel = crecipe.fuel;
|
||||
float burnTime = fuel.burnTime / 200F;
|
||||
|
||||
if (gui.isMouseOver(fuel.stack, recipe) && burnTime < 1) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -39,8 +40,7 @@ public class FurnaceRecipeHandler extends TemplateRecipeHandler
|
||||
final PositionedStack ingred;
|
||||
final PositionedStack result;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
||||
public static class FuelPair {
|
||||
public FuelPair(ItemStack ingred, int burnTime) {
|
||||
this.stack = new PositionedStack(ingred, 51, 42, false);
|
||||
@@ -51,7 +51,7 @@ public class FurnaceRecipeHandler extends TemplateRecipeHandler
|
||||
public final int burnTime;
|
||||
}
|
||||
|
||||
public static List<TemplateFuelPair> afuels;
|
||||
public static ArrayList<FuelPair> afuels;
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,16 +51,6 @@ import static codechicken.lib.gui.GuiDraw.getMousePosition;
|
||||
public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageHandler
|
||||
{
|
||||
protected static ReentrantLock lock = new ReentrantLock();
|
||||
public static class TemplateFuelPair
|
||||
{
|
||||
public TemplateFuelPair(ItemStack ingred, int burnTime) {
|
||||
this.stack = new PositionedStack(ingred, 51, 42, false);
|
||||
this.burnTime = burnTime;
|
||||
}
|
||||
|
||||
public final PositionedStack stack;
|
||||
public final int burnTime;
|
||||
}
|
||||
|
||||
public static void findFuelsOnce() {
|
||||
// Ensure we only find fuels once, even if threaded
|
||||
@@ -98,23 +88,23 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
Stopwatch stopwatch = Stopwatch.createStarted();
|
||||
if (parallel) {
|
||||
try {
|
||||
FurnaceRecipeHandler.afuels = ItemList.forkJoinPool.submit(() -> ItemList.items.parallelStream().map(TemplateRecipeHandler::identifyFuel).filter(Objects::nonNull).collect(Collectors.toList())).get();
|
||||
FurnaceRecipeHandler.afuels = ItemList.forkJoinPool.submit(() -> ItemList.items.parallelStream().map(TemplateRecipeHandler::identifyFuel).filter(Objects::nonNull).collect(Collectors.toCollection(ArrayList::new))).get();
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
FurnaceRecipeHandler.afuels = new ArrayList<>();
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
FurnaceRecipeHandler.afuels = ItemList.items.stream().map(TemplateRecipeHandler::identifyFuel).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
FurnaceRecipeHandler.afuels = ItemList.items.stream().map(TemplateRecipeHandler::identifyFuel).filter(Objects::nonNull).collect(Collectors.toCollection(ArrayList::new));
|
||||
}
|
||||
|
||||
NEIClientConfig.logger.info("FindFuels took " + stopwatch.stop() );
|
||||
}
|
||||
|
||||
private static TemplateFuelPair identifyFuel(final ItemStack itemStack) {
|
||||
private static FurnaceRecipeHandler.FuelPair identifyFuel(final ItemStack itemStack) {
|
||||
if (efuels.contains(itemStack.getItem())) return null;
|
||||
final int burnTime = TileEntityFurnace.getItemBurnTime(itemStack);
|
||||
if (burnTime <= 0) return null;
|
||||
return new TemplateFuelPair(itemStack.copy(), burnTime);
|
||||
return new FurnaceRecipeHandler.FuelPair(itemStack.copy(), burnTime);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user