mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-28 15:36:06 +00:00
- transformReplace() now gives the replacement item in the player inventory if it is part of a stack (instead of modifying the whole stack)
- Added noReturn() transformation to avoid any item from being returned. Suppressed programmed vanilla/mod behaviour to, for example, give a bucket back. - Added giveBack() and giveBack(item) transformation to return the item, or a replacement item, back into the inventory instead of the crafting table. Fixes fighting between transformations and default mod/vanilla behavior. - Fixed asterisks in multiline comments breaking script parsing. - Fixed removeShaped function not working properly if no ingredients are given - Fixed addAll for oredict entries in 1.7.10
This commit is contained in:
1 parent
56b8c9355c
commit
25b9589af7
34 files changed
+163
-59
No files matched your search
@@ -10,6 +10,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.player.IPlayer;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -67,12 +68,12 @@ public class ShapelessRecipe implements ICraftingRecipe {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyTransformers(ICraftingInventory inventory) {
|
||||
public void applyTransformers(ICraftingInventory inventory, IPlayer byPlayer) {
|
||||
RecipeMatching matching = matchShapeless(ingredients, inventory);
|
||||
|
||||
for (int i = 0; i < ingredients.length; i++) {
|
||||
IIngredient ingredient = ingredients[i];
|
||||
IItemStack transformed = ingredient.applyTransform(matching.inputs[i]);
|
||||
IItemStack transformed = ingredient.applyTransform(matching.inputs[i], byPlayer);
|
||||
if (transformed != matching.inputs[i]) {
|
||||
inventory.setStack(matching.indices[i], transformed);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user