mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-03 22:26:19 +00:00
Upstream has released updates that appear to apply and compile correctly Gale Changes: Dreeam-qwq/Gale@f2c8aaf Sync update from ver/1.21.1 branch
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 e91c4e26c25980645941ca8fbdcc3a9d02e31063..006044af19cb70f6bd1dbda31bc13e60cd37a0fb 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 {
|
|
@@ -238,6 +247,13 @@ public interface Holder<T> {
|
|
return this.boundTags().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 8ac2b3a17d1a9df6695c8034b71544704be23036..d203ab8cd02432e05d6e3b8766d5a733e570173d 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -2096,11 +2096,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 2d50d72bf026d0cf9c546a3c6fc1859379bfd805..ae8b7e2b185918e197de211a3f541bc0dd1943c3 100644
|
|
--- a/src/main/java/net/minecraft/world/level/material/FluidState.java
|
|
+++ b/src/main/java/net/minecraft/world/level/material/FluidState.java
|
|
@@ -158,4 +158,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
|
|
}
|