#1496: Use correct Fluid class on Tags type check

This commit is contained in:
DerFrZocker 2024-10-27 07:26:23 +11:00 committed by md_5
parent c7aab7fa7f
commit abfe292aa6
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -2488,7 +2488,7 @@ public final class CraftServer implements Server {
return itemTags.getTags().map(pair -> (org.bukkit.Tag<T>) new CraftItemTag(itemTags, pair.key())).collect(ImmutableList.toImmutableList());
}
case org.bukkit.Tag.REGISTRY_FLUIDS -> {
Preconditions.checkArgument(clazz == org.bukkit.Material.class, "Fluid namespace (%s) must have fluid type", clazz.getName());
Preconditions.checkArgument(clazz == org.bukkit.Fluid.class, "Fluid namespace (%s) must have fluid type", clazz.getName());
IRegistry<FluidType> fluidTags = BuiltInRegistries.FLUID;
return fluidTags.getTags().map(pair -> (org.bukkit.Tag<T>) new CraftFluidTag(fluidTags, pair.key())).collect(ImmutableList.toImmutableList());
}