mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-23 08:59:23 +00:00
* 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
85 lines
3.5 KiB
Diff
85 lines
3.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Taiyou06 <kaandindar21@gmail.com>
|
|
Date: Mon, 11 Nov 2024 16:55:50 -0500
|
|
Subject: [PATCH] Remove stream in updateFluidOnEyes
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/core/Holder.java b/src/main/java/net/minecraft/core/Holder.java
|
|
index 4d2231868b786da9071c3dff2c073b478a486e8a..3887649c707393a7fb9d510c725bc58befe3090b 100644
|
|
--- a/src/main/java/net/minecraft/core/Holder.java
|
|
+++ b/src/main/java/net/minecraft/core/Holder.java
|
|
@@ -29,6 +29,8 @@ public interface Holder<T> {
|
|
|
|
Stream<TagKey<T>> tags();
|
|
|
|
+ Set<TagKey<T>> tagsAsSet(); // Leaf - Remove stream in updateFluidOnEyes
|
|
+
|
|
Either<ResourceKey<T>, T> unwrap();
|
|
|
|
Optional<ResourceKey<T>> unwrapKey();
|
|
@@ -105,6 +107,13 @@ public interface Holder<T> {
|
|
public Stream<TagKey<T>> tags() {
|
|
return Stream.of();
|
|
}
|
|
+
|
|
+ // Leaf start - Remove stream in updateFluidOnEyes
|
|
+ @Override
|
|
+ public Set<TagKey<T>> tagsAsSet() {
|
|
+ return Set.of();
|
|
+ }
|
|
+ // Leaf end - Remove stream in updateFluidOnEyes
|
|
}
|
|
|
|
public static enum Kind {
|
|
@@ -229,6 +238,13 @@ public interface Holder<T> {
|
|
return this.tags.stream();
|
|
}
|
|
|
|
+ // Leaf start - Remove stream in updateFluidOnEyes
|
|
+ @Override
|
|
+ public Set<TagKey<T>> tagsAsSet() {
|
|
+ return this.tags;
|
|
+ }
|
|
+ // Leaf end - Remove stream in updateFluidOnEyes
|
|
+
|
|
@Override
|
|
public String toString() {
|
|
return "Reference{" + this.key + "=" + this.value + "}";
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index 2427e8535d40204a42c214c2a47359d1555da38f..c4965b7582edfdf97cac82c1472f8fcc1a880a6b 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -2174,11 +2174,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
double d1 = (double) ((float) blockposition.getY() + fluid.getHeight(this.level(), blockposition));
|
|
|
|
if (d1 > d0) {
|
|
- Stream stream = fluid.getTags();
|
|
- Set set = this.fluidOnEyes;
|
|
+ // Leaf start - Remove stream in updateFluidOnEyes
|
|
+ Set<TagKey<Fluid>> tagsSet = fluid.getTagsAsSet();
|
|
+ Set<TagKey<Fluid>> set = this.fluidOnEyes;
|
|
|
|
- Objects.requireNonNull(this.fluidOnEyes);
|
|
- stream.forEach(set::add);
|
|
+ Objects.requireNonNull(set);
|
|
+ set.addAll(tagsSet);
|
|
+ // Leaf end - Remove stream in updateFluidOnEyes
|
|
}
|
|
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/level/material/FluidState.java b/src/main/java/net/minecraft/world/level/material/FluidState.java
|
|
index 49e07b51e7a516d71abc1976069be2d8b523c83c..3bcbc9628d70722f034d3a33bf3868cb96011d2d 100644
|
|
--- a/src/main/java/net/minecraft/world/level/material/FluidState.java
|
|
+++ b/src/main/java/net/minecraft/world/level/material/FluidState.java
|
|
@@ -157,4 +157,10 @@ public final class FluidState extends StateHolder<Fluid, FluidState> implements
|
|
public Stream<TagKey<Fluid>> getTags() {
|
|
return this.owner.builtInRegistryHolder().tags();
|
|
}
|
|
+
|
|
+ // Leaf start - Remove stream in updateFluidOnEyes
|
|
+ public java.util.Set<TagKey<Fluid>> getTagsAsSet() {
|
|
+ return this.owner.builtInRegistryHolder().tagsAsSet();
|
|
+ }
|
|
+ // Leaf end - Remove stream in updateFluidOnEyes
|
|
}
|