Skip to content

Commit

Permalink
或者字符串id时传入版本
Browse files Browse the repository at this point in the history
  • Loading branch information
lt-name committed Dec 30, 2023
1 parent f37ff93 commit 2821da7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/cn/lanink/gamecore/utils/PlayerDataUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import cn.nukkit.Server;
import cn.nukkit.item.Item;
import cn.nukkit.level.Position;
import cn.nukkit.network.protocol.ProtocolInfo;
import cn.nukkit.plugin.Plugin;
import cn.nukkit.utils.Config;
import lombok.Getter;
Expand Down Expand Up @@ -54,7 +55,7 @@ public static LinkedHashMap<String, List<?>> inventoryToLinkedHashMap(@NotNull M
LinkedList<String> list = new LinkedList<>();
if (entry.getValue() != null) {
if (NukkitTypeUtils.getNukkitType() == NukkitTypeUtils.NukkitType.MOT) {
list.add(entry.getValue().getNamespaceId()); //0
list.add(entry.getValue().getNamespaceId(ProtocolInfo.CURRENT_PROTOCOL)); //0
} else {
list.add(entry.getValue().getId() + ":" + entry.getValue().getDamage()); //0
}
Expand Down

0 comments on commit 2821da7

Please sign in to comment.