Update JEI compat to latest
This commit is contained in:
parent
d51a908f6b
commit
0f26cbedd7
|
@ -7,4 +7,4 @@ curse_id=224791
|
|||
|
||||
mappings_version=snapshot_20151128
|
||||
|
||||
jei_version=2.2.0.15
|
||||
jei_version=2.8.2.38
|
|
@ -7,15 +7,8 @@ import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeCategory;
|
|||
import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeMaker;
|
||||
import mezz.jei.api.IModPlugin;
|
||||
import mezz.jei.api.IModRegistry;
|
||||
import mezz.jei.api.JEIPlugin;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeTransferHelper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@JEIPlugin
|
||||
public class BloodMagicPlugin implements IModPlugin {
|
||||
|
@ -26,38 +19,18 @@ public class BloodMagicPlugin implements IModPlugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public Iterable<? extends IRecipeCategory> getRecipeCategories() {
|
||||
return Arrays.asList(
|
||||
public void register(IModRegistry registry) {
|
||||
registry.addRecipeCategories(
|
||||
new AltarRecipeCategory(),
|
||||
new BindingRecipeCategory()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public Iterable<? extends IRecipeHandler> getRecipeHandlers() {
|
||||
return Arrays.asList(
|
||||
registry.addRecipeHandlers(
|
||||
new AltarRecipeHandler(),
|
||||
new BindingRecipeHandler()
|
||||
);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public Iterable<? extends IRecipeTransferHelper> getRecipeTransferHelpers() {
|
||||
return Arrays.asList(
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public Iterable<Object> getRecipes() {
|
||||
List<Object> recipes = new ArrayList<Object>();
|
||||
|
||||
recipes.addAll(AltarRecipeMaker.getRecipes());
|
||||
recipes.addAll(BindingRecipeMaker.getRecipes());
|
||||
|
||||
return recipes;
|
||||
registry.addRecipes(AltarRecipeMaker.getRecipes());
|
||||
registry.addRecipes(BindingRecipeMaker.getRecipes());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,14 +46,17 @@ public class AltarRecipeCategory implements IRecipeCategory {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void init(@Nonnull IRecipeLayout recipeLayout) {
|
||||
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 31, 0);
|
||||
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 125, 30);
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
|
||||
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 31, 0);
|
||||
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 125, 30);
|
||||
|
||||
if (recipeWrapper instanceof AltarRecipeJEI) {
|
||||
AltarRecipeJEI altarRecipeWrapper = (AltarRecipeJEI) recipeWrapper;
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, altarRecipeWrapper.getInputs());
|
||||
|
|
|
@ -27,11 +27,6 @@ public class AltarRecipeJEI extends BloodMagicRecipeWrapper {
|
|||
this.infoString = new String[]{TextHelper.localize("jei.BloodMagic.recipe.requiredTier", tier), TextHelper.localize("jei.BloodMagic.recipe.requiredLP", requiredLP)};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesOreDictionaryComparison() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getInputs() {
|
||||
return Collections.singletonList(input);
|
||||
|
@ -43,8 +38,13 @@ public class AltarRecipeJEI extends BloodMagicRecipeWrapper {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft) {
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
minecraft.fontRendererObj.drawString(infoString[0], 90 - minecraft.fontRendererObj.getStringWidth(infoString[0]) / 2, 0, Color.gray.getRGB());
|
||||
minecraft.fontRendererObj.drawString(infoString[1], 90 - minecraft.fontRendererObj.getStringWidth(infoString[1]) / 2, 10, Color.gray.getRGB());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,14 +46,17 @@ public class BindingRecipeCategory implements IRecipeCategory {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void init(@Nonnull IRecipeLayout recipeLayout) {
|
||||
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5);
|
||||
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 73, 5);
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
|
||||
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5);
|
||||
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 73, 5);
|
||||
|
||||
if (recipeWrapper instanceof BindingRecipeJEI) {
|
||||
BindingRecipeJEI bindingRecipeWrapper = (BindingRecipeJEI) recipeWrapper;
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, bindingRecipeWrapper.getInputs());
|
||||
|
|
|
@ -21,11 +21,6 @@ public class BindingRecipeJEI extends BloodMagicRecipeWrapper {
|
|||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usesOreDictionaryComparison() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getInputs() {
|
||||
return Collections.singletonList(input);
|
||||
|
@ -37,7 +32,12 @@ public class BindingRecipeJEI extends BloodMagicRecipeWrapper {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft) {
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue