Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/1.20.x' into 1.20.1-fabric-dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	gradle.properties
#	src/main/java/net/p3pp3rf1y/sophisticatedcore/upgrades/feeding/FeedingUpgradeWrapper.java
  • Loading branch information
Salandora committed Jan 5, 2025
2 parents 5d654a7 + 2171fac commit b094721
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mod_id=sophisticatedcore
mod_name=Sophisticated Core
mod_license=GNU General Public License v3.0
mod_group_id=sophisticatedcore
mod_version=1.0.6.1
mod_version=1.0.8.1
mod_authors=P3pp3rF1y, Salandora
mod_description=A library / shared functionality mod for Sophisticated Storage and Backpacks
mod_credits=Created by P3pp3rF1y. Ported to Fabric by Salandora.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ public static ShapeBasedRecipeBuilder shaped(ItemStack stack) {
return shaped(stack.getItem(), stack.getTag(), RecipeSerializer.SHAPED_RECIPE, stack.getCount());
}

public static ShapeBasedRecipeBuilder shaped(ItemStack result, RecipeSerializer<?> serializer) {
return new ShapeBasedRecipeBuilder(result.getItem(), result.getTag(), serializer, 1);
}

public ShapeBasedRecipeBuilder define(Character symbol, TagKey<Item> tagIn) {
return define(symbol, Ingredient.of(tagIn));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ private boolean tryFeedingStack(Level level, int hungerLevel, Player player, Int
singleItemCopy.setCount(1);

if (singleItemCopy.use(level, player, InteractionHand.MAIN_HAND).getResult() == InteractionResult.CONSUME) {
// Changed for compatibility with rpg inventory
player.setItemInHand(InteractionHand.MAIN_HAND, mainHandItem); //player.getInventory().items.set(player.getInventory().selected, mainHandItem);

stack.shrink(1);
inventory.setStackInSlot(slot, stack);

Expand All @@ -113,6 +110,9 @@ private boolean tryFeedingStack(Level level, int hungerLevel, Player player, Int
InventoryHelper.insertOrDropItem(player, insertResult, inventory, PlayerInventoryStorage.of(player));
}
}

// Changed for compatibility with rpg inventory
player.setItemInHand(InteractionHand.MAIN_HAND, mainHandItem); //player.getInventory().items.set(player.getInventory().selected, mainHandItem);
return true;
}
// Changed for compatibility with rpg inventory
Expand Down

0 comments on commit b094721

Please sign in to comment.