#help-development
1 messages · Page 374 of 1
p.setVelocity(p.getLocation().getDirection().multiply(1).setY(5));
I use this method to modify the velocity of player p, but even though i set the Y-value to 5 (which should be a strong force) the player only seems to be launched forwards? Any ideas?
Try mvn clean maybe
I'm trying to do everything without using NMS I'm afraid, but thank you anyway!
You should just run this to confirm my thoughts, as I cannot reproduce your issue. Have you solved it already?
According to my conducted experiments as well as this excerpt from the client's code, fireworks will always play a sound, no matter if silent or not. So it looks like you're not going to change that, :/.
I don’t actually have any nms even imported/available for my project so I can’t test it
How can I save a second file from my jar onto the plugin folder?
saveDefaultConfig() only saves config.yml
I want to also save
new.yml
You said you're running on 1.19.2, right? Are you running spigot or paper?
Spigot
JavaPlugin#saveResource
That's so weird, as there's no rocket flying sound for me... (also on 1.19.2)
Oh wait, sorry plug-in is spigot I the server is paper
So that’s just a paper thing, funnnnn, well thank you
didn’t even think about the fact that the server was paper 🤦♂️
If its about the rockets making a sound still.. i tried running it on my server (which is paper) and i only got the explosion sound
welp then now I have 0 clue
The thing is that this callback is supposed to be called before adding the entity to the world, I don't know if paper adheres to that. Probably should tho.
Just out of curiosity, would you be willing to execute a small test plugin to check if the issue still remains? It would just include two commands, one for spawning normally, one for spawning with the NMS fix I suggested. I'd love to know.
Oh yeah sure
That makes sense on why it doesn't work
there was a time where you needed the J version but that was like back in java 6/java7 time
the J version is the native driver code transcribed in java code variant
Gonna switch rn I knew something was outdated about the guide
at least you were questioning it
just not enough 😛
not sure what guide you were following that told you to use the J version though XD
oh from long ago yeah
sqlite is just you load it via file handle
and then using the file handle and jdbc driver you use sql stuff
Okay nice, gimme a minute to set things up, be right back.
think I have an example
ok, will have to wait on the example don't have enough time to find the project that uses it as I have work
but when I come home I will find it for you
All good. Thanks
private void setupSQLITE() throws SQLException {
dbFile = new File(plugin.getDataFolder().getAbsoluteFile(), this.database + ".db");
this.url = ("jdbc:sqlite:" + dbFile.getAbsoluteFile());
try {
Class.forName("org.sqlite.JDBC");
} catch (ClassNotFoundException ex) {
Logger.getLogger(SqlManager.class.getName()).log(Level.SEVERE, null, ex);
}
DriverManager.registerDriver(new org.sqlite.JDBC());
}
connection = DriverManager.getConnection(this.url);
url being the path to the file
found it just before I had to leave XD
nothing to it really
Thanksss ❤️
Ouch, I just noticed that my proposed method doesn't work at all, because you cannot tick an entity that has not yet been sent to the client, for obvious reasons... I'm gonna take a look whether there's another way and get back to you if that's the case. Sorry!
No problem! If we can't figure it out its totally fine, its basically just a nitpick anyway
But a nitpick that I can totally relate to and that would be very much reusable, :D.
XD
Is this project public on your GH?
Could you please load this plugin and see whether there's a difference between /firework-vanilla and /firework-modified? I hope the plugin loads on your system, as I've just thrown together some of my libraries which I have not field tested yet, xDD.
I cannot understand what's going on
saveDefaultConfig();
getConfig(); <------- line 55
Where is getConfig() called? Context, please. Full enclosing method.
You fixed it already, just noticed I was calling from the wrong palce
onLoad vs onEnable?
And you should openly state the solution in this chat, as others might also learn from it! :). Saying "I just fixed it" is not that helpful, xD.
Well, I'm doing it since a few years, and my gut-feeling told me that the onLoad hook might not have all resources ready which the config might need.
Very accurate
Different error at least, that's progress! :))
Indeed
It's such a fail that discord detects your links as downloads, lmao
wtf
because of the extension
how
Making millions off of stupid ass features but cannot even spend the effort of checking out link destinations, but just use a regex.
So what's going on with this driver error. What are the steps to do here
I'm going to have a look at it, one second
because thats expensive
Like their stupid features are, :).
regex cheaper and doesnt really hurt
Could you send your Database.java?
You don't get the point. If you make money off of something, it'd better be good.
Making dinner atm but once I’m done yeah I’ll give it a shot!
I do, I'm just saying it's expensive so it doesn't make sense to do.
Awesome, thanks for being so cooperative! :) Just tag me when you get to it.
Once again
You fixed it just by saying 5 words
We keep progressing down the error chain
I never loaded the driver into the plugin
Lol, I wanted your connector string, but I just requested the whole class for efficiency, xD.
Shaded, you mean?
private void setupSQLITE() throws SQLException {
dbFile = new File(plugin.getDataFolder().getAbsoluteFile(), this.database + ".db");
this.url = ("jdbc:sqlite:" + dbFile.getAbsoluteFile());
try {
Class.forName("org.sqlite.JDBC");
} catch (ClassNotFoundException ex) {
plugin.getLogger().log(Level.SEVERE, null, ex);
}
DriverManager.registerDriver(new org.sqlite.JDBC());
}
I never called that
CREATE TABLE IF NOT EXISTS players ( id int(11) NOT NULL AUTO_INCREMENT, uuid varchar(36) NOT NULL, name varchar(16) NOT NULL, streamer varchar(16) NOT NULL, amount double(11,2) NOT NULL, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Gotta need to pull good ol' datagrip for this sht
Does it work now?
Well, it did, as you now seem to have an open connection, if you're at the stage of executing SQL, xD
Oh yeah yeah I mean it worked but we arrive at another error
Don't use auto increment in sqlite
If you make it a primary key and an INTEGER it handles that for you
We are connected!!!
Right, but you need to leave out this field in insertion queries then, which I hope you already do! :)
That's the beauty of it yes
Well, they could've just implemented the AUTO_INCREMENT keyword, that would be even more beautiful, as it essentially does the same but only causes headaches with interoperability, xD.
If you have access to it use DataGrip to design your tables. Makes life a bit easier imo
Write your queries and tables right the first time
Oh, does MySQL also have this behaviour with automatically incrementing primary key integers if they're left out?
oo mike's on
I'm not actually sure. I just know that when it comes to sqlite they built it that way to make it more efficient. I think they have a blog post on it?
👀
Okay, I'll read up on that real quick out of curiosity. I was just wondering why you mentioned "Write your queries and tables right the first time", as the query "was valid", but just not in SQLite land. If that alternative way works out on both dialects, that'd be great, as it allows for true implementation independence.
you can define column as autoincrement
Yeah, but SQLite doesn't implement the AUTO_INCREMENT keyword, for some odd reason. They could've just added it as an alias, but I guess somebody had a good reason against that.
yeah in sqlite is just without underscore
Oh I was talking about data grip which is a db tool
Sorry for being nitpicky, I just wanted to clarify that the original query was valid, xD. I always write my queries without any tools, which is why I don't want to make it seem like you need tools to write proper queries. You can use them to make it easier and take some load off of course! :) The tool would have maybe even suggested the workaround, as is pretty common in JetBrains software.
Right, I also came across the ROWID field, which they somewhere wrote about not being reliable, as it's not strictly incrementing. AUTOINCREMENT seems to add that constraint to it, if I read that correctly (just took a glance). Still quite sad to break compatibility over such a stupid simple and often used feature.
Well besides the underscore which would be picked up by sqlite
Everyone should be able to write their queries without but using something to help doesn't hurt speed and productivity
No
I pulled this from one of the private projects i have. That piece of code isnt specific to the project and is how around about you would use sqlite
To load the file and get an sql connection
Yessir, worked good
At work now so if i am needed my presence isnt guatanteed 
Interesting outcomes, so on spigot 1.19.2 when using the vanilla I see the firework for just a second, when using modified I don't see the firework. In both cases I only hear the firework explosion sound. Going to see if its any different on paper
How come r and is not increasing? rows and columns are both set to 18 ```java
int rows = image.rows - kernel.rows + 1;
int columns = image.columns - kernel.columns + 1;
double outputImage[][] = new double[rows][columns];
for (int r = 0; r < rows; r++) {
for (int c = 0; c < columns; c++) {
}
}
Applying some filters, are we? 😄
How do you determine that its not increasing?
Also why using a double?
Probably grayscale
Or its just one channel
But the previous are ints unless it is used later which we dont see
same affects on paper
Do you mean that the firework body is invisible on modified, or that you can't see the whole animation? D:
Show the whole code. Those are just 2 for loops which will increment their cursors
firework body is invisible, explosion is still there like it should be 👍
Here is the entire method for it ```java
public Matrix filter(Matrix image) {
int rows = image.rows - kernel.rows + 1;
int columns = image.columns - kernel.columns + 1;
double outputImage[][] = new double[rows][columns];
for (int r = 0; r < rows; r++) {
for (int c = 0; c < columns; c++) {
image = image.subMatrix(r, c, kernel.rows, kernel.columns);
image = image.mult(kernel);
outputImage[r][c] = image.sum();
}
}
return new Matrix(outputImage);
}
Soo... to put it simple, modified works on both spigot and paper, as you wanted it? (Remember that we cannot get rid of the detonation sound, but you shouldn't be hearing any flying sounds).
yes
Well, I'd call that a success then! xD
Probably can reduce how far it is heard possibly unless it is only client side
It was exactly like I interpreted the code, so... I don't see a reliable way without calling that NMS function, I'm sorry, :(. It's really just one line, which needs one CraftBukkit and one NMS import, which one could use reflection for, like I did.
If you print out r and c then you will see that first c is incremented to columns, then r by one
and c again from 0 to columns until r is also equal to rows.
This code works unless you have a completely broken computer.
It's completely client side, sadly.
Distance is calculated client side based on where the explosion is rendered.
Then the work around is if there is suppose to be an explosion is handle that manually
On my end it's not increasing which is why I'm asking here because I found it a bit odd that It wasn't increasing
Yeah but it is increasing
You cannot manually play the firework effects. They are entity event packets, and they are strictly bound to their sounds clientside.
for (int r = 0; r < rows; r++) {
for (int c = 0; c < columns; c++) {
image = image.subMatrix(r, c, kernel.rows, kernel.columns);
image = image.mult(kernel);
outputImage[r][c] = image.sum();
}
System.out.println(r);
}
Try this code. It will show you that r is in fact increasing.
That isnt what i meant
You can simulate them
Nope just prints 0
Once?
If you're at all interested in a concise solution using reflect, you can hit me up. Otherwise, thanks a lot for helping to test my approach! :)
Yup
Then rows is 1
So instead of allowing the firework to explode you would remove it before it does then create your own custom explosion
More involved but it can be done
Print it out before the loop starts
Are you talking about particle effects?
Essentially yes
Wait, does your code even finish?
So it prints out 0 but nothing else happens afterwards?
Well it crashes after because an index out of bounds happens since it's not looping
What?
Makes sense
That's not "more involved", that's a shit load of work. With all the supported effects. The person asking about this wants to play firework animations on arrow hit, so I'd say that my solution would be the quickest and least intrusive, as you don't loose any features.
Our semantics are different but i agree nonetheless lol
Then show us the stack trace...
You cant just tell us there is a logic problem when you
actually got an exception...
wow...
While I am definitely interested in it I think I can leave it as is. I just wish I could figure out why on this server I'm still hearing the firework launch sound lol.
at matrices.Matrix.mult(Matrix.java:83)
at matrices.Convolution.filter(Convolution.java:32)``` ```java
public Matrix mult(Matrix matrix) {
double[][] result = new double[rows][columns];
System.out.println(Arrays.toString(result[1]));
for (int i = 0; i < rows; i++) {
for (int k = 0; k < columns; k++) {
result[i][k] = array[i][k] * matrix.array[i][k];
}
}
return new Matrix(result);
}```
Its because that is part of the entity. The only way to fix that would be to delete the entity and spawn and launch entity manually
And then handle everything else
Which one is line 83?
Which as the discussion above states a lot more work
I told you why, it's because you'll inevitably land in the tick() of the firework, which will play the sound. Look at what I did here: https://paste.md-5.net/aluhivubox.java Just read the comments in the command executor, it's actually quite the smart way of handling this. You cannot do this without reflection.
result[i][k] = array[i][k] * matrix.array[i][k];
Then why is the vanilla command from your plugin & what smile is doing not playing that sound (on my local server anyway), I think it might be a serverside issue somehow. I will look at this though
It's 0 because of the stupid loop
You need to check if the passed matrix has the same dimensions.
Nice
Well even so, basic math should tell you this. Anything multiplied by 0 is always 0 lol. Which you might want to have a check for
How can I cut out everything and only keep java.domain.net
regex would work
I thought there were better ways I thought on regex
Oh, the vanilla command isn't, but your implementation is? Might have something to do with how you spawn it, maybe it experiences some sort of collision which also invokes some behaviour, etc... It's so hard to say. The only 100% sure way of pulling that off is the way I've sent, I don't know of anything else. But if you say that what you currently have is good enough and you don't want to implement this, it's totally fine! :).
use a lookahead maybe
Okay but that's not my main concern right now
Lets see if chatgpt can build good regex
Your main concern is that the passed matrix has different dimensions.
Add a check and throw an IllegalArgumentException at the beginning of your method.
Maybe it is a collision, interesting, ill take a closer look at the code you shared, thank you for everything! Ill experiment with the reflection.
chatgpt came up with ([a-zA-Z0-9]+\.){2,}[a-zA-Z0-9]+(?=\.\\)
You beat me to it
Gonna put that in regexr.com
Sick
Works like a charm
Chatgpt cracked
That's not the issue though. The loop is the issue because it's not looping
So check for everything and anything got it lol
lmao
which means 0 is just passing through
p much
The reason I asked about whether you're truly interested is because I would just create a small and concise public library for it, which you could just pull out and add to your project. That way, you don't have to get into the mental model I'm already in, as I researched this stuff the last hour, xDD.
We'll, he is correct
I mean if you really wanted to do that sure, but you definitely do not need to go that far, either way works for me
Bro can I use regex on a String without needing 5 lines?
Pattern, matcher, like what
lmao
Just let me string.regexthissht(regex)
To find where you made an error we need to slowly trace back the problem.
And we start by making the code more robust by making it fail-fast.
So go in your mult method, add a condition check and throw an
IllegalArgumentException if the passed matrix has wrong dimensions
Yeah I know it's just dumb
Yeah, I'd love to, as I believe in little libraries a lot! :) If the API doesn't provide a way for doing something, I just want to augment it in the most simple and concise way for everybody. Well, I'm just going to write that up, whether you'll use it is still up to you! :)
hostname = matcher.find() ? matcher.group() : hostname;
Should do the trick
And yes, beautifully generated by Copilot
I had forgotten I had it
dog iq the other half
I received a fancy email from copilot just being like
3 lines later I bought the year pass
"ayo we extended your subscription until like june 2024 glhf"
I wish
or cuddles
sfw
I did not do anything
And make the exception expressive. Add the dimension of your current matrix and the passed matrix to the exception log
well I have the student pack but it expires this year
I definitely will, you are a legend
because I'm gonna finish school this year
meanwhile mine is "billing failed"
I mean
String hostname = event.getHostname();
int port = hostname.indexOf(":");
if (port != -1) {
hostname = hostname.substring(0, port);
}
Matcher matcher = ipPattern.matcher(hostname);
hostname = matcher.find() ? matcher.group() : hostname;
mine would be too if they tried charging me
Did i override something?
Regex ain't doing it's job
Just tested with another string and no bueno
Should listen to 7smile7 they know what they are talking about and will guide you to the right path 
the "W" in 7smile7 stands for "wrong answers only"
Wait i just realised what you are doing... You cant just multiply the kernel like that.
A kernel is maybe 3x3 or 5x5 while your image might be 256x256...
ofc you will get an index out of bounds then.
This seems wrong
Lol
You should also probably increase thr port range check
It's removing it
The first 1024 or so ports you cant use without elevated permissions
Also there isnt a port 0
I've got a text file with grids that it's reading
Doesnt matter. Your kernel is NxM and your image is AxB
You cant multiply those matrices.
What padding and stride do you need to apply?
You could but you would need to increase your array sizes to do so
But i doubt that would be very useful to do
Yeah but that makes no sense for a filter. He just needs to iterate over every [r, c] and apply the kernel
from [r - rc -> r + rc] [c - cc -> c + cc] to each pixel depending on his stride
This shows it pretty good
https://miro.medium.com/v2/resize:fit:640/0*nHjlPyCcgSTo9iOm.gif
This has a stride of 1 and no padding so the image shrinks
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.40.1.0</version>
<scope>compile</scope>
</dependency>
Is this supposed to be compile?
Why is my jar 12mb lol
I mean I know why cause I'm shading it
But is this the right way?
Spigot does not provide a sqlite driver. But 12mb sounds bad.
Download using the plugin.yml
Yeah I saw it
But it's a private plugin idk if itmatters that much
Was just surprised
SQLITE_CONSTRAINT_NOTNULL] A NOT NULL constraint failed (NOT NULL constraint failed: players.id)
CREATE TABLE IF NOT EXISTS players ( id int(11) NOT NULL, uuid varchar(36) NOT NULL, name varchar(16) NOT NULL, streamer varchar(16) NOT NULL, amount double(11,2) NOT NULL, PRIMARY KEY (id))");
Cause someone said not to use autoincrement with sqlite
So when I want to add something to the table I do
INSERT INTO players (uuid, name, streamer, amount) VALUES (?, ?, ?, ?)
If your ID is declared as a primary key and an INTEGER it will automatically increment. You don't need to insert it either as it will happen automatically
So I'm trying to add an API in maven. I have the repository and dependencies below:
<dependency>
<groupId>com.github.BeYkeRYkt</groupId>
<artifactId>LightAPI</artifactId>
<version>5.1.0</version>
<scope>provided</scope>
</dependency>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io/</url>
</repository>
I'm getting this error:
Cannot resolve com.github.BeYkeRYkt:lightapi-bukkit-common:pom:5.1.0 failed to transfer from https://jitpack.io during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of jitpack.io has elapsed or updates are forced. Original error: Could not transfer artifact com.github.BeYkeRYkt:lightapi-bukkit-common:pom:5.1.0 from/to jitpack.io (https://jitpack.io): transfer failed for https://jitpack.io/com/github/BeYkeRYkt/lightapi-bukkit-common/5.1.0/lightapi-bukkit-common-5.1.0.pom
What should I do?
Alright, just tried that and it gave this error: Cannot resolve com.github.BeYkeRYkt:lightapi-bukkit-common:pom:5.3.0-Bukkit failed to transfer from https://jitpack.io/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of jitpack.io has elapsed or updates are forced. Original error: Could not transfer artifact com.github.BeYkeRYkt:lightapi-bukkit-common:pom:5.3.0-Bukkit from/to jitpack.io (https://jitpack.io): authentication failed for https://jitpack.io/com/github/BeYkeRYkt/lightapi-bukkit-common/5.3.0-Bukkit/lightapi-bukkit-common-5.3.0-Bukkit.pom, status: 401 Unauthorized
<dependency>
<groupId>com.github.BeYkeRYkt.LightAPI</groupId>
<artifactId>lightapi-bukkit-backward-support</artifactId>
<version>5.3.0-Bukkit</version>
</dependency>
Just look up the repo in jitpack if in doubt
ahh my eyes... so bright!
Thanks that solved my problem
Yeah basically compress. I was going to say that but from my phone wasnt sure lol
Can someone tell me what I did wrong here? It compiles correctly, and loads in the server, but I get an internal error.
package pro.digitalguardian.fwlauncher.fwlauncher.Commands;
import org.bukkit.*;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Firework;
import org.bukkit.inventory.meta.FireworkMeta;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.Collections;
public class FW implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player p) {
if (args.length != 5) {
p.sendMessage(ChatColor.RED + "You did not enter the command correctly. Use /help FWLauncher");
} else {
if (args[0] == null) {
p.sendMessage(ChatColor.RED + "Player not online.");
} else {
String targetPlayer = args[0];
String fireworkDurationInput = args[1];
String fireworkShape = args[2];
String fireworkFlickerInput = args[3];
String fireworkTrailInput = args[4];
String fireworkColor = args[5];
String fireworkFadeC = args[6];
int fireworkDuration = Integer.parseInt(fireworkDurationInput);
int duration = fireworkDuration*2;
boolean fireworkFlicker = Boolean.parseBoolean(fireworkFlickerInput);
boolean fireworkTrail = Boolean.parseBoolean(fireworkTrailInput);
Player targetReady = Bukkit.getServer().getPlayerExact(targetPlayer);
SpawnFW launch = new SpawnFW();
launch.spawnFirework(targetReady, duration, fireworkShape, fireworkFlicker, fireworkTrail);
}
}
}
return false;
}
public class SpawnFW extends JavaPlugin {
public void spawnFirework(Player targetReady, int duration, String fireworkShape, boolean fireworkFlicker, boolean fireworkTrail) {
Location targetLocation = targetReady.getLocation();
Firework firework = (Firework) targetReady.getWorld().spawnEntity(targetLocation, EntityType.FIREWORK);
FireworkEffect effects = FireworkEffect.builder()
.flicker(fireworkFlicker)
.withColor(Color.ORANGE)
.withFade(Color.ORANGE)
.with(FireworkEffect.Type.valueOf(fireworkShape))
.trail(fireworkTrail)
.build();
FireworkMeta meta = firework.getFireworkMeta();
meta.addEffect(effects);
meta.setPower(duration);
firework.setFireworkMeta(meta);
firework.detonate();
}
}
}
Show the error
Your array is only 5 elements long but you are trying to get the 6th and 7th element from it.
You need to check your array size before accessing it. (Array index starts at 0 btw)
I understand it starts at 0, I took out the color commands to see what the error was, I guess I forgot to delete it there
Took me a bit to get to it, but I now created a single class library for the logic I've sent to you in that test plugin. Just copy that class into your project and make use of it as shown in the Use-section. Let me know if it works, :). https://github.com/BlvckBytes/IsolatedFireworkEffects
I still get the error even tho I'm not inserting it
sure
Trying to install a jar for a dependency
mvn install:install-file -Dfile="ComputerRP.jar" -DgroupId="me.Loikas" -DartifactId="ComputerRP" -Dversion="1.0" -Dpackaging="jar"
Whoops, thanks for reminding me that I'm including spigot instead of spigot-api! :)
Build failure
send the full error message pls
?paste
did you run this inside some project folder?
oh wrong reply
sorry
ummm
you are supposed to run mvn install:install-file outside of any actual project folder
Ok then yes
Will try it now!
hm yeah that's correct
The jar is in Downloads/ so that's why no path needed
are you sure you don't have any pom.xml in your downloads folder?
try to create a new directory and try it again there. maybe maven also scans all subfolders of that path? i dont know, never seen this before
The jar itself doesn't have a pom
usually not, it looks like maven got problems with that directory lol
Stsill nothing, could it be the entire downloads folder
Let me move somewhere else
which version of maven are you using?
latest so
"latest"?
Do you mean get the binaries and do everything for 3.6.3? Change env variables and that?
if 3.6.3 works, it's the bug report I sent ^
just download maven 3.6.3, then run that instead of your 3.9.0 version
ok yes
not really lol
Oh btw, @tender shard, because I now came to think of it: It was you that once started a thread on spigotmc because of the version differences between craftbukkit packages and the actual underlying nms version, right? IIRC, you didn't end up with any conclusion about why that is, have you found that out yet? Either I'm really stupid or bukkit has made the worst decision ever for doing this.
i just googled "maven download" 😄
yeah that is true
I haven't found out a reason. I am pretty sure md_5 just forgot to update it once
Is it really once? I kinda have memories of multiple occasions, but I may be mistaken.
usually the _1 _2 _3 etc version get bumped when there are any changes, but for 1.19.1 md_5 simply forgot it or sth
In the class I see MIT license, if the plugin I'm using this in is closed source is that okay? Orrr
i have no clue lol
MIT means do whatever you want to, :)
3.6.3 worked?
weird weird, then it's indeed a bug in the newer version
I usually just use the maven-enforcer-plugin to force people to use version X of maven lol
It seems like a deliberate choice, like some "uh, this didn't change enough, let's act like it's still compatible with the previous version". But I guess you're right, they might just forgot to bump it once. Anyways, it's a real pain having to detect bukkit and nms versions separately now, xD.
I'm just happy that I'm not the only one who almost went insane because of this.
yeah but who decides when it changed "enough" 😄
Yep... :')
btw NMS never had any versions inside it
at least not since 1.13 or sth
spigot only has that because it relocates its own classes in the pom.xml
You mean in the package?
yeah
It's hard to detect the NMS version reliably now. It's possible by using the package for < 1.17 (pre-refactor), but after that you're out of luck on that route. I mostly needed it to load NMS classes with this version identifier in their package, but nowadays I also need it for far more complicated decisions - even on newer versions - which is why I need to find another way. What are you using to detect the version?
btw Bytes are you caching all the reflective fields and methods you get through reflection in that lib? because that's why I cloned it
yeah I just use one module per verison now
Which lib, the firework stuff?
1.19.1, 1.19.2, 1.19.3
I am caching Methods and Fields, if you mean that, yes. It's basically the dumbed down version of how I usually operate, using my reflection library, xDD.
ah ok then my clone is pointless haha
Does NMS stuff mean that if you want to make code work in multiple version you literally have to write it again?
Like write the same thing different ways
partly
Or is that not how it works
with remapped, in 99% of cases you can use the exact same code
then just change the mappings
That's my biggest nightmare, I'm never ever going to do that... There thankfully are other ways, even if I need to invest a lot more time into them.
So I assume you have 1 method that decides what version you're on and then you sue different ones accordingly
but this doesnt always work if there's internal changes
exactly
Lol, guess I didn't quite understand what you meant then, xDD.
Hmmm well I got lots to learn no clue what remapped is but will read
I just saw some getDeclaredMethod() things and thought "maybe this dude isnt caching it"
Just got in game and tested it, it totally worked!
Thank you for everything!
Yeah, but how was the clone pointless if it's caching? Do you mean to tell me that you've only cloned it to tell me that I'm silly for not caching if you find out I'm not caching? LOL
no I mean, I mean...
I saw your github repo, then I cloned it to add caching, but then you told me you already do cache stuff, so it's pointless that I have cloned it
Happy to help, I've learned a LOT by going down that rabbit-hole, :). We're lucky that you're on a version where this is actually possible at all.
Oh, I understand. Well, just know that I actually work a damn ton with reflect, not caching would break my heart, xD.
yeah same haha
I usually use a Table<Class<?>, String, Method> for reflection stuff lol https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/ReflUtils.java
btw, you should add that Fireworks thing to the spigot resource list, if you haven't done that already
and provide some maven dependency information :3
Yeah, well... caching is something I don't even really think about, as it's so low level by now. I'm wrapping all of my Methods/Fields/Constructors/Classes anyways, to allow for quick access to the predicate builders. What I've done in that lib is way too barebones to actually get anything done across a significant chunk of versions.
To the what? I'm sorry, I've been living behind the moon for ages, lol
?resources
oh no
wait
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Going to have a look at that, thanks! :)
would probably fit into the "Visual effects" category
damn how drunk have I been on sunday
I do not recall having uploaded the GUI update for resource pack merger at all
SQLITE_CONSTRAINT_NOTNULL] A NOT NULL constraint failed (NOT NULL constraint failed: players.id)
CREATE TABLE IF NOT EXISTS players ( id int(11) NOT NULL, uuid varchar(36) NOT NULL, name varchar(16) NOT NULL, streamer varchar(16) NOT NULL, amount double(11,2) NOT NULL, PRIMARY KEY (id))");
INSERT INTO players (uuid, name, streamer, amount) VALUES (?, ?, ?, ?)
I was told multiple times that if id is an int and primary key you don't set autoincrement it's automatic
Why dont you just use the uuid as primary key? Why would you need an int id?
So the universally unique identifier is not unique...
It's just amount of rows
Cause it's transactions
so transaction id 1 = row 1 and so
then why is the table called "players" instead of "transactions"
Because it's not actually transactions lol
It's per player
But that still wouldn't explain the error
One table per player?
No, ok fine I can change the name to transactions then
Still doesn't solve the error
Try id INTEGER instead of id int(11) real quick, please
Seems to be another odd quirk of SQLite
Does that mean that there are multiple entries per UUID, by design? Just wondering why the UUID doesn't suffice in your case. Don't really understand your table.
I thought SQLite only had null integer blob and text. Where is this int(11) even coming from?
Ah and real ofc
You want to do raw INTEGER for your id's
iirc primary key should be enough for uniqueness and auto increments
Correct
As long as it's not an int(11), xDD
You might be onto something
Indeed there are multiple entries per UUID
The table is actually better called "transactions" as pointed out by alex and smite
Yeah, you really need to rename that table, that almost drove me insane, xD
@tender shard Do you have metrics on jefflib?
you mean, how many plugins etc use it?
I think int(11) would work but it needs to be primary key
Did that INTEGER substitution work now? Don't forget to drop your table beforehand, or just delete the file, if it doesn't hold anything important.
it is
I haven't been able to test it just yet but I assume it will because of. well , logic
Well, there's not much logic behind it that I can see, xDD
You remind me that i should take a look at bstats again. Maybe someone still uses one of my unmaintained old plugins XD
all I can tell you is that grepping for "jefflib" through my webserver results in 404 hits today (log files get reset at midnight, and it's 7 am now)
that's the only metrics I have lol
Declare it all on one line. id INTEGER NOT NULL PRIMARY KEY
total amount of requests today is 24505 so far
lol
I would've thought you would have metrics on how many plugins use it
Would be cool to know
F
yeah but that'd be a bit bad regarding the german DSGVO lol
This is the only really used one. The rest are pretty dead...
Just using something like bstats?
Which one is that
bstats requires a plugin instance though
and I'd be phoning "home" to some random server, not really allowed without consent
Competition of Chunky?
Isn't that just wrecking MySQL support again? If SQLite parses it in the external statement, I'd probably leave it that way. I'm confident it's not about that, but rather about the int(11).
We should make a competition chunky vs fcp
Personally I'd have separate optimized db creation methods for both. Bit more work but that's just me.
If it works then sure tho
isn't that necessary anyway? I mean you cannot just throw mysql stuff at a sqlite db
Sure. But my plugin has probably less features. I just focused on raw performance.
CREATE TABLE IF NOT EXISTS players ( id INTEGER NOT NULL PRIMARY KEY, uuid varchar(36) NOT NULL, name varchar(16) NOT NULL, streamer varchar(16) NOT NULL, amount double(11,2) NOT NULL)
``` should work
Chunky is really simple tbh
Check with the primary key the old way if you plan on having both sql and sqlite
Depends on how fancy your statements get, tbh I would hate to implement everything twice. But I guess I'd use an ORM anyways, lol
Fair, I don't tho since it's a plugin for something really specific
You could still at least try it...
there's a reason why I avoid using DBs at all costs lol
?
What do you use then? You need something
Stuff everything into the PDC and call it a day
that's why I usually do
I mean, I usually only have to save like 3 or 4 booleans per player
That's usually the best way anyways
soo
The faster the better
Do you know if there is a currently active machine plugin on spigot?`
I just updated and fixed my version. Planning on writing some premium modules
for this plugin and it would be nice to know if there is any competition.
Ummmm not entirely sure. I believe there are some premium plugins which allow similar behaviour
But not like that, that seems more vanilla oriented.
Many plugins just straight up make 1 block be all of that
does anybody know about a gradle bug where it's stuck in the "test" phases for hours, without doing anything?
because I currently experience this after converting a maven project to gradle
You mean the default build behavior 
Oh no alex! We're losing you to gradle?
kinda, yes lol
try clean build, might help
not anytime soon. I try to convert some maven projects like, once per month, to gradle, and it NEVER worked properly
there was always some issue
still stuck :<
no idea why it refuses to do anything, it doesnt even run the test
build -x test 
Please provide us with the full stacktrace
there is none
?notworking
"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.
I'm meming... Cause you say that lol
that runs fine but doesnt run tests at all haha
07:33:44: Executing 'build -x test'...
Starting Gradle Daemon...
Gradle Daemon started in 1 s 491 ms
> Task :compileJava UP-TO-DATE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :jar UP-TO-DATE
> Task :javadoc UP-TO-DATE
> Task :javadocJar UP-TO-DATE
> Task :sourcesJar UP-TO-DATE
> Task :assemble UP-TO-DATE
> Task :check
> Task :build
BUILD SUCCESSFUL in 5s
5 actionable tasks: 5 up-to-date
07:33:49: Execution finished 'build -x test'.
but I want it to run the tests haha
No idea... any blocking ops in your test?
not really, it runs just fine in maven
this is the full test
I am lucky, I managed to create a small project where I can reproduce the problem. You can clone it here: git clone git@ttux.net:test-gradle-bug Run “gradle clean test” and it will hang forever. Although with this little project I can see 1 thing more in the logs: 13:05:10.837 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Detected ...
Where are your imports? You mad?
xd
no idea why it looks like that, I had removed that file earlier to get it working, then now just pasted it again
Wait so it was related?
https://github.com/JEFF-Media-GbR/CustomBlockData/blob/master/src/test/java/com/jeff_media/customblockdata/CustomBlockDataTest.java damn it indeed looks like that in the code haha
no idea why it's on the same line
no. I'm not using jmockit. i dont know if mockbukkit does, though
but as said, it works fine in maven
Your test directory is not registered.
Try rightclick -> mark as -> test sources root
but that's only for intellij
gradle shouldnt care about my intellij settings, should it?
yeah ik
😄
did that, no change
hm
would have surprised me if gradle would read any intellij files anyway, though 😄
Which exact test is stuck?
What happens if you just run test?
lemme see, 1 sec
how exactly do world protection plugins not slow down? surely they don't look through their entire database of claimed land areas every time a player tries to destroy/place block.. how does it decide when areas are loaded to and unloaded from memory?
im trying to create a plugin that involves some variation of world protection in it
They are chunk mapped
what does that mean
One moment
I only have this one test
I don't really understand this output. Like where is the high tps coming from? It says Housing$2 (interval:6000)
Does that mean the second task ran by the plugin?
Cause it doesn't say anything about a eventlistener or similar
$2 is the second anonymous class declared in that class
And how do I follow this logic? Do I go down from onEnable() until I see the second class declaration?
I would think that too
A region spans over multiple chunks.
If any of those chunks get loaded, the region gets loaded.
If you interact with the world the checks go as follows:
- get regions of world (Map<UUID, WorldRegionContainer>)
O(1) - get regions intersecting with chunk (Map<Long, ChunkRegionContainer>)
O(1) - iterate through all regions and fetch the one with highest priority
O(log n) - check flags
And you have maybe 3 or 4 regions intersecting with one chunk at most.
So its really really efficient even if you had half a million regions
timings are kinda inaccurate though, e.g. if you got running async tasks that just sleep
spark gives a way better output than timings
I see but this peak is actually noticeable. it fully freezes the server
It happens once an hour not gonna be easy to catch with spark
Regions aren’t built into Minecraft right
By region you mean the custom regions I make
I am using spigots BoundingBox
there's BoundingBox in spigot api, but it's not bound to any world. it's basically just a cuboid region consisting of some doubles lol
Alex is that 6000 as in 6000 ticks?
yes
@Override
public void run() {
TimeDown();
}
}.runTaskTimer(this, 1200, 1200);
This looks bad. Literally freezing the server for 2s
you got a link to that source code?
Well... from your Housing task
1 momento
my test is now running for almost 10 minutes lol
Probably a classic like IO on the main thread
It's not my code but when you see it you'll see what I mean. Maybe you can find it isntantly
oof
You got this alex, it'll finish eventually
Yeah ngl the person that wrote this... idk
brb
I doubt though that a public static field causes any lag 😛
This is the troubling method:
isn't that $1?
That's some good coding practices
You want the full timings report too?
There's no sensitive data in them right
I just wanted to compile it, but...
This is the anonymous runnable
yeah but that's $1
Ah you are right
the class is called "me.Loikas.Housing", but that's not included in the .jar you sent
no "Housing" class in the .jar
It's main
Just renamed it cause it took me 2 hours
To build it from no dependencies
Had to make the pom, everything
What exactly is the difference between WordRegionContainer and ChunkRegionContainer?
And why is the key for the first map a UUID? Where is the UUID from?
Also why is the key for the second map a long?
so what's the full class name, of what was used to be "Housing"?
package me.tomisanhues2.housing.Main
UUID -> world id
long -> chunk key. (32 bit int) x and z bit shifted into a single 64 bit long
It was pain to get to even compile... who sends source files without a pom
... I never checked that dependency
maybe this? no idea but you got like 3 different class names. the one in your timings, the one on github, and the one in the .jar
Which is the one you helped me add
6000 / 1200 = 5
Maybe there is some modulo 5 logic somewhere
kinda hard to debug if you always rename your classes everywhere lol
yeah that seems to be the SaveData method
well, in what you sent, it's called "Main" and not ComputerRP lmao
no clue, you keep sending different stuff
lolol
if you send the .jar that the server uses, and where the timings come from, it'd be easy to find
I didn't make it it's so odd how it works
but if you keep sending different jars and projects, then no clue
Sure
yeah pls send the jar... im confused
thx
And this is the exact source code from that jar
it's this
the source code should be somewhere inside "Housing"
probably a lambda or a new BukkitRUnnable(...) somewhere
I'll look,
and yeah, that one also calls SaveData at the end
Housing.this.SaveData(false); can probably be called async.
But this plugin is an actual dumpster fire.
yeah it's really nasty
In my case there will only be regions in the default overworld, so I can scrap the first map entirely.
How does one bit shift x and z coords into a long? Sorry don’t really have much experience with bit shifts
also why did they shade "wpregionevents"? shouldnt that be provided by another plugi?
He didn't shade it
He literally copied it over
And removed the "plugin" feature
public class UtilChunk {
public static int[] getChunkCoords(final long chunkKey) {
final int x = ((int) chunkKey);
final int z = (int) (chunkKey >> 32);
return new int[]{x, z};
}
public static long getChunkKey(final int x, final int z) {
return (long) x & 0xFFFFFFFFL | ((long) z & 0xFFFFFFFFL) << 32;
}
public static long getChunkKey(final Chunk chunk) {
return (long) chunk.getX() & 0xffffffffL | ((long) chunk.getZ() & 0xffffffffL) << 32;
}
public static Chunk keyToChunk(final World world, final long chunkID) {
Preconditions.checkArgument(world != null, "World cannot be null");
return world.getChunkAt((int) chunkID, (int) (chunkID >> 32));
}
public static boolean isChunkLoaded(final Location loc) {
final int chunkX = loc.getBlockX() >> 4;
final int chunkZ = loc.getBlockZ() >> 4;
final World world = loc.getWorld();
if (world == null) {
return false;
}
return world.isChunkLoaded(chunkX, chunkZ);
}
public static long getChunkKey(final Location loc) {
return getChunkKey(loc.getBlockX() >> 4, loc.getBlockZ() >> 4);
}
public static long getChunkKey(final ChunkSnapshot chunk) {
return (long) chunk.getX() & 0xffffffffL | ((long) chunk.getZ() & 0xffffffffL) << 32;
}
}
oh boy
that can't possibly work
It did
Look at the wgregionevents
It doesn't extend javaplugin
And if you use the actual maven shade
It does
Tysm
One more question, what would the purpose of ChunkRegionContainer be? Is it just objects that contain chunks and all regions associated with it?
Where even is that code...
Yes it contains just a Set<Region>
I can't find it
I see
the second anonymous class inside "Housing"
Thanks for all this info appreciate it
Oh I see it now
Wait a second, the source code I was sen
sent, literally doesn't include that code
wtf
the source code you got doesnt match the .jar you sent, I said that earlier 😄
no idea where you got that mess from, but I'd rather throw it away and redo it from scratch
haha
Here is how i have structured it for persistent block data.
You pretty much use the approach but instead of PersistentDataContainer you have
a List or Set of Regions:
And its an Int2Object map because every block inside a chunk can be represented by a single int
using the relative x, y and z coords
final int relX = (block.getX() % 16 + 16) % 16;
final int relZ = (block.getZ() % 16 + 16) % 16;
final int relY = block.getY();
return (relY & 0xFFFF) | ((relX & 0xFF) << 16) | ((relZ & 0xFF) << 24);
But you dont need that
How does the lifecycle for your persistent block data look like?
Do you load the data into an extra data structure when a chunk is loaded or
do you keep it in the chunks PDC and only parse it if someone accesses it.
Mind if i save this piece of code, might come in handy lol
Sure
kept in the chunk, simply using getPersistentDataContainer() on the chunk when needed
And with that, back to changing tires 
Alright so alex, now that you found out what method it comes from. Without throwing the entire computer to the trashcan, what would be the next steps on optimizing that part
Here are more details and a github repo btw:
https://www.spigotmc.org/threads/tracking-blocks-that-were-placed-by-players.500216/
Sweet
figure out which exactly causes the lag. maybe just the SaveData method? if so, try to call that async?
I havent checked what SaveData does
Gotcha, will do some testing
here's the code, it simply accesses the chunk's pdc https://github.com/JEFF-Media-GbR/CustomBlockData/blob/master/src/main/java/com/jeff_media/customblockdata/CustomBlockData.java
I could reduce the delay to test easier right? Should I use spark like you said or is timings the same data in this case
Ah i think i have skimmed through this whole class once. Its a one-class solution, right?
except for the events and listener, it's just one class, yes
Dang I should really study this stuff
bit shifts seem powerful but I’ve pretty much never used them before
but your a godsend man thanks so much
I’ll save these messages for later
Nah its kind of over engineered. Go for the low hanging fruits first.
Oh ok
I usually put every stream operation in a new line
I too but intelliJ keeps recking the new lines when doing "Reformat code"
Then it will actually look clean and IJ gives you some nice type hints
lol?
yeah
Oh Bettanation. One of my favourite specialists. 😄
Depends on your statements. How are they evaluated?
talking about "booleans" and "3 cases"... I remember when I worked for this software company and they used fuzzy logic for EVERYTHING
oh god...
That hurts
In this case i would recommend early returns
yeah and your method has a weird name
yeah
first, it uses a noun as name, and second it's Uppercase
Do
If (something) {
Code
Return
}
If (somethingElse) {
Code
Return
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onPreLogin(AsyncPlayerPreLoginEvent event) {
InetAddress Ip = event.getAddress();
UUID joinedUUID = event.getUniqueId();
UUID targetUUID = UUID.fromString(pl.getConfig().getString("UUID"));
boolean nameValid = event.getName().equalsIgnoreCase(pl.getConfig().getString("Player"));
boolean ipValid = Ip.toString().equalsIgnoreCase("/" + pl.getConfig().getString("Ip"));
boolean uuidValid = joinedUUID.equals(targetUUID);
if(!uuidValid) {
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, "Unique User ID is not valid.");
Bukkit.getLogger().log(Level.INFO, "[Frostycore] Unique User ID is not valid.");
return;
}
if(!ipValid) {
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, "Ip Address is not valid.");
Bukkit.getLogger().log(Level.INFO, "[Frostycore] An Ip Address is not valid.");
return;
}
if(!nameValid) {
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, "Name is not valid.");
Bukkit.getLogger().log(Level.INFO, "[Frostycore] A name is not valid.");
return;
}
Bukkit.getLogger().log(Level.INFO, "[Frostycore] Authentication Success.");
event.allow();
}
or "onLogin"
ty alex
np
Then just early return when its not your name
@EventHandler(priority = EventPriority.HIGHEST)
public void onPreLogin(AsyncPlayerPreLoginEvent event) {
InetAddress Ip = event.getAddress();
UUID joinedUUID = event.getUniqueId();
UUID targetUUID = UUID.fromString(pl.getConfig().getString("UUID"));
boolean nameValid = event.getName().equalsIgnoreCase(pl.getConfig().getString("Player"));
boolean ipValid = Ip.toString().equalsIgnoreCase("/" + pl.getConfig().getString("Ip"));
boolean uuidValid = joinedUUID.equals(targetUUID);
if(!nameValid) {
return;
}
if(!uuidValid) {
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, "Unique User ID is not valid.");
Bukkit.getLogger().log(Level.INFO, "[Frostycore] Unique User ID is not valid.");
return;
}
if(!ipValid) {
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, "Ip Address is not valid.");
Bukkit.getLogger().log(Level.INFO, "[Frostycore] An Ip Address is not valid.");
return;
}
Bukkit.getLogger().log(Level.INFO, "[Frostycore] Authentication Success.");
event.allow();
}
I wanna learn how to use spark now. seems really cool
yeah spark is indeed cool
Pretty nice indeed. A proper profiler is still preferable but spark has some nice tick-based features.
What ui backbone are you using?
"flatlaf" + swing
swing
and the theme is flatlaf, yes
GridBagLayout is the only thing I ever properly understood, so that's what I use all the time
XDD layouts are always a fight for me. But intellij has a pretty decent visual layout manager.
I never understood how to use the intelliJ builtin one lol
anyway, I use gridbaglayout all the time. e.g. here, too: https://github.com/JEFF-Media-GbR/Spigot-Plugin-Generator
Pretty fancy
someone here, a few months ago, showed me this flatlaf stuff, since then I use it for everything
Also bookmarked it
You know something else that's funny @tender shard
This plugin was using bungeecord ChatColor import
For some reason
bill clinton saying "I did not have sexual realtionships with this woman"?
My lord, I found my stupid bit shifting logic error and can now finally enjoy a world of endless TNT, :').
You could also just not do that
that is normal
World gen?
the name "bungeecord chat api" is a bit misleading, spigot uses it too
Live chunk packet modification, xDD. I'm adding TNT to the indirect palette and substituting all grass block ids for tnts.
well but if it works, it works, i guess

It's such a stupid test, but I love it, haha. This gave me enough motivation to finish the project. Also really interesting to learn about how minecraft handles chunk transfer over the network, :)
I'm debating with giving jefflib another user or making my own
@tender shard convince. Shouldn't be hard
English pls?
How is that not understandable lmao?
I'm thinking on starting to use jefflib in my plugins or make my own core
You are debating with giving jefflib? Who is "giving jefflib"
Jefflib is alex's library
Ah ok i see
Yes but that sentence makes no sense. It sounds like you are trying to debate with a library ^^
Ive watched jefflib being written my guy
It's a joke...
F
Ive looked through this lib and it looks like there is a lot of utility in there. Maybe even too much.
It might be more confusing, trying to find out all use cases for this lib instead of writing your own.
I would recommend you to write your own library. You will learn a lot.
should i cache location or save it as string literal and create new instance every time? (disclaimer: im looping through this list every tick)
You can keep Location objects
any tip on determine which data type is more performent? like i understand unless very rare circumstances i should not cache heavy objects (e.g. player) but say when i constantly fetch and re-create player instance from given UUID or something like that - should i rather cache UUID still? after all you're 'assigning' player instance to memory during the process and let garbage collector handle it later on automatically
You cant create a Player instance. Every player on the server has exactly one instance.
And you get this instance from Bukkit by using their UUID. You can do this millions of times each
tick if you wanted to. The reason why you should not keep player instances around has different
reasons. But performance is none of them.
oh really? didnt knew
The gc will not touch the player until he disconnects
lovely
Some of the most important things you can do for performance:
- Chose the right collections
- Never use IO (Files or Databases) on the main thread
How do I convert a command argument into a Player object?
declaration: package: org.bukkit, class: Bukkit
hi i know you
?
Smile do you have a good starting point to learn nms
guide, practice project, something
project your emotions into general
I need help updating a plugin.
Start with something simple
But have good understandings in regards to your IDE (pssst IntelliJ) and Java
How do I update an outdated plugin?
I know you gotta extract and look for a version
Depend on new spigot then Open the code and fix what's broken
If it is a medium to large plugin and was written before 1.13: Good luck.
It says error loading plugin directory ItemCurrency
Maven, gradle, eclipse's build system or whatever the hell IJ uses?
It says its not a valid plugin file for some reason
I'm looking for a currency plugin that uses coins instead of money/dollar
Would be nice if you were to improve on that answer
Why not just make your own plugin? An eco-system is kind of easy and does not take a lot of work
Depends on the quality you wish to achieve
Idk if the quality us aimed that high if they are just looking for random plugins that use coins online
A barely system can be hacked away in a weekend, but a system that always works takes a lot of skill and knowledge. That takes a good month to complete.
Should I change something here to update the plugin?
Now thats maven xD
Okay - you're using maven.
But neither eclipse nor IJ.
I don't think he understands what he's trying to do with all due respect
What is this error? Plugin already initialized?
https://pastebin.com/tv6y6Ayu
To answer your question: Yes you need to change the version in the version part of the spigot dependency
Youre right I dont. I just want this thing to work properly lol
It should be 1.19.2-R0.1-SNAPSHOT
I was thinking it should be that
Don't create a new instance of your main (JavaPlugin) class
Like so?
Yeah
Now the question is, how to freaking put it back to a jar file 
Just switching dependency won't fix the problem if it's broken on 1.19
I didn't, here are all my classes https://pastebin.com/U19WJzHu
I was just about to say
It's not that simple updating a plugin
Oh, I see what you mean.
oof
But I can't use JavaPlugin twice in the same plugin
Which is required for the spawning of fireworks
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
You pass an instance from the main class
Just send the plugin to me and I'll take a look - perhaps the fix is straightforward
just paste your method to FW class
and remove from main class
and stop nesting ifs
tf is FW
firework i guess
Oh ok lol
guy is unfamiliar with naming classes correctly ig
Ill send it via dm?
How so?
There are conventions for naming things in Java which you should follow
thank you I sent it via dm
Name your classes the way everybody can understand what they are doing
Yeah good thing you did it as otherwise we would have walked in circles. The developer of that plugin apparently gave up on using maven quickly
?conventions
or take FREE JAVA LESSONS from me
(checkmybio)
the great comeback of jree fava lessons
I’ll pass.
Ok listen, if you need to access JavaPlugin from other classes, pass a reference from your main class over to the classes where you need it. For example:
If you need it in the FW implements ( Why is there a space bar in a class file )
in the onEnable() method have this
getCommand("fw").setExecutor(new FW(this));
Then change the FW implements class to accept that parameter in the constructor and assign it to a local variable.
private FWvouches plugin
then you can use plugin.spawnFirework(targetPlayer)
I wanna hire a dev to make a core plugin for me if anyone would be interested
Not the correct channel.
which channel do i use?
Not the correct discord server either
he can use static method tho
and have no need in instance at all
cuz method is pretty simple
and doesn't require loading anything
Screenshotted. Thanks.
You are correct he can use either or. Both are the same
also he can use getProvidingPlugin()
But might as well learn how to pass instances to other classes since it doesn't look like he has much experience
free java lessons are still available
I feel like you’re messing with me, so i’m gonna pass.
wait what
May be better if try to override command from commandmap Object.
The damage of an item is 0 if it's not set, right?
isn't it default item damage?
Just learn OOP paradigm so will be easily learn java, c# and others.
i remember one guy called me a scammer cuz he wanted a plugin and i said i can code it for him in 15 mins
after like 15 minutes he actually believed me and i streamed him the entire process
Ye, it's 0
oh you meant durability
I remember getting scammed because I was dumb and gave a guy my plugin before he payed me lol
ahaha
there's a difference?
never made paid plugins so
i thought the damage you deal with item equipped
Eh I need the money lol
ahh
I wanna afford a nice pc someday
Need to obfuacate the code and make license system if non-paid customer need to install on the server.
nice one
- Won't work 2. Not allowed
^
i'm proud of myself
Its allowed if its private use.
why would you have license system if its private use
Ok
Wait... real?? No kizzy??
I meant he can do anything if he dont release plugin to public.
yeah but im just trying to find logical use-case of license system if its for private use
of course my dude
why download RAM when you can have 64 GB of real ram

Wait... Downloaded ram isn't real?
Bruh I thought that os was distro
it is
Frr
Looks cool
oh it is
Sus servers
uhh, is chatgpt chinese
@halcyon hemlock It can respond in any language
If you somehow made it respond in chinese tell it to speak english instead
I wonder if you could tell it to use pig latin
Probably
does anyone know how to exclude depedencies from shadowJar task inside gradle project?
By making the scope provided
gradle doesnt have provided scope?
Oh gradle
but i get what you mean
in gradle its compileOnly
but the thing is i make this inside my dependency
it works sure
but my depedency lacks of the crucial dependency then
if its packaged inside jar
i want to shade that dependency inside dependency jar but not when i shade it with bukkit classes
i have snakeyaml as a dependency for my project
and since spigot includes snakeyaml
why should i included it inside the jar file
That sounds overly complicated
i just want to setup my project right
Wait so you're making a dependency that has the possibility to be used in spigot?
by marking compileOnly, the main classes would only compile but couldnt be ran since they lack the classes
Or will it always be used with it
one sec
core:
dependencies:
- snakeyaml, if i build core project i want it to package the snakeyaml inside its own jar file.
subprojects of core:
bukkit:
shade dependencies:
- core, but without snakeyaml dependency, since spigot already uses snakeyaml internally to parse configuration.
i want to achieve something like this
it looks like a transitive depedency chain
but whenever i mark core as a depedency as a bukkit which i shade
and inside of the closure i declare transitive it refuses to omit the dependency from the shaded output
// shade core classes to bukkit implementation of project.
implementation (project(path: ":", configuration: "shadow")) {
transitive = false
}
in theory this should work
but somehow it doesnt
Beyond my gradle knowledge so someone else will have to help
as you can see if i open the shaded output, i get snakeyaml inside
which is not what i want to achieve
You'd probably have to exclude it
