aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/plugin/cooking
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2019-12-24 11:31:40 +0800
committershedaniel <daniel@shedaniel.me>2019-12-24 11:31:40 +0800
commit08d80d588a36598114087a79917e36e9d2cc97c3 (patch)
tree95cde698bbf1eca2f83143d39fd206cf2dc803f2 /src/main/java/me/shedaniel/rei/plugin/cooking
parent7d438f554c4173880a407a6bb8fc80b8a4723845 (diff)
downloadRoughlyEnoughItems-08d80d588a36598114087a79917e36e9d2cc97c3.tar.gz
RoughlyEnoughItems-08d80d588a36598114087a79917e36e9d2cc97c3.tar.bz2
RoughlyEnoughItems-08d80d588a36598114087a79917e36e9d2cc97c3.zip
Finishing workstation usage and close #220
Diffstat (limited to 'src/main/java/me/shedaniel/rei/plugin/cooking')
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingCategory.java14
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java22
2 files changed, 18 insertions, 18 deletions
diff --git a/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingCategory.java b/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingCategory.java
index deb1bf384..257c41313 100644
--- a/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingCategory.java
+++ b/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingCategory.java
@@ -33,13 +33,13 @@ public class DefaultCookingCategory implements TransferRecipeCategory<DefaultCoo
private Identifier identifier;
private EntryStack logo;
private String categoryName;
-
+
public DefaultCookingCategory(Identifier identifier, EntryStack logo, String categoryName) {
this.identifier = identifier;
this.logo = logo;
this.categoryName = categoryName;
}
-
+
@Override
public void renderRedSlots(List<Widget> widgets, Rectangle bounds, DefaultCookingDisplay display, IntList redSlots) {
Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
@@ -49,7 +49,7 @@ public class DefaultCookingCategory implements TransferRecipeCategory<DefaultCoo
}
RenderSystem.translatef(0, 0, -400);
}
-
+
@Override
public List<Widget> setupDisplay(Supplier<DefaultCookingDisplay> recipeDisplaySupplier, Rectangle bounds) {
Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
@@ -70,22 +70,22 @@ public class DefaultCookingCategory implements TransferRecipeCategory<DefaultCoo
widgets.add(EntryWidget.create(startPoint.x + 61, startPoint.y + 19).entries(recipeDisplaySupplier.get().getOutputEntries()).noBackground());
return widgets;
}
-
+
@Override
public RecipeEntry getSimpleRenderer(DefaultCookingDisplay recipe) {
return SimpleRecipeEntry.create(Collections.singletonList(recipe.getInputEntries().get(0)), recipe.getOutputEntries());
}
-
+
@Override
public Identifier getIdentifier() {
return identifier;
}
-
+
@Override
public EntryStack getLogo() {
return logo;
}
-
+
@Override
public String getCategoryName() {
return I18n.translate(categoryName);
diff --git a/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java b/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java
index f1c33dd81..7eec9a749 100644
--- a/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java
+++ b/src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java
@@ -28,7 +28,7 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay {
private AbstractCookingRecipe recipe;
private List<List<EntryStack>> input;
private List<EntryStack> output;
-
+
public DefaultCookingDisplay(AbstractCookingRecipe recipe) {
this.recipe = recipe;
this.input = recipe.getPreviewInputs().stream().map(i -> {
@@ -41,49 +41,49 @@ public abstract class DefaultCookingDisplay implements TransferRecipeDisplay {
this.input.add(FurnaceBlockEntity.createFuelTimeMap().keySet().stream().map(Item::getStackForRender).map(EntryStack::create).map(e -> e.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(Formatting.YELLOW.toString() + I18n.translate("category.rei.smelting.fuel")))).collect(Collectors.toList()));
this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
}
-
+
@Override
public Optional<Identifier> getRecipeLocation() {
return Optional.ofNullable(recipe).map(AbstractCookingRecipe::getId);
}
-
+
@Override
public List<List<EntryStack>> getInputEntries() {
return input;
}
-
+
@Override
public List<EntryStack> getOutputEntries() {
return output;
}
-
+
public List<EntryStack> getFuel() {
return input.get(1);
}
-
+
@Override
public List<List<EntryStack>> getRequiredEntries() {
return input;
}
-
+
@Deprecated
public Optional<AbstractCookingRecipe> getOptionalRecipe() {
return Optional.ofNullable(recipe);
}
-
+
@Override
public int getWidth() {
return 1;
}
-
+
@Override
public int getHeight() {
return 1;
}
-
+
@Override
public List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<Container> containerInfo, Container container) {
return CollectionUtils.map(recipe.getPreviewInputs(), i -> CollectionUtils.map(i.getMatchingStacksClient(), EntryStack::create));
}
-
+
}