9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2026-01-03 22:26:19 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0066-Remove-stream-in-updateFluidOnEyes.patch
Dreeam 01fa6ac227 Add Leaf Commands (WIP)
* Added Leaf Commands base
* Added WIP /leaf reload
* Added /leaf version
* Change /gale permission to OP as default
2025-02-22 03:15:42 -05:00

76 lines
3.1 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/net/minecraft/core/Holder.java b/net/minecraft/core/Holder.java
index 6c7edbbf3935c40ccb78bee680ea75431718b9bd..a1b4dc70d555cce5e06c0298736d8b89e04a96be 100644
--- a/net/minecraft/core/Holder.java
+++ b/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.boundTags();
+ }
+ // Leaf end - Remove stream in updateFluidOnEyes
+
@Override
public String toString() {
return "Reference{" + this.key + "=" + this.value + "}";
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 970420761b2c3b82a60479c556e76e385bf211e1..4d88aa70c01e03baf8aea897b00f335c7be91f46 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -1984,7 +1984,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
FluidState fluidState = this.level().getFluidState(blockPos);
double d = blockPos.getY() + fluidState.getHeight(this.level(), blockPos);
if (d > eyeY) {
- fluidState.getTags().forEach(this.fluidOnEyes::add);
+ this.fluidOnEyes.addAll(fluidState.getTagsAsSet()); // Leaf - Remove stream in updateFluidOnEyes
}
}
}
diff --git a/net/minecraft/world/level/material/FluidState.java b/net/minecraft/world/level/material/FluidState.java
index 481cb46973acb9785fdee5732e98aac560c6ec08..06581fe010ca722d62d0b6d3c44d845f9db0231f 100644
--- a/net/minecraft/world/level/material/FluidState.java
+++ b/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
}