mirror of
https://github.com/PaperMC/Paper.git
synced 2024-09-11 14:38:05 +02:00
33 lines
1.8 KiB
Diff
33 lines
1.8 KiB
Diff
|
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 f0fa928a66140293166dddc37eee50a2041560ed..eb29131934370ea2865f8feee93ec3cb5490c4b1 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 d8f4d351a66c6d1e60e1a470ce64f538c7718232..88c58676e6d2eb618596cd118257cbf7973396a9 100644
|
||
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||
|
@@ -198,7 +198,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);
|
||
|
}
|
||
|
|