Infer type arguments

This commit is contained in:
Marcel Konrad
2019-06-22 15:03:12 +02:00
parent 0a0361ed09
commit dff636eb34

View File

@@ -39,15 +39,15 @@ public class ContentRecipes extends Content
@Override @Override
public void initGui(Container container, int x, int y) public void initGui(Container container, int x, int y)
{ {
List<IRecipe> recipes = Minecraft.getInstance().player.getRecipeBook().getRecipes().stream() List<IRecipe<?>> recipes = Minecraft.getInstance().player.getRecipeBook().getRecipes().stream()
.flatMap(recipe -> recipe.getRecipes().stream()) .flatMap(recipe -> recipe.getRecipes().stream())
.filter(recipe -> !recipe.isDynamic()) .filter(recipe -> !recipe.isDynamic())
.collect(Collectors.toList()); .collect(Collectors.toList());
ElementPageList<IRecipe> list = new ElementPageList<IRecipe>(x, y, recipes, 114, 20, 3, container, new ILogicPageList<IRecipe>() ElementPageList<IRecipe<?>> list = new ElementPageList<IRecipe<?>>(x, y, recipes, 114, 20, 3, container, new ILogicPageList<IRecipe<?>>()
{ {
@Override @Override
public String translate(IRecipe item) public String translate(IRecipe<?> item)
{ {
if(!item.getRecipeOutput().equals(ItemStack.EMPTY)) if(!item.getRecipeOutput().equals(ItemStack.EMPTY))
{ {
@@ -58,20 +58,20 @@ public class ContentRecipes extends Content
} }
@Override @Override
public String toTooltip(IRecipe item) public String toTooltip(IRecipe<?> item)
{ {
return item.getId().toString(); return item.getId().toString();
} }
@Override @Override
public void onClick(IRecipe item) public void onClick(IRecipe<?> item)
{ {
ContentRecipes.this.builderRecipe.setRecipe(item); ContentRecipes.this.builderRecipe.setRecipe(item);
container.initButtons(); container.initButtons();
} }
@Override @Override
public GuiButtonBase onRegister(int x, int y, int width, int height, String text, IRecipe item, ActionHandler actionHandler) public GuiButtonBase onRegister(int x, int y, int width, int height, String text, IRecipe<?> item, ActionHandler actionHandler)
{ {
return new GuiButtonTooltip(x, y, width, height, text, this.toTooltip(item), actionHandler); return new GuiButtonTooltip(x, y, width, height, text, this.toTooltip(item), actionHandler);
} }