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:
@@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user