feat: actually reset

This commit is contained in:
ineanto 2023-12-28 21:20:18 +01:00
parent 61132a2c88
commit 4f13d3fc2d

View file

@ -115,22 +115,18 @@ public class AppearanceManager {
properties.get("textures").clear(); properties.get("textures").clear();
properties.put("textures", new WrappedSignedProperty("textures", skinResult.value(), skinResult.signature())); properties.put("textures", new WrappedSignedProperty("textures", skinResult.value(), skinResult.signature()));
} else { } else {
profile.setSkin(null); reset();
dataStore.updateCache(player.getUniqueId(), profile);
return ActionResult.error(I18NDict.Error.MOJANG_SKIN); return ActionResult.error(I18NDict.Error.MOJANG_SKIN);
} }
} else { } else {
profile.setName(null); reset();
dataStore.updateCache(player.getUniqueId(), profile);
return ActionResult.error(I18NDict.Error.MOJANG_NAME); return ActionResult.error(I18NDict.Error.MOJANG_NAME);
} }
return ActionResult.ok(); return ActionResult.ok();
} catch (ExecutionException e) { } catch (ExecutionException e) {
return ActionResult.error(I18NDict.Error.CACHE); return ActionResult.error(I18NDict.Error.CACHE);
} catch (IOException e) { } catch (IOException e) {
profile.setName(null); reset();
profile.setSkin(null);
dataStore.updateCache(player.getUniqueId(), profile);
return ActionResult.error(I18NDict.Error.MOJANG_NAME); return ActionResult.error(I18NDict.Error.MOJANG_NAME);
} }
} }