Changed formatting to have bracing on a new line
This commit is contained in:
parent
e5eddd6c45
commit
e48eedb874
189 changed files with 6092 additions and 4041 deletions
|
@ -3,7 +3,8 @@ package WayofTime.bloodmagic.compat;
|
|||
/**
|
||||
* Implement on all primary compatibility classes.
|
||||
*/
|
||||
public interface ICompatibility {
|
||||
public interface ICompatibility
|
||||
{
|
||||
|
||||
/**
|
||||
* Called after the given {@code modid} has been verified as loaded.
|
||||
|
@ -16,8 +17,9 @@ public interface ICompatibility {
|
|||
String getModId();
|
||||
|
||||
/**
|
||||
* Whether or not compatibility should be loaded even if the mod were to be found.
|
||||
*
|
||||
* Whether or not compatibility should be loaded even if the mod were to be
|
||||
* found.
|
||||
*
|
||||
* Generally a determined by a config option.
|
||||
*/
|
||||
boolean enableCompat();
|
||||
|
|
|
@ -18,28 +18,23 @@ import net.minecraft.item.ItemStack;
|
|||
import java.util.Collections;
|
||||
|
||||
@JEIPlugin
|
||||
public class BloodMagicPlugin implements IModPlugin {
|
||||
public class BloodMagicPlugin implements IModPlugin
|
||||
{
|
||||
|
||||
public static IJeiHelpers jeiHelper;
|
||||
|
||||
@Override
|
||||
public boolean isModLoaded() {
|
||||
public boolean isModLoaded()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(IModRegistry registry) {
|
||||
registry.addRecipeCategories(
|
||||
new AltarRecipeCategory(),
|
||||
new BindingRecipeCategory(),
|
||||
new AlchemyArrayCraftingCategory()
|
||||
);
|
||||
public void register(IModRegistry registry)
|
||||
{
|
||||
registry.addRecipeCategories(new AltarRecipeCategory(), new BindingRecipeCategory(), new AlchemyArrayCraftingCategory());
|
||||
|
||||
registry.addRecipeHandlers(
|
||||
new AltarRecipeHandler(),
|
||||
new BindingRecipeHandler(),
|
||||
new AlchemyArrayCraftingRecipeHandler()
|
||||
);
|
||||
registry.addRecipeHandlers(new AltarRecipeHandler(), new BindingRecipeHandler(), new AlchemyArrayCraftingRecipeHandler());
|
||||
|
||||
registry.addRecipes(AltarRecipeMaker.getRecipes());
|
||||
registry.addRecipes(BindingRecipeMaker.getRecipes());
|
||||
|
@ -49,19 +44,22 @@ public class BloodMagicPlugin implements IModPlugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onJeiHelpersAvailable(IJeiHelpers jeiHelpers) {
|
||||
public void onJeiHelpersAvailable(IJeiHelpers jeiHelpers)
|
||||
{
|
||||
jeiHelper = jeiHelpers;
|
||||
|
||||
jeiHelpers.getItemBlacklist().addItemToBlacklist(new ItemStack(ModBlocks.bloodLight));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRegistryAvailable(IItemRegistry itemRegistry) {
|
||||
public void onItemRegistryAvailable(IItemRegistry itemRegistry)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecipeRegistryAvailable(IRecipeRegistry recipeRegistry) {
|
||||
public void onRecipeRegistryAvailable(IRecipeRegistry recipeRegistry)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,15 +6,18 @@ import net.minecraftforge.fluids.FluidStack;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class BloodMagicRecipeWrapper implements IRecipeWrapper {
|
||||
public abstract class BloodMagicRecipeWrapper implements IRecipeWrapper
|
||||
{
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs() {
|
||||
public List<FluidStack> getFluidInputs()
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs() {
|
||||
public List<FluidStack> getFluidOutputs()
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,20 +2,24 @@ package WayofTime.bloodmagic.compat.jei;
|
|||
|
||||
import WayofTime.bloodmagic.compat.ICompatibility;
|
||||
|
||||
public class CompatibilityJustEnoughItems implements ICompatibility {
|
||||
public class CompatibilityJustEnoughItems implements ICompatibility
|
||||
{
|
||||
|
||||
@Override
|
||||
public void loadCompatibility() {
|
||||
public void loadCompatibility()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModId() {
|
||||
public String getModId()
|
||||
{
|
||||
return "JEI";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableCompat() {
|
||||
public boolean enableCompat()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,8 @@ import net.minecraft.util.ResourceLocation;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlchemyArrayCraftingCategory implements IRecipeCategory {
|
||||
public class AlchemyArrayCraftingCategory implements IRecipeCategory
|
||||
{
|
||||
|
||||
private static final int INPUT_SLOT = 0;
|
||||
private static final int CATALYST_SLOT = 1;
|
||||
|
@ -26,41 +27,48 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory {
|
|||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
public String getUid()
|
||||
{
|
||||
return Constants.Compat.JEI_CATEGORY_ALCHEMYARRAY;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
public String getTitle()
|
||||
{
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
public void drawExtras(Minecraft minecraft)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
public void drawAnimations(Minecraft minecraft)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
|
||||
{
|
||||
|
||||
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5);
|
||||
recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 50, 5);
|
||||
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 73, 5);
|
||||
|
||||
if (recipeWrapper instanceof AlchemyArrayCraftingRecipeJEI) {
|
||||
if (recipeWrapper instanceof AlchemyArrayCraftingRecipeJEI)
|
||||
{
|
||||
AlchemyArrayCraftingRecipeJEI alchemyArrayWrapper = (AlchemyArrayCraftingRecipeJEI) recipeWrapper;
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, (ItemStack) alchemyArrayWrapper.getInputs().get(0));
|
||||
recipeLayout.getItemStacks().set(CATALYST_SLOT, (ItemStack) alchemyArrayWrapper.getInputs().get(1));
|
||||
|
@ -68,4 +76,3 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,28 +6,33 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlchemyArrayCraftingRecipeHandler implements IRecipeHandler<AlchemyArrayCraftingRecipeJEI> {
|
||||
public class AlchemyArrayCraftingRecipeHandler implements IRecipeHandler<AlchemyArrayCraftingRecipeJEI>
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<AlchemyArrayCraftingRecipeJEI> getRecipeClass() {
|
||||
public Class<AlchemyArrayCraftingRecipeJEI> getRecipeClass()
|
||||
{
|
||||
return AlchemyArrayCraftingRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Constants.Compat.JEI_CATEGORY_ALCHEMYARRAY;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AlchemyArrayCraftingRecipeJEI recipe) {
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AlchemyArrayCraftingRecipeJEI recipe)
|
||||
{
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AlchemyArrayCraftingRecipeJEI recipe) {
|
||||
public boolean isRecipeValid(@Nonnull AlchemyArrayCraftingRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,8 @@ import javax.annotation.Nullable;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class AlchemyArrayCraftingRecipeJEI extends BloodMagicRecipeWrapper {
|
||||
public class AlchemyArrayCraftingRecipeJEI extends BloodMagicRecipeWrapper
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
private final List<ItemStack> inputs;
|
||||
|
@ -19,28 +20,33 @@ public class AlchemyArrayCraftingRecipeJEI extends BloodMagicRecipeWrapper {
|
|||
private final ItemStack output;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public AlchemyArrayCraftingRecipeJEI(@Nonnull ItemStack input, @Nullable ItemStack catalyst, @Nonnull ItemStack output) {
|
||||
this.inputs = Arrays.asList(new ItemStack[] {input, catalyst});
|
||||
public AlchemyArrayCraftingRecipeJEI(@Nonnull ItemStack input, @Nullable ItemStack catalyst, @Nonnull ItemStack output)
|
||||
{
|
||||
this.inputs = Arrays.asList(new ItemStack[] { input, catalyst });
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getInputs() {
|
||||
public List getInputs()
|
||||
{
|
||||
return inputs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getOutputs() {
|
||||
public List getOutputs()
|
||||
{
|
||||
return Collections.singletonList(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,21 +12,26 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AlchemyArrayCraftingRecipeMaker {
|
||||
public class AlchemyArrayCraftingRecipeMaker
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
public static List<AlchemyArrayCraftingRecipeJEI> getRecipes() {
|
||||
public static List<AlchemyArrayCraftingRecipeJEI> getRecipes()
|
||||
{
|
||||
Map<ItemStackWrapper, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> alchemyArrayRecipeMap = AlchemyArrayRecipeRegistry.getRecipes();
|
||||
|
||||
ArrayList<AlchemyArrayCraftingRecipeJEI> recipes = new ArrayList<AlchemyArrayCraftingRecipeJEI>();
|
||||
|
||||
for (Map.Entry<ItemStackWrapper, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet()) {
|
||||
for (Map.Entry<ItemStackWrapper, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet())
|
||||
{
|
||||
ItemStack input = itemStackAlchemyArrayRecipeEntry.getValue().getInputStack();
|
||||
BiMap<ItemStackWrapper, AlchemyArrayEffect> catalystMap = itemStackAlchemyArrayRecipeEntry.getValue().catalystMap;
|
||||
|
||||
for(Map.Entry<ItemStackWrapper, AlchemyArrayEffect> entry : catalystMap.entrySet()) {
|
||||
for (Map.Entry<ItemStackWrapper, AlchemyArrayEffect> entry : catalystMap.entrySet())
|
||||
{
|
||||
ItemStack catalyst = entry.getKey().toStack();
|
||||
if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectCrafting) {
|
||||
if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectCrafting)
|
||||
{
|
||||
ItemStack output = ((AlchemyArrayEffectCrafting) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).getOutputStack();
|
||||
|
||||
AlchemyArrayCraftingRecipeJEI recipe = new AlchemyArrayCraftingRecipeJEI(input, catalyst, output);
|
||||
|
|
|
@ -13,7 +13,8 @@ import net.minecraft.util.ResourceLocation;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AltarRecipeCategory implements IRecipeCategory {
|
||||
public class AltarRecipeCategory implements IRecipeCategory
|
||||
{
|
||||
|
||||
private static final int INPUT_SLOT = 0;
|
||||
private static final int OUTPUT_SLOT = 1;
|
||||
|
@ -25,40 +26,47 @@ public class AltarRecipeCategory implements IRecipeCategory {
|
|||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
public String getUid()
|
||||
{
|
||||
return Constants.Compat.JEI_CATEGORY_ALTAR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
public String getTitle()
|
||||
{
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
public void drawExtras(Minecraft minecraft)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
public void drawAnimations(Minecraft minecraft)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
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) {
|
||||
if (recipeWrapper instanceof AltarRecipeJEI)
|
||||
{
|
||||
AltarRecipeJEI altarRecipeWrapper = (AltarRecipeJEI) recipeWrapper;
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, altarRecipeWrapper.getInputs());
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, altarRecipeWrapper.getOutputs());
|
||||
|
|
|
@ -6,28 +6,33 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AltarRecipeHandler implements IRecipeHandler<AltarRecipeJEI> {
|
||||
public class AltarRecipeHandler implements IRecipeHandler<AltarRecipeJEI>
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<AltarRecipeJEI> getRecipeClass() {
|
||||
public Class<AltarRecipeJEI> getRecipeClass()
|
||||
{
|
||||
return AltarRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Constants.Compat.JEI_CATEGORY_ALTAR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AltarRecipeJEI recipe) {
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AltarRecipeJEI recipe)
|
||||
{
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AltarRecipeJEI recipe) {
|
||||
public boolean isRecipeValid(@Nonnull AltarRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,8 @@ import java.awt.*;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class AltarRecipeJEI extends BloodMagicRecipeWrapper {
|
||||
public class AltarRecipeJEI extends BloodMagicRecipeWrapper
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
private final ItemStack input;
|
||||
|
@ -20,31 +21,36 @@ public class AltarRecipeJEI extends BloodMagicRecipeWrapper {
|
|||
|
||||
private final String[] infoString;
|
||||
|
||||
public AltarRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack output, int tier, int requiredLP) {
|
||||
public AltarRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack output, int tier, int requiredLP)
|
||||
{
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
|
||||
this.infoString = new String[]{TextHelper.localize("jei.BloodMagic.recipe.requiredTier", tier), TextHelper.localize("jei.BloodMagic.recipe.requiredLP", requiredLP)};
|
||||
this.infoString = new String[] { TextHelper.localize("jei.BloodMagic.recipe.requiredTier", tier), TextHelper.localize("jei.BloodMagic.recipe.requiredLP", requiredLP) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getInputs() {
|
||||
public List getInputs()
|
||||
{
|
||||
return Collections.singletonList(input);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getOutputs() {
|
||||
public List getOutputs()
|
||||
{
|
||||
return Collections.singletonList(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
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) {
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,16 +8,21 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AltarRecipeMaker {
|
||||
public class AltarRecipeMaker
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
public static List<AltarRecipeJEI> getRecipes() {
|
||||
public static List<AltarRecipeJEI> getRecipes()
|
||||
{
|
||||
Map<ItemStack, AltarRecipeRegistry.AltarRecipe> altarMap = AltarRecipeRegistry.getRecipes();
|
||||
|
||||
ArrayList<AltarRecipeJEI> recipes = new ArrayList<AltarRecipeJEI>();
|
||||
|
||||
for (Map.Entry<ItemStack, AltarRecipeRegistry.AltarRecipe> itemStackAltarRecipeEntry : altarMap.entrySet()) {
|
||||
if (itemStackAltarRecipeEntry.getValue().getOutput() != null) { // Make sure output is not null. If it is, the recipe is for a filling orb, and we don't want that.
|
||||
for (Map.Entry<ItemStack, AltarRecipeRegistry.AltarRecipe> itemStackAltarRecipeEntry : altarMap.entrySet())
|
||||
{
|
||||
if (itemStackAltarRecipeEntry.getValue().getOutput() != null)
|
||||
{ // Make sure output is not null. If it is, the recipe is for a
|
||||
// filling orb, and we don't want that.
|
||||
ItemStack input = itemStackAltarRecipeEntry.getKey();
|
||||
ItemStack output = itemStackAltarRecipeEntry.getValue().getOutput();
|
||||
int requiredTier = itemStackAltarRecipeEntry.getValue().getMinTier().toInt();
|
||||
|
|
|
@ -13,7 +13,8 @@ import net.minecraft.util.ResourceLocation;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BindingRecipeCategory implements IRecipeCategory {
|
||||
public class BindingRecipeCategory implements IRecipeCategory
|
||||
{
|
||||
|
||||
private static final int INPUT_SLOT = 0;
|
||||
private static final int CATALYST_SLOT = 1;
|
||||
|
@ -26,41 +27,48 @@ public class BindingRecipeCategory implements IRecipeCategory {
|
|||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
public String getUid()
|
||||
{
|
||||
return Constants.Compat.JEI_CATEGORY_BINDING;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
public String getTitle()
|
||||
{
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
public void drawExtras(Minecraft minecraft)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {
|
||||
public void drawAnimations(Minecraft minecraft)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
|
||||
{
|
||||
|
||||
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5);
|
||||
recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 50, 5);
|
||||
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 73, 5);
|
||||
|
||||
if (recipeWrapper instanceof BindingRecipeJEI) {
|
||||
if (recipeWrapper instanceof BindingRecipeJEI)
|
||||
{
|
||||
BindingRecipeJEI bindingRecipe = (BindingRecipeJEI) recipeWrapper;
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, (ItemStack) bindingRecipe.getInputs().get(0));
|
||||
recipeLayout.getItemStacks().set(CATALYST_SLOT, (ItemStack) bindingRecipe.getInputs().get(1));
|
||||
|
|
|
@ -6,28 +6,33 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BindingRecipeHandler implements IRecipeHandler<BindingRecipeJEI> {
|
||||
public class BindingRecipeHandler implements IRecipeHandler<BindingRecipeJEI>
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<BindingRecipeJEI> getRecipeClass() {
|
||||
public Class<BindingRecipeJEI> getRecipeClass()
|
||||
{
|
||||
return BindingRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Constants.Compat.JEI_CATEGORY_BINDING;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull BindingRecipeJEI recipe) {
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull BindingRecipeJEI recipe)
|
||||
{
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull BindingRecipeJEI recipe) {
|
||||
public boolean isRecipeValid(@Nonnull BindingRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,8 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicRecipeWrapper;
|
||||
|
||||
public class BindingRecipeJEI extends BloodMagicRecipeWrapper {
|
||||
public class BindingRecipeJEI extends BloodMagicRecipeWrapper
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
private final List<ItemStack> inputs;
|
||||
|
@ -19,28 +20,33 @@ public class BindingRecipeJEI extends BloodMagicRecipeWrapper {
|
|||
private final ItemStack output;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public BindingRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack catalyst, @Nonnull ItemStack output) {
|
||||
this.inputs = Arrays.asList(new ItemStack[] {input, catalyst});
|
||||
public BindingRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack catalyst, @Nonnull ItemStack output)
|
||||
{
|
||||
this.inputs = Arrays.asList(new ItemStack[] { input, catalyst });
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getInputs() {
|
||||
public List getInputs()
|
||||
{
|
||||
return inputs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getOutputs() {
|
||||
public List getOutputs()
|
||||
{
|
||||
return Collections.singletonList(output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,21 +12,26 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class BindingRecipeMaker {
|
||||
public class BindingRecipeMaker
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
public static List<BindingRecipeJEI> getRecipes() {
|
||||
public static List<BindingRecipeJEI> getRecipes()
|
||||
{
|
||||
Map<ItemStackWrapper, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> alchemyArrayRecipeMap = AlchemyArrayRecipeRegistry.getRecipes();
|
||||
|
||||
ArrayList<BindingRecipeJEI> recipes = new ArrayList<BindingRecipeJEI>();
|
||||
|
||||
for (Map.Entry<ItemStackWrapper, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet()) {
|
||||
for (Map.Entry<ItemStackWrapper, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet())
|
||||
{
|
||||
ItemStack input = itemStackAlchemyArrayRecipeEntry.getValue().getInputStack();
|
||||
BiMap<ItemStackWrapper, AlchemyArrayEffect> catalystMap = itemStackAlchemyArrayRecipeEntry.getValue().catalystMap;
|
||||
|
||||
for(Map.Entry<ItemStackWrapper, AlchemyArrayEffect> entry : catalystMap.entrySet()) {
|
||||
for (Map.Entry<ItemStackWrapper, AlchemyArrayEffect> entry : catalystMap.entrySet())
|
||||
{
|
||||
ItemStack catalyst = entry.getKey().toStack();
|
||||
if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectBinding) {
|
||||
if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectBinding)
|
||||
{
|
||||
ItemStack output = ((AlchemyArrayEffectBinding) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).getOutputStack();
|
||||
|
||||
BindingRecipeJEI recipe = new BindingRecipeJEI(input, catalyst, output);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue