Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/1.8'
- Loading branch information
Showing
37 changed files
with
786 additions
and
402 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@API(apiVersion = "23.0.0", owner = "JEI", provides = "JustEnoughItemsAPI") | ||
@API(apiVersion = "24.0.0", owner = "JEI", provides = "JustEnoughItemsAPI") | ||
package mezz.jei.api; | ||
|
||
import net.minecraftforge.fml.common.API; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package mezz.jei.gui; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
import net.minecraft.item.ItemStack; | ||
|
||
import net.minecraftforge.fluids.Fluid; | ||
|
||
import mezz.jei.api.JEIManager; | ||
import mezz.jei.api.recipe.IRecipeCategory; | ||
|
||
public class Focus { | ||
private final ItemStack stack; | ||
private final Fluid fluid; | ||
|
||
public Focus() { | ||
this.stack = null; | ||
this.fluid = null; | ||
} | ||
|
||
public Focus(Object focus) { | ||
if (focus instanceof ItemStack) { | ||
this.stack = (ItemStack) focus; | ||
this.fluid = null; | ||
} else if (focus instanceof Fluid) { | ||
this.stack = null; | ||
this.fluid = (Fluid) focus; | ||
} else { | ||
this.stack = null; | ||
this.fluid = null; | ||
} | ||
} | ||
|
||
public Focus(ItemStack stack) { | ||
this.stack = stack; | ||
this.fluid = null; | ||
} | ||
|
||
public Focus(Fluid fluid) { | ||
this.stack = null; | ||
this.fluid = fluid; | ||
} | ||
|
||
public Fluid getFluid() { | ||
return fluid; | ||
} | ||
|
||
public ItemStack getStack() { | ||
return stack; | ||
} | ||
|
||
@Nonnull | ||
public ImmutableList<IRecipeCategory> getCategoriesWithInput() { | ||
if (stack != null) { | ||
return JEIManager.recipeRegistry.getRecipeCategoriesWithInput(stack); | ||
} else { | ||
return JEIManager.recipeRegistry.getRecipeCategoriesWithInput(fluid); | ||
} | ||
} | ||
|
||
@Nonnull | ||
public ImmutableList<IRecipeCategory> getCategoriesWithOutput() { | ||
if (stack != null) { | ||
return JEIManager.recipeRegistry.getRecipeCategoriesWithOutput(stack); | ||
} else { | ||
return JEIManager.recipeRegistry.getRecipeCategoriesWithOutput(fluid); | ||
} | ||
} | ||
|
||
@Nonnull | ||
public ImmutableList<Object> getRecipesWithInput(IRecipeCategory recipeCategory) { | ||
if (stack != null) { | ||
return JEIManager.recipeRegistry.getRecipesWithInput(recipeCategory, stack); | ||
} else { | ||
return JEIManager.recipeRegistry.getRecipesWithInput(recipeCategory, fluid); | ||
} | ||
} | ||
|
||
@Nonnull | ||
public ImmutableList<Object> getRecipesWithOutput(IRecipeCategory recipeCategory) { | ||
if (stack != null) { | ||
return JEIManager.recipeRegistry.getRecipesWithOutput(recipeCategory, stack); | ||
} else { | ||
return JEIManager.recipeRegistry.getRecipesWithOutput(recipeCategory, fluid); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,53 @@ | ||
package mezz.jei.gui; | ||
|
||
public class GuiFluidTank { | ||
import javax.annotation.Nonnull; | ||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.FontRenderer; | ||
|
||
import net.minecraftforge.fluids.FluidStack; | ||
|
||
public class GuiFluidTank extends GuiWidget<FluidStack> { | ||
private final int capacityMb; | ||
|
||
public GuiFluidTank(int xPosition, int yPosition, int width, int height, int capacityMb) { | ||
super(xPosition, yPosition, width, height); | ||
this.capacityMb = capacityMb; | ||
} | ||
|
||
@Override | ||
protected Collection<FluidStack> expandSubtypes(Collection<FluidStack> contained) { | ||
return contained; | ||
} | ||
|
||
@Override | ||
protected FluidStack getMatch(Iterable<FluidStack> contained, @Nonnull Focus toMatch) { | ||
if (toMatch.getFluid() == null) { | ||
return null; | ||
} | ||
for (FluidStack fluidStack : contained) { | ||
if (toMatch.getFluid() == fluidStack.getFluid()) { | ||
return fluidStack; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
protected void draw(@Nonnull Minecraft minecraft, int xPosition, int yPosition, @Nonnull FluidStack contents) { | ||
// TODO | ||
} | ||
|
||
@Override | ||
protected List getTooltip(@Nonnull Minecraft minecraft, @Nonnull FluidStack value) { | ||
// TODO | ||
return null; | ||
} | ||
|
||
@Override | ||
protected FontRenderer getFontRenderer(@Nonnull Minecraft minecraft, @Nonnull FluidStack value) { | ||
return minecraft.fontRendererObj; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package mezz.jei.gui; | ||
|
||
import net.minecraftforge.fluids.FluidStack; | ||
|
||
import mezz.jei.api.gui.IGuiFluidTanks; | ||
|
||
public class GuiFluidTanks extends GuiWidgets<FluidStack, GuiFluidTank> implements IGuiFluidTanks { | ||
@Override | ||
public void init(int index, int xPosition, int yPosition, int width, int height, int capacityMb) { | ||
GuiFluidTank guiFluidTank = new GuiFluidTank(xPosition, yPosition, width, height, capacityMb); | ||
guiWidgets.put(index, guiFluidTank); | ||
} | ||
} |
Oops, something went wrong.