#help-development

1 messages · Page 250 of 1

round finch
#

Like a mod chat

wet breach
#

If you design it right, you can have this. Discord has such a thing where you can designate a channel as NSFW

round finch
#

Well could be possible if they redesigned their already existing systems

orchid gazelle
#

What mojang is doing is pushing up their garbage trash bs bedrock edition

#

They want everyone to switch to bedrock

#

I can see

#

(They can also make more $$$ per player at bedrock)

torn shuttle
#

this sucks but I think I'm going to have to rebuild this web app to use next to no html and be almost entirely just javascript

wet breach
orchid gazelle
#

Bro they are literally pulling updates against the want of their playerbase

#

Chat Reports for example

#

Migration for example

#

You can already see that on the official website too, they are not seing java as the main edition anymore

#

See, they shot up the price to "combine" java and bedrock like wtf

wet breach
# orchid gazelle Migration for example

Migration has nothing to do with the player base and from business point of view made sense. Microsoft already had a system in place. Made no sense to pay for additional servers.

orchid gazelle
#

If you have java, you should not care about bedrock

torn shuttle
#

if you have java no one forces you to care about bedrock

wet breach
#

As for chat reports I already explained above a point of view. Not saying it is correct but it doesn't mean it isn't understandable either. What everyone agrees on is poor execution for it.

orchid gazelle
#

-> they are sending more players to bedrock

torn shuttle
wet breach
#

Well I can tell you from a perspective of a parent. Bedrock is a lot better for kids and a lot easier for them to play. It is also easier to keep tabs where they are playing too. These are things you are not considering because all you care about is java and not who the target audience is.

orchid gazelle
torn shuttle
#

what the hell are you even talking about

#

if you are a java player your java experience has not been materially affected by bedrock

wet breach
#

You are free to have your biased opinion. But to ignore other views and aspects is just ignorant as you are not the sole person they are catering to

#

Also as magma said too

orchid gazelle
#

I have anxiety that they keep on bringing "bad" things

torn shuttle
wet breach
#

I have all the versions of mc and I like you prefer the java version. However I also have younger siblings and they have access to both. They prefer bedrock and it is easier to keep tabs on them especially who they play with or where they play. But overall they enjoy bedrock more

torn shuttle
#

there are valid criticisms of bedrock but you can't even formulate a single legitimate reason as to why it upsets you

orchid gazelle
#

Not about their target players

wet breach
#

In what way? As it stands the java version still has more features then bedrock does

torn shuttle
#

name one thing

orchid gazelle
#

For example microsoft pulling players away from java, and pushing down the growth of the java playerbasw

torn shuttle
#

you have crossplay systems, and this does not affect the existing java experience

orchid gazelle
#

They are indirectly pushing down the growth of the playerbase by their combination of bedrock and java for example

#

(The java+bedrock pack)

orchid gazelle
wet breach
#

You do realize some of us received bedrock for free just because we had java version.

orchid gazelle
#

Yes

torn shuttle
torn shuttle
#

let me remind you that mojang does not owe you a long-term steady influx of new players

#

this is just a game you bought

wet breach
#

Everyone already knows at some point java version won't be maintained forever. However that doesn't mean the community won't maintain it

orchid gazelle
#

Yeah but I can still complain about them pulling down the playerbase predictively lol

torn shuttle
#

mojang doesn't even owe the maintenance of the java edition in the first place, if they want to they could make minecraft 2 tomorrow and completely drop the current state of mc

wet breach
#

Java version will continue to exist and be maintained so as long there is a community for it

orchid gazelle
#

Yeah "as long as there is a community"

#

What are they doing? Trying to get players away from java lol

quaint mantle
#

class main string args public void main

WHY DID NOTCH MAKE MINECRAFT IN JAVA

wet breach
#

Makes no sense to maintain something if no community exists for it anymore. That is just waste of time and money

orchid gazelle
#

Sure

#

But they are pulling down the community themselves

wet breach
wet breach
#

Beside he never intended for mc to be commercialized

quaint mantle
torn shuttle
#

seems like the community would just be moving

torn shuttle
#

no it's not

#

you have the same community, different backend

wet breach
#

It became popular from a game forums as more people became interested in it. Mc was free at the beginning

orchid gazelle
#

If you are moving players from java to bedrock, you are pulling down the java community

#

Bro I just autopiloted to the trainstation 100% lmao

wet breach
#

Then notch made a company and sold it cheaply and then it grew from there

torn shuttle
#

lol I wish I could sell my company cheaply like notch

orchid gazelle
#

Same

torn shuttle
#

hey frost I got a cheap company to sell you

wet breach
#

The original intent though wasn't to commercialize but as more people wanted it and more features that was the only sensible route

quaint mantle
#

I wish I had one 😂

wet breach
orchid gazelle
#

You see, the playerbase of my country is dying completely

#

All the servers are closing or losing so many players the rounds are not even getting full

wet breach
#

That is their fault

#

Not every server owner is a good business owner

torn shuttle
#

this might shock you but no game lasts forever

orchid gazelle
#

But also has partwise-fault of micro$

quaint mantle
wet breach
#

Not really

quaint mantle
#

20 bucks

torn shuttle
#

mc has already had a better staying power than 99.99% of games out there

wet breach
#

And continues to do so

orchid gazelle
torn shuttle
#

you can count how many games have had this kind of staying power in one hand

jagged monolith
#

How is this conversation even remotely related to Spigot or Bungeecord development?

wet breach
torn shuttle
#

WoW, Runescape, Minecraft

orchid gazelle
#

Well the owners do not have full fault on that

torn shuttle
#

I would have a hard time listing more

orchid gazelle
wet breach
#

They do. It's called failed marketing and not being creative enough or original to keep their player base. How do you know this player base simply didn't join better servers

orchid gazelle
#

Because I know tons of people that stopped to play

wet breach
#

They don't make up the majority

torn shuttle
#

I know tons of people that stopped playing too

#

5 years ago

orchid gazelle
#

But they give me an overview

torn shuttle
#

even before bedrock was a thing

orchid gazelle
#

I can see how many players are leaving and how many are joining other servers

torn shuttle
#

did mc die 9 years ago, I remember a ton of people stopping back then

orchid gazelle
#

The joining other servers part is at about 0

wet breach
#

Because you run all the servers in the world?

orchid gazelle
#

No, but I have the ability to socialize

wet breach
#

Not with the majority.

orchid gazelle
#

Studies also do not research on 8 billion people lol

torn shuttle
#

not to mention this is a pointless argument, minecraft has always operated on a revolving doors basis

#

new people enter and old people leave daily

orchid gazelle
#

They can still see what happens for 50k tho

orchid gazelle
torn shuttle
#

I've been on this space since infdev, if I based my view on only the people I interacted with I would conclude no one plays minecraft

orchid gazelle
#

Oh cmon how am I supposed to argue against that

torn shuttle
#

you aren't

#

you're making a shit argument

#

did you just realize that?

orchid gazelle
#

I cannot proof any number

torn shuttle
#

yeah, I know you can't

orchid gazelle
#

But you can simply see that it happens

wet breach
#

Looking at the stats from last year at this point this year we are only down about 20k players. There is still about on average 170k players

torn shuttle
#

we have the numbers

orchid gazelle
#

In german, there is a difference between "Tatsache" and "Fact"

#

This is a Tatsache lol

torn shuttle
#

and we probably have way more time in the mc space than you do

wet breach
#

However this is a normal drop that happens every year

torn shuttle
#

at least I don't think very many people have been on here longer than I have

wet breach
#

Because Christmas and all that

orchid gazelle
torn shuttle
orchid gazelle
#

Yes, less people enter than they would with other marketing + dev

wet breach
#

The stats above tracks active players btw

orchid gazelle
#

It is meant like that

torn shuttle
#

so people are leaving, and new players aren't coming in

orchid gazelle
#

They are, but ness

#

Less

torn shuttle
#

I don't know what level of education you got but I think you can figure out the maths

#

what is the impact on the total amount of players

orchid gazelle
#

And new players tend to only play survival

#

So the server scene is getting dropped, at least where I live

torn shuttle
#

so now the enemy is survival

orchid gazelle
#

No

torn shuttle
#

I should've known it, mojang is ruining minecraft by making it a survival game

wet breach
#

So your issue is that new players rather play bedrock and if they do play java they like survival and not these other game modes that server owners think are fun but apparently are not

torn shuttle
#

those devious bastards, we need to go back to the classic browser edition

#

they are RUINING my game

wintry ferry
#

The browser edition holds a special place in my heart

orchid gazelle
#

No it is also that server owners have fault for it, but not full fault

wintry ferry
#

I remember a server that had a bunch of pixel art underwater

wet breach
#

So far everything you been complaining about can be attributed to terrible server owners

torn shuttle
#

remember the browser edition servers that had the lava flood maps

orchid gazelle
#

Cmon guys don't joke on me I cannot defend with frozen fingers on my touchscreen while walking

torn shuttle
#

those were the days

wintry ferry
#

All it took was 1 prick with lava

orchid gazelle
wet breach
#

Not it reached its peak long time ago

torn shuttle
#

surely this couldn't be applied to everything

#

imagine if mojang dedicated 1 trillion usd to advertising

#

ok now imagine if that was 1 quadrillion instead

#

they can do so much more

wintry ferry
#

Even better, a gorillion dollars

torn shuttle
#

they should etch the minecraft icon on the moon so everyone gets to see the ad

orchid gazelle
#

Ok at this point I gotta go, school is starting

wintry ferry
#

Did anyone ever play that Mooncraft mobile game

#

Lunacraft*

wet breach
#

I mean there is like some billion java accounts. The most you could expect a year of new players for java is at most a million but most likely a few hundred thousand

#

Out of that you could only expect a couple 10k to actually stay

#

Which our stars actually shows that

#

Stats

wintry ferry
wet breach
#

And in comparison with other popular games Minecraft still has one of the largest player bases with java version alone

torn shuttle
#

not even close to 1 bil

wet breach
#

At not there yet then still couple hundred mil lol

torn shuttle
#

238 mil is to 1 bil what 238 is to 1000

#

not even close

wet breach
#

Ok was wrong on that number but still a lot of accounts regardless

#

Mc peaked a long time ago. Now it's just maintaining. Which isn't doing bad on that

torn shuttle
#

it's quite literally the most sold game of all time

#

but 1 bil would be 1 in 8 people, in the entire world

#

I'm not even sure that 1 in 8 people meet the conditions required to acquire a copy of mc

wintry ferry
#

Still pretty cool to say 1 in 24 people own the game

#

4% of the world

torn shuttle
#

just for scale here, they are running laps around the second most sold game which was gta 5

#

at 170mil

wet breach
#

Yep

torn shuttle
#

tetris is at 100mil, and that's the last game over that three digit million mark

wet breach
#

But anyways point still stands though we are getting a routine influx of new players

torn shuttle
#

I mean I don't question that the game is slowing down, but I don't attribute that to bedrock

#

it is a very visible and easily verifiable statistic

wet breach
#

Yep

torn shuttle
#

but you know, the game is 11 years old

#

even WoW didn't get this kind of staying power

#

(first versions started coming out in 09)

wet breach
#

They probably would have if they weren't trying to screw over unofficial wow servers all the time lol

torn shuttle
#

pirated WoW servers actively sap subs though

#

WoW would be rock solid if they did horizontal progression instead of vertical

#

as it is teh game is only as good as its latest expansion which is a travesty in my eyes

wet breach
#

That is only true because blizzard refuses to accept or incorporate the unofficial servers

#

Where as Mojang welcomed it

torn shuttle
#

mojang doesn't charge subscriptions

wintry ferry
#

They could easily do what Mojang does with Bedrock and have unofficial servers but server-authenticated paid cosmetics

torn shuttle
#

while I do think it would be cool if blizz allowed community servers I just don't think it fits the model they want to do

wet breach
#

Nope it doesn't. But doesn't mean Mojang never showed it's appreciation for all these different servers and the creativeness where was all blizzard did was showed a cold shoulder lol

torn shuttle
#

the only way that works is if they drop subs and go free to play

#

which won't happen

wet breach
#

Not true, they could have moved the cost from player subs to server subs instead

torn shuttle
#

that would def not work

#

100%

wet breach
#

Charging for a license to run a server? Yes it does work and many applications and games still do it

torn shuttle
#

you said move the cost from player subs to server subs

#

so what, the server will pick up the bill of every sub lost from people playing in that server?

wet breach
#

No

torn shuttle
#

any moderately successful server would need to pay tens of thousands of dollars to make up for the lost revenue, you understand that right

#

a month

wet breach
#

You charge owners of servers to be allowed to run a server.

#

But that cost doesn't have to be a one time fee. It can be monthly or yearly

torn shuttle
#

your suggestion is making up for lost revenue from players subs by charging server with licensing fees

#

a WoW server holds 900-1500 daily users, sub prices are $13

#

this will not work

wet breach
#

I never said making up anything. They will lose a player regardless.

torn shuttle
#

then they won't do it, why would they

wet breach
#

And hence wow will continue to diminish on being popular

#

And they will continue to lose subs to free servers

torn shuttle
torn shuttle
wet breach
#

Yeah costs them more money to do so

#

For every free server that goes down a few more goes up

#

Blizzard can't take on the world

torn shuttle
#

for years

wet breach
#

They havent

torn shuttle
#

there are no big free WoW servers out there

wet breach
#

They didn't sue no 7bil people nor do they have the resources to do so

quaint mantle
#

So my getConfiguarionSection gives me an error of
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.getValues(boolean)" because the return value of "org.bukkit.configuration.file.FileConfiguration.getConfigurationSection(String)" is null

This is the code that errors. (p = Player)

Map<String, Object> playerData = inst.getData().getConfigurationSection(String.format("%s.Crates", p)).getValues(false);

This creates said data its trying to find.

if(inst.getData().get("%s.Crates") == null){
    HashMap<String, Integer> hash = new HashMap<String, Integer>(){{
        put("CommonCrate", 0);
        put("RareCrate", 0);
        put("LegendaryCrate", 0);
    }};
    inst.getData().set(String.format("%s.Crates", event.getPlayer().getUniqueId()), hash);
}
torn shuttle
quaint mantle
#

Anybody got any idea why? Its a yaml file, i created a class to store and read player data using yaml files.

torn shuttle
#

they have more than enough resources to take every server down

#

they don't even need to sue them, takedown notices do the trick almost every time

wet breach
#

They don't. You obviously don't know the costs in the US alone

torn shuttle
jagged monolith
wet breach
quaint mantle
torn shuttle
quaint mantle
#

All I did was search it up and assumed it works as the same format as a yaml file.

wet breach
#

Yes

torn shuttle
#

who

wet breach
#

It was a battle net server

#

Should look into pvpgn history.

torn shuttle
wet breach
#

So yes blizzard has done it before. But it was costly hence they don't try to sue everyone otherwise they will just sue themselves into bankruptcy

torn shuttle
#

I thought we were talking about WoW here

#

can you name one lawsuit WoW had to do to take down a pirated WoW server because they refused to shut down

#

seemingly you think this is a daily occurrence or something that blizz is bleeding money from so it should be easy to find

wet breach
#

This is why Microsoft doesn't try to sue everyone or any large corporation because they will lose more then what they will gain

torn shuttle
#

I can't even find a lawsuit for pvpgn

wet breach
#

Otherwise if it was the opposite like you claim we should see tens of thousands of suits from these businesses against their users but we don't

jagged monolith
# quaint mantle How do configuration sections work?

They are basically sections in a config.

player: #This is a section
  playernames: # this is also a section
    - player1

blocks: #Another section
  ores:
    - diamond

Basically getConfigurationSection("players.playernames") would get the playernames section from above.

torn shuttle
#

we don't see suits because wow pirated servers are fly by night operations that the second blizzard sends a cease and desist letter to (which can be done for free, by the way) they cease and desist

quaint mantle
#
(hiding my userid as i keep my acc private):
  Money: 0
  DailyLot: 12345678
  Crates:
    RareCrate: 0
    LegendaryCrate: 0
    CommonCrate: 0
  Tags:
  - None
wet breach
quaint mantle
#

here is what mine looks like

torn shuttle
#

and as long as blizzard keeps one intern on payroll to play whack-a-mole that one intern will keep destroying any chances any free servers might have to stay alive

quaint mantle
#

@jagged monolith Wait im an idiot.

wet breach
#

Interns are not lawyers that can act on behalf of a corporation in the US

quaint mantle
#

I forgot to change p to p.getUniqueId

#

:bruh:

jagged monolith
torn shuttle
wet breach
#

Never said that. Just said it wasn't free for them

torn shuttle
#

it's 1 person

#

and I can even tell you, they don't have them do it full time

#

presumably because they're too busy getting sued by their own workers

wet breach
#

It's called a retainer and they contract with a firm so yes it is full time

#

But priorities you know

torn shuttle
#

so yes, they can probably pull an intern from their legal department to spend an afternoon sending cease and desist letters to pirated servers like once per month or something

wet breach
#

Seems like full time to me regardless. No one with 7+ years is going to only work part time or at part time wages

wet breach
#

In other countries sure

#

But no intern who isn't a lawyer can act on the behalf of a corporation

#

Only know this because there is actually a spot on corporate papers to designate such a person and they have to be a lawyer or an officer of the corp to be able to do so.

torn shuttle
wet breach
#

Sure doesn't mean they bypass the laws either

torn shuttle
#

I think they're called associate lawyers

wet breach
#

They are not. Otherwise that isn't an intern

#

An intern is someone who doesn't possess a license to practice law but is learning. There is plenty they can do, but plenty they also can't do. Such as representing people or corporations as wells giving legal advice. But they can be on cases to learn or do research

torn shuttle
#

yeah they can't sign on the company's behalf, but they do all of the footwork and then the documentation just gets signed off by whoever is looking over their work

#

point is you presented this as blizzard bleeding money over these issues when their legal department probably doesn't even notice the workload difference of sending a cease and desist letter, these are built on templates and the thing that takes the longest to do is figuring out where to send it off to

#

and that is left to the interns

wet breach
#

Not saying they are bleeding money, but they are losing players by not welcoming custom servers. In essence losing revenue regardless. Eventually they will have no players subbed but free servers will always be a thing.

torn shuttle
#

except you also say they would lose subs (and I would argue in absolutely catastrophic amounts) if they allowed custom servers

#

and you also admit server licensing fees would not cover the losses

wet breach
#

They would have the loss regardless

torn shuttle
#

no they wouldn't

wet breach
#

Oh guess the players stay forever

torn shuttle
#

we are talking about WoW right

wet breach
#

But the servers paying a fee is still a steady stream of revenue

torn shuttle
#

the game that just released a new expansion?

#

the game that came out in 2004?

wet breach
#

And they continue to lose players as far as I can see

torn shuttle
#

yeah and your argument is taking the userbase that pays $10 a month and reduce the amount of monthly income they get from that to $0 because this is a good business decision

wet breach
#

I never said that

civic wind
#

Who cares

torn shuttle
#

we care

#

clearly

civic wind
#

Go in another chat you’re flooding this one

wet breach
#

They can keep subs for players if they really wanted. But they can charge for servers existing too. But I mean can't really stop a player from not paying

civic wind
#

Woffling about stuff that has nothing to do with ‘help-development’

wet breach
civic wind
wet breach
#

Well unless staff says otherwise we are fine

civic wind
#

You’re not, thats not what this chat is for

#

Arguing like 2 children over something that has nothing to do with either of you or this channel loll

wet breach
#

Well you are not staff and you are the only one complaining currently

civic wind
#

Anyways go in another channel

#

Child

wet breach
#

Last I recalled you were the one that is. I didn't forget our last interaction at the beginning of the year

civic wind
#

I joined in sept 18th, delusional and annoying. I won’t respond anymore if you have something to say dm me

wet breach
#

No thanks.

torn shuttle
#

are we just making shit up today, what the hell is up with people

#

or is that the join date for discord?

civic wind
#

Thats discord, notice the spigot logo next to sept 18

#

Lmfaooo

torn shuttle
#

can't you just leave and rejoin?

civic wind
#

Probably yeah

torn shuttle
#

or does it still log the first join date

civic wind
#

Not sure tbh

wet breach
#

They left and rejoined

civic wind
#

They?

#

I’m one person and im a guy lmfao

#

What the heck is this dude on about bruh my brain

torn shuttle
#

so yes

civic wind
#

June is early this year?

#

Half way through??

torn shuttle
#

june is before september

#

so we are just making shit up today

civic wind
#

Yes my mistake

#

But idk who this guy is nor do i remember even leaving

#

Besides the point of when i joined or left, this isnt for woffling in so go to another channel

wet breach
#

I don't have you blocked for no reason. You may not remember but I do

#

Lol

#

Alright time for me to work a bit

civic wind
#

I remember alex, the pronouns guys

#

Bro argues with everyone hes like a little girl

wet breach
#

But the reason I have them blocked is because they wanted to complain that I wouldnt dm them and continued to chat here

civic wind
#

I remember it being about genders

civic wind
torn shuttle
#

talking about pronouns you should probably learn how they work

#

"they" is no necessarily plural

wet breach
#

Anyways cya later. Until next time magmaguy

torn shuttle
#

see ya frost

#

don't pirate WoW

warm mica
maiden thicket
#

💀

civic wind
#

Why you keep saying they😂😂

torn shuttle
#

I just think it's hilarious to make fun of someone because they want specific pronouns when he opens with complaining about the pronouns frost used

civic wind
#

Yeah

#

Whats ur point

#

This channels full of confused children

#

Guys theres only 2 genders

torn shuttle
#

you're entitled and you're very dumb

maiden thicket
#

if you were to take an english class, they can also refer to singular and plural

#

they doesn't refer to a gender

civic wind
#

Yes it does now

maiden thicket
#

it does not

torn shuttle
#

"they" is genderless numbnuts

civic wind
#

Your generation made it refer to a ‘gender’

torn shuttle
#

it doesn't imply any gender

maiden thicket
#

some people simply do not wish to be identified as a male or a female so they prefer to be called they or them

maiden thicket
#

it's that simple

#

it is not a gender

civic wind
#

I know it isnt

maiden thicket
#

it just means you do not want to be associated with a gender

civic wind
#

Dont call me they im a boy

maiden thicket
#

and if you took an english class, it also can refer to a singular person

civic wind
#

Girls are girls boys are boys, if i were to say they i would be talking about more than 1 person

maiden thicket
#

that's not how the english language works

civic wind
#

I know

torn shuttle
maiden thicket
#

maybe you should learn english

civic wind
#

I’m typing in english

#

Boy = boy Girl = girl

maiden thicket
#

speaking english and understanding how it works are two different things

#

yes you've made that clear, yet they doesn't refer to a gender

#

it is a pronoun that is learned in basic english classes

torn shuttle
#

I can type in japanese, that doesn't mean I know every japanese word

civic wind
maiden thicket
#

look at the second one

civic wind
#

I know

torn shuttle
#

this is some genuinely stupid shit going on here

civic wind
#

You are missing the point im making

civic wind
jagged monolith
#

So much for this being a Spigot & Bungeecord Development help channel... This convo is more suited for dms or #general really.

maiden thicket
#

i agree

remote swallow
#

Anyone know of a plugin on github that uses gson or simple json, im trying to figure out how either of them work and i cant find anything decent online

maiden thicket
#

that is my bad

torn shuttle
#

they're in json

maiden thicket
#

that's an example of gson

#

very simple usage

remote swallow
#

Thanks

maiden thicket
#

another example of gson from ashcon json object to ashcon java object

#

as for simplejson

torn shuttle
#

mmmh http json my favorite

maiden thicket
#

wouldn't know

#

i use org.json

torn shuttle
#

I need to stop procrastinating on rewriting this in js

#

here we go again

ivory sleet
remote swallow
#

Wait a minute how did he

eternal oxide
#

it changed quite a while ago

#

probably paid

#

oh it just changed back when I clicked his profile

remote swallow
#

Discordjank

sly venture
#

How do I recognize an item when I put it in Inventory?

#

If you try to save it to a config.yml, and you use InventoryClickEvent, the inventory controls all activities.

tardy delta
#

Wdym recognize?

#

PDC tag on meta?

sly venture
#

yes.

#

I want it to be recognized when I put an item in the inventory.

#

Creating shop plugin editor.

#

When you put an item in Inventory, it is saved in config immediately

icy beacon
iron palm
#

what is the string array keyword in SQL im trying to store some array data's inside the player but cannot find it

kind hatch
#

varchar(SIZE)

iron palm
kind hatch
#

Uhh, wait. I thought you were talking about a normal string. You mean a List<String> or String[]?

iron palm
#

ik i can store it as string but uh im looking for a better way if exists

molten hearth
#

Usually there is no sort of array storage implemented in databases

iron palm
#

then why setArray method exists in PreparedStatement

#

damn

molten hearth
#

You should probably encode the string array and store it as a string

iron palm
molten hearth
#

setArray is not supposed to be used like that

#

SQL can support arrays eg SELECT x FROM y WHERE z in (?) and you can use setArray in this case

#

But array storage is not a thing

hazy parrot
#

or just use correct relational pattern

#

google about association tables, i guess you should take a look at it

#

might not be the case, but is in 90% cases when you need list or array to be imported

soft raven
#

Hello, I am trying to make a plugin similar to that of dream's "hunter vs. speedrunner", which there is a compass that points to players, however in my case I am trying to accomplish the compass being able to track multiple people. I have sparse/little java knowledge, however a few years of experience in cpp.

What I mainly need help with is the ability for the compass to rotate through a dynamic array of all people on the server by left clicking it, and then pointing toward their coordinates (if in same world), and then display a little hud that shows up for a few seconds after right clicking it.

How would I be able to tell if the compass was left or right clicked?

#

I've figured out what methods to use to find the coordinates of the players and how to set compass direction so far

peak depot
#

get the interaction event

#

there you can check if left or rightclick

soft raven
#

ty

#

I found the docs page

#

sorry for my bad english it's 3 am for me lmao

trim lake
#

Why is output of this so wierd? ```if (!getDataFolder().exists()) getDataFolder().mkdir();
file = new File(getDataFolder() + "/config.yml");

    try {
        if (!file.exists()) {
            file.createNewFile();
        }
        configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(file);

        List<String> social = new ArrayList<String>();
        social.add("test");
        configuration.set("socials.web", social);
        configuration.set("socials.discord", social);
        configuration.set("socials.resourcepack", social);
        configuration.set("socials.wiki", social);
        ConfigurationProvider.getProvider(YamlConfiguration.class).save(configuration,file);
    } catch (IOException e) {
        e.printStackTrace();
    }```

Output:

socials:
  web: &id001
  - test
  discord: *id001
  resourcepack: *id001
  wiki: *id001
peak depot
#

?paste

undone axleBOT
peak depot
#

please upload the code here please

trim lake
#

Like a normal .yml list as its look in spigot

#

idk why is added only in web section not other sections

#

Idk how to doit 😄 I found some tutorial and google some staff

peak depot
#

are you using bungeecord or spigot

trim lake
#

bungee

peak depot
#

yes thats why

trim lake
#

its ok. It´s hard to find some helpful staff for bunge. Im trying to make simply command witch will read list of messages from file. Thats all what I need. But idk, how to do in bungee

peak depot
#

Like just a file with one message per line? or what

chrome beacon
undone axleBOT
trim lake
#

Im getting error with that code

chrome beacon
#

?jd

trim lake
chrome beacon
trim lake
#

Wtf... Its working but only in main class? I tried make class and put that code in and trows errors

peak depot
#

send the error

trim lake
#

Do i need implement something? Sorry for stupid questions

chrome beacon
#

;/

peak depot
#

?paste the whole class

undone axleBOT
peak depot
#

prob a bracket error

trim lake
chrome beacon
#

You gotta pass your plugin instance with di

#

?di

undone axleBOT
chrome beacon
#

Then use that to access the datafolder etc

trim lake
#

Gona read that thank.

young belfry
#

some one can help me?

gleaming grove
#

How can I properly generate SH1 for resourcepack?

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

torn shuttle
# gleaming grove How can I properly generate SH1 for resourcepack?

you're going to want something like this

    public static String sha1Code(File file) throws IOException, NoSuchAlgorithmException {
        FileInputStream fileInputStream = new FileInputStream(file);
        MessageDigest digest = MessageDigest.getInstance("SHA-1");
        DigestInputStream digestInputStream = new DigestInputStream(fileInputStream, digest);
        byte[] bytes = new byte[1024];
        // read all file content
        while (digestInputStream.read(bytes) > 0)
            digest = digestInputStream.getMessageDigest();
        byte[] resultByteArry = digest.digest();
        return bytesToHexString(resultByteArry);
    }

    public static String bytesToHexString(byte[] bytes) {
        StringBuilder sb = new StringBuilder();
        for (byte b : bytes) {
            int value = b & 0xFF;
            if (value < 16) {
                // if value less than 16, then it's hex String will be only
                // one character, so we need to append a character of '0'
                sb.append("0");
            }
            sb.append(Integer.toHexString(value).toUpperCase());
        }
        return sb.toString();
    }
gleaming grove
torn shuttle
#

I mean that's one use case

gleaming grove
#

so insted of file as Input I can put resourspack new url

torn shuttle
#

go read up on what sha1 is

gleaming grove
#

It just always returns same output for certain input

torn shuttle
#

that's one way to describe it

gleaming grove
#

anyway, thanks for code

torn shuttle
#

lol someone reverted my username, cowards

orchid gazelle
#

yuGamgaM

river oracle
#

Oh my its yugamgam

torn shuttle
#

has anyone ever done locality-sensitive hashing?

wispy flicker
#

Can someone help me please

Came back to my plugin after about a week break. 
Im new to packet editing and sending . could i get some help with it?
Im struggling a bit because im trying to follow guides and not getting far enough. can someone walk me through making an itemstack for an entity and help me fix a bit of my broken code```
young belfry
young belfry
hazy parrot
#

send line 6 of your utils class

#

i would assume that 1 of your getConfig().getString is returning null

young belfry
#

and it doesn't give an error

hazy parrot
hazy parrot
#

i mean

because "textToTranslate" is null

#

its null for some reason

young belfry
#

i dont see any null text

long dove
#

Aña

young belfry
hazy parrot
young belfry
hazy parrot
young belfry
wary harness
#

@last temple they should use Set insted of list

kind hatch
#

I'm running into an issue with MySQL. I am calling multiple sql queries in succession and the database connection dies out after the first query. This is crashing my test server as well. I'm not sure why this is the case as I am opening and closing the connection with each query.

vocal cloud
#

Try using a connection pool library

kind hatch
#

I am. I'm using HikariCP

subtle folio
#

You could try leaving the connection open?

#

and closing it on shutdown

kind hatch
#

I don't think I can with my current setup. Wouldn't that negate the point of try with resources? I'd have to rewrite several try blocks.

subtle folio
#

I see, never used HikariCP before. It's always given me issues.

wet breach
#

connection pool keeps however many connections open and the only thing you should be doing is letting the connection pool manager know when you are done with a connection

#

the connection pool manager will then either close the connection or keep it open depending on what is set on how many connections to keep opened

kind hatch
#

I'm under the impression that hikari will handle that on it's own so long as I use try with resources. Do I need to explicitly tell it to close the connection at the end of try catch anyways?

wet breach
#

no

#

the connection pool handles the closing of connections

#

it will only close a connection if too many are opened

#

depending on the config set

#

so you could put to allow 1000 connections, but only keep 250 idle/opened

kind hatch
#

Well, I didn't set any maximum, so it's using whatever the default is.

wet breach
#

in this manner the only time the pool will close connections for you is if it gets above 250. Also MySQL will close connections automatically as well

wet breach
#

by default I think that is either 1-2k connections

kind hatch
#

Hmmm, well I'm not sending that many requests at any given time. More like 25 at the most per person at any given second.

#

But, I'm the only one testing right now, so....

#

I'm probably doing something wrong with my code.

wet breach
#

well what happens when you are opening and closing connections too quickly is you get too many half opened connections

#

you are only allowed by the OS only so many half opened connections before it starts refusing to open more connections

#

by default in windows 10, you are only allowed 10 concurrent half opened connection

kind hatch
#

Yea, but failing after the first query? I haven't touched my mysql installation. (Whatever is included in Linux Mint by default) So I feel that something else is happening.

wet breach
#

take a look at the error logs

#

mysql has logs

#

on linux that is in /etc/logs

kind hatch
# wet breach mysql has logs

It's not that kind of mysql error. I get a Connection is not available, request timed out after 30000ms error in console and the test server just crashes and becomes a zombie process.

wet breach
#

is the server on the same host as the DB server?

kind hatch
#

Yes, everything is running on my local PC.

wet breach
#

then you have a log somewhere that will contain some errors

#

take a look in var/log/messages

#

for connection logs

vocal cloud
#

I mean have we even seen the code yet?

wet breach
#

nope, might be wise but also doubtful it is the code since they were using queries just fine

#

but never hurts to look anyways I suppose

kind hatch
#

1 sec and I'll paste the classes.

#

Gotta love it when this happens.

#

Not sure why it doesn't like that class code.

wet breach
#

or /etc/logs/

#

somewhere you should have some logs of something lmao

#

OS doesn't just start whacking connections for the fun of it, well not usually anyways

wet breach
#

make a single method that takes a query to open and close connections

#

second, its not even using the connection pool either

kind hatch
wet breach
#

you can return a resultset

#

from that method

#

second, you should make it use the connection pool

#

since you are not doing that except in the beginning when you setup the DB, but you don't refer to the datasource object after that

#

so connection pool becomes pointless as nothing is using it

kind hatch
#

I thought I was though. Everytime I call #getSQLConnection, it calls on that dataSource object.

#

Also, I found the logs, but they are tiny. They also don't really have anything that says anything about closing connections or crashing.

wet breach
#

well try changing your code where you are not trying with resources and not closing them

#

what you should add however is using commit()

#

You should allow the connection pool handle the closing

kind hatch
wet breach
#

it is ideal after you are done with a query

#

makes your query final or lets mysql know you are done and want the changes implemented

#

also, the way your initializing hikari you are not configuring it

#

or maybe I don't see it

kind hatch
#

Well, I'm not setting pool limits or anything, but here's where I do it.

wet breach
#

you don't need to set the cache stuff

#

wonder if that is where it is messing up for you

kind hatch
#

I could try it without it.

wet breach
#

never used caching from hikari, personally never used hikaric always used bonecp

kind hatch
#

Is bonecp nearly as small as hikari?

wet breach
#

its hikari's predecessor

kind hatch
#

I'm assuming it has a maven repo?

wet breach
#

yes

#

it is considered out dated too

#

but I always used it because it works and never had issues with it

#

maybe I should just make my own connection pool >>

kind hatch
#

Ok, tried without the caching and it still zombified itself.

wet breach
#

what does this do

#

if (!conn.isValid(1000)) {

kind hatch
#

That's the timeout for the connection check.

wet breach
#

also why are you calling super(plugin);

#

alright, just double checking

#

didn't know if that was the case or you were trying to open 1k connections 😂

kind hatch
wet breach
#

really don't see a reason to even use super on plugin? o.O

kind hatch
#

I need an instance of plugin to get my mysql config file.

#

Which is used for the screenshot sent eariler.

wet breach
#

Yes, you could just pass in your main class for that

#

which is more appropriate then passing in just Plugin

kind hatch
#

Oh wait, you're right.

wet breach
#

which would be acceptable if you are were expecting other plugin instances of not your own

#

but I don't think you are

#

lol

#

so my recommendation for your connection things

#
        Connection connection = mySQL.getSQLConnection();
        PreparedStatement statement = connection.prepareStatement(DELETE_PLAYER)
        PreparedStatement statement = mySQL.getSQLConnection().prepareStatement(DELETE_PLAYER);
#

just put them in a normal try-catch block

kind hatch
#

Should I also put the commit at the end of the try block? Or just try the local connection variable?

wet breach
#

you can, right now we are just trying to get it working

#

if you don't use commit inclusively, mysql will eventually do it

#

just you doing so just tells mysql you are pretty much done with those changes go ahead and do whatever you got to do lol

wet breach
kind hatch
wet breach
kind hatch
#

And those are the ones in the stacktraces, so, maybe that's my issue.

#

Look further down.

#

The rest of them just use PreparedStatements in the try with resources

wet breach
#

um

kind hatch
#

I'm fixing consistency now

wet breach
#

wait not that link again

#

ok fixed link

#

why we throwing runtimeexceptions? lol

kind hatch
#

Hell if I know. That was probably auto generated by intellij when I forgot to add the catch block.

wet breach
#

like literally any sqlexception is going to cause that to be thrown which could be as simple as you trying to go forward on a resultset that is empty

kind hatch
#

It's fixed now.

wet breach
#

inconsistencies XD

kind hatch
#

Yeaaaaa.....

#

I'm working on it

wet breach
#

I think this should really be refactored

kind hatch
#

You're probably right, but one step at a time.

shell trench
#

I'm getting this error in the console:
Could not pass event PlayerAdvancementDoneEvent

what causes this?
This is my code:

public class PlayerAdvancementDoneHandler implements Listener {
    private final Plugin plugin;

    public PlayerAdvancementDoneHandler(ItemEffectChallenge plugin){
        Bukkit.getPluginManager().registerEvents(this, plugin);
        this.plugin = plugin;
    }

    @EventHandler
    public void onPlayerAdvancementDone(PlayerAdvancementDoneEvent event){
        Advancement advancement = event.getAdvancement();
        if (advancement.getDisplay() == null) return;
        if(advancement.getDisplay().getTitle().equalsIgnoreCase("Free The End")){
            ItemEffectChallenge.getInstance().getConfig().set("timer.status", 0);

            TextComponent text = new TextComponent("\n\n\n\n");

            TextComponent seed = new TextComponent("" + event.getPlayer().getWorld().getSeed());
            seed.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText("Click to copy")));
            seed.setClickEvent(new ClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, "" + event.getPlayer().getWorld().getSeed()));

            text.addExtra("§aThe dragon was killed by§r§e§l " + event.getPlayer().getDisplayName() + "§r\n§a§nSeed:§r ");
            text.addExtra(seed);
            text.addExtra("\n§9§nTimer:§r " + ItemEffectChallenge.getInstance().timeElapsed);
            text.addExtra("\n\n\n");

            Bukkit.getServer().spigot().broadcast(text);
        }
    }
}
kind hatch
wet breach
#

nice

shell trench
#

yes

wet breach
#

ah see the issue now

#

you didn't

#

because plugin is null

#

?di

undone axleBOT
shell trench
#

from the main file

wet breach
#
      Bukkit.getPluginManager().registerEvents(this, plugin);
        this.plugin = plugin;
#

plugin is being set after registering therefore it is null at the time the code to register event is invoked

shell trench
#

It's not the only event I'm construcing like this and the others work, so why is it by this specific evenent the case?

wet breach
#

Yeah I see that now, but something is null somewhere

wet breach
#

?paste

undone axleBOT
kind hatch
kind hatch
wet breach
#

which way are you doing it? making a bunch of connection objects for no reason? or using the method that returns a connection in the preparestatement object?

#

also, probably should try without the try with resources blocks

wet breach
#

java.lang.NoSuchMethodError: 'org.bukkit.advancement.AdvancementDisplay org.bukkit.advancement.Advancement.getDisplay()'

shell trench
#

1.19

wet breach
#

using the correct java version to compile?

kind hatch
wet breach
#

the only two ways to get the error above is either using too old of a java version to compile the plugin, or you are trying to run the plugin on an older version of mc

shell trench
wet breach
#

and you still have try with resources blocks

kind hatch
wet breach
#

here you go

kind hatch
wet breach
#

so....uh without feeding a config from the gecko connections suffer

#

o.O

kind hatch
wet breach
#

instead of doing that

#

do HikariConfig config = new HikariConfig();

#

and then set all the config options first

#

then do HikariDataSource(config)

#

I am betting that the datasource object is losing the initial configs you set and since nothing calls initialize again, no way to set the configs

shell trench
kind hatch
wet breach
#

which one?

quaint mantle
#

I would like to ask if there is any good website on spigot? Which one can I just rewrite?
Template

wet breach
#

that is the first I heard about an actual SQLExecption

kind hatch
#

java.sql.SQLException: Can't call commit when autocommit=true

wet breach
kind hatch
#

Then it fuckin died

#

lol

wet breach
#

guess no need for commit thing

#

that is all it is complaining about btw

kind hatch
#

Yes, that is the first exception I have run across.

wet breach
#

oh there is more?

kind hatch
#

No, it's always ends here. Caused by: java.lang.RuntimeException: java.sql.SQLTransientConnectionException: HikariPool-2 - Connection is not available, request timed out after 30000ms.

wet breach
#

this is good news and improvement

kind hatch
#

Idk why the connection isn't there.

#

It should be handling itself.

#

I'm pretty sure I've touched hikari in the past and it didn't ever have this kind of issue.

wet breach
#
HikariConfig config = new HikariConfig();
        config.setMaximumPoolSize(20);
        config.setConnectionTimeout(120000);
        config.setLeakDetectionThreshold(300000);
#

also, I am tired, with hikaricp you should be using try with resources 😑

#

would have figured it would have handled closing automatically like bonecp did

kind hatch
#

-.-

wet breach
#

but you need to close it out with this. getConnection().close()

#

so datasource.getConnection().close()

kind hatch
#

But doesn't try with resources do that automatically so long as a connection object is put in the parentheses?

wet breach
#

it goes in the finally block

#

try catch finally

kind hatch
#

You can't access try-with-resources variables in the finally block. ;3

karmic mural
#

Anyone here tried using GitHub Copilot when making plugins? I'm interested in your experience as I am thinking of trying it out

molten hearth
#

it seems to know the bukkit api quite well

wet breach
molten hearth
#

(so well it recommends bukkit api usage when im not even using bukkit)

wet breach
kind hatch
#

Ok, lemme update the code.

wet breach
#

I think what is killing your connections is a slow query that hits the 30 second mark

#

also the not closing of connections apparently that I assumed hikari would handle

karmic mural
kind hatch
wet breach
#

might have missed a commit somewhere lol

kind hatch
#

Looks like I did. 😛

kind hatch
kind hatch
#

BUT WHY? Why does it want to work all of the sudden now?!?! beawkljatbjkaew

#

Oh well. Guess I'll finish up the implementation since it's working for now.

wet breach
kind hatch
wet breach
#

o.O

#

a connection leak?

kind hatch
wet breach
kind hatch
#

What specifically?

wet breach
#

line 154

faint cypress
#

I have a Runnable class LoadCharacterListFileRunnable extends BukkitRunnable.
It's used to load a bunch of stuff from large .csv files, do some computation and then pass the result back to the main thread. It takes approximately 2 seconds to complete, hence I run it asynchronously.
I start it to run asynchronously in 150 ticks like so:

this.characterListFileRunnable = new LoadCharacterListFileRunnable(plugin, csvFileName, false, append);
this.characterListFileRunnable.runTaskLaterAsynchronously(plugin, 150L);
// Inform admins that the operation will take place in 150 ticks.

In that time, Admins can write a command to cancel the upcoming task. I cancel it via this.characterListFileRunnable.cancel().

I wish to be able to add functionality to cancel it / stop it from executing whilst it is running asynchronously. How can I go about this?
I've found that the cancel method doesn't interrupt it.

One way I can think of is putting the callback like so:

// Inside the runnable run() method...
if (!this.isCancelled()) {
    // Run callback method
}

...However this doesn't actually cancel the async task, it only makes the callback not run so the load will have no effect.
Could I have some advice?

kind hatch
# wet breach line 154

That's my interface calling #loadDatabase(). Which for the MySQL implementation, just calls MySQL#load().

public void load() {
    Connection connection = getSQLConnection();

    try {
      Statement s = connection.createStatement();
      s.execute(createHugsDatabase);
      s.execute(createHugsDataTable);
      s.execute(createHugsPlayerdataTable);
      s.execute(createHugsPreferencesTable);
      s.execute(createHugsPreferencesSoundsTable);
      s.execute(createHugsPreferencesIndicatorsTable);
      s.close();
    } catch (SQLException e) {
      e.printStackTrace();
    }

    initialize();
  }
wet breach
kind hatch
#

Idk at this point. .-.

#

But I am closing the connection in that block.

#

It's also localized to a variable, so it shouldn't be causing any issues.

wet breach
#

what does initialize do?

kind hatch
#

This is from the SQLDatabase class.

public void initialize() {
    connection = getSQLConnection();
    try {
      PreparedStatement ps = connection.prepareStatement("SELECT * FROM " + table /*+ " WHERE uuid = ?"*/);
      ResultSet rs = ps.executeQuery();
      close(ps, rs);

    } catch (SQLException ex) {
      plugin.getLogger().log(Level.SEVERE, "Unable to retrieve connection", ex);
    }
  }
wet breach
#

what dose close do?

kind hatch
#
public void close(PreparedStatement ps, ResultSet rs) {
    try {
      if (ps != null)  ps.close();
      if (rs != null)  rs.close();
    } catch (SQLException ex) {
      Error.close(plugin, ex);
    }
  }
wet breach
#

not sure why that warranted its own method for doing?

kind hatch
#

I made this a long time ago. I was going to originally start working with MySQL, but started with SQLite instead.

tardy delta
#

Dunno how to remove embed on phone lol

kind hatch
#

Put it in <>

tardy delta
#

Lol

wet breach
kind hatch
wet breach
#

for whatever reason it complains about the connection at first in mysql class and then comes back and complains about the load method in general in that stack trace

tardy delta
#

<Insert try with resources here>

kind hatch
#

Already have that setup

wet breach
#

well not everywhere

#

as we just discovered lol

kind hatch
#

It is now.

#

Feel free to check

tardy delta
#

What's even the dif between statement st = conn.preparestatement(); statement.exec(sql stuff) and statement st = conn.preparestatement(sql stuff); st.exex()?

wet breach
#

it doesn't really make sense to me

#

try removing config.setLeakDetectionThreshold(300000); then

#

and see if it still complains about leaks

kind hatch
kind hatch
wet breach
#

you are not closing the connection in those places

#

now that I see

#

you are closing the statement but not the connection

#

try invoking close on the connection 🙂

kind hatch
#

I mean, I'm including a local connection variable in the try with resources so it should be closed once it finishes. If I close it first without closing the statement first, I'll likely get an error because of the order in which they are declared in the block.

wet breach
#

and what you have said and provided, if you have since changed it then it shouldn't be an issue anymore

#

but all those lines in the stacktrace that refer to your plugin all point to methods that didn't have try with resources

#

and never called closed on the connection

kind hatch
#

Look. That stacktrace was using try-with-resources.

#

Which is why it concerns me.

wet breach
#

public void initialize() {
connection = getSQLConnection();

#

that isn't a try with resources

#

public void load() {
Connection connection = getSQLConnection();

#

these are all lines from the stack trace

#

initialize from the onEnable()

#

load from the MySQL.load()

#

the only thing I don't see you doing with those connections other then they are not try with resources, is closing the connections

#

just the statements

kind hatch
#

Alright, let me switch those over real quick.

#

I'll also reenable that config flag to see if it'll pop up again.

wet breach
#

might be wise as that detects when connections are not being closed

kind hatch
#

Ok, I have yet to see that error. I'm spamming the menus like I did before, but it has yet to show up.

kind hatch
#

I spoke too soon.... 🥲

wet breach
#

hmmm

#

might have missed a spot or two maybe?

kind hatch
#

Would not executing a query cause it to linger? Even if it's in a try-with-resources?

#

Cause I thought I noticed one of them not sending the execute command.

tardy delta
#

Throw your pc out of the window

#

Fixes everything

kind hatch
#

Ok, I've checked everything and there was only one query that didn't get an execute call on it. If that's not it. Idk what the issue is.

wet breach
kind hatch
#

That's what I would have thought/expected.

wet breach
#

I guess we will find out

#

the only other thing I can think of is that the leakdetection is set too low possibly

#

or for some reason just have this really slow query

kind hatch
#

Nope. I just did the exact same thing and it no longer shows up. This is bullshit. That goes against what try-with-resources is supposed to do.

wet breach
#

lol

#

well it probably did try

#

with the resources you gave it

#

but it failed

kind hatch
#

Maybe, but at least now I'm getting actual SQL errors because my impl is incomplete.

#

I have a feeling that I'm gonna have to rewrite this anyways. However, that's a problem for another day. At least it looks like it's working properly now.

#

Anyways, thanks for the help once again @wet breach.

#

Ima take a break.

twilit roost
#

can I make FallingBlock not despawn/break after some time?

glossy venture
#

if i had a function

public CompletableFuture<A> a() {
  // do stuff async
}

and wanted to make a function b with a completable future with a different (or the same) return type, but with a pre set function for completion, like this:

public CompletableFuture<B> b() {
  return a().<some function>((result, throwable) -> {
    // do something which (important!) returns B instead of A
    // and is always done when complete even when another when complete
    // is registered
  });
}

how would i do that? i would use it in function c like

public void c() {
  b().whenComplete((b, throwable) -> {
    // do more shit
  });
}
tardy delta
#

return a().whenComplete((result, throwable) -> this.handle())

#

?

orchid gazelle
#

hello. how do I make nms Shulkers invisible?
#setInvisible does not do anything

glossy venture
#

nah i basically want a pipeline like

Future<A> -> whenComplete: do something A -> B -> Future<B>
``` and then i can do `.whenComplete` on the B future
#

maybe thenApply

#

but theres no docs

ivory sleet
#

thenApply and whenComplete are not that different

#

just applying different types of functional interfaces once the result is completed basically

tardy delta
#

im confused what you actually want to do

glossy venture
tardy delta
#

you want a mapper to map to a B type?

glossy venture
#

but with a CompleteableFuture

tardy delta
#

forgot that existed

#

maybe thats what you want?

glossy venture
#

i think

tardy delta
#

like ```java
T get();

CompletableFuture<U> f = CompletableFuture.supply(this::get).thenApply(U::cast)```

glossy venture
#

yeah

#

aight

#

htnaks

#

thanks

tardy delta
#

had to work too much with arrays today

#

i was like: just dont use an array for this but teacher was like no no no

worldly ingot
#

Yeah. University professors tend to have a hardon for arrays

tardy delta
#

also we may not use break or continue 🤔

molten hearth
#

Least insane university teacher

tender shard
#

does anyone know how my build.gradle is supposed to look like to imitate this?

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <minimizeJar>true</minimizeJar>
                    <relocations>
                        <relocation>
                            <pattern>com.jeff_media.jefflib</pattern>
                            <shadedPattern>me.username.jefflib</shadedPattern>
                        </relocation>
                    </relocations>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludeDefaults>false</excludeDefaults>
                            <includes>
                                <include>com/jeff_media/jefflib/internal/nms/**</include>
                            </includes>
                        </filter>
                    </filters>
                </configuration>
            </plugin>
molten hearth
#

I had a teacher do that in high school but in university I can code freely

tender shard
#

but how am I going to declare the relocations

#

the filters

#

the minimizeJar

#

I'd like to translate exactly what I sent into a build.gradle file

tender shard
#

yeah I don't really get it

#

everytime they declare one tiny option in a shadowJar { block

#

am I supposed to have twenty different ones, or can this all go into one?

vale ember
#

all go into the same shadowJar {

tender shard
#

ok thx I'll try

vale ember
#

np

tender shard
#

hm but wait

#

it says the "include" statement uses the Ant Path Matcher syntax

#

but in the examples it only uses class names, not directory names?

#

would this include ALL classes that have "nms" in their package namy ANYWHERE?

relocate('com.jeff_media.jefflib', 'me.username.jefflib') {
    include '**/nms/**'
}
river oracle
#

Gradle? Whats gotten into you alex ? Drink a little too much?

tender shard
#

nah it's just people kept complaining there's no gradle dependency information for jefflib

#

apparently everyone who tried use it with gradle also has no clue about how to configure shadowJar

river oracle
#

Imagine using gradle with spigot tho

tender shard
#

imagine claiming gradle is better but not knowing how to translate a pom.xml to a build.gradle file

vale ember
river oracle
#

I just use maven cuz it's easier for spigot stuff

#

If you don't agree your just high

next plume
#

I love it when you compile a plugin with gradlew build, gradle spits out screens and screens full of warnings, then says BUILD SUCCESSFUL.

#

Maybe you should address some of the 500 warnings?

river oracle
#

Reminds me of npm lol

#

Npm 500 severe errors! Ok your good to go 👍🏽

vale ember
vale ember
tender shard
#

but that would only match classes, not files

#

I need to include stuff by their file name

#

I'll just try it

tardy delta
next plume
tender shard
#

ugh wtf

#
FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\mfnal\IdeaProjects\JeffLib\Example-Plugin\build.gradle' line: 29

* What went wrong:
A problem occurred evaluating root project 'JeffLib-Example-Plugin'.
> Could not find method publishing() for arguments [build_5z7wdei1cs569b04p6dcebaew$_run_closure3@765d9ffa] on root project 'JeffLib-Example-Plugin' of type org.gradle.api.Project.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
#

gradle init created that block itself?

#

ok I just removed the publishing section. now when I run gradle build, all I get is an empty .jar file (with only a META-INF folder).

Here's my build.gradle:

#

?paste

undone axleBOT
tender shard
#

note: my project is indeed empty, but why didn't the shadow plugin shade anything?

#

nvm I am stupid

#

gradle init ignored all the dependencies and repositories from my pom.xml

#

wtf

river oracle
#

You should give up and tell the gradle users to get good 👍🏼

molten hearth
#

I went to high school then college then uni

#

But college was just 2 years kinda weird

river oracle
#

Highschool sucks I hope it gets better

tardy delta
#

college three years for me

molten hearth
#

I also only went for 1 uear

#

year

#

And they gave me a diploma lol

river oracle
#

College is going to be 3 years for me I already finished my first year of cs

tender shard
next plume
#

I went to an "Institute".

minor fox
river oracle
#

Who knows

#

Probably

tender shard
#

gradle jar also doesn't shade anything. what even is the difference?

#

from what I see, "build" isn't even a default task type, and I also didn't define it, so why does it not fail in the first place? o0

shell trench
#

How can I get the amount a player has killed a mob?
My idea is ti use the inbuild stats.

tender shard
orchid gazelle
#

oh its the Jägermeister guy hello wassup

tender shard
orchid gazelle
#

yeah

#

good that im using maven lol

tender shard
#

me too but I need gradle for this one time

#

thank god my bf is at least cooking sth lol

orchid gazelle
#

ohh thats sad

shell trench
orchid gazelle
#

and smh I cannot make shulkers invisible

#

but I want them to be invisible

tender shard
#

fr shadowJar is a joke, it doesn't even do anything when running any default tasks, and why the "build" exists, nobody knows, because it's not in the list of official "builtin" tasks

#

so I now found out that you have to run gradle shadowJar but the relocate { ... } option does exactly nothing

quaint mantle
#

how do i start coding in my server ? i have found a skript plugin but its not 1.19 so how do i do ?

tender shard
quaint mantle
#

yep

#

i know how to use plugins but not code skripts

#

i want to code because i have not found a plugin that i am looking for

tender shard
#

do you know at least basic java?

#

or kotlin

tardy delta
#

bet not

worldly ingot
#

tasks.build.dependsOn = tasks.shadowJar or something like that. I always forget the syntax because it changes every Gradle release

tender shard
#

ok thanks, I still wonder where exactly the build task is actually explained, because the official documentation does not mention it at all

#

I meanwhile just got shading working by running shadowJar but it completely ignores my relocate settings

#

I did it exactly like explained in the docs :/

#

shading works, minimizing works, but it still puts those classes into com.jeff_media instead of me.username

tender shard
worldly ingot
#

I think the issue is your include statement, because I only do relocate 'org.bstats', 'wtf.choco.veinminer.metrics' and it works totally fine

worldly ingot
#

Changes every major Gradle release PES_CryHands

tender shard
worldly ingot
#

But yeah I'm using that too in Gradle 7, tasks.build.dependsOn tasks.shadowJar lol

#

I thought there was an =

tender shard
#

this gives me a 1 kb .jar file

tender shard
# tender shard

this gives me a 93kb jar, as expected, but with original package names

#

moving "include" before "relocate" doesn't change anything btw

worldly ingot
#

Yeah but I'm wondering if it's only relocating your com/jeff_media/jefflib/internal/nms/** packages into the new me.username.jefflib package

#

Everything not matching that is the default package

#

(I'm guessing. Again, I hate Gradle as much as you do rn)

tender shard
#

everything else is gone because of minimize

#

:/

worldly ingot
#

oic

tender shard
#

in maven I just add a filter to include the NMS classes, then add a totally normal relocation section. The syntax I currently use, where "include" is INSIDE the relocate block, is from th eofficial docs D:

#

well from the docs of the shadow plugin

tardy delta
tender shard
#

I also tried moving "minimize()" above "include()" but that also doesn't change anything

minor garnet
#
            long now = System.nanoTime();
            float delta = (float)(now - this.lastSim) / (float) TimeUnit.SECONDS.toNanos(1L);      

            plugin.sendMessage("lastClick: " + delta);
            
            if (lastClick > .19f && lastClick < .21f) {
                state = State.HOLDING;
                plugin.sendMessage("holding");

            
            } else {
                plugin.sendMessage("click");
                state = State.CLICK;
            }
            lastSim = now;``` 
why ????
tender shard
#

why what?

#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

minor garnet
#

0.19523.. > 0.19 and 0.19523... < 0.21

state must be Holding but is setting to Click, am i doing something wrong?

tender shard
#

where does that "e mener" print come from?

#

this doesn't seem to be your full code

minor garnet