#help-development

1 messages · Page 1467 of 1

paper viper
quaint mantle
#

okay ill read that later and what about the error

vestal dome
#

for some reason I cannot edit it..

#

it was on the main page of the settings tho

quaint mantle
#

this right?

vestal dome
#

I didn't have nitro and I could customize it

young knoll
#

It's only for some random people

vestal dome
#

I currently have nitro... but it does not let me edit it

quaint mantle
#

yeah me too the unlock with nitro doesnt work the about me writing works like writing and then saving but nothing changes

vestal dome
#

ANYWAY

#

is there a point on doing a custom fork?

#

like any advantages if you're creating your own server..

young knoll
#

You can always improve performance

quaint mantle
#

aight

vestal dome
quaint mantle
#

You can do whatever you want

#

Just put your gamemode into the spigot itself :troll:

chrome beacon
#
ItemStack[] items = (ItemStack[]) map.keySet().toArray();
ItemStack foundItem = items[IntStream.range(0, items.length)
  .filter(i -> items[i].isSimilar(item))
  .findFirst()
  .orElse(-1) + 1];
#

ugh bad formatting but there you go @quaint mantle

quaint mantle
#

that'll grab the next item

chrome beacon
#

Yes

#

I mean it's untested

#

It will probably throw an error if you're on the last item

vestal dome
young knoll
#

I mean

#

It will be slightly faster

paper viper
#

you literally can do anything tbh

#

send custom packets

#

do anything what you want

#

but custom packets require client

#

that is able to accept it

chrome beacon
#

I mean you can do that with plugins too 🧠

quaint mantle
#

could i ask whats causing this?

#

yeahhh

chrome beacon
quaint mantle
#

i am not

#

its playerinventory

paper viper
#

a completely new packet structure

chrome beacon
quaint mantle
#
Saving inventory:
VariablesHandler.getPlayerInventories().put(player.getName(), player.getInventory());

Putting into inventory:
if (VariablesHandler.getPlayerInventories().containsKey(player.getName())) {
                player.getInventory().clear();
                player.getInventory().setContents(VariablesHandler.getPlayerInventories().get(player.getName()).getContents());

                VariablesHandler.getPlayerInventories().remove(player.getName());
            }
chrome beacon
paper viper
#

ig but id rather that be part of the server

quaint mantle
#

why?

paper viper
#

names can change...

#

uuids cannot

young knoll
#

Not while the player is connected though

quaint mantle
#

ohhh okay

maiden thicket
#

but for example

#

plugin is enabled

young knoll
#

Still, UUID is better

maiden thicket
#

player is saved in the map

#

they leave and come back with their name changed

#

and now boom contents gone

paper viper
#

However, I guess you could use a Weak data structure and Player

#

but id rather use UUID

quaint mantle
#

ok and the error?

vestal dome
#

or performence

#

or make things easier.....

#

or things I should probably do if I make a fork

maiden thicket
#

could you try printing out the size of the contents stored ?

quaint mantle
#

You know what else could make it better? deez nuts.

vestal dome
#

the dish respect.

quaint mantle
#

i dont see getContents.size

maiden thicket
#

it's an array isnt it

#

.length

vestal dome
#

size()

#

not size

quaint mantle
#

oh yea sry

#

weird doesnt do anything rn

#

nvm im just stupdi

#

41

#

maybe it gets even an armor?

young knoll
#

It copies the armor and offhand slot

quaint mantle
#

xd

young knoll
#

But doesn't like setting it back I guess

paper viper
#

wrong channel

#

oops

quaint mantle
#

yeah so how do i fix that

surreal citrus
#

anyone know what happened to the spigotmc maven repo, there doesn't seem to be any builds on there for pure spigot/craftbukkit just the api? I'd rather not use build tools and I need to do NMS development. I've got the mavenLocal repo, is this working for anyone else?

young knoll
#

You need to use buildtools to add NMS to your local maven repo

chrome beacon
#

You need BuildTools for NMS

surreal citrus
#

😦 bruh moment

quaint mantle
#

i mean you could just build them all

#

@young knoll do you know how to get the armor contents and other stuff separately?

young knoll
#

getArmorContents and getItemInOffHand

quaint mantle
#

and the item contents bcz that returns the armor and offhand

cedar zinc
#

Heyy Guys, im really dumb with coding xD. And i want to get a link from a API and transfer it to a QR Code

#

Any ideas?

paper viper
#

what

cedar zinc
#

Yeah, im trying to get a link from an API called ThemePark. And get the link from it so i could generate an QR Code in minecraft with it

delicate fractal
#

aynone know how essentialsx works

quaint mantle
#

i hate this yagpdb bot

quaint mantle
# cedar zinc Yeah, im trying to get a link from an API called ThemePark. And get the link fro...
public static void create(String qrData) {
        try {
            String charset = "UTF-8";
            Map<EncodeHintType, ErrorCorrectionLevel> hintMap = new HashMap<EncodeHintType, ErrorCorrectionLevel>();
            hintMap.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L);
            BitMatrix matrix = new MultiFormatWriter().encode(new String(qrData.getBytes(charset), charset), BarcodeFormat.QR_CODE, 200, 200, hintMap);
            MatrixToImageWriter.writeToFile(matrix, path), path);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
cedar zinc
#

Wow, that's really helpful, thank you!

quaint mantle
#

yw

#

oh sorry imports

#
import java.util.HashMap;
import java.util.Map;

import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
cedar zinc
#

Alrighty, thank you!

wheat dagger
#

Can someone help me ?

quaint mantle
# quaint mantle I ended up making my own shenanigans again https://gyazo.com/d1b8270411f14a66a89...
{
            potions.add(new IItem(0, new ItemStack(Material.DIRT), 25));
            potions.add(new IItem(1, new ItemStack(Material.COAL, 3), 30));
            potions.add(new IItem(2, new ItemStack(Material.DIAMOND_AXE), 266));
            potions.add(new IItem(3, new ItemStack(Material.EMERALD, 6), 2));

        }

        public IItem next (ArrayList < IItem > items, ItemStack itemStack){
            int index = 0;
            for (IItem potion : items) {
                if (itemStack.isSimilar(potion.item)) {
                    return (index == (items.size() - 1) ? items.get(0) : items.get(index + 1));
                }
                index++;
            }
            return null;
        }

        public IItem previous (ArrayList < IItem > items, ItemStack itemStack){
            int index = 0;
            for (IItem potion : items) {
                if (itemStack.isSimilar(potion.item)) {
                    return (index == 0 ? items.get(items.size() - 1) : items.get(index - 1));
                }
                index++;
            }
            return null;
        }```
quaint mantle
wheat dagger
#

What contents do you mean ?

#

other files ?

quaint mantle
#

files folders in it

wheat dagger
#

But I need them to build the jar

quaint mantle
#

show what you have in there

chrome beacon
quaint mantle
#

Yeah it's good

wheat dagger
#

root where I used BuildTools :

quaint mantle
#

@chrome beacon could you help me btw with the getStorageContents or smth ?

quaint mantle
wheat dagger
#

File where I'm using mvn clean install

wheat dagger
#

But I'm modifying spigot, so no

#

I modify some of this files

quaint mantle
#

wait ok

wheat dagger
#

And I try to build the jar

quaint mantle
#

maybe try --disable-certificate-check

wheat dagger
#

Unrecognized option: --disable-certificate-check

quaint mantle
chrome beacon
#

Wdym?

#

Get contents doesn't remove anything

upper hazel
#

How can I check for armor changes with Spigot. In paper there is an event but is there anything similar in the Spigot API

wheat dagger
#

You can't

quaint mantle
#

PlayerInventory#getContents in 1.9 version like returns armor contents, offhand item, and this

wheat dagger
#

at least before 1.12.2

upper hazel
#

im on latest

quaint mantle
#

maybe ArmorStandManipulateEvent

upper hazel
#

I dont need Armor stand

quaint mantle
#

oh sorry

#

armor changes

chrome beacon
quaint mantle
#

yes

quaint mantle
chrome beacon
#

Try using getStorageContents

wheat dagger
#

I won't work with clicking with the item in hand

upper hazel
#

I need checks for any time of armor equip

#

ye

#

like dispensers and all

wheat dagger
#

If I remember someone made a plugin to add this event

quaint mantle
# chrome beacon Try using getStorageContents

Caused by: java.lang.NoSuchMethodError: org.bukkit.inventory.PlayerInventory.getStorageContents()[Lorg/bukkit/inventory/ItemStack;
at pavlyi.authtools.spigot.listeners.MainListener.cancelSetup(MainListener.java:125) ~[?:?]

upper hazel
wheat dagger
#

just copy the listeners

upper hazel
#

I think im gonna have to, since there is no easy other alternative

wheat dagger
#

Just put credits in here

upper hazel
#

I just didnt want to since its so old too

#

dont want random ass bugs

wheat dagger
#

Do what you want, but be sure that there is no native method to do so

quaint mantle
#

1.9

chrome beacon
#

Why are you on 1.9

quaint mantle
#

for plugin development

upper hazel
#

thats so random

#

lol

chrome beacon
#

But why kekwhyper

quaint mantle
#

the client im doing it for choose it

wheat dagger
chrome beacon
#

Well you'll have to filter it yourself then

#

Or loop and get contents

upper hazel
#

but i know what u mean

wheat dagger
#

x)

upper hazel
#

also when 1.17 comes out could be issues

#

which is disapointing

wheat dagger
#

For me I only used 3 versions of spigot 1.8, 1.12.2 and 1.16.5

quaint mantle
chrome beacon
#

Get what's in the armor slot and remove it from the array

upper hazel
#

tbh idk why spigot havnt alrdy added armor events

quaint mantle
#

ohhh

#

thats smart

#

didnt think of that

quaint mantle
# chrome beacon Get what's in the armor slot and remove it from the array

just a question how would i get the list or idk? sry i never used filter function

Arrays.stream(VariablesHandler.getPlayerInventories().get(player.getUniqueId()).getContents())
                        .filter(item -> item != null)
                        .filter( item -> VariablesHandler.getPlayerInventories().get(player.getUniqueId()).getArmorContents())
                        .collect( Collectors.toSet() );
chrome beacon
#

That would work

quaint mantle
chrome beacon
#

Well yeah

#

You need to check if the item is in the armor contents array

quaint mantle
#

so like item.contains?

#

what would be the most efficient way of pulling blocks out of the ground and have them flying in the sky with as little lag as possible

#

And is there a way to get a list of blocks on the surface around a particle.

chrome beacon
quaint mantle
#

never?

chrome beacon
#

TNT cause a lot of lagg especially if there's a lot of it

hollow canopy
#

can you guys give advice? I am making a spider armor that gives damage reduction for spiders. How can I make that?

quaint mantle
#

listen to the damage event, check if attacker is instance of spider, reduce accordingly

quaint mantle
#

e.getInventory().setItem(coinSlot, new ItemStack(Material.DOUBLE_PLANT, 100)); This will set it to 64 items, any way to bypass this/

quaint mantle
#

so that it's 100 items instead of 64

chrome beacon
#

oh I assumed you were doing tnt

quaint mantle
chrome beacon
#

eh you should be fine

#

Don't think to much about performance

quaint mantle
#

i just dont know where id start to get blocks floating

chrome beacon
#

Make it work first

#

First you need some math to create the tornado shape

quaint mantle
#

im not needing a tornado

#

just flying blocks

chrome beacon
#

Then just set the block to air and spawn a falling block?

#

Not sure what you need help with here

quaint mantle
sonic bronze
#

Hey there I need some help with iterating though my config file. I really want to progress make progress with my plugin but I am stuck with it.
I already posted the problem here https://www.spigotmc.org/threads/can-not-iterate-through-config.508069/#post-4174081 and if maybe someone would be interested in directly helping me with that problem I would be pleased.
TL;DR:
I try to iterate though my config file but don't get any value. I followed some examples already but end up with nothing working yet. Would be happy if someone who already made it work is interested in helping me.

quaint mantle
#

posted something there for u

sonic bronze
#

Thanks I try it

#

@quaint mantle I replied again

quaint mantle
#

@sonic bronze same

young shell
#

is there a non-deprecated way to spawn a falling Block with Data? Because World#spawnFallingBlock() is deprecated

quaint mantle
#

Spawn it via entities

#

Just guessing

digital plinth
#

any idea why this custom effect kills even a creative player?

#
      - ==: PotionEffect
        effect: 6
        duration: 2000
        amplifier: 125
        ambient: false
        has-particles: true
        has-icon: true```
#

6 is instant health

sonic bronze
lyric grove
#

how would i figure out whats causing the null pointer?

tribal holly
#

look at line 104

#

...

lyric grove
#

omg im so dumb

#

i named it wrong

tribal holly
#

check if the getString realy find

lyric grove
#

thanks

tribal holly
#

if i create tow team on different scoreboard did the player can see other team color name (above player head) ?

#

or they need to be in the same scoreboard ?

wheat dagger
#

same scoreboard I think

#

But if you update team in both scoreboard it works too

tribal holly
#

ok thx

chrome beacon
sonic bronze
#

@quaint mantle answered again

wet breach
#

@lyric grove try pasting the entire error

#

not just part of it

tribal holly
#

guys he found the problem useless to ping him

#

and the error screen contain all infos

lyric grove
#

just a sill config mistake

#

how would i remove potions effects using uuid's?

wet breach
#

use the UUID to get the player object

#

and then from the player object you can remove potion effects

lyric grove
#

oh

lyric grove
wet breach
#

yes that works

lyric grove
#

thank you

vital ridge
#

Can I ask help for a client here lol

#

or its only spigot?

wet breach
#

?ask

queen dragonBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

vital ridge
#

I'm creating a client, after I ran it for the first time this error came up:
https://hastebin.com/macewagivi.sql
I tried changing my client compiler to java 1.8 and overall eclipse compiler to 1.8 but after doing that and running my client again the same error still keeps popping up.

#

Im using mdk.

wet breach
#

the issue is the reflective code

#

actually what does your pom look like?

#

could just be a simple issue of not specifing the correct JDK

vital ridge
#

theres no pom text file

#

At least something called pom

wet breach
#

oh not using maven to build

vestal dome
#

it's "pom.xml"

vital ridge
#

Yeah theres no such file

wet breach
#

so I take it you are using ant then

vital ridge
#

I followed a tutorial

#

Ive never used gradle or maven myself

#

but this one

#

is associated with gradle

wet breach
#

ah gradle

vestal dome
#

just tell me when you guys are done helping each other So I can post my problem, ok thanks.

wet breach
#

I am not familiar enough with gradle to help solve any issues related to it. Anyways, it is either going to be an issue of not specifying the JDK properly and thus, the compiler just uses what it can pull from the command line, which whatever JDK version pops up when you do java --version on the command line. Or it is a legit issue with the reflective code that is causing the class cast exception.

vestal dome
#

then why chose it in the first place?

vital ridge
#

I followed a tutorial 🙂

#

And it used forge mdk

#

and gradle

wet breach
#

@vital ridge doesn't necessarily mean it is a good one or accurate

vital ridge
#

Well I got to learn from somewhere right

#

Just trynna watch every single tutorial i can

#

to get at least some knowledge

wet breach
#

indeed, but projects like forge and tools such as java and maven change over time

#

thus making the tutorial you following, outdated

vital ridge
#

ye maybe, its from oct 2020

#

Idk like, what should I do lol, I still want to continue with it

#

in the comments, a few people had the same problem, but they were told that its cuz java 1.8+ is not supported

wet breach
#

Java made changes in later versions to how reflection works, so it is quite possible that forge updated their code to keep it compliant with that. If that is true, then you can't use the updated project with older versions of java

vital ridge
#

I can try java 9

#

or smthing like that

wet breach
#

I wouldn't try java 9

#

try with Java 11

#

9 broken too many things, 10 fixes some of those things, and 11 everything is fixed that was broken lol

vestal dome
#

I still love Java 8

vital ridge
#

Yea theres still the same error

wet breach
#

@vestal dome why? missing out on many great features in later versions

vestal dome
#

tell me some

#

convince me .

wet breach
#

and best part is, all the way up to java 16 you can still run java 8 code

#

Unix sockets are in Java 16

#

natively

vestal dome
#

Unix?

wet breach
#

yes, unix sockets are like TCP sockets

#

but better especially for things say MySQL DB servers

#

that are running on the same host

#

less overhead and more bandwidth 😄

vestal dome
#

I would say being outdated is the best way to maintain Cross-version

#

even most of my plugins are base 1.8.8

wet breach
#

Also, in the later versions the GC(Garbage collector) is significantly improved over what is in Java 8

#

Java 16 can run anything coded for Java 8

vestal dome
#

What if you compiled using java 16 and someone uses java 8?

wet breach
#

you can even use JDK 16 to compile for 1.8 as well

#

@vestal dome obviously if you compile for jdk 16, you can't use lower versions to run it. But you don't need to compile for jdk 16 unless you make use of specific features of it. But that isn't the same as running the server/plugins with JDK 16

#

But you don't need Java 8 to compile for java 8 either

vestal dome
#

exactly.

wet breach
#

so there is no harm in just simply upgrading

vestal dome
#

I don't disagree with people who update their java server version to 16.

#

I'm just saying I'm not updating my plugin's base Java because it may interefere with cross-version support.

wet breach
#

sure, if you want to support java 8

#

personally I compile for java 11

#

if you refuse to update to java 11 at minimum, then that isn't my problem 😉

vestal dome
#

Alright

#

Now uhh

#

I have this timings.

#

but I specifically check if the chunk is loaded or not.

#

because you may not want to load the chunk to make the machine produce,

#

and lag out the server, but it still does.... I don't get it

wet breach
#

not sure what you mean by not want to load the chunk and make the machine produce

vestal dome
#

I don't want to produce on a machine on an unloaded chunk

#

because I don't want to lag out the server.

wet breach
#

you mean, have things like crops growing?

vestal dome
#

no

#

it's a block that you place

#

and it produces some items every few seconds

#

the idea is that if a machine is in an unloaded chunk, it will not spawn any items neither work.

#

if it is on a loaded chunk, it will drop it's item and do it's thing

#

but for some reason the plugin still loads the chunks when producing.

wet breach
#

probably has to do with some code you are using then

vestal dome
#

and I even have a check before spawning it

#

here look

#

I have a check at line 25

#

it checks if the config is enabled and if the chunk is not loaded, it will just RETURN... and it's done

#

the chunk is not loaded and performance is not affected..

wet breach
#

any particular reason why you bitshift the location?

vestal dome
#

yes because I need the chunk cordinates......

wet breach
#

this.location.getChunkAt(location).isLoaded()

#

or something to that effect

chrome beacon
#

That would load the chunk

eternal oxide
#

close location.getChunk().isLoaded()

eternal night
#

Yeah, getChunk().isLoaded() is always true lol

vestal dome
#

let me guess why lmfao

eternal oxide
wet breach
#

A better solution would just be to check if there is players nearby

eternal oxide
#

or isChunkLoaded(x,z) on World

wet breach
#

instead of loaded chunks

vestal dome
wet breach
#

this way, even if the chunk is loaded, your machine won't be producing stuff while the chunk is waiting to be unloaded since that isn't instant

vestal dome
#

Pissed

#

sense is kinda apsent tho

#

what am I even supposed to use?

#

it doesn't even make a little sense.

#

Absolute NONE

#

Unless I done something wrong, but still.

#

wtf

wet breach
#

well, the best solution would be to change what you check for or add an additional check so that there isn't problems with a chunk being loaded unnecessarily for whatever reason

#

the additional check would be to simply check if there is players nearby

#

if there isn't any players nearby, simply don't have your machine do anything. As I said earlier. Even if a player did cause the chunk to load, chunks don't unload instantly either.

vestal dome
#

just ask it

#

let me just waste my 69 minutes again

digital plinth
#

umm did i do anything wrong here

vestal dome
#

well.... do I even have to say a word?

#

we don't even have the pom so.. if u could send it, would be easier....

wet breach
#

either you have some missing tags, or indentation is incorrect for the tags @digital plinth

vestal dome
#

p

wraith rapids
#

getChunkAt loads the chunk synchronously

#

basically a no-no

#

especially on paper

#

you basically never want to call getChunkAt

vestal dome
#

why on paper?

#

lmfao

wraith rapids
#

because paper's chunk loading is asynchronous, unlike spigot's

vestal dome
#

"how make stuff unstable.exe"

#

ok probably not

wraith rapids
#

it's stable as long as nobody wants chunks to load synchronously

mortal hare
#

who needs vscode anyways

twilit rivet
#

How can I get an argument like "/chatlogs <name>" which responds to the sender on the target

mortal hare
#

the new Sublime Text 4 is awesome

wraith rapids
#

the goal, basically, is to reduce sync chunk loads to exactly zero

#

few things in the base game cause them on paper, most notably perhaps nether portals

#

plugins that fire sync loads are generally frowned upon

vestal dome
#

frowned ?

wraith rapids
#

get shat on

#

as sync loads can frequently take upwards of 50ms to complete

mortal hare
#

its blaze fast, supports GPU acceleration, looks as great as VSCode UI, apart the con of the bulky sublime merge

vestal dome
wraith rapids
#

it would still be quite slow, but not as slow

#

as stuff like light and neighbors need to be computed regardless

vestal dome
#

ram is 10 times faster then an SSD

#

wdym

#

well.... cannot disagree f****

wraith rapids
#

and just parsing the serialized data and spawning all of the entity and tile entity objects and everything will take its time

#

what are you doing, anyway

vestal dome
#

What's the best server implementation in your opinion?

eternal night
#

vanilla is kinda og

wraith rapids
#

tuinity or purpur maybe

#

in the bukkit ecosystem, anyway

vestal dome
#

I still consider base spigot or paper very good for it's value

wraith rapids
#

paper is very good yeah

#

spigot not so much though

vestal dome
#

I like spigot 🙂

wraith rapids
#

there is little value to it by this point other than the forums being a large repository of noob questions

mortal hare
#

i liked sponge

#

but its seems to be dead

vestal dome
#

I never used any other server implementation except Spigot, Bukkit & Paper...

#

Oh and NMS itself.

wraith rapids
#

bukkit is the most popular api yeah

wet breach
#

spigot is built on top of bukkit, and paper is built on top of spigot and thus includes bukkit. So, doesn't matter which you pick, get the bukkit api regardless 😉

vestal dome
#

I find bukkit quite questionable ngl....

wraith rapids
#

bukkit is kind of trash around parts

vestal dome
#

not bukkit

#

wait

#

I confused myself..

#

Such big brain

wet breach
#

Bukkit developers didn't always make the wisest decisions especially after a couple key developers were hired by Mojang

sage swift
wraith rapids
#

there are quite a few design decisions in bukkit that i disagree with and some things could definitely take some inspiration from the other projects around

wet breach
#

most of the decisions were based around how lazy they wanted to be

vestal dome
#

I still like to use NMS..

wraith rapids
#

one of the things i really don't like is the tooth-and-nail "we must not break backwards compat" mindset

vestal dome
#

Learning how to manipulate NMS can actually be pretty useful, I would say..

sage swift
#

hmm yes forced paper adventure components when

wet breach
#

your contribution to bukkit at the time could simply be denied all because they don't want to maintain the code you contributed even if its super valuable 😛

wraith rapids
#

tbh that's the case still mostly everywhere

sage swift
#

limiting

wraith rapids
#

it's not really worth pulling in if nobody can maintain it

vestal dome
#

If u don't feel good with Bukkit...

#

Use NMS

#

simple.

#

just agree that you will have to use a LOT of reflection.

wet breach
#

NMS doesn't always require reflection

vestal dome
#

wdym?

wet breach
#

but problem with using NMS is the unpredictable changes to it

vestal dome
#

it can difficult sometimes...

#

but still.....

sullen marlin
#

Sigh

wraith rapids
#

to be honest I'd almost take unpredictable changes over half a decade of stagnation

wet breach
#

that is why there is an API 🙂

compact haven
#

MD FOUR

mortal hare
#

all praise to the supreme leader

ornate heart
sullen marlin
#

Stop using nms and stop bitching about an API you have made no effort to improve

wraith rapids
#

kick him

#

he said the word

#

get him

sage swift
#

noo hahaha

#

what word

vestal dome
#

the human mindset is to complain about everything

#

md5 should know that.

sage swift
#

it's a violation of the TOS to remember it

twilit rivet
wraith rapids
#

lmao

wet breach
#

API's are not meant to change wildly all the time anyways

mortal hare
#

the problem is not with bukkit api itself

#

its the problem with licensing

wraith rapids
#

i can't hear you over the material enum

mortal hare
#

and obfuscation

#

although mojang released mappings

vestal dome
#

what?

mortal hare
#

recently

wet breach
#

I don't see how licensing is the issue here @mortal hare or even related to the topic o.O

vestal dome
wraith rapids
#

maybe he's talking about nms for some reason

sullen marlin
#

If you're concerned about licensing then using NMS is definitely not the answer lol

eternal night
#

Yea #576 when

eternal oxide
#

I think the low/no contributions is simply due to the complexity of making a PR.

sullen marlin
#

Well obviously complaining is easier than doing anything at all

eternal oxide
#

More rewarding for sure

eternal night
#

also, tbh spigot PRs are rather simple compared to other projects in the eco system xD

quaint mantle
#

Ive always been intrested in APIs is the spigot backend of the API open source?

eternal night
#

like, bukkit and craft bukkit changes are just commits

wet breach
#

@eternal night it can be hard if you don't understand how to make patches

vestal dome
#

I say change my mind ironically.. because it's true.

sullen marlin
#

Yes, check the readmes, also contributing page on the wiki

eternal night
#

there is a bash script that does all of you

wraith rapids
#

all of me

#

is done

compact haven
#

hot

eternal night
#

ooof

mortal hare
#

PR's are rare because people are afraid to fuck up 😄

wet breach
#

well it is easy to mess up the patching process depending where you are trying to make the PR lol

vestal dome
#

Cannot get it, Cannot get it, Cannot make it, omg.

wraith rapids
#

meanwhile the paper people are sitting on a huge backlog of prs that they have an entire team verifying and merging

eternal oxide
#

To be honest, the only part I found lacking in the API (that I can remember) is the Half finished Vehicle API.

wraith rapids
#

people have asked for API about loot tables in the past day like 3 times

young knoll
#

There are a lot of small things

#

I looked for a creeper ignite event, sadly there is not one

eternal night
#

add it yourself

wet breach
#

what is wrong with the API for loot tables that is currently in place @wraith rapids ?

wraith rapids
#

yeah, the few, pre-existing vanilla loot tables are there sure, but you can't create new ones or modify the existing ones

eternal oxide
#

I thought creepers fire teh prime event, just as they are about to explode

wet breach
#

you can create new ones o.O

young knoll
#

They do

wraith rapids
#

not afaik

young knoll
#

But I want just as they start the fuse

wraith rapids
#

i guess I could be wrong but I've never heard of that being possible

#

over the several dozens of times people have asked for it

wet breach
#

well most of the problem revolves around most not understanding how the server uses loot tables and when they are created

#

and once created what you can or can't do with them

sullen marlin
#

Creating a purely code driven loot table is problematic because what do you do when the plugin is not loaded?

wraith rapids
#

the same as you would do when the datapack isn't loaded

eternal night
#

cry ?

wraith rapids
#

which, I don't know what that is, it probably is either silently omitted or stripped out

#

either way the problem shouldn't be different from that of datapacks

sullen marlin
#

A Datapacks doesn't leak an entire plugin, it's just a string

wraith rapids
#

are you talking about reloads?

sullen marlin
#

Big difference between attaching an arbitrary java object to an entity and attaching a string

wraith rapids
#

i don't know what you're talking about

eternal night
#

someone just remove /reload please

#

would save us such a huge headache

#

would even make those pesky custom inventory holder impl relatively safe

wraith rapids
#

i see no difference; both are things provided by a resource that can be absent at any time in the future

eternal night
#

not like any serious production environment actually uses a reload

sullen marlin
#

The existence of reload is a great reminder that it's an API not a modding framework

#
  • plugin API
digital plinth
sullen marlin
#

Repository, spelling

wet breach
sage swift
#

kek

wraith rapids
#

all of my plugins are intended to handle reloads

eternal night
#

Well, yes but then you would move that responsibility into plugins hands

sullen marlin
#

I mean if you use the API, reload just works

eternal night
#

which like, do you trust the devs

wraith rapids
#

if it doesn't handle reloads, it's probably 🚮

eternal night
#

maybe we just need a bukkit based modding framework 🤔

sullen marlin
#

Aka forge

sage swift
#

sukkit

wet breach
quaint mantle
#

i had a play around with mohist and i couldnt understand why mods dont like working with plugins

eternal night
#

forge is bukkit based o.O

#

that is a new one

sage swift
#

based?

eternal night
#

implements bukkit api

sage swift
#

---joke-->
your head

wraith rapids
#

forge is also redpilled

eternal night
#

ah, I am german, we don't have humor

#

sorry gecko 😦

sage swift
#

you better be

eternal night
#

ye plz forgive me for my inherited lack of humor, I can't help it

wet breach
#

@eternal night not sure what you mean by leak classes into the server runtime. Classes of plugins are loaded onto the classpath. That is why sometimes when you replace a jar or remove it while the server is running, it doesn't mean it was removed from the server until it restarts or changes appear.

sullen marlin
#

They’re in their own isolated classloader which is removed when you, eg, reload

wraith rapids
#

he probably means that instances from plugin classes aren't strongly referenced, which would keep the classes and through the classes the pluginclassloader strongly referenced, which would also retain all static shit strongly referenced

eternal night
#

^^ so if your plugin threw its class into an inventory (e.g custom inventory holder) and is reloaded and dies, that class would still fly around

sullen marlin
#

Becomes problematic if you leave your own classes lying around nms

eternal night
#

because now the server is holding onto it

wraith rapids
#

and now that class is holding onto the classloader

#

which holds onto all of the other classes

wet breach
#

@eternal night ah ok, yeah understand what you mean now

eternal night
#

yus, sorry if I was not clear enough on that

wet breach
#

well, I mean, that is the difference between decent devs and not so decent ones lol

#

however, most plugins are free

#

and you get what you paid for

eternal night
#

Yeah but as spigot you don't wanna break just because people are trash

#

xD

wraith rapids
#

well tbh

#

most paid plugins are worse than free oss plugins

eternal night
#

^^

wraith rapids
#

even when open sourced, paid plugins tend to be kind of shit

#

read: songoda

wet breach
#

don't need to tell me about that

eternal night
#

maybe we just need some form of abstraction of the PDC on an inventory, so people that need to easily identify inventories and store data on them can use that

wet breach
#

was a developer for them for a shot period of time so I have first hand knowledge 😛

eternal night
#

🤔

wraith rapids
#

it wouldn't really be persistent though

#

would be more like metadata

eternal night
#

yeaa

#

but like, you also don't wanna add metadata api to it

#

because tbh that was pain

wraith rapids
#

yeah metadata was cancer

eternal night
#

So like. move PDC values into an ArbitraryDataContainer or something that does not promise persistency

#

have PDC extend that interface

#

and give it to each inventory

wraith rapids
#

TransientDataContainer :fingerguns:

eternal night
#

🔫

#

would actually not be too bad imo

wraith rapids
#

being transient you wouldn't need the persistentdatatype bullshittery of the pdc

eternal night
#

You do tho

wraith rapids
#

since your data would go poof on plugin unload or server restart or whatever

#

so you could just hold the actual data you have

eternal night
#

but then there isn't a difference between the current setup

#

like if the server would have to go through each container at the end

#

and poof your things

sullen marlin
#

Can you stop calling the api bullshit

#

I’m tired of it

wraith rapids
#

i call many things bullshit

eternal night
#

not like inventories die through a reload

wraith rapids
#

don't take it personally

sullen marlin
#

It’s belittling to everyone that’s worked on it

#

Which you haven’t

eternal night
#

😱

quaint mantle
#

i dont seem to be able to find the spigot github, maybe im just being blind?

sullen marlin
#

Don’t care, fix your attitude or get out

queen dragonBOT
eternal night
#

there is none, spigot is hosted on their own website

#

yea that

quaint mantle
#

ah thanks

eternal night
#

well there is a spigot github xD just not with the repos you need

sullen marlin
quaint mantle
#

1.17 in the works?

eternal night
#

we shall feed you to the goblins for asking

wraith rapids
#

👺

quaint mantle
#

xD

wet breach
wraith rapids
#

1.19

sullen marlin
#

How to delete discord

eternal night
#

🤯

#

maybe there is a hidden 1.19 version of spigot, with #576 already merged an materials happy

wet breach
#

well, deleting discord is super easy, just don't think very many people would be happy about it XD

wraith rapids
#

we should just all go back to irc

wet breach
#

I like irc 🙂

wraith rapids
#

pisscord is trash

eternal night
#

actually, does this discord have an irc hook ?

wet breach
#

well discord wouldn't be so bad if they allowed people to run their own discord servers

eternal night
#

😭

wraith rapids
#

but then the NWO wouldn't be able to censor and arbitrarily delete guilds for wrongthink

wet breach
#

NWO?

wraith rapids
#

nevermind

eternal night
#

You need more tinfoil frost

#

interesting ping

sullen marlin
#

you k bro?

wraith rapids
#

lmao

wet breach
#

more tinfoil @eternal night ? o.O

wraith rapids
#

frosty frostfrost is out like a snowman

eternal night
#

😂 man just google NWO xD

wet breach
#

you mean, I should par-take in the nonsensical conspiracy stuff

eternal night
#

yes

wraith rapids
#

covid19 is caused by 5g cell towers

wet breach
#

that made me laugh the first time someone told me that @wraith rapids

wraith rapids
#

it's remarkable how dumb people are

eternal night
#

reaching the pinnacle of help-development has never been so easy xD

eternal oxide
#

I've heard worse conspiracies 🙂

wet breach
#

well you were on point with the conspiracy until you introduce the animatronic thing into it @quaint mantle

wraith rapids
#

haven't heard about the animatronic thing either

#

of course

#

US taxpayer dollars will keep them safe from now to armageddon

eternal oxide
#

You forgot to include the NWO using infant blood to stay young

wraith rapids
#

just eat your bugs goy

eternal oxide
#

I'm safe, I wear 10 masks! I get faint at times, but I'm sure I'll be ok.

wet breach
#

many people do

sullen marlin
#

ok bye

#

?ban @quaint mantle

queen dragonBOT
#

🔨 Banned madafaqcking_guy#0781 indefinitely

wet breach
#

lol

#

guess, that was a bit too much

random epoch
#

md5 savage

wet breach
#

well, it had to end somehow

quaint mantle
wet breach
#

don't think that was the issue

random epoch
#

Quick question how do I check if it’s a players first time online. Player#hasPlayedBefore doesn’t seem to work

wraith rapids
#

define doesn't seem to work

twilit rivet
#

Anyone know mySQL here? I'm trying to make my chatlog plugin get all entries from one user, without doing it all through coding. For example, ```
Monotoo 5
placeholder_1 5
Placeholder_2 5

wet breach
#

@random epoch if the player has never joined your server before, it works.

wraith rapids
#

iirc it's set on the first time they quit

random epoch
wet breach
#

it gets set on the first world save @wraith rapids

sacred gate
#

anyone know any good permission plugin

wet breach
#

as well

wraith rapids
#

how strange

#

how about last played

wet breach
#

last played should get set on quit

twilit rivet
wraith rapids
#

mm

#

how consistent

wet breach
#

should use group manager so everyone can tell you how terrible it is 😉

wraith rapids
#

lol

twilit rivet
#

the old days of GM was amazing

#

then PEX

wet breach
#

what do you mean the old days?

wraith rapids
#

pex > everything else

wet breach
#

group manager still works

twilit rivet
#

GM is ass

wraith rapids
#

lmao

#

elgar is dying

wet breach
#

so is everyone else

twilit rivet
#

I love it, but a lot of new people are like what the fk am I meant to do

#

same as pex

wet breach
#

or do you mean the rate they are is significantly increased?

twilit rivet
#

LP just has a cool web ui

wraith rapids
#

i mean as in immediately

wet breach
#

lmao

eternal oxide
#

I try to ignore trolls

#

GM is da bestest

wet breach
#

I generally use a modified version for GM 😉

#

it works and have no reason to use anything else

sage swift
#

you cannot ignore me elgar

#

i am too powerful

wraith rapids
#

i remember aikar raving about his permission setup

wet breach
#

he has his own plugin?

wraith rapids
#

apparently his permission setup leverages almost entirely on the built in bukkit permissions.yml

wet breach
#

or does he use a modified version of an existing one?

#

Well nothing wrong with that I suppose

wraith rapids
#

he just has a very small and lightweight plugin to add root nodes to specific players, which are then configured in perms.yml to have all of the other nodes as children

#

since the built-in perms system can't actually differentiate between players

#

aside from ops and not ops

wet breach
#

I can see how that kind of setup is more ideal for a database setup

wraith rapids
#

aikar raves about a lot of things

#

he has his own dedicated channel on the paper guild for raving about dieting and nutrition info

wet breach
#

lol personally he should just stick with coding advice and not nutrition stuff

wraith rapids
#

i agree

#

i have the channel muted

sinful python
#

I hate to ask a general java question here but the java discord couldn't answer my question (lmao). Why does it seem like every Location in the list becomes identical to the most recently added Location? I added the console commands to try to understand what is happening, I'll post the console's messages in a second

wraith rapids
#

remember that locations are mutable

young knoll
#

Locations are mutable

muted idol
#

hello there so after a game ends im trying to unload the world to then delete it. but for some reason the world that the player left does not get deleted. this is my stack trace. https://pastebin.com/Sdd5yCVX
the part of my code where im getting the error:

    public void GameEnd() throws IOException {    
        for (Player player : Bukkit.getOnlinePlayers()) {
            plugin.runners.clear();
            plugin.hunters.clear();
            plugin.playermanager.clear();
            plugin.playersInGame.clear();
            plugin.playersLeftGame.clear();
            player.getInventory().clear();
            plugin.sendToServer(player, plugin.getConfig().getString("Settings.Hub"));
        }
        
        Bukkit.getServer().unloadWorld("ManHunt", true);
        Bukkit.getServer().unloadWorld("ManHunt_nether", true);
        Bukkit.getServer().unloadWorld("ManHunt_the_end", true);
        
        FileUtils.deleteDirectory(new File("ManHunt"));
        FileUtils.deleteDirectory(new File("ManHunt_nether"));
        FileUtils.deleteDirectory(new File("ManHunt_the_end"));

        Bukkit.createWorld(WorldCreator.name("ManHunt"));
        Bukkit.createWorld(WorldCreator.name("ManHunt" + "_nether").environment(Environment.NETHER));
        Bukkit.createWorld(WorldCreator.name("ManHunt" + "_the_end").environment(Environment.THE_END));
    } //and i have already tried sleeping in between the unloadWorld and delete directory!
wraith rapids
#

the documentation about which methods return a modified clone and which methods simply mutate the location itself is kind of easy to miss

#

but it is there

#

most of the time, anyway

sinful python
#

Oh 👀

wraith rapids
#

iirc .add f.e doesn't clone

#

it just modifies

sinful python
#

b r u h

wraith rapids
#

so you're probably modifying the same location repeatedly and then adding the same location to a list several times

sullen marlin
#

@muted idol use unloadWorld(false)

#

not true

muted idol
sullen marlin
#

true is save, if you're deleting you dont want to save

sinful python
#

So I should make different variables for each of the locations, then add them to the list?

sullen marlin
#

also your spigot is ~100 versions outdated

wraith rapids
#

making different variables does nothing

#

multiple variables can point to the same object

muted idol
#

but it is just the world that the player died on that doesn't get deleted and renewed

young knoll
#

Clone it each time you want to modify it

wraith rapids
#

what you need is a new object, not a new variable

sinful python
#

Got it

sullen marlin
#

also make sure the world is empty

#

check the return value of unloadWorld

muted idol
#

no players?

sullen marlin
#

it will only return true if the world was unloaded, and it will only be unloaded if there are no players

wraith rapids
#

dead players are in a strange state

dense goblet
#

how would I stop a banner from being destroyed by a block update (i.e. breaking the block which supports it)? Is cancelling the BlockPhysicsEvent fine in this case?

sullen marlin
#

(this is all in the javadocs)

wraith rapids
#

they still exist in the world

wraith rapids
#

and i'm pretty sure they still load chunks and count for mob spawning, not sure about the latter

sullen marlin
#

@dense goblet should be

sinful python
#

God that one tripped me up hard yesterday, they aren't counted on getOnlinePlayers()

eternal oxide
dense goblet
#

would it work if e.g. the banner is on a sand block which gets updated by a chain of physics events?

wraith rapids
#

yeeeah dead players are kind of weird

quaint mantle
#

deleting overworld is a big no no

dense goblet
#

I need the banner to be indestructible pretty much

wraith rapids
#

you'll have a relatively hard time doing that

#

there are quite a few things that can destroy a block

eternal oxide
#

Overworld is blocked from being unloaded so can;t be deleted

wraith rapids
#

the main worlds all are

dense goblet
#

I have a bunch of them down already but physics is one that docs say you should be careful with

wraith rapids
#

well uh

eternal oxide
#

only overworld is prevented from being unloaded

sullen marlin
#

@dense goblet I mean it would be far better to just stop the support block from breaking

muted idol
wraith rapids
#

preeetty sure the primary world's nether is as well

sullen marlin
#

leaving things floating in the world that dont want to be there is bad

eternal oxide
sullen marlin
#

they will get removed one day

wraith rapids
#

at least I vaguely remember not being able to unload it with multiverse

muted idol
muted idol
#

which is like a waiting area

sullen marlin
#

the issue is probably the players like I said above

#

try that first

wraith rapids
#

yeah you want to move the dead player out of the world first

dense goblet
muted idol
#

aight

eternal oxide
dense goblet
#

but now that I think about it, it leads back to the same problem

#

i.e. gotta cancel a physics event which is said to be unreliable

#

such as when the banner sits on a sand block

sullen marlin
#

just put the banner not on sand lol

dense goblet
#

it can be put by the player anywhere

#

it should only be deletable through a menu

naive spindle
#

when i use hikari like this
hikari.setDataSourceClassName("com.mysql.jdbc.jdbc2.optional.MysqlDataSource");
hikari.addDataSourceProperty("prepStmtCacheSize", 500);
hikari.addDataSourceProperty("prepStmtCacheSqlLimit", 2048);
hikari.addDataSourceProperty("cachePrepStmts", true);
hikari.addDataSourceProperty("useServerPrepStmts", true);
hikari.addDataSourceProperty("serverName", DatabaseConfig.getAddress());
hikari.addDataSourceProperty("port", "3306");
hikari.addDataSourceProperty("databaseName", DatabaseConfig.getName());
hikari.addDataSourceProperty("user", DatabaseConfig.getUsername());
hikari.addDataSourceProperty("password", DatabaseConfig.getPassword());
hikari.addDataSourceProperty("useSSL", false);
hikari.addDataSourceProperty("characterEncoding","UTF-8");
hikari.addDataSourceProperty("useUnicode","true");
hikari.setMaximumPoolSize(10000);
hikari.setLeakDetectionThreshold(10000);

server is freezing, why is it?

dense goblet
#

and disallowing putting it on certain blocks would feel clunky

wet breach
#

you are probably performing queries on the main thread @naive spindle

wraith rapids
#

👀

wet breach
#

run the queries using an async task @naive spindle and it shouldn't cause your server to freeze

wraith rapids
#

baby's first steps into the world of concurrency

obsidian tree
obsidian tree
wet breach
#

nothing is wrong with the cofig

#

it is your code

obsidian tree
#

nope

wraith rapids
#

make a thread dump and look at what the server is freezing on

wet breach
#

a separate thread should not be causing the main thread to freeze, if it is there is something wrong with you code that is causing that thread to sync with the server in a bad way

wraith rapids
#

to figure out why the server is freezing, look at what it's blocking on; take a thread dump and assess the issue

eternal oxide
#

or post some actual code we can advise on.

obsidian tree
#

problem is

    hikari.setMaximumPoolSize(10000);
    hikari.setLeakDetectionThreshold(10000);
#

i deleted these lines and its working now

wraith rapids
#

👀

wet breach
#

not sure what the leakdetection does

#

probably the issue

#

as for poolsize, that shouldn't cause issues except network related ones lol

wraith rapids
#

leak detection sounds dubious

wet breach
#

never heard of leak detection for connection pooling

obsidian tree
#

it prints when you don't close the Connection afaik

wraith rapids
#

sounds pointless

wet breach
#

not sure why it would do that, if you don't close the connection yourself, the OS will eventually do so

sullen marlin
#

sounds helpful

#

but usually it comes at the cost of performance so you do it only in dev

wraith rapids
#

sounds like something that should be a flag at compile time

obsidian tree
#

but it wasn't the problem

#

i only deleted that line but it still didn't work

#

maximumPoolSize is the problem i think

sullen marlin
#

yeah 10000 is a lot

vestal dome
#

Uhhhh

#

mh

sullen marlin
#

doubt you need a pool of 10k?

#

Wouldn't a typical value be like 8

wet breach
#

I mean at 10k don't need a pool XD

#

typical value is like 20

#

or 30

wraith rapids
#

have you taken a thread dump yet

vestal dome
#

Thread.dumpStack();

#

nice

naive spindle
#

the main problem was our plugin is not saving every player if we kick all the players from server

#

when wem kick 1-2 players it is saving them to sql

#

but when we kick multiple players like 10-15

#

it is not saving

#

the main problem is this

vestal dome
#

PlayerQuitEvent?

obsidian tree
#

yes

wet breach
#

well that isn't an issue with the pool size

naive spindle
#

how can we fix it?

vestal dome
#

uhhhhh........ like are you doing it in a seperate thread?

wet breach
#

probably should configure your mysql server to handle a larger connection size though. But what you should be doing, is utilizing the pool and let your task do its job and notify that its done doing its job in saving all the player information

vestal dome
#

don't you have errors even?

wet breach
#

you are probably expecting it to be instant

obsidian tree
wet breach
#

when it simply isn't going to be instant if you have 10k players

naive spindle
#

i tried increasing max_connections on mysql

#

its like 5000 or 10000 rightnow

obsidian tree
#

for utilizing pool

wet breach
#

I am not going to do your job for you. You are already using HikariCP

#

its just a matter of using its API to fetch an existing connection

#

and then creating an appropriate task to do the job

#

and have some way to notify it is done

#

this way you can do your restart or shut down the server or whatever else you need to do

sullen marlin
#

also stop increasing max connections lol

#

leave it at the default or like 20

#

its literally causing your problems

#

20k connections is insane

wet breach
#

yeah, connection pool size isn't the same as max connections

naive spindle
sullen marlin
#

both

naive spindle
#

sure

#

also i found a error ```

[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: java.sql.SQLTransientConnectionException: HikariPool-2 - Connection is not available, request timed out after 30000ms.
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at net.cladium.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:695)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at net.cladium.hikari.pool.HikariPool.getConnection(HikariPool.java:197)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at net.cladium.hikari.pool.HikariPool.getConnection(HikariPool.java:162)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at net.cladium.hikari.HikariDataSource.getConnection(HikariDataSource.java:128)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at net.cladium.core.database.Database.getConnection(Database.java:133)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at net.cladium.core.player.CladiumPlayer.lambda$saveOptions$3(CladiumPlayer.java:217)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:58)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at java.base/java.lang.Thread.run(Thread.java:829)```

vestal dome
#

why create 1 connection for 1 thing...

wet breach
#

connection pool size is similar to creating a task handler

#

each pool created can handle many connections

naive spindle
#

i can send more errors

wet breach
#

so a size 20 for connection pool could mean, 20k connections if each pool is configured to handle 1k connections

naive spindle
#

here is the full errors

#

we kicked all players here

vestal dome
#

well.

#

reading errors is fun.... unless they are completely copy and paste of each other.

naive spindle
#

just wanted to paste all of them

wet breach
#

basically, you didn't bother catching the exception if a connection isn't available

#

or bother handling it

naive spindle
#

SET GLOBAL max_connections = 30;
is this ok for mysql?

wet breach
#

mysql, you want 50k-100k

#

shouldn't need more then that, but mysql is capable of handling millions of connections though

naive spindle
#

md_5 said lower it, it was 10k before

wet breach
#

more or less referring to your connection pool size

obsidian tree
#

I created a new /stop command, it loops all players and kick them all. and after 30 seconds, it shutdowns the server.

wet breach
#

since you didn't understand that pool size isn't the same as how many connections it will make

obsidian tree
#

and this is the saveOptions method (for saving datas to sql)

#

how can i make this better

dense goblet
#

@sullen marlin unfortunately cancelling the physics event doesn't stop the block from breaking, it seems to have no effect (even though it prints that the event is cancelled)

obsidian tree
#

i dont want you to do my job, i only need some examples

wet breach
#

So, first things first, set your mysql server to handle 100k connections, next use a connection pool size of 10-20, and then configure each pool to have 100 connections. This gives you 1000k-2000k connections total that hikaricp will use or try to use.

#

that is a bit extreme and would recommend using lower limits if possible for your connection pool, but that should resolve your issues or some of them.

torn oyster
#

how do i not save a world

#

on disable

#

do i like

#

unload the world onDisable

#

with save = false

naive spindle
wet breach
#

that is fine, I am telling you what you failed to understand and went wrong as far as configuring the connection pool stuff goes

#

connection pool size does not mean the amount of connections it will make

naive spindle
#

so i'll add my.cnf
[mysql]
max_connections: 100000

and we need to set pool size to 10 or 20 in code?

#

how can we configure each pool

wet breach
#

hikaricp should have api methods to set the connection limit for the pools

wet breach
#

yes

#

restart mysql server so that it uses the new config setting, or use the command to change it

naive spindle
#

we'll try that thanks!

vestal dome
#

uhhh

#

can I intervene now?

#

lmfao

naive spindle
wet breach
#

it seems the configuration option you were using was correct, however I don't use hikaricp so I can't say for certain why setting it to 10k for example would cause issues other then guessing that it creates 10k connection objects in their own threads which can be bad lol.

vale cradle
#

I'm pretty sure you set it from the HikariConfig

wet breach
#

I personally use BoneCP even though it is deprecated

obsidian tree
naive spindle
vale cradle
#

there's a method thought

#

You need a HikariConfig to create a HikariPool

wet breach
#

HikariCP doesn't have a setting to create partitions

vale cradle
#

Just look where it is and change the values

wet breach
#

partition is like a handler

dense goblet
#

just realised dividing coords by 16 doesnt give the proper chunk coordinates on negative quadrants .-.

vale cradle
wraith rapids
#

rightshift by 4

vale cradle
#

^^

dense goblet
#

that multiplies by 2^4 no?

wraith rapids
#

division rounds towards zero

#

rightshift rounds towards negative infinity

vale cradle
#

A listener of queries?

dense goblet
#

I am using integers

wraith rapids
#

yes

#

-1 / 16 = 0

#

-1 >> 4 = -1

wet breach
#

@dense goblet there is a few ways to resolve your problem. Easiest one is bitshifting

dense goblet
#

ooo that is cool

wet breach
#

or you can just use absolutes and keep track of the negatives

dense goblet
#

thank you for the tip

wraith rapids
#

-1 / 16 = -0.0625 which rounds towards zero, to 0

wet breach
#

or you can just simply divide by a negative when its negative numbers

wraith rapids
#

rounding towards negative infinity however yields -1

#

which is the correct value

dense goblet
#

and what about modulo, if I want chunk-relative coords

wet breach
#

and yes, for values that don't divide evenly need to round the values

wraith rapids
#

you want to use & with a bitmask

dense goblet
#

so x & 0b1111

wraith rapids
#

myes

#

gives values ranging from 0 to 15

dense goblet
#

cool ty

wraith rapids
#

the reason why these semantics work is because the chunk coordinate and the in-chunk block coordinate are effectively complementing bitmasks

wet breach
wraith rapids
#

that is, the 4 least significant bits represent the location within the chunk

#

and the 28 most significant bits represent the location of the chunk

#

put them together and you have a global location within the world

#

right shifting by 4 yields you the 28 bits of the chunk coordinate

#

bitmasking by 4 rightmost high bits yields you the block component

dense goblet
#

thats a good way of looking at it

wraith rapids
#

going a step further you can split the 28 remaining bits to 23 bits of region location and 5 bits of in-region chunk location

#

but that's less useful as regions aren't really exposed by the api

vale cradle
wet breach
#

@vale cradle yes that counts

vale cradle
#

yes

#

a lot actually xd

wet breach
#

so, with executors you have workers

#

each worker can only do so much work as defined

dense goblet
wet breach
#

well partitions with connections is like workers

#

and you would set the amount of connections each partition is allowed to make

#

IE, the amount of work they could do

vale cradle
#

So, you want a pool for each executor?

wet breach
#

exactly

vale cradle
#

There is no need to create so many pools

wet breach
#

this is optimal because if a pool is too busy, it should use a different pool

wraith rapids
#

all the pools

vale cradle
#

Personally I create an API to do the DB work, and I connect them with the rest of the code using Futures

wraith rapids
#

pool.close(Reason.AIDS)

vale cradle
#

The DB stuff is made in a different thread but from the same executor

#

I create an Executor for each one tho

wet breach
#

hikariCP is supposed to be the successor to bonecp, however hikaricp is missing features

vale cradle
#

one for MySQL, another for MongoDB, etc.

wraith rapids
#

one might say you're boned

vale cradle
wet breach
#

Well there are different ways to implement connection pooling

#

all you are doing is just using your own implementation

#

instead of using a lib for it

vale cradle
#

It's not so hard tho

#

Btw, I have my own library

#

And all of those stuff is on there

wet breach
#

@vale cradle it may not be hard to create your own connection pool implementation. There are various requirements that are related to connection pools

#

some people need speed and then others don't necessarily need speed but want a smaller memory footprint

#

to implement either of those requirements requires vastly different approaches