Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed energy not shown in Jade + Added Recipe to be shown in JEI with a test recipe #6

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public boolean canReceive() {
}

public EnergyStorage getEnergyHandler(Direction side) {
if (side == null) return this.getEnergyStorage();
Direction blockFacing = this.getBlockState().getValue(DiskAssemblerBlock.FACING);
return side == blockFacing.getOpposite() ? this.getEnergyStorage() : null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import dev.wolfieboy09.qstorage.api.util.ResourceHelper;
import dev.wolfieboy09.qstorage.block.disk_assembler.DiskAssemblerRecipe;
import dev.wolfieboy09.qstorage.registries.QSBlocks;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
import mezz.jei.api.gui.drawable.IDrawable;
import mezz.jei.api.helpers.IGuiHelper;
Expand All @@ -26,8 +27,8 @@ public class DiskAssemblerCategory implements IRecipeCategory<DiskAssemblerRecip
private final IDrawable icon;

public DiskAssemblerCategory(@NotNull IGuiHelper guiHelper) {
ResourceLocation location = ResourceHelper.asResource("disk_assembler");
background = guiHelper.createDrawable(location, 0, 0, 100, 100);
ResourceLocation location = ResourceHelper.asResource("textures/gui/disk_assembler.png");
background = guiHelper.createDrawable(location, 0, 0, 176, 76);
icon = guiHelper.createDrawableItemStack(new ItemStack(QSBlocks.DISK_ASSEMBLER.get()));
}

Expand All @@ -53,15 +54,18 @@ public IDrawable getBackground() {

@Override
public void setRecipe(IRecipeLayoutBuilder builder, DiskAssemblerRecipe recipe, IFocusGroup focuses) {
builder.addSlot(RecipeIngredientRole.INPUT, 17, 27);
builder.addSlot(RecipeIngredientRole.INPUT, 17, 45);
builder.addSlot(RecipeIngredientRole.INPUT, 35, 36);
builder.addSlot(RecipeIngredientRole.INPUT, 17, 27).addIngredients(recipe.diskPort());
builder.addSlot(RecipeIngredientRole.INPUT, 17, 45).addIngredients(recipe.diskCasing());
builder.addSlot(RecipeIngredientRole.INPUT, 35, 36).addIngredients(recipe.screws());

builder.addSlot(RecipeIngredientRole.INPUT, 116, 27);
builder.addSlot(RecipeIngredientRole.INPUT, 134, 27);
builder.addSlot(RecipeIngredientRole.INPUT, 116, 45);
builder.addSlot(RecipeIngredientRole.INPUT, 134, 45);
builder.addSlot(RecipeIngredientRole.INPUT, 116, 27).addIngredients(recipe.extras().getFirst());
builder.addSlot(RecipeIngredientRole.INPUT, 134, 27).addIngredients(recipe.extras().get(1));
builder.addSlot(RecipeIngredientRole.INPUT, 116, 45).addIngredients(recipe.extras().get(2));
builder.addSlot(RecipeIngredientRole.INPUT, 134, 45).addIngredients(recipe.extras().get(3));

builder.addSlot(RecipeIngredientRole.OUTPUT, 80, 36);
builder.addSlot(RecipeIngredientRole.OUTPUT, 80, 36).addIngredient(
VanillaTypes.ITEM_STACK,
recipe.result()
);
}
}
Loading