#help-development

1 messages · Page 2155 of 1

vestal dome
#

idk

#

since you're running that in a server, you should specify the file in your plugin's data folder.

vestal dome
#

wel

#

well

#

on your plugin's main instance you can do "getDataFolder"

harsh totem
#

'getDataFolder()' cannot override 'getDataFolder()' in 'org.bukkit.plugin.java.JavaPlugin'; overridden method is final

kindred valley
#

what is the best economy plugin

harsh totem
kindred valley
#

can i pass respawn screen on death?

tardy delta
#

why are you saving your mutes in a json file and not a yaml one?

quiet ice
#

At that point you could simple take the absence or presence of the file as sufficent for the boolean

#

probably a lot more atomic than the other variants

kindred valley
#

i cant get target file after running the maven

tardy delta
#

doing mvn package?

kindred valley
tardy delta
#

build errors?

kindred valley
#

no

#

?paste

undone axleBOT
kindred valley
tardy delta
#

or doing stuff in your pom that changes the ouput directory

tardy delta
#

well where is it supposed to output?

kindred valley
tardy delta
#

is the build log also saying that its outputting to that place?

fallen thunder
#

Hello what's the fine methode to get a chunk ?

tardy delta
#

based on what?

worldly ingot
#

World#getChunkAt()?

shy ridge
#

I have a map with many detail for a PvP server but we want to allow players to build. Is there a plugin that stops the players from breaking the map but allows the players to place blocks and destroy blocks built by players?

shy ridge
#

Oh yeah that seems more fit, sorry.

pastel juniper
#

How can I check if a value in config file is e.g. False

summer scroll
#

FileConfiguration#getBoolean

pastel juniper
#

And if I want to check if amount is 10, what do I have to.....

tardy delta
shy ridge
#

Not one bit...

fallen thunder
worldly ingot
#

I mean

#

I'm not sure what would imply that it's bad

tardy delta
#

and lemme see what it will return if its not found

ivory sleet
#

0

tardy delta
#

0 ye

#

i dont think you want to save a file every time someone breaks a block tho, I'd say store it somewhere

harsh totem
tardy delta
#

?yaml

#

smh

worldly ingot
#

JSON > YAML for data storage

worldly ingot
#

1000%

harsh totem
tardy delta
#

smth liek that

worldly ingot
#

You can make use of Gson. If you do a quick search about "How to use GSON", you'll find lots of basic guides on it. How to serialize/deserialize objects and read from/write to them is all you really need

#

Then so long as you understand how to read from/write to files, you're good

harsh totem
#

should I switch to gson?

worldly ingot
#

I mean I suppose that's an option too

ivory flume
#

If i do Player#setResourcePack but that pack (with the same hash) is already loaded

worldly ingot
#

You can use JSON Simple, but GSON has a lot more flexibility in terms of serialization, and is a bit more type-friendly

ivory flume
#

does it relaod

#

the pack

tardy delta
#

bump x)

ivory sleet
#

ugh

#

kinda against enum there

#

Id just have an abstract factory

#

(or just factory)

latent pelican
#

I want to spawn a custom mob at coordinates (1,1) instead of the players coordinates..
Code: LivingEntity mob = (LivingEntity) p.getWorld().spawnEntity(p.getLocation(), EntityType.ZOMBIE);

What shall I replace p.getLocation() with?

tardy delta
ivory sleet
#

yes

#

you could have an abstract factory

#

but that might be overkill

#

idk the exact design of your code but ye

#

the big advantage with just using a factory as opposed to the coupled enum factories is mockability mostly

tardy delta
#

i was going to have a Storage implementation which handle stuff

ivory sleet
#

ig reusability also? altho thats quite far fetched

harsh totem
#

or should it be map.get(0);

worldly ingot
#

Deserialize it to a JsonObject instead

#

(or JsonArray, depending on whether or not it's an object or an array)

ivory sleet
#

You probably wanna use try with resources for the reader

tardy delta
ivory sleet
#

or at least, close it (after you're done w/it)

humble tulip
#

Which is better h2 or sqlite?

worldly ingot
#

Depends on your use case

#

Each have pros and cons

humble tulip
#

I guess if you're reading or writing a lot h2 is better than sqlite?

harsh totem
tardy delta
#

actually i was just trying to make a class that holds a hikari datasource and has methods to get a connection
seemed that the datasource needs different stuff for each database
so maybe i will handle the initialisation of the datasource in some class that implements Storage, which has methods like connect and close instead of having different connection classes for each db and different ones for the db implementations

worldly ingot
#

JsonObject.class instead of Map.class

#

But again, if it's an array, use JsonArray

tardy delta
#

sorry for that bible

harsh totem
#

ok so will this return the boolean value "isMuted"?

            Map<?, ?> map = gson.fromJson(reader, JSONObject.class);
            map.get("isMuted");```
#

will this line return it? map.get("isMuted");

tardy delta
#

so having implementations for each database type and in the connect method, initializing the datasource too + creation of tables etc

#

instead of that weird enum stuff

pastel juniper
tardy delta
#

compare materials with ==, not with equals

#

unnessecary toString

ivory sleet
#

And throw excretion on failure

tardy delta
#

yep

ivory sleet
#

Exception jeez autocorrect

pastel juniper
#

I trash in Java, so I don't want to change it...... if it works don't touch it

quiet ice
tardy delta
#

anyways why does a HikariDatasource implements Closeable?

ivory sleet
#

I mean

tardy delta
#

wait

#

does calling some method that gets a datasource in a try with resources also closes it?

ivory sleet
#

Believe so

eternal oxide
#

if it implements Closeable

tardy delta
#

why would you want to close the whole datasource and not just the connection

quiet ice
#

I thought it needs to implement AutoCloseable

ivory sleet
#

Fourteen on shutdown obv

#

Or sth

quiet ice
#

Hopefully, not doing that would make everything much worse

ivory sleet
#

Indeed

tardy delta
#

ye but i dont think the whole program is looping in a try with resources, like how would you use it then?

latent pelican
#

I want my Custom Mob (Entity Zombie) to target a specific coordinate. However, if I write:
Zombie.getNavigation().a(loc, 1.0);
The getNavigation method is marked red (Cannot resolve reference...?!)

What to do?

quiet ice
#

I recommend using mojmap

ivory sleet
#

Isn’t HikariDataSource just following the design of object pool fourteen?

tardy delta
#

connection pool ye

ivory sleet
#

Right so in that case close hopefully closes down and terminates the pool entirely

humble tulip
#

Unless you create a reference to it in the () of the try with

lethal python
#

is creating a private static final itemstack with custom item meta for use throughout a plugin a good thing to do or should i do something else

ivory sleet
#

There are better ways of doing it

lethal python
#

if i want to give players that item or compare and check if the item they clicked was that item

#

how should i be doing that

humble tulip
#

You can just keep an instance and use a getter

lethal python
#

where do i put the instance

humble tulip
#

It depends

lethal python
#

on what

humble tulip
#

Where you're using it

#

The entire plugin

#

And how you're using it

#

Like if it's a currency item, it could be in some sort of currency manager class

lethal python
#

i'll have a listener which checks if a player right clicked using that specific item with the custom item meta, and then somewhere else in another file i'll be giving the player one of those items

tardy delta
#

i mean i dont see a place where you would create a connectionpool in a try with resources and right after the code finishes, it closes the whole pool

ivory sleet
#

Tests

tardy delta
#

leave the pool open then but close the connections

ivory sleet
#

Unit tests specifically

tardy delta
#

hmm

humble tulip
#

But again it depends

#

If you have multiple items maybe have a class that has getters for them

lethal python
#

where in the plugin

#

in the onEnable?

#

or in its own file or something

kindred valley
#

can i force a player to enter a bed

humble tulip
#

Plugin class

#

That extends javaplugin

lethal python
#

like that

#

static

humble tulip
#

private ItemStack xyz;
public ItemStack getXyz() {
return xyz;
}

#

Then do plugin.getXyz();

#

From your listener or command class

vestal dome
#

anyone tell me how to Disable JLine

lethal python
#

is this fine to do

#

in the main plugin class

worldly ingot
lethal python
#

is it good practice i mean

worldly ingot
#

Though there's also no guarantee that if you're doing it during the day that the player will stay in the bed

kindred valley
#

with true its not entering the bed

humble tulip
eternal oxide
vestal dome
#

IT DOESN'T WORK

#

AND I'M IN SEVERE PAIN

#

REEEEEEEEEEEEE

#

I've even MODDED bungeecord

#

but it NOT WORK

tardy delta
#

lol

vestal dome
#

ahhhhhhhhhhhh

kindred valley
eternal oxide
vestal dome
#

but it is not created ?

#

like auto?

eternal oxide
#

just try it as a startup on bungee

vestal dome
#

I already DID

#

It did not work

eternal oxide
#

no clue then

quiet ice
#

Alternatively, just yeet jline from the deps and resolve all errors

vestal dome
#

no?

#

because spigot uses JLine, and if you add -nojline to the arguments

#

it does not use this "smart" jline

quiet ice
#

?stash Alternatively, we can take a look at how spigot does it

undone axleBOT
vestal dome
#

I already did

#

and copied code

#

I'm so tired, of this stupid JLine bulls...

quiet ice
vestal dome
#

They clearly still use JLine

#

I should also note to you, that I want to like, edit an already existing Bungee jar, to disable JLine because I'm using an obfuscated BungeeCord proxy, that does have some classes obfuscated.

#

it's a premium fork

worldly ingot
vestal dome
#

what nobody told me I couldn't edit it

worldly ingot
#

I'm using an obfuscated BungeeCord proxy, that does have some classes obfuscated.
it's a premium fork
idk wtf I just read

vestal dome
#

like it's obfuscated.

#

I cannot recompile it

#

bruh

worldly ingot
#

No I know what you said

#

but I don't understand... why that exists...

vestal dome
#

because people too damn worry about their code getting ripped

quiet ice
#

Recaf to the rescue!

vestal dome
#

Yesss

#

what is the rescue

quiet ice
#

Just get recaf premium

quaint mantle
humble tulip
#

Wot obfuscated bungee

#

Whyy

tardy delta
#

its premium 😎 😎

vestal dome
#

want the name?

#

of the bungeecord, just bc?

humble tulip
#

Yeah why not

vestal dome
#

Aegis

quiet ice
#

Premium software be like

tardy delta
#

anyways why doesnt StorageImpl::new works where this is expected, the StorageImpl has a default constructor kinda weird to use plugin -> new StorageImpl()

tardy delta
quiet ice
#

Because StoreImpl::new would require a constructor that takes in plugin as an arg

vestal dome
# quiet ice

Bro it's really cool and all but it doesn't help.. Because I still didn't find how to disable Jline.

tardy delta
#

meh i hate it

quiet ice
#

You need to remove all jline classes, patch up all errors that arise from it and hope that it works

#

Where as right now you have no arguments I assume

vestal dome
#

I have spigot to base my edits of

#

Don't you understand.

tardy delta
#

you are a noob basically

graceful turret
#

have you got any idea how to calculate ender pearl destination location when player throws it?

vocal cloud
#

I'm still so confused as to why you need to disable it ngl

lusty cipher
#

how could I simplify this?

        var stream = getFriendsStream()
            .filter(f -> f.getName().equals(id) || f.getName().equals(zeroedUuid));

        if (stream.count() == 1) {
            return stream.findFirst();
        } else {
            return stream.filter(f -> f.getName().equals(id)).findFirst();
        }
daring maple
lusty cipher
#

I want to find the first entry in getFriendsStream where getName().equals(id). If that doesn't exist, I want to check if there's any entry where getName().equals(zeroedUuid) and return that if so

graceful turret
#

but it has to be outside 'if'

lusty cipher
#

in a optimal case the entry where getName().equals(zeroredUuid) should be at the end of the stream so that findFirst never returns it if another entry was not filtered

latent pelican
#

`
Player p = (Player) sender;
LivingEntity mob = (LivingEntity) p.getWorld().spawnEntity(new Location(p.getWorld(), 1.0, -60.0, 1 .0), EntityType.ZOMBIE);
Zombie z = (Zombie) mob;

        Location loc = new Location(p.getWorld(), 10.0, -60.0, 60.0);

        this.getNavigation().a(loc, 1.0);

`
Why is there an error (Cant ressolve method "getNavigation") if I want to move my mob to a certain position?

vestal dome
#

Bruhhh

lusty cipher
#
        return getFriendsStream()
            .filter(f -> f.getName().equals(id) || f.getName().equals(zeroedUuid))
            .sorted((a, b) -> a.getName().equals(zeroedUuid) ? 1 : -1)
            .findFirst();

hmm I think this might work

#

I would assume sorted doesn't execute when there's only 1 element

#

and that conditional will make the entry which equals zeroedUuid to be at the end

native nexus
#

Does anyone know a good TOTP library or a good Authenticator API I should use!?

tardy delta
#

should i let my storage interface return futures for each database operation or make a wrapper which handles the futures?

kindred valley
#

can i block if player f5

tardy delta
#

hmm i'll probably write some classes that interact with the database and wraps futures around them

#

so the command stuff doesnt have to care

native nexus
kindred valley
native nexus
#

Or client idfk

kindred valley
#

its client side i took a look

#

impossible

worldly ingot
#

Yeah, client sends no packet for that. No reason for it to

quaint mantle
#

Anyone got a World Creator Lib or something, that copies a world and creates it without much lag spikes ?

vestal dome
#

and most of the info there.

#

I'm sure.

left swift
#

Im handling the message from the console and when the message is colored I receive weird symbol, how can I remove that symbol and get clean or colored string? I guess its the § symbol

#

^ I have this when I send the message to the player

tardy delta
#

how do you color it?

#

§aMessage for example?

vestal dome
#

define 1.8

#

1.8 kg?

left swift
#

It's not 1.8

tardy delta
#

mc 1.8

vestal dome
#

why?

#

well actually

lost matrix
vestal dome
#

don't even answer me

left swift
lost matrix
# vestal dome why?

Because its a horribly outdated piece of software with a ton of bugs that will never be fixed

vestal dome
#

but

#

that's my opinion

lost matrix
vestal dome
#

I would still disagree, but it's still opinion.

lost matrix
# vestal dome I would still disagree, but it's still opinion.

Its literally not.
-> horribly outdated piece of software (support was dropped almost half a decade ago)
-> with a ton of bugs that will never be fixed (has been proven true numerous times)
To add on that:

  • It lacks a ton of essential API features like PDCs
  • The community is really small and shrinking, while half of it are just kids that wanna click their mouse real quick
vestal dome
#

It doesn't lack PDCs it has NBT, and most of all, Bukkit API is garbage on this version? yes, what about NMS? oh wait, It's still using the same api as it was LITERALLY UNTIL TODAY.

#

LITERALLY

lost matrix
#

And those are not opinions. Those are facts that support an opinion: 1.8 is bad

lusty cipher
#

7.1% really is nearly nothing

#

especially when every other version shown there is at max 2 years old

lost matrix
#

Oh it fell again. Last time i checked it was 7.8

quaint mantle
#

owo

#

I only know one server on 1.7.10

quiet ice
#

1.8 does not run natively under J17.

vocal cloud
#

The dumbest part is there really isn't anything you can't do in 1.18 that 1.8 has. It's a myth that people perpetuate cause they don't want to learn new stuff lol

quiet ice
#

If something does not run under any non-EOL java version, something is really wrong

lost matrix
#

PlayerProfiles

quaint mantle
#

question, what about optimization between 1.8 and 1.18.2?

vocal cloud
#

uh Smile you forgot the best part. PDC kek

quaint mantle
#

no they didn't

lusty cipher
#

people using 1.8 should really just acknowledge it's outdated but just stick to it because of the player base and gameplay mechanics

vocal cloud
#

Oh missed that part 👨‍🦯

quaint mantle
#

lmaoo

quiet ice
#

PDC is good and all, but not really the ultimate gamechanger

lusty cipher
vestal dome
#

they do

quiet ice
#

The ultimate gamechanger is the new itemstack API

vestal dome
#

bruh

ivory sleet
lusty cipher
quaint mantle
#

I wonder when or if mojang will concentrate on server optimization

#

I really hope they do one day

lost matrix
lethal python
#

if i've gotten a block from p.getTargetBlockExact how do i get the face the player was looking at?

vestal dome
#

okey, maybe a lil bit

ivory sleet
quiet ice
#

All unmaintained software is bad after a few years

lost matrix
quiet ice
#

not bad per-se, but painful to set up

vestal dome
#

no

#

bad software can have tons of bugs and be supported still somehow

lusty cipher
#

so DOS is still good software in every way?

vestal dome
#

BRUH

#

don't take my phrase to extreme

lethal python
#

what a stupid argument

vestal dome
#

an argument

vestal dome
#

because of opinion

vocal cloud
#

The only servers that use 1.8 are the servers that can afford to hire 100k engineers to make it better lol

lost matrix
#

Thats a false converse conclusion.
Just because outdated software is bad doesnt mean that up-to-date software is automatically good.

quiet ice
#

See windows

sand frost
lethal python
#

thank u for doing that

quaint mantle
#

only in paper @sand frost

#

I'm pretty sure

quiet ice
#

?jd-s

undone axleBOT
ivory sleet
#

Jadss I do understand that you may like the features of 1.8, but the software itself is objectively worse than 1.18.2

lost matrix
latent pelican
#

I want to use NMS but if I import it, it cannot be found? Where do I get NMS from?

sand frost
lost matrix
# latent pelican I want to use NMS but if I import it, it cannot be found? Where do I get NMS fro...
lusty cipher
lethal python
#

is that how many people use paper

sand frost
lethal python
#

where is sponge

#

surely sponge would b up there

lusty cipher
#

28.8% of all servers use Spigot
56.8% of all servers use Paper

lusty cipher
lethal python
#

o ok

vocal cloud
lethal python
#

damb i don't wanna cut out almost 30% of servers :///

quiet ice
#

Sponge is on another chart

lethal python
#

i will use the raycast

quiet ice
lusty cipher
#

compared to the tens of thousands of spigot and paper

sand frost
lost matrix
lusty cipher
latent pelican
lost matrix
sand frost
lusty cipher
#

happened a long time ago

#

some time last year

sand frost
#

Upsie never noticed it xD

quiet ice
lusty cipher
#

Starting with build #232, Paper will contain all patches and changes from Tuinity.
^ from August 2021

sand frost
#

But I have a small question.
What is the best way to create an API for a BungeeCord plugin that can be accessed by a Spigot plugin?

To explain:
I made a bungeecord plugin with an api in the style of the spigot api where there are just interfaces implemented by the actual plugin. But now I need to access some of the methods in the api for my spigot plugin.
What would the best way to do this? Should I use the Plugin Messaging Channel, should I write a second API just based on the SQL database containing classes and not just interfaces or is there a even better way?

ivory sleet
#

PMC is dependent on player connections

#

so thats the issue w/ using pmc

vestal dome
#

you can use Socket connections

ivory sleet
#

if you have the opportunity, opt in for something like redis or rabbitmq

vestal dome
#

why Redis?

#

actually nvm

lost matrix
vestal dome
#

forget that

ivory sleet
#

redis is scalable and has a mq implementation :3

vestal dome
#

ik ik

ivory sleet
#

ye I mean if you wanna get the know-how then the DIY approach might be more interesting for ya

quiet ice
#

well unsafe is relative

ivory sleet
#

in the sense of reliability, a duct taped socket implementation is probably gonna be slightly more unsafe

sand frost
quiet ice
#

Plugin messaging channel

sand frost
#

Oh never new there is an actively used abbreviation for that 😅

midnight shore
#

Is it safe to save an encrypted password inside of an ItemStack persistent data container? Or is it easy to find

quiet ice
#

Programmers make up abbreviations on the fly

lost matrix
quiet ice
ivory sleet
#

^

ivory sleet
#

CompletableFuture?

midnight shore
#

What does afaik mean? Sorry 😢

quiet ice
#

As far as I know

midnight shore
#

Okk

manic furnace
#

How can I check if a player has a item in his mainhand?

lost matrix
#

You can also write a filter that strips the pdc from outgoing packets. Thats what i do sometimes.

sand frost
lost matrix
manic furnace
#

yes but what can i check

ivory sleet
#

redis is quite easy to setup

uneven fiber
manic furnace
#

what? if it is null?

ivory sleet
#

(can be a bit hard to scale horizontally sometimes)

lost matrix
sand frost
manic furnace
#

Bc this doesn't work

lost matrix
uneven fiber
#

to check the material

#

but im not sure

lost matrix
#

In newer versions you want to use Material#isAir()

#

Because there are 3 types of air

sand frost
uneven fiber
#

no worries

#

I actually have a question

sand frost
uneven fiber
#

Im trying to make a command where when a player crouches, they are teleported up into the air

#

but im having an issue that it will only teleport the player into the air if they are crouching when they call the command

lost matrix
uneven fiber
#

let me send a picture

sand frost
uneven fiber
#

]

#

oh are you not allowed to send pictures

sand frost
#

I can upload stuff 🤔

midnight shore
#

When they run the command create a Bukkit runnable, checking if the player is crouching , if it is launch it up, if it isn’t do nothing. When they are launched you can optionally cancel the task

uneven fiber
#

the issue im having right now is that only if they are crouching while they call the command, then they are teleported up

sand frost
# uneven fiber precisely

Then you need for example a list of uuids where you add / remove the person if they execute the command. And in the Listener for the PlayerToggleSneakEvent you check if the player's uuid is in the list and if they are teleport them up

midnight shore
#

Or instead put their uuid In a list and when crouch event.is sent remove them from the list and launch them up. This would work as well

lost matrix
lethal python
#

if i use p.rayTraceBlocks and there are no blocks, what will the result.getHitBlock() return?

sand frost
lost matrix
lethal python
ivory sleet
#

you can use redis just for the mq it provides

#

no need to use the key value db if you dont want to

lost matrix
#

Redis topics

sand frost
lost matrix
#

as easy as it gets

vestal dome
lost matrix
sand frost
# lost matrix Redis topics

Is there an article or something I could use to get a look into how the feature works and some examples or so?

sand frost
lost matrix
lost matrix
quaint mantle
#
// This'll work to copy a world, right?
public static void copyDirectory(String sourceDirectoryLocation, String destinationDirectoryLocation) 
  throws IOException {
    Files.walk(Paths.get(sourceDirectoryLocation))
      .forEach(source -> {
          Path destination = Paths.get(destinationDirectoryLocation, source.toString()
            .substring(sourceDirectoryLocation.length()));
          try {
              Files.copy(source, destination);
          } catch (IOException e) {
              e.printStackTrace();
          }
      });
}```
sand frost
#

Okay but how should I use it for my problem? Is this something I need to implement in my existing plugin or do I need to create a second API with this feature? 😅

vestal dome
lethal python
lost matrix
lethal python
#

this is in BlockFace

lost matrix
#

And it is

quaint mantle
#

I wanna use this code.

vestal dome
#

it still isn't

#

since when

#

is it an advantage?

lethal python
sand frost
vestal dome
#

it's not an advantage or disadvantage, it's what it is.

quaint mantle
golden kelp
#

I am using the PlayerMoveEvent but I want to ignore Mouse & Jump/Sneak movements

golden kelp
lost matrix
vestal dome
#

like 1-5 more?

lethal python
#

hello did anyone see my question

vestal dome
#

that CAN'T be an advantage...

sand frost
lost matrix
#

And its more in the hundreds of milliseconds

lethal python
#

i don't want to be the guy who tells people to move channel but isn't this the help channel not argument channel :x

vestal dome
#

literally

lost matrix
#

Which is crucial if you design highly responsive micro services. Thats why many
get compiled to binary containers using graalvm

lethal python
#

·_ .

vestal dome
#

as far as I'm concerned... java classes get loaded to ram?????

#

right??

#

am I stupid..

sand frost
lethal python
#

here u go, i don't know what the method descriptions mean exactly

#

i'd like to get the block where a block will be placed if you place on a given block face

#

so i can spawn an entity there

humble tulip
#

Classes only get loaded once referenced some way or ther other right?

sand frost
ivory sleet
#

I mean the Class<T> singleton takes some memory, and some other stuff

lethal python
#

Conclure can you help

ivory sleet
#

w/?

humble tulip
#

Block.getRelative

#

@lethal python

lethal python
#

how do i use that

#

you pass in the face?

humble tulip
#

Get thenclicked block and then use the getRaltiveMethod

#

Pass the face yes

lethal python
#

awesome

#

ty

#

it is fixed conclure

humble tulip
#

Np

dusk flicker
#

Is there a better way to have a timer for events? I'm thinking of just updating a set integer for the remaining time every second with the scheduler

sand frost
ivory sleet
#

redis has a mq feature

#

in other words, you can send and receive data

#

which in this case can solve your problem since it can communicate over a single jvm instance

humble tulip
lethal python
#

there are possible null pointer exceptions on almost everything ,_,

#

have to catch so much

lethal python
#

:v

humble tulip
#

Just check if it's null

sand frost
dusk flicker
#

if you are catching everything you are doing something wrong

ivory sleet
#

yes

#

exactly DerEingerostete

humble tulip
#

Sometimes you don't have to check

#

Like for playerinteractevent, if action is right click block

#

You don't habe to check if block is null

lethal python
#

like, i've done a check to make sure that getHitBlock returns something, but then it is saying that getHitBlockFace might return null

humble tulip
#

You can juet ignore the ide warnings that it is

lethal python
#

like no it won't, i already checked if there was a block

sand frost
ivory sleet
#

So I can communicate between my Spigot Plugin and my BungeeCord Plugin?

humble tulip
#

Ide doesn't know everything

ivory sleet
#

you just connect to redis in both your spigot plugin and bungeecord plugin

#

register a subscriber for a specific channel (similar to plugin message channels) (in both your plugin instances)

#

and thats pretty much it

lethal python
#

so doing

RayTraceResult result = p.rayTraceBlocks(5);
            if (result != null) {
                BlockFace face = result.getHitBlockFace();
                Block relative_block = result.getHitBlock().getRelative(face);
            }

this is fine

sand frost
#

Okay so its just like the PluginMessagingChannel but more general?

humble tulip
#

Never worked with raytrace

sand frost
ivory sleet
lethal python
#

ok

ivory sleet
#

redis is the middle man

#

its a db

sand frost
ivory sleet
#

oh

#

well

lethal python
#

conclure i like your dog

golden kelp
humble tulip
#

If you know skmething can't possibly be null

ivory sleet
#

I use a library called lettuce, I can show an example using that library

humble tulip
#

You cna safely call methods on it

humble tulip
#

If you're unsure just check ir its null

sand frost
golden kelp
#

Hey guys, I am using PlayerMoveEvent to spawn a light at the player location and remove the previous one. But this leaves some lights still there

#

using LightAPI

eternal oxide
#

only place a light when the player has moved a full block

chrome beacon
#

I'd use a runnable every tick instead of the move event

golden kelp
#
@EventHandler
    public void onPlayerMove(org.bukkit.event.player.PlayerMoveEvent event) {
        if(event.getPlayer().isFlying()) return;
        if(event.getPlayer().isSneaking()) return;
        if (!(
            event.getFrom().getBlockX() == event.getTo().getBlockX()
            && event.getFrom().getBlockZ() == event.getTo().getBlockZ())) {
                Player player = event.getPlayer();
                if (vLights.getLightPlayers().containsKey(player)) {
                    vLights.getLightPlayers().get(player).setLocation(player.getLocation());
                    util.lightPlayer(player, vLights.getLightPlayers().get(player));
                }
        }
    }
tardy delta
#

why not importing

golden kelp
#

the class name is same so will cause issues

#
public class PlayerMoveEvent implements Listener {
    private final VLights vLights;
    private final Util util;
    
    public PlayerMoveEvent(VLights vLights) {
        this.vLights = vLights;
        util = vLights.getUtil();
    }
    
    @EventHandler
    public void onPlayerMove(org.bukkit.event.player.PlayerMoveEvent event) {
        if(event.getPlayer().isFlying()) return;
        if(event.getPlayer().isSneaking()) return;
        if (!(
            event.getFrom().getBlockX() == event.getTo().getBlockX()
            && event.getFrom().getBlockZ() == event.getTo().getBlockZ())) {
                Player player = event.getPlayer();
                if (vLights.getLightPlayers().containsKey(player)) {
                    vLights.getLightPlayers().get(player).setLocation(player.getLocation());
                    util.lightPlayer(player, vLights.getLightPlayers().get(player));
                }
        }
    }
}

ivory sleet
#

Okay so I wrote an abstraction, which if you want I'd give to you, but Ill just show how it might be used

class SpigotPlugin extends JavaPlugin {
  
  Messenger messenger = LettuceMessenger.create();

  @Override void onEnable() {
    messenger.bootUp();
    messenger.subscribe("myplugin:channel",reader -> {
      LOGGER.infoformat("Received '%s' from proxy", reader.readUTF());
    });
    getServer().getPluginManager().registerEvents(new Listener(){
      @EventHandler void onJoin(PlayerJoinEvent e){
        messenger.publish("myplugin:channel", writer -> {
          writer.writeUTF(e.getPlayer().getName()+" joined!");
        });
      }
    },this);
  }
}

class BungeePlugin extends Plugin {
  Messenger messenger = LettuceMessenger.create();

  @Override void onEnable() {
    messenger.bootUp();
    messenger.subscribe("myplugin:channel",reader -> {
      LOGGER.infoformat("Received '%s' from backend server", reader.readUTF());
    });
    getProxy().getPluginManager().registerEvents(this,new Listener(){
      @EventHandler void onJoin(PostLoginEvent e){
        messenger.publish("myplugin:channel", writer -> {
          writer.writeUTF(e.getPlayer().getDisplayName()+" joined proxy!");
        });
      }
    });
  }
}
``` @sand frost
hasty prawn
#

Annotation on same line as the method? Conclure are u feeling okay? 😟

ivory sleet
#

lol ye tried to keep it concise

golden kelp
#

yea thats curesed AF

sand frost
ivory sleet
#

yeah let me push the project to github and you could have a look there

sand frost
patent horizon
#

would anyone know how to get a player's luckperms group? the docs just keep recommending to use player.hasPermission, but i'm opped on the server and still not passing conditions

ivory sleet
#

isnt it like group.<groupname>

#

(the permission)

sand frost
patent horizon
ivory sleet
patent horizon
#

and adding myself to those groups, and i'm still not passing the conditions

ivory sleet
#

hmm thats weird

#

might wanna ask the luckperms guys

golden kelp
lethal python
#

this is sending the message twice

#

why is that

sand frost
ivory sleet
#

uh yeah

hasty prawn
ivory sleet
#

its supposed to be an event plugin

#

similar to sth like minigames Ig

lethal python
sand frost
ivory sleet
#

its not done cuz the project got disbanded kinda

sand frost
ivory sleet
#

yeee

#

well, I do work on it from time to time

#

but I do more modding than spigot plugins as of now

sand frost
golden kelp
#

i get paid 10x for modding 😭

#

i like spigot and server stuff more

lethal python
#

https://i.imgur.com/RAPFKet.png
^ I have this in my onEnable, it creates a static ItemStack

I have the line

if (p.getInventory().getItemInMainHand().equals(Waystones.waystone_item)) {

in a listener, but when I right click with this item: /give @p clock{CustomModelData:400000,display:{Name:'[{"text":"Waystone","italic":false}]'}} 1, the if statement doesn't succeed, why is this?

sand frost
ivory sleet
#

yeah, the best way not to lose motivation is to get stuff done

#

and dont be so minute about details and perfection

#

but I can totally relate

sand frost
#

Thats wright 😅 I just got demotivated because of some bugs in PlotSquared that they are currently fixing xD

lethal python
#

Conclure what do i do, I thought I made them equal

sand frost
#

And also because it's a lot of work that I've taken on all by myself. 😅

ivory sleet
#

oh yeah

#

gotta be nice towards yoiurself

sand frost
#

I am always getting new ideas to add to the project and making it even bigger and then getting even more demotivated because its so much stuff to do xD

ivory sleet
#

wouldnt it be better to create the itemstack based on your code?

lethal python
#

I don't know how to do that

ivory sleet
#

p.getInventory().addItem(stack);

lethal python
#

ok

#

then hopefully it will b ok

tardy delta
ivory sleet
#

abhorrently yes

sand frost
#

@ivory sleet But cool to see that u are currently working on your Eventfull plugin xD (or is it just open for releasing it on github? xD)

ivory sleet
#

well

#

guess both

#

but I am planning on putting it on spigot resource section once its done

sand frost
#

Did I get you to continue to work on it? xD

ivory sleet
#

well, both yes and no lol

#

I work on it occasionally, but might do it a little bit more now

sand frost
#

Okay then kinda happy noises xD

ivory sleet
#

ye

ivory sleet
#

tho trying to give this dino mod some love as well lol

sand frost
ivory sleet
#

lol

#

Ig

#

what've you done so far?

sand frost
#

Thats also the reason why my GitHub is so empty and there is only one finished bugfree API there xD

ivory sleet
#

ah

#

tbf I dont have anything remarkable on my github

uneven fiber
#

Nice I can send photos now

sand frost
# ivory sleet what've you done so far?

Some spigot plugins and small projects for myself. I mostly don't upload these because of one ore more reason:

  1. I don't quite finish it. Just so much that it works hardcoded xD
  2. I abandon the project xD
  3. I feel like I want to keep it for myself
  4. It's so bad that I am ashamed of uploading it
sand frost
uneven fiber
#

Question

sand frost
#

Looks like you have a lot of forks and some projects you made yourself. And other stuff I don't what it does xD

#

But its certainly more than I have xD

#

But on that note. Time to take some repos private xDD

ivory sleet
#

lol ye

#

half of my repos are private and archived

uneven fiber
#

im trying to Develop a command so that when first executed, any time a player shifts, they will be launched into the sky. When the command is ran again, this will no longer occur. The issue I'm having is that you must be sneaking when you call the command, otherwise you won't be launched into the air! Any thoughts?

lusty cipher
#

damn my plugin is at 4885 lines of java now (excluding blank & comment lines)

uneven fiber
#

this is my code that im trying rn

sand frost
ivory sleet
#

in total its ~100

eternal night
#

see conclure that is why I just have all of my stuff in a private-all org

ivory sleet
#

lol, thats actually kinda smart and organized

daring maple
#

You would want to save the players UID or smth and then check if that players sneaks with a listener

sand frost
#

But the most of my projects are local (I think around 100+)

ivory sleet
#

quite a lot eyes_right

uneven fiber
daring maple
uneven fiber
#

Ok

sand frost
ivory sleet
#

oo damn

#

well I probably only got 20 local projects

lusty cipher
#

I got 60 repositories but I only use like 10 of them actively

ivory sleet
#

altho replit for instance, is bombed with over 100 py projects

sand frost
# ivory sleet oo damn

But then there are also 2 projects I just have for testing stuff like for example this xD

lusty cipher
#

but there's a few in there

ivory sleet
#

thats a first

#

ah nice

lusty cipher
#

yeah I dunno why people don't delete their forks

ivory sleet
#

I mean you do it?

lusty cipher
#

my plugin was forked 6 times but only 2 of those forks ever got additions

ivory sleet
#

oh ye

#

I used to fork stuff in case the original repo would be deleted

#

but now I just fork when I might be pring

lusty cipher
#

but did that ever happen

ivory sleet
#

ye once

#

to some command api I was using

lethal python
#

i've got a playerinteractevent listener and rn it's firing twice cause both hands, how do i check for the hand of the item used

ivory sleet
#

(which was why I started forking almost everything I could get my hands on)

ivory sleet
lusty cipher
#

seems so weird to me lol

lethal python
ivory sleet
#

tho idk if the event offers a way to tell which hand used said item

eternal night
#

tho like

#

instead of getting the players main hand

ivory sleet
#

oh yeah Lynx got your back here, im a bit outdated

eternal night
#

that way your player can still use an item in offhand

lethal python
#

thank you lynx :)

vocal cloud
#

Conclure doing a "back in mah day"

#

It's okay we'll find you a nice old folks home.

ivory sleet
#

🙌

tardy delta
#

does this looks good as a beginning?

ivory sleet
#

I assume disconnect shutdowns eventual connections?

tardy delta
#

ye

#

maybe i could just init the datasource in the connect method

sand frost
#

@ivory sleet Took a bit to do but I have a question now xD Do you also have a project for testing small stuff like me here? 😂

ivory sleet
#

ah right, looks good, altho a bit baffled concerning the exposure of hikari

#

but ye

dusk flicker
#

I have no idea what you are doing spefically, but only thing I can see is the HikariDataSource seems out of place considering everything else is abstracted

ivory sleet
#

lol

sand frost
tardy delta
dusk flicker
#

also what is your main class name

#

Xkingdoms

#

I mean like, it works just dont look right to me

ivory sleet
#

web ide

sand frost
#

Oh nice. Never new about it

ivory sleet
#

if it extends JavaPlugin Id name it XkingdomsPlugin or sth

sand frost
#

And there are your test projects? xD

ivory sleet
#

yup

dusk flicker
#

Id rather have it be like XKingdoms personally

sand frost
#

Can you show me a example or a number of how many there are? xD

dusk flicker
#

what you add after up to you, I just dont like the k not being capitalized

ivory sleet
#

altho I for the most part create a new project every time I want to test something since I cant find old test projects that I wrote

quaint mantle
#

Is there a way to load worlds that are not in the main file, for example "./islands/worlds/%world-name%/" <- Directory.

ivory sleet
#

ugh

tardy delta
#

push not showing on github i guess stuff is broken

dusk flicker
#

?tas @quaint mantle

undone axleBOT
tardy delta
#

merging brrr

sand frost
# ivory sleet Ig

I like Epic Game and kap1 - kap19 xD Just a question. What does 'kap' mean? xD

tardy delta
ivory sleet
#

kap for kapitel which in english means chapter

#

what does updatePlayer(p) do?

#

or whats the intent rather*

tardy delta
#

its intended to save a player to a database and if it doesnt exist, create it

#

might want to change it to 'savePlayer' but ye

quaint mantle
ivory sleet
#

and create just creates an instance and puts it in the cache?

#

no database talkie talk whatsoever?

tardy delta
#

i wasnt doing implemtation yet so things are very weird 😆

#

it has to take a kingdomsplayer parameter ye

ivory sleet
#

oh right

tardy delta
#

and somewhere else put it in cache

#

but my problem was about that datasource

#

like i dont want to write a different connectionfactory and different storage implementation for each db type

#

so i thought lets put it in the enum

sand frost
ivory sleet
#

understandable

sand frost
#

But why do you have chapters in programming? xD

tardy delta
#

althought the storage needs the connectionfactory in order to get a connection
so in fact the issue is where to put the implentation for each datasource

ivory sleet
#

I have second highschool (gymnasium) and there we learn basic programming in Py, so those were projects coupled to specific chapters of our programming book

quaint mantle
#

german?

sand frost
sand frost
ivory sleet
#

oo woaw

quaint mantle
#

german programming education is dogshit

ivory sleet
#

I mean py is pretty underwhelming, especially for people who know programming already

quaint mantle
#

unless you go and find an internship

sand frost
#

Yes but its dependent on the school you are going

#

If you have a modern school with enough teachers that know programming it can actually be cool. But our school has only 1 computer since teacher and just recently got some new ones

pearl wolf
#

anyone know how to shortcut this block of lines?

@EventHandler
    public void onClick(PlayerInteractEvent e) {

        if (e.getAction().equals(Action.RIGHT_CLICK_BLOCK) || e.getAction().equals(Action.LEFT_CLICK_AIR)) {
            if (e.getItem() != null) {
                if (e.getItem().hasItemMeta()) {
                    if (e.getItem().getItemMeta().hasDisplayName()) {
                        if (e.getItem().getItemMeta().getDisplayName().equals("Speed 3")) {
                            // Action
                        }
                    }
                }
            }
        }
    }
sand frost
unkempt peak
#

Make a var for the item meta

#

And put them on the same line

sand frost
#

But also you could use a general method that uses the item to check all that stuff you are doing in that event method

unkempt peak
sand frost
ivory sleet
#

yeah use explanatory variables, and favor implicit else to explicit if else

sand frost
ivory sleet
#
if (condition) {
  //TODO
} else {
  //TODO
}

if (!condition) {
  //TODO
  return;
}
//TODO
#

latter is implicit else

#

it reduces the nesting

#

which is good, because developers dont read the code that does not fit on their screens (mostly)

left swift
#

what is better way for custom nametags (via armorstands)? Use normal armorstands or register my own one like "nametag" with armorstand model?

sand frost
ivory sleet
#

ah yeah idk if those names are official

#

but thats what I call those two "patterns"

ivory sleet
sand frost
ivory sleet
#

mye, idk how I learned Java now when I think about it, but mostly by doing it over and over as well

tardy delta
#

is there a way to get the absolute path of a file without creating a file object?

ivory sleet
#

sure is

#

I think?

humble tulip
#

plugin.getdatafolder().getabolutepath + fileseparator + file name

sand frost
tardy delta
#

well the absolute path should be ~/user/mcserver/plugins/myplugin/database.h2

#

not just plugins/blablabla or it wont find it

sand frost
#

And then when I made a java programm that wasn't a plugin I really googled something like 'main method java' or 'enable method java' . Idk what it was I googled but I actually didn't knew what the main method of java was xD

humble tulip
#

Get absolutepath of datafolder

#

Then add the rest

tardy delta
#

wait 😂

ivory sleet
humble tulip
sand frost
ivory sleet
#

oo right

humble tulip
#

It's the easiest way and a one time tjing so it doesn't matter

sand frost
ivory sleet
#

idk

#

let me see

#

3 years max

#

2-3 years

sand frost
#

I am impressed. Then we are pretty close. Thought you had more xD

tardy delta
sand frost
#

I think I started late 2018 or 2019

ivory sleet
#

which was probably a crucial underlying factor in learning Java and other stuff

sand frost
ivory sleet
#

yuh, tho with that being said, there are some great videos that might enhance your understandings of OO, software and Java

#

for instance uncle bob would be one guy

sand frost
ivory sleet
#

ye find it quite hilarious also

desert loom
#

and passing plugin.getDataFolder().getAbsolutePath() and "database.h2" to that method.

tardy delta
#

wasnt it called Paths.resolve at first?

#

i remember me that method

ivory sleet
#

ye

desert loom
#

I think resolve is part of the Path object rather than Paths

ivory sleet
#

getDataFolder().toPath().toAbsolutePath().resolve("subfile.extension") or sth would work

tardy delta
#

aaah

#

wasnt resolve also creating the file if it didnt exist?

ivory sleet
#

nope

#

thats Files::createFile

quaint mantle
#

stop mr conclure using ::

tardy delta
#

nvm i think it was the h2 thing or hikari who made the file

quaint mantle
#

its #

ivory sleet
#

nonono

quaint mantle
#

you make my blood boil as a rust user

sand frost
ivory sleet
#

method reference

quaint mantle
#

😮

ivory sleet
#

I am not writing html anchors here

quaint mantle
sand frost
quaint mantle
#

because :: is for rust only :<

ivory sleet
#

then it looks like static

quaint mantle
ivory sleet
#

oh yeah it is

#

but still

quaint mantle
#

bruh ur confusing tf outta me

ivory sleet
#

what does :: do in rust then?

quaint mantle
#

like uh

#

uninstanced

#
mod something {
    const HI: &str = "Hello";
}

fn main() {
    println!("{}", something::HI);
}
ivory sleet
#

ah

quaint mantle
#

you can see how i'd get annoyed right 😦

ivory sleet
#

yeah

tardy delta
ivory sleet
#

im gonna continue to use :: then :3

quaint mantle
#

Bruh

ivory sleet
#

well

#

even in java enhancement proposals

#

:: is actually used

tardy delta
#

:: in rust is for enums too

sand frost
native nexus
#

.map()

tardy delta
#

smh

sand frost
quaint mantle
tardy delta
tardy delta
#

havent used rust for a while

quaint mantle
#

oh yeah it does

tardy delta
#

wheres the dark mode on that site >->

quaint mantle
#

idk how to make it

sand frost
quaint mantle
#
fn main() {
    let msg = "hi";
    let msg2 = "bye";
    println!("{msg} {msg2}");
}
#

didnt know that worked

tardy delta
#

set the background-colour to something black in your css

#

anyways

#

looks good tho

#

looks so simple but yet so powerful

mortal hare
#

man i hate how Intellij provides this as a readable message

tardy delta
#

i wont even try to read that

mortal hare
#

Intellij supports hyperlinks in those context messages

#

but no, they'll provide long ass package paths instead

tardy delta
#

dont ask me why i made a gist thing, i just wanted to try

ivory sleet
#

looks cool

tardy delta
#

that

quaint mantle
#

Okay so, is there a way to loop thru all directories in a certain directory, for example

Load all worlds from directory "./island-worlds/player-uuid/", but instead of giving the id, loop thru all the directories in "./island-worlds/"

ivory sleet
#

sure is

quaint mantle
#

Could you provide me a quick code sample, if you don't mind ?

void escarp
#

Hi! My plugin works with a number the value of which I want to keep in the event of a reboot. Would you recommend saving that in a .txt file and if so, how can I read/write such .txt file?

ivory sleet
#
try (DirectoryStream<Path> stream = Files.newDirectoryStream(path)) {
  for (Path path : stream) {
    //TODO
  }
}```
tardy delta
#

use the inbuilt config file

quaint mantle
ivory sleet
#

hmm I guess?

quaint mantle
#

For example, load all the worlds when the server starts up, so there wont be any lag later on.

void escarp
quaint mantle
#

Or that's a dumb idea?

ivory sleet
#

how many worlds are there

quaint mantle
#

Well, there will be 1 world per team.

ivory sleet
#

yes thats a terrible idea

quaint mantle
#

So let's say there're like 100 worlds, it'll take quite a bite of time to load.

#

Then, I should load/unload them as they leave/join, right ?

ivory sleet
#

yes

#

in principle

quaint mantle
#

Wouldn't that cause a bit of lag spikes ?

ivory sleet
#

altho if possible you could try to reduce the amount of worlds

#

just make sure teams are separated enough from each and another

void escarp
#

why not use single world and divide it into regions

ivory sleet
#

^

quaint mantle
#

I thought about that, but the problem is I've never worked with regions.

#

I don't know how to do it.

#

Yes, it's alot better to just use regions, but I've never done that.

void escarp
#

you could just define coordinates and prevent players from leaving them maybe

ivory sleet
#

start by trying

#

just do something that looks right to you, after that we can discuss it here

ivory sleet
#

chances are youll b able to come up with some quite desirable results

ivory sleet
quaint mantle
#

Is it possible to have multiple world borders in a single world ?

void escarp
# ivory sleet WilliamD

yes but

the value changes every so often so I don't want it to be overriden if someone has the config open and when they save it they save it with an old value

#

it has to be separate from the config

ivory sleet
#

oh

tardy delta
#

so stupid that you cant just put a comma here

ivory sleet
#

missed that part, well in that case, sure

#

ye fourteen agree

#

if its just internal plugin data perhaps use a file extension like .temp or sth

void escarp
#

how would I save and read the file? i have but a few hours of experience with bukkit plugin development

mortal hare
#

is there any way to declare a list which can accept both the impl object and its derivative:

List<? extends Foo> list = new ArrayList<>(); // Works only for extended classes. Cannot add Impl classes. I need to add both. super seems a good way to do it but im not sure.
mortal hare
# void escarp how would I save and read the file? i have but a few hours of experience with bu...
BukkitWiki

The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...

void escarp
ivory sleet
#

dovidas do you mean derivatives of Foo?

mortal hare
#

both the Foo interfaces

#

and the its derivatives

#

i think ? super Foo would work

#

super keyword inside wildcards state that it has to have at least one superclass that foo has

ivory sleet
#

myes but then you turn it into a write only list

#

assuming you abide by the types concretely

#

I mean Id just have List<Foo> if possible

quaint mantle
#

Okay so, a long time ago i saw an article that you could change the spigot world path, but the problem is that idk where that was. What configuration file.

#

For example, all the worlds to be in ./worlds/

ivory sleet
#

but if you return both a super type of Foo and a sub type of Foo like List<SuperFoo> or List<SubFoo> List<?> might be what you need since theres no real contract going on anymore

mortal hare
#

why bother changing source code when you can use junctions in windows and symlinks in unix

quaint mantle
#

eh

void escarp
#

is this it?

BufferedReader reader = new BufferedReader(new FileReader("~/plugins/Name/.val"));
String val = reader.readLine();

?

ivory sleet
#

nonono

tardy delta
#

dont think the plugins folder is in your home directory

ivory sleet
#

try (var reader = Files.newBufferedReader(Path.of("path"))) {
//TODO
}

mortal hare
#

tbh i think it doesnt matter

void escarp
#

it's a docker container

mortal hare
#

since Foo for me is an interface

#

so it should be extended

ivory sleet
#

ye

mortal hare
#

so im using extends correctly

lost matrix
#

implements

mortal hare
#

inside wildcard

lost matrix
#

Ah

ivory sleet
#

dovidas problem is, (and I see it a lot) people try to make sense of generics by talking about instances

#

which often leads to unnecessary wildcard declarations

mortal hare
#

these are very low level generic classes

#

for abstraction only

#

to support multiple platforms (sponge, bukkit, etc.)

ivory sleet
#

for sure but point persists, when you do generics you only wanna consider types (and type constructors)

tardy delta
mortal hare
#

im just trying to decouple bukkit api from my abstraction classes

tardy delta
mortal hare
tardy delta
#

its for something like

void updatePlayer(KingdomsPlayer player) {
  try (Connection conn = connFactory.getConnection();
        PreparedStatement ps = conn.prepareStatement(s))   {
  // do db stuff
  }
}```
#

so the StorageType enum is able to get a datasource which corresponds to the type of database the user wants

mortal hare
#

good idea, enum abstraction is on point there.

#

better than long method which tries to resolve what the player uses

quaint mantle
#
// Okay so I've created something that I'd like to use.

Create a world where all player islands will be, make the spawn point at 0/65/0 and on every 500 blocks each direction there will be an island for a team that a player will create, is there a way that that could somehow be done or?
lost matrix
lost matrix
tardy delta
#

the thing that i dont really want to write a Storage implementation and a configsupplier thing for each type of database, just one thing

#

or i could store suppliers to them so i can get them from a storagetype constant

quaint mantle
lost matrix
#

I would just look at the chunk system and scale it up.
So create a SkyWorld which contains a Map<SkyTileCoordinate, SkyTile>
And each tile is 250x250 blocks. The rest should come naturally