#spigot help
1 messages ยท Page 1 of 1 (latest)
And multiple people have given you advice regarding this
I will repeat mine:
You should study a bit more OOP and make sure you understand how it works before attempting to write a plugin
"Accessing a method/variable from another class" is a common beginner question that demonstrates a fundamental misunderstanding of how object orientation works
i know how oop works
Then you should know that you need to call a non-static method on an instance of a class, not the class itself
And that you will need to instantiate (or obtain) this instance
no i dont, im new to java, i know oop from python and javascript
that's my code
Then you don't understand OOP in the right context, those languages' OOP implementations are nothing like java's
java is a weird language
Java has a much more rigid type system and more fleshed-out OOP because OOP was the entire point in java rather than an afterthought in language design
Python and js are the ones with weird OOP implementations
An issue with that code is that you'll have one global gui if you create one
You should learn more about java OOP before attempting to write plugins
It can be learned in a few hours to a few days and will be the foundation of all code you write in java
So it's very important
Once you understand OOP you'll need to understand HashMaps as well
Very useful for this context
but dont you agree that you learn from mistakes and erros you do ? im sure if i learn how to fix this then ill figure out the rest
You'll learn best by learning the core structure of OOP. The issue at hand is by solving your problem you may not understand core functionality that will help in the long run
If you only understand the mechanics of it insofar as they enable you to make things work how you want them to, you will never be able to make conscious design decisions
ok, any tutorials for reference ?
I'm entirely self taught I don't really have any tutorials I can recommend. Others do but it really comes down to how one learns.
I kinda read the oracle docs
then how am i suppose to learn ๐คทโโ๏ธ
Well you've got simple go-overs like this https://www.javatpoint.com/java-oops-concepts
Java OOPs Concepts, OOPs, (Object-Oriented Programming), procedure-oriented vs object-oriented, java oops concept with examples, oops features, object, class, inheritance, polymorphism, abstraction and encapsulation.
If you like courses there are plenty out there
ok thanks
If you like videos there's lots but I like this guy https://www.youtube.com/c/CodingwithJohn/
I dont like articles, probably wont be useful for me
ok thanks
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Got a ways to go before we reach DI
isn't that ban detectable ?
if that makes any sense
its a simple concept really
im a go dev, i have development knowledge ๐
just pass your container class as a constructor parameter
-close