diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-08-21 05:12:31 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-08-21 05:12:31 +0800 |
| commit | 88025ee2dd9830aacaa380f5394c1072ed661f8f (patch) | |
| tree | 24576a8676622d1d8fce712e847f0592537e51ea | |
| parent | 38779f9b8e3804a6efa0e47d28226017e2584c13 (diff) | |
| download | RoughlyEnoughItems-88025ee2dd9830aacaa380f5394c1072ed661f8f.tar.gz RoughlyEnoughItems-88025ee2dd9830aacaa380f5394c1072ed661f8f.tar.bz2 RoughlyEnoughItems-88025ee2dd9830aacaa380f5394c1072ed661f8f.zip | |
Fix not being able to move items to grid in survival.
Signed-off-by: shedaniel <daniel@shedaniel.me>
| -rw-r--r-- | RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java | 39 | ||||
| -rw-r--r-- | gradle.properties | 2 |
2 files changed, 20 insertions, 21 deletions
diff --git a/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java b/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java index 8d8eeb4cb..4447256e2 100644 --- a/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java +++ b/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java @@ -59,30 +59,29 @@ public class InputSlotCrafter<C extends Inventory> implements RecipeGridAligner< this.player = player; this.inventoryStacks = this.containerInfo.getInventoryStacks(this); this.gridStacks = this.containerInfo.getGridStacks(this); - if (player.isCreative()) { - player.skipPacketSlotUpdates = true; - // Return the already placed items on the grid + + player.skipPacketSlotUpdates = true; + // Return the already placed items on the grid + this.returnInputs(); + + RecipeFinder recipeFinder = new RecipeFinder(); + this.containerInfo.getRecipeFinderPopulator().populate(this).accept(recipeFinder); + DefaultedList<Ingredient> ingredients = DefaultedList.of(); + map.entrySet().stream().sorted(Comparator.comparingInt(Map.Entry::getKey)).forEach(entry -> { + ingredients.add(Ingredient.ofItems(entry.getValue().stream().map(ItemStack::getItem).toArray(Item[]::new))); + }); + + if (recipeFinder.findRecipe(ingredients, null)) { + this.fillInputSlots(recipeFinder, ingredients, hasShift); + } else { this.returnInputs(); - - RecipeFinder recipeFinder = new RecipeFinder(); - this.containerInfo.getRecipeFinderPopulator().populate(this).accept(recipeFinder); - DefaultedList<Ingredient> ingredients = DefaultedList.of(); - map.entrySet().stream().sorted(Comparator.comparingInt(Map.Entry::getKey)).forEach(entry -> { - ingredients.add(Ingredient.ofItems(entry.getValue().stream().map(ItemStack::getItem).toArray(Item[]::new))); - }); - - if (recipeFinder.findRecipe(ingredients, null)) { - this.fillInputSlots(recipeFinder, ingredients, hasShift); - } else { - this.returnInputs(); - player.skipPacketSlotUpdates = false; - this.containerInfo.markDirty(this); - throw new NotEnoughMaterialsException(); - } - player.skipPacketSlotUpdates = false; this.containerInfo.markDirty(this); + throw new NotEnoughMaterialsException(); } + + player.skipPacketSlotUpdates = false; + this.containerInfo.markDirty(this); } @Override diff --git a/gradle.properties b/gradle.properties index ce820d90c..afda0d113 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ org.gradle.jvmargs=-Xmx3G -mod_version=5.2.4 +mod_version=5.2.5 supported_version=1.16.2 minecraft_version=1.16.2-rc1 yarn_version=1.16.2-rc1+build.4+legacy.20w09a+build.8 |
