Skip to content

Commit

Permalink
24w46a
Browse files Browse the repository at this point in the history
  • Loading branch information
gnembon committed Nov 13, 2024
1 parent 24ab040 commit e7d30cc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check https://fabricmc.net/develop/
minecraft_version=24w44a
minecraft_version=24w46a
loader_version=0.16.7
jsr305_version=3.0.2
fabric_version=0.106.0+1.21.2
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/carpet/helpers/HopperCounter.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;

import static java.util.Map.entry;
Expand Down Expand Up @@ -420,13 +421,10 @@ public static TextColor guessColor(Item item, Level level)
{
for (Ingredient ingredient : r.placementInfo().ingredients())
{
for (Holder<Item> stack : ingredient.items())
Optional<Holder<Item>> match = ingredient.items().filter(stack -> fromItem(stack.value(), registryAccess) != null).findFirst();
if (match.isPresent())
{
TextColor cand = fromItem(stack.value(), registryAccess);
if (cand != null)
{
return cand;
}
return fromItem(match.get().value(), registryAccess);
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/carpet/script/api/Inventories.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,14 @@ public static void apply(Expression expression)


List<Value> ingredientValue = new ArrayList<>();
for (Optional<PlacementInfo.SlotInfo> info : recipe.placementInfo().slotInfo())
for (int info : recipe.placementInfo().slotsToIngredientIndex())
{
if (info.isEmpty())
if (info == PlacementInfo.EMPTY_SLOT)
{
ingredientValue.add(Value.NULL);
continue;
}
PlacementInfo.SlotInfo value = info.get();
int ingredientIndex = value.placerOutputPosition();
int ingredientIndex = info;

List<Value> alternatives = new ArrayList<>();
recipe.placementInfo().ingredients().get(ingredientIndex).items().forEach(item -> alternatives.add(ValueConversions.of(item.value(), regs)));
Expand Down

0 comments on commit e7d30cc

Please sign in to comment.