Continue mapping migration

This commit is contained in:
Aleksey 2021-04-12 21:38:22 +03:00
parent 99ade39404
commit f03fd03bd0
499 changed files with 12567 additions and 12723 deletions

View file

@ -11,34 +11,34 @@ import com.google.common.collect.Lists;
import me.shedaniel.rei.api.EntryStack;
import me.shedaniel.rei.api.TransferRecipeDisplay;
import me.shedaniel.rei.server.ContainerInfo;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.item.crafting.Recipe;
import ru.betterend.recipe.builders.AlloyingRecipe;
import ru.betterend.recipe.builders.InfusionRecipe;
public class REIInfusionDisplay implements TransferRecipeDisplay {
private final InfusionRecipe recipe;
private final List<List<EntryStack>> input;
private final List<EntryStack> output;
private final int time;
public REIInfusionDisplay(InfusionRecipe recipe) {
this.recipe = recipe;
this.input = Lists.newArrayList();
this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
this.output = Collections.singletonList(EntryStack.create(recipe.getResultItem()));
this.time = recipe.getInfusionTime();
recipe.getPreviewInputs().forEach(ingredient -> {
recipe.getIngredients().forEach(ingredient -> {
input.add(EntryStack.ofIngredient(ingredient));
});
}
public int getInfusionTime() {
return this.time;
}
@Override
public @NotNull Optional<ResourceLocation> getRecipeLocation() {
return Optional.ofNullable(recipe).map(Recipe::getId);
@ -48,7 +48,7 @@ public class REIInfusionDisplay implements TransferRecipeDisplay {
public @NotNull List<List<EntryStack>> getInputEntries() {
return this.input;
}
@Override
public @NotNull List<List<EntryStack>> getResultingEntries() {
return Collections.singletonList(output);
@ -58,7 +58,7 @@ public class REIInfusionDisplay implements TransferRecipeDisplay {
public @NotNull ResourceLocation getRecipeCategory() {
return AlloyingRecipe.ID;
}
@Override
public @NotNull List<List<EntryStack>> getRequiredEntries() {
return this.input;
@ -75,8 +75,7 @@ public class REIInfusionDisplay implements TransferRecipeDisplay {
}
@Override
public List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<ScreenHandler> containerInfo,
ScreenHandler container) {
public List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<AbstractContainerMenu> containerInfo, AbstractContainerMenu container) {
return this.input;
}
}