From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Tue, 1 Mar 2022 12:45:50 -0800
Subject: [PATCH] Fix Fluid tags isTagged method


diff --git a/src/main/java/org/bukkit/craftbukkit/tag/CraftFluidTag.java b/src/main/java/org/bukkit/craftbukkit/tag/CraftFluidTag.java
index 89cb1ec575c0f58e9934d98b056621348dbbe27a..cdd474e9b0363641839a66d3e61fec46c735879a 100644
--- a/src/main/java/org/bukkit/craftbukkit/tag/CraftFluidTag.java
+++ b/src/main/java/org/bukkit/craftbukkit/tag/CraftFluidTag.java
@@ -16,7 +16,7 @@ public class CraftFluidTag extends CraftTag<net.minecraft.world.level.material.F
 
     @Override
     public boolean isTagged(Fluid fluid) {
-        return CraftMagicNumbers.getFluid(fluid).is(tag);
+        return registry.getHolderOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.Registry.FLUID_REGISTRY, org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(fluid.getKey()))).is(tag); // Paper
     }
 
     @Override
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index bda04a3a7865cfaf6eff7a40b3f12fa3145771e9..41e7ca100073052b99c82fa6a82f8168e0135499 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -201,7 +201,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
         return CraftMagicNumbers.MATERIAL_BLOCK.get(material);
     }
 
-    public static net.minecraft.world.level.material.Fluid getFluid(Fluid fluid) {
+    public static net.minecraft.world.level.material.Fluid getFluid(Material fluid) { // Paper - wrong type
         return CraftMagicNumbers.MATERIAL_FLUID.get(fluid);
     }
 
