Skip to content
This repository has been archived by the owner on Jun 23, 2024. It is now read-only.

Commit

Permalink
Special case honey bottles; they need an extra click on the crafting …
Browse files Browse the repository at this point in the history
…pad to remove empty glass bottles
  • Loading branch information
gbl committed Sep 13, 2021
1 parent 7bbac1d commit 56f3493
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public Stream<ResourcePack> streamResourcePacks() {
public static void dumpAll() {
for (Recipe r: instance.values()) {
LOGGER.info(r.getId());
System.out.println(r.getId() + " produces " + r.getOutput().getTranslationKey());
// System.out.println(r.getId() + " produces " + r.getOutput().getTranslationKey());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ private void saveButtonPressed() {
try {
Files.write(Paths.get(path), recipe.toSaveString().getBytes());
LoomRecipeRegistry.registerRecipe(recipe);
System.out.println(recipe.toSaveString());
// System.out.println(recipe.toSaveString());
saveName.setText("");
recipeBook.updateRecipes();
recipeBook.updatePatternMatch();
Expand Down
17 changes: 15 additions & 2 deletions src/main/java/de/guntram/mcmod/easiercrafting/RecipeBook.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package de.guntram.mcmod.easiercrafting;

import com.mojang.blaze3d.systems.RenderSystem;
import de.guntram.mcmod.easiercrafting.Loom.LoomRecipe;
import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -483,7 +482,7 @@ class Takefrom {
private boolean canCraftRecipe(Recipe recipe, ScreenHandler inventory, int gridSize) {
if (recipe instanceof ShapelessRecipe shapelessRecipe) {
if (recipe.getIngredients().size() > gridSize*gridSize) {
System.out.println("shapeless for "+recipe.getOutput().getTranslationKey()+" has "+recipe.getIngredients().size()+" items while gridSizs is "+gridSize);
// System.out.println("shapeless for "+recipe.getOutput().getTranslationKey()+" has "+recipe.getIngredients().size()+" items while gridSizs is "+gridSize);
return false;
}
return canCraftShapeless(shapelessRecipe, inventory);
Expand Down Expand Up @@ -721,6 +720,20 @@ else if (mouseX>xOffset+containerLeft+textBoxSize-20)
slotClick(resultSlotNo, mouseButton, SlotActionType.QUICK_MOVE); // which is really PICKUP ALL
updateRecipesIn(ConfigurationHandler.getAutoUpdateRecipeTimer()*1000);
}

/* Special case honey blocks which leave glass bottles in the input slots */

if (underMouse.getOutput().getItem() == Items.HONEY_BLOCK) {
slotClick(1, 0, SlotActionType.QUICK_MOVE);
slotClick(2, 0, SlotActionType.QUICK_MOVE);
slotClick(4, 0, SlotActionType.QUICK_MOVE);
if (gridSize == 2) {
slotClick(3, 0, SlotActionType.QUICK_MOVE);
} else {
slotClick(5, 0, SlotActionType.QUICK_MOVE);
}
}

// LOGGER.info("mousebutton = "+mouseButton);
// LOGGER.info("hasControl = "+Screen.hasControlDown());
// LOGGER.info("hasShift = "+Screen.hasShiftDown());
Expand Down

0 comments on commit 56f3493

Please sign in to comment.