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
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue