#dev-general

1 messages Ā· Page 619 of 1

old wyvern
#

yes

prisma wave
#

a

old wyvern
#

r

prisma wave
#

a

#

😌 elaramoon clojuremoon

steel heart
#

O right, and so what about f sharp

#

Does that come close to Haskell?

old wyvern
old wyvern
prisma wave
steel heart
#

Idk being as good as Haskell I assume

#

Since apparently it’s the ā€œsuperiorā€ to C# someone said so possibly it might even be a competitor to Haskell shrug

prisma wave
#

its more user friendly

#

but type inference doesnt work quite a lot

#

in C# interop

steel heart
#

Ah

prisma wave
#

which is sad because the explicit type specification syntax is ugly

#

let f (a: A) (b: B) = .. 🤢

steel heart
#

Oh

old wyvern
steel heart
#

Hehe

old wyvern
#

Thats right

#

Si

prisma wave
#

really??

steel heart
#

lol

old wyvern
#

Well yes

prisma wave
#

directly?

old wyvern
#

Simon was part of microsoft research till last year

#

Yea I think so

prisma wave
#

oh yeah of course he was

old wyvern
#

Which failed or something

prisma wave
#

naturally

old wyvern
#

after which they went for f# which took some advise and work from simon afaik

prisma wave
#

i love don syme

old wyvern
prisma wave
#

hes the main f# designer i think

old wyvern
#

ahhh

prisma wave
#

we should put don syme and simon and rich hickey in a boxing ring and see who wins

old wyvern
#

😌

#

Simon will beat the lambda out of them

prisma wave
#

probably

old wyvern
#

likely

prisma wave
#

he is a bit old though

old wyvern
#

Yes, experience

prisma wave
#

lmao true

obtuse gale
#

Oh santa

#

My sexy mitten

#

@quiet depot why do you give abusive people staff like blitz?

#

Yesterday he was threatening with no reason

#

To use his perms

#

.

#

Like what?

frail glade
#

Not the place for this. If you have a report, you can DM Barry.

static zealot
#

I might actually do it now billyb if you don't stop being an asshole

obtuse gale
#

That’s my report right there with a reply to the direct abuse / threat

#

Lmaoo?

#

Reporting you is being an ass? Funny

frail glade
#

Again, not the place.

obtuse gale
#

Js this dude threatens

#

You have *

#

And let this slide no wonder this disc is ded

#

I’m done but I made my point and he proved it

frail glade
#

If you don't like being here, then just leave?

obtuse gale
#

I like it here not with these abusive staff members

#

Idk why that’s allowed to slide

#

But I can’t say my opinions

frail glade
#

Then if you have a problem with another member of the community, you can make a report by DMing @compact perch .

obtuse gale
#

Well hopefully he sees this convo

#

Then demotes that dumb ass

#

Threatens after I call him out for threatening got me ded

inner umbra
#

As far as I know, piggy doesn't give staff roles.

hot hull
#

kek

long dagger
#

how can I use the default.json to show a image on a sign? Currently the picture is solid black, but shows up fine in chat

still portal
#

Either with white dye or a colorcode

#

Signs automatically make text black

cursive jolt
#

Yay billy is gone

hot hull
#

Can't you add a logger filter?

prisma wave
#

You need to add an implementation if you want logging messages

#

log4j (lol) or logback are the main 2

#

šŸ’€

#

Add a no-op implementation explicitly I guess?

#

But that means no debug logs or error messages or anything lmao

#

From Jedis that is

hybrid dune
#

Hi, I don't know if anyone knows this, but is there still an API for Selectors like @r, @a[r=5] (assuming the CommandExecutor implementation is ran from a commandblock or player)?

half harness
#

since I don't know of an api for that

#

although you could try making your own

#

for [] you could use split by splitting on , and String#trim to remove whitespace

#

although that might take a while if you want to fully support it

hybrid dune
# half harness what for? is this for user input parsing?

Yes, I want to implement a command that requires people to be able to run the command with a selector (mostly for use within command blocks) but if i try to search for some kind of API all I find is people asking how to make a lobby selector which I really don't need

#

I don't really care about scoreboard/teams in the selectors

#

But atleast support for attributes like name,tag,r,etc

#

To make it even more painful, im looking to make this plugin support both 1.12.2 and 1.13+

half harness
#

u could always use what mojang uses

#

EntitySelectorParser

#

ArgumentParserSelector in spigot

#

not sure if its obfuscated in 1.12

hybrid dune
#

Oh thats really useful to know

half harness
hybrid dune
#

So for 1.12 it would by EntitySelectorParser or?

half harness
#

hm

hybrid dune
#

Oh i see

half harness
#

lemme see

#

@hybrid dune gimme a min

hybrid dune
#

Okay

#

I found a sponge thread, but it seems to be a little too outdated

#

Hmm Bukkit.selectEntites should be a thing but sadly is not in 1.12.2 it seems like

half harness
#

šŸ‘€

hybrid dune
half harness
#

d;spigot Bukkit#selectEntities

ruby craterBOT
#
@NotNull
public static List<Entity> selectEntities(@NotNull CommandSender sender, @NotNull String selector)
throws IllegalArgumentException```
Description:

Selects entities using the given Vanilla selector.
No guarantees are made about the selector format, other than they match the Vanilla format for the active Minecraft version.
Usually a selector will start with '@', unless selecting a Player in which case it may simply be the Player's name or UUID.
Note that in Vanilla, elevated permissions are usually required to use '@' selectors, but this method should not check such permissions from the sender.

Parameters:

sender - the sender to execute as, must be provided
selector - the selection string

Throws:

IllegalArgumentException - if the selector is malformed in any way or a parameter is null

Returns:

a list of the selected entities. The list will not be null, but no further guarantees are made.

half harness
#

woa

#

woaaaaaaaaaaaaaaa

#

woaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

hybrid dune
#

It seems like it got added in 1.13

half harness
#
    @Override
    public List<Entity> selectEntities(CommandSender sender, String selector) {
        Preconditions.checkArgument(selector != null, "Selector cannot be null");
        Preconditions.checkArgument(sender != null, "Sender cannot be null");

        EntityArgument arg = EntityArgument.entities();
        List<? extends net.minecraft.world.entity.Entity> nms;

        try {
            StringReader reader = new StringReader(selector);
            nms = arg.parse(reader, true).findEntities(VanillaCommandWrapper.getListener(sender));
            Preconditions.checkArgument(!reader.canRead(), "Spurious trailing data in selector: " + selector);
        } catch (CommandSyntaxException ex) {
            throw new IllegalArgumentException("Could not parse selector: " + selector, ex);
        }

        return new ArrayList<>(Lists.transform(nms, (entity) -> entity.getBukkitEntity()));
    }
#

this is the code for it

hybrid dune
#

What is the implements for it?

half harness
#

wdym?

hybrid dune
#

Because i see Override

#

where do i need to implement that

half harness
#

no u dont

#

thats the implementation

hybrid dune
#

oh bruh

half harness
hybrid dune
#

im blind

#

Alot of the classes don't seem to exist in 1.12.2

#

sadly

#

alot of types don't exists either

half harness
hybrid dune
#

I don't think the class exist in 1.12

#

Because some types don't exist either

half harness
hybrid dune
#

Yeah, or that.

cinder flare
#

any reason to use 1.12?

#

not much place for it these days

half harness
#

ĀÆ_(惄)_/ĀÆ

sick belfry
#

easy to fix

#

just re implement it kekwhyper

half harness
#

what if u copy & paste the class

#

or would that not work

#

🄲 🄲 🄲

hybrid dune
#

i mean i could try and get my hands on MCP 1.12

half harness
#

VanillaGradle 😌

hybrid dune
#

or that

#

but re-implementing the class would be painful beyond pain

half harness
#

lol

hybrid dune
#

i mean idk

half harness
#

ok you'd have to copy and paste like 10 classes

hybrid dune
#

oh dear

half harness
#

if u want to do this

#

lol

#

i think

#

its a lot of code

#

its hard to go thrhough'

half harness
hybrid dune
#

it might be easier to just create a thread on spigotmc

#

which i hate doing because forum

cinder flare
#

or use a modern version?

hybrid dune
#

i mean, if i use a modern api version it isn't compatible with 1.12.2 is it?

#

Because i do need 1.12.2 support

cinder flare
#

For?

hybrid dune
#

because the plugin i am making might get used on alot of 1.12.2 servers as the gamemode the plugin is made for have alot of servers with 1.12.2

#

of course i could say that it isn't a me problem

#

but i would like to make it as version compatible as possible

cinder flare
#

7% ain't a whole lot to me

hybrid dune
#

well thats true

#

but i would still like to support that version

cinder flare
#

well good luck lol

hybrid dune
#

Well

#

i think it means its time to create an implementation

#

from scratch

#

I can't wait to bang my head against the wall at least 518 times

hybrid dune
#

I give up

#

i was starting to implement selectors

#

it went quite well

#

But i stg i tried to run it

#

turns out MC Already handles selectors in custom commands for 1.12.2?????

#

so i did a good 40m of work for nothing

obtuse gale
#

lol

hybrid dune
#

i hate myself

#

well i am keeping that class there for now

#

may 1.13+ not handle it by itself

obtuse gale
hybrid dune
#

yes

#

altho sadly that function doesnt exist in the 1.12 api (and i want to support 1.12.2)

#

so gonna make my own class

#

for that

obtuse gale
#

or you could.. check for the version?

hybrid dune
#

i mean how do i get that function in my 1.12 based plugin

#

if i upgrade it doesnt support 1.12 anymore

#

or can i just add legacy support or sum

obtuse gale
#

that's why you

check for the version

#

or check if the function exists with reflection or smth

#

if it does, call that, it already gives you full power of selectors, they can be amazingly complicated

#

if it doesn't exist just.. well don't call it and fallback to whatever you do in 1.12

hybrid dune
#

okay, but like if i upgrade to the api version of like 1.19; how do i specify its 1.12 compatible

obtuse gale
#

you don't?

hybrid dune
#

it just works?

#

as long as the function exists ofc

obtuse gale
#

not sure what the question is honestly

hybrid dune
#

i mean if i upgrade my plugin to 1.19

#

will it not kick out errors in 1.12 saying like outdated server

#

or outdated api version

obtuse gale
#

you mean the api-version in the plugin.yml?

hybrid dune
#

Yes

cursive jolt
#

1.12 doesn’t check that

obtuse gale
#

it didn't even exist in 1.12 ^

cursive jolt
#

Only 1.13 does so I set it to 1.13 always

hybrid dune
#

But do 1.13 plugins work in 1.12

cursive jolt
#

Depends on what bukkit methods you use

obtuse gale
#

in reality if you're making a plugin for 1.12 you shouldn't even use the api-version or anything in newer versions

#

like, simply target 1.12

hybrid dune
#

So if i upgrade my api, as long as i check if the function exists im good?

#

(and if i check the 1.13 plugin will work in 1.12)

obtuse gale
#

that function will exist in the future

#

like 99.9999% sure

obtuse gale
hybrid dune
#

Okay

#

Thank you for your help

#

I appreciate it alot

#

I now at least know that i can make it support stuff like that

half harness
#

since you can't even use the 1.13+ api anyways, so better off making it throw an error when trying to compile fingerguns

glacial lava
#

Is anyone good with pterodactyl panel frontend?

hot hull
#

Quick question, what do y'all recommend for creating/drawing stuff in an application (language, library, etc)

#

Using Java atm but it's a pain

distant sun
#

Drawing programatically or literally drawing (e.g. paint)?

hot hull
#

programatically, game graphics etc

prisma wave
#

lwjgl maybe?

hot hull
#

doodoo

prisma wave
#

cry

quiet depot
#

unreal, unity, godot

#

those are in descending order of hard to least hard aswell

hot hull
#

hmm, unreal could be good

prisma wave
#

shading things into libraries is usually considered a bad idea

#

although

#

hmm

quiet depot
#

trove

#

what century is this

#

maybe 10 years ago

#

no clue, look up some modern alternatives

#

also trove is shaded in spigot anyway

#

wait that might be the client

potent nest
#

fastutil or eclipse collections are pretty common afaik

#

so you're already relocating the dependencies of that library in your plugin to the locations where the library expects them to be but it doesn't work?

#

well if the sdk jar used by gradle does not contain the relocated libraries, you'll need to relocate them in your plugin again

#

only if your sdk contains the sources at the locations you want them to be

#

that's why you normally want to avoid shading

hot hull
hot hull
#

cubic noise

rough flame
#

Isn't editorconfig a popular thing among java repositories? I am looking for a good editorconfig which would enforce me to follow the java naming conventions but I just can't find any among popular github repositories.

hot hull
#

A what

cinder flare
#

is it a formatting enforcement tool or something lol

dawn island
#

I don't really use it for my projects as it's more of preference on how you want it to be styled.

#

I usually just install a theme and call it a day, over forcing anyone using my projects to have a config to my taste.

hot hull
#

Confused as to why that'd even be needed

dawn island
hot hull
#

Oh so just forces code style

dawn island
#

Yeah, and it can be across different IDE's

obtuse gale
#

it's useful for projects with many collaborators

dawn island
#
# Topmost editor config file
root = true

# Custom Coding Styles for Java files
[*.java]

# The other allowed value you can use is space
indent_style = tab 

# You can play with this value and set it to how
# many characters you want your indentation to be
indent_size = 4 # most common size is 4

# Character set to be used in java files.
charset = utf-8 
trim_trailing_whitespace = true
hot hull
#

Pretty neat

#

Just realized I have copy paste on my mouse now

lunar cypress
#

i use checkstyle for that

rough flame
#

In gradle, should I use ' or " for strings? in repositories and dependencies, etc

#

so
compileOnly "io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT"
vs
compileOnly 'io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT'

#

or it doesn't matter?

onyx loom
#

in this case it doesnt matter

sly sonnet
#

"

onyx loom
#

the only difference is when u try to use string interpolation iirc, then there would be a difference

dense dew
#

Hi, when are 2 langs benchmarked, let's say Java and Go
Does more CPU usage = slower language?

prisma wave
#

uh

#

i guess so?

#

it's less efficient

#

not necessarily slower though unless the programs are the exact same

cinder flare
#

CPU usage isn't really a good indicator I would say

lunar cypress
#

not at all

#

i can have a highly parallel program in some "slower" language and a non-parallel one in a "faster" language

#

if both do the same thing and the parallelisation is appropriate the former will likely be much faster

#

how much cpu is used depends on, well, your program

eternal compass
#

Anyone here used kubernetes for minecraft? Do you need to write custom code to deploy specific servers and load balance, or is it mostly already available?

cinder flare
#

I mean you just need to make a Docker image for your server

#

Database credentials should be the same, problem is slow startup time

cinder flare
frigid badge
#

I’ve done it once before, wasn’t too hard, just a few annoying bits

#

I think there are also gh repo’s with k8s for mc

hot hull
#

Oh hey Lemmo

agile galleon
#

just abbreviate from all the APIs and wrap around them for each platform

brittle vector
#

i need help setting custom ips for my server

hot hull
#

No

eternal compass
eternal compass
frigid badge
quiet depot
#

howdy lemmo

#

how's the ceo life

#

what are you these days

silent rune
#

header:
- "&c&lHandoria"
- "&7&l>> %animation:Welcome%&3 &l&9&l%player%&7&l! &7&l<<"
- "&a&lGracze Online: &r&a%online%"
- "&6&lAdministracja Online: &r&e%staffonline%"
how can i make %online% with custom players
help

remote goblet
#

Java 16's switch case is so nice man

silent rune
#

wat

remote goblet
potent nest
#

*java 14

remote goblet
#

yeah but who cares about that

#

im saying its java 16 cause i never touched 12, 13, 14 or 15

#

in comparison to this actual ass

#

pretty sexy

#

the lack of spacing between stuff causes feelings of anger however

rough flame
#

how do I early return while processing a stream one by one?

#

hell, how do I even iterate a stream without stream.forEach because I can't stop iterating with that

remote goblet
#

the people who aren't dumb might have a different answer but from what i know, you'd have to for loop that arphox

rough flame
prisma wave
rough flame
#

My current solution

Iterator<Inventory> iterator = getInventoriesIterator();
while (iterator.hasNext()){
    Inventory inventory = iterator.next();
    acceptWithoutCheck(acceptedItems, inventory);
    if (Arrays.stream(acceptedItems).allMatch(x -> x.getAmount() == 0))
        break;
}
#

see my code, but the point is that at some point there is no need to continue iterating

rough flame
prisma wave
#

what does acceptWithoutCheck actually do?

#

Because you could make that return a new Stream and then use takeWhile

rough flame
# prisma wave what does acceptWithoutCheck actually do?

private void acceptWithoutCheck(ItemStack[] acceptedItems, Inventory inventory) {
    HashMap<Integer, ItemStack> remainingFromAccepted = inventory.addItem(acceptedItems);

    for (int i = 0; i < acceptedItems.length; i++) {
        if (remainingFromAccepted.containsKey(i)) {
            // Amiket nem bírtunk belerakni, azoknak az amount-jÔt felülírjuk az eredetiben
            int remainingAmount = remainingFromAccepted.get(i).getAmount();
            acceptedItems[i].setAmount(remainingAmount);
        } else {
            // Amiket bele bƭrtunk rakni, azoknak az amount-jƔt nullƔra Ɣllƭtjuk az eredetiben
            acceptedItems[i].setAmount(0);
        }
    }
}
prisma wave
#

hmm

#

alright tbh just use a for loop

#

turning this into a nice functional thing will be hard

rough flame
#

can you give me an example for that? nor stream nor iterator works with for

prisma wave
#

for (T item : (Iterable<T>) stream::iterator)

rough flame
#

gonna try it

#

So like this right:

for (var inventory : (Iterable<Inventory>) getInventoriesIterator()){
    acceptWithoutCheck(acceptedItems, inventory);
    if (Arrays.stream(acceptedItems).allMatch(x -> x.getAmount() == 0))
        break;
}
#

What intellij is saying here?

rough flame
prisma wave
prisma wave
rough flame
prisma wave
#

yeah you can't cast that then

#

Try casting this::getInventoriesIterator

#

Or just change it to return an Iterable instead, Iterators aren't very useful

rough flame
#

how do I return an iterable from stream?

prisma wave
rough flame
#

alright this works
for (var inventory : (Iterable<Inventory>) stream::iterator){

#

but then I don't understand the ::

prisma wave
#

yep

#

It's quite cursed

#

but because Iterable is a functional interface, with its only method being iterator(), you can use a method reference

rough flame
distant sun
# remote goblet in comparison to this actual ass
enum Option {
    TAG((tag, value) -> tag.setTag(value)),
    NAME((tag, name) -> tag.setName(name)),
    PERMISSION((tag, permission) -> tag.setPermission(permission)),
    DESCRIPTION((tag, description) -> tag.setDescription(Collections.singletionList(description)));

    private BiConsumer<Tag, String> action;

    Option(BiConsumer<Tag, String> action) {
        this.action = action;
    }
}```
This could also work I guess ![shrug_animated](https://cdn.discordapp.com/emojis/685225450175332466.webp?size=128 "shrug_animated")
rough flame
prisma wave
#

yeah same thing

rough flame
#

what is a functional interface?

boreal needle
#

an interface with one abstract method

prisma wave
#

Typically things like Predicate, Consumer, etc

boreal needle
#

instead of being explicit and implementing it anonymously you can just use a lambda

prisma wave
#

It's the same as doing java new Iterable<Inventory>() { @Override public Iterator<Inventory> iterator() { return getInventoriesStream().iterator(); } }

rough flame
#

I still don't get why can't I cast an iterator into an iterable :/

prisma wave
#

because an Iterator is not an Iterable

#

Iterator can only be used once, whereas Iterable produces multiple Iterators

rough flame
#

so iterable is something that has a method that returns an iterator

prisma wave
#

Yes

rough flame
#

okay, but then I don't get () -> getInventoriesStream().iterator()

#

in C# this is a Func<Iterator<Inventory>>

boreal needle
#

java is special

prisma wave
#

You do need it

#

That is a function that returns an iterator, therefore it's an iterable

boreal needle
#

functional interfaces are the one type in java that is structural depending on context

rough flame
#

we are strongly typed

boreal needle
#

because thats what the iterable interface defines

boreal needle
#

d;jdk iterable

ruby craterBOT
#
public interface Iterable```
Iterable has 3 methods, 58 implementing classes, and  18 sub interfaces.
Description:

Implementing this interface allows an object to be the target of the enhanced for statement (sometimes called the "for-each loop" statement).

Since:

1.5

rough flame
#

this seems like duck typing for me

boreal needle
#

it is the one exception to the nominative typing pattern that java has

prisma wave
#

It's almost duck typing yeah

#

But the difference is that it still needs to know the type statically

#

So you need the cast

#

It's more structural typing rather than nominal

#

Duck typing usually implies dynamic

rough flame
#

okay I think I understand it to some point, thank you very much all
(if you need help in C# anytime, ask me)

prisma wave
#

I appreciate the offer but I will die before I use C#

rough flame
prisma wave
#

Ugly and I don't like it

obtuse gale
#

and ratio

prisma wave
#

true!

distant sun
frail glade
#

For?

distant sun
#

my website

frail glade
#

Gotcha

distant sun
frail glade
#

What's your nginx logs say?

#

Probably messed up the certs somewhere.

distant sun
#

wait a moment, I can't connect to the server wtf

#

ssh: connect to host gabytm port 22: Connection timed out
pls dont tell me I broke it 🤣

agile galleon
#

Ubuntu more feature rich tho

#

Excited what reasons you have

boreal needle
#

i highly doubt gnome-sudoku ships on the server

lunar cypress
#

lmao

agile galleon
#

There is libreoffice for cli?

boreal needle
#

no

agile galleon
#

What it doin there then

#

screensaver?

lunar cypress
#

nothing

#

it's not on ubuntu server

agile galleon
#

Lmao

#

Isnt that what were going with?

#

I doubt anyone is using ubuntu dekstop to run a website

lunar cypress
#

yes but anti ubuntu copy pasta was talking about desktop ubuntu

agile galleon
#

He shouldnt have

lunar cypress
#

which is funny considering that debian on desktop in comparison is quite an adventure

#

5 year old packages

#

have fun with that

agile galleon
#

If you are going with a linux distro for dekstop just use something like Manjaro

agile galleon
#

Idek what i like more, ages old packages, features that are somewhy considered bloaware or the fact that we didnt start this conversation with dekstop distros and apparently never switched

boreal needle
#

arch sunglas

agile galleon
#

Yes arch Linux ftw

boreal needle
#

on the desktop at least, it is very very nice

agile galleon
#

I wouldnt see a reason to use it server wise either way

lunar cypress
#

have yet to find a reason to use arch personally

boreal needle
#

its a very powerusery distro

agile galleon
#

You can say i use arch linux

#

And sound like a nerd

lunar cypress
#

granted

boreal needle
#

but everything you could possibly want ever has a package, if not in the repos then on the aur

lunar cypress
#

well i have that on arch derivatives too

boreal needle
#

you get enough control over your system without having to compile your own kernels and stuff

obtuse gale
#

You can say i use arch linux
and no one will give a shit

boreal needle
#

everything is always up to date

#

it's a very good blank slate for you to do whatever you want with

lunar cypress
#

except for the control (which is pretty vague, i wouldn't know what exactly i'd want to control that i can't already) those are also true for arch derivatives

#

oh and yeah i'm not interested in a blank slate

#

i'm a lazy person

boreal needle
#

yeah its not for everyone

fervent tinsel
#

does caching any result in factory breaks main idea of pattern? Or there can be added one more underlying thing for such thing

remote goblet
#

code review anyone modCheck

ocean quartz
#

Code bullying, always up for it

remote goblet
#

sick

fervent tinsel
#

wait

#

lemmi commit changes

remote goblet
#

the only think i would like to say is avoid is my gui package

#

because literally who can make gui code look decent

#

without layering about a million classes in one

ruby craterBOT
#
public static String join(CharSequence delimiter, CharSequence... elements)
throws NullPointerException```
Description:

Returns a new String composed of copies of the CharSequence elements joined together with a copy of the specified delimiter. For example, ```java

String message = String.join("-", "Java", "is", "cool");
// message returned is: "Java-is-cool"

Note that if an element is null, then "null" is added.

Since:

1.8

Parameters:

delimiter - the delimiter that separates each element
elements - the elements to join together.

Throws:

NullPointerException - If delimiter or elements is null

Returns:

a new String that is composed of the elements separated by the delimiter

remote goblet
#

that

#

exists okay

boreal needle
#

it does

remote goblet
#

i know String#join exists but mostly thought of it like combining a string list into a single string

#

but entirely forgot i could just you know

#

String#join(", ", List<String>)

#

my intellect is lacking

fervent tinsel
#

i guess, there is StringJoiner thing

#

might help

remote goblet
#

dont ask

obtuse gale
#

I asked

remote goblet
#

bully esophose over it

obtuse gale
#

@tranquil crane hello??

remote goblet
#

hello nicole you're now getting thrown under the bus

boreal needle
#

i would join in the code review party but i am currently lacking emotional stability

#

so for the sake of my self-confidence i will abstain

remote goblet
#

aren't we all

boreal needle
#

ive already embarrassed myself

ocean quartz
#

@remote goblet What's the point of the BukkitColor class?

remote goblet
#

quite simply for the potion color config option

#

potion-color: RED

#

because bukkit is dumb

ocean quartz
#

Understandable have a great day

tranquil crane
#

class was named like that because I wanted them listed in numerical order in my IDE

obtuse gale
#

šŸ’€

tranquil crane
#

do you have a better idea for them?

#

they're basically just migration scripts

tranquil crane
remote goblet
fervent tinsel
ocean quartz
sly sonnet
#

šŸ˜Ž

static zealot
#

yes. loads of people are getting it

#

its nice.

dawn island
#

yeah i got mine a week or two ago, when I registered for it in november.

humble silo
humble silo
#

Anyone know how to scroll through options with it? The Option + [ isnt working

dawn island
#

@humble silo try Ctrl + Enter, where you can see 10 suggestions in a separate window.

#

Tab to accept the solution, or Esc to cancel.

humble silo
#

If i manually click the refresh on that side tab it works.... ok gonna try to change the keybinds

#

weird, its only giving me one solution for things tho

#

Would think it would have more ways to generate the fibonacci sequence

#

(currently only gives me 1)

dawn island
#

Are you using Windows? or Mac.

obtuse gale
#

sometimes it's really shitty

#

some other times it literally reads your mind

#

most of the time it's "meh" tho

dawn island
#

sometimes it will bug out like this so it may only have one possible solution.

obtuse gale
#

I find the completion suggestions really aggressive tho, I really wish I could turn up the delay until it shows up or smth

humble silo
dawn island
#

Can you provide what you are trying to do with copilot?

humble silo
#

and it only gives me one solution

#

this is in kotlin though, so it may not work as well?

dawn island
dawn island
#

I'll try it in Kotlin in a moment.

obtuse gale
#

mmh it's not that I don't want them at all, I just wish it was configurable lol

#

just the delay, that's all ugh

#

also it's pretty good for lazy repetitive shit like writing javadoc

humble silo
#

Idk how much ima use this, kinda col tho

obtuse gale
#

already exploited it lol

humble silo
#

thats so cool lol

#

lol

#

it works

#

this is awesome

dawn island
humble silo
#

already writing some banger docs lol

obtuse gale
#

it's like "yep, I'm sure this person wants 75 lines of "hello world" prints, ABSOLUTELY REASONABLE"

dawn island
#

oh yes that's very helpful, i keep getting similar but it's pre-existing methods or comments when trying to go to a new line.

#

I just have to set to a keybind on my mouse to toggle it as it's annoying in some places.

obtuse gale
#
// calculate days between dates using java.time API
def daysBetweenDates(start: String, end: String): Int = {
  val startDate = java.time.LocalDate.parse(start)
  val endDate = java.time.LocalDate.parse(end)
  val daysBetween = java.time.Period.between(startDate, endDate).getDays
  daysBetween
}

and I was today years old when I found out java.time.Period is a thing ???

dawn island
#

It's just really buggy tbf. EDITED: I'm just manually opening the suggestions by right clicking it.

obtuse gale
#

it tends to prefer the java.util time API before java.time unless you specify it woeisme

#

though it's not like I need to calculate something with dates every hour

humble silo
dawn island
#

it's also on a wait list for a reason, so I expect bugs but it may just need more detailed comments.

obtuse gale
#

it's really good when a) you do similar, repetitive tasks and b) there is a lot of "recent" context to infer things from

#

yesterday it refactored me an entire 100+ lines function patch all by itself

#

spooky shit

humble silo
#

Could it turn a when statement into a if?

#

or something?

#

that IJ cant do?

obtuse gale
obtuse gale
#

it's hard to get it to do something useful, big, out of thin air

winged oyster
#

that's honestly one of the best examples for the usefulness of copilot i've seen

half harness
dawn island
half harness
#

oh

#

wdym?

ocean quartz
#

I wish you could do something similar to ctrl + space

dawn island
dawn island
humble silo
humble silo
#

In the end decided to just substring my checksum files down to 40 characters and call it good

remote goblet
#

A for effort

distant sun
#

Map(){{ }}??

obtuse gale
#

🤢

potent nest
#

ah yes more classes to load

remote goblet
#

dont ask, shut up

pastel imp
#

Uhm how good is json for storing data?

#

For context, I wanna store the coords and some info of a block I place.

hallow crane
#

JSON is perfectly fine for that, but keep in mind if you’re doing a lot of reading and writing, you may run into concurrency issues.

pastel imp
#

What would be a solution for that?

#

Isn’t that risky?

#

I suppose, but then I would also use more ram? It’s either ram or cpu I suppose

hallow crane
steel heart
#

exclude relocation I assume (but still shade it)? yeah should be

#

ah

#

I assume relocateshadowjar is your own task?

#

anyhow generally speaking

tasks.getByName<ShadowJar>("shadowJar") {
  relocate("original.package","relocated.destination")
}

this is how I do it

woven plaza
#

Shouldnt he use mongodb

#

If he wants to store in json

steel heart
#

oh well might wanna stick to the relocation prefix configuration

#

but you could still exclude certain libs with for instance

tasks.getByName<ShadowJar>("shadowJar") {
        this.dependencies {
            this.exclude(this.dependency("org.conclure:conclure-api:1.0-SNAPSHOT"))
        }
}```
#

I believe (the this is not required ofc)

remote goblet
#

okay copilot now that is just not okay

static zealot
#

kek that looks about right

remote goblet
#

okay welp thats being thrown into a class

#

and never leaving it

obtuse gale
#

m for minutes and monthsšŸ˜”

static zealot
#

yes

pastel imp
remote goblet
#

nope

#

wrong screenshot

static zealot
#

kek

remote goblet
#

i made it change it to this

hallow crane
pastel imp
hallow crane
#

Do you plan to relocate all of those

sly sonnet
distant sun
sly sonnet
#

It can be determined by dividing the last two digits of the year by 4

remote goblet
#

im gonna be honest

#

i dont know any fuckin psychos

#

that are gonna be putting auction house items up for a year

sly sonnet
#

but...

remote goblet
#

much less doing it very specifically on a leap year

sly sonnet
#

once in a while there will be a longer year

distant sun
prisma wave
#

There are a few that don't work for that formula afaik

remote goblet
#

the method actually just got changed to this

distant sun
#

A little bit more acceptable

potent nest
dawn island
remote goblet
#

uh yeah

#

1d 12h 30m 0s

dawn island
#

I see, I am using GitHub copilot to make me a solution as I need it for my project as well, but shouldn't it allow spaces if the user doesn't put any in? or do you require it.

remote goblet
#

probably but i'll cross that bridge at some point

dawn island
#

Is that method in a library? as it may be worth it to check if the time contains anything other than digits/numbers.

remote goblet
#

uh nope

#

i just told copilot to come up with that method

#

there's another example

fervent tinsel
#

Why not just use regex in this case?

remote goblet
#

i dont know ask copilot

#

i didnt make it

fervent tinsel
#

Stoopid copilot

remote goblet
#

im using it to come up with methods i dont have the mental capacity to think of at the moment

dawn island
#

Copilot gave me a really big regex but it fails if the string doesn't have 0d or 0h lol.

#
            // Check time if it passes the regex that doesn't allow any other character than spaces, digits, and letters.
            if (!time.matches("^[\\d\\s\\w]+$")) { 
             // !time.matches("^[\\d\\s\\w]+[d][\\d\\s\\w]+[h][\\d\\s\\w]+[m][\\d\\s\\w]+[s]$")
                return 0;
            }
distant sun
#

(\d+)+, is the second plus needed?

remote goblet
#

what the fuck LMAO

#

it just added this

dawn island
frail glade
#

What in the

ocean quartz
#

Sometimes it suggests in russian kek

tranquil crane
#

My favorite is when it just starts suggesting the same thing 50 times in a row with no mercy

#

I've had it try to insert author tags which aren't my name

dawn island
#

Are the author tags from other repositories you have? as sometimes it suggests previous code, or dependencies you have.

tranquil crane
#

nope

dawn island
#

For example, I was testing out @fervent tinsel's duration parser and now it remembers that code and is providing other examples for it.

tranquil crane
#

Once it tried to insert Katherine as the author or something like that

#

I don't even ask questions about why it tries to do that

ocean quartz
dawn island
#

Is that the class name šŸ’€ ?

tranquil crane
#

I found it

frail glade
#

Mfw list

tranquil crane
#

I was writing javadoc and out of nowhere it just suggested they were the author

#

Sometimes it does stuff like that and other times it writes this entire chunk of code based off the comment

#

ignore the missing semicolon I hit backspace on accident

remote goblet
#

it's actually just decided your new name

#

nicole isnt for you, switch to kristian

tranquil crane
#

Ori wondering why these images look so familiar when I just swiped them from our dms

remote goblet
#

slightly

#

I managed to get it to create a circle

frail glade
tranquil crane
#

just slap a // create 5 radius circle out of particles with <location variable here> as the center point and see what it spits out

frail glade
#

copilot pls

remote goblet
tranquil crane
#

darn

#

oh I don't have that code committed that's why it couldn't find it KEKW

#

thank you copilot

#

this thing just sassed me to a whole new level

#

wait that thread doesn't even link to a page even closely related to particles

#

at least it takes a joke

dawn island
#

I remember seeing this on Reddit, and thought you might like it.

frail glade
obtuse gale
#

"The method returns a String"

#

lol

dawn island
#

I don't personally use it, but remember seeing it online as a reddit post a few months ago.

#

I know it's main extension is for VSC.

ocean quartz
ocean quartz
dawn island
hallow crane
#

If I am reading the source right, in ChatChat, if you send a message to a channel does everyone with that channel's associated permission node see it? If that's true doesn't it mean it's not a subscribe/publish system (no ignoring/subscribing to channels)?

old wyvern
pastel imp
#

@lean kiln you still doing the copy pasta of analyse? Lol

pallid gale
distant sun
distant sun
potent nest
#

as it says, both methods have the same erasure

distant sun
#

welp, I just found what's the problem, smh

boreal needle
#

would anyone be willing to help me test some chatchat stuff quickly?

lean kiln
pastel imp
#

to redirect a message to someone specific

ocean quartz
static zealot
pastel imp
#

fair

lean kiln
#

Well, please do not ping me for unnecessary reasons. Thank you

sweet cipher
#

No problem

remote goblet
#

co pilot is now personally attacking me

static zealot
#

:)))))

winter sierra
#

Hello whats the structure for the main class - 1.18.2 CraftBukkit

Since java extends JavaPlugin {
doesnt work whats correct name for it?

boreal needle
#

define "doesn't work"

#

there are infinitely many things it could be doing
telling us it doesn't work leaves infinite - 1 possibilities
tell us what it does do instead, which leaves us with just one

potent nest
#

CraftBukkit sounds sus

boreal needle
#

how?

#

it's the reference impl of bukkit

potent nest
#

yeah but no sane person works with it directly

boreal needle
#

that is true

#

newbies do tend to get their terminology muddled tho

winter sierra
boreal needle
#

no we dont

winter sierra
#

ok so

#

i need to do this to implement the plugin

#

idk

#

tbh

#

its java

prisma wave
#

No as in

#

What specifically isn't working, and what's happening instead?

winter sierra
#

The import doesnt show up and an error happends?

boreal needle
#

share that error

winter sierra
#

well

boreal needle
#

and some context too - maven/gradle etc

prisma wave
#

Yeah you've probably added the dependency wrong

winter sierra
#

i cant screenshot it since this channel doesnt support images

#

and gyazo isnt helping really

boreal needle
#

send the text then

winter sierra
#

JavaPlugin cannot be resolved to a type

boreal needle
#

and share the line it's happening on

winter sierra
prisma wave
winter sierra
boreal needle
#

have you imported it?

prisma wave
#

are you using maven / gradle

winter sierra
#

ok so

#

no

winter sierra
#

cause the "JavaPlugin" doesnt work

#

how am i going to import it if it doenst work ?

boreal needle
#

you have not sent any such "help thingy"

boreal needle
#

something with no mention of an import

#

import org.bukkit.plugin.java.JavaPlugin;

#

you need to import classes before you can use them

winter sierra
#

yeah and what do i do if it doesnt exist????

#

ive imported the jar correctly

boreal needle
#

you calm down and stop getting pissy at people on the internet

#

then we will help you

winter sierra
#

i am calm lol?

obtuse gale
winter sierra
#

the CraftBukkit

boreal needle
#

are you trying to use nms

winter sierra
#

no

boreal needle
#

are you trying to use internal craftbukkit stuff

winter sierra
#

hmm not really

boreal needle
#

then use gradle or maven

winter sierra
#

Im trying to make a 1.18 plugin and ive only done 1.8

#

and it should work the same way but it isnt

#

and i dont like gradle or maven so idk man

boreal needle
#

there is a reason nobody depends on jarfiles anymore

#

i think youll find you are encountering it now

obtuse gale
boreal needle
#

enjoy

#

all you need is spigot-api

distant sun
boreal needle
#

i've been reworking my website index page - how does it look?

distant sun
#

cool - maybe align the github stuff on left?

boreal needle
#

hm

#

i quite like that ngl

static zealot
#

me too

boreal needle
#

works perfectly right up until i deploy

#

this is not funny

distant sun
#

Nice

boreal needle
#

good old race conditions

prisma wave
#

Racist conditions

dawn island
boreal needle
#

i do that a bit further down the page

cinder flare
boreal needle
#

you see the light switch in the top right corner?

cinder flare
#

no I did not think that was a light switch lmao

#

tbh thought it was a broom or something

#

a light bulb would be a better indicator imo

boreal needle
#

are pull cord light switches a british thing then

cinder flare
#

I've only ever seen one, and it's in a crusty room in my basement with no light switches

obtuse gale
#

I like it

cinder flare
#

i mean i like it now that i know what it is

#

but it was very unclear

obtuse gale
#

yeah originally I thought it was a broom too lol

#

then I was like i'll click it because

#

and it clicked

#

(haha pun intended)

tranquil crane
#

that copilot sql string just scrolled about 600 characters to the right

oak raft
#

How do you guys recommend I structure a discord bot folder wise? I was looking at some other bots and a few have an events folder, commands folder, listener folder etc. Do you think some of these folders are redundant?

tranquil crane
tranquil crane
oak raft
tranquil crane
#

Pretty much what you just listed are going to be in just about every bot project

#

The folder structure doesn't really matter that much, just keep it structured in a way that you will be able to find everything at just a glance

tranquil crane
ocean quartz
tranquil crane
#

I doubt it would ever stop

oak raft
#

Hey one more thing

#

I see that you use env variables but how does that really work

#

Like how did you set that up?

cinder flare
#

docker compose probably

#

and a little .env file

oak raft
#

Hm

#

Yeah I might have to go back to learning kotlin

cinder flare
#

unrelated lol

#

but docker is great 😌

oak raft
#

Oh yeah I know, I was just browsing through that bot and realized it's a lot easier to read and (maybe?) manage over java

#

But I did look into docker, not sure how it works exactly but I didn't go too far

half harness
#

HI REMENCE

oak raft
#

YO DKIM

#

What's up man

half harness
#

:D been a while

oak raft
#

It has been! I had to stop doing stuff cuz school

#

But now I'm back and forgot a lot of stuff...

half harness
oak raft
#

Yeah lol

#

wbu?

#

What've you been up to?

half harness
#

good, been trying to learn Kotlin/JS but some things I don't know if it's possible in kotlin šŸ˜–

#

also tried to learn godot but then i sorta forgot about it

oak raft
#

Kotlin has limits? 🤨

#

Godot's also nice

half harness
#

uhhhhhhh

#

ye

#

plus its entirely free

#

:D

#

instead of just student

oak raft
#

Yeah it's great. I started with unreal engine though since it's also free until you make your first million dollars

half harness
#

oh

oak raft
#

Which basically means free forever

half harness
#

million 🄲

oak raft
#

Yeah šŸ˜†

half harness
#

unreal uses c++ tho šŸ‘€

oak raft
#

Yeah it's sorta aids but I'm coasting along the c++ journey

half harness
#

lol

#

good luck fingerguns

oak raft
#

C++ is a good language to learn, no?

obtuse gale
#

virtual int inline long constexpr volatile unsigned const long long int foo() const noexcept

oak raft
obtuse gale
#

completely valid C++ moment

half harness
#

idk emily has c++ exp tho

#

i think

#

right?

obtuse gale
#

also this is a valid lambda []<>(){} lol

oak raft
#

Yeah I know emily's a c++er

obtuse gale
#

not as much as I used to be

half harness
#

hm

oak raft
#

What do you focus on now

obtuse gale
half harness
#

scala

#

i think emily also mentioned that sometimes too

oak raft
#

Never heard of it

half harness
#

recently

#

it also doesn't have semicolons

#

like kotlin

#

:D

obtuse gale
#

it's the most epic big brain jvm language

half harness
#

nvm

oak raft
#

No semicolons? 🤤

half harness
#

oh

obtuse gale
#

lol dkim

half harness
obtuse gale
#

it's pretty sweet, I'm really enjoying it

half harness
#

that was one of the reasons why i didn't want to do scala

#

lol

oak raft
#

How many languages do you speak emily?

obtuse gale
#

yeah jvm is an incredibly versatile platform

half harness
#

but

#

does it have native and JS platforms 😌

obtuse gale
#

ew js

half harness
#

(even tho kotlin native and kotlin js suck)

oak raft
#

Wow

half harness
#

BUT

#

kotlin jvm

#

=

#

😌

oak raft
#

Is it even worth learning java anymore?

#

Or is kotlin the motive

obtuse gale
#

modern java is pretty neat

half harness
#

hm

#

kotlin also i'd say is easier to learn though

#

ĀÆ_(惄)_/ĀÆ

#

well

#

like the things that are also in java

#

not coroutines and stuff

#

maybe

obtuse gale
#

I don't see a reason not to be familiar with both

#

Just familiar, not like fully dive in and learn each

oak raft
#

Makes sense

half harness
#

true

oak raft
#

This is kinda offtopic but what do you guys do to stay sharp with the languages you know?

#

I guess practice, but what kinda projects? I find that I don't really know what to make

ocean quartz
half harness
ocean quartz
#

I mean yeah, it's a different platform xD
By that logic Kotlin JS would be better because there are way more JS libs

half harness
oak raft
#

Ah

#

So forget 🄲

obtuse gale
#

I just

#

do stuff

#

lmao

ocean quartz
#

Yeah just keep doing things with it

oak raft
#

What are some examples?

ocean quartz
#

I forgot like half of what I learned about C because I haven't used it in years

obtuse gale
#

and like stay up to date on new releases, news, maybe watch a conference talk, short vids etc

obtuse gale
# oak raft What are some examples?

honestly coming up with stuff yourself is hard, I often just browse github to find stuff I could potentially contribute to instead 🄲

oak raft
#

Maybe if I fill my youtube homepage with programming stuff I'll never forget

obtuse gale
#

NEVER!!

oak raft
#

😳

ocean quartz
#

My approach was always like "think of something and try to make it" no matter how hard that was, the harder the more you learn
And there were times I couldn't do it which is fine

oak raft
#

That's kind of like what I'm doing now with dotenv stuff

#

Since I have no clue what I'm doing when it comes to that

#

But I do like that approach

obtuse gale
#

bruh I was about to import an entire spring-like framework just for a json parser šŸ’€

half harness
#

gson 😌

#

i remember when i didn't want to use gson šŸ˜–

ocean quartz
#

Kotlinx serializer 😌

obtuse gale
#

I remember when you used to flame kt lmao

oak raft
#

afaik spring is used for web applications, right?

half harness
obtuse gale
#

you

half harness
#

me?

ocean quartz
#

You

half harness
#

oh

#

wait why

#

šŸ˜–

obtuse gale
#

oriented to web stuff yes

ocean quartz
obtuse gale
#

it's colossally big

#

and super over engineered as fuck

#

for no reason other than because java

ocean quartz
#

Learning it is like learning a new language

oak raft
#

Yikes

#

Ok I'll skip that chapter for now

obtuse gale
#

yeah lol

#

@prisma wave !!!

#

it's the thing!

tranquil crane
#

we have the technology

obtuse gale
tranquil crane
#

love not having to write sql myself

obtuse gale
#

sql mysql

tranquil crane
#

I cannot type properly today

obtuse gale
#

mood

tranquil crane
#

there is a reason I'm having copilot write most of my code

obtuse gale
#

help me smiling_face_with_3_tears

ocean quartz
#

Watcha working on?

obtuse gale
#

oh, you know

#

just trying to learn a framework

#

which requires me learning the entire fundamentals of functional programing and category theory

ocean quartz
#

Nice

cinder flare
obtuse gale
#

that's a whole other level 🄲

#

but yeah clojure is EPIC

#

I tried it

#

it's super cute

#

but it's too much for me

cinder flare
#

im looking at haskell rn

#

probably just gonna implode before i get anything useful out of it

#

but i really do like chaining functions and stuff, all the stuff we're doing with ChatChat

obtuse gale
#

oh? wdym?