Compare commits

..

No commits in common. "d56761cd273210e80abb86c54b0b01646672f4de" and "71c2263c9da3a608d2664c11a5eb6b4908b49be5" have entirely different histories.

1 changed files with 2 additions and 14 deletions

View File

@ -32,25 +32,13 @@ public abstract class ServerPlayerEntityMixin implements ServerPlayerEntityInter
@Inject(method = "writeCustomDataToNbt", at = @At("TAIL"))
public void writeCustomDataToNbt(NbtCompound nbt, CallbackInfo ci) { //Immer wenn eine andere Methode aufruft, dass Daten abgespeichert werden sollen, tun wir das jetzt auch
if (dataSaver != null) { //wenn der dataSaver null ist, wuerde sonst ein Error kommen, weil Minecraft keine leeren NBTs absepeicheern kann :(
try {
nbt.put("REServerMod", this.dataSaver);
} catch (Exception e) {
REServerMod.LOGGER.info("Error while saving custom NBt-Data: " + e);
}
} else {
REServerMod.LOGGER.info("write failed! This probably means, that the player hasn't set a custom spanpoint yet");
}
nbt.put("REServerMod", this.dataSaver);
//REServerMod.LOGGER.info("writeCustomDataToNbt called");
}
@Inject(method = "readCustomDataFromNbt", at = @At("TAIL"))
public void readCustomDataFromNbt(NbtCompound nbt, CallbackInfo ci) { //gleiches beim einlesen. Werden NBT-Daten eingelesen, tun wird das auch
try {
dataSaver = (NbtCompound) nbt.get("REServerMod");
} catch (Exception e) {
REServerMod.LOGGER.info("Error while saving custom NBt-Data: " + e);
}
dataSaver = (NbtCompound) nbt.get("REServerMod");
//REServerMod.LOGGER.info("readCustomDataFromNbt called with following Data: " + Arrays.toString(nbt.getIntArray("REServerMod.sleep_data")));
}