#help-development

1 messages Β· Page 640 of 1

vast raven
#

Would mongo be helpful to save a JSON itemStack, isn't it?

prime epoch
#

right well i do know how it works so stop chatting shit honestly

remote swallow
#

you sure?

echo basalt
#

But putting a shitty drawing of 3 circles into 1 big circle isn't going to explain it well

prime epoch
quaint mantle
#

will there be lag if there are more than 100 or 1000 queries per second in the database? how do i get past this?

quaint mantle
#

epicebic was explain this but i wanna hear this from you

echo basalt
#

guys please put some effort in your explanations

kind hatch
young knoll
#

Especially with a pool of connections

remote swallow
prime epoch
prime epoch
quaint mantle
#

and how much ram and cpu am i need for this ?

livid dove
#

Very recently as part of our library for example we've set it up that on enable it will grab data from a db and initialise an "sqlTable" class which is essentially a cache that periodically updated back to the dB (every few mins) the big changes.

Or if ur not a masochist, learn redis and implement a duel system of SQL and redis

echo basalt
#

A database is a piece of software written with the objective of managing data. It provides an easy solution to manage your data at a large scale, across multiple machines.

Depending on the type of database (SQL vs NoSQL), data can be stored in different ways:

  • In an SQL database, the data is stored in tables which consist of columns you write ("PlayerID is a variable character array of length 36"), which are then indexed by the DBMS (Database Management system, such as MySQL for example) so you can do queries like SELECT money FROM player_data WHERE PlayerId = '...';

  • In a NoSQL database (Let's say mongo), the data is stored in documents, that look like "json" files (In practice it's actually bson, a binary version of json), where each document has an internal ID and is also indexed for queries.

To operate a DBMS, you must establish a connection with it. Most DBMS software is designed to handle multiple connections from multiple sources, and have safety checks such as internal locking and read-only views to deal with concurrent requests, so things don't become desynchronized.

Don't forget that your DBMS instance isn't made of iron, and you want to cause as little load on it as possible, so you need to have a balance between keeping data in cache on your program (plugin), and hitting your database with queries.

Once you achieve a huge load, it's important to shard your database, which means that segments of it are kept in separate instances and it all acts as one, with shared indexes. This allows you to hit different instances at the same and retain functionality while spreading the load.

quaint mantle
#

If there are 1000s of data in a haspmap, how much ram will it consume?

prime epoch
prime epoch
livid dove
prime epoch
#

you can cut down on it by storing stuff like the player UUID instead of the Player object (usually very bad pratice to store the player object)

livid dove
#

*1000 ints

echo basalt
livid dove
echo basalt
#

And it also demonstrates how you don't know how java's memory structure works πŸ˜›

prime epoch
echo basalt
#

Yes

quaint mantle
prime epoch
#

anyone else wanna try say i dont know how something πŸ’€

echo basalt
#

Putting an object in a hashmap won't create a new copy of the object, but instead just add the memory address to its internal container

young knoll
#

Because storing the player object leads to memory leaks

livid dove
echo basalt
#

It's incorrect

#

I'm not saying to not try, just saying that the way you're explaining doesn't match reality

worldly ingot
#

Yeah. That Player already exists. Putting it in a collection doesn't change that

#

Same amount of memory is used

echo basalt
#

I should get a teaching degree

worldly ingot
#

minus the overhead of the collection itself, but y'know

echo basalt
#

so I can school people

prime epoch
young knoll
#

That's called being a redditor

worldly ingot
#

ackshually

remote swallow
#

no its called mansplaning

livid dove
echo basalt
#

what do you think I'm practicing here

livid dove
#

Being a bad lecturer?

echo basalt
#

yeah

livid dove
#

Lol

remote swallow
#

how else is illusion gonna hire 9 year olds to work for 1/3 minimum wage

echo basalt
#

I already tested my patience by getting my basic programming degree while already knowing how to code shit

quaint mantle
#

sry about that why i need storage player uuid ? not name ? for offline

prime epoch
echo basalt
kind hatch
young knoll
#

Because names can change

worldly ingot
#

In offline mode, so can UUIDs :D

echo basalt
#

:D

worldly ingot
#

So you're fucked either way, really

young knoll
#

Shh

#

Offline mode isn't real

livid dove
#

So ill be the good student and actually ask, how come a player map can cause a memory leak? If the overhead is only in setting up the collection? Never actually encountered this explanation and I'm genuinely curious

junior geyser
#

Do color codes count as charaters in the spigot charater limit?

quaint mantle
#

wait

echo basalt
#

Β―_(ツ)_/Β―

quaint mantle
#

in offline mod names is uuid ?

worldly ingot
echo basalt
#

I'm not here to argue but at least know your shit

kind hatch
remote swallow
young knoll
junior geyser
worldly ingot
echo basalt
worldly ingot
livid dove
echo basalt
#

It's UUID.nameUUIDFromBytes(byte[] bytes)

prime epoch
junior geyser
worldly ingot
#

Yes

young knoll
#

You can however use a WeakHashMap

junior geyser
worldly ingot
#

Yes

junior geyser
#

I just wasited a crap ton of time then

wet breach
#

they can at the same time

worldly ingot
#

:D

junior geyser
#

alright thanks

young knoll
#

Can't wait to see plugins with scoreboards that go across the entire screen

worldly ingot
#

1.20.1+ change though. Limit still exists in prior versions

#

So if it's a public plugin, at least be mindful of that

echo basalt
junior geyser
wet breach
echo basalt
#

Then you're just passing a new object with the same data

prime epoch
prime epoch
young knoll
#

You said you can save memory by storing UUID over player

#

Which is not true

prime epoch
#

how is that not true?

echo basalt
young knoll
#

Because they are both just a refrence to an object

livid dove
young knoll
#

And refrences are all the same size

prime epoch
#

alright i see my mistake my bad

echo basalt
#

When you put players in a map however, you're still holding a reference in that map which prevents the object from being garbage-collected. When the player then leaves and rejoins, the old instance is not GC'd because it's reachable by your map, but the new instance is also put in your map which results in a memory leak

young knoll
#

Unless you use a weak map

echo basalt
#

^

livid dove
mortal hare
#

is there any like real reason to use runtimeOnly inside gradle projects if you're loading your libraries manually via the classloader? (provided runtime class path doesnt matter in that case, no?)

echo basalt
#

but yeah

prime epoch
echo basalt
#

I did the most technical explanation that resulted in same conclusion my dude

#

I'm not here to be pretentious and say that I'm better than everyone

#

Because I'm not, frostalf is more experienced than me

prime epoch
#

and that i dont know how java works

#

over a minor mistake

#

πŸ‘

echo basalt
#

Β―_(ツ)_/Β―

livid dove
#

You insulted him and said he was wrong.

It took like 5 mins to even give a reason bro.

He was wrong and a muppet. But my man take the L

echo basalt
livid dove
#

Gotten πŸ˜†

prime epoch
#

lovely jubbly

river oracle
#

classic help-development

echo basalt
#

I'm not gonna lose my mind over a meaningless argument

#

who else needs help

prime epoch
livid dove
remote swallow
river oracle
#

me 🀚

How heavy of a task is ChunkSnapshot and if so how should I make sure I don't lag the server while taking (I forgot the work dist command)

mortal hare
echo basalt
kind hatch
#

?workdistro

echo basalt
#

Uses a bunch of ram though

mortal hare
#

chatgpt says that you dont need to use runtimeOnly in gradle if you're using custom class loader

echo basalt
mortal hare
#

ik its bad to use chatgpt

#

but im asking here for clarification

remote swallow
livid dove
opal juniper
#

docusaurus better

echo basalt
#

Like it just looks too.. beginner

sweet sonnet
#

If I use the spigot api but only use bukkit classes, etc, can my plugin also work on a bukkit server or no?

#

I'd asume not

terse bough
#

Is it possible to send the text with a Custom Color via ItemDisplay Packet, because then you have to convert the string to a Component? I can't find a solution. :/ (ver. 1.20)

young knoll
#

Depends

#

Some methods in bukkit are still from the spigot API

#

But not many

opal juniper
#

If the bukkit server is spigot maintained bukkit then yeah

echo basalt
#

Isn't Bukkit just an API, I haven't seen a bukkit server in a while

young knoll
#

It is yes

sweet sonnet
#

craftbukkit is the server implementation

young knoll
#

You need CraftBukkit to run

echo basalt
#

Everything is usually spigot, paper+ or some off-brand minestom/glowstone platform

worldly ingot
#

You've probably never seen a Bukkit server

remote swallow
worldly ingot
#

Given that, y'know, it's not a server πŸ™‚

young knoll
#

But if you see someone running plain craftbukkit in 2023

#

Kill them

opal juniper
#

i mean. what’s the difference lol?

remote swallow
echo basalt
#

Looks too formal imo

remote swallow
opal juniper
#

oh no, the .spigot() is gone

worldly ingot
#

VeinMiner has a few

echo basalt
#

run the command accordingly

young knoll
echo basalt
#

Can be simplified

remote swallow
#

i did remove some of the formal stuff

#

bc it was too formal

worldly ingot
echo basalt
#

Subsequently

opal juniper
#

doesn’t chocos PR add more of those .spigot() piles of garbage

echo basalt
#

This word is too complex for most international uhh

#

people

opal juniper
#

i hate the spigot interfaces

worldly ingot
#

wtf D:

#

I do add more of those only because we kind of have to

echo basalt
#

I'd replace it with a "Once ran"

young knoll
#

Not really any choice

#

But yes it does kinda suck

opal juniper
#

Great PR though

worldly ingot
#

Fun fact though, the current Spigot interfaces aren't actually interfaces. They're classes

#

I'm adding interfaces now though

kind hatch
worldly ingot
#

Not without giving it a stupid name

young knoll
#

I mean we could use weird names

worldly ingot
#

e.g. getNameComponent()

young knoll
#

Or make it take a param for no reason

opal juniper
#

Player#spigot#respawn should not exist

#

πŸ’€

worldly ingot
#

You're welcome to PR a replacement in Bukkit πŸ™‚

#

We're trying to move out Spigot-exclusive API tbh

young knoll
#

Can we PR replacements for all of spigot?

#

It's patch system succ

remote swallow
#

no

#

can we merge craftbukkit into spigot

wet breach
echo basalt
#

doesn't matter anymore

wet breach
#

maybe not, but I still missed it lmao

#

anyways I am just going to assume you are correct regardless then

remote swallow
echo basalt
#

can't bother reading that

remote swallow
#

ms

#

smh

round finch
#

Most experienced none staffs?

#

Hhmm

echo basalt
#

Β―_(ツ)_/Β―

#

I don't get paid for this crap

wet breach
#

there is plenty here who are not staff that are very experienced

echo basalt
#

Sure maybe it brought those 2 people to my DMs

remote swallow
echo basalt
#

But we're just here to help each other

wet breach
#

and to guide the lost and teach the new

echo basalt
#

I'm only here because I was asking for questions a few years ago and now I'm experienced enough to be able to guide others

quaint mantle
#

is my connection right and hikari works like this ? i set config and equalize with connection after change some datas with statement method ?
and where can i find properties like maxpoolsize or more ?

echo basalt
#

boomer

#

and also to give us the moneys

#

speaking of moneys can I have 2 grand I wanna visit the states

kind hatch
echo basalt
#

πŸ‘‰πŸ‘ˆ

wet breach
#

Not my fault the staff abadoned ship. If I had known ahead of time they were going to this, I would have stayed XD

wet breach
#

so in a way, yes

wet breach
echo basalt
#

plane ticket's like 750 bucks

#

saving up for it but takes a while

wet breach
#

yeah but hotels cost a lot though unfortunately

#

and airbnb isn't anymore helpful on that

echo basalt
#

I gotta get new glasses πŸ˜”

echo basalt
wet breach
#

o.O

echo basalt
#

like

#

300 bucks

wet breach
#

was going to say, that is the most I have paid for glasses XD

trim lake
#

Why?... Idk if Im stupid or what πŸ˜„

String version = "1.1";
String[] versionSplit = version.split(".");
        PersoKits.console.sendMessage("0: " + versionSplit[0]);
        PersoKits.console.sendMessage("1: " + versionSplit[1]);
wet breach
#

not that I need glasses but my SO does

echo basalt
#

They'd be much cheaper but my dad decided that a 70% discount due to insurance were just them trying to scam him into buying them early

mortal hare
#

is there any reason to use runtimeOnly classpath in gradle while developing spigot plugins

#

i cant see any use of that

echo basalt
#

So instead of paying like 100$ for frames and having free lenses I gotta pay mad cash money

echo basalt
#

And I do need glasses for driving

wet breach
#

that would mean the glasses would cost you like $100

echo basalt
#

So yeah like 100 bucks

#

Which is much less than the like 350 I'll have to pay

wet breach
#

not sure how that could be viewed as a scam

#

XD

young knoll
#

Frames are always so damn expensive

echo basalt
#

because he'd be buying it after like 2 years instead of once every 5

wet breach
#

I mean insurance itself is a very elaborate large scale scam, but I mean the choice of having and not having it though is a very big difference however regardless

echo basalt
#

it was their own insurance

trim lake
young knoll
#

Regex

echo basalt
#

30 bucks and you get free lens replacements for 2 years

#
  • 50% on frames
#

n some other things

young knoll
#

. is a special character in regex

echo basalt
#

He gave in

#

and just didn't use it

trim lake
#

Oh, I see... Im stupid thanks

hazy parrot
#

What ide are u using marek, I think ij scream if you don't escape dot

quaint mantle
#

If I give money to one of you, will he be able to answer my questions?

echo basalt
#

We're not here to take your money

#

Just ask away

quaint mantle
#

alright

trim lake
#

Eclips... I know is horible

hazy parrot
#

That explains it πŸ˜‚

trim lake
#

😦 xD

quaint mantle
#

i wanna understand hikari work

  • i set config to hikaridatasource and i connect with hikaridatasource ?
echo basalt
#

I never used hikari so I'll just let jesus take the wheel

#

or someone else

#

any of y'all used hikari?

remote swallow
#

yeah

young knoll
#

Yes

remote swallow
#

ill let coll explain

echo basalt
#

Go for it then

young knoll
#

It manages a pool of connections for you, you grab a connection from the data source with HikariDataSource#getConnection and then just close it when you are done (try with resources)

#

HikariConfig is what you pass to the constructor of HikariDataSource to specify config options

echo basalt
#

Chat components

wet breach
echo basalt
#

I just don't lmao

#

I should

#

But eh

past plover
#

in protocollib, how would i get stuff that have the field type as VarInt?

echo basalt
#

It's just a regular int

young knoll
#

I thought there was a getVarInt

echo basalt
#

Nope

#

ProtocolLib wraps the nms field class and not the contents that are then encoded

#

There's no VarInt class that's used in nms, that's purely a byte encoding thing

#

So if you have any int fields in the packet class, getInt to access them

worldly ingot
#

PL exposes it just as getInts()

#

They are just integers at the end of the day

remote swallow
#

hi choco

echo basalt
#

And any nms fields in the nms packet class are just their wrapped counterparts in plib

sterile breach
quaint mantle
#

saving datas to db with hasmap is good method ?
i mean player on join server i add hasmap and if player left server i set hashmap to db and remove from hashmap
or is there a better method?

gray saddle
#

how do i use event priority from a field

gray saddle
#

i want to get it from config

vast ledge
#

I broke myself

#

somebody help

dusty herald
#

any idea why java public void applyKit(Player player, Kit kit) { PlayerInventory inventory = player.getInventory(); inventory.clear(); inventory.setHelmet(kit.getHelmet()); inventory.setChestplate(kit.getChestplate()); inventory.setLeggings(kit.getLeggings()); inventory.setBoots(kit.getBoots()); inventory.setContents(kit.getInventory()); player.updateInventory(); } isn't working? This is the Kit data

 @Data
    public static class Kit {
        private String name;
        private ItemStack helmet;
        private ItemStack chestplate;
        private ItemStack leggings;
        private ItemStack boots;
        private ItemStack[] inventory;


        public Kit(FileConfiguration config, String path) {
            this.name = config.getString(path + ".name");
            this.helmet = getItem(config, path + ".armor-content.helmet");
            this.chestplate = getItem(config, path + ".armor-content.chestplate");
            this.leggings = getItem(config, path + ".armor-content.leggings");
            this.boots = getItem(config, path + ".armor-content.boots");
            this.inventory = new ItemStack[9];
            for (int i = 0; i < 9; i++) {
                this.inventory[i] = getItem(config, path + ".inventory-content." + i);
            }
        }

        private ItemStack getItem(FileConfiguration config, String path) {
            if (config.contains(path)) {
                Material material = Material.valueOf(config.getString(path + ".material"));
                int amount = config.getInt(path + ".amount");
                return new ItemStack(material, amount);
            } else {
                return null;
            }
        }
    }```
gray saddle
#

EventPriority e = EventPriority.valueOf(getConfig().getString("PlayerQuitEvent"));

Because I have this ^^^

young knoll
#

You need to use the method I provided

young knoll
#

Also also use Material.matchMaterial over valueOf

quaint mantle
#

who did this ?

dusty herald
#

I tried it without the updateInventory and it still didn't work, the only things updating are the hotbar itself, only the armor isn't updating and it's all not null. but I'll go ahead and change it matchMaterial

vast ledge
#

Somebody

#

send

#

help

vast ledge
dusty herald
#

idk imma take a break from it though, my heads hurting

vast ledge
#

but i stole it

quaint mantle
#

who did this πŸ˜„

vast ledge
#

from EpicEbic

young knoll
#

That video is quite old

quaint mantle
#

πŸ˜„

young knoll
#

No idea who made it

vast ledge
#

ig you try checking the domain register

quaint mantle
#

ah

#

not DedicatedMC

#

i found this

#

nvm

vast ledge
#

yep

#

there you go

#

thats who made it

desert loom
#

Completely replaces the inventory's contents. Removes all existing contents and replaces it with the ItemStacks given in the array. from the doc

young knoll
#

Ah right

#

How did I miss that

quaint mantle
#

you guys suggested me hashmap method for store datas to db is this good ?
is there a problem if a player constantly rejoin the server?

ivory sleet
#

its for libs that dont need to be on ur compile classpath

prime epoch
#

how would i go about changing nametag colors like in faction gamemodes? Ive been thinking about teams but i dont think it'll work the way i want. Is it possible to just get all the player info thats being rendered to the player then just change the colors client side with NMS?

young knoll
#

Team prefix is the best option

echo basalt
#

Yeah setContents removes armor

prime epoch
mortal hare
#

so there's no need to use runtimeOnly

#

since it wouldnt launch the plugin from application class loader (for example, CLI)

warm mica
vast ledge
#

I need mental help

hazy parrot
#

Me2 tbf

vast ledge
#

Shouldnt this

#

go through the blocks

#

and stop

#

once its foun done?

#

found one**

young knoll
#

Yes

#

Since you return inside every if

vast ledge
#

then explain this

chrome beacon
#

Show entire code

vast ledge
#

That is all the code

#

that can do placing

hazy parrot
#

It's not

vast ledge
#

the other code is to pickzp the block

hazy parrot
#

Also what event is it

vast ledge
#

PlayerInteractEvent

hazy parrot
#

?interactionevent

#

?interaction

chrome beacon
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
hazy parrot
#

Smh

vast ledge
quaint mantle
vast ledge
#

it executes

#

it has to be rightclick block

vast ledge
#

while shifting

vast ledge
#

im

#

going

#

to

#

go

#

cry

#

I want to move my self out of the window, at a very high velocity

#

Its fixed

hazy parrot
#

Me every 15 min

shadow night
vast ledge
#

welp

#

didn't work

#

nullpointer

shadow night
#

Fuck coding

#

Just do it manually

hasty prawn
#

NPE is probably caused by how you're setting bedlessDeus

vast ledge
#

"Cannot get Velocity of entity 'bedlessYeus' in line 1 of Yeet.java"

shadow night
#

Lmao

vast ledge
#

Turning into my server console

hasty prawn
#

Line 1? Where are you defining bedlessDeus, send the line for that.

vast ledge
#
public class Yeet extends bedlessEntity {
  bedlessDeus.setVelocity(bedlessYeus.getLocation().getDirection().multiply(15)) // please work
}
hasty prawn
#
  1. Naming conventions should be BedlessEntity
  2. If you're accessing the class variable bedlessDeus that's defined in BedlessEntity, you should be using this. in front of it
  3. You're using both bedlessDeus and bedlessYeus, which I imagine is a typo on the 2nd one.
  4. Missing semicolon
ivory sleet
#

if ur spigot plugin chooses an impl to some api

#

then runtimeOnly would be reasonable

vast ledge
#
  1. yes
  2. bedlessDeus is a static refrence to a player
  3. bedlessYeus is an undefined Entity in bedlessEntity
  4. yes
hasty prawn
#

Or atleast not error provided you're defining that variable properly

vast ledge
#

Player bedlessYeus = null;

hasty prawn
#

no

vast ledge
#

yes

hasty prawn
vast ledge
#

πŸ’£

shadow night
#

Imagine actually creating a something that would work like that lmal

#

I remember there was a guy who was like: let's make a real world api

vast ledge
#

yea

#

lemme just hack the mainframe

#

go into europe

#

get my entity UUID

#

and get my interface

#

extend it

shadow night
#

HumanEntity is a thing, right?

vast ledge
#

and launch me against a computer monitor

#

yes

inner mulch
#

is there a good guide for learning mysql?

quaint mantle
vast ledge
#

if you want mongo

#

(which is better)

quaint mantle
#

You will find lot of guides, there's not "a good guide" as many will be easier for you, and others will think other guides are easier than then one you read

quaint mantle
vast ledge
#

yes

#

1v1 me

quaint mantle
#

It depends on how you are going to use the database and for what

#

End of conversation

vast ledge
#

Ill throw rocks at you

livid dove
#

Just make a library that wraps it all so you can make sql databases with an abstract class that ends up being like this long Plus getters :L

livid dove
# remote swallow Is it on github

Not yet, we are currently in beta. Something like this, we wanna make sure its as idiot proof as it can be as , unlike most plugins, bugs in this one can seriously screw up a plugin

#

As its making database tables etc

#

Last thing we wanna see is 1000 lines in the console of SQL exceptions

#

lmao

remote swallow
#

Can i have the db stuff

quaint mantle
remote swallow
vast ledge
#

GIMME

#

OR

#

I

#

STAB

livid dove
# quaint mantle How does it work? Can you make an example?

Of course. That image is a single table.

It is controlled using an SQL table manager:

Each "table" added to the manager is a cache of the table that updates every X ammount of time (config defined) that allows for easy calling of data from the table.

If a row is added, updated, removed etc, every X ammount of time the SQL is also auto updated.

If, onEnable, the table is initialised, and a check of the database shows the table does not exist, it will create it as per the fields of the Class.

#

In fact

echo basalt
#

Decent, I usually just have a main table class and do a lot of manual logic

#

Problem is

livid dove
echo basalt
#

There are certain parameters that certain drivers have

livid dove
#

Apologies for any errors, missing stuff etc

echo basalt
#

Like mySQL's blob being postgres' BYTEA

#

How do you handle it

quaint mantle
#

What happens if a table already exists, but it has new fields or some have been removed?
Is there an "updateTable" method?

livid dove
quaint mantle
livid dove
echo basalt
#

In mysql you have BLOB, MEDIUMBLOB etc

#

In postgres it's all just a BYTEA with no limit

#

There are also some query changes

#

From ON DUPLICATE KEY UPDATE to ON CONFLICT etc

quaint mantle
#

Why don't you "translate" the column type on creation? By having a SQLDriver enum, or somthing to identify the sql engine

echo basalt
#

Just look at the uhh

#

queries here

livid dove
quaint mantle
echo basalt
#

diff driver

quaint mantle
#

Oh

livid dove
#

Tbh this is why i want to release it publicly sooner rather than later as it would allow the benefit of folk more familliar with other drivers to potentially contribute

shadow night
livid dove
#

Yeah tbh im happy with the whole Library.

The team really smashed it out (mainly myself and a guy called chronicler delta).

Got our commands down to this:

public class ClaimDepositExecutable extends SettlementExecutable {
    /**
     * Constructor initialises the settlement manager, along with initialising all the fields of the {@link
     * CommandExecutable} from TheCuriosityCore. This makes the
     * creation of nested commands much easier.
     *
     * @param settlementManager The settlement manager for this plugin, initialed as a singleton onEnable.
     */
    public ClaimDepositExecutable(SettlementManager settlementManager) {
        super(settlementManager);
    }

    @Override
    public void perform(CommandSender commandSender, String[] args) {
        if(!(commandSender instanceof Player)){
            Bukkit.getLogger().info("You cannot execute this command as the console");
        }
        Player playerSender = (Player) commandSender;
        UUID settlementId = this.settlementManager.getSettlementID().get(0);
        Bukkit.getServer().getPluginManager().
                callEvent(new SettlementWealthDepositEvent(playerSender,settlementId,Integer.parseInt(args[1])));
    }

    @Override
    protected String initName() {
        return "deposit";
    }

    @Override
    protected String initDescription() {
        return "Deposits cash from the players currently selected settlement";
    }

    @Override
    protected String initSyntax() {
        return null;
    }

    @Override
    protected List<String> determineTabCompletes(String[] strings) {
        return Collections.emptyList();
    }```
echo basalt
#

my commands are much different lmao

#

that reminds me of my SimpleCommand util

quaint mantle
#

I love how almost nobody uses the return statement of bukkit command API πŸ˜”

echo basalt
#

simply inferior

livid dove
#

Oh I like your approach.

Our library focused more on making it so these arnt command persay, but executors that can call on other instances of the executor abstract to allow really easy tab completion and nesting

quaint mantle
#

someone using hikaricp ?

hazy parrot
#

Yes

quaint mantle
#

can u teachme somethings ?

echo basalt
#

There are some other things my approach can do

#

Like params

livid dove
#

Aye thats cool

#

Itd be cool to see what bits n bobs we could take from each others approachces once our library is public

#

Collaberation is best dev work

#

change my mind :L

echo basalt
#

Where there's a FilteredParameterType interface where you could define a list of inputs

#

and it automatically tab completes

hazy parrot
rough ibex
#

dont ask to ask

quaint mantle
#

aight

livid dove
#

If not the sub-executeables are the tab completes

quaint mantle
#

and where can i see other properties like maxpoolsize

echo basalt
#

the filtered param type is also used for automatic filtering and casting

#

You can have a list param which is a filtered param type of a list

#

And that list can be of anything

#

And given you pass a T -> String function, you can get the param as an object from that list

livid dove
#

Oh noice, we do something simmilar but the oposite way around with our config package

#

where we have a cache of values that absoloutly need to be fast as heck (around 80% faster?) from the config where you dont need to use a million different methods to get different types of data from the config.

Just put in the class as one of the params and boom, u either get the value or an exception if youve been dumb and picked the wrong class

quaint mantle
# hazy parrot What

yes can i set hikari properties with any method ?
likemaxpoolsize
or like poolclosetime

hazy parrot
#

Wdym any method

quaint mantle
#

or someone give me guide for hikaricp

#

i can't found

hazy parrot
#

You have javadocs

quaint mantle
#

all videos for spirng boot

quaint mantle
#

javadocs don't tell me how to start

hazy parrot
#

How to start what

quaint mantle
#

Where should I start using hikaricp?
i mean which method getting my db information like username port host

#

docs can tell me this ?

hazy parrot
#

Can you please use some translator

#

Hikari is just used for obtaining connection, everything else you do normally

#

Preparin statements etc

quaint mantle
#

Can't I change certain settings while connecting?
i mean cp settings

#

like maxpoolsize

#

"most open pool"

hazy parrot
#

Have you even looked link I sent you

#

There is method setMaximumPoolSize

quaint mantle
#

im looking

#

ah

#

yes ty

livid dove
echo basalt
#

The parser's absolute doodoo

#

I might want to rewrite it one day

livid dove
#

Its amazing we've used class converting generics everywhere, but yet never thought about it

quaint mantle
livid dove
echo basalt
#

WEll

#

The syntax can get quite complex

#

Here's an example

hazy parrot
echo basalt
#

message <player> [no-logs] (content)

#

And 2 examples of how it works:
/message ImIllusion Hey there!
/message ImIllusion no-logs Hey there!

quaint mantle
#

ah

#

i found

#

from docs

#

nvm

livid dove
echo basalt
#

So the parser is broken down into 4 elements:

  • Literals
  • Parameters
  • Tags
  • List parameters
#

Literals are just 1:1 text

#

Parameters have a type, and if they're optional and don't match the type you skip ahead to the next element

#

Tags are like optional literals

#

And list parameters are like parameters except that if you do have a match, you match until:

  • The next element (Everything has priority over list parameters)
  • The list's parameter type no longer matches the input
#

And I just did this with a big ass for loop

#

And honestly I want to rewrite it into an actual parser with tokens

livid dove
echo basalt
#

Tab completion was a whole other brainfuck

#

where I get what element we're at with a rewritten version of the parser

#

And I match all the next possible elements

#

I should really just rewrite it but I already spent way too much time

shadow night
#

What the hell

#

Sir, this is a spigot's

echo basalt
#

I had no prior experience of writing a parser

#

I should really just write it properly lmao

shadow night
#

Wait

#

How do parsers work

echo basalt
#

They grab each word and tokenize it

#

And then grab the syntax and tokenize it

livid dove
#

Like erm... done?

#

Or at least the foundation makes it easy to be done

shadow night
#

Class[]

livid dove
#

Eh

shadow night
#

Wait what did I just write

echo basalt
#

as I said

#

doodoo

livid dove
#

All in favour of removing IMIllusion's rights to call anyone dumb for a month?

#

jk

echo basalt
#

shush

#

one thing is writing fucking language parsers

young knoll
#

Everyone writes bad code

echo basalt
#

this is very much a proof-of-concept adapted as production code

#

I have some code I'm proud of

livid dove
#

Also

young knoll
#

But only some people get to write bad code that makes it to production

echo basalt
#

Like the profiles system for my skyblock code :)

livid dove
#

fuick you for shitting on enterprise shit and then doing fucking //comments with full ass shakespeare verses

#

and not making em javadocs

echo basalt
#

fuck off

livid dove
#

LMAO

#

Love ya man

echo basalt
#

I don't shit on enterprise code

livid dove
#

Wait is that not u?

#

SOmeone does

#

I swore it was you

echo basalt
#

I wrote this last week

worldly ingot
#

Truly a marvel

shadow night
#

The description tho

echo basalt
#

Why would you want to access the builder

worldly ingot
#

You won’t be able to see it at all. It just exists

echo basalt
#

nah you don't

#

@Builder.Default

#

for default values

#

Lets you set a default value

young knoll
#

That’s not a default then

livid dove
#

I am ready for judgement

inner mulch
#

Hello, I want to use packets to change a players nametag, is there any guide, material i can use to learn packet spoofing?

#

BlockBreakEvent?

#

or does this not work?

quaint mantle
#

if i add hikari am i need add mysql connector to maven ?

worldly ingot
#

Hikari needs to be shaded but CraftBukkit already provides the MySQL driver

quaint mantle
#

so i got this warn bcs craftbukkit already provides ?

#

wdym for shading i don't know .D

tidal karma
#

I think you misspelled packetWrapper. It should be PacketWrapper

dull atlas
#

Hi, how can I freeze player movement on the horizontal axis (x and z) without affecting the vertical (y) axis?
For context, I want the player to not move horizontally when he has the levitation effect.

I made this event but for some reasons whenever the player walk, the Y position is modified/frozen.

@EventHandler
    public void OnPlayerMovement(PlayerMoveEvent event) {
        if(event.getPlayer().hasPotionEffect(PotionEffectType.LEVITATION)) {
            Location from = event.getFrom();
            Location to = event.getTo();

            if(to != null) {
                to.setX(from.getX());
                to.setZ(from.getZ());
            }
        }
    }
```Any ideas?
river oracle
dull atlas
river oracle
dull atlas
#

Sure, lemme record

river oracle
#

you might need to verify

#

!verify

undone axleBOT
#

Usage: !verify <forums username>

dull atlas
#

Ah well I don't have an account sooo ;-;

#

Maybe a gif or idk

#

or via PM if you want

inner mulch
#

Guys, how do i use packets, i dont understand :(?

river oracle
#

just use NMS

#

NMS makes sending packets easy as fuck

#

?nms

river oracle
#

you have 2 types of packets, Clinetbound, and Serverbound

#

each Player on the server has a connection you can use to send packets

dull atlas
#

Found out also that the levitation is handled after the event call in Spigot/Paper.

        // If a Plugin has changed the To destination then we teleport the Player
        // there to avoid any 'Moved wrongly' or 'Moved too quickly' errors.
        // We only do this if the Event was not cancelled.
        if (!oldTo.equals(event.getTo()) && !event.isCancelled()) {
            this.player.getBukkitEntity().teleport(event.getTo(), PlayerTeleportEvent.TeleportCause.PLUGIN);
-            return;
        }

        // Check to see if the Players Location has some how changed during the call of the event.
        // This can happen due to a plugin teleporting the player instead of using .setTo()
        if (!from.equals(this.getCraftPlayer().getLocation()) && this.justTeleported) {
            this.justTeleported = false;
            return;
        }
    }
}
// CraftBukkit end
this.player.absMoveTo(d0, d1, d2, f, f1);
+this.clientIsFloating = d11 >= -0.03125D && !flag1 && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR && !this.server.isFlightAllowed() && !this.player.getAbilities().mayfly && !this.player.hasEffect(MobEffects.LEVITATION) && !this.player.isFallFlying() && !this.player.isAutoSpinAttack() && this.noBlocksAround(this.player);
this.player.serverLevel().getChunkSource().move(this.player);
this.player.doCheckFallDamage(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5, packet.isOnGround());
this.player.setOnGroundWithKnownMovement(packet.isOnGround(), new Vec3(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5));
if (flag) {
    this.player.resetFallDistance();
}

this.player.checkMovementStatistics(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5);
this.lastGoodX = this.player.getX();
this.lastGoodY = this.player.getY();
this.lastGoodZ = this.player.getZ();
#

I guess I'll have to predict the levitation velocity addition in my code πŸ₯²

river oracle
#

?jora

#

?jora

#

?jira

undone axleBOT
river oracle
#

bruh way too used to mythinkpad after tinkering with it for 5 hours

dull atlas
#

How long would it take to be fixed?

river oracle
#

depends if anyone picks up the issue and how simple the fix was

dull atlas
#

If it's like more than 2-3 months then I will work on another solution

river oracle
#

I wouldn't wait fo ra solution

dull atlas
#

yeah

river oracle
#

but submit a jira

dull atlas
#

doing it rn

river oracle
#

because its an issue nonetheless

dull atlas
#

yep

wet breach
river oracle
#

It could be a spigot issue, but I feel like it should just work regardless of when levitation is handled

dull atlas
#

Also, idk if this has importance or nah but i'm using 1.19.3-R0.1-SNAPSHOT

river oracle
#

I don't think any changes were made to that event

dull atlas
#

But from what I saw, there isn't differences for the levitation handling

wet breach
#

So the issue is when you cancel the event they continue to go up?

dull atlas
#

As alternative solution, I will simply add the levitation velocity in my event (even tho it's not great/optimal)

wet breach
#

So when the player moves you are changing where they are moving to?

#

If that is the case that makes sense in why velocity is affected

#

This isnt really a bug

#

Rather the server recalculating their trajectory and time it should get there

#

By setting for example their position further then the server says well for that to be possible they need to be going this fast or this slow lol

#

Its not like teleporting

wet breach
dull atlas
wet breach
#

Well idk if while having levitation you can hover across the ground moving freely. If not the only free movement is on the y

dull atlas
#

Well in vanilla MC, you can move horizontally while having the levitation effect

#

Which I am trying to avoid by simply making the player levitate upwards only

young knoll
#

You can try setting their walk speed to 0

dull atlas
#

It doesn't affect

#

Already tried it, walk speed is only applied to the ground

wet breach
#

Then i would cancel the move event if x and z changed by 0.5

dull atlas
wet breach
#

Move event?

#

Just cancel it if x and z changed by 0.5

#

Not sure what is difficult to understand here

dull atlas
#

By canceling it, you cancel the Y velocity

young knoll
#

Does setting fly speed work?

wet breach
#

Not sure why that would be so hard

dull atlas
#

If I cancel it

dull atlas
wet breach
#

It shouldnt if velocity is reset back to being upwards

dull atlas
wet breach
#

Like they are not going to fall out of the sky unless you dont set the velocity of course. All you should do is check the move event and see if x and z changed by a certain amount. If it has, cancel the event reset their velocity

dull atlas
#

I'll try to calculate the levitation velocity while revoking the horizontal ones

wet breach
#

You dont need to recalculate anything if you just cancel the event

echo basalt
#

Is there a way to know what chunks a player sees?

#

Or what players can see a chunk

#

Might be something about the chunk ticket system

dull atlas
wet breach
echo basalt
#

Probably

wet breach
dull atlas
wet breach
#

Anyways their view only resets when the event is cancelled and the event should be cancelled when x and z changes

#

So it wouldnt be all the time

dull atlas
#

Same way I never specified that I don't want the player to die or other things.
I just don't see why would you delete a variable, just to recode the same one, when you can just modifiy a variable via get/set

wet breach
#

What you should do then, is set their velocity to 0 when you change their position

#

Then set the velocity back to upwards

dull atlas
#

I have no ideas if you are trolling or if you are genuily serious

#

But that sounds like a really bad idea, sorry

wet breach
#

Ok then i wont help further.

compact haven
#

he’s being serious lol

#

I have no idea what this issue is, but frost doesn’t joke

dull atlas
#

I will simply add levitation velocity (0.9blocks/s) to my event while preventing the x/z variables to change

compact haven
#

pretty sure he’s incapable of such

wet breach
#

Spigots code on the other hand there isnt a flaw with it though

#

Just you have a unique requirement that doesnt fit the api

dull atlas
#

Indeed

#

I don't really think it's a flaw, just my case is very unique and wasn't taken in account for the Event

wet breach
#

Well resetting the velocity should do the trick for you

#

Because then it removes any guessing

#

Its basically like normalizing

dull atlas
#

But math/code wise, it's far simplier (logically) to revoke X and Z changes in the movement, while adding the predicted Y movement needed for the levitation.
Instead of rewritting the whole Location after canceling an event

wet breach
#

Well you said it was causing velocity to be added everytime to the y

#

You could just nullify that velocity by resetting it.

dull atlas
#

But I'll try to reset the velocity

#

rather than canceling the event

wet breach
#

I was continuing with you not cancelling the event

#

If you dont cancel the event just nullify the velocity by resetting back to known values

dull atlas
#

Yeah

wet breach
#

And then add velocity if its needed right after

dull atlas
#

Mhm, hopefully this won't alter the levitation

wet breach
#

It shouldnt, but this just removes a lot of guessing to predict unexpected velocities lol

dull atlas
#

Tried and, it works halfway. The player moves simply slower horizontally (altho the levitation works fine now)

#

It's like if the velocity (event) is reset in specific frames, but in between them the player can move a little bit

wet breach
#

Well better then nothing. And see wasnt such a crazy idea after all uwu

dull atlas
#

xD

wet breach
#

I wonder if its because of the client

dull atlas
#

Well I will revert my code like before, and will do some testing to find a good way to remove the freeze of levitation by adding some Y velocity

dull atlas
wet breach
#

If its due to the client you would need to reset velocity a couple of times to get the client to register that lol

dull atlas
#

a couple times?

#

like in loop x)?

wet breach
#

Client uses prediction with movement and over rules the server in regards to where it wants the player to move

#

So even though the server recognizes you want the player to stop the client could send another position packet and thus player moving again

#

Always fun to battle the client

dull atlas
dull atlas
wet breach
#

Idk you could try that or see if resetting velcity a couple times spaced by a tick or two works

dull atlas
#

mhm

#

If could maybe give negative velocity depending on the destination velocity? altho it might not be great

wet breach
#

Really wished mojang would let the server dictate movements and not the client

dull atlas
#

yeah...

#

It's also the main issue/reasons with movement hacks xD

wet breach
#

Well the hacks are actually easy to curtail

#

Most people dont because they want hardcore pvp

#

Basically how you handle them especially something like reach is you would set a lower value for the reach. This way if they use a hack they can only ever achieve normal values

#

Which makes detection super easy after that uwu

#

But yeah it is the reason those things can be done more easily

dull atlas
#

I see I see

wet breach
#

Anyways time for me to get back to work. These tires arent going to roll themselves

lost matrix
#

No? I did a block display thing?

river oracle
#

?workdist

#

man

#

?workdistrobution

#

I can't spell

#

sob

lost matrix
#

?workdistro

river oracle
#

thanks 7smile7

river oracle
#

slow

#

my language skills in general have always been a bit slow

wet breach
#

Maybe its average and everyone elses is fast or advanced

kind hatch
#

If return is a glorified goto statement, does it go to the ending method brace or the line before it?

lunar wigeon
#

well, Workload can be replaced with Runnable and it doesnt contain any multithreading

wet breach
river oracle
#

some tasks need to be done on the main thread

#

that thread covers such tasks

lunar wigeon
#

I think you dont understand

river oracle
#

its easy enough to do multithreaded workloads

lunar wigeon
#

I know it can be about changing blocks or modifying world which cant be done asynchronously. But it can work just like FAWE deals with it

river oracle
#

I'd be opening to see a better workdistro thread if you want to make one tbh I think that's something everyone could benefit from

#

I'm not far enough into this shit to know much better

lunar wigeon
#

well, you should read fawe docs

river oracle
#

that thread tends to be reccomended for workdistro problems too

lunar wigeon
#

its good to understand logic of work distribution

lost matrix
#

Those are often confused

humble lynx
#

A lot of tutorials online for NBT usage is saying to use NBTTagCompound, however I can't pull that method up. All other methods seem to work.
Has this been replaced with something else, if so, what's the renamed version?
I've tried taking a look at wiki.vg as well. (P.S using 1.20)

river oracle
#

why are you using NBT in 1.20?

lost matrix
#

?pdc

river oracle
#

so agree for the most part

humble lynx
#

I need to get the information of the mob that is being hit (e.g. skin type, collar, etc.)

lost matrix
#

I guess if you want to modify vanilla tags

humble lynx
#

and store this information, but I'm stuck on the getting information part

river oracle
lost matrix
young knoll
#

(Neither)

humble lynx
#

Through PDC? Or are you recommending I go through each mob that stores unique information

#

Because there's sheep, foxes, villagers, and many more lol

young knoll
#

I see

humble lynx
#

Plus if I want to be an experienced minecraft developer, learning about NMS is nice and just widens the scope a bit. Shutting people down each time the words NMS comes up is kinda sucky imo.

#

It's nice to use an API when it's there and makes it easier, but in this case I feel NBT is needed.

#

I just can't find any information on where to get the NBTTagCompound

lost matrix
lost matrix
#

mojang mappings

river oracle
#

if your using mojmaps they're named dif

#

it sucks

lost matrix
#

net.minecraft.nbt.CompoundTag

river oracle
#

yeah

#

lame ass name change smh

lost matrix
#

mojmaps are godsend

#

Im so glad we have those now

humble lynx
#

It'd be easier for me to make a list of mobs that have custom tags (such as cat, fox, etc.)
Then run my method and get the Variant information, then store that information.

junior geyser
#

@worldly ingot Apparently it does not actually include color codes in the charater limit

#

For versions older than 1.20.1 I mean

#

The change was made a couple days after the 1.16 release

lunar wigeon
humble lynx
lunar wigeon
river oracle
#

imho you should make a thread covering multithreaded workdist for operations like FAWE block placement etc which must be sync

#

I personally would like to see and in detph coverage of that kinda workdist vs an overview of the logic

lunar wigeon
#

you know what fawe does, do you?

lost matrix
lost matrix
lunar wigeon
#

well, yes but no

river oracle
lunar wigeon
#
        try { 
             asyncCatcher = Class.forName("org.spigotmc.AsyncCatcher").getDeclaredField("enabled"); 
             asyncCatcher.setAccessible(true); 
                asyncCatcher.setBoolean(asyncCatcher, true);
         } catch (Throwable ignored) { 
         }
#

thats part of fawe's code

young knoll
#

Cursed

lunar wigeon
#

they modify spigot so AsyncCatcher doesnt catch it

young knoll
lost matrix
#

Ok but "it" is not traditionall block modifications

lunar wigeon
#

well ofcourse it isnt

lost matrix
#

They still synchronize with the main thread, just manually

lunar wigeon
#

they use NMS for faster block placement, workload distribution to not run everything in 1 tick

young knoll
#

Fast async world exception

lost matrix
#

But yeah fawe does a lot of very weird stuff in the background

lunar wigeon
#

but it is still efficient, but could be even better

#

well if you have time you can update your thread or github repo to make it even more optimized because it surely can be

worldly ingot
lunar wigeon
#

XD

lilac dagger
#

at least they're replacing blocks fast

lunar wigeon
#

well yes, but at what cost

#

replacing blocks asynchronously may cause server crashes

lost matrix
#

*from another thread.
And as stated before: They dont actually do that. The unsafe sections
are not used for placing blocks...

remote swallow
#

7smile can i get ur opinion

lost matrix
#

Sure

remote swallow
remote swallow
lost matrix
#

Oh i see jekyll πŸ™‚

#

Just the Docs?

remote swallow
#

how did you know kekw

lost matrix
#

Hm, both are quite readable.
I think the split of each section having

  • Quick use
  • Further explaination

Makes it useful for experienced and new users

remote swallow
#

ones written by me, the other is chatgpt making it formal

lunar wigeon
#

@lost matrix are you planning to update the spigot thread or github repo?

lost matrix
#

Uhm, for which thread? I got a few...

lunar wigeon
#

the workload distribution

lost matrix
#

I would have to re-visit that because it was written a while ago.
But i didnt see anything missing the last time i checked

remote swallow
lost matrix
#

What would be your suggestion i should add

lunar wigeon
#

and it should work on many threads and queue it to main thread

lost matrix
#

Workload was the first iteration of the class. Its expanded later on

buoyant viper
lost matrix
lunar wigeon
#

the entire queue works on main thread

#

+it runs even when tick is overloaded

#

it should check it before polling it

lost matrix
lunar wigeon
#

I've just checked the thread again and it's mostly what Aikar said

lost matrix
lunar wigeon
#

was it?

lost matrix
#

Let me double check

remote swallow
#

how do most people actually learn to write wikis

remote swallow
lunar wigeon
lost matrix
lunar wigeon
#

yea, spigot doesnt provide that

#

but you can still check it

lost matrix
#

Elaborate

lunar wigeon
#

on github or spigot

lavish hemlock
#

Quick question. I know the best practices but I'm curious why they're best practices.
So obviously, use SQL connection pooling because it's slow to open a new connection for each transaction.
But why not just have a single connection open for the whole duration of the program?

lost matrix
lunar wigeon
#

well you have repo on github and thread on spigot

lost matrix
lavish hemlock
#

But why should you close connections after you're done with them?

lunar wigeon
#

also using NMS you can place block way faster

lavish hemlock
#

The other parts make sense though.

lost matrix
lavish hemlock
lunar wigeon
#

I should wear glasses

buoyant viper
# lost matrix

reminds me i wanted to PR a ServerTickEvent w two possible "stages", START, and END, like

public class ServerTickEvent extends Event {
    private final Stage stage;

    public ServerTickEvent(Stage stage) {
        this.stage = stage;
    }

    public Stage getStage() {
        return stage;
    }

    public enum Stage {
        START, END
    }
}```
lavish hemlock
#

Oh Fabric has something like that.

remote swallow
#

imagine that

buoyant viper
#

imajin that

remote swallow
#

calling an event twice every 50 ms

#

screaming for lag

buoyant viper
#

as long as the servers event manager isnt dogshit it shouldnt be an issue

lavish hemlock
#

Well, you're probably already calling a shit ton of events every second anyway

#

And on Paper this is negligible

buoyant viper
#

clients call millions of event/s just fine peepoCoolSunglasses

lunar wigeon
lavish hemlock
#

No but I have seen what player move packets are like :)

buoyant viper
#

haha packet spam go BRRRRRRRRRR

lavish hemlock
#

So I can only imagine what that looks like on the server side

buoyant viper
#

20 events/s per player

#

ezpz

lost matrix
buoyant viper
#

1.9+ tried? to optimize this iirc by sending fewer position packets if a player hasnt moved

#

but i think it still spams hard p sure

remote swallow
#

mojang goo rewrite to not send move packets for mouse move ment

lost matrix
#

2 more events per tick are neglible

buoyant viper
#

yeah :P

lost matrix
#

We are speaking about micros here

lavish hemlock
#

I can imagine that being useful for log files?

lost matrix
lavish hemlock
#

I'm not arguing, mind you. I'm just trying to understand why it is that it's so vital to close a connection immediately after you're done with a single transaction.

#

I can understand the multithreading aspect though

lost matrix
#

Also mem mapped files dont keep file pointers open in the traditional sense. It lets the os
map files into virtual memory. Big difference.

lavish hemlock
#

That's true.

#

Most of the time I keep resources active for however long I need them and then when everything's all done I shut 'em down lol

lost matrix
#

But good question. Its been a long time since manually handling connections myself so i just took it as a given to close them.

lost matrix
lunar wigeon
#

@lost matrix you may implement system to your queue that reduces queue ticks per second depending on tick responds (how fast is the code ran)

#

or just use multithreading somewhere

lavish hemlock
#

Not entirely true, the kernel will close most resources, i.e. sockets and file pointers, and I thiiink that should apply to SQL connections since hopefully the server would be able to detect a closed socket...?

lunar wigeon
#

because you can run Workload tasks on main thread but manage queue in other thread

lost matrix
lunar wigeon
#

actually it might make it slower

lavish hemlock
#

I think the better solution is implementing fork/join lol

lavish hemlock
#

For a task like setting a large area of blocks, fork/join sounds perfect since you cut down the large task into smaller tasks.

#

But I'm not sure how compatible Bukkit is with just regular ol' Java concurrency lol

lost matrix
#

Yeah that might work. But that sounds very specifc to me.
Its just a matter if introducing a tick counter and checking with a modulo
which is defined by the current tps. Limiting the millis per tick should be enought

lavish hemlock
#

I read through that post on workloads but I'm still not capable of understanding it tbh

lost matrix
lavish hemlock
#

Of course

lunar wigeon
lost matrix
#

The thread kind of is about a fork/join where you fork on ticks but stay on the same thread.
Not sure how this analogy holds up.

lavish hemlock
#

I saw the example repo too but the workload solution was seemingly slower than the regular one?

lunar wigeon
#

I mean you can still send message, title, actionbar to player asynchronously 😎

lavish hemlock
#

There were example gifs side-to-side and it took a much longer time for the workload to complete

#

I'm going to assume the benefit is that it doesn't block the main thread

lost matrix
lavish hemlock
#

I see.

#

Ahh wait so it's almost like a kernel scheduling algorithm

#

Splitting a task up into smaller pieces so each ""process"" is able to run without impacting one another (time slices and shizz)