0
다음은 내 직렬화 코드입니다. 나중에 다시로드하려면 어떻게해야합니까?플레이어의 인벤토리를 비 시리얼 화하는 방법
invs
은 myinventories.yml
FileConfiguration
입니다.
public void action(Player p){
PlayerInventory i = p.getInventory();
int slot = 0;
for(ItemStack item : i){
Map<String, Object> itemS = item.serialize();
if(Main.invs.get(p.getName() + ".inventory.slot." + slot) == null){
Main.invs.createSection(p.getName()+ ".inventory.slot." + slot);
}
Main.invs.set(p.getName() + ".inventory.slot." + slot, itemS);
slot = slot + 1;
}
slot = 0;
}
감사합니다. 지금 당장이 작업을 수행하고 있습니다. – ffxhand
나는 실제로 || (OR 비교) 부분이 효과가 있다고 생각하십니까? http://pastebin.com/UjZkLeHK – ffxhand
정상적으로 작동하며 수정하려면 게시물을 수정하고 있습니다. 내가 어떻게 망쳤는지 전혀 모르겠다. 부분이지만 분명히 실수입니다. – Pokechu22