9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-23 00:49:31 +00:00

Fix terminal color on Windows (#176)

* Fix terminal color on Windows

Windows doesn't have environment variables TERM and COLORTERM by default, but we assuming that it supports the `truecolor` for terminal.

* Add back revert to original java console on Java 22
This commit is contained in:
Dreeam
2024-11-30 20:01:54 -05:00
committed by GitHub
parent 714cb8a9cf
commit 0510b51ed3
81 changed files with 23 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Date: Fri, 23 Aug 2024 20:22:00 -0400
Subject: [PATCH] Remove stream in RecipeManager getRecipeFor
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
index febf87b14125925f548393360e89077329a6c522..de7537c4eacf6fa549f74fd329102a2e4865194a 100644
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
@@ -118,9 +118,16 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
return Optional.of(recipe);
} else {
// CraftBukkit start
- List<RecipeHolder<T>> list = this.byType(type).stream().filter((recipeholder1) -> {
- return recipeholder1.value().matches(input, world);
- }).toList();
+ // Leaf start - Remove streams in RecipeManager getRecipeFor
+ List<RecipeHolder<T>> list = new java.util.ArrayList<>();
+
+ for (RecipeHolder<T> recipeholder1 : this.byType(type)) {
+ if (recipeholder1.value().matches(input, world)) {
+ list.add(recipeholder1);
+ }
+ }
+ // Leaf end - Remove streams in RecipeManager getRecipeFor
+
return list.isEmpty() ? Optional.empty() : Optional.of(list.getLast()); // CraftBukkit - SPIGOT-4638: last recipe gets priority
// CraftBukkit end
}