Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrbysco committed Jun 9, 2024
1 parent 11cd241 commit fef31da
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/shynieke/statues/recipe/LootRecipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public boolean showNotification() {

@Override
public boolean matches(RecipeInput recipeInput, Level level) {
return this.getIngredients().get(0).test(recipeInput.getItem(0));
return this.getIngredients().getFirst().test(recipeInput.getItem(0));
}

@Override
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/shynieke/statues/recipe/UpgradeType.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,10 @@ public boolean apply(ItemStack stack, int level) {

String glowingID = GLOWING.name().toLowerCase(Locale.ROOT);
StatueUpgrades statueUpgrades = stack.getOrDefault(StatueDataComponents.UPGRADES, StatueUpgrades.empty());
Map<String, Short> upgradeMap = new HashMap<>();
short glowLevel = statueUpgrades.upgradeMap().getOrDefault(glowingID, (short) 0);

if (glowLevel > 0) {
upgradeMap.putAll(statueUpgrades.withDowngrade(glowingID));
Map<String, Short> upgradeMap = new HashMap<>(statueUpgrades.withDowngrade(glowingID));

if (upgradeMap.getOrDefault(glowingID, (short) 0) == 0)
upgradeMap.remove(glowingID);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/shynieke/statues/util/ListHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static <T> T getRandomFromList(List<T> list) {
public static <T> T getRandomFromList(List<T> list, Random rand) {
final int size = list.size();
Preconditions.checkArgument(size > 0, "Can't select from empty list");
if (size == 1) return list.get(0);
if (size == 1) return list.getFirst();
int randomIndex = rand.nextInt(list.size());
return list.get(randomIndex);
}
Expand Down

0 comments on commit fef31da

Please sign in to comment.