Comments (7)
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.
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
from simplixstorage.
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.
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":
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
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.
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.
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.
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)
- Jar download HOT 2
- Use of custom serialization objects HOT 2
- Unsupported class file major version 60 when compiling in java 16 HOT 1
- Toml comments are not preserved HOT 2
- Error when using the reload callback HOT 2
- Add Toml comment preservation and header methods HOT 4
- HOCON config support HOT 2
- Config(yaml) has broken edit with UTF-8 Characters HOT 3
- Split code base into modules HOT 1
- Comments dissappear when adding defaults. HOT 2
- Supporting comments and preserving comments in a file TOML HOT 1
- Wiki is outdated HOT 1
- Discord invite invalid HOT 1
- Latest release shows wrong version in maven HOT 1
- Need some help HOT 2
- Rethrow exceptions HOT 1
- Yaml#addDefaultsFromInputStream messes the order of keys even if the DataType is sorted
- Does not generate files
- Dot in key create problem with FlatFile HOT 1
- Request for future updates HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simplixstorage.