Coder Social home page Coder Social logo

Comments (7)

KotlinFactory avatar KotlinFactory commented on June 6, 2024

Hey thefrogline,

Thank you for using SimplixStorage and asking this question here,

The way you are creating your YAML is already fine.

You can retrieve data from is using

getString("PAtH-TO-VALUE")
getInteger("PATH-TO-VALUE");

What exactly do you mean by "the config is not recognizing me"?

We would love to help you.

If you have any further questions, feel free to ask.
If you need real-time help, feel free to join our Discord: discord.simplixsoft.com

Regards,
Leonhard

from simplixstorage.

thefrogline avatar thefrogline commented on June 6, 2024

Hi! Thanks for answering, because with "the config is not recognizing me" I mean this, the yml does not detect me, I am trying to make a command block to test all this of the configuration system, I also leave you an image of how it looks my project, so you can see if I'm doing something wrong. or I don't know if I'm doing something wrong, I'm new to all this library stuff and it's still a bit hard for me to understand . I am trying to do this with a configuration already with comments and configurationI am trying to do this with a configuration already with comments and configuration
image
image

from simplixstorage.

yoyosource avatar yoyosource commented on June 6, 2024

Hello thefrogline,

as Intelij gives you a hint what is wrong, is says 'Cannot resolve symbol [...]', this is why the field you specified with the name 'yaml' is not in your current context. This is because there is no field named the same way. Did you create this field somewhere, if yes where?

Other than that. If you 'getString()' from some kind of Configuration you get a String object on which no method with the name 'getStringList()' is available. This is because there is a difference in a String object and some kind of Configuration object specified by SimplixStorage.

Regards yoyosource

from simplixstorage.

thefrogline avatar thefrogline commented on June 6, 2024

Hello!
sorry for the delay in answering, I will explain all my code and if you do not understand something tell me, I speak Spanish and sometimes it is difficult for me to translate some things, but I will try also that I am something new in Java

1.- With my code first what I do is create a configmanager, which what it does is create all the configurations with a constructuctor called "create config":
image

2.- In my OnEnable () I start to create all the configurations, for now I have 3 tests, and they are all created with the same .yml format
image

3.- Now what I want to know is how from my main or my configmanager, get part of the configuration of some of my specific files, for example in security I want to get the blocked words, and in config.yml get the prefix of my plugin (it's just an example), perhaps because of the method by which I am doing it, it is not possible, or it would be better if they tell me how to use their api correctly, sorry for so much confusion when it comes to explaining myself and I understand very little, and perhaps misbehaving , but thank you very much for answering!

from simplixstorage.

yoyosource avatar yoyosource commented on June 6, 2024

Hello thefrogline,

no problem. Your ConfigManager just creates a file and internally creates and Config object. So to access that object you need to have a field somewhere. I would consider a Map<String, Config> or a List<Config> for your use case. You should also read the Config if the config file exists, otherwise you just create a file on disk and never use it. Creating your config files in the onEnable() is fine. But your class CommandBlocker does not know the instances creates in ConfigManager or the onEnable() method. So creating a Field or saving in a Map, that is stored in a field, is your solution, I think. Maybe you could return a Config object from createConfig(String) so you can save it in the onEnable() method in some kind of field and access it in your BlockCommand class?

Regards yoyosource.

from simplixstorage.

thefrogline avatar thefrogline commented on June 6, 2024

Thank you very much, what you recommended helped me and I was finally able to use the api, really good support, I haven't asked for support for a long time because I had a bad experience (in another plugin, I am not talking about any of their other plugins), but thank you very much for being patient and helping me! and sorry for delaying in answering :D, recommendation, that there be some example plugin of how to use the plugin well, for new people like me xd, how to do what I ask and things like that

from simplixstorage.

yoyosource avatar yoyosource commented on June 6, 2024

No problem. One problem with example plugins is, that you do not learn how use the plugin but copy what others give you. That is not good if you want to use the plugin on your own without relying on others. So yeah example help but a whole example plugin would not be good, in my opinion.

Regards yoyosource.

from simplixstorage.

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.