#help-development

1 messages · Page 1862 of 1

dense heath
#

Depends on what you think a device is, but we're not here to get into semantics.

wet breach
#

sure, you can probably keep that line of questioning going for everything

quaint mantle
#

Probst more

wet breach
#

there is really no way to measure the exact number of bots today

quaint mantle
#

Try BukkitObjectOutputStream/BukkitObjectInputStream

dense heath
#

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?

wet breach
#

Generally you serialize it because you want to store it somewhere

dense heath
#

Where will the string go in the end? What are you using it for?

quaint mantle
#

Either yaml, or abitrary binary data

wet breach
#

or a DB

echo basalt
#

He's probably trying to make a data syncing plugin

dense heath
wet breach
#

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

echo basalt
#

You'll have to serialize it yourself

wet breach
#

you can iterate over the map

quaint mantle
#

BukkitObjectOutputStream

#

Then Convert to Base 32

#

Not humanly readable though

dense heath
#

Simply serialize the map. Most YAML and JSON libraries can get you what you want.

wet breach
#

even though it has nothing to do with that

quaint mantle
#

Got confused for a sec

#

But I get it

#

I used to be one of them

wet breach
#

just don't tell the confused that 64bits has been around for a long time already since the 8bit days 😛

dusk flicker
#

lmao

dense heath
wet breach
#

two topics there

#

sorry you failed to comprehend just the one XD

dense heath
#

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

wet breach
#

my messages is satire on the technologically illiterate ones

#

anyways moving on

thick gust
#

sorry that i ask but i forgot, which should i click to export my plugin?

thick gust
#

thx!

wet breach
#

you can do package or install

#

install does a bit more, but still gives what you want

thick gust
#

what's the difference?

#

okay

dense heath
thick gust
#

i just stick to package i guess

#

ty guys 🙂

faint sage
#

🦛

wet breach
#

that is technically true

thick gust
#

is there a current method for spawning falling blocks? the spawnFallingBlock method from the World class is deprecated.

sullen marlin
#

?jd

sullen marlin
#

Read the docs

dense heath
wet breach
thick gust
#

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?

quaint mantle
#

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?

young knoll
#

You can do that with the api

#

setTicksLived iirc

quaint mantle
#

ohhh truee

#

ill check when i get home but if someone sees this and has a big brain idea pls lmk!

rigid drum
#

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

thick gust
#

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.

worldly ingot
#

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

quaint mantle
#

UUID

worldly ingot
#

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

thick gust
#

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.

worldly ingot
#

If you're doing this ^, it's not going to work

#

See above

thick gust
#

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?

worldly ingot
#

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

thick gust
#

I am so dumb

#

Yeah

#

The entire arraylist gets created once again

worldly ingot
thick gust
#

Thank you for the reminder haha xD

#

Sometimes I just need people to look over my code I would never have noticed that.

worldly ingot
#

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

thick gust
#

Yeah that was my thought. 😄

#

Aight thanks Choco 🙂

worldly ingot
thick gust
#

Also why are emotes blocked on this server? It's so sad I can't use all that pepe emojis 😦

worldly ingot
#

Just a booster+ thing

thick gust
#

Sadge

wet breach
#

just become a booster 🙂

thick gust
#

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?!

wet breach
#

need to register the command

thick gust
#

The command is registered.

#

In the plugin.yml and in the main class I just pasted in here.

wet breach
#

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

thick gust
#

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.

wet breach
thick gust
#

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

wet breach
#

Alright so the command is what isn't working right?

thick gust
#

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

wet breach
#

nvm then

#

lmao

thick gust
#

For the love of god finally I made it fixing this ugly thing

wet breach
#

well let it also be a learning lesson

#

that ugly code is not cool!

thick gust
#

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.

wet breach
#

this is how I setup some of my command stuff 😛

thick gust
#

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

thick gust
#

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.

wet breach
stiff palm
#

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.

#

if someone helps me, please tag me, thank you 😄

buoyant viper
thick gust
#

How could you display rgb chat messages again?

#

Like with a specific rgb value, not just the enum values of chatcolor

buoyant viper
#

uhh

#

&#RRGGBB i think

fleet imp
#

Using CommandPreprocess event, does isCancelled turn true if the syntax was wrong or something

#

like, if the command fails

young knoll
#

try it and see?

candid galleon
#

that wouldn’t make sense

worldly ingot
#

Preprocess is called before it's even forwarded to the command executor

#

So no

modest shard
#

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

thick gust
quaint mantle
jolly inlet
modest shard
#

do i have to use maven projects btw

quaint mantle
#

even with vanilla you can do §x§R§R§G§G§B§B

#

or with translateAlternateColorCodes

jolly inlet
modest shard
#

ok

quaint mantle
#

&x&R&R&G&G&B&B

waxen plinth
#

Gradle or maven

modest shard
#

ok if i create a maven project

waxen plinth
#

Otherwise it becomes much harder for other people to build your code

modest shard
waxen plinth
#

Why

modest shard
#

is there anything that looks wrong here

waxen plinth
#

Yes

modest shard
#

idk ive never done plugin development although i have some java experience

waxen plinth
#

Your main class is called Main

hardy swan
#

Hahaha

waxen plinth
#

You're using eclipse

quaint mantle
#

thats the worst thing ever

modest shard
#

i dont like itelliJ :()

hardy swan
#

That's not wrong exactly

waxen plinth
#

Packages are displayed flat rather than hierarchically

#

You capitalize your package name

modest shard
#

can u stop dissing my interface and tell me why i cant import certain statements

jolly inlet
# modest shard ok

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.

waxen plinth
#

Your code probably needs to be in src/main/java

#

You might not have set up your pom properly

modest shard
dense heath
waxen plinth
#

Show us your pom

dense heath
dense heath
modest shard
jolly inlet
waxen plinth
modest shard
#

the import statements are wrong or have something wrong with them

jolly inlet
#

Nono.

waxen plinth
#

You should call it the name of the plugin

dense heath
jolly inlet
#

The external library is set up wrongly.

waxen plinth
#

You should only call a main class Main if it is the entry point of the program

hardy swan
modest shard
waxen plinth
jolly inlet
#

Watch a tutorial, or something. @modest shard

waxen plinth
#

Sure you can just do wHaTeVeR yOu LiKe

#

But there are standards and they exist for a reason

dense heath
waxen plinth
#

It's common but bad practice

modest shard
#

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)

waxen plinth
#

For plugins they should be called the name of the plugin

jolly inlet
dense heath
waxen plinth
#

For standalone programs calling it Main is fine

modest shard
waxen plinth
#

If you call all your main classes Main you end up with tons of classes called Main on the classpath

jolly inlet
hardy swan
jolly inlet
dense heath
waxen plinth
#

Calling them by the plugin name makes it far less ambiguous to interface with another plugin from your plugin

#

Oh here's rack

dense heath
dusk flicker
#

are you saying Main is an acceptable class name in a plugin

waxen plinth
#

The guy

dusk flicker
#

I swear

waxen plinth
#

Where's the copypasta

dusk flicker
#

@paper viper I NEED YOU.

waxen plinth
#

Oh it's him?

#

I thought it was you lol

paper viper
#

Main?

dusk flicker
#

YES

paper viper
#

Im here daddy

dusk flicker
#

HE IS ARGUING FOR IT

jolly inlet
#

@modest shard I would need a screenshot to support you.

dusk flicker
#

I don't have it anymore

modest shard
paper viper
#

@dense heath

hardy swan
#

Haha

paper viper
#

you better read this shit

waxen plinth
#

Lol

paper viper
#

or else i will find your address

modest shard
dusk flicker
#

yikes I forgot how bad Eclipse formatting is

paper viper
#

🤢

modest shard
paper viper
#

that class name

dusk flicker
#

ofc I use intellij

modest shard
paper viper
#

🤮

jolly inlet
dusk flicker
#

so what's the actual issue

hardy swan
#

so i believe his class should be in src/main/java, someone pointed that out

dusk flicker
#

def a possibility

modest shard
#

how do i fix that

paper viper
#

Yep, iirc eclipse has that too

modest shard
dusk flicker
#

No, just its prefrence

paper viper
#

No, make a folder

#

main/java

jolly inlet
#

You might, bur you don't have to.

modest shard
#

wHeRe

dusk flicker
#

Under src

#

Then move all your packages and classes into that folder

modest shard
paper viper
#

thats a package

jolly inlet
#

You just need to put both java files into the same me.ramen.Testplugin directory. @modest shard

paper viper
#

not a folder

dusk flicker
#

You want a folder, not a package

#

my dude this isnt a plugin

paper viper
hardy swan
#

:`D

paper viper
#

did you read it even?

modest shard
#

wottt

dense heath
paper viper
#

...

modest shard
paper viper
#

read it

dense heath
#

Writing a response to your article, need a few more moments.

paper viper
#

Lol

#

Mmm more post karma

young knoll
#

Heck is going on in here

dusk flicker
jolly inlet
waxen plinth
#

There really is no good reason to call it Main

dusk flicker
paper viper
#

Feed me those messages

modest shard
#

ok should i just start over with intelliJ

jolly inlet
#

No wait.

dusk flicker
#

You don't have too

jolly inlet
#

We will solve it.

dusk flicker
#

Try moving all your packages into that created folder (or in this case, package)

#

Maybe Eclipse is just a bit weird

dusk flicker
#

Havent used it in a few years

hardy swan
#

ok @dense heath hear me out, say all plugins have their class as Main, wouldn't that be irritating?

waxen plinth
#

@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

hardy swan
#

^

modest shard
#

main and the command files?

jolly inlet
dusk flicker
#

move the two packages that you created with your classes into the main.java folder

modest shard
#

so the commands one into the first package?

jolly inlet
dusk flicker
#

(it should move the classes as well)

jolly inlet
paper viper
#

let me add it

modest shard
dusk flicker
#

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

hardy swan
#

eclipse doesn't help you generate a maven project?

modest shard
#

i closed my packjage explorer f i forgot how to open it again 🤮

waxen plinth
#

intellij

dusk flicker
#

honestly

#

no idea

modest shard
#

nvm i found it

dusk flicker
#

Lol

waxen plinth
#

sad

#

And yea packages are literally just folders

#

Folders but based

dusk flicker
#

love that description of them

#

lmao

hardy swan
#

use command line instead of IDEs, problem solved

#

mvn archetype:generate

dusk flicker
#

that an actual command

#

huh

#

didn't know that

waxen plinth
#

Only foolish developers use any tools that might make development easier

dusk flicker
#

very true

hardy swan
#

yes, cool kids use vim

jolly inlet
modest shard
#

this?

waxen plinth
#

I have a good alternative to command classes but I will be executed by a firing squad

dusk flicker
#

uh oh

jolly inlet
dusk flicker
#

well they are getting somewhere at least

modest shard
#

so change the main name?

#

to me.ramen.TestPlugin?

paper viper
#

waiting for that bk response 😄

jolly inlet
#

Yeah, the name of the package should be different.

waxen plinth
#

Honestly

#

Just make a new maven project

dusk flicker
#

honestly yeah might be easier lol

hardy swan
#

exactly haha

waxen plinth
#

Eclipse will set it up for maven automatically

dusk flicker
#

I get to start working with Gradle Redempt

jolly inlet
dusk flicker
#

its fun....

waxen plinth
#

I don't know enough about eclipse to help with that issue otherwise

modest shard
#

ok 😦

waxen plinth
#

Mostly because it's not insanely verbose

jolly inlet
hardy swan
#

maven is better, cuz it is verbose

dusk flicker
#

I have no idea what im doing but managed to add an apache commons dep lol

waxen plinth
#

Nice

dusk flicker
#

I have to use gradle on this project, basically 90% of it is restrictive that I can't change

waxen plinth
#

What are you struggling with

modest shard
#

is this right sofar

jolly inlet
waxen plinth
#

Sure

dusk flicker
#

I wonder if that top selection is what changed it

modest shard
#

or rather

#

i found one

waxen plinth
#

I just like gradle because you can define something simple in 1 line instead of like 5

#

And xml fucking sucks

modest shard
#

but the import stuff still didnt work

dusk flicker
#

Yeah I do like that lol

jolly inlet
modest shard
dusk flicker
#

Spigot provides a api repository

modest shard
#

or am i missing something here

dusk flicker
#

so if you are doing that, yes

jolly inlet
dusk flicker
#

I dont think that gif applies

modest shard
#

wot

jolly inlet
modest shard
#

this thing?

jolly inlet
#

No no.

dusk flicker
#

hope you built that with buildtools

modest shard
dusk flicker
#

YIKES

modest shard
#

😐

jolly inlet
modest shard
dusk flicker
#

my mouth has been dry for like 10 mins cause of this convo

#

LOL

jolly inlet
modest shard
#

yes where in the eclipse ide?

modest shard
jolly inlet
#

Yeah pls

dense heath
# paper viper https://www.spigotmc.org/threads/why-you-shouldnt-name-your-main-plugin-class-ma...

This is fluff and I disagree with most of it. Let's break it down:

  1. 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.
  2. 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.
  3. 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.
  4. 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.

modest shard
#

this?

jolly inlet
#

Yes.

dense heath
paper viper
#

Damn, communist

#

I see

#

Lol

buoyant viper
#

mom said its MY turn to use the Main

paper viper
#

Just wants everything to be the same

#

XD

dusk flicker
#

lmao

dense heath
modest shard
#

what is buildtools

dusk flicker
#

yes

#

either Java or C

dense heath
#

Be based, write your robot in Rust.

dusk flicker
#

and C Sucks

dense heath
dusk flicker
#

¯_(ツ)_/¯

dense heath
modest shard
#

😦

waxen plinth
#

C doesn't suck but it does lack a lot of useful abstractions that virtually all modern languages have

modest shard
#

what are build tools??

dusk flicker
#

?bt

undone axleBOT
modest shard
#

what do they do

waxen plinth
#

Read the page damnit

jolly inlet
#

Stop.

waxen plinth
#

We're not your butlers lol

modest shard
#

do u need to build to use the api

waxen plinth
#

Least you can do is take a minute to read the linked resource my guy

jolly inlet
#

@modest shard listen.

modest shard
#

ok i got git

dusk flicker
jolly inlet
#

This is a good tutorial setting up your ide environment.

waxen plinth
#

Don't be a help vampire

dusk flicker
#

basically have to use vscode but I have an addon that lets me deploy from intellij lol

waxen plinth
paper viper
#
  1. Maybe cause you never knew, but naming your class Main does indeed break certain frameworks/apis that name their class Main.
  2. 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.
  3. If you can already provide a unique package the first place, why not just provide a unique main plugin class name then? Lol
  4. 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.
jolly inlet
#

It should fix any kind of external library error.

dense heath
dense heath
waxen plinth
#

Waiting on jetbrains fleet honestly

modest shard
#

what do i do with git bash

waxen plinth
waxen plinth
paper viper
#

And safe

#

Rust very safe

modest shard
waxen plinth
#

RTFM

jolly inlet
modest shard
#

nvm

dusk flicker
#

jump off a bridge gang!

waxen plinth
#

Read what a help vampire is and stop being one

jolly inlet
hardy swan
# dense heath This is fluff and I disagree with most of it. Let's break it down: 1. Special h...
  1. Naming conventions might not help you prevent your program from breaking down, but they are there for other reasons.
  2. 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.yml that extends JavaPlugin, that's all.
  3. 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.
  4. 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).
waxen plinth
#

Lol

dusk flicker
#

technically bukkit calls the main class that

dense heath
paper viper
#

and you

modest shard
hardy swan
#

fk, didn't see pulsebeat already replied, typed too slow

modest shard
#

wait

#

nvm

#

wo

#

t

paper viper
jolly inlet
paper viper
#

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

#

🙂

jolly inlet
dense heath
jolly inlet
#

Then, does it work.

#

Have you really did anything said, including making a new project.

modest shard
#

u have to have a server to code plugins?

paper viper
#

well why is that then (there is a reason for it of course)

hardy swan
#

lightning struck

jolly inlet
paper viper
#

otherwise it wouldnt make sense that you are arguing that its fine to use

modest shard
#

br

jolly inlet
#

That is literally the external jar file.

dense heath
paper viper
#

answer the question then

dense heath
modest shard
#

gone

paper viper
jolly inlet
modest shard
#

why do u need to make a spigot server to make plugins

dense heath
jolly inlet
#

Because you need the jar file to use it as an external file.

wet breach
jolly inlet
paper viper
#

Lol

modest shard
young knoll
#

Thats a server

jolly inlet
#

That is your sever.

modest shard
#

thats from a video

hardy swan
#

I think the argument is over, and the conclusion is: try not to name your plugin class Main >:'D

modest shard
#

if u cant tell

jolly inlet
#

You need to put that jar file in external library.

modest shard
#

wot

jolly inlet
#

Delete any server, set up one and put that UNIQUE jar file in external library.

modest shard
#

isnt that wht that is

jolly inlet
#

Please, I am close to raging richt now.

jolly inlet
dense heath
modest shard
#

just that file

jolly inlet
#

Is that serious??

young knoll
jolly inlet
#

Do you mean that serious?

young knoll
#

That one won't work

jolly inlet
#

Yeah!!!!!

#

You have to setup your sevrer first.

young knoll
#

No

modest shard
#

ok then

dense heath
# paper viper "harassing"?

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.

young knoll
#

You have to use the right one from buildtools

modest shard
#

whyd it take so long to realize that

#

it was the bootstrap

jolly inlet
#

Just double click on that file

#

That will make a server.

young knoll
#

"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."

paper viper
modest shard
dense heath
vagrant stratus
#

Naming a plugin class Main is dumb af

#

if two plugins have the same main path, one or both will not load

jolly inlet
young knoll
#

No it's isn't

vagrant stratus
modest shard
dense heath
young knoll
#

But that world require identical packages too

#

Which is unlikely

dusk flicker
#

its java -jar spigot-1.18.jar

dense heath
#

In fact, I am so confident that I am correct that I am willing to put my money where my mouth is right now

jolly inlet
dense heath
#

I'll throw down $20 on this.

paper viper
#

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

jolly inlet
#

@tight sluice You basically did anything possable wrong.

dusk flicker
#

the plugins both might LOAD, but the code def wont work from both plugins

dense heath
vagrant stratus
young knoll
#

Well duh

dense heath
young knoll
#

Class names should be descriptive

jolly inlet
#

@modest shard Reinstall java and watch a lot of tutorials.

hardy swan
#

lol

modest shard
#

im watching rn

paper viper
modest shard
#

😦

dense heath
paper viper
#

cause they already know its a dumbass move to name it that anyways

#

Lol

jolly inlet
#

You need a java sdk, not only a jre... @modest shard

vagrant stratus
#

Personally if I were to do a server or hire devs, I definitely wouldn't hire anyone who names their plugins main class Main

modest shard
modest shard
#

this thing

#

or no

jolly inlet
#

Search for a tutorial installing java...

dusk flicker
#

wait md gives the rights to name your plugin class Main?

#

didnt know that

paper viper
#

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

jolly inlet
#

Please stop being a help vampire as @waxen plinth said.

dusk flicker
#

the hell is a help vampire

#

here I come google

vagrant stratus
wet breach
# dense heath In fact, I am so confident that I am correct that I am willing to put my money w...

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.

dusk flicker
#

LOL HELP VAMPIRE IS THE BEST DEFINATION IVE EVER SEEN

jolly inlet
paper viper
#

guys this is the pinnacle of spigot discord

modest shard
#

i am

paper viper
#

20 conversations going on at once

vagrant stratus
hardy swan
paper viper
dusk flicker
#

threads suck tho

paper viper
#

Lol

jolly inlet
dusk flicker
#

we want EVERYONE of the few thousand members to see the stupid shit we talk about in here

jolly inlet
#

I am so close to raging...

paper viper
wet breach
dense heath
jolly inlet
#

That's literally the best reference.

paper viper
#

Yea thats why you gotta chill

#

remember that you are helping other people

#

if u need time for yourself, take the time you need

wet breach
paper viper
#

sometimes you have to focus on yourself rather than others

jolly inlet
#

It's like 5 am in the morning, what am I supposed to do xd

paper viper
#

🛌

dense heath
vagrant stratus
#

How so?

wet breach
dense heath
#

Let's get in a call to sort this out. These guys are actually trying to help some people lmao

dusk flicker
#

what are you a master Java developer with 10 years of experience?

vagrant stratus
#

Unlikely

dusk flicker
#

send a resume then

jolly inlet
#

People, listen....

hardy swan
#

honestly, I would very much say that the only responsibility of Main is to run main(String[] args)....

dense heath
wet breach
modest shard
dense heath
dusk flicker
#

Im good to not hop in a call

modest shard
#

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

jolly inlet
#

You need to go on windows and let you expand the file endings.

#

Then change .txt to .bat

wet breach
jolly inlet
#

You are jow changing only the name @modest shard

dense heath
dusk flicker
#

see thats called deflecting

#

its what happends when you dont know the answer to something

jolly inlet
#

People, stop arguing. The answer is simple...

modest shard
wet breach
dense heath
jolly inlet
modest shard
#

ok

#

wait

hardy swan
dusk flicker
#

mojang... did mojang

wet breach
craggy plover
#

Is it possible to do a multiple bungee setup?

dusk flicker
echo basalt
dense heath
vagrant stratus
dense heath
vagrant stratus
#

I touch ASM like crazy, doesn't mean I know everything about it though

dense heath
wet breach
#

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.

echo basalt
#

I wonder if I can fake plugin messages if I make an extra proxy and connect to someone else's server 🤔

vagrant stratus
dusk flicker
#

you just put another servers ip in the servers section

#

as long as its offline mode you good

wet breach
dense heath
wet breach
#

I mean, clients can fake inventory names to gain access to inventories 😛

hardy swan
#

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

wet breach
#

one of the main reasons you shouldn't rely on inventory name to verify if its the correct inventory

lavish hemlock
#

what is the fun in that

dense heath
lavish hemlock
#

why is that impressive

echo basalt
#

I mean like

dense heath
lavish hemlock
#

what

wet breach
#

basically stealing

echo basalt
#

Some plugins use plugin messaging to communicate important data to proxies

dense heath
dense heath
jolly inlet
#

@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...

echo basalt
#

I can listen into all data, analyze it and compromise a server

#

Sounds like a big risk in bungee

dusk flicker
#

thats why good devs dont use PMCs

quaint mantle
#

😂

modest shard
#

ive searched for this already but how do i give the build tools more memory

dusk flicker
#

plugin messaging channels

#

lmao

lavish hemlock
quaint mantle
modest shard
dusk flicker
#

?google

undone axleBOT
quaint mantle
jolly inlet
echo basalt
#

Java -xmx5G -jar...

dusk flicker
#

sooo yall how high are we tonight

quaint mantle
wet breach
quaint mantle
dense heath
echo basalt
dusk flicker
#

good devs just dont use PMCs

#

and use something like redis pub/sub

quaint mantle
dusk flicker
#

LMAO

dense heath
modest shard
#

i am very much lost

echo basalt
quaint mantle
#

yeah, good devs use LMC, lego military company

jolly inlet
dense heath
jolly inlet
#

xd

wet breach
#

and both objects not being the same 😛

jolly inlet
lavish hemlock
#

I mean there's a reason why classes like Collections typically require libs to use names like MoreCollections or Collections2

modest shard
lavish hemlock
#

You cannot import two classes of the same simple name in the same source file.

wet breach
dense heath
echo basalt
vagrant stratus
#

Classes are objects

quaint mantle
#

classes are blueprints of objects

jolly inlet
quaint mantle
#

?learnjava the last link said that

undone axleBOT
dense heath
dusk flicker
#

someone is fast typing

#

or did that just randomly appear

quaint mantle
hasty prawn
#

RPG said it

echo basalt
#

Man googled it

quaint mantle
#

objects are created from classes

jolly inlet
quaint mantle
#

classes != objects

dusk flicker
#

good chance im just wayyy too tired at this point to think straight

quaint mantle
#

classes are a blueprint

hasty prawn
quaint mantle
#

objects contain functionality

echo basalt
#

The Class<?> can be an object

wet breach
quaint mantle
#

the class Class can be an object

#

which is weird

echo basalt
dense heath
quaint mantle
echo basalt
#

Hm

quaint mantle
#

STOP DONT SCARED ME WITH THAT CAR

#

STOP

#

STOP

#

STOP

#

CHANGE IT NOW

vagrant stratus
dusk flicker
#

what

quaint mantle
dusk flicker
#

oh

jolly inlet
#

I honestly love it.

dusk flicker
#

that

quaint mantle
#

NOOOOO

#

NOOOOOOOOOOOOOOOOO

vagrant stratus
#

Bukkit is static and not an inner class 😉

jolly inlet
#

dababy...

quaint mantle
#

WHY WOULD YOU LOVE TO SCARED ME

#

I JUST WAKE UP MY GRANDPA LOL

#

DONT DO THAT AGIAN

dusk flicker
#

lmao

dense heath
quaint mantle
#

DONT YOU DARE

vagrant stratus
#

just slap static as a modifier and you're good to go

quaint mantle
dusk flicker
#

Snow isnt it literally like 10am for you?

dense heath
vagrant stratus
#

You....can?

quaint mantle
wet breach
#

you can make almost anything static

dusk flicker
#

fair enough

#

ive slept to like 1pm before

echo basalt
#

Why are we arguing about static

quaint mantle
#

me too bro

dense heath
echo basalt
#

It's 4:20am ffs

dense heath
#

That's not valid.

#

It must be an inner class to become static.

jolly inlet
#

5:22 am..

dusk flicker
#

11:22 pm for me

echo basalt
wet breach
dusk flicker
#

me and Snow literally are like 12 hours different in timezones yet we work on the same project lol

dense heath
#

A static method and a static class are different.

#

Simply because a method is static does not make the class static.

wet breach
echo basalt
#

Gets garbage collected lmao

wet breach
#

Main class is static unless we are dealing with some kind of library or API lol

dense heath
#

Outer classes cannot be static.

lavish hemlock
#

The main class is not static lmao

quaint mantle
#

outer classes cant be static

dense heath
#

It is impossible for an outer class to be static.

quaint mantle
lavish hemlock
#

The static modifier only applies to inner classes, methods, and fields.

vagrant stratus
quaint mantle
lavish hemlock
#

And refers to whether or not an inner class can be instantiated independently of its enclosing class.

dusk flicker
#

I will show you how stable those scripts are

quaint mantle
#

hoho

quaint mantle
dusk flicker
#

not really

lavish hemlock
dusk flicker
#

work has been a big factor

jolly inlet
#

Do you guys think there would later be a new type of anti discrimation TikTok wave towards programming name conventions like 'MyClass'?

quaint mantle
#

?wyvern

dusk flicker
#

fuck tiktok

lavish hemlock
quaint mantle
#

tiktok = donkey balls

#

me use tiktok kids bro

#

*youtube

#

wow everyone just die after tiktok kids

wet breach
wet breach
#

whether or not your IDE or compiler lets you put the static identifier or not is independent to how the JVM runs

lavish hemlock
#

One that I fancy

quaint mantle
lavish hemlock
#
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.

wet breach
#

the class is also not going to go away either

vagrant stratus
#

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.)
quaint mantle
#

i like that

#

good job maow

lavish hemlock
#

I take issue with using the term "static" for this because of how it's already a term in the language.

quaint mantle
#

static = existing once globally

lavish hemlock
#

And in fact

#

Classes are not technically always static

#

Considering how classloading works

#

And how some classloaders can't really be considered as "global"

wet breach
lavish hemlock
#

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

gentle oriole
#

/give triggers PlayerDropItemEvent...

quaint mantle
#

thats dumb

dusk flicker
#

give is a horrible command

#

lmao

lavish hemlock
#

A ClassLoader for plugins, to allow shared classes across multiple plugins

wet breach
gentle oriole
#

yes but I think it wasnt intentional

wet breach
#

since there is a hierarchy to the class path stuff

lavish hemlock
#

But yeah I'd argue "global" means that something can be accessed globally, not just that it exists globally.

vagrant stratus
#

so ig each classloader would have its own "static" classes 🤷‍♂️

gentle oriole
#

my plugins kills players when they drop items.

wet breach
lavish hemlock
#

And there is actually one form of class that can't just be accessed through that classloader's findClass or whatever

jolly inlet
#

I see the problem.

lavish hemlock
#

Lemme find the method

quaint mantle
#

record are classes, wonder if i need to use static on it in inner class?

#

no

jolly inlet
quaint mantle
#

records are @Data but made in primitive java

#

wats dat

#

so like

gentle oriole
gentle oriole
paper viper
#

@Data is a Lombok annotation

gentle oriole
#

not take them out in the crafting table and press q

jolly inlet
quaint mantle
#
record Person(String name, int age) {
}
Person person = new Person("Bob", 5);

System.out.println(person.name());
System.out.println(person.age());

@quaint mantle

gentle oriole
#

hmm

#

@jolly inlet you mean if player dropped item, check if item is in inventory?

quaint mantle
#

you cant modify variables in records

#

oh

#

final

#

yes they are final by default

#

and you cant declare new ones

gentle oriole
jolly inlet
#

So, like Crafting tables wouldn't be counting.

quaint mantle
lavish hemlock
#

These cannot be accessed globally or in any way, really.

jolly inlet
gentle oriole
jolly inlet
#

Then you check if it came out of the inventory and you kill the player.

gentle oriole
#

?

jolly inlet
#

You want to kill the player when he drops any item.

wet breach
#

but that is correct

lavish hemlock
#

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)

quaint mantle
wet breach
quaint mantle
#

i dont get why you say that

quaint mantle
wet breach
#

they been slowly removing the unsafe ones anyways

lavish hemlock
#

Did you know you can essentially have a dynamic ldc instruction through MethodHandles.Lookup::findClass?

quaint mantle
#

lol

wet breach
#

the ones that are still left, don't think are going to be easy to replace

quaint mantle
#

not bad to learn something

quaint mantle
#

but then, inner record are classes anyways, so do it need to be static

wet breach
#

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

quaint mantle
#

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
vagrant stratus
quaint mantle
#

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 + '}';
        }
    }
}```
wet breach
vagrant stratus
#

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

wet breach
#

lol

#

just because everyone else probably has?

vagrant stratus
#

vanilla

#

not paper/spigot, vanilla

quaint mantle
#

ye

wet breach
#

I know. many people have done it

#

or wanted to

vagrant stratus
#

A lot of massive changes just aren't possible under the current changes lol

wet breach
#

they start and then never finish, think every dev ends up with a forked vanilla at some point 😂

vagrant stratus
#

I'll probably wait until some current projects are finished before I do something that massive though

young knoll
#

I still want configurable piston push limit

#

But I'm lazy

wet breach
#

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

vagrant stratus
wet breach
#

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

young knoll
#

That's why I'll probably stick with spigot PRs

vagrant stratus
#

Well, luckily from what I can tell updating to a new release for me wouldn't be toooo difficult

quaint mantle
vagrant stratus
#

I could also do 1.18.1 then insta jump to whatever's out when I'm done lol

quaint mantle
#

im now stick to 1.16.5 only so i dont really mind seperate patches for every classes

young knoll
#

Ya think MD would go for configurable piston pushing, or moveable tile entities

vagrant stratus
quaint mantle
#

i put them in a massive patch file then call them stage of classes

young knoll
#

Or is that too far from vanilla for spigot

vagrant stratus
wet breach
vagrant stratus
quaint mantle
#

why people like latest version :heh:

#

1.16.5 da best

#

no upgrading

wet breach
#

I am still not sure what configurable piston pushing is. I know what is probably being referred to for moveable tile entities

quaint mantle
jolly inlet
#

What do you guys think about Design Patterns?

quaint mantle
#

configurable piston!

vagrant stratus
wet breach
hardy swan
young knoll
quaint mantle
#

i thought ya cant even join 1.17+?

#

oh you gonna buy a new pc

#

ah yes thats why you change

vagrant stratus
#

as for spigot, I just use via lol

jolly inlet
quaint mantle
#

i havent seen the new generation

hardy swan
young knoll
quaint mantle
#

i can make better terrain than the generation, but i wanna see their work

young knoll
quaint mantle
young knoll
#

mhm

hardy swan
#

I think it is a matter of coming across something similar that i could use

#

That reminds me of

jolly inlet
wet breach
quaint mantle
#

not that much

young knoll
#

I mean

quaint mantle
#

even less

young knoll
#

Keeping a sane range is down to the user

vagrant stratus
#

Integer.MAX_VALUE push limit

#

lets goooo

hardy swan
wet breach
modest shard
shy forge
#

Sorry to jump in: Anyone know if TabCompleter forces alphabetical order? Mine is but I don't like that

modest shard
#

my craftbukkit is gone?