1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2026-01-03 22:16:31 +00:00

Fix incorrectly converting MCPL to Geyser holdersets (#5577)

This commit is contained in:
Eclipse
2025-06-05 12:55:16 +00:00
committed by GitHub
parent efb52dc8f9
commit 955aa3aee0

View File

@@ -37,6 +37,7 @@ import org.geysermc.mcprotocollib.protocol.data.game.item.component.HolderSet;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.ToIntFunction;
/**
@@ -72,7 +73,8 @@ public final class GeyserHolderSet<T> {
* Constructs a {@link GeyserHolderSet} from a MCPL HolderSet.
*/
public static <T> GeyserHolderSet<T> fromHolderSet(JavaRegistryKey<T> registry, @NonNull HolderSet holderSet) {
return new GeyserHolderSet<>(registry, new Tag<>(registry, holderSet.getLocation()), holderSet.getHolders());
Tag<T> tag = holderSet.getLocation() == null ? null : new Tag<>(registry, holderSet.getLocation());
return new GeyserHolderSet<>(registry, tag, holderSet.getHolders());
}
/**