Skip to content

Commit

Permalink
Merge pull request #616 from Lapis256/fix/sag_mill_recipes
Browse files Browse the repository at this point in the history
Prevent item duplication by updating processing recipes in SAG Mill
  • Loading branch information
Rover656 committed Feb 15, 2024
2 parents 43e4ddb + b707d9a commit 53b57fc
Show file tree
Hide file tree
Showing 22 changed files with 134 additions and 108 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "none",
"energy": 2400,
"input": {
"item": "minecraft:bone_block"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "none",
"energy": 2400,
"input": {
"tag": "forge:gems/ender_crystal"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "none",
"energy": 2400,
"input": {
"tag": "forge:ender_pearls"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "none",
"energy": 2400,
"input": {
"tag": "forge:glass"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "chance_only",
"energy": 2400,
"input": {
"item": "minecraft:glowstone"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "none",
"energy": 2400,
"input": {
"tag": "forge:ingots/gold"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "none",
"energy": 2400,
"input": {
"tag": "forge:ingots/iron"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "none",
"energy": 2400,
"input": {
"tag": "forge:gems/lapis"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "none",
"energy": 2400,
"input": {
"tag": "forge:gems/prescient_crystal"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "none",
"energy": 2400,
"input": {
"tag": "forge:gems/pulsating_crystal"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "chance_only",
"energy": 2400,
"input": {
"tag": "forge:gems/quartz"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "chance_only",
"energy": 2400,
"input": {
"tag": "forge:storage_blocks/quartz"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "chance_only",
"energy": 2400,
"input": {
"item": "minecraft:quartz_slab"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "chance_only",
"energy": 2400,
"input": {
"item": "minecraft:quartz_stairs"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "chance_only",
"energy": 2400,
"input": {
"tag": "forge:sandstone"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "none",
"energy": 2400,
"input": {
"tag": "forge:ingots/soularium"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "none",
"energy": 2400,
"input": {
"tag": "forge:stone"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "none",
"energy": 2400,
"input": {
"tag": "forge:gems/vibrant_crystal"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"type": "enderio:sag_milling",
"bonus": "chance_only",
"energy": 2400,
"input": {
"tag": "minecraft:wool"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ protected void consumeInputs(SagMillingRecipe recipe) {
INPUT.getItemStack(inv).shrink(1);

// Claim any available grinding balls.
if (grindingBallData == IGrindingBallData.IDENTITY) {
if (recipe.getBonusType().useGrindingBall() && grindingBallData == IGrindingBallData.IDENTITY) {
ItemStack ball = GRINDING_BALL.getItemStack(inv);
if (!ball.isEmpty()) {
IGrindingBallData data = GrindingBallManager.getData(ball);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.enderio.machines.common.lang.MachineLang;
import com.enderio.machines.common.recipe.SagMillingRecipe;
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
import mezz.jei.api.gui.builder.IRecipeSlotBuilder;
import mezz.jei.api.gui.drawable.IDrawable;
import mezz.jei.api.gui.ingredient.IRecipeSlotTooltipCallback;
import mezz.jei.api.gui.ingredient.IRecipeSlotsView;
Expand Down Expand Up @@ -67,9 +68,11 @@ public void setRecipe(IRecipeLayoutBuilder builder, SagMillingRecipe recipe, IFo
builder.addSlot(INPUT, 32, 1)
.addItemStacks(List.of(recipe.getInput().getItems()));

builder.addSlot(CATALYST, 74, 12)
.addItemStack(new ItemStack(Items.AIR))
.addItemStacks(GrindingBallManager.getGrindingBalls().stream().map(ItemStack::new).toList());
IRecipeSlotBuilder gridingBallSlot = builder.addSlot(CATALYST, 74, 12)
.addItemStack(new ItemStack(Items.AIR));
if (recipe.getBonusType().useGrindingBall()) {
gridingBallSlot.addItemStacks(GrindingBallManager.getGrindingBalls().stream().map(ItemStack::new).toList());
}

List<SagMillingRecipe.OutputItem> results = recipe.getOutputs();
if (!results.isEmpty()) {
Expand Down

0 comments on commit 53b57fc

Please sign in to comment.