Giter Site home page Giter Site logo

Comments (5)

danorris709 avatar danorris709 commented on June 7, 2024

Could you show what you're doing please?

from api.

Razzybazzy1 avatar Razzybazzy1 commented on June 7, 2024

I'm attempting to get every attribute from my plugin, that i currently have to loop through the directory so that it can get all the UUIDs of the players with attributes, and then use getSaveManager().loadAttribute(). After loading the attribute, using the UUID from the file's name, the attribute is loaded by using this.id or this.getId() returns null regardless of if the player is online

java~
if (ConfigProxy.PLAYERDATA.exists() && ConfigProxy.PLAYERDATA.isDirectory()) {
File[] files = ConfigProxy.PLAYERDATA.listFiles();
if (files != null) {
for (File file : files) {
UUID uuid = UUID.fromString(file.getName().replace(".json", ""));
playerManager.getSaveManager().loadAttribute(AttributeData.class, uuid).whenComplete((attribute, throwable) -> {
attribute.setUuid(uuid); // had to add as if using this.id and this.getId() both return null
DATA.put(uuid, attribute);
});
}
}
}

from api.

danorris709 avatar danorris709 commented on June 7, 2024

Does the attribute class extend PlayerAttribute? if not then the JsonSaveManager will not update the parent after it is loaded.

from api.

Razzybazzy1 avatar Razzybazzy1 commented on June 7, 2024

it extends the ManagedForgeAttribute also the player is offline, but i still want to get the UUID

from api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.