use of com.lowdragmc.multiblocked.api.gui.recipe.RecipeWidget in project Multiblocked by Low-Drag-MC.
the class RecipePage method readRecipe.
private void readRecipe(PacketBuffer buffer) {
if (buffer.readBoolean()) {
recipe = controller.getDefinition().recipeMap.recipes.get(buffer.readUtf());
if (recipeWidget != null) {
removeWidget(recipeWidget);
}
this.addWidget(recipeWidget = new RecipeWidget(recipe, controller.getDefinition().recipeMap.progressTexture, null));
recipeWidget.inputs.addSelfPosition(5, 0);
recipeWidget.outputs.addSelfPosition(-5, 0);
recipeWidget.setSelfPosition(new Position(0, 167));
} else {
if (recipeWidget != null) {
removeWidget(recipeWidget);
}
status = RecipeLogic.Status.IDLE;
progress = 0;
}
}
use of com.lowdragmc.multiblocked.api.gui.recipe.RecipeWidget in project Multiblocked by Low-Drag-MC.
the class JEIPlugin method registerRecipes.
@Override
public void registerRecipes(@Nonnull IRecipeRegistration registration) {
Multiblocked.LOGGER.info("JEI register");
for (RecipeMap recipeMap : RecipeMap.RECIPE_MAP_REGISTRY.values()) {
if (recipeMap == RecipeMap.EMPTY)
continue;
registration.addRecipes(recipeMap.recipes.values().stream().map(recipe -> new RecipeWidget(recipe, recipeMap.progressTexture)).map(RecipeWrapper::new).collect(Collectors.toList()), new ResourceLocation(Multiblocked.MODID, recipeMap.name));
}
MultiblockInfoCategory.registerRecipes(registration);
}
Aggregations