Some REI Compat Changes (#1882)

* Update REi

* Update to 3.2.6
This commit is contained in:
shedaniel 2019-11-07 22:46:19 +08:00 committed by modmuss50
parent 201785b674
commit 8ecfa4207a
7 changed files with 124 additions and 113 deletions

View file

@ -24,9 +24,8 @@
package techreborn.compat.rei.rollingmachine;
import me.shedaniel.rei.api.Renderer;
import me.shedaniel.rei.api.EntryStack;
import me.shedaniel.rei.plugin.crafting.DefaultCraftingCategory;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.Identifier;
import reborncore.common.crafting.RebornRecipeType;
@ -35,26 +34,26 @@ import techreborn.api.recipe.recipes.RollingMachineRecipe;
import techreborn.compat.rei.ReiPlugin;
public class RollingMachineCategory extends DefaultCraftingCategory {
private final RebornRecipeType<RollingMachineRecipe> rebornRecipeType;
public RollingMachineCategory(RebornRecipeType<RollingMachineRecipe> rebornRecipeType) {
this.rebornRecipeType = rebornRecipeType;
}
@Override
public Identifier getIdentifier() {
return rebornRecipeType.getName();
}
@Override
public String getCategoryName() {
return StringUtils.t(rebornRecipeType.getName().toString());
}
@Override
public Renderer getIcon() {
return Renderer.fromItemStack(new ItemStack(ReiPlugin.iconMap.getOrDefault(rebornRecipeType, () -> Items.DIAMOND_SHOVEL).asItem()));
public EntryStack getLogo() {
return EntryStack.create(ReiPlugin.iconMap.getOrDefault(rebornRecipeType, () -> Items.DIAMOND_SHOVEL));
}
}