#help-development
1 messages · Page 1862 of 1
sure, you can probably keep that line of questioning going for everything
Probst more
there is really no way to measure the exact number of bots today
Try BukkitObjectOutputStream/BukkitObjectInputStream
You can serialize the map without another format if you like. If you're storing stuff in YAML, most YAML implementations are able to directly store maps.
Why do you need it as a string?
Generally you serialize it because you want to store it somewhere
Where will the string go in the end? What are you using it for?
Either yaml, or abitrary binary data
or a DB
He's probably trying to make a data syncing plugin
Storing a serialized string in a DB violates at least one normal form
ok? doesn't really matter. And I wouldn't store serialized strings as a string anyways, I would just serialize the entire Java object and store it in a BLOB
You'll have to serialize it yourself
you can iterate over the map
Simply serialize the map. Most YAML and JSON libraries can get you what you want.
it needs to be base 64 otherwise we get people complaining about 32bits
even though it has nothing to do with that
... WHAT LMAO
just don't tell the confused that 64bits has been around for a long time already since the 8bit days 😛
lmao
This is so far off the mark from what Base64'ing some data does that I'm contracting impediments right now
it needs to be base 64 otherwise we get people complaining about 32bits
I think the only one failing to comprehend things here is you. This is not even close to what Base64ing is about
I know, read the next line down and I even say it has nothing to do with it
my messages is satire on the technologically illiterate ones
anyways moving on
sorry that i ask but i forgot, which should i click to export my plugin?
package
thx!
Package is preferred. Install will put the binary in your maven cache
🦛
that is technically true
is there a current method for spawning falling blocks? the spawnFallingBlock method from the World class is deprecated.
?jd
Read the docs
This command is so blessed
there is more then one method for that, find that method in the Javadocs and you will see the other same named ones that are not deprecated
yeah i was using a very old one. i switch to a non-deprecated version.
can you limit the amount of passengers for entities?
the old method was setPassenger for enemies. the current one is addPassenger since enemies can have multiple passengers. but is there any way you can limit it to for example only 1 passenger?
hey peeps, not home atm and hd a question i wanted to ask before i forgot
is it possible to spawn an NMS item entity?
i currently have items spawned for damage counters/potion effects when theyre applied but i use a scheduler to handle their removal. is it possible to perhaps create custom ones where if they touch the ground they remove themselves/die after a certain amount of time?
is it like setMaxTicks
ohhh truee
ill check when i get home but if someone sees this and has a big brain idea pls lmk!
I mean you can check if they touch the ground without using nms too
depending on how precise you want to get
but yes you can spawn nms item entity
uh sorry to disturb you guys but I have some problems comparing my inventory.. I won't get the message in the event at all.
Your comparison should probably be if (views.get(player) == event.getView()).
And make sure to remove the entry from the Map when you close the inventory
UUID
Meh, I can't imagine having a Player there is much of a concern. Though if you don't really need that Player instance then yeah, might as well be a UUID
Noticing just now that you have a listener in a command executor though
Bukkit.getPluginManager().registerEvents(plugin, new BalloonCommand())
this.getCommand("balloon").setExecutor(new BalloonCommand());
If you're doing this ^, it's not going to work
I just changed it to an ArrayList.
I still don't get why this does not work at all.
I think contains is still like == and not .equals.
Oh
So you can't have both a listener and a commandexecutor in one class?
I mean you can but you should seperate it
That's what ur trying to tell?
You should generally separate them, but you can keep them together if you want. However you have to also understand that you are creating two instances of that class
One which is a command and is modifying that list, one which is a listener that is listening to a completely different list

Thank you for the reminder haha xD
Sometimes I just need people to look over my code I would never have noticed that.
can just make it once, hold it as a variable and pass it into both, then you're probably good to go
Rest of the code looks fine

Also why are emotes blocked on this server? It's so sad I can't use all that pepe emojis 😦
Just a booster+ thing
Sadge
just become a booster 🙂
I already boosted my server twice and I don't wanna pay 3.5€ a month for just emotes.
When I get a job i can do it. Atm i am poor.
However let's not discuss such things here in this channel. Wrong topic xD
public class Balloons extends JavaPlugin {
public String prefix = ChatColor.translateAlternateColorCodes('&',
Objects.requireNonNull(getConfig().getString("Prefix")));
private BalloonsCommand balloonsCommand;
@Override
public void onEnable() {
loadConfig();
balloonsCommand = new BalloonsCommand(this);
loadCommands();
loadListener();
Bukkit.getConsoleSender().sendMessage(prefix + ChatColor.translateAlternateColorCodes('&',
Objects.requireNonNull(getConfig().getString("Started"))));
}
@Override
public void onDisable() {
saveConfig();
Bukkit.getConsoleSender().sendMessage(prefix + ChatColor.translateAlternateColorCodes('&',
Objects.requireNonNull(getConfig().getString("Stopped"))));
}
private void loadConfig() {
getConfig().options().copyDefaults(true);
saveConfig();
}
private void loadCommands() {
Objects.requireNonNull(Bukkit.getPluginCommand("balloons"))
.setExecutor(balloonsCommand);
}
private void loadListener() {
PluginManager pm = Bukkit.getPluginManager();
pm.registerEvents(balloonsCommand, this);
}
}
K i'm just confused...
Choco I created a variable of the ballonsCommand as you suggested.
And it's still not working?!
need to register the command
The command is registered.
In the plugin.yml and in the main class I just pasted in here.
this.getCommand("balloons").setExecutor(new BalloonsCommand(this));
is what should be in the onEnable()
well could be in the command class too, but either way you need to register the command with the server
plugin.yml is for default permissions
It doesn't matter if u put it into a method or just straight up into the onEnable method. I don't have a commands class for registering each command. I just did it all in the loadCommands method. Besides that, plugin.yml needs the command in there as well, otherwise it won't work at all. So if u don't list it there, it won't work.
Also this. is completly useless, you don't need it.
lol I saw after I was done typing, and second I wasn't saying plugin.yml isn't needed, just it isn't the same kind of registering is all.
Just use "this." for variables with the same name. For example if u have a method having parameters which are called the same as ur class variables.
All fine m8 ;D
Alright so the command is what isn't working right?
Yeah..
The problem was that I initialized the class twice, but it's still not working somehow.
I try figuring it out on my own first of all.
I head back to u if I need help.
IT WORKS
I changed back to a hashmap and it works finally oh gosh
I think the issue might be you should use getCommand() instead of getPluginCommand()
nvm then
lmao
For the love of god finally I made it fixing this ugly thing
Oh i got a lot of plugins with ugly code.
I am puking when I see my old code from like 5 years ago..
I will seperate now my commandexecutor and listener, just like Choco recommended it.
it is what I do 🙂
this is how I setup some of my command stuff 😛
that way the extra variable for my command is not required anymore. that's why you seperate such things. now I understand. I will follow the grand wizard choco's rules in future. xD
yeah I am too lazy to write projects to setup such things.
I think doing that would save me a lot of work tho
So I could just use it multiple times and save all that setup stuff I have to do over and over lol
Just came back into spigot coding after years, so i start it slowly.
the way I do it isn't the most efficient, but it works in that it helps keep things organized 🙂
Hi, good night, i have a problem with items in inventories, i'm trying to code a duels plugin, so i am creating kits and when loading the contents to the player, when the player tries to move the item it seems to be in the destination slot but when you try to use it, it disappear.
here is the code: https://paste.md-5.net/ewafexohor.cs
if someone helps me, please tag me, thank you 😄
that's nice way to stackoverflow
How could you display rgb chat messages again?
Like with a specific rgb value, not just the enum values of chatcolor
Using CommandPreprocess event, does isCancelled turn true if the syntax was wrong or something
like, if the command fails
try it and see?
that wouldn’t make sense
can anyone with TI knowledge regarding spigot help me with the creation of a plugin on eclpise? I can't get any imports to work even though I have a spigot 1.18 file set as an external reference library
net.md_5.bungee.api.ChatColor.of("#92e336");
Is what I am using for first. Your method did not work for me :/
no
May I see your code? And, have you really used your server jar file in the external reference library? So that the code knows where to refer.
do i have to use maven projects btw
You don't have to.
ok
&x&R&R&G&G&B&B
It's highly recommended to use a build system of some kind
Gradle or maven
ok if i create a maven project
Otherwise it becomes much harder for other people to build your code
Why
is there anything that looks wrong here
Yes
idk ive never done plugin development although i have some java experience
Your main class is called Main
Hahaha
You're using eclipse
thats the worst thing ever
i dont like itelliJ :()
That's not wrong exactly
Packages are displayed flat rather than hierarchically
You capitalize your package name
can u stop dissing my interface and tell me why i cant import certain statements
Does other code work properly and when you type like import org.bukkit... Does anything gets suggested by Eclipse. If not, you should really lookup a tutorial convincing the setup of an external library with a working jar files.
Your code probably needs to be in src/main/java
You might not have set up your pom properly
the right stuff is not being suggested
Nothing wrong with this.
Show us your pom
Nothing wrong with this.
Nothing wrong with this.
Then that is the problem probably.
No, you shouldn't call your main plugin class Main
the import statements are wrong or have something wrong with them
Nono.
You should call it the name of the plugin
Factually incorrect. Call your class whatever you would like.
The external library is set up wrongly.
You should only call a main class Main if it is the entry point of the program
Try not to use wildcards in import statements
what are wildcards
Okay I'm talking about best practices here
Watch a tutorial, or something. @modest shard
i have
Sure you can just do wHaTeVeR yOu LiKe
But there are standards and they exist for a reason
Calling your "main class" "Main" is acceptable.
It's common but bad practice
ive done what they do exactly (maybe different versions and that im using 2021-12 eeclipse idk if anything changed tho in addition to using 1.18 spigot)
For plugins they should be called the name of the plugin
May you show the eclipse site where you set it up?
Show me one official Spigot article that says this.
For standalone programs calling it Main is fine
? like where i got my eclipse from?
If you call all your main classes Main you end up with tons of classes called Main on the classpath
No no.
It is always good to give accurate names to a class
just one named Mai ofc
Like how you set up your external library.
Yeah? So long as they're in different packages it doesn't matter.
Calling them by the plugin name makes it far less ambiguous to interface with another plugin from your plugin
Oh here's rack
Calling a plugin's main class "Main" is pretty accurate.
are you saying Main is an acceptable class name in a plugin
The guy
I swear
Where's the copypasta
@paper viper I NEED YOU.
Main?
YES
Im here daddy
HE IS ARGUING FOR IT
@modest shard I would need a screenshot to support you.
I don't have it anymore
right click the project -> build path -> add external source -> select the spigot file
@dense heath
Reading this, hold on
Haha
you better read this shit
Lol
or else i will find your address
yikes I forgot how bad Eclipse formatting is
🤢
do u use intelliJ
that class name
ofc I use intellij
shaddup im just trying to get this thing to work
🤮
Well...
so what's the actual issue
so i believe his class should be in src/main/java, someone pointed that out
def a possibility
Yeah.
how do i fix that
Yep, iirc eclipse has that too
am i supposed to use intelliJ
No, just its prefrence
You might, bur you don't have to.
wHeRe
thats a package
You just need to put both java files into the same me.ramen.Testplugin directory. @modest shard
not a folder
reeEEEE MAiN
its called an application
:`D
did you read it even?
wottt
Nope
...
i made folder it turned it into a package
read it
Writing a response to your article, need a few more moments.
Heck is going on in here
I don't think its a plugin at least lol https://cdn.rackdevelopment.tech/img/1p6QSMA6Aq.png
You just need to put both java files into the same me.ramen.Testplugin directory. @Ramen_ReBound
There really is no good reason to call it Main
Hmm maybe try moving it aswell
Feed me those messages
ok should i just start over with intelliJ
No wait.
You don't have too
We will solve it.
Try moving all your packages into that created folder (or in this case, package)
Maybe Eclipse is just a bit weird
@modest shard
Havent used it in a few years
ok @dense heath hear me out, say all plugins have their class as Main, wouldn't that be irritating?
@paper viper another thing to add is that when interfacing with other plugins through their API, you often access their main plugin class, and having it be called by the plugin name makes it much less ambiguous which plugin you're interfacing with
^
whats that mean 😦
main and the command files?
Yes.
move the two packages that you created with your classes into the main.java folder
so the commands one into the first package?
And if you want to have more structure than you can create more folders under it.
(it should move the classes as well)
Yeah anything.
Yeah that's a good point too
let me add it
didnt work b/c when i made a folder it turned into a package for some reason
yeah I know, might aswell try it either way
Eclipse might just count it as a package even tho its not, technically packages are folders
eclipse doesn't help you generate a maven project?
i closed my packjage explorer f i forgot how to open it again 🤮
intellij
nvm i found it
Lol
Only foolish developers use any tools that might make development easier
very true
yes, cool kids use vim
Well...Listen...You delete any other package than your main one first. Then you are creating a directory wirh lower case letters and WITHOUT any periods. Then you put your command classes into this folder and your main java class into the normal and unique package: me.ramen.TestPlugin
I have a good alternative to command classes but I will be executed by a firing squad
uh oh
No, name your package like before.
well they are getting somewhere at least
waiting for that bk response 😄
Yeah, the name of the package should be different.
honestly yeah might be easier lol
exactly haha
Eclipse will set it up for maven automatically
I get to start working with Gradle Redempt
@modest shard Honestly
its fun....
I don't know enough about eclipse to help with that issue otherwise
ok 😦
Hell yeah gradle is great
Mostly because it's not insanely verbose
Idk either but I try where I can.
maven is better, cuz it is verbose
I have no idea what im doing but managed to add an apache commons dep lol
Nice
I have to use gradle on this project, basically 90% of it is restrictive that I can't change
What are you struggling with
When you set it up, watch a tutorial and do all the same, trust me, that will work then.
Sure
I wonder if that top selection is what changed it
no tutorial uses a maven that ive found
or rather
i found one
I just like gradle because you can define something simple in 1 line instead of like 5
And xml fucking sucks
but the import stuff still didnt work
Yeah I do like that lol
It's weird tho, half my dependencies are added here https://cdn.rackdevelopment.tech/img/PujzE3BbiM.png
Not cause of Gradle, but the actual software im making this for
As said, you have to send a screenshot how you set up your external jar file.
isnt that downloaded from spigot
Spigot provides a api repository
or am i missing something here
so if you are doing that, yes
Yes, I mean like your external library.
I dont think that gif applies
Sry, I mistyped.
this thing?
No no.
hope you built that with buildtools
probably not
YIKES
😐
@modest shard
whats that
This.
yes where in the eclipse ide?
whats that
Yeah pls
This is fluff and I disagree with most of it. Let's break it down:
- Special handling of classes during the class loading process should be thoroughly documented. I have never heard of a developer experiencing problems during class loading on a Spigot plugin because their main class was named "Main". That's a load of shit.
- You're right, it isn't a standalone piece of software, but if Spigot calls it a "main class" then I see no problem with naming your main class, very appropriately, "Main". You say it is discouraged, but you don't say by who. Better references in this section would support your claims instead of making it sound like what is it: your opinion.
- Packaging is my only possible response to this section. As long as plugin's full class names don't overlap, everyone is happy. There are very few circumstances where you have to be looking at every single loaded class on a server.
- Saying "a lot of people do it" is not a good reason to ever do something. A lot of people create a pseudo-singleton pattern in their main class, but that doesn't make it good.
A substantially better argument than any of the points you have stated would be that it is Java convention to name classes accordingly with their super classes, except in case of the Object super class. Following this logic, main classes--which always extend JavaPlugin--should be MyPluginNamePlugin so that it matches the official convention advertised by Oracle.
Yes.
No? I never have to look at every single class loaded at once lmao
mom said its MY turn to use the Main
lmao
Oh dear lord! Java based First robots!
what is buildtools
Be based, write your robot in Rust.
and C Sucks
Factually incorrect.
¯_(ツ)_/¯
No? xd
😦
C doesn't suck but it does lack a lot of useful abstractions that virtually all modern languages have
what are build tools??
?bt
what do they do
Read the page damnit
Stop.
We're not your butlers lol
do u need to build to use the api
Least you can do is take a minute to read the linked resource my guy
ok i got git
worst thing is it recommends using VSCode for programming
This is a good tutorial setting up your ide environment.
Don't be a help vampire
basically have to use vscode but I have an addon that lets me deploy from intellij lol
Rust in vscode is nice
- Maybe cause you never knew, but naming your class Main does indeed break certain frameworks/apis that name their class Main.
- Do you not know the fucking difference between an actual server and a plugin? A plugin is a modification to the game, not a full on application. This ain't opinion, it's fact. Even the Paypal disputes have said that plugins are modifications, and we can all agree on that. Plugins are server side mods.
- If you can already provide a unique package the first place, why not just provide a unique main plugin class name then? Lol
- Tell that to the 1000th chat plugin developer /s lol. But seriously, the point of that section was that cause a lot of professional plugins do it anyways, and the reasons above.
It should fix any kind of external library error.
I have depression from reading this. This is why I stayed away from robotics lmao
C is a low level language. Of course it is missing abstractions.
Waiting on jetbrains fleet honestly
what do i do with git bash
Rust is much nicer and comparable in speed, but has many more abstractions
Again
i dont see it
RTFM
???
nvm
jump off a bridge gang!
Read what a help vampire is and stop being one
Just follow the tutorial dude
- Naming conventions might not help you prevent your program from breaking down, but they are there for other reasons.
- Spigot calls it your main class because that is probably the best way to describe it in a plugin, not the best way to name it. It is the class that you reference from
plugin.ymlthat extendsJavaPlugin, that's all. - While package names solves the ambiguity problem, no one desires the write package names over their program, and would very much prefer them to be in the import statements.
- There should be a reason why a lot of people do it. And the sheer reason that a lot of people do it might be a reason to do it (conventions).
Lol
technically bukkit calls the main class that
Really interested in seeing an example of a Spigot library being broken by this. Let's see it.
Read the end of my message and you'll have a substantially better argument lol
and you
i dont have a server folder
fk, didn't see pulsebeat already replied, typed too slow
it's okay lmao
wtf?
u reinforce the points
God damn bro. How hard is it to just not name your class Main? Why are you arguing over this. It's called Refactor -> Rename
🙂
Just follow it and try to concentrate. If you have problems, FIRST TRY TO SOLVE THEM BY YOURSELF.
i have
I don't name my main classes Main lmao
Then, does it work.
Have you really did anything said, including making a new project.
u have to have a server to code plugins?
well why is that then (there is a reason for it of course)
lightning struck
Yeah.
otherwise it wouldnt make sense that you are arguing that its fine to use
br
That is literally the external jar file.
You're critiquing people over stupid shit, let a developer name their class Main if they want to. It doesn't matter.
answer the question then
Which?
gone
The problem?
why do u need to make a spigot server to make plugins
"[...] it is Java convention to name classes accordingly with their super classes, except in case of the
Objectsuper class. Following this logic, main classes--which always extendJavaPlugin--should beMyPluginNamePluginso that it matches the official convention advertised by Oracle."
Because you need the jar file to use it as an external file.
isnt that
lol
Yeah, it is.
But that doesn't that just contradict all the other points you make anyways?
Lol
then whats this
Thats a server
That is your sever.
thats from a video
I think the argument is over, and the conclusion is: try not to name your plugin class Main >:'D
if u cant tell
You need to put that jar file in external library.
wot
Delete any server, set up one and put that UNIQUE jar file in external library.
Please, I am close to raging richt now.
Follow my instructions.
Yup. I'm much later in the developer lifecycle than most of the people you're harassing for naming their main classes Main. I don't name my classes Main, but that doesn't mean I think it is an atrocious crime that others do. Stop being an asshole to new developers about something extremely benign
i dont have any servers
just that file
"harassing"?
What lmao?
That's the boostrap jar
Do you mean that serious?
That one won't work
No
ok then
If you made a thread just to link it to people with your own fluffed up opinion because you have to tell it to that many people, you're harassing without a doubt.
You have to use the right one from buildtools
"The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar (download), or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically."
its not an opinion if there are facts in the argument...?
Highlight your facts in your article.
Naming a plugin class Main is dumb af
if two plugins have the same main path, one or both will not load
Can you use: java spigot-1.18.jar?
Factually incorrect
No it's isn't
Have you tried it?
yes i double clicked to run and that was the error messag
Yes
its java -jar spigot-1.18.jar
In fact, I am so confident that I am correct that I am willing to put my money where my mouth is right now
Yes.
I'll throw down $20 on this.
Application vs. Mod. This is definately a fact lmao
Uniqueness - how is this not a fact lmfao? Can you even argue against this?
Redempt's point too, definatly a fact as well because it's ambigous.
Most popular and famous plugins made by developers do not use Main.
is this not a fact
Lol
@tight sluice You basically did anything possable wrong.
the plugins both might LOAD, but the code def wont work from both plugins
Now this is factually correct.
Either way Main as a plugin main class is dumb as fuck.
You're better off naming the class that extends JavaPlugin after the name of the plugin, e.g. If it was called Enchants it would be com.example.Enchants
Well duh
Any individuals taking this bet?
Class names should be descriptive
@modest shard Reinstall java and watch a lot of tutorials.
lol
im watching rn
for people who are dumbasses, yes
😦
You could just say you want to bet, jeez
You need a java sdk, not only a jre... @modest shard
Personally if I were to do a server or hire devs, I definitely wouldn't hire anyone who names their plugins main class Main
As is your God-given right.
Search for a tutorial installing java...
I'm definitely very picky, but Main should be one of the first things you learn because its what you shouldnt name your main class name
Please stop being a help vampire as @waxen plinth said.
of course, but that's for any class that has public static void main(String[] args){}
There are edge cases in where if the Main class in an API is simply called Main and causing some breakage to where you have to use the fully qualified path to the class in question. This can happen when say you are interfacing with NMS stuff where the main server class happens to be called Main and if you have an API where their main class is also called Main, you couldn't use Main as the Object unless you differentiate in the body of the class which Main you are actually referring to.
LOL HELP VAMPIRE IS THE BEST DEFINATION IVE EVER SEEN
Basically stop asking and just follow along all tutorials and do clean reinstalls.
guys this is the pinnacle of spigot discord
i am
20 conversations going on at once
Threads are a thing though 😉
I have today expanded on my vocabulary
But sadly people are lazy
threads suck tho
Lol
Nice one.
we want EVERYONE of the few thousand members to see the stupid shit we talk about in here
I am so close to raging...
just take a break tbh
they mostly confuse me due to how its implemented
As long as the compiler knows which class you're talking about, you're good. Once your code gets compiled into a class file, all of the references to methods and fields are backed in the constant pool by the name and type cp entry which specifies the full class name of what you're referencing lmao
It is like explaining a children how to run because it says that it can already walk but it doesn't.
That's literally the best reference.
Yea thats why you gotta chill
remember that you are helping other people
if u need time for yourself, take the time you need
doesn't change the fact that you would have to drop down to fully qualified names for the Objects in the body of the class, and unfortunately your IDE will probably not know which Main you actually wanted and will let it happen without erroring and when you run it, you end up with problems because you are using the wrong Main in places when you wanted the other Main
sometimes you have to focus on yourself rather than others
It's like 5 am in the morning, what am I supposed to do xd
A wise man.
🛌
Factually incorrect on so many different levels.
How so?
care to show an example?
Let's get in a call to sort this out. These guys are actually trying to help some people lmao
what are you a master Java developer with 10 years of experience?
Actually, yes.
Unlikely
send a resume then
People, listen....
honestly, I would very much say that the only responsibility of Main is to run main(String[] args)....
Hop in the call and I'm happy to share
I have 24 years of experience with Java 😄
Gaming!
Tell that to mojang lol
Im good to not hop in a call
how do u change this to batch file
i did what the person in the tutorial do\id but it didnt turn to batch instead its still a text file
You need to go on windows and let you expand the file endings.
Then change .txt to .bat
Due to your experience I am assuming you know what I mean by fully qualified objects are?
You are jow changing only the name @modest shard
This guy thinks I don't know what a fully qualified name is when he can't even tell me what a name and type constant pool entry is
see thats called deflecting
its what happends when you dont know the answer to something
People, stop arguing. The answer is simple...
yes but idk how to make the file endings show
its 42 we know >>
If you knew what a name and type constant pool entry was then you would know that I knew what a fully qualified class name is
Search for it and stop asking here.
what did mojang do lol
mojang... did mojang
even experienced people don't know everything
Is it possible to do a multiple bungee setup?
Bit hacky but ye
This is called deflecting
It's call the truth lol
They aren't mutually exclusive
I touch ASM like crazy, doesn't mean I know everything about it though
ASM abstracts a ton of shit about the class file away from the developer
I am saying it isn't so much I think you don't know, just I don't assume everyone knows everything and thus like to verify.
I wonder if I can fake plugin messages if I make an extra proxy and connect to someone else's server 🤔
Depends, I touch bytecode a lot too with what I do if that helps 😉
you just put another servers ip in the servers section
as long as its offline mode you good
you probably could since it requires a player connection
I modify plugins compiled plugins with hex editors lmao
I mean, clients can fake inventory names to gain access to inventories 😛
everytime I see discord says "several people typing..." I think of those typing seeing the names of other people typing and i start thinking of the blue eye problem
#Doubt
one of the main reasons you shouldn't rely on inventory name to verify if its the correct inventory
that just sounds masochistic
what is the fun in that
Pop in right now and I will
why is that impressive
I mean like
Gotta nop out the DRM
what
basically stealing
Some plugins use plugin messaging to communicate important data to proxies
NOP, the first bytecode instruction.
Factually incorrect.
@dense heath @wet breach Okay, guys. It doesn't matter how you name then, it only helps to understand more likely what they are doing. A main named file should contain like the main stuff, etc. And because you have like a lot of folders and so, you wouldn't have like the problem of having two lapping "Main.java" files. Soo.. It is only a matter of decision...
I can listen into all data, analyze it and compromise a server
Sounds like a big risk in bungee
thats why good devs dont use PMCs
ive searched for this already but how do i give the build tools more memory
Xmx
I will defend my copyright using LETHAL FORCE.
how to use xmx
Google your question before asking it:
https://www.google.com/
what is this bruh
It is only a matter of convention and how accuratd you wanna represent your classes @wet breach @dense heath
Java -xmx5G -jar...
sooo yall how high are we tonight
this lol
I described the biggest reason for it and it has to do with you can't use two Objects of the same type but are actually different without using the fully qualified name of said object
least intimidating military services ive ever seen
Good devs sign their messages cryptographically lmao
Your pfp is more intimidating than those guys
i will turn you into a convertable
LMAO
Real Redis hours
i am very much lost
Binary pubsub because the string one sucks
yeah, good devs use LMC, lego military company
Stop arguing though, there is no real answer although you are really seeming to get one.
This guy doesn't know how to use two different classes named the same thing lmao
xd
show me you using 2 objects named the same in the same class without using fully qualified object paths 🙂
and both objects not being the same 😛
Love you and Joe.
I mean there's a reason why classes like Collections typically require libs to use names like MoreCollections or Collections2
but how 😦
Fully qualified class names.
You cannot import two classes of the same simple name in the same source file.
same difference, we both know what is being referred to
Objects and classes are very different.
Who's joe? 
classes extend Object lol
Classes are objects
classes are blueprints of objects
Joe Ligma.
?learnjava the last link said that
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Not necessarily
RPG said it
Man googled it
objects are created from classes
Joe ligma balls. Wtf.
classes != objects
good chance im just wayyy too tired at this point to think straight
classes are a blueprint
It confused me for a solid 10 seconds too dw
objects contain functionality
The Class<?> can be an object
we both know what I was referring to. Not sure why you are so big on being hyper technical about the wording? You very well understand what it is I have requested.
What if its static
Only inner classes are static lmao
static is just objects without reference
Hm
Any class can be static lol
what
oh
I honestly love it.
that
Bukkit is static and not an inner class 😉
dababy...
WHY WOULD YOU LOVE TO SCARED ME
I JUST WAKE UP MY GRANDPA LOL
DONT DO THAT AGIAN
lmao
Implicitly, but not explicitly.
DONT YOU DARE
just slap static as a modifier and you're good to go
WHY WOULD YOU LOVE TO SCREAM OVER TEXT
Snow isnt it literally like 10am for you?
Pretty sure you can't do that on outer classes :thonk:
You....can?
well, kinda, but my grandpa is just too tired
you can make almost anything static
Why are we arguing about static
me too bro
public static class MyClass {}
It's 4:20am ffs
5:22 am..
11:22 pm for me
Beginners be like
unless its the Main class in which case it is static 😄
me and Snow literally are like 12 hours different in timezones yet we work on the same project lol
Compile an outer class right now that is static.
A static method and a static class are different.
Simply because a method is static does not make the class static.
oh so your Main class just magically disappears then?
Gets garbage collected lmao
Main class is static unless we are dealing with some kind of library or API lol
Outer classes cannot be static.
The main class is not static lmao
outer classes cant be static
It is impossible for an outer class to be static.
well i mean i give you the access to it but i still havent really know what you can do for it lol, the project scripts are just too stable for someone to improve it
The static modifier only applies to inner classes, methods, and fields.
Main class is called within native code
And refers to whether or not an inner class can be instantiated independently of its enclosing class.
oh JUST WAIT
I will show you how stable those scripts are
hoho
yall still working on that server
not really
This also does not make sense
work has been a big factor
Do you guys think there would later be a new type of anti discrimation TikTok wave towards programming name conventions like 'MyClass'?
?wyvern
fuck tiktok
lmao I would not be surprised
tiktok = donkey balls
me use tiktok kids bro
*youtube
wow everyone just die after tiktok kids
I know it is called within native code, however due to how the JVM works, Main class that is designated that contains the main method effectively becomes static.
Here's a solution to that
whether or not your IDE or compiler lets you put the static identifier or not is independent to how the JVM runs
One that I fancy
maybe after i done the contributing and credit file, we can start to pushing patches
public class Main {
private Main() {}
public static void main(String[] args) {
new Main().run(args);
}
private void run(String[] args) {
// ...
}
}
Class ain't static no more.
the class is also not going to go away either
Noice
as for static, a bit of research
In Java, the static keyword typically flags a method or field as existing not once per instance of a class, but once ever. A class exists once anyway so in effect, all classes are "static" in this way and all objects are instances of classes.
static does have a meaning for inner classes, which is entirely different: Usually an inner class instance can access the members of an outer class instance that it's tied to, but if the inner class is static, it does not have such a reference and can be instantiated without an instance of the outer class. Maybe you saw that someplace, then tried to use it on a top-level class, where it isn't meaningful.
Or maybe you saw it in other languages like C#, whose syntax is an awful lot like Java's.
(One time I couldn't figure out why an outer class instance wasn't being garbage-collected -- it was because I was keeping a reference to one of its inner class instances elsewhere, and the inner class was not static and so had a reference to the outer class instance. So by default, I make inner classes static now.)
see 🙂
I take issue with using the term "static" for this because of how it's already a term in the language.
static = existing once globally
And in fact
Classes are not technically always static
Considering how classloading works
And how some classloaders can't really be considered as "global"
well there is technically only one global one
That was a bad way to phrase it uhh
I'm pretty sure you're able to load the same class across two different classloaders
PluginClassLoader has something like that in its docs soo
/give triggers PlayerDropItemEvent...
thats dumb
A ClassLoader for plugins, to allow shared classes across multiple plugins
I will research this more specifically, but I am pretty sure you can't. Or if you can, they are technically not on the same class path
yes but I think it wasnt intentional
since there is a hierarchy to the class path stuff
But yeah I'd argue "global" means that something can be accessed globally, not just that it exists globally.
For variables, it's not "once ever", but once per Class. Since a Class can loaded multiple by different class loaders, it's statics can exists multiple, though in separate namespaces.
For variables at least, wouldn't be surprised if it's similar for classes too
so ig each classloader would have its own "static" classes 🤷♂️
my plugins kills players when they drop items.
that is an interesting feature
And there is actually one form of class that can't just be accessed through that classloader's findClass or whatever
I see the problem.
Lemme find the method
But can't you check like if they really dropped it through out the inventory?
actually it finds a way to kill players in any way, whether player forgot to eat, or to ate too much.
they couldve dropped it in crafting table or smth
@Data is a Lombok annotation
not take them out in the crafting table and press q
But then they dropped it.
record Person(String name, int age) {
}
Person person = new Person("Bob", 5);
System.out.println(person.name());
System.out.println(person.age());
@quaint mantle
so?
?
you cant modify variables in records
oh
final
yes they are final by default
and you cant declare new ones
Yeah.
so what if they have more than 1 amount of that item in the inventory?
So, like Crafting tables wouldn't be counting.
declaration: module: java.base, package: java.lang.invoke, class: MethodHandles, class: Lookup
^ hidden classes
so uhh what do you mean by that... heh?
These cannot be accessed globally or in any way, really.
Here's the JEP for them https://openjdk.java.net/jeps/371
I don't see the problem yet.
for example if player has 2 steak in inventory, what if player only dropped one?
Then you check if it came out of the inventory and you kill the player.
?
You want to kill the player when he drops any item.
That is a relatively new thing though
but that is correct
Technically they're not new
They've existed for a while as part of Unsafe
via the Unsafe::defineAnonymousClass method
but they've been factoring out Unsafe-only calls like those
(that's why we have foreign memory now, bc it replaces all the Unsafe#putInt or whatever stuff)
but what are you trying to say to me?
lol, I know about the unsafe ones, I meant the JEP you are referring to
i dont get why you say that
Ah fair
i thought you were wondering what records were
they been slowly removing the unsafe ones anyways
Did you know you can essentially have a dynamic ldc instruction through MethodHandles.Lookup::findClass?
the ones that are still left, don't think are going to be easy to replace
yea, i didnt actually know we cant change the parameters lol
but then, inner record are classes anyways, so do it need to be static
what I do need to do though for Java especially with the release of 17, is go through the code to see what new things there are
lets get this example
public blockUtil {
private static class IntBounds {
private final int min;
private final int max;
public IntBounds(int min, int max) {
// codes there
}
public String toString() {
return "IntBounds{min=" + this.min + ", max=" + this.max + '}';
}
}
}```
this is an inner class that i can change to a record
same here, I could probably improve something like my Anti-Malware a lot lol
then when i change to the record, would it still be static or not
public blockUtil {
private staticOrNot? record IntBounds(int min, int max) {
public String toString() {
return "IntBounds{min=" + this.min + ", max=" + this.max + '}';
}
}
}```
Yeah been lacking on keeping up with changes on the JVM. And who knows there could be some hidden thing in there that no one knows about 😛
True true :p
If I ever get around to the JDK fork on mine properly, I'd probably add/change/remove stuff as well lol
Thinking about forking the vanilla server to for the memez
ye
A lot of massive changes just aren't possible under the current changes lol
they start and then never finish, think every dev ends up with a forked vanilla at some point 😂
I'll probably wait until some current projects are finished before I do something that massive though
first it starts with forking spigot or some other related project and then realizing or getting too ambitious and looking at that vanilla server
going like, you know what would be better is if it was just in the vanilla code
In my case I just need something to do lol
the issue with forking vanilla is by the time you get it all fixed up
and working to compile, a new release has came out
That's why I'll probably stick with spigot PRs
Well, luckily from what I can tell updating to a new release for me wouldn't be toooo difficult
yeah but dont make massive patches, because that would cause lot of issues lol
I could also do 1.18.1 then insta jump to whatever's out when I'm done lol
im now stick to 1.16.5 only so i dont really mind seperate patches for every classes
Ya think MD would go for configurable piston pushing, or moveable tile entities
That's why I'm re-doing my paper fork, it would of been one massive patch instead of a bunch of smaller ones lol
i put them in a massive patch file then call them stage of classes
Or is that too far from vanilla for spigot
I'm not even sure the client would be able to handle it lol
you will need to elaborate for me
are there even any moveable tile entities in java?
I am still not sure what configurable piston pushing is. I know what is probably being referred to for moveable tile entities
like instead of pusing the block, it push itself backwards.
What do you guys think about Design Patterns?
configurable piston!
This is why I upgraded myself lol
that seems like something to request from Mojang because it would make sense this would be a block of its own
Which design pattern?
How so?
ya dont like 1.16.5??11?!1
i thought ya cant even join 1.17+?
oh you gonna buy a new pc
ah yes thats why you change
as for spigot, I just use via lol
In general, about them. Do you use them, etc.?
so you use 1.18 server then use viabackwards? wait that actually a good idea ngl
i havent seen the new generation
I dun think I would sit down and design a plugin with a list of design pattern by my side.
Configurable push limit, vanilla is locked at 12
i can make better terrain than the generation, but i wanna see their work
By nature, no
oh blocks?
mhm
I think it is a matter of coming across something similar that i could use
That reminds me of
But do you have iterating steps for refactoring and cleaning software?
I can understand there for being a limit. I could see it possibly being something in Spigot if you are allowed to change the limit within a sane range
not that much
I mean
even less
Keeping a sane range is down to the user
I generally just go with experience about how i think the software should be structured lol
Lol I can totally see servers crashing from this trying to load literally all the chunks to MC's boundary limit XD
Sorry to jump in: Anyone know if TabCompleter forces alphabetical order? Mine is but I don't like that
my craftbukkit is gone?