#help-development

1 messages Β· Page 295 of 1

eternal night
#

Pls don't use

tender shard
#

it does what? o0

eternal night
#

That's the thing that turns your "true" into a byte

#

Horror

tender shard
#

it turns the string "true" into a byte?

eternal night
#

Because Mojang interprets the string true as a Boolean or something

#

Idk

#

Been a while

tender shard
#

I remember this very weird bug when deserializing itemstacks that have "json-looking" text stored as String in it's PDC

eternal night
#

It's shit, stay away from pdc and yaml

tender shard
#

and it would break everything and throw exceptions

eternal night
#

Like the combo

tender shard
#

e.g.

ItemStack item = ...;
ItemMeta meta = item.getItemMeta();
meta.getPDC().set(..., "{\"name\": \"mfnalex\"}");
config.set("myitem", item);
ItemStack item = config.getItemStack("myitem"); // <-- huge exception
#

I wonder if this was fixed meanwhile? I once opened a jira issue and md_5 said it's indeed a bug but he won't be able to fix it without breaking other stuff

eternal night
#

It has not

tender shard
#

damn

eternal night
#

Everything as a byte array is the vibe

tender shard
#

I should add a new data type to MorePersistentDataTypes lol

#

DataType.STRING_CONTAINING_JSON

eternal night
#

Or just, again, don't use spigots item yaml shit

tender shard
eternal night
#

Papers item to byte blob XD

tender shard
#

but

  1. more than 30% of servers use spigot
  2. then it's not human readable anymore
#

D:

#

paper should just contribute upstream more πŸ˜›

eternal night
#

Not really possible

tender shard
#

why not? honest question, why is this not possible?

eternal night
#

The people that contribute those patches would have to sign the cla

#

Else they cannot be contributed

tender shard
#

what's the problem with signing it?

eternal night
#

That some people don't want to ? Or that people who have written the patches just aren't around

#

Can't force them

#

Lol

tender shard
#

well that's sad

#

I mean it takes like 30 seconds to sign it

#

and it doesnt have any downsides or anything

eternal night
#

What ?

tender shard
#

which downside does it have?

eternal night
#

You are signing your rights to the patch away lol

#

That's the entire point

tender shard
#

yeah sure, I mean it's an open source project

#

who the fuck contributes to an open source project and then later says "ha you cannot use it, I wrote it"

#

makes no sense in my eyes

#

imho you already give the rights away by contributing to any open source thing, automatically. it's like... inherent to the idea of creating a PR

eternal night
#

Not at all o.o

tender shard
#

not sure if I phrased it correctly

#

my english is only good enough for small talk and to talk about pickles

eternal night
#

My MIT licenced Code still forces every sucker that uses it to include the licence and a credit

#

Spigot doesn't have to do shit

tender shard
#

hm I don't really think I get what you mean

eternal night
#

I mean, my paper patches will have my mail and username as credit. If we ever get rid of them and move them to commits, I'll be the author of that commit etc

#

Spigot just, absorbs your stuff

#

You loose any form of ownership of the code

#

Which is the entire point so no one can trash them like Bukkit

tender shard
#

yeah okay but what are you going to do with the ownership? sell it to someone or what?

#

or make paper remove it again when you don't feel like contributing anymore?

eternal night
#

I mean it's a licence discussion. This is more about moral and concept than anything else lol

tender shard
#

honest question, I cannot think of a legimite reason why keeping the ownership would be relevant

eternal night
#

No like a single plugin gives two shits about licencing

tender shard
#

so MiniDigger could just say "Nah I don't feel like MiniMessage should be in paper anymore" and then they'd have to remove it again ? or am I misunderstanding sth lol

#

i think I'm misunderstanding sth

eternal night
#

But at this point it's also just a dumb business move to contribute to spigot lol XD

tender shard
#

it's also always a question about where copyright starts and where it ends. for example I added these 4 translation key methods to spigot (well I PRed them) and then found out that paper does it basically exactly the same way. One could now say that I "stole" this but I wrote this shit myself. I mean it's just a few lines - now the question is, if two people write the same code without having copied each other, does that count as "stealing" that code?

#

because if that'd be the case, then every Hello World program would basically be stolen from s/o else

#

I even accidentally used the same variable names haha

#

nmsItemStack e.g.

#

but tbh how else would one call an NMS itemstack

eternal night
#

Yea it's a iffy thing obviously

#

Especially with how some fixes just, fhere is only one way to fix them

#

Or API that just, makes sense

tender shard
#

exactly

eternal night
#

Hence no one is going completely nuts about this kind of stuff

tender shard
#

that's also why I had this discussion with this dude on paper's discord about the bukkit api

mighty aurora
#

Quick Question. Would a valid method(this was suggested to me and it doesn't seem like it would work but I want to run it by some people who know more than me) to turn players completely invisible(armor and all) be to basically move their armor to an armor stand that is set to be invisible?

tender shard
#

I mean cmon, obv an interface that represents a player is called Player

tender shard
eternal night
#

There is also player#hide and show

tender shard
#

oh yeah

mighty aurora
#

player hide prevents the player from taking damage.

eternal night
#

It does yea

tender shard
#

then use setVisible(false)

mighty aurora
#

I didn't know that was a thing.

#

thanks

tender shard
#

I am pretty sure it is

#

hide(...) basically makes it hidden completely from clients (they dont know this entity exists), while setVisible(false) just makes it not "render" them

#

unless I am mistaken

eternal night
#

But anyway, I mean no one is going nuts and screaming at spigot if something similar is submitted to them. Obviously don't like it too much because well, the extra apis we add is an advantage for us.

#

Don't know what setVisibke does tbh

mighty aurora
#

.setVisible on a player doesn't work

tender shard
#

well this one dude on stash sent a kinda passive aggressive comment lol

#

that already made me not wanna contribute anything anymore haha

eternal night
#

Well, md used to be rather careful on anything looking remotely like paper patches

tender shard
mighty aurora
#

doesnt prevent armor visibility

eternal night
#

No need to move the armour to an armorstand tho

tender shard
eternal night
#

People do a lot of things

tender shard
#

so even if I stole it from paper, that'd be my responsibility and not Spigot's

eternal night
#

Well yea, does not hurt to still check

#

Does spigot have the sendEquipmentChange stuff

#

Might be better here for armour

tender shard
#

IIRC the CLA basically just says this:
"Everything I contribute was done by me and I have the rights of that code. But now it's yours. If I fucked up, that's my responsibility"

eternal night
#

Yet you'll also double check the road before crossing a cross walk just in case a car does not see you

tender shard
#

you mean like sendBlockChange but for equipment, right?

#

if so, yeah that exists

eternal night
#

Sure it wouldn't be your fault but safe is safe

eternal night
#

Oh yea

#

Might be nice to hide the armour then

tender shard
#

wait wait wait

#

does an invis potion not affect the armor?

eternal night
#

No?

tender shard
#

I never play minecraft, so I have no clue

#

lol

mighty aurora
#

it has no effect on armor

tender shard
#

how weird

rich pewter
#

How do you write to a yml file?

tender shard
#

If so, call save(File) on it

eternal night
#

Pdc for plugins when then

tender shard
#

that's your job

#

you are the pdc dude

#

I only write libs related to pdc

tender shard
#

btw is there any official docs or something that notify about api changes in paper? I know that spigot doesn't have any so I always miss the new stuff

eternal night
#

We usually release a little update post on the discord

#

πŸ˜›

tender shard
#

half of the people here are banned from your discord

eternal night
#

Every like 2 weeks or month

#

Otherwise twitter gets the same post

#

If you use that

tender shard
#

I could create an alt discord account

#

not_mfnalex#0001

eternal night
#

Once I finish my thingy, I should start making YouTube shorts covering API changes

jagged monolith
eternal night
#

And get the fat stacks from YouTube

#

For doing shorts

#

For 3 people

tender shard
eternal night
#

It's not so bad lol

tender shard
#

yeah well but it also has entries like "Updated SnakeYaml" and stuff which are useless if you just want to see api changes

#

so yeah it's not perfect but it's okay

#

I'd rather like to see some blog posts or sth

#

e.g. when PlayerProfile was added in 1.18.1, NOBODY knew about it

eternal night
#

We need a slicedlime update video series for API 😦

#

A weekly podcast lol

tender shard
#

I want to see md_5 becoming a tiktoker

eternal night
#

I'd follow for sure

tender shard
#

same lmao

#

my boyfriend is such a weirdo, he has 17k followers on tiktok

eternal night
#

Famous af

tender shard
#

all his videos are shit

#

he's just lipsyncing some songs or similar

#

i never understood tiktok

jagged monolith
tender shard
#

on the other hand, there's many things I don't understand

#

I am a tax lawyer but I couldn't do my own tax returns lol

#

oooh TeleportCause.DISMOUNT was finally added

#

hi verano

#

we all saw you typing

sterile token
#

What would the best way, for having a common sender for bungee and spigot?

tender shard
#

create an interface that declares all the methods you need, then create a bungee module and a spigot module with a wrapper class for the underlying sender that implements your interface and just delegates the stuff to the underlying object

eternal night
#

Use adventure for everything πŸ™‚

#

There ya go

sterile token
tender shard
#

we got geyser, to make bedrock players join java servers. we got viaversion to make 1.19 players join 1.8 servers. we got mohist to run spigot plugins on forge (well, more or less...).

When will we have a thing that allows spigot plugins to run on bungee lmao

tender shard
sterile token
tender shard
#

you create two modules. E.g. MyAPI-spigot and MyAPI-bungee

sterile token
tender shard
#

both have a class that wraps the underlying sender, and then delegates

#

e.g.

sterile token
#

That is were im mixxed

tender shard
#
public class SpigotCommandSender implements MyUniversalCommandSender {

  private final CommandSender sender;
  
  public SpigotCommandSender(CommandSender /* the spigot one */ sender) {
    this.sender = sender;
  }

  @Override /* declared in your MyUniversalCommandSender interface */
  public String getName() {
    return sender.getName();
  }
}
#

basically like how CraftPlayer etc works

tender shard
#

however I don't see many usecases for this. Bukkit and Bungee player objects are extremely different

sterile token
#

yeah i thought something like that and then how i would call it via the Command?

tender shard
#

I mean, all they have in common is that they have a name, a uuid, and that you can send messages. oh and that they can have permissions

#

that's basically all they have in comm on

sterile token
#

Im doing it for my cmd framework that why

tender shard
#

your command framework would then just take a MyUniversalCommandSender instead of a bukkit or bungee one

sterile token
#

yeah i know that

tender shard
#

from spigot you'd just do new SpigotCommandSender(theActualSpigotCommandSender)

sterile token
#

I have smth like this public abstract boolean execute(Sender sender, String[] args);

sterile token
#

Let start from begining, how would you do the command registration for bungee/spigot

#

I dont really understand the delegation part between diff platforms

tender shard
#

uwu

buoyant viper
#

?jd-s

undone axleBOT
tender shard
#

ha noob

#

you need the spigot docs

sterile token
#

What?

tender shard
#

chads like me know everything by heart

sterile token
#

I know how to register command on spigot and bungee, just dont know how to create the command framework so its support both of them

#

Mainly the delegation part

tender shard
#

verano sometimes I think you're living in a different world lol

#

I wasn't talking to you

sterile token
#

HMNN

#

πŸ€”

tender shard
sterile token
#

You broken my brains, are you talking with ghosts?

#

πŸ’€

tender shard
#

I'm doing a trivia in #bot-commands brb

sterile token
#

ohh ok

rich pewter
#

if there is a list of player names in the plugin comfig.yml file, how would i get them as an OfflinePlayer[]?

tender shard
#

anyone up for some trivia?

#

verano meet me in the trivia channel pls

#

I am bored

tender shard
#

imagine your config looks like this:

#
players:
  - mfnalex
  - verano
#

then you could turn that into a list of offlineplayers like this: (1 sec, gotta type)

jagged monolith
#
            for(String user : userDataFile.getConfigurationSection("Users.").getKeys(false)) {
                OfflinePlayer player = Bukkit.getOfflinePlayer(UUID.fromString(user));

                if(player.isOnline()) {
                    getUserDataMap().put(UUID.fromString(user), new ConcurrentHashMap<>());
                }
            }

This is an example from my own plugin.

tender shard
#
List<OfflinePlayer> players = getConfig().getStringList("players").stream()
        .map(Bukkit::getOfflinePlayer)
        .collect(Collectors.toList());
rich pewter
#

ok ty

#

ill try it tmrw gotta go sleep

tender shard
#

@sterile token why are you not in #bot-commands ?

sterile token
tender shard
#

you are supposed to say "hi" in #bot-commands now

#

and then we play a trivia game

sterile token
#

If im not wrong when you compile, the comments are ignored

buoyant viper
jagged monolith
#

Yeah, i'd say the comments were ignored.

sterile token
#

So if you write any docs in the code, during compile they are just ignore

#

if im not wrong they will be always remove

buoyant viper
#

a compiled class file wont have comments/javadocs p sure

sterile token
#

yeah

buoyant viper
#

no matter what compiler u use

sterile token
#

You will have to generate the docs, from those comments

#

Its not posible

#

On IJ there is a tool for that

sterile token
#

No

#

If you are using maven they will be downloaded im not sure how that works sorry

buoyant viper
#

if u do it through maven i believe itll be a separate jar called like <artifactId>-<version>-sources.jar

sterile token
#

The problem is that you will have to upload it too

#

That are the main reason in my case of having my own remote maven repo for coding, so i just deploy my libraries there and i dont need to care about that type of things

wet breach
#

If you want people to be able to see the code after compiling. You need to attach sources

#

This will also leave the comments in place as well

opaque scarab
#

Anyone know of a good way to internally stop a task?

#

Yes I’m a beginner here

sterile token
#

Also i will recommend using the spigot docs, for this type of questions

#

?jd-s

undone axleBOT
opaque scarab
#

@sterile token Thanks, that worked!

sterile token
quaint mantle
#

hi

#

i am implementing a command right now. The command is called join and when a player uses the join command, it takes the name of the game as an argument, and it looks through a hashmap for that name and runs a runnable.

#

and passes the onCommand() method's arguments to the runnable.

#

here is what the code looks like.

#

games.get(gameName).run(sender, cmd, label, args);

#

i am getting a red underline on this code, how do i register a runnable that has parameters as well?

#

i was looking into consumers but they seem to only take one argument at most.

buoyant viper
#

assuming ur not using the Runnable for anything other than run(), make a class that has a method that takes in those parameters

#

like

public class YourClass
  public void theMethod(CommandSender sender, Command command, String label, String[] args) {
    // do stuff
  }
}```
quaint mantle
#

oh ok

#

then i could use like i show below, right?

YourClass name = new YourClass() {
  public void theMethod(CommandSender sender, Command command, String label, String[] args) {
    // do stuff
  }
};```
buoyant viper
#

yeah

quaint mantle
#

okay, just making sure since i have not really done a lot of java programming.

#

also, can i perhaps create another class that implements or extends Runnable?

buoyant viper
#

yeah

#
public class YourClass implements Runnable {
  @Override
  public void run() {
    // do stuff
  }
}```
#

Runnable is an interface last i rmemeber, so non-interfaces use implements keyword

#

?learnjava will probably help u on ur adventures too @quaint mantle

undone axleBOT
lavish hemlock
# quaint mantle i was looking into consumers but they seem to only take one argument at most.

There are BiConsumers but it's also possible to define your own functional interfaces.
Note that they're primarily intended for lambdas.

@FunctionalInterface
interface QuadConsumer<T1, T2, T3, T4> {
    void accept(T1 t1, T2 t2, T3 t3, T4 t4);
}

void myMethod(QuadConsumer<String, String, String, String> consumer) {
    consumer.accept("michael", "it's", "your", "birthday");
}

myMethod((s1, s2, s3, s4) => {
    // ...
});
#

I typed that on phone.
Kill me.

quaint mantle
#

Is it possible to modify something's texture ingame?
By sending packets or something like that?

nova tiger
#

hi i am looking for some plugin devs that can help me with a server dm me if you are interested you will get more info if you sent me

lavish hemlock
#

Via a plugin? Probably not. You'd want to have the server send a resource pack.

quaint mantle
lavish hemlock
#

Possibly. You can check wiki.vg to see.

quaint mantle
#

Ok thanks

cold field
#

OK. I give up plugin licensing is a mess

lavish hemlock
#

What's your problem

nova tiger
#

hi i am looking for some plugin devs that can help me with a server dm me if you are interested you will get more info if you sent me

lavish hemlock
#

Don't spam your advertisement

nova tiger
#

ok

quaint mantle
#

@lavish hemlock i guess i found something that might help

vale ember
#

is there a way to avoid unchecked cast here? (projectile is of EntityType)

player.launchProjectile((Class<? extends Projectile>) projectile.getEntityClass());
distant ridge
#

How can I change the bot's "playing: whatever" or "watching: whatever" using DiscordSRV's API?

ivory sleet
#

So do it through JDA

twin venture
#

Hello friends , i have a bit of problem with json saving :
so the description is a single line , but its add each word in new list .. how i can fix that? or is this how its looks like?

#

iam not sure if iam doing something wrong .. :

#

desc + effects + i will also add requirments

humble tulip
#

@twin venture use a string for the description, not a String array of words

quaint mantle
#

Yeah youre using a list its going to implement each string on its own

ivory sleet
#

Well if you use gson, you could always define a typeadapter for it

vale ember
humble tulip
#

Wait what?

vale ember
#

projectile is EntityType

humble tulip
#

Ah

#

Where do you get the entity type from config or something?

vale ember
#

yeah i deserialize it

humble tulip
#

Well then deserialize it to the Class

ivory sleet
#

You can’t really avoid the unchecked cast then

vale ember
#

k guess ill just suppress it then

humble tulip
#

So store the projectile class somewhere in your code after deserializing

#

And check that it extends projectile.class

twin venture
humble tulip
ivory sleet
#

Thats a string

#

Of course you can define what a list is based of a string

#

But semantically

humble tulip
#

Do u want ',' to mean new line?

ivory sleet
#

Thats a string

twin venture
#

yes new line .

humble tulip
#

Ok well don't join the string[] with ', '

#

Just ' '

twin venture
#

i have tried to do it but didnt know how with json ..

#

ok thx i will try

humble tulip
#

It's not a json problem

twin venture
#

ok i will try today thx ..

quaint mantle
#

Is there a way I can just listen for all serverbound packets using protocolLib?

worn tundra
#

You could always do a for loop πŸ™„

twin venture
#

yeah that fixed it

quaint mantle
#

how to upload a premium resource??

hybrid spoke
jagged monolith
undone axleBOT
quaint mantle
quaint mantle
#

ty

#

hi, how do i get the chat color code for the wool material?

summer scroll
#

What should I do If I want to create a playtime system but I can get the information about weekly/monthly playtime for the players.

buoyant viper
#

and then obv some wools wont have a chat color

#

like Brown

dry yacht
lavish hemlock
#

Or, if you support hex colours, then yeah you can just use the hex colour for brown wool lol

quaint mantle
#

but i have another problem right now.

#

so, i dont want players to be able to change anything in their inventory; the players should not be able to move any items, drop any items or place them or use them, i want every item in their inventories to remain in their original slots, how can i do it?

#

I tried the InventoryClickEvent but there does not seem to be a method called getPlayer() to get the Player object because I wanna check the player against a list of players to determine if the event should be cancelled for that player or not.

tall dragon
#

can any1 explain how to actually read server crash stack traces.

#

cuz all the threads get dumped but idk which one is actually causing issues

river oracle
#

No getPlayer for click event

dry yacht
dry yacht
dry yacht
formal bear
#

How to handle multiple queries at once? I set up HikariCP connection pool, but after spamming 3-5 times query on command, it crashes.

#

Transaction or smh? Is it possible

tardy delta
#

what crashes

formal bear
#

Connection

eternal oxide
#

?paste crash log

undone axleBOT
tardy delta
#

jvm crash 🀑

formal bear
#

        try {

            PreparedStatement preparedStatement = getConnection().prepareStatement(query);

            int x = 0;

            if (!query.contains("?") && args.length == 0) return preparedStatement;

            for (String var : args) {
                x++;
                preparedStatement.setString(x, var);
            }

            return preparedStatement;

        }

        catch (SQLException error) {

            error.printStackTrace();

        }

        return null;

    }

    public void executeQuery(PreparedStatement preparedStatement) {

        if (isNotConnected()) return;

        ProxyServer.getInstance().getScheduler().runAsync(instance, ()-> {

            try {

                preparedStatement.execute();

                preparedStatement.getConnection().close();

            }

            catch (SQLException error) {

                error.printStackTrace();

            }
        });
    }``` executing query methods
tardy delta
#

i once made the jvm crash with worldedit :)

#

not closing statements too, very good

#

and x should start at 1

eternal oxide
#

don't close the connection when using Hikari

tardy delta
#

ah youre incrementing it before :/

tardy delta
#

i always closed them and never had issues

eternal oxide
#

no it closes it and forces Hikari to open a new one

tardy delta
#

🀑

formal bear
#

So leave only execute()?

eternal oxide
#

Yes I believe so

#

I actually ran out of connections when testing it due to hikari having to open new connections all the time

warm mica
ivory sleet
#

ProxyConnection::close iirc from Hikari just lends the connection back to the HikariPool instance

#

ofc with proper locking mechanisms

eternal oxide
#

In my experience it didn;t, but I may be wrong

ivory sleet
#

Hmm, maybe the pool was configured in that way then

#

but by default hikari should abide by the object pool pattern

formal bear
#

        String INSERT = "INSERT INTO user_codes (code) VALUES ";

        for (String code: codes) INSERT += "('" + code + "'), ";

        INSERT = INSERT.substring(0, INSERT.length() - 2);

        PreparedStatement preparedStatement = mySQLDatabase.prepareStatement(INSERT);

        ProxyServer.getInstance().getScheduler().runAsync(instance, ()-> mySQLDatabase.executeQuery(preparedStatement));

    }``` After testing it with command /codes (prefix) (amount of codes)
#

It just stops responding

eternal oxide
#

Use batch for multiple inserts

formal bear
#

Instead of VALUES (x), (y), (z)?

eternal oxide
#

no you use PreparedStatement#addBatch

#

sec

formal bear
#

i understand

#

add inserts to batch

formal bear
#

multiple insert queries into batch

eternal oxide
#

be sure to conn.setAutoCommit(false); and then enable it after

#

as when using batch you have to call commit yourself

#

It seems I do close my connection using Hikari

#

as I use a try with resources

formal bear
#

What about refreshing? For example UPDATE query?

eternal oxide
#

update can batch too

formal bear
#

Sure, thanks

#

And the last question, how to sync properly? For example once a second or smh? When players would start to query data with commands

#

For example 10 players will execute command at once

#

Just async for every query or

eternal oxide
#

you keep relevant data in memory and push to sql when changed. interval depending on how important the data is

summer agate
#

Is there anywhere I can find which java versions are compatible with which minecraft version? As far as I know mc 1.16 is up to java 16, and above requires java 17?

remote swallow
#

All versions below 1.16 are 8, 1.17 is 16 and all higher are 17

summer agate
#

would java 17 work with mc 1.16?

remote swallow
#

It would not

#

Actually

warm mica
#

You can even use Java 17 with Spigot 1.8 if the software and the plugins support it

summer agate
#

Not true, I am unable to run buildtools for 1.16 with java 17 installed

#

nope, a clean spigot server on 1.16.5 requires java 16 max to run (on linux at least which shouldn't be any different). Therefore you can't use java 17 for 1.16 plugins since java 16 doesn't know what to do with java 17 files

ivory sleet
#

Yeah iirc some libs prevents u from using too modern java versions

#

Server sidedly

summer agate
#

Guess I'll have to drop support for 1.16 then. Trying to use an api compiled on java 17

ivory sleet
#

An api,

#

?

#

Which api

summer agate
#

plotsquared

ivory sleet
#

Cant u use a version of that api which is compiled on j16?

summer agate
#

one of my codevelopers looked into it and the latest version on j16 was for max 1.17

ivory sleet
#

Hmm

#

In worst case you might have to write a proxy layer

summer agate
#

I was already going to drop 1.16 though when mc 1.20 comes out. Might as well do it earlier

ivory sleet
#

Ah alt

#

Alr

summer agate
#

only 3.3% of my users still use 1.16.5 and they can just keep using the old release

ivory sleet
#

Ye

#

So if you’re masochistic enough

#

You could work with abstractions

#

As by the means of having one module per version

#

(Or method+varhandles/reflection)

summer agate
#

Yeah no, I have already abstracted our code to be compatible with a forge (as in common code with an implementation for each) and I am never doing that stuff again if I can help it

ivory sleet
#

Its easier with spigot

#

Because you have the spigot api

#

And forge api consisting of events mostly (bit different)

summer agate
#

It will only be a small part of the plugin, so not going to bother

ivory sleet
#

Alr gl then

summer agate
#

Might as well drop 1.17 then since only 2.7% uses it

vale ember
#

is Bukkit's scheduler's delayed tasks reliable (cuz ticks per second isn't constant right?), or should i use java's executor for scheduling delayed tasks?

summer agate
#

Depends on what you want to use it for I suppose

vale ember
#

like ability cooldowns

vale ember
summer agate
#

You want server ticks for that, because that would mean that if the server lags, abilities are slowed too, so bukkit scheduler

earnest socket
#

I'm trying to make a cannon but I am having trouble making the cannonballs fire in the correct direction. I am currently summoning falling blocks. How should I go about doing this

ivory sleet
#

Well i don’t know if SES is much better

earnest socket
#

the direction of the cannonball should be the same as the armorstand's rotation that I use for the cannon btw

ivory sleet
#

Cuz I assume you want to jump back to the server thread when executing the tasks areg?

ivory sleet
#

Go with bukkit scheduler

vale ember
#

k thanks

ivory sleet
#

Cuz with SES you will want to have another ES which is gonna cause sone latency already + a delegation back to the bukkit scheduler

summer agate
#

This is also a good idea yeah, just save when the last ability was used, and when someone tries to use it, check if the time since then is greater then the cooldown, if yes then they may use it

vale ember
#

so i need a set to be concurrent if i am modifying it from task run via BukkitRunnabel#runTaskLaterAsynchronously, right?

ivory sleet
vale ember
#

is it better than Collections.synchronizedSet(new HashSet<>())?

mighty aurora
#

What would the best way to be to determine the air block just prior to the block determined by a raycast?

eternal oxide
#

subtract teh vector from the hit location

ivory sleet
#

Its faster

tardy delta
#

Collections.synchronizedSet just wraps the synchronized keyword around all interactions iirc

ivory sleet
#

Yep

tardy delta
#

should check impl but idk how to install ij on linux :/

#

app store broken

ivory sleet
#

No what you said is correct

tardy delta
formal bear
#

Why with app store??

tardy delta
#

idk how to install from tar.gz :/

formal bear
#

You can install Toolbox easily

tardy delta
#

dont even know how to install from that

#

why cant they just give a deb file

formal bear
#

Just use dpkg

remote swallow
#

no

formal bear
#
cd jetbrains-toolbox-1.27.2.13801
sudo dpkg -i jetbrains-toolbox-something.deb```
remote swallow
#

if you mean about alex he changed his actual discord name

#

cafebabe doesnt/cant add a nick if it matches your current name

#

lol

#

no clue

#

i think that might still keep the nick

#

been as its already been applied

formal bear
remote swallow
#

discord be like

#

ah

tardy delta
formal bear
#

I'm using mac silicon rn so i dont know whats inside that tar sorry ;D

remote swallow
#

just install ij off the jetbrains website

tardy delta
#

got it

formal bear
tardy delta
#

intellij blocking

twilit roost
#

whats the max length of GUI Title?

formal bear
#
[15:58:07 INFO]: [CODES] foo0s65WOa7
[15:58:07 INFO]: [MANAGER] Creating statement...
[15:58:07 INFO]: [MANAGER] Created statement!
[15:58:07 INFO]: [MYSQL] Executing batch...
[15:58:07 INFO]: [MYSQL] Executing batch after if...
[15:58:07 INFO]: [MYSQL] Trying to send data!
codes bar 1
[15:58:10 INFO]: [CODES] barGi7kQLsR
[15:58:10 INFO]: [MANAGER] Creating statement...
[15:58:10 INFO]: [MANAGER] Created statement!
[15:58:10 INFO]: [MYSQL] Executing batch...
[15:58:10 INFO]: [MYSQL] Executing batch after if...
[15:58:10 INFO]: [MYSQL] Trying to send data!
codes dan 1
[15:58:16 INFO]: [CODES] danJHHlHnbg
[15:58:16 INFO]: [MANAGER] Creating statement...
[15:58:16 INFO]: [MANAGER] Created statement!
[15:58:16 INFO]: [MYSQL] Executing batch...
[15:58:16 INFO]: [MYSQL] Executing batch after if...
[15:58:16 INFO]: [MYSQL] Trying to send data!
codes que 1
[15:58:24 INFO]: [CODES] que57xJTwFu
[15:58:24 INFO]: [MANAGER] Creating statement...
[15:58:24 INFO]: [MANAGER] Created statement!
[15:58:24 INFO]: [MYSQL] Executing batch...
[15:58:24 INFO]: [MYSQL] Executing batch after if...
[15:58:24 INFO]: [MYSQL] Trying to send data!
codes pug 1
[15:58:34 INFO]: [CODES] pugu8FwfpY6
[15:58:34 INFO]: [MANAGER] Creating statement...``` Hmm, after 4 queries, executing function does not run
eternal oxide
#

are you closing yoru statement?

formal bear
#

Connection? Nope

eternal oxide
#

PreparedStatement

formal bear
#

I will test with closing statement

#

one sec

#

        if (isNotConnected()) return;

        // goes here and prints nothing, no exception nor executing

        try {

            ProxyServer.getInstance().getLogger().info("[MYSQL] Trying to send data...");

            preparedStatement.executeBatch();

            preparedStatement.close();

            ProxyServer.getInstance().getLogger().info("[MYSQL] Data has been sent! Closing statement...");

        }

        catch (SQLException error) {

            error.printStackTrace();

        }

    }```
#

the last one only created the statement

brittle loom
#

Hello, I'm storing a Map containing both an itemstack and another object in a data.db file. I'd like to delete the Map if the itemStack no longer exists (example player died in lava and the item got burnt or item was thrown in the void, etc), does anyone know any method or event I could use to accomplish this?

remote swallow
#

listen to item drop, inventory click ect events and check if it was that item, if it was remove the map

formal bear
#

?paste

undone axleBOT
remote swallow
#

you should not use exceptions to control code flow

river oracle
#

Panic and shutdown the server

river oracle
#

Oh wait lol he is literally using it to do something

#

I thought you meant like don't use exceptions and throw stuff

remote swallow
#

ahh lol

worldly ingot
#

Oh yeah, no that's horrible lol

#

Theoretically, you should be able to check if the statement is closed. Anywhere you're accepting a PreparedStatement you should have an open connection. You can't get a PreparedStatement instance without a connection

#

So if you really want to make that check, you can check if (preparedStatement.isClosed())

formal bear
#

Okay thanks

mighty pier
#

?learnjava

undone axleBOT
sharp ridge
#

What should I use to obfuscate remapped nms classes in gradle?

#

is there a way how to use SpecialSource for gradle projects?

remote swallow
#

theres some special source plugins on gradle otherwise you would need to use paperweight userdev

sharp ridge
#

alr

#

thanks :D

remote swallow
#

np lol

twilit roost
quaint mantle
#

How to program an anti-ban listener?

remote swallow
#

check if the player is banned on async pre login event

#

if they are remove them from the ban list

chrome beacon
#

anti ban listener?

#

Why do you need that

torn shuttle
#

if I want to copy a world multiple times to have multiple versions of the same world which files do I need to delete to make sure that I don't get mc to think I'm trying to load the same world multiple times?

remote swallow
#

cant you just rename them and mc says its different

torn shuttle
#

no

#

worlds have an id file somewhere

#

if two of the same id try to load in mc locks the second one

chrome beacon
#

I believe the Spigot API uses the folder name

remote swallow
#

could be level.dat or session.lock

chrome beacon
#

so its fine

torn shuttle
#

mc still locks it

#

I already got the session.lock, I was wondering if there was more

#

trying to document this so I stop getting lost

remote swallow
#

might be in level.dat if its not session

torn shuttle
#

it's annoying because you brick the world when you get it wrong

#

and it's a bit tricky to test on this setup

remote swallow
#

backups

torn shuttle
#

yeah I have them, still annoying

formal bear
worldly ingot
#

Well you're allowed to use try and catch. We're not telling you not to. We're saying that use of a try catch to handle the flow of logic is wrong. Your isNotConnected() method is an inappropriate use of try/catch

#

Your executeBatch() method can be changed to use PreparedStatement's isClosed() method instead, but I ultimately think that checking whether or not the statement is closed is a bit redundant given that you're only able to get a statement instance from an open connection

#

Regardless,

    public void executeBatch(PreparedStatement preparedStatement) {
        ProxyServer.getInstance().getLogger().info("[MYSQL] Checking if connected...");
//         if (isNotConnected()) return; // Replace this
        try {
            // With this
            if (preparedStatement.isClosed() {
                return;
            }
            // ^^^

            ProxyServer.getInstance().getLogger().info("[MYSQL] Trying to send data...");
            preparedStatement.executeBatch();
            preparedStatement.close();
            ProxyServer.getInstance().getLogger().info("[MYSQL] Data has been sent! Closing statement...");
        }
        catch (SQLException error) {
            error.printStackTrace();
        }
    }```
torn shuttle
#

try{
steal(choco, heart);
} catch (Exception ex){
jail(this, 10000);
]

worldly ingot
#

I don't actually know if isClosed() throws an SQLException. If it doesn't, you can pull that up a bit

remote swallow
#

?ischocoreal

undone axleBOT
#

No, Choco is not real. I was not programmed to say this by Sam.

torn shuttle
remote swallow
#

anyway even if choco was real

#

mrs choco has already took it

torn shuttle
#

I heard they're making a romcom movie about that, it's called dum and dummer

worldly ingot
#

She's not Mrs. Choco. yet

torn shuttle
#

so you're saying we have a chance choco

remote swallow
#

she will be, from what your saying, which is all that matters

#

are your dogs going to be ring bearers

torn shuttle
#

if by that you mean they'll be eating the rings then yes

remote swallow
#

instead of them carrying them in their mouth or on their back they eat them and take a dump when they are needed

dry yacht
# quaint mantle hi, how do i get the chat color code for the wool material?

Btw, just curious, is this still an active issue? I don't know how much a version-independent and color-accurate solution is of importance to you, but: It wouldn't be a big deal to get the current server version, go to mojang's version manifest and find the corresponding client.jar url, extract the assets folder, query all block PNG files, calculate their average RGB color and store this information into a JSON-based table, which you can then load when the plugin loads. You version supports hex-colors, and that would most definitely give you the most accurate results available, for all blocks - not only for wool.

Otherwise, the quick and easy way would just be a lookup-table implemented as a switch-case block, where you match materials to chat-colors, obviously.

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

Item name not changing on checks

spring pike
#

Hello, I have a pvp server for me and my friends, and, when fighting, damage sometimes gets dealt withtout "cooldown", even though there should be 10(?) ticks of invincibility when a player gets damage. What could be causing this? I have no plugins on my server that mess with damage events. I hope it's possible to see in the video

remote swallow
#

isnt that just default minecraft

spring pike
#

default?

spring pike
#

the server is 1.8.9, but I play on 1.7.10 with viarewind

dire marsh
#

not sure then

#

we've experienced something similar on newer versions, might just be an mc thing

#

also I believe it's an entire 20 ticks of invincibility

spring pike
#

1 second?

#

I play lots of pvp, and I'm pretty sure it's .5 seconds

#

or at least something very close to that

remote swallow
#

might be a via rewind thing

spring pike
#

I was also thinking of that, I think i'll remove it and try it out

dry yacht
dire marsh
#

checked 1.19 src and it's 20, could be different for 1.7/1.8 though, haven't played those for ages

tender shard
#

lmao when 1.8 isn't old enough already, so yuo install viarewind so you can use even older versions lmao

spring pike
remote swallow
#

what year was 1.8?

spring pike
#

2013 I think

#

close to 10 years lol

remote swallow
#

?1.8

undone axleBOT
dire marsh
#

aha it's / 2

#

so it's the same on all versions

dry yacht
dry yacht
spring pike
#

Didn't try it yet, hold on

crystal palm
#

heya!
im looking to store information inside of an item. when someone will right/left click while holding it, itll run a command.
will persistendatacontainers work? when the item is first made, ill give it some data and check for it when the player tries to interact

formal bear
crystal palm
#

alright, thank you!

dry yacht
spring pike
#

thanks, I'll try it. Even after deleting all my plugins except for viarewind (because i tested it already) and multiverse it didnt get fixed, so I'll have a look at the multiverse config too if your method doesn't work.

dry yacht
eternal oxide
#

A jar added to your resources folder will not be loaded by the classLoader

dry yacht
#

What other plugin does this work for? I'd actually be curious about that.

remote swallow
#

shouldnt you be shading stuff you want to run as a plugin

#

or add the jar to the class loader

eternal oxide
#

dependencies are not resources folder

spring pike
dry yacht
#

But you understand why we think that it doesn't work that way, right? Yes, if the plugin-loader has been instructed to load jars from resources/ into the path, then sure, it would work. But what loader does this?

Usually, you either shade your dependencies into your plugin or specify them in the plugin.yml for the server to provide them (which I never did, due to the fear of the server not doing it's job properly).

tender shard
#

ugh never do that

dry yacht
eternal oxide
#

you remove it from your resources and shade properly

spring pike
tender shard
#

did you write the api yourself? is it a maven project too?

spring pike
tender shard
#

then just mvn install the api project

#

after that, add it as dependency to the other plugin, set the scope to "compile" and shade it

#

np πŸ˜„

dry yacht
spring pike
dry yacht
remote swallow
#

paper probably still host 1.8 paperclip jars

spring pike
dry yacht
spring pike
#

Another strange thing I noticed tho, this only occurs when another player attacks me, AND when he's crit damaging me

#

as in the video

#

therefore it might be hard to test this locally

dry yacht
#

Server returned HTTP response code: 403 for URL: https://s3.amazonaws.com/Minecraft.Download/versions/1.8.8/minecraft_server.1.8.8.jar, alrighty, going back to my 1.8.8 spigot jar, xDD. Shouldn't make any difference anyways.

spring pike
#

nice lol

dry yacht
spring pike
#

i don't even know

#

it was 6 months ago and in my whole history of making servers I never had anything to do with buildtools

remote swallow
#

or did you use get bukkit

dry yacht
tender shard
#

just shade it. set the scope to "compile" and add the maven-shade-plugin including the confiuration. then just do mvn package and you'll have a .jar with the API shaded in

spring pike
remote swallow
#

what is paper spigot

tender shard
#

yes

remote swallow
#

is that some fork of paper

tender shard
remote swallow
#

make sense

spring pike
remote swallow
#

oh thats just paper

eternal oxide
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

dry yacht
spring pike
tender shard
#

huh paper removed their quiz for old versions

remote swallow
#

guess they used paper spigot as a brand before

spring pike
tender shard
#

new spigot logo confirmed

remote swallow
#

what is that

tender shard
#

duh obviously that is a siphon for kitchen sink with flexible drain hose - 100% waterproof - tubular siphon with two appliance connections + connection seals.

dry yacht
remote swallow
#

oh its a u bend pipe

#

wheres your something trap

tender shard
#

something trap?

remote swallow
#

theres a trap thats meant to be on them i thought

#

come on discord

tender shard
#

hm I am not expert when it comes to spigots and siphons. Maybe ask md_5 about it

spring pike
remote swallow
#

there could also be a u bend pipe

tender shard
dry yacht
tender shard
dry yacht
spring pike
remote swallow
dry yacht
tender shard
dry yacht
spring pike
dry yacht
spring pike
#

I put it into the same event that reduces overall attack damage, so don't worry about the other stuff

#

and no i didnt

dry yacht
#

That's not really what I meant. Going to give you an example in a second.

remote swallow
#

== for enums

tender shard
spring pike
tender shard
#

I'd do it like this basically

    private final Cooldown cooldown = new Cooldown();

    @EventHandler
    public void onCritHit(EntityDamageByEntityEvent event) {
        if(cooldown.hasCooldown(event.getEntity())) {
            event.setCancelled(true);
            return;
        }
        cooldown.setCooldown(event.getEntity(), 500, TimeUnit.MILLISECONDS);
    }
#

ofc also check the damage cause and the damage amount and stuff

spring pike
#

noted, thanks

tender shard
#

(the Cooldown class is what I sent above in the github link)

spring pike
#

oh didn't see it, appreciated

remote swallow
#

alex i have a question

tender shard
#

NO

remote swallow
#

sad

tender shard
#

well ok

spring pike
#

I'll just wait for BlvckBytes answer

remote swallow
# tender shard well ok

can i have a like 2gb server on ur ptero because everytime i attempt to run mc, a server and intellij my computer just dies

dry yacht
# spring pike I'll just wait for BlvckBytes answer

I really don't get why the event has no API for checking for critical damage... I had to first research the requirements of critical hits before I could get to actually thinking about the solution itself, haha

tender shard
remote swallow
#

yeah

tender shard
#

kk

#

then go ahead

remote swallow
#

thanks

tender shard
#

np

remote swallow
#

ill give you a gregg

#

want me to name it anything specific

tender shard
#

greggs 🀀

twin venture
#

Ideas for perk event system

tender shard
remote swallow
#

ebics whor'e server it is

#

damn you get a double 0 ip

tender shard
#

wdym

#

10.0.0.X?

#

that's private IPs

remote swallow
#

yeah

#

oh

#

also massive tragedy

tender shard
#

that's the bridge vlan on the proxmox host

remote swallow
#

i cant have port 69696

tender shard
#

no it only goes up to 65535 or sth lol

remote swallow
#

it only lets me pick 300number ports

#

so 30069 we go

tender shard
#

nice

remote swallow
#

want me to add a cpu limit, also do i add a swap size

tender shard
#

swap is only needed if you don't use enough ram

#

cpu limit, no

remote swallow
#

ptero seems cool tbh

tender shard
#

the server has enough free ram, just use whatever amount you like lol

twin venture
remote swallow
#

ill limit myself to like 8 or 6gb

#

you pick

twin venture
#

if i have something like that i will make the best server i can xd

tender shard
#

and it costs roughly 100€ + 19% VAT per month

tender shard
#

if it's not enough, you can still raise it later

twin venture
remote swallow
#

theres something weird ive noticed that i do

#

if im specifying ram for servers i do 1024 x gb size

#

and use that mb

twin venture
#

is the host avillable at France or germany?

#

oh its hetzner

tender shard
twin venture
#

i know them

dry yacht
dry yacht
remote swallow
#

how much disk space do i get

spring pike
tender shard
dry yacht
remote swallow
twin venture
glossy venture
#

im so fucking confused how the fuck does this work
what the hell

dry yacht
tender shard
#

yeah epic, do some heavy worldedit stuff

runic island
#

How do i make theese dependencies work?

tender shard
#

repository*

#

also why would you add all those api versions

twin venture
tender shard
#

you should use one spigot-api, not a hundred

runic island
#

I want my plugin to work on other versions

tender shard
#

that has nothing to do with that

#

use the lowest api version you wanna support

remote swallow
#

if you dont use nms do the above

tender shard
#

if you want to do 1.16.5+ then use spigot-api 1.16.5

twilit roost
#

I have Integer x.
I have some Strings whose are Negative Spaced Characters.
I want to transfer that Integer, into biggest possible combination of those Strings

for example:

"pseudo code"
Integer xToBackspace = 20;

String outputed = "{NEG16}{NEG4}";

I somehow want to create a function, that will generate that outputed
Heres my current try:
https://paste.md-5.net/enamuyeren.java
Use case:
https://paste.md-5.net/yenobukito.cs

dry yacht
tender shard
spring pike
#

@dry yacht I read through your code, 2 things. .#isOnGround() is deprecated, and the HashMap may be final. Should I ignore this?

dry yacht
tender shard
#

and whether the map is final or not doesnt matter

spring pike
#

oko

#

k

runic island
tender shard
#

thankfully github copilot always adds the repo for me

humble tulip
#

Wbay are u doing?

remote swallow
twilit roost
remote swallow
#

thanks

humble tulip
#

Sure

dry yacht
glossy venture
#

dude what how the fuck does this work please tell me

dry yacht
dry yacht
glossy venture
#

its on a thread

#

its printing, calling a function on the same fucking thread, which should print something, but it doesnt
it just printing the first thing

#

and other functionality in the stupid function doesnt work either

#

im so confused

dry yacht
#

Would be great to know what worker is and how it's set up.

undone axleBOT
glossy venture
#

this is the whole thing

#

its just a thread

#

not that complicated

dry yacht
#

Btw, seems unrelated, but sometimes the issue with printing can be unflushed buffers too. Like, you print something but it hasn't yet been flushed to the output device. But in this case, this is not an issue, as you print over and over again, and println internally flushes, iirc.

dry yacht
chrome beacon
#

Make sure you're using the right worker instance

glossy venture
#

i had it as a not static class first

#

but i thought that might be broken or smth

#

so i made it use di

#

with a static class

quaint mantle
#

anyone know how to make github actions work with buildtools ?

glossy venture
#

for UpdaterThread

dry yacht
spring pike
#

@dry yacht thanks so much man, it works. You're a livesaver

quaint mantle
tender shard
chrome beacon
dry yacht
dry yacht
quaint mantle
spring pike
tardy delta
#

im wondering if i like make it method synchronized that changes a field x, will that synchronize on the whole object and prevent modifications on other fields too for threads that dont have the lock acquired?

dry yacht
copper scaffold
#

Is it possible to disable the chest open animation?

tardy delta
#

or is there a dif bwteen synchronized (this) and synchronized in a method declaration

#

hmm that will probably allow only one thread to enter that method and wont lock on the whole object

#

sometimes im asking weird questions

dry yacht
wet tapir
#

I'm sorry idk what to actually do here.
I'm trying to convert my pack to a plugin but people keep acting really weird...
Like as if I'm not even allowed to be around them or learn how to do it.

tardy delta
#

hmm

dry yacht
onyx fjord
#

how do I set up gh actions so they can compile something with spigot remapped?

wet tapir
#

Yea I make optifine packs that require cit files

chrome beacon
quaint mantle
wet tapir
#

@dry yacht I been working on them for years now

tardy delta
#

id think that this locks the whole object java void setI(int i) { synchronized(this) { this.i = i; } }

#

and synchronized in the header only prevents two threads from calling setI at the same time

onyx fjord
#

thx olivo

dry yacht
zealous scroll
#

Is there a way I can remove a set of entities upon server unload (reload/stop)? So far, entities have to be in loaded chunks to be removed. I've tried loading the chunks, removing them, then unloading the chunks but that doesn't seem to fix the issue. I don't really want to keep the chunks loaded all the time to save memory because my plugin uses these entities heavily all around the world.

dry yacht
tardy delta
#

ye never actually used it before

dry yacht
dry yacht
tardy delta
#

once wrote a chat app that uses Object#notify and Object#wait for sending and receiving messages :/

wet tapir
#

@dry yacht
As far as I understand. I'm able to convert my Json models to a yem or something to load into a plugin
I seen it in the quality armory plugin
But idk how to make my own plugin that's the issue

chrome beacon
#

All you do is send a resource pack

proven surge
#

hi

#

i have problem

wet tapir
#

@chrome beacon yea but
I want to make people stuff
Not just for my self so I was gonna start making pack plugins

dry yacht
zealous scroll
#

I already have a handle on them, but I do remove them based on a predicate

        for (world in Bukkit.getWorlds()) {
            for (entity in world.entities) {
                if (EntityUtils.hasFlag(entity, EntityFlag.REMOVE_ON_SHUTDOWN)) {
                    entity.remove()
                }
            }
        }
chrome beacon
proven surge
#

I'm having a problem adding lands

twin venture
proven surge
#

If I want to give someone trust on lands

river oracle
#

You are always best off asking the developer though

dry yacht
# zealous scroll I already have a handle on them, but I do remove them based on a predicate ``` ...

Well, that's not what I meant by having a handle on them. You're still querying the whole server. I meant something along the lines of you having spawned them earlier, kept them in a list or map and now want to remove them.

Okay, and your issue is (probably) that the entities you want to remove are not showing up in your loops because their containing chunk got unloaded, right?

Just trying to understand your problem first.

tardy delta
zealous scroll
#

That would probably be the case, yeah

#

Would you suggest I save them in a collection to later on query it and remove these entities in a loop instead of fetching all of the world's entities?

wet tapir
#

Well.
I believe that I should attempt to learn how to do this.
But I'm scared because there is already a lotta work I gotta make but I'm still willing to try @chrome beacon

chrome beacon
#

So why do you need to make a plugin?

#

And what should that plugin do

tardy delta
#

how is it still not 1000 or 999 whatever

dry yacht
tardy delta
#

ah wait i print the i before the threads are done

dry yacht
tardy delta
#

ok returns 1000 when doing awaitTermination

zealous scroll
tardy delta
#

oh i thought ExecutorService#join was a thing

#

oh this also works

#

not two times shutdown

dry yacht
# zealous scroll I assign the flag upon entity creation. It's just a metadata flag https://past...

Okay, that's what I thought. Then I'd say that it would be best to keep a local variable in the class which creates entities that keeps track of them, for later removal.

That collection should probably only be weakly referencing it's items, as I guess one of your spawned entities can die and be garbage collected later on, and you might run the risk of creating a memory-leak otherwise.

I'm not sure how bukkit internally handles entities, and if Entity#remove throws if that entity has been unloaded by the server. Your main issue is that you do not want to get as low level as modifying world NBT data yourself, which the entity should know it's exact place in and be able to remove itself.

I'd advise you to try the collection approach and see if you encounter any further errors.

dry yacht
tardy delta
#

one maybe ,-,

#

what A ThreadPoolExecutor will automatically adjust the pool size (see getPoolSize) according to the bounds set by corePoolSize (see getCorePoolSize) and maximumPoolSize (see getMaximumPoolSize). When a new task is submitted in method execute(Runnable), if fewer than corePoolSize threads are running, a new thread is created to handle the request, even if other worker threads are idle.

spring pike
#

@dry yacht it turns out your method of fixing the critical double hits worked, but only kinda. Sometimes my friend couldn't hit me at all for a second, sometimes the old issue came through again.... idk what to do now

quartz goblet
#

Does anyone know why I would be getting "CraftWorld cannot be resolved to a type?" Like is the craftbukkit stuff not in the api? When I take it into luyten my api has it

tardy delta
#

no

#

hhave to use spigot artifact instead of spigot-api

dry yacht
tardy delta
#

well actually wondering if CraftWorld is nms or not

#

just craftbukkit ig

quartz goblet
#

what is spigot artifact?

tardy delta
#

are you using maven or gradle?

spring pike
quartz goblet
#

maven

zealous scroll
tardy delta
#

just change 'spigot-api' in the dependency in your pom.xml to spigot

quartz goblet
#

thanks ill try that

dry yacht
dry yacht
spring pike
dry yacht
static hollow
#

hello,
I've wrote this class for Bukkit's Location serialization:
https://pastebin.com/vDDR1WUs

And using it like this:

Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();

List<JsonElement> countriesToWrite = new ArrayList<>();
for (Country country : countries)
{
    countriesToWrite.add(gson.toJsonTree(country, Country.class));
}

try (FileWriter writer = new FileWriter(playerFile))
{
    gson.toJson(countriesToWrite, new TypeToken<List<JsonElement>>()
    {
    }.getType(), writer);
} catch (IOException e)
{
    e.printStackTrace();
}

Country class don't have any Location at all, but Plot (and there are plots in country.plots) have this:

@JsonAdapter(LocationSerializer.class)
@Expose
@Getter
@Setter
private Location corner1;

@JsonAdapter(LocationSerializer.class)
@Expose
@Getter
@Setter
private Location corner2;

The problem is, that when I'm using the code #2 for saving json, it gives me stackoverflow error (recursion). Why? :/

tardy delta
#

why excludeFieldsWithoutExposeAnnotation()

static hollow
#

why not? I don't want them

tardy delta
#

make them transient

#

at what line does the stackoverflow occur?

static hollow
hazy parrot
#

And what are those lines

static hollow
#

Oh, right, you don't see it in pastebin. Im sorry

#

As i remember, 11 was just a class name and everything, and 25 was setting z in serialize

undone axleBOT
humble tulip
#

We can't help without seeing code

static hollow
runic island
#

What do i set my api version as if i want the plugin to work on multiple versions?

#

In plugin.yml

river oracle
#

whatever version of the api you are coding with

runic island
#

Well whenever i put it as anything else than the version im using on the server it doesn't load. And i want one plugin file to work with all versions

river oracle
#

cuz thats not how api-version works

runic island
#

I just get this error but the 1.12 changes to whatever i enter:

[22:41:32 ERROR]: Could not load 'plugins\DiscordServerStatus-1.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.12
        at org.bukkit.craftbukkit.v1_13_R2.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:226) ~[server.jar:git-Spigot-1a3504a-06534f2]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[server.jar:git-Spigot-1a3504a-06534f2]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:332) ~[server.jar:git-Spigot-1a3504a-06534f2]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:252) [server.jar:git-Spigot-1a3504a-06534f2]
        at org.bukkit.craftbukkit.v1_13_R2.CraftServer.loadPlugins(CraftServer.java:325) [server.jar:git-Spigot-1a3504a-06534f2]
        at net.minecraft.server.v1_13_R2.DedicatedServer.init(DedicatedServer.java:213) [server.jar:git-Spigot-1a3504a-06534f2]
        at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:698) [server.jar:git-Spigot-1a3504a-06534f2]
        at java.lang.Thread.run(Thread.java:750) [?:1.8.0_352]
chrome beacon
#

It should be 1.13

river oracle
#

^

runic island
#

And then it will work 1.13+?

river oracle
#

wasn't api-version added in 1.13 ofc it would make sense it doesn't work with anything below that

#

if you are using 1.12 api don't bother adding it I'm pretty sure legacy mode will be activated

chrome beacon
remote swallow
#

yeah api version was added in 1.13

runic island
#

I coded it using 1.19 but im almost not using any spigot api stuff at all other than simple commands and send chat messages

river oracle
#

then it works for everything 1.19+

#

adding api-version to config as 1.19

runic island
#

Yeah

#

I get this error now. Do i need to change the java version im using in intellij?

/DiscordServerStatus has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
chrome beacon
#

Yes you need to use Java 8

runic island
#

Okay

runic island
remote swallow
#

both technically

#

change the sdk in intellij, and compile version in pom.xml

runic island
remote swallow
#

yeah

runic island
#

I changed the 11 to 8 and i have this in the project structure but i still get the same error

hazy parrot
#

1.8 iirc, not 8

runic island
hazy parrot
#

Yes

runic island
# hazy parrot 1.8 iirc, not 8

Im still getting the same error :/

[23:06:16 ERROR]: Could not load 'plugins\DiscordServerStatus-1.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: com/gampis/discordserverstatus/DiscordServerStatus has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
dry yacht
# hazy parrot 1.8 iirc, not 8

https://stackoverflow.com/questions/53642402/why-do-i-see-open-jdk-1-8-instead-of-java-8

I always thought that 1.x === x, as they at some point in time started to take the minor version number and use it as a standalone version number.

dry yacht
dry yacht
runic island
#

Ok

chrome beacon
runic island
dry yacht
#

?paste

undone axleBOT
dry yacht
dry yacht
runic island
dry yacht
runic island
#

I just press install

dry yacht
#

Then press clean first, then do your usual thing

#

Maven tries to cache compilation units and strives to compile as little as necessary, so it may be stuck at not re-compiling the necessary parts because it hasn't been noticed of the version-change properly. You can force a complete rebuild by running clean first.

runic island
dry yacht
#

Damn, I forgot to uncheck that. I'm sure it'll bother me a million times with "do you want to update" now, :(.

tender shard
eternal night
#

Living dangerously

dry yacht
tardy delta
#

security matches moment

bold flume
tardy delta
#

section is null

copper scaffold
#

Is it possible to disable the chest open animation?

remote swallow
tender shard
#

great!

#

np

tender shard
#

or whichever file the data manager thing reads

#

SHARE A PIIC

#

you said your lobby works

#

so I want to see a screenshot of your lobby lol

#

:<

remote swallow
#

easy fix

#

dm it him

wet tapir
#

Hey question

#

Why are people so secretive about plugins

remote swallow
#

what like

sonic goblet
#

In what sense