#help-development
1 messages · Page 250 of 1
If you design it right, you can have this. Discord has such a thing where you can designate a channel as NSFW
Well could be possible if they redesigned their already existing systems
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)
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
That isn't it at all. You can believe that if you want. But they already have a large user base thus forcing those on java version over really won't make much difference
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
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.
If you have java, you should not care about bedrock
if you have java no one forces you to care about bedrock
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.
Yeah but players that have no idea about the game tend to start bedrock and then never go to the good minecraft
-> they are sending more players to bedrock
you are not the authority on which one is the "good" minecraft, and as a java player this does not affect your gameplay experience
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.
Of course it does. When you have a garbage house with no water, you still would want a good house lol
what the hell are you even talking about
if you are a java player your java experience has not been materially affected by bedrock
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
well how do I feel offended by mojang then?
I have anxiety that they keep on bringing "bad" things
because you drank the tribalism koolaid and can't even articulate what about bedrock makes you mad
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
there are valid criticisms of bedrock but you can't even formulate a single legitimate reason as to why it upsets you
Yeah sure but im talking about how java gets ruined by mojang with their bedrock stuff
Not about their target players
In what way? As it stands the java version still has more features then bedrock does
what about java got ruined by bedrock
name one thing
For example microsoft pulling players away from java, and pushing down the growth of the java playerbasw
you have crossplay systems, and this does not affect the existing java experience
They are indirectly pushing down the growth of the playerbase by their combination of bedrock and java for example
(The java+bedrock pack)
Of course it does. Less players playing the game = less players I can play with = less content getting created
You do realize some of us received bedrock for free just because we had java version.
Yes
you are complaining about the future java experience
Yes
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
Everyone already knows at some point java version won't be maintained forever. However that doesn't mean the community won't maintain it
Yeah but I can still complain about them pulling down the playerbase predictively lol
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
Java version will continue to exist and be maintained so as long there is a community for it
Yeah "as long as there is a community"
What are they doing? Trying to get players away from java lol
class main string args public void main
WHY DID NOTCH MAKE MINECRAFT IN JAVA
?
Makes no sense to maintain something if no community exists for it anymore. That is just waste of time and money
It was the language he knew and was comfortable with
😭
Beside he never intended for mc to be commercialized
wait what
you keep saying two diametrically opposed things, "pulling down the community" by just moving the community to bedrock
seems like the community would just be moving
Its the same thing
It became popular from a game forums as more people became interested in it. Mc was free at the beginning
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
Then notch made a company and sold it cheaply and then it grew from there
lol I wish I could sell my company cheaply like notch
Same
hey frost I got a cheap company to sell you
The original intent though wasn't to commercialize but as more people wanted it and more features that was the only sensible route
I wish I had one 😂
That wasnt what I meant. I meant the game was sold cheaply
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
this might shock you but no game lasts forever
But also has partwise-fault of micro$
i call dibs
Not really
20 bucks
mc has already had a better staying power than 99.99% of games out there
And continues to do so
Less players to play Java = less players to play on server xy
you can count how many games have had this kind of staying power in one hand
How is this conversation even remotely related to Spigot or Bungeecord development?
Uhmmm
Shhht
You are blaming Microsoft on the decision of server owners. When Microsoft never forced them to do anything
WoW, Runescape, Minecraft
Well the owners do not have full fault on that
I would have a hard time listing more
They are closing because of low player count
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
Because I know tons of people that stopped to play
They don't make up the majority
But they give me an overview
even before bedrock was a thing
I can see how many players are leaving and how many are joining other servers
did mc die 9 years ago, I remember a ton of people stopping back then
The joining other servers part is at about 0
Because you run all the servers in the world?
No, but I have the ability to socialize
Not with the majority.
Studies also do not research on 8 billion people lol
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
They can still see what happens for 50k tho
And less people enter because of the marketing and dev of minecraft
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
Oh cmon how am I supposed to argue against that
I cannot proof any number
yeah, I know you can't
But you can simply see that it happens
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
we have the numbers
In german, there is a difference between "Tatsache" and "Fact"
This is a Tatsache lol
and we probably have way more time in the mc space than you do
However this is a normal drop that happens every year
at least I don't think very many people have been on here longer than I have
Because Christmas and all that
Never said the total numbers are decreasing
except, of course, when you did
Yes, less people enter than they would with other marketing + dev
The stats above tracks active players btw
It is meant like that
so people are leaving, and new players aren't coming in
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
And new players tend to only play survival
So the server scene is getting dropped, at least where I live
so now the enemy is survival
No
I should've known it, mojang is ruining minecraft by making it a survival game
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
those devious bastards, we need to go back to the classic browser edition
they are RUINING my game
The browser edition holds a special place in my heart
No it is also that server owners have fault for it, but not full fault
I remember a server that had a bunch of pixel art underwater
So far everything you been complaining about can be attributed to terrible server owners
remember the browser edition servers that had the lava flood maps
Cmon guys don't joke on me I cannot defend with frozen fingers on my touchscreen while walking
those were the days
All it took was 1 prick with lava
No, the growth of minecraft java is less than it would be with good java marketing and dev
brave words
Not it reached its peak long time ago
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
Even better, a gorillion dollars
they should etch the minecraft icon on the moon so everyone gets to see the ad
Ok at this point I gotta go, school is starting
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
And in comparison with other popular games Minecraft still has one of the largest player bases with java version alone
there's only 238 million cumulative sales in 2021
not even close to 1 bil
At not there yet then still couple hundred mil lol
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
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
just for scale here, they are running laps around the second most sold game which was gta 5
at 170mil
Yep
tetris is at 100mil, and that's the last game over that three digit million mark
But anyways point still stands though we are getting a routine influx of new players
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
Yep
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)
They probably would have if they weren't trying to screw over unofficial wow servers all the time lol
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
That is only true because blizzard refuses to accept or incorporate the unofficial servers
Where as Mojang welcomed it
mojang doesn't charge subscriptions
They could easily do what Mojang does with Bedrock and have unofficial servers but server-authenticated paid cosmetics
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
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
the only way that works is if they drop subs and go free to play
which won't happen
Not true, they could have moved the cost from player subs to server subs instead
Charging for a license to run a server? Yes it does work and many applications and games still do it
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?
No
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
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
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
I never said making up anything. They will lose a player regardless.
then they won't do it, why would they
And hence wow will continue to diminish on being popular
And they will continue to lose subs to free servers
because you aren't taking a strategy that will result in player loss?
and they will continue to take down free servers because they're sapping their userbase...
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
They havent
there are no big free WoW servers out there
They didn't sue no 7bil people nor do they have the resources to do so
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);
}
7 bil people didn't make free WoW servers...
Anybody got any idea why? Its a yaml file, i created a class to store and read player data using yaml files.
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
They don't. You obviously don't know the costs in the US alone
the highest profile takedown I know of was nostalrius. They probably paid some lawyer 1k to write a takedown notice.
Your configuration section is invalid. Meaning it cannot get it. Double check you're using the right name for the configuration section you have in the file
They probably paid more then that. As they keep lawyers on retainer. But lawsuits are expensive. But take down notices doesn't stop other people from propping up a server
How do configuration sections work?
has blizzard ever sued a server to take it down
All I did was search it up and assumed it works as the same format as a yaml file.
Yes
who
so not world of warcraft
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
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
This is why Microsoft doesn't try to sue everyone or any large corporation because they will lose more then what they will gain
I can't even find a lawsuit for pvpgn
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
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.
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
(hiding my userid as i keep my acc private):
Money: 0
DailyLot: 12345678
Crates:
RareCrate: 0
LegendaryCrate: 0
CommonCrate: 0
Tags:
- None
It's not free as they have to pay someone to do it.
here is what mine looks like
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
@jagged monolith Wait im an idiot.
Interns are not lawyers that can act on behalf of a corporation in the US
That would do it.
you think blizzard can't afford to keep 1 lawyer on payroll?
wut
Never said that. Just said it wasn't free for them
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
It's called a retainer and they contract with a firm so yes it is full time
But priorities you know
I have no idea of why you don't think the multibillion dollar company activision-blizzard doesn't have its own multiple legal departments but they do
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
Seems like full time to me regardless. No one with 7+ years is going to only work part time or at part time wages
Interns are not lawyers so in the US no
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.
you understand that lawyers have their own internship systems right
Sure doesn't mean they bypass the laws either
I think they're called associate lawyers
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
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
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.
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
They would have the loss regardless
no they wouldn't
Oh guess the players stay forever
we are talking about WoW right
But the servers paying a fee is still a steady stream of revenue
And they continue to lose players as far as I can see
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
I never said that
Who cares
Go in another chat you’re flooding this one
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
Woffling about stuff that has nothing to do with ‘help-development’
No one needs help currently
Doesn’t matter go in general
Well unless staff says otherwise we are fine
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
Well you are not staff and you are the only one complaining currently
Last I recalled you were the one that is. I didn't forget our last interaction at the beginning of the year
I joined in sept 18th, delusional and annoying. I won’t respond anymore if you have something to say dm me
No thanks.
are we just making shit up today, what the hell is up with people
or is that the join date for discord?
can't you just leave and rejoin?
Probably yeah
or does it still log the first join date
Not sure tbh
They left and rejoined
They?
I’m one person and im a guy lmfao
What the heck is this dude on about bruh my brain
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
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
But the reason I have them blocked is because they wanted to complain that I wouldnt dm them and continued to chat here
I remember it being about genders
Ah that was you? Entitled gender fluid guy
talking about pronouns you should probably learn how they work
"they" is no necessarily plural
Anyways cya later. Until next time magmaguy
Are you a toxic child
💀
Why you keep saying they😂😂
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
Yeah
Whats ur point
This channels full of confused children
Guys theres only 2 genders
you're entitled and you're very dumb
if you were to take an english class, they can also refer to singular and plural
they doesn't refer to a gender
Yes it does now
it does not
"they" is genderless numbnuts
Your generation made it refer to a ‘gender’
it doesn't imply any gender
some people simply do not wish to be identified as a male or a female so they prefer to be called they or them
.
I know it isnt
it just means you do not want to be associated with a gender
Dont call me they im a boy
and if you took an english class, it also can refer to a singular person
Girls are girls boys are boys, if i were to say they i would be talking about more than 1 person
that's not how the english language works
I know
https://www.merriam-webster.com/dictionary/they learn english you moron
maybe you should learn english
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
I can type in japanese, that doesn't mean I know every japanese word
look at the second one
I know
this is some genuinely stupid shit going on here
You are missing the point im making
No you are
So much for this being a Spigot & Bungeecord Development help channel... This convo is more suited for dms or #general really.
i agree
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
that is my bad
what do you need help on
you can always take a look at how resource packs work
they're in json
that's an example of gson
very simple usage
Thanks
another example of gson from ashcon json object to ashcon java object
as for simplejson
mmmh http json my favorite
How did you change your name?
Wait a minute how did he
it changed quite a while ago
probably paid
oh it just changed back when I clicked his profile
Discordjank
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.
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
hey, if anybody here is experienced with multimodule maven projects, please take a look at this thread: https://www.spigotmc.org/threads/attemping-multi-moduling-no-intellisense.581251/
what is the string array keyword in SQL im trying to store some array data's inside the player but cannot find it
varchar(SIZE)
and then will it work if i use setArray method in jdbc?
Uhh, wait. I thought you were talking about a normal string. You mean a List<String> or String[]?
exactly
ik i can store it as string but uh im looking for a better way if exists
Usually there is no sort of array storage implemented in databases
You should probably encode the string array and store it as a string
ah so there is no way else than this aight ty
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
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
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
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
?paste
please upload the code here please
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
hmm
are you using bungeecord or spigot
bungee
yes thats why
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
Like just a file with one message per line? or what
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Im getting error with that code
?jd
This is not working to. Getting errors
What error
Wtf... Its working but only in main class? I tried make class and put that code in and trows errors
send the error
Do i need implement something? Sorry for stupid questions
;/
?paste the whole class
prob a bracket error
Yeah those are methods in your plugin instance
You gotta pass your plugin instance with di
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Then use that to access the datafolder etc
Gona read that thank.
some one can help me?
How can I properly generate SH1 for resourcepack?
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!
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();
}
this hash is only to check if resourcepack content has been changed right?
I mean that's one use case
so insted of file as Input I can put resourspack new url
go read up on what sha1 is
It just always returns same output for certain input
that's one way to describe it
anyway, thanks for code
lol someone reverted my username, cowards
yuGamgaM
Oh my its yugamgam
has anyone ever done locality-sensitive hashing?
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```
can some one help me with this?
Caused by: java.lang.NullPointerException: Cannot invoke "String.toCharArray()" because "textToTranslate" is null
send line 6 of your utils class
i would assume that 1 of your getConfig().getString is returning null
probably the problem is in the config because I used that class in all classes
and it doesn't give an error
Yeah you maybe dont have some field in config you are trying to getString from
Bruh the config is ok
i dont see any null text
Aña
what is line 45 of CommandFly class
flyList.add(player);
wouldn't say so tbh
I understand, I recreate the class
@last temple they should use Set insted of list
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.
Try using a connection pool library
I am. I'm using HikariCP
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.
I see, never used HikariCP before. It's always given me issues.
you should instead let hikaricp handle the closing of connections, it is the whole purpose of a connection pool
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
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?
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
Well, I didn't set any maximum, so it's using whatever the default is.
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
maximum is whatever you configured mysql
by default I think that is either 1-2k connections
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.
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
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.
.
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.
is the server on the same host as the DB server?
Yes, everything is running on my local PC.
then you have a log somewhere that will contain some errors
take a look in var/log/messages
for connection logs
I mean have we even seen the code yet?
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
This folder doesn't exist for me.
1 sec and I'll paste the classes.
Gotta love it when this happens.
Not sure why it doesn't like that class code.
Ok, here's the code.
The MySQL class that handles the hikari stuff: https://pastebin.com/meeYCF79
The implementation: https://paste.md-5.net/ixiseseteg.java
Had to use pastebin because both md_5 paste and hastebin didn't like the entire class.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
try /etc/mysql/logs
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
instead of each method opening and closing its own connection
make a single method that takes a query to open and close connections
second, its not even using the connection pool either
I think I tried that at one point, but it didn't work out because you need an open connection to access a ResultSet.
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
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.
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
Do I need to put that in every single method?
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
Well, I'm not setting pool limits or anything, but here's where I do it.
you don't need to set the cache stuff
wonder if that is where it is messing up for you
I could try it without it.
never used caching from hikari, personally never used hikaric always used bonecp
Is bonecp nearly as small as hikari?
its hikari's predecessor
I'm assuming it has a maven repo?
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 >>
Ok, tried without the caching and it still zombified itself.
That's the timeout for the connection check.
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 😂
Because the MySQL class is extending another class called SQLDatabase. https://paste.md-5.net/ojasuvikuj.java
really don't see a reason to even use super on plugin? o.O
I need an instance of plugin to get my mysql config file.
Which is used for the screenshot sent eariler.
Yes, you could just pass in your main class for that
which is more appropriate then passing in just Plugin
Oh wait, you're right.
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
I'll try the first one, considering I'm already using the second one. Give me a few
Should I also put the commit at the end of the try block? Or just try the local connection variable?
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
don't you mean the second one? since you have it like the first?
Most of them are like the second one.
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
I'm fixing consistency now
Hell if I know. That was probably auto generated by intellij when I forgot to add the catch block.
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
It's fixed now.
I think this should really be refactored
You're probably right, but one step at a time.
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);
}
}
}
CONSISTENCY RESTORED!
https://paste.md-5.net/wisofaxebe.java
nice
did you register the event?
yes
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
new PlayerAdvancementDoneHandler(this);
from the main file
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
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?
Yeah I see that now, but something is null somewhere
can you paste the stacktrace
?paste
So, this sorta worked. I was able to click in the menus for a little bit, but then it quickly reverted to its old ways.
What about it?
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
java.lang.NoSuchMethodError: 'org.bukkit.advancement.AdvancementDisplay org.bukkit.advancement.Advancement.getDisplay()'
1.19
using the correct java version to compile?
Wdym? They are all normal try catch blocks now. :33
Also, probably the latter as that #getSQLConnection method returns dataSource.getConnection()
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
I'm trying to run the pluggin on a 1.19 server and it was also written for 1.19
then you should remove everywhere you have Connection connection then
and you still have try with resources blocks
That's what I had before and it still crashed. Just faster
I knew it
here you go
Ok, all try with resources blocks are gone.
But... I do that! >.<
In the MySQL class constructor. I declare the HikariDataSource, then I update the values right after in the #initializeValues() method.
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
I found the problem but don't know how to fix it.
Some Advancements doesn't seem to have a .getDisplay() function(but some have)
Is there a better way to chck if an advancement is a specific advencement?
I currently do
advancement.getDisplay().getTitle().equalsIgnoreCase("Free The End")
Nope, I got another SQL exception, but it ultimately killed itself. Yet another zombie I had to put down.
which one?
I would like to ask if there is any good website on spigot? Which one can I just rewrite?
Template
that is the first I heard about an actual SQLExecption
java.sql.SQLException: Can't call commit when autocommit=true
oh nice, guess mysql does this by default now
Yes, that is the first exception I have run across.
oh there is more?
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.
this is good news and improvement
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.
try this
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
-.-
but you need to close it out with this. getConnection().close()
so datasource.getConnection().close()
But doesn't try with resources do that automatically so long as a connection object is put in the parentheses?
You can't access try-with-resources variables in the finally block. ;3
Anyone here tried using GitHub Copilot when making plugins? I'm interested in your experience as I am thinking of trying it out
don't need to?
works great for me
it seems to know the bukkit api quite well
we will go with your way
(so well it recommends bukkit api usage when im not even using bukkit)
and then also use the config example I have above
Ok, lemme update the code.
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
Awesome. Thank you for your feedback, will definitely give it a try!
Uhhhh. This makes no sense to me. It was working for a second, then it spammed Can't call commit when autocommit=true when I tried to enter a menu. Then it hard crashed about a minute later.
might have missed a commit somewhere lol
Looks like I did. 😛
I guess it's working now? Idfk at this point. I'm spamming the menus and I haven't crashed yet, so it looks promising.
woo finally
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.
just remember to save a copy of your code to use later with hikari 😄
Hold up. I actually got an error.
java.lang.Exception: Apparent connection leak detected
its in your onenable?
What specifically?
line 154
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?
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();
}
how come this doesn't have a try with resources?
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.
what does initialize do?
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);
}
}
what dose close do?
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);
}
}
not sure why that warranted its own method for doing?
I made this a long time ago. I was going to originally start working with MySQL, but started with SQLite instead.
Lil less bloat code to interact with a database https://github.com/FourteenBrush/xKingdoms/blob/master/src/main/java/me/fourteendoggo/xkingdoms/storage/persistence/impl/SqlitePersistenceHandler.java
Dunno how to remove embed on phone lol
Put it in <>
Lol
you don't have something recursively referring back to load?
No, it only ever gets called once, and that's on startup.
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
<Insert try with resources here>
Already have that setup
What's even the dif between statement st = conn.preparestatement(); statement.exec(sql stuff) and statement st = conn.preparestatement(sql stuff); st.exex()?
it doesn't really make sense to me
try removing config.setLeakDetectionThreshold(300000); then
and see if it still complains about leaks
I have to do it in that order because normal SQL syntax doesn't like the ? character. So I need to set the variables first and then execute the query so that it looks like a normal query went through.
It probably won't as it wasn't doing it before, but it worries me that something is still wrong here.
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 🙂
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.
I am going based off the stacktrace
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
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
Alright, let me switch those over real quick.
I'll also reenable that config flag to see if it'll pop up again.
might be wise as that detects when connections are not being closed
Ok, I have yet to see that error. I'm spamming the menus like I did before, but it has yet to show up.
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.
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.
possibly, but I mean if you close the connection it shouldn't cause an issue I don't think
That's what I would have thought/expected.
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
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.
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.
can I make FallingBlock not despawn/break after some time?
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
});
}
hello. how do I make nms Shulkers invisible?
#setInvisible does not do anything
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
thenApply and whenComplete are not that different
just applying different types of functional interfaces once the result is completed basically
im confused what you actually want to do
basically like Stream<A>.map() -> Stream<B>
you want a mapper to map to a B type?
but with a CompleteableFuture
i think
like ```java
T get();
CompletableFuture<U> f = CompletableFuture.supply(this::get).thenApply(U::cast)```
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
Yeah. University professors tend to have a hardon for arrays
also we may not use break or continue 🤔
Least insane university teacher
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>
I had a teacher do that in high school but in university I can code freely
using shadowJar?
yeah
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
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?
all go into the same shadowJar {
ok thx I'll try
np
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/**'
}
Gradle? Whats gotten into you alex ? Drink a little too much?
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
Imagine using gradle with spigot tho
imagine claiming gradle is better but not knowing how to translate a pom.xml to a build.gradle file
gradle ❤️
I just use maven cuz it's easier for spigot stuff
If you don't agree your just high
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?
i guess you could do ```groovy
include 'com/jeff_media/jefflib/nms/**'
Well warnings are warnings for a reason: they're not critical, so your app can still work. Do you propose build to fail on every warning? What would be the difference of warning and error then?
hm but I wonder, because in their example they use it like this
com.jeff_media.jefflib.nms.*
but that would only match classes, not files
I need to include stuff by their file name
I'll just try it
idk its not university, i believe the english word is college
What's the point of having warnings if you just ignore them all?
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
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
You should give up and tell the gradle users to get good 👍🏼
fake word
I went to high school then college then uni
But college was just 2 years kinda weird
Highschool sucks I hope it gets better
college three years for me
College is going to be 3 years for me I already finished my first year of cs
but I also wanna know how it works out of curiosity lol
I went to an "Institute".
does anyone know why gradle build still doesn't shade anything? https://paste.md-5.net/ujulonobax.cs
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
How can I get the amount a player has killed a mob?
My idea is ti use the inbuild stats.
//push
player.getStatistic(Statistic.MOB_KILLS);```
oh its the Jägermeister guy hello wassup
I'm angry at gradle because shadowJar is a shit plugin
me too but I need gradle for this one time
thank god my bf is at least cooking sth lol
ohh thats sad
and for a specific mob?
If I want for example get the ammount of zobies killed?
player.getStatistic(Statistic.MOB_KILLS, EntityType.ALLAY);
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
how do i start coding in my server ? i have found a skript plugin but its not 1.19 so how do i do ?
it simply uses the original package names
coding in your server?
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
bet not
You can make build depend on the shadowJar task so that it's run automatically when you build
tasks.build.dependsOn = tasks.shadowJar or something like that. I always forget the syntax because it changes every Gradle release
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
(btw in gradle 7 it seems to be tasks.build.dependsOn(tasks.shadowJar))
I think the issue is your include statement, because I only do relocate 'org.bstats', 'wtf.choco.veinminer.metrics' and it works totally fine
SEE WHAT I MEAN!?
Changes every major Gradle release 
when I do that, it doesn't shade anything at all
But yeah I'm using that too in Gradle 7, tasks.build.dependsOn tasks.shadowJar lol
I thought there was an =
this gives me a 1 kb .jar file
this gives me a 93kb jar, as expected, but with original package names
moving "include" before "relocate" doesn't change anything btw
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)
the include part is the only thing it includes anyway
everything else is gone because of minimize
:/
oic
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
tf
I also tried moving "minimize()" above "include()" but that also doesn't change anything
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 ????
"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.
0.19523.. > 0.19 and 0.19523... < 0.21
state must be Holding but is setting to Click, am i doing something wrong?
nvm this was another debug checking if the value was greater or less
