multi-sleep improved #9
|
@ -26,12 +26,16 @@ public class setAndGetMultiButtonsSpawn {
|
||||||
fullArray[2] = (int) player.getZ();
|
fullArray[2] = (int) player.getZ();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
assert subNbt != null;
|
if (subNbt != null) {
|
||||||
subNbt.putIntArray(String.valueOf(spawn), fullArray); //speichert unseren array an der entsprechenden nummer ab
|
subNbt.putIntArray(String.valueOf(spawn), fullArray); //speichert unseren array an der entsprechenden nummer ab
|
||||||
topNbt.put("multi_sleep", subNbt); //speichert den tag unter multi_sleep im top-tag ab
|
topNbt.put("multi_sleep", subNbt); //speichert den tag unter multi_sleep im top-tag ab
|
||||||
castedPlayer.setDataSaver(topNbt); //speichert den top-tag wieder im spieler ab
|
castedPlayer.setDataSaver(topNbt); //speichert den top-tag wieder im spieler ab
|
||||||
|
} else {
|
||||||
|
REServerMod.LOGGER.info("Error when trying to write spawn to file!");
|
||||||
|
player.sendMessage(Text.translatable("chat.modchest.multispawn.spawnnotsaved"));
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
REServerMod.LOGGER.info("Sorry! Error when saving Spawnpoint! Exception: " + e);
|
REServerMod.LOGGER.info("Error when saving Spawnpoint! Exception: " + e);
|
||||||
player.sendMessage(Text.translatable("chat.modchest.multispawn.spawnnotsaved"));
|
player.sendMessage(Text.translatable("chat.modchest.multispawn.spawnnotsaved"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue