#help-development

1 messages · Page 374 of 1

vocal cloud
#

And you changed it in intellij (or w/e ide's) settings as well?

regal scaffold
#

Sdk, java version and language level are all set to 19

graceful oyster
#

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?

vocal cloud
#

Try mvn clean maybe

regal scaffold
#

Did already

#

It just refuses to like it

balmy valve
#

I'm trying to do everything without using NMS I'm afraid, but thank you anyway!

dry yacht
#

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, :/.

balmy valve
regal scaffold
#

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

dry yacht
dry yacht
balmy valve
#

So that’s just a paper thing, funnnnn, well thank you

#

didn’t even think about the fact that the server was paper 🤦‍♂️

graceful oyster
dry yacht
dry yacht
# balmy valve welp then now I have 0 clue

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.

wet breach
#

you should be using the JDBC connector

#

the J version is horribly outdated

regal scaffold
#

That makes sense on why it doesn't work

wet breach
#

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

regal scaffold
#

Gonna switch rn I knew something was outdated about the guide

wet breach
#

just not enough 😛

regal scaffold
#

Man I gotta redo so much again to change it

#

Love outdated -guides

wet breach
#

not sure what guide you were following that told you to use the J version though XD

regal scaffold
#

It's in my browser history

#

But it was an example from spigot itself

wet breach
#

oh from long ago yeah

regal scaffold
#

Love it

#

Do you have an example on sqllite implementation?

wet breach
#

sqlite is just you load it via file handle

#

and then using the file handle and jdbc driver you use sql stuff

dry yacht
wet breach
#

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

regal scaffold
#

All good. Thanks

wet breach
# regal scaffold 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

regal scaffold
#

Thanksss ❤️

dry yacht
# balmy valve Oh yeah sure

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!

balmy valve
dry yacht
#

But a nitpick that I can totally relate to and that would be very much reusable, :D.

balmy valve
#

XD

regal scaffold
dry yacht
regal scaffold
#

I cannot understand what's going on

#
        saveDefaultConfig();
        getConfig(); <------- line 55
dry yacht
regal scaffold
regal scaffold
#

lmao

#

You have a lot of experience

#

Crazy

#

I have the driver shaded, yes

dry yacht
#

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.

dry yacht
regal scaffold
#

Very accurate

dry yacht
regal scaffold
#

Indeed

dry yacht
#

It's such a fail that discord detects your links as downloads, lmao

regal scaffold
#

wtf

crimson relic
#

because of the extension

regal scaffold
#

how

dry yacht
#

Making millions off of stupid ass features but cannot even spend the effort of checking out link destinations, but just use a regex.

regal scaffold
#

So what's going on with this driver error. What are the steps to do here

dry yacht
dry yacht
crimson relic
#

regex cheaper and doesnt really hurt

dry yacht
dry yacht
balmy valve
crimson relic
dry yacht
regal scaffold
#

You fixed it just by saying 5 words

#

We keep progressing down the error chain

#

I never loaded the driver into the plugin

dry yacht
#

Lol, I wanted your connector string, but I just requested the whole class for efficiency, xD.

dry yacht
regal scaffold
#
    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

dry yacht
regal scaffold
#

Negativo

dry yacht
#

Well, it did, as you now seem to have an open connection, if you're at the stage of executing SQL, xD

regal scaffold
#

Oh yeah yeah I mean it worked but we arrive at another error

vocal cloud
#

Don't use auto increment in sqlite

regal scaffold
#

Alright

#

Does that mean I need to set the id myself or can I just let it be?

vocal cloud
#

If you make it a primary key and an INTEGER it handles that for you

regal scaffold
#

We are connected!!!

dry yacht
vocal cloud
#

That's the beauty of it yes

dry yacht
#

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.

vocal cloud
#

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

dry yacht
echo basalt
#

oo mike's on

vocal cloud
vocal cloud
dry yacht
hazy parrot
dry yacht
hazy parrot
#

yeah in sqlite is just without underscore

dry yacht
#

...

#

really? :-:

vocal cloud
hazy parrot
#

ig, let me google

dry yacht
# vocal cloud 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.

dry yacht
# hazy parrot <https://www.sqlite.org/autoinc.html>

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.

vocal cloud
#

Everyone should be able to write their queries without but using something to help doesn't hurt speed and productivity

wet breach
#

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

regal scaffold
#

Yessir, worked good

wet breach
#

At work now so if i am needed my presence isnt guatanteed uwu

balmy valve
quaint mantle
#

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++) {

        }
    }
lost matrix
#

How do you determine that its not increasing?

wet breach
#

Also why using a double?

lost matrix
#

Probably grayscale

quaint mantle
#

And yes

lost matrix
#

Or its just one channel

wet breach
dry yacht
lost matrix
balmy valve
quaint mantle
#

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);
}
dry yacht
dry yacht
#

Well, I'd call that a success then! xD

wet breach
dry yacht
#

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.

lost matrix
dry yacht
dry yacht
wet breach
quaint mantle
lost matrix
#

Yeah but it is increasing

dry yacht
lost matrix
wet breach
#

You can simulate them

quaint mantle
#

Nope just prints 0

lost matrix
#

Once?

dry yacht
# balmy valve yes

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! :)

quaint mantle
#

Yup

lost matrix
#

Then rows is 1

wet breach
#

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

quaint mantle
#

It's not

#

rows is 18

lost matrix
#

Print it out before the loop starts

dry yacht
wet breach
#

Essentially yes

lost matrix
#

So it prints out 0 but nothing else happens afterwards?

quaint mantle
#

Well it crashes after because an index out of bounds happens since it's not looping

lost matrix
#

What?

wet breach
#

Makes sense

dry yacht
# wet breach Essentially yes

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.

wet breach
lost matrix
#

wow...

balmy valve
quaint mantle
#
    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);
    }```
wet breach
#

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

wet breach
#

Which as the discussion above states a lot more work

dry yacht
quaint mantle
#

result[i][k] = array[i][k] * matrix.array[i][k];

wet breach
#

If any of those are 0 the result is 0

#

Which you should check

balmy valve
quaint mantle
#

It's 0 because of the stupid loop

lost matrix
echo basalt
#

yo frost

#

I fixed my pc

wet breach
#

Nice

regal scaffold
#

Hey!

#

event#getHostname()

Returns a pretty big string:

java.domain.net.\\UUID\\IP

echo basalt
#

had to use a rotary saw to cut some stuf

#

and 2 disks exploded on my face

wet breach
regal scaffold
#

How can I cut out everything and only keep java.domain.net

echo basalt
regal scaffold
#

I thought there were better ways I thought on regex

dry yacht
# balmy valve Then why is the vanilla command from your plugin & what smile is doing not playi...

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! :).

echo basalt
#

use a lookahead maybe

quaint mantle
regal scaffold
#

Lets see if chatgpt can build good regex

lost matrix
balmy valve
echo basalt
regal scaffold
#

You beat me to it

#

Sick

#

Works like a charm

#

Chatgpt cracked

quaint mantle
#

That's not the issue though. The loop is the issue because it's not looping

wet breach
regal scaffold
#

lmao

quaint mantle
#

which means 0 is just passing through

echo basalt
#

p much

dry yacht
echo basalt
regal scaffold
#

We'll, he is correct

balmy valve
regal scaffold
#

Bro can I use regex on a String without needing 5 lines?

#

Pattern, matcher, like what

echo basalt
#

lmao

regal scaffold
#

Just let me string.regexthissht(regex)

lost matrix
# quaint mantle which means 0 is just passing through

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

echo basalt
#

pattern should be a constant of a precompiled pattern

#

t hen you create a matcher

regal scaffold
#

Yeah I know it's just dumb

dry yacht
regal scaffold
#

hostname = matcher.find() ? matcher.group() : hostname;

#

Should do the trick

#

And yes, beautifully generated by Copilot

echo basalt
#

copilot is great

#

smarter than you half the times

regal scaffold
#

I had forgotten I had it

echo basalt
#

dog iq the other half

regal scaffold
#

And suddenly sub ran out

#

I tried coding without it

echo basalt
#

I received a fancy email from copilot just being like

regal scaffold
#

3 lines later I bought the year pass

echo basalt
#

"ayo we extended your subscription until like june 2024 glhf"

regal scaffold
#

Once you start with it, can never leave it

#

It's like cocaine

echo basalt
#

or cuddles

regal scaffold
#

sfw

echo basalt
regal scaffold
#

wtf

#

I want that

echo basalt
#

I did not do anything

lost matrix
echo basalt
#

well I have the student pack but it expires this year

balmy valve
echo basalt
#

because I'm gonna finish school this year

crimson relic
echo basalt
#

I mean

regal scaffold
#
        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;
echo basalt
#

mine would be too if they tried charging me

regal scaffold
#

Did i override something?

#

Regex ain't doing it's job

#

Just tested with another string and no bueno

wet breach
#

Should listen to 7smile7 they know what they are talking about and will guide you to the right path uwu

echo basalt
#

the "W" in 7smile7 stands for "wrong answers only"

lost matrix
regal scaffold
#

It's fine now

#

Just the regex was wrong

#

Chatgpt actually messed up the regex

wet breach
#

Lol

wet breach
regal scaffold
#

It's removing it

wet breach
#

The first 1024 or so ports you cant use without elevated permissions

#

Also there isnt a port 0

quaint mantle
lost matrix
lost matrix
wet breach
#

You could but you would need to increase your array sizes to do so

#

But i doubt that would be very useful to do

lost matrix
#

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 has a stride of 1 and no padding so the image shrinks

regal scaffold
#
        <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?

lost matrix
#

Spigot does not provide a sqlite driver. But 12mb sounds bad.
Download using the plugin.yml

regal scaffold
#

wym?

lost matrix
#

You can let spigot download dependencies

#

Then you dont need to shade them

regal scaffold
#

Hmmm

#

Alright

lost matrix
regal scaffold
#

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 (?, ?, ?, ?)
vocal cloud
#

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

opaque scarab
#

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?

lost matrix
#

Latest release version is 5.3.0-Bukkit

#

try <version>5.3.0-Bukkit</version>

opaque scarab
# lost matrix try ``<version>5.3.0-Bukkit</version>``

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

lost matrix
eternal oxide
#

ahh my eyes... so bright!

opaque scarab
wet breach
vocal cloud
#

Jitpack

quaint mantle
#

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();
        }
    }
}
lost matrix
#

Show the error

lost matrix
quaint mantle
#

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

dry yacht
regal scaffold
tender shard
#

intelliJ literally ALWAYS complains about "vulnerible dependencies" lmao

regal scaffold
#

alex I know maven is your speciality

#

Mind giving me a hand

tender shard
#

sure

regal scaffold
#

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"

dry yacht
# tender shard uh

Whoops, thanks for reminding me that I'm including spigot instead of spigot-api! :)

regal scaffold
#

Build failure

tender shard
regal scaffold
#

?paste

undone axleBOT
regal scaffold
#

Is it this?

tender shard
#

oh wrong reply

#

sorry

regal scaffold
#

ummm

tender shard
#

you are supposed to run mvn install:install-file outside of any actual project folder

regal scaffold
#

Ok then yes

regal scaffold
#

I'm running it from a random git bash

#

In my downloads folder

tender shard
#

hm yeah that's correct

regal scaffold
#

The jar is in Downloads/ so that's why no path needed

tender shard
#

are you sure you don't have any pom.xml in your downloads folder?

regal scaffold
#

Yeah I am sure

#

Could something about the jar be the culprid?

tender shard
#

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

regal scaffold
#

The jar itself doesn't have a pom

tender shard
regal scaffold
#

Stsill nothing, could it be the entire downloads folder

tender shard
regal scaffold
#

Let me move somewhere else

tender shard
#

which version of maven are you using?

regal scaffold
#

latest so

tender shard
#

"latest"?

regal scaffold
#

3.9.0

#

Was finding it

tender shard
#

try 3.6.3 for fun

#

it's the version IntelliJ used to include for years

regal scaffold
#

Do you mean get the binaries and do everything for 3.6.3? Change env variables and that?

tender shard
#

if 3.6.3 works, it's the bug report I sent ^

tender shard
regal scaffold
#

ok yes

tender shard
regal scaffold
#

Very much handy'

#

It's like you got these links memorized tf

tender shard
#

not really lol

dry yacht
#

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.

tender shard
#

i just googled "maven download" 😄

tender shard
#

I haven't found out a reason. I am pretty sure md_5 just forgot to update it once

dry yacht
#

Is it really once? I kinda have memories of multiple occasions, but I may be mistaken.

tender shard
#

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

balmy valve
tender shard
#

i have no clue lol

dry yacht
regal scaffold
#

@tender shard

#

This is why

#

you're the goat

#

Smartest man alive

tender shard
#

3.6.3 worked?

regal scaffold
#

So I'll just use 3.6.3

#

Hopefully doesn't mess with anything else

tender shard
#

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

dry yacht
# tender shard i have no clue 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.

tender shard
#

yeah but who decides when it changed "enough" 😄

dry yacht
#

Yep... :')

tender shard
#

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

dry yacht
tender shard
#

yeah

dry yacht
#

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?

tender shard
#

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

tender shard
tender shard
#

1.19.1, 1.19.2, 1.19.3

tender shard
dry yacht
# tender shard yes

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.

tender shard
#

ah ok then my clone is pointless haha

regal scaffold
#

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

tender shard
#

partly

regal scaffold
#

Or is that not how it works

tender shard
#

with remapped, in 99% of cases you can use the exact same code

#

then just change the mappings

dry yacht
# tender shard 🥲

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.

regal scaffold
#

So I assume you have 1 method that decides what version you're on and then you sue different ones accordingly

tender shard
#

but this doesnt always work if there's internal changes

dry yacht
regal scaffold
#

Hmmm well I got lots to learn no clue what remapped is but will read

tender shard
balmy valve
#

Thank you for everything!

dry yacht
tender shard
#

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

dry yacht
dry yacht
tender shard
#

yeah same haha

#

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

dry yacht
# tender shard yeah same haha

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.

dry yacht
tender shard
#

?resources

undone axleBOT
tender shard
#

oh no

#

wait

dry yacht
#

Going to have a look at that, thanks! :)

tender shard
#

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

regal scaffold
#
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

lost matrix
regal scaffold
#

Because it's not unique

#

It's like a table of values

lost matrix
#

So the universally unique identifier is not unique...

regal scaffold
#

It's just amount of rows

#

Cause it's transactions

#

so transaction id 1 = row 1 and so

tender shard
#

then why is the table called "players" instead of "transactions"

regal scaffold
#

Because it's not actually transactions lol

#

It's per player

#

But that still wouldn't explain the error

lost matrix
#

One table per player?

regal scaffold
#

No, ok fine I can change the name to transactions then

#

Still doesn't solve the error

dry yacht
dry yacht
dry yacht
lost matrix
#

I thought SQLite only had null integer blob and text. Where is this int(11) even coming from?

#

Ah and real ofc

vocal cloud
#

You want to do raw INTEGER for your id's

lost matrix
#

iirc primary key should be enough for uniqueness and auto increments

vocal cloud
#

Correct

dry yacht
regal scaffold
#

You might be onto something

regal scaffold
#

The table is actually better called "transactions" as pointed out by alex and smite

dry yacht
#

Yeah, you really need to rename that table, that almost drove me insane, xD

regal scaffold
#

@tender shard Do you have metrics on jefflib?

tender shard
#

you mean, how many plugins etc use it?

vocal cloud
#

I think int(11) would work but it needs to be primary key

dry yacht
regal scaffold
#

I haven't been able to test it just yet but I assume it will because of. well , logic

dry yacht
lost matrix
#

You remind me that i should take a look at bstats again. Maybe someone still uses one of my unmaintained old plugins XD

tender shard
#

that's the only metrics I have lol

vocal cloud
#

Declare it all on one line. id INTEGER NOT NULL PRIMARY KEY

tender shard
regal scaffold
#

I would've thought you would have metrics on how many plugins use it

#

Would be cool to know

tender shard
regal scaffold
#

Really?

#

tf

lost matrix
#

This is the only really used one. The rest are pretty dead...

regal scaffold
#

Just using something like bstats?

regal scaffold
tender shard
#

bstats requires a plugin instance though

lost matrix
tender shard
#

and I'd be phoning "home" to some random server, not really allowed without consent

regal scaffold
#

Competition of Chunky?

dry yacht
regal scaffold
#

We should make a competition chunky vs fcp

vocal cloud
#

If it works then sure tho

tender shard
#

isn't that necessary anyway? I mean you cannot just throw mysql stuff at a sqlite db

lost matrix
regal scaffold
#
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

vocal cloud
#

Check with the primary key the old way if you plan on having both sql and sqlite

dry yacht
regal scaffold
#

Fair, I don't tho since it's a plugin for something really specific

dry yacht
#

You could still at least try it...

tender shard
#

there's a reason why I avoid using DBs at all costs lol

regal scaffold
#

What do you use then? You need something

dry yacht
#

Stuff everything into the PDC and call it a day

tender shard
#

that's why I usually do

#

I mean, I usually only have to save like 3 or 4 booleans per player

vocal cloud
#

That's usually the best way anyways

tender shard
#

soo

vocal cloud
#

The faster the better

lost matrix
# regal scaffold Chunky is really simple tbh

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.

regal scaffold
#

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

tender shard
#

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

lost matrix
regal scaffold
#

Oh no alex! We're losing you to gradle?

lost matrix
#

try clean build, might help

tender shard
#

there was always some issue

tender shard
#

no idea why it refuses to do anything, it doesnt even run the test

lost matrix
#

build -x test trollface

regal scaffold
#

Please provide us with the full stacktrace

tender shard
lost matrix
#

?notworking

undone axleBOT
#

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

regal scaffold
#

I'm meming... Cause you say that lol

tender shard
#
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

lost matrix
#

No idea... any blocking ops in your test?

tender shard
#

not really, it runs just fine in maven

tender shard
regal scaffold
#
tender shard
#

it just stores some data in PDC

#

that's all

regal scaffold
#

99% not related but 1% chance it is

#

?commands

lost matrix
#

Where are your imports? You mad?

regal scaffold
tender shard
regal scaffold
#

Wait so it was related?

tender shard
#

no idea why it's on the same line

tender shard
#

but as said, it works fine in maven

lost matrix
#

Your test directory is not registered.

#

Try rightclick -> mark as -> test sources root

tender shard
#

but that's only for intellij

#

gradle shouldnt care about my intellij settings, should it?

lost matrix
#

Nope

#

But then the folder becomes green

tender shard
#

yeah ik

lost matrix
#

😄

tender shard
#

did that, no change

lost matrix
#

hm

tender shard
#

would have surprised me if gradle would read any intellij files anyway, though 😄

lost matrix
#

Which exact test is stuck?
What happens if you just run test?

tender shard
#

lemme see, 1 sec

ornate patio
#

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

lost matrix
#

They are chunk mapped

ornate patio
#

what does that mean

lost matrix
#

One moment

tender shard
regal scaffold
#

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

tender shard
#

$2 is the second anonymous class declared in that class

regal scaffold
#

And how do I follow this logic? Do I go down from onEnable() until I see the second class declaration?

tender shard
#

kinda, yes

#

well the "interval 6000" should give away which task it is

regal scaffold
#

I would think that too

lost matrix
# ornate patio what does that mean

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

tender shard
#

timings are kinda inaccurate though, e.g. if you got running async tasks that just sleep

#

spark gives a way better output than timings

regal scaffold
#

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

ornate patio
#

Regions aren’t built into Minecraft right

#

By region you mean the custom regions I make

lost matrix
#

I am using spigots BoundingBox

tender shard
#

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

regal scaffold
#

Alex is that 6000 as in 6000 ticks?

tender shard
#

yes

regal scaffold
#
            @Override
            public void run() {
                TimeDown();
            }
        }.runTaskTimer(this, 1200, 1200);
lost matrix
regal scaffold
#

It's really bad

#

And I'm trying to figure out where it's coming from

tender shard
#

you got a link to that source code?

regal scaffold
#

I might not have the most clean code but not even my plugins do this

#

Yeah I do

lost matrix
#

Well... from your Housing task

regal scaffold
#

1 momento

tender shard
#

my test is now running for almost 10 minutes lol

lost matrix
#

Probably a classic like IO on the main thread

regal scaffold
#

It's not my code but when you see it you'll see what I mean. Maybe you can find it isntantly

regal scaffold
regal scaffold
lost matrix
#

First thing i see 😄

#

Good start

regal scaffold
#

Yeah ngl the person that wrote this... idk

lost matrix
#

brb

tender shard
#

I doubt though that a public static field causes any lag 😛

lost matrix
#

This is the troubling method:

regal scaffold
#

lol

#

When I first read it

#

I cried

tender shard
regal scaffold
#

That's some good coding practices

#

You want the full timings report too?

#

There's no sensitive data in them right

tender shard
#

I just wanted to compile it, but...

lost matrix
tender shard
tender shard
regal scaffold
lost matrix
#

Ah you are right

regal scaffold
#

I tried searching for a 6000 interval anything and nada too

tender shard
# regal scaffold

the class is called "me.Loikas.Housing", but that's not included in the .jar you sent

#

no "Housing" class in the .jar

regal scaffold
#

It's main

#

Just renamed it cause it took me 2 hours

#

To build it from no dependencies

#

Had to make the pom, everything

ornate patio
tender shard
#

so what's the full class name, of what was used to be "Housing"?

regal scaffold
#

package me.tomisanhues2.housing.Main

lost matrix
regal scaffold
#

It was pain to get to even compile... who sends source files without a pom

tender shard
regal scaffold
#

... I never checked that dependency

tender shard
#

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

regal scaffold
#

Which is the one you helped me add

lost matrix
#

6000 / 1200 = 5
Maybe there is some modulo 5 logic somewhere

tender shard
#

kinda hard to debug if you always rename your classes everywhere lol

regal scaffold
#

That's what I was sent. imagine

tender shard
#

yeah that seems to be the SaveData method

regal scaffold
#

In computerRP right

#

I have the source too

tender shard
#

well, in what you sent, it's called "Main" and not ComputerRP lmao

#

no clue, you keep sending different stuff

regal scaffold
#

lolol

tender shard
#

if you send the .jar that the server uses, and where the timings come from, it'd be easy to find

regal scaffold
#

I didn't make it it's so odd how it works

tender shard
#

but if you keep sending different jars and projects, then no clue

regal scaffold
#

Sure

lost matrix
#

yeah pls send the jar... im confused

regal scaffold
#

That's the jar

tender shard
#

thx

regal scaffold
tender shard
#

it's this

#

the source code should be somewhere inside "Housing"

#

probably a lambda or a new BukkitRUnnable(...) somewhere

regal scaffold
#

I'll look,

tender shard
#

and yeah, that one also calls SaveData at the end

lost matrix
#

Housing.this.SaveData(false); can probably be called async.
But this plugin is an actual dumpster fire.

tender shard
#

yeah it's really nasty

ornate patio
tender shard
#

also why did they shade "wpregionevents"? shouldnt that be provided by another plugi?

regal scaffold
#

He didn't shade it

#

He literally copied it over

#

And removed the "plugin" feature

lost matrix
# ornate patio In my case there will only be regions in the default overworld, so I can scrap t...
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;
  }

}
tender shard
#

oh boy

regal scaffold
#

And called it from his own plugin

#

No joke

tender shard
#

that can't possibly work

regal scaffold
#

It did

#

Look at the wgregionevents

#

It doesn't extend javaplugin

#

And if you use the actual maven shade

#

It does

ornate patio
#

One more question, what would the purpose of ChunkRegionContainer be? Is it just objects that contain chunks and all regions associated with it?

regal scaffold
lost matrix
#

Yes it contains just a Set<Region>

regal scaffold
#

I can't find it

ornate patio
tender shard
ornate patio
#

Thanks for all this info appreciate it

regal scaffold
#

Oh I see it now

#

Wait a second, the source code I was sen

#

sent, literally doesn't include that code

#

wtf

tender shard
#

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

regal scaffold
#

You are not wrong...

#

Guy called Loika

#

Don't hire lol

tender shard
#

haha

lost matrix
# ornate patio I see

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

lost matrix
# tender shard haha

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.

wet breach
#

Mind if i save this piece of code, might come in handy lol

lost matrix
#

Sure

tender shard
wet breach
#

And with that, back to changing tires uwu

regal scaffold
#

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

lost matrix
wet breach
#

Sweet

tender shard
#

I havent checked what SaveData does

regal scaffold
#

Gotcha, will do some testing

regal scaffold
#

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

lost matrix
tender shard
#

except for the events and listener, it's just one class, yes

ornate patio
ornate patio
#

but your a godsend man thanks so much

#

I’ll save these messages for later

lost matrix
#

Nah its kind of over engineered. Go for the low hanging fruits first.

ornate patio
#

Oh ok

tender shard
#

opinions:

#

should this be split into several lines?

lost matrix
#

I usually put every stream operation in a new line

tender shard
#

I too but intelliJ keeps recking the new lines when doing "Reformat code"

lost matrix
#

Then it will actually look clean and IJ gives you some nice type hints

tender shard
#

yeah

lost matrix
#

Oh Bettanation. One of my favourite specialists. 😄

#

Depends on your statements. How are they evaluated?

tender shard
#

talking about "booleans" and "3 cases"... I remember when I worked for this software company and they used fuzzy logic for EVERYTHING

lost matrix
#

oh god...

remote swallow
#

That hurts

lost matrix
#

In this case i would recommend early returns

tender shard
#

yeah and your method has a weird name

#

yeah

#

first, it uses a noun as name, and second it's Uppercase

remote swallow
#

Do

If (something) {
   Code
   Return
}

If (somethingElse) {
    Code
    Return
}
lost matrix
#
  @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();
  }
tender shard
#

I'd just call it authenticateOnPreLoginEvent or sth

#

or just "authenticate"

regal scaffold
tender shard
#

or "onLogin"

regal scaffold
#

ty alex

tender shard
lost matrix
#

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();
  }
regal scaffold
#

I wanna learn how to use spark now. seems really cool

tender shard
#

yeah spark is indeed cool

lost matrix
#

Pretty nice indeed. A proper profiler is still preferable but spark has some nice tick-based features.

lost matrix
#

"flatlaf" + swing

tender shard
#

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

lost matrix
#

XDD layouts are always a fight for me. But intellij has a pretty decent visual layout manager.

tender shard
#

I never understood how to use the intelliJ builtin one lol

lost matrix
#

Pretty fancy

tender shard
#

someone here, a few months ago, showed me this flatlaf stuff, since then I use it for everything

lost matrix
#

Also bookmarked it

regal scaffold
#

You know something else that's funny @tender shard

#

This plugin was using bungeecord ChatColor import

#

For some reason

tender shard
dry yacht
#

My lord, I found my stupid bit shifting logic error and can now finally enjoy a world of endless TNT, :').

lost matrix
#

You could also just not do that

tender shard
tender shard
#

the name "bungeecord chat api" is a bit misleading, spigot uses it too

regal scaffold
#

I know it does b

#

but why import bungee if spigot has it too

dry yacht
# lost matrix World gen?

Live chunk packet modification, xDD. I'm adding TNT to the indirect palette and substituting all grass block ids for tnts.

tender shard
#

well but if it works, it works, i guess

dry yacht
#

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, :)

regal scaffold
#

I'm debating with giving jefflib another user or making my own

#

@tender shard convince. Shouldn't be hard

regal scaffold
#

How is that not understandable lmao?

#

I'm thinking on starting to use jefflib in my plugins or make my own core

lost matrix
#

You are debating with giving jefflib? Who is "giving jefflib"

regal scaffold
#

Jefflib is alex's library

lost matrix
#

Ah ok i see

lost matrix
regal scaffold
#

You just don't know jefflib

#

The best library on spigotmc and the universe

lost matrix
#

Ive watched jefflib being written my guy

regal scaffold
#

It's a joke...

lost matrix
#

F

lost matrix
polar atlas
#

should i cache location or save it as string literal and create new instance every time? (disclaimer: im looping through this list every tick)

lost matrix
polar atlas
# lost matrix 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

lost matrix
#

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.

polar atlas
#

oh really? didnt knew

lost matrix
#

The gc will not touch the player until he disconnects

polar atlas
#

lovely

lost matrix
#

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

How do I convert a command argument into a Player object?

mighty pier
quaint mantle
regal scaffold
#

Smile do you have a good starting point to learn nms

#

guide, practice project, something

mighty pier
#

project your emotions into general

delicate sluice
#

I need help updating a plugin.

ivory sleet
#

But have good understandings in regards to your IDE (pssst IntelliJ) and Java

delicate sluice
#

How do I update an outdated plugin?

#

I know you gotta extract and look for a version

chrome beacon
#

Depend on new spigot then Open the code and fix what's broken

quiet ice
delicate sluice
#

It says error loading plugin directory ItemCurrency

quiet ice
#

Maven, gradle, eclipse's build system or whatever the hell IJ uses?

delicate sluice
#

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

quiet ice
#

Would be nice if you were to improve on that answer

orchid gazelle
#

Why not just make your own plugin? An eco-system is kind of easy and does not take a lot of work

quiet ice
#

Depends on the quality you wish to achieve

orchid gazelle
#

Idk if the quality us aimed that high if they are just looking for random plugins that use coins online

quiet ice
#

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.

delicate sluice
#

Should I change something here to update the plugin?

orchid gazelle
#

Now thats maven xD

quiet ice
#

Okay - you're using maven.
But neither eclipse nor IJ.

regal scaffold
#

I don't think he understands what he's trying to do with all due respect

quaint mantle
quiet ice
#

To answer your question: Yes you need to change the version in the version part of the spigot dependency

delicate sluice
#

Youre right I dont. I just want this thing to work properly lol

quiet ice
#

It should be 1.19.2-R0.1-SNAPSHOT

delicate sluice
#

I was thinking it should be that

chrome beacon
delicate sluice
#

Like so?

chrome beacon
#

Yeah

delicate sluice
#

Now the question is, how to freaking put it back to a jar file md_5

fluid river
#

build it?

#

mvn clean package

chrome beacon
quaint mantle
regal scaffold
delicate sluice
#

Well

#

We gotta try and see if it works tho

regal scaffold
#

It's not that simple updating a plugin

quaint mantle
#

Oh, I see what you mean.

delicate sluice
#

oof

fluid river
#

no you do

quaint mantle
#

But I can't use JavaPlugin twice in the same plugin

#

Which is required for the spawning of fireworks

chrome beacon
#

?di

undone axleBOT
regal scaffold
#

You pass an instance from the main class

quiet ice
fluid river
#

just paste your method to FW class

#

and remove from main class

#

and stop nesting ifs

orchid gazelle
#

tf is FW

fluid river
#

firework i guess

orchid gazelle
#

Oh ok lol

fluid river
#

guy is unfamiliar with naming classes correctly ig

delicate sluice
#

Ill send it via dm?

quaint mantle
orchid gazelle
#

There are conventions for naming things in Java which you should follow

delicate sluice
fluid river
#

Name your classes the way everybody can understand what they are doing

quiet ice
chrome beacon
fluid river
#

or take FREE JAVA LESSONS from me

(checkmybio)

#

the great comeback of jree fava lessons

quaint mantle
#

I’ll pass.

regal scaffold
# quaint mantle How so?

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)

delicate sluice
#

I wanna hire a dev to make a core plugin for me if anyone would be interested

regal scaffold
#

Not the correct channel.

delicate sluice
#

which channel do i use?

regal scaffold
#

Not the correct discord server either

delicate sluice
#

hmmm

#

my bad

fluid river
#

and have no need in instance at all

#

cuz method is pretty simple

#

and doesn't require loading anything

regal scaffold
fluid river
#

also he can use getProvidingPlugin()

regal scaffold
#

But might as well learn how to pass instances to other classes since it doesn't look like he has much experience

fluid river
quaint mantle
fluid river
#

wait what

quaint mantle
fluid river
#

why do you have such a feeling

#

i actually helped like 10+ guys here already

zealous osprey
#

The damage of an item is 0 if it's not set, right?

fluid river
#

isn't it default item damage?

quaint mantle
#

Just learn OOP paradigm so will be easily learn java, c# and others.

fluid river
#

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

zealous osprey
#

Ye, it's 0

fluid river
#

oh you meant durability

orchid gazelle
#

I remember getting scammed because I was dumb and gave a guy my plugin before he payed me lol

fluid river
#

ahaha

zealous osprey
fluid river
#

never made paid plugins so

fluid river
orchid gazelle
#

Eh I need the money lol

zealous osprey
orchid gazelle
#

I wanna afford a nice pc someday

quaint mantle
#

Need to obfuacate the code and make license system if non-paid customer need to install on the server.

fluid river
#

nice one

orchid gazelle
#
  1. Won't work 2. Not allowed
regal scaffold
#

^

fluid river
#

i'm proud of myself

quaint mantle
fluid river
#

not a scam

hazy parrot
#

why would you have license system if its private use

quaint mantle
#

Ok

orchid gazelle
quaint mantle
hazy parrot
#

yeah but im just trying to find logical use-case of license system if its for private use

fluid river
orchid gazelle
#

Wow!

#

Gotta try that out RIGHT NOW

quaint mantle
#

I downloaded 16gb ram

#

Ih 32 rn

tender shard
#

why download RAM when you can have 64 GB of real ram

quaint mantle
hazy parrot
quaint mantle
tender shard
quaint mantle
#

Frr

tender shard
#

it's the fanciest BSD distro available

#

called macOS

quaint mantle
#

Looks cool

tender shard
#

oh it is

quaint mantle
halcyon hemlock
#

uhh, is chatgpt chinese

rotund ravine
#

@halcyon hemlock It can respond in any language

#

If you somehow made it respond in chinese tell it to speak english instead

eternal oxide
#

I wonder if you could tell it to use pig latin

rotund ravine
#

Probably

mortal hare
#

does anyone know how to exclude depedencies from shadowJar task inside gradle project?

vocal cloud
#

By making the scope provided

mortal hare
#

gradle doesnt have provided scope?

vocal cloud
#

Oh gradle

mortal hare
#

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

vocal cloud
#

That sounds overly complicated

mortal hare
#

i just want to setup my project right

vocal cloud
#

Wait so you're making a dependency that has the possibility to be used in spigot?

mortal hare
#

by marking compileOnly, the main classes would only compile but couldnt be ran since they lack the classes

vocal cloud
#

Or will it always be used with it

mortal hare
#

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

vocal cloud
#

Beyond my gradle knowledge so someone else will have to help

mortal hare
#

as you can see if i open the shaded output, i get snakeyaml inside

#

which is not what i want to achieve

vocal cloud
#

You'd probably have to exclude it

mortal hare
#

and in the root project i get not shaded classes

#

it literally does the reverse

#

what i need