#dev-general

1 messages ยท Page 374 of 1

obtuse gale
#

Basically compile time reflection lol

#

Oh yeah and good luck figuring out if the compiler throws errors lol

#

The closest you get in Java on specialization is either inheritance & overriding methods or just a whole separate class on its own (IntStream and Stream<T> are separate classes altogether, if specialization was a thing, they would be just Stream<T> and one Stream<int>)

hot hull
#

How ugly/dumb would it be to have a try catch for NPE as a condition to close the menu :p

jovial warren
#

Lol

#

Just null check

#

Ez

hot hull
#

Not my code so it's a fucking mess

cinder flare
#

"Aw, who wrote this crap? This is so confusing!" git blame "Oh, it was me."

hot hull
#

Nah it's not confusing, it's just made in a retarded way because the person didn't know what they were doing

cinder flare
#

Are you fixing it?

cinder flare
#

holy shit copyright Sun from 2006

quiet depot
cinder flare
#

๐Ÿ˜ฎ

#

bro I wish I had starmism.com and a noreply email for it

quiet depot
#

and I wish I wasn't so stupid that I just blamed it on the person who was originally at blame

cinder flare
#

oh I thought that was from your pov haha

quiet depot
#

noreply emails are overrated

#

I have a noreply email

#

and it's the only email i use

#

i also send emails from it

#

it usually confuses people because I have to say "please do actually reply to this email, even though it's called noreply"

#

fun stuff

cinder flare
#

bet you have your own domain and everything ๐Ÿ˜”

quiet depot
#

that's mainly for dev stuff tho

regal gale
#

Hello? My question please? ๐Ÿ‘€

quiet depot
cinder flare
#

๐Ÿ˜‘

quiet depot
#

what's the face for

cinder flare
#

i've got zero domains, and you've got two

#

and one of them is a google thing or something?

quiet depot
#

google thing?

#

no

#

p1g.pw points to a link shortener, but I mainly use the domain for dev stuff

#

projects and shit

cinder flare
#

oh that makes sense

quiet depot
#

used to have 3 domains actually but let the third expire, didn't need it (piggeh.org)

#

3 isn't even that much

#

gian has way more

cinder flare
#

๐Ÿ˜–

quiet depot
#

can you not afford a domain?

cinder flare
#

no lol

quiet depot
#

can't afford $20 a year?

#

actually you're probably american aren't you

#

more like $15 for you

cinder flare
#

well with zero income, it is pretty hard to pay recurring fees

quiet depot
#

eh

#

do you not get money on birthdays or christmas?

cinder flare
#

goes towards paying for uni

quiet depot
#

and you can't spare $20?

cinder flare
#

my parents take it i dunno man

quiet depot
#

have you asked them lol?

cinder flare
#

i do suck at making websites, so maybe it's for the best lol

#

i mean not about a domain lol

quiet depot
#

a domain is quite important

#

well at least to me

#

anyway

#

students can get a free .me from namecheap for a year

#

while still a student, renewing is discounted

cinder flare
#

already used it like 3 years ago

quiet depot
#

there's also like 2 other companies on github edu that give free domains to students

cinder flare
#

yeah used the other one

quiet depot
#

then there's also the final option of using your non tech savvy friend's school email

cinder flare
#

pfft haha

quiet depot
#

i've done it before

cinder flare
#

now that is pretty big brain

#

now all that's left is to think of something to put there!

quiet depot
#

ricardo

cinder flare
#

?

quiet depot
cinder flare
#

oh yea

heady birch
#

Amazing

quiet depot
#

nice style niall

#

quite modern

heady birch
#

Inspired by the ultimate thymeleaf tutorial

quiet depot
#

wow

heady birch
#

The best software

#

Every garden centre in the UK is using it

quiet depot
#

was*

#

was using it

heady birch
#

Lol

quiet depot
#

like 100 years ago

#

when that styling was acceptable

hot hull
#

Niall

#

Can you stop using 500 year old website designs

heady birch
#

Programmers these days

quiet depot
#

the dinosaurs will come back if this keeps up

heady birch
#

All they know is nodejs, bootstrap, vue

#

Talking about bootstrap

#

What are some cool CSS frameworks?

quiet depot
#

bootstrap

#

bootstrap is still my favourite but some people use some weird shit called "bulma" aswell

heady birch
#

5 is available

#

Oh bulma is neat to be honest

quiet depot
#

and some people have just given up on the manual html/css thingo and use vue (which I think basically does everything for you? ngl haven't looked into vue much)

heady birch
#

Neither

#

Wow, ofcourse a windows 98, XP and 7 css framework exists

hot hull
#

l

cinder flare
#

J

old wyvern
#

That would be useful if we want to selectively load dependencies ig

quiet depot
#

I'd assume the value

old wyvern
#

Ill remove the xml parser since we wont need that now

cinder flare
#

I presume you give it the key and it gives you the value

#

nice one more level and a new color!

old wyvern
#

Same

#

altho 9k exp tho

#

๐Ÿ˜ฌ

cinder flare
#

awe nice only 3k

jovial warren
#

I think I wanna use a scheduler for ticking at this point lol

#

screw your sleep method Yugi

#

it always gets out of sync and doesn't produce accurate timing results

cinder flare
#

๐Ÿ‘€

jovial warren
#

I think that means I can't do watchdog though

#

but watchdog seems kinda broken anyway, so not really sad about that lol

static zealot
#

Oh did Krypton just hit 20 tps?

jovial warren
#

using a single-threaded SES, yes

#
tickScheduler.scheduleAtFixedRate({
    val nextTickTime = System.currentTimeMillis() - lastTickTime
    if (nextTickTime > 2000L && lastTickTime - lastOverloadWarning >= 15000L) {
        LOGGER.warn("Woah there! Can't keep up! Running ${nextTickTime}ms (${nextTickTime / 50} ticks) behind!")
        lastOverloadWarning = lastTickTime
    }
    GlobalScope.launch { eventBus.call(TickStartEvent(tickCount)) }
    val tickTime = measureTimeMillis(::tick)
    val finishTime = System.currentTimeMillis()
    GlobalScope.launch { eventBus.call(TickEndEvent(tickCount, tickTime, finishTime)) }
    lastTickTime = finishTime
}, 0, TICK_INTERVAL, TimeUnit.MILLISECONDS)
#

ez

#

that's the actual code lol

#

and somehow, the main thread doesn't die

jovial warren
#

lemme show you the old code

old wyvern
#

Also, stop GlobalScope abuse

jovial warren
#

ignore that for now lol

#
while (isRunning) {
    val nextTickTime = System.currentTimeMillis() - lastTickTime
    if (nextTickTime > 2000L && lastTickTime - lastOverloadWarning >= 15000L) {
        LOGGER.warn("Woah there! Can't keep up! Running ${nextTickTime}ms (${nextTickTime / 50} ticks) behind!")
        lastTickTime += nextTickTime
        lastOverloadWarning = lastTickTime
    }
    GlobalScope.launch { eventBus.call(TickStartEvent(tickCount)) }
    val tickTime = measureTimeMillis(::tick)
    val finishTime = System.currentTimeMillis()
    GlobalScope.launch { eventBus.call(TickEndEvent(tickCount, tickTime, finishTime)) }
    lastTickTime = finishTime

    if (tickTime < TICK_INTERVAL) delay(TICK_INTERVAL - tickTime)
}
#

this is the old code

#

and this would chill at 16 TPS

old wyvern
#

launching coroutines might have significant overhead

jovial warren
#

lemme try not doing that

old wyvern
#

Sure

jovial warren
#

still chills at 16

old wyvern
#

Also is this happening inside a couroutine context??

#

Use it on its own thread

jovial warren
#

still that same runBlocking yes

old wyvern
#

Try without that

jovial warren
#

also, won't that kill the program since the main thread will stop executing?

cinder flare
#

"Woah there!"

old wyvern
#

Run that outside a coroutine context on the thread you want blocked

jovial warren
#

removed the runBlocking and replaced delay with Thread.sleep and guess what

old wyvern
#

Still same?

jovial warren
#

still 16 TPS xD

old wyvern
#

Thats really weird

#

Profile it

jovial warren
#

how?

old wyvern
#

Use any profiler

jovial warren
#

I'm using spark atm for profiling (yes, I wrote a spark impl for Krypton so I could monitor this stuff lol)

old wyvern
#

Use hte one built into ij

jovial warren
#

also, maybe it might be worth adding a profiler at some point, like what Mojang code has

old wyvern
jovial warren
#

like one that can push to listening profilers

old wyvern
#

Just use the debugger for now

jovial warren
#

like push tick starts and stuff

#

alright

#

flight recorder?

old wyvern
#

JProfiler

jovial warren
#

alright

#

if my trial hasn't ran out yet lol

#

right, where am I looking?

#

main seems to do a hell of a lot of waiting

old wyvern
#

If you're getting an avg of 16 handling things normally id assume you have some bottleneck somewhere

cinder flare
#

yeah I'm impressed you don't have 20 without any plugins or any players

jovial warren
old wyvern
#

bard screen share in vc?

jovial warren
#

sure

hot hull
#

Bardy, have you tested it being ran outside of IJ yet?

#

I wanna throw it on my survur :sadge:

cinder flare
#

ooh yeah that'd be cool

#

we can get the whole gang together to start rewriting open source plugins for Krypton!

hot hull
#

FrozenJoin for Krypton ๐Ÿ˜

cinder flare
#

ooh never heard of it

#

is it your plugin?

stuck harbor
#

FrustyJoyn

hot hull
#

@onyx loom Start flaming this dude for not knowing what that is

onyx loom
#

eeeeeeeee

cinder flare
#

im typing as fast as I can!!!!

#

oh ew wtf is songoda

onyx loom
#

frozenjoin good

cinder flare
#

oh damn we got the whole gang of contributors here

hot hull
#

would it be worth making actions, which take in any event, and execute whatever you want?

cinder flare
#

Frosty, BM, Yuri, and Piggy!

#

so uh, what does this bad boy do

#

cool particle effects or something upon join?

analog crater
#

Does anyone have any good tutorials for ktor and react.kt?

old wyvern
#

matt may be able to help

hot hull
cinder flare
#

such as?

hot hull
static zealot
cinder flare
#

Maybe the code ain't bad, just the documentation lol

hot hull
#

what documentation?

#

Also yea the code is shit

cinder flare
#

Least it's Kotlin

#

can't be as bad as java haha

hot hull
#

Oh yea this is also in kotlin

#

Completely forgot

analog crater
#

Couldn't ActionHolder.kt be a data class?

hot hull
oak coyote
hot hull
#

@jovial warren I'm waiting for this greatness to happen

cinder flare
#

yoooooo it's #2!

hot hull
#

Well yes

cinder flare
#

poor airplane

hot hull
#

airplane is just there cause it loads fast

prisma wave
#

๐Ÿฅฒ

jovial warren
hot hull
#

What would be the cause of this again?

#

pings the server just fine, just fucks it when I try to connect

oblique heath
#

it broke

#

restart it ๐Ÿคทโ€โ™‚๏ธ

#

that looks like a bungee message, so it seems like the backend servers aren't reachable

cinder flare
#

stupid bungee

#

velocity gang

#

(never used either, just like having opinions :)

oak coyote
#

They both do the same thing

#

Just one was made with hindsight from the other

cinder flare
#

exactly! just like Java and Kotlin! And look at the difference there

#

Does Velocity have good error messages tho? This kinda looks a little painful

oak coyote
#

Not really

#

I canโ€™t find you the server nor fallback server so goodbye

#

Not exactly hard to understand

cinder flare
#

hmmm maybe the io.netty part threw me off

oak coyote
#

An expception call yeah for the developer

#

Itโ€™s why you should read the first bit

cinder flare
#

I'm a developer and I still got scared ๐Ÿ˜‹

hot hull
cinder flare
#

oh which one is better

hot hull
#

velocity

#

however velocity isn't gonna be permanent

cinder flare
#

oh?

hot hull
#

It's gonna be maintained so long larger servers use it, after that I doubt anyone is gonna bother

cinder flare
#

Well isn't that... the state of every piece of software?

hot hull
#

Nah stuff like paper will always be maintained, since people can fix shit themselves

cinder flare
#

and people can't fix Velocity?

#

is Waterfall gonna stay around then?

hot hull
#

Can someone try connecting to frosty.op65n.tech

cinder flare
#

mc connection?

hot hull
#

yes

cinder flare
#

bet

#

๐Ÿ‘€

hot hull
#

Would appear I may have fucked a port or something

#

used the wrong port smh

cinder flare
#

smh

oak coyote
#

Have you got it on a proxy @hot hull

cinder flare
#

awe now im not whitelisted :'(

hot hull
#

Yeah this port was bound to the krypton server cause I'm a retard

#

Yes Jerry

oak coyote
#

๐Ÿคก

hot hull
#

stop bully

oak coyote
#

Hehehe

onyx loom
#

always bully

hot hull
#

@ocean quartz Can we get FrozenActions support for mf cmds?

cinder flare
#

Make a PR. you won't

hot hull
#

He's rewritting it, so no I won't ;C

cinder flare
#

awe too bad

jovial warren
#

fixed weird ticking times btw

#

guess what it was

onyx loom
#

what was it!

jovial warren
#

Thread.sleep apparently has about a 10 ms overhead

onyx loom
#

lol

jovial warren
#

so I was sleeping for just over 60 ms instead of the 50 ms I should've been sleeping

hot hull
#

Damn you unproductive af sleeping for 60ms

jovial warren
#

ffs

#

no, the main thread was sleeping for just over 60 ms

onyx loom
#

/s

jovial warren
#

lol ik Kaliber

prisma wave
#

elara/threads::sleep 50
0 overhead

onyx loom
#

damn thats crazy

prisma wave
#

yes

#

this is because every elara function compiles to just a single line of assembly

#

fastest possible operation

jovial warren
#

or have you finally decided to ditch the JVM

old wyvern
#

It wasnt an overhead

prisma wave
#

thats always been planned

old wyvern
#

Its just that the next time the scheduler ticked was 12 millis after the wake time

hot hull
#

@ocean quartz wakey wakey, if I set the nbt tag to null, will it remove it?

jovial warren
#

can anyone here tell me how to link C files properly with JNI?

#

I read a tutorial but it didn't seem to work

#

I just wanna write some JNI code in C and call it from Java lol

lunar cypress
#

what are you doing exactly?

jovial warren
#

but the Java compiler complains native_sum isn't in java.library.path

#
#include <jni.h>

JNIEXPORT jlong JNICALL
Java_dev_bombardy_testing_NativeMath_sum(JNIEnv *env, jint number) {
    long sum = 0;
    for (int i = 0; i < number; i++) {
        sum += i;
    }
    return sum;
}
```this is my C code btw
lunar cypress
#

Where do you load the library?

jovial warren
#

you talking about where I call System.loadLibrary?

#

inside of NativeMath

lunar cypress
#

yes

jovial warren
#

actually maybe the static block should go at the bottom

lunar cypress
#

that does not matter at all

jovial warren
#

public static native long sum(final int number); this is my native method

#

System.loadLibrary("native_sum"); then this is how I load the library

lunar cypress
#

If you have copied the build.gradle file it will only add this to the library path for the test task

#

which is not what you want I presume

jovial warren
#

I'm running the test task

#

at least, I should be

#

I'm just trying to do some testing with JNI

lunar cypress
#

so you are running gradle test

jovial warren
#

lemme try doing that

lunar cypress
#

what's in build/libs/hello/shared

jovial warren
#

ah, I see the issue actually

#
> No tool chain is available to build for platform 'windows_x86':
    - Tool chain 'visualCpp' (Visual Studio):
        - Could not locate a Visual Studio installation, using the command line tool, Windows registry or system path.
    - Tool chain 'gcc' (GNU GCC):
        - Could not find C compiler 'gcc' in system path.
    - Tool chain 'clang' (Clang):
        - Could not find C compiler 'clang' in system path.
lunar cypress
#

yes, you need to build the library before you can use it

jovial warren
#

so what have I gotta get then? VS?

#

or can I somehow get GCC on Windows

lunar cypress
#

you can't. you don't have to install the full VS though

#

in the installer you can select to only install the cpp build tools

#

I'd assume you need the same stuff as you need for the rust installation

#

You could also try to see if it works with WSL (it should)

#

If you don't want the effort

jovial warren
#

I'm in the individual components section of VSC, which ones do I actually need?

lunar cypress
#

you're in the visual studio installer?

jovial warren
#

also, WSL doesn't work for me atm, since WSL 2 requires the hypervisor enabled, and that breaks VirtualBox

jovial warren
#

what should I be linking with? MSVC?

lunar cypress
#

you need this

jovial warren
#

I have that installed

#

maybe I'm missing something

#

which tools do I need ticked inside of that?

old wyvern
#

wait

#

You cant have gcc on windows?

jovial warren
#

you can use MinGW or Cygwin according to the website

#

but not natively

old wyvern
#

yea

#

MinGW should work

lunar cypress
#

ew, mingw

obtuse gale
#

just switch to Linux you pussy

jovial warren
#

yeah true, I should do that lol

old wyvern
#

He is on linux I think

#

Wait

jovial warren
#

currently on Windows atm

old wyvern
#

when did you switch to windows?

#

Werent you running arch?

jovial warren
#

some time ago

old wyvern
#

ah

jovial warren
#

yeah I still do have Arch

#

I just don't use it lol

old wyvern
#

I see

jovial warren
#

I've been meaning to move back, but I just can't be assed lol

old wyvern
#

yea for now mingw should be enough

jovial warren
#
#include <jni.h>

JNIEXPORT jlong JNICALL
Java_dev_bombardy_testing_NativeMath_sum(JNIEnv *env, jint number) {
    long sum = 0;
    for (int i = 0; i < number; i++) {
        sum += i;
    }
    return sum;
}
```is there anything wrong with this code btw?
#

since idk whether jlong and C's long are interoperable or not

#

right, got MinGW installed, how do I actually use it?

quiet depot
#

try type gcc in cmd

jovial warren
#

nothing

quiet depot
#

run it thru mingw directylt ehn

old wyvern
#

Make sure you have it in your PATH

quiet depot
#

installer should add it atuomatically

old wyvern
#

It didnt for me I think

quiet depot
#

depending on where he downloaded it from

old wyvern
#

I had to add it manually

jovial warren
#

yeah it's not there

#

also, I didn't download it, I just used an installer I have on my system

quiet depot
#

the minimal git bash one does it automatically but the full mingw64 doesn't iirc

old wyvern
#

ah

obtuse gale
quiet depot
#

or might be other way around

old wyvern
jovial warren
#

oh btw, Git bash doesn't have gcc

#

apparently

old wyvern
#

From the example it looks like they can return long for jlongs

quiet depot
#

install the full mingw64 then

jovial warren
#

yeah I have it

#

it's just not in PATH

old wyvern
#

add it

jovial warren
#

what path do I want to add? C:\Program Files\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin?

quiet depot
#

wtf is that

#

where'd you download this shit from

jovial warren
#

that seemed to work

#

no idea, old installer lol

#

well, it was just sitting on my system

lunar cypress
#

jlong is an alias for long

old wyvern
#

x86_64-8.1.0-win32-seh-rt_v6-rev0

lunar cypress
#

I think

old wyvern
#

tf is this

quiet depot
#

dude they don't even make installers for the full ver last time I checked

#

it's just zips

onyx loom
#

bardy got a virus question mark

quiet depot
#

nah

#

probs not

onyx loom
#

i can always give him one tho fingerguns

old wyvern
#

corona virus question mark

jovial warren
#

anyway, I'll upgrade it another time

#

Gradle still can't find GCC though

old wyvern
#

thats weird

quiet depot
#

yeah idk if what I said is true, I might've been thinking of something else cuz I'm looking at their site now and looks like they do have installers

jovial warren
#

- Could not find C compiler 'gcc' in system path.

quiet depot
#

download that

#

probably not a virus

#

try install gcc thru it

jovial warren
#

also, gcc still doesn't seem to be recognised inside of IJ's CMD

#

it's recognised in CMD though

quiet depot
#

open a new terminal in ij

#

type exit in the terminal

jovial warren
#

yeah I already tried that

#

still not there

old wyvern
#

huh

#

Reopen IJ

jovial warren
#

oh btw, apparently, this is one of the only places where NetBeans & Eclipse > IntelliJ

#

the fact that they have support for C and apparently IntelliJ doesn't

#

like they have support for these multi-language projects

jovial warren
#
See file:///C:/Users/callu/IdeaProjects/testing/build/tmp/linkNative_sumSharedLibrary/output.txt for all output for linkNative_sumSharedLibrary.
linking native_sum.dll failed.
g++.exe: error: Shlwapi.lib: No such file or directory
g++.exe: error: Advapi32.lib: No such file or directory

Finished linkNative_sumSharedLibrary, see full log file:///C:/Users/callu/IdeaProjects/testing/build/tmp/linkNative_sumSharedLibrary/output.txt.
jovial warren
old wyvern
#

Install the plugin

old wyvern
#

IJ pretty much has everything

quiet depot
#

3 years ago

old wyvern
#

The plugin for C/C++ I assume

#

Whichever CLion uses

quiet depot
#

c/c++ plugin might not be up to par with clion

#

someone I know has complained about it

old wyvern
#

I see

quiet depot
#

saying clion > ij + c ploogin

#

but that might just be pebcak

jovial warren
#

anyway, any idea about my error?

old wyvern
#

It seems to run fine with Android Studio mostly

jovial warren
old wyvern
#

oh?

quiet depot
#

ah

#

you know

#

I've been told this 3 times now

#

I always forget the exact reason why "intellij c bad"

#

for some reason the fact that the plugin doesn't exist just doesn't want to stick in my head

old wyvern
#

damn

pale shell
#

Probably?!

jovial warren
#

lol

#

when your test outputs 0 some of the time and the correct answer other times

old wyvern
#

Wonderful

#

Impure systems be like

forest pecan
#

๐Ÿฅฒ

jovial warren
#

actually, tell a lie, correct answer my ass

#

idk about you, but I don't think 20 * (20 - 1) is 1409450392

forest pecan
#

wot lol

obtuse gale
pale shell
#

๐Ÿ˜…

jovial warren
#

can someone tell me what EXCEPTION_ACCESS_VIOLATION means?

#

trying to write some C code to print the size of a C long and it seems to throw that

prisma wave
#

segmentation fault

#

send the code

jovial warren
#
#include <jni.h>
#include <stdlib.h>

JNIEXPORT void JNICALL
Java_dev_bombardy_testing_Native_printSizeOfLong(JNIEnv* env) {
    printf(sizeof(long));
}
prisma wave
#

As a C expert I am sure it will be easy

#

doesn't printf take a char* ?

jovial warren
#

ah that'll be it

old wyvern
#

first arg is the format

jovial warren
#

okay what the actual fuck

old wyvern
#

the size should be the second arg

jovial warren
#

that returns 0.000000

distant sun
#
                for (i in 100 downTo 20 step 20) {
                    if (player.hasPermission(Constants.Permissions.MORE_FLY_PERMISSION.plus(i))) {
                        return i.toString()
                    }
                }

                return "0"
                
                // or

                return (100 downTo 20 step 20).firstOrNull {
                    player.hasPermission(Constants.Permissions.MORE_FLY_PERMISSION.plus(it))
                }?.toString() ?: "0"```
old wyvern
#

Send what you used

jovial warren
#
public class Native {

    public static native void printSizeOfLong();

    static {
        System.loadLibrary("natives");
    }
}
old wyvern
#

The C function

jovial warren
#
@Test
    public void longSize() {
        Native.printSizeOfLong();
    }
#

printf("%f", sizeof(long));

prisma wave
#

woozy_face

jovial warren
#

lol

old wyvern
#

use %d

prisma wave
#

Use %d I think

#

Ez

#

C expert

old wyvern
#

f is for floating point numbers

jovial warren
#

lol

old wyvern
#

d is for integers

jovial warren
#

what did I say yesterday

old wyvern
#

idk

jovial warren
#

long is 4

distant sun
#

c sucks

prisma wave
#

I'm basically Linus torvalds at this point

jovial warren
#

long is 4 bytes on Windows

#

no wonder I get strange errors

old wyvern
#

no

#

4 bytes is for 32 bit

jovial warren
#

yeah

#

ik

#

but the minimum size of a long in C is 32 bits

prisma wave
#

why don't they just use Big Integer !

old wyvern
#

nah man

#

long long long

#

long long long long long

#

very long long long long

jovial warren
#

so I assume ```c
JNIEXPORT jlong JNICALL
Java_dev_bombardy_testing_NativeMath_sum(JNIEnv* env, jint number) {
return (long) number * (number - 1);
}

forest pecan
#

bardy you should actually use jna instead of jni

jovial warren
#

since jlong is 64 bit and jint is 32 bit

old wyvern
#

Youll need to cast each number'

jovial warren
dusky drum
#

why is Vault so demanding :/

Could not find org.bukkit:bukkit:1.13.1-R0.1-SNAPSHOT.
Required by:
         project : > com.github.MilkBowl:VaultAPI:1.7
prisma wave
#

(unsigned long long) 0

old wyvern
#

Does operations on jlong work?

jovial warren
#

no clue

distant sun
#

@dusky drum transitive = false

jovial warren
#

they seem to work Yugi

old wyvern
#

Ah ok

#

use long long

jovial warren
#

but I get really really weird thingies

forest pecan
#

why you use jni ๐Ÿ˜ฆ

old wyvern
#

cast it to a long long

prisma wave
#

i64 ๐Ÿ™‚ ๐Ÿ‘ ๐Ÿ‘ PlusOne

old wyvern
#

They getting botted hard

forest pecan
#

what is that server

#

send em link

prisma wave
#

wtf

forest pecan
#

send me link

#

lol

prisma wave
#

Couldn't be Dev Den

forest pecan
#

someone

jovial warren
#

apparently, 20 * (20 - 1) is 113309238466483752 @old wyvern

old wyvern
#

oh wait

jovial warren
#

something's going on here

old wyvern
#

HOLY SHIT

prisma wave
#

Lmfao

jovial warren
#

what the fuck

forest pecan
#

sned me llink

#

someone

jovial warren
#

sned me link

forest pecan
#

send me link to server

#

i wanna see

#

pls

#

pls

onyx loom
#

idontbangfraud

jovial warren
#

send me

#

inv

forest pecan
#

sedn me

#

inv

#

pls

old wyvern
#

Wait goddamit xD

jovial warren
#

lol

old wyvern
#

I forgot the server name itself

#

oh yes

#

TheCodingDen

#

You are already in it I think pulse

prisma wave
#

damn

forest pecan
#

im in bois

jovial warren
#

the channels aren't there

forest pecan
#

they just stopped

#

lol

old wyvern
#

They fixed it

#

lol

forest pecan
#

i saw the mods delete them

#

xd

old wyvern
#

xD

jovial warren
#

lol

prisma wave
#

how does that even happen

old wyvern
#

That whole discord is going crazy

jovial warren
#
JNIEXPORT jlong JNICALL
Java_dev_bombardy_testing_NativeMath_sum(JNIEnv* env, jint number)
{
    long casted = (long) number;
    return (long long) (casted * (casted - 1));
}
```someone please tell me in what universe that would return `-480383736` with `number` as `20`
quiet depot
#

lol

#

imagine a coding discord

prisma wave
#

overflow

quiet depot
#

not being able to protect itself from bots

#

what fucking plebs lmao

prisma wave
#

๐Ÿฅฒ

jovial warren
#

wdym overflow?

surreal quarry
#

lmaoo

quiet depot
#

overflow

jovial warren
#

yeah ik

#

but idk how that could overflow

lunar cypress
old wyvern
#

ikr xD

surreal quarry
#

that was nuts

old wyvern
#

Those channels were flying

forest pecan
#

why ๐Ÿ‘ are ๐Ÿ‘ you ๐Ÿ‘ using ๐Ÿ‘ jni

old wyvern
#

They disabled chat in msot channels now

surreal quarry
#

the only thing i can think of it going faster is when the official python discord got raided lmao

forest pecan
#

jna better

#

๐ŸŒš

quiet depot
#

is the coding den the biggest code server?

old wyvern
#

Probably not

quiet depot
#

apart from discord api perhaps

#

idk if that's bigger or not

forest pecan
#

theres a lot of ones out there

quiet depot
#

I assume it is

old wyvern
#

They havent fixed the invite link xD

#

its still weird

forest pecan
#

i got in from this sketchy ass redit npost

#

lol

old wyvern
#

"jamieontop"

lunar cypress
#

Tcd is one of the biggest definitely

surreal quarry
#

they have around 12k

#

online

jovial warren
#

wait so they didn't just get radied, they must've got hacked?

lunar cypress
#

Yep

old wyvern
#

Yea one of the admins ig

quiet depot
#

both

#

lol

#

if microsoft buys discord

#

minecraft accounts won't be the only accounts getting migrated to microsoft accounts ๐Ÿ˜‰

onyx loom
#

๐Ÿ˜ฉ

forest pecan
#

fuckkk

onyx loom
#

please never

errant geyser
#

That will be the day I don't use Discord anymore

quiet depot
#

I mean it's not ideal but at least it'd probably greatly mitigate bots

onyx loom
#

i still havent migrated my mc account to microsoft

errant geyser
#

^

quiet depot
#

that's because you can't

#

migrations start in april

onyx loom
#

huh

#

oh

#

i thought they started like 6 months ago

quiet depot
#

no

#

the announcement was then

onyx loom
#

nvm then ๐Ÿ˜‚

quiet depot
#

it's due for april unless they changed the date

#

i can't remember the exact day

jovial warren
#

I think Microsoft will just leave Discord alone

#

like if they buy it

quiet depot
#

well

#

not exactly

jovial warren
#

they'll just leave it to act independently, like what they did with a few of their other acquisitions

quiet depot
#

if they buy it there'll be a lot of pressure to make it profitable at first

#

maybe after that they'll leave it alone

#

but that alone will probably require some changes

jovial warren
#

Discord is profitable though

onyx loom
#

well have to pay for the stickers kek

jovial warren
#

isn't it?

quiet depot
#

discord doesn't make a profit

jovial warren
#

ah

quiet depot
#

it's 100% reliant on investors

#

well

#

99%

#

1% comes from nitro

jovial warren
#

oh no

quiet depot
#

fun fact youtube doesn't make a profit either

#

mind you youtube doesn't lose money, but it's not profitable

#

they break even

onyx loom
#

damn

jovial warren
#

also, surely Microsoft wouldn't want to ruin the massive community of people who use Discord

#

by making servers paid or something

quiet depot
#

oh they wouldn't do that

oblique heath
#

they definitely wont do that

onyx loom
#

that would defeat the whole purpose of discord

surreal quarry
#

i really hope they integrate discord to the xbox

quiet depot
#

they would do that

jovial warren
#

yeah that's my hope too

surreal quarry
#

and then leave it alone after that lol

quiet depot
#

i thought xbox already had discord integration

onyx loom
#

but then itll never get integrated into playstation ๐Ÿ˜ญ

surreal quarry
#

nah

quiet depot
#

what's wrong with you guys

#

pc masterrace

#

why are you talking about consoles

oblique heath
#

phone master race

onyx loom
#

na u can link ur discord account to xbox and see what game ur playing but thats it

surreal quarry
#

i play rocket league with friends who have xbox's

oblique heath
#

/s

jovial warren
surreal quarry
#

so i have to use the god awful xbox app

jovial warren
#

yeah

#

and Discord runs on Linux

oblique heath
#

discord self hosting when

surreal quarry
#

lol

quiet depot
#

it'd be really cool if microsoft integrated skype's phone number thing into discord

jovial warren
#

Microsoft won't stop Discord running on Linux either, since they have no reason to

onyx loom
#

whats that exactly?

#

havent used skype in years kek

jovial warren
#

as long as they don't do what they tried (and of course, failed) to do to Skype with Discord

quiet depot
#

kaliber it's a phone number that's attached to your skype account

old wyvern
quiet depot
#

so people can call you on a normal mobile phone and it goes to discord

surreal quarry
#

could you imagine they drop discord support for mac and linux to force windows 10 sales

onyx loom
#

oh right cool

old wyvern
#

Why would they invest on a non-profittable organisation?

quiet depot
#

in the hope that it becomes profitable

#

that's how investing works

#

companies don't start profitable

jovial warren
oblique heath
#

is discord public

old wyvern
#

I mean discord is pretty big rn

quiet depot
#

no discord isn't public

oblique heath
#

aw

quiet depot
#

although that's an option

jovial warren
#

if they still thought Linux was a "virus", they wouldn't've made WSL

old wyvern
#

Is there much more growth to be done to discord rn?

onyx loom
#

absolutely

old wyvern
#

Its very widely used

heady birch
#

Why cant I cast an int to a long

surreal quarry
#

Int#toLong

quiet depot
#

there's a huge potential market yugi

heady birch
#

yeah but it is an Object

jovial warren
heady birch
#

which could be a int or a long

surreal quarry
#

toLong#fromInt(int)

jovial warren
#

well then that's why Niall

old wyvern
#

Doesnt pretty much everyone use it at this point tho?

quiet depot
#

no

stuck harbor
#

kneeee

jovial warren
#

you can't cast Object to primitives

quiet depot
#

discord is still mainly a "gamer" platform

oblique heath
#

a LOT

jovial warren
#

you can only cast primitives between each other

surreal quarry
#

cast it to a Long not a long

jovial warren
#

because primitives are completely different things on the JVM

#

they aren't classes

old wyvern
#

I see

#

Hmm

jovial warren
#

they have their own separate bytecode instructions

quiet depot
#

discord is still in its infancy compared to how big it could get

old wyvern
#

Also piggy i got a question about class loading

quiet depot
#

lay it on me

old wyvern
#

Ill ask in a bit

#

One moment

quiet depot
#

o

jovial warren
#

thinking about class loading actually, someone in Paper mentioned the other day how they thought that Paper should use module class loaders instead of URL class loaders if/when it hard forks

#

and just scrap loading dependencies at runtime

quiet depot
#

who said that

#

because depending on who said it i'll either say "lol" or

#

idk

#

maybe "lol"

#

yeah one of those two options

jovial warren
#

lemme see if I can find it

old wyvern
#

So if I had a class using a custom ClassLoader which loaded some ClassA and is now holding an instance of that class, if it returns that instance to the parent class which doesnt use this classloader, nee instances created inside that ClassA will still use the custom class loader right?

jovial warren
#

apparently, module class loaders are "the way to move the platform forward"

old wyvern
#

And all of its contents can be used by other classes even tho it doesnt use the "custom" class loader?

quiet depot
#

yeah we'll see

#

@old wyvern your question is confusing me a little bit

#

mind removing any reference to "instance" because classloaders don't touch instances afaik

#

should clear it up a bit

#

oh wait

#

nvm

#

i think I just misread

old wyvern
jovial warren
#

sorry, I mean like what LuckPerms does

old wyvern
#

Ill write it up a bit clearer

jovial warren
#

where it loads its own dependencies at runtime

hot hull
onyx loom
#

frosty

#

have u ever considered that he might be sleeping

jovial warren
#

you think Frosty cares about that?

#

lol

#

also, who tf sleeps until half past 3 in the afternoon (his time I think)

onyx loom
#

me

#

and matt is in same timezone as us btw

quiet depot
#

I think I'm confused with what "parent class" refers to

jovial warren
#

ah yeah, Portugal isn't it

old wyvern
#

or rather

#

wait

forest pecan
#

Fefo gave me something like this about loading plugins using some form of bootstrap:

public final class PulseLoaderClassLoader extends URLClassLoader {

  PulseLoaderClassLoader(PulseBootstrapLoaderPlugin plugin) {
    // No URLs by default, they will be added as you go anyway; have the PluginClassLoader as parent class loader
    super(new URL[] { }, plugin.getPluginClassLoader());
  }

  // Don't actually expose the method, but "wrap" it
  public void addJarToClasspath(URL url) {
    addURL(url);
  }
}
public final class PulseBootstrapLoaderPlugin extends JavaPlugin {

  // Maybe add a getWhateverClassLoader method? So you can do like JavaPlugin.getPlugin(PulseBootstrapLoaderPlugin.class) to get *this* class loader and add URLs to it
  private final PulseLoaderClassLoader classLoader = new PulseLoaderClassLoader(this);
  private Map<String, PulsePluginWhatever> plugins = new HashMap<>();

  public PulseBootstrapLoaderPlugin() {
    // Some constructor logic
    // Scan a folder for your custom jars
    // Read your "custom plugin.yml"
    // Load the "main" class with the class loader
    // Call their constructors, set the dataFolder, the logger, etc (essentially what Bukkit does)
    // Save them into the Map
  }

  @Override
  public void onLoad() {
    // Call their onLoads
  }

  // Repeat for onEnable and onDisable

  public ClassLoader getPluginClassLoader() {
    return getClassLoader(); // older versions of Bukkit had this method as protected final
  }
}
public abstract class PulsePluginWhatever extends JavaPlugin { // or not, it can be fully custom unrelated to a JavaPlugin

}

I haven't tried it before, but he claims that it should work for loading all plugins. It becomes the dominant plugin loader and will load all the plugins itself. This will allow the url method to be opened cause it uses the custom classloader instead of the one provided.

quiet depot
#

oh btw a little conclusion to something I said earlier. If discord is currently somehow making a profit, I highly doubt it'll be from the simps buying nitro for their favourite streamer, it'll probably be from discord selling our data (or more accurately, the investors selling/using it).

onyx loom
#

oh no not my data!

forest pecan
#

yea lol

jovial warren
#

also, that's what I do in Krypton lol

forest pecan
#

lmfao

jovial warren
#

lemme show

quiet depot
forest pecan
#

fefo sent me that exact code

#

in dms when i needed help

#

i want to try it

onyx loom
#

oh no not china!

jovial warren
#
// this is only so we can expose addURL for internal use
class PluginClassLoader(vararg urls: URL) : URLClassLoader(urls) {

    internal fun addPath(path: Path) {
        addURL(path.toUri().toURL())
    }

    companion object {

        init {
            ClassLoader.registerAsParallelCapable()
        }
    }
}
onyx loom
#

(china i love you dont kill me pls ๐Ÿ˜„ )

forest pecan
#

so you opened the url?

forest pecan
jovial warren
onyx loom
#

๐Ÿคจ

forest pecan
#

imma dial the government

#

(im chinese btw lmfao)

quiet depot
#

wait are you actually?

forest pecan
#

Yes

onyx loom
#

o

forest pecan
#

Brandon Li

#

"Li"

#

lmfao

jovial warren
#

yeah I was gonna say

quiet depot
#

lithium

old wyvern
#

So lets say I loaded a class "MyClass" with my implementation of ClassLoader called "TestClassLoader"

I then create an instance of this class. Some other class which doesnt use "TestClassLoader" fetches this instance.

But since the "other class" here doesnt use TestClassLoader, it will try to load the class again using extension class loader if I refer to it right?

forest pecan
jovial warren
#

I mean, I didn't guess that, but it's very obvious now you mention it

forest pecan
#

Yea

quiet depot
#

yugi when you say an instance of this class

#

do you mean a Class<MyClass>

#

or a MyClass

old wyvern
#

MyClass

quiet depot
#

ok

old wyvern
#

So would TestClassLoader loading it affect parent class loaders of it so I can refer to it with the other classloaders?

quiet depot
#

let's picture it this way:

#

MyClass: TestClassLoader
OtherClass: OtherClassLoader

#

In OtherClass, if you didn't wish for MyClass to also be loaded by OtherClassLoader, you would not be able to reference MyClass in code

#

you would only be able to interact with MyClass via reflection

old wyvern
#

hmm

#

Welp

quiet depot
#

that's not a big deal

#

explain the usage

old wyvern
#

pdm remake

jovial warren
#

gl with that one

quiet depot
#

with what

old wyvern
#

Since 9+ cant append to URLClassLoader

quiet depot
#

isolation?

jovial warren
old wyvern
#

No Imena

jovial warren
#

just expose the inner addURL method lol

old wyvern
#

The systemclassloader

#

isnt URLClassLoader

jovial warren
#

why tf are you manually loading classes using the system class loader

quiet depot
#

why are you trying to add things to the system class loader?

old wyvern
#

I am not

#

Was jsut reading up on it

#

The changes from 9

forest pecan
#

open module

#

here take a look at this class:

quiet depot
#

okie

jovial warren
#

also, surely you can reflectively access addURL anyway?

quiet depot
#

if you find anything interesting, pls let me know

old wyvern
#

Sure piggy

jovial warren
#

or do modules deny that now

old wyvern
forest pecan
quiet depot
#

would love to expand my classloader info repertoire

forest pecan
#

this works for Java 8-15

jovial warren
#

well then you shouldn't be trying to add to it

forest pecan
#

it opens the module

#

and loads a jar file

#

it doesn't work for Java 16+ however

jovial warren
#

strong encapsulation of JDK internals xD

forest pecan
#

Yea lol

quiet depot
#

yugi especially anything regarding unloading classes reliably

jovial warren
#

you shouldn't be trying to manually load classes using any internal class loaders

quiet depot
#

if you find any mention of that you might've stumbled onto a gold mine

old wyvern
#

Ill let you know if I end up finding anything useful

forest pecan
#

im just confused, are you having trouble support java 9-15 or java 16+?

quiet depot
#

thx

old wyvern
jovial warren
#

couldn't you technically use JNI to unload classes?

old wyvern
#

One way would be have a specific entrypointclass

#

Which would be loaded by slimjar

forest pecan
#

So you aren't using URLClassLoader

#

right

old wyvern
#

Mhm

jovial warren
#

so what are you using?

old wyvern
#

Because that implementation has changed

jovial warren
#

what?

forest pecan
#

Well that supports java 9 - 15 (the URLCLassLoader one)

jovial warren
#

?help

compact perchBOT
#
FAQ Answer:
ยป Give the helpers some details
ยป Ask suitable questions
ยป Be polite
ยป Wait

Source

forest pecan
#

probably not the place to ask for help here

jovial warren
#

^

pure glacier
#

oh ok..

#

sry

forest pecan
#

in this channel

#

at least

jovial warren
pure glacier
#

is there a channel?

forest pecan
#

Yeah

quiet depot
#

probably

ocean quartz
#

And don't randomly ping people, read the rules about pinging support

pure glacier
#

thx! ok..

jovial warren
#

I mean, with C, you have full control over the actual memory that's being allocated

quiet depot
#

you can control memory in java code too ||unsafe||

hot hull
#

Why was I pinged

jovial warren
#

yeah but nowhere near as well

heady birch
#

C, memory leaks, rust, never

jovial warren
hot hull
#

Dude deleted his message

forest pecan
#

lol

hot hull
#

Fucking ass

jovial warren
#

oof

hot hull
#

God do I hate ghost pings

jovial warren
quiet depot
#

until u disable safe mode niall

jovial warren
#

if you can get Rust to work with JNI then please, tell me lol

old wyvern
hot hull
#

Pulse

ocean quartz
forest pecan
hot hull
#

jump off a cliff

forest pecan
quiet depot
#

ay so pulse

#

what time is it for u

forest pecan
hot hull
pure glacier
quiet depot
#

lol

forest pecan
#

lol

jovial warren
#

lol

#

patience is a virtue

old wyvern
#

The instance you get is not a URLClassLoader

hot hull
forest pecan
#

hm remind me of your general goal again

old wyvern
#

Ofc yo ucan create your own class loader that extends it

forest pecan
#

you can load jars with it

#

but was the goal different

pure glacier
#

-_- i need help tho frosty

old wyvern
#

Yes but that goes into the entry point idea

quiet depot
#

@pure glacier just wait patiently for an answer in #development, if someone knows the answer they will share

old wyvern
#

Because you actually need the entry class to be created by that classloader

jovial warren
forest pecan
#

Hm yeah

old wyvern
#

Which is something I was trying to avoid

#

Might just end up going with that tho

forest pecan
#

Yeah that's going to be tuff

ocean quartz
forest pecan
#

urlclassloader is easy for supporting java 9 -15, but after that it gets harder

quiet depot
#

yugi

#

when in practice are you getting a system class loader?

quiet depot
#

sorry if you mentioned it before wasn't following super closely

#

it's just in bukkit, you don't really get the system class loader

#

so is this for standalone apps?

old wyvern
#

Either

hot hull
forest pecan
#

For bukkit shouldn't you use the plugin classloader though?

old wyvern
#

Im trying to keep it agnostic to that

forest pecan
#

You could pass in a classloader as an argument

old wyvern
#

Run anywhere

forest pecan
#

or some sort of injection

quiet depot
#

for standalone apps you could get your pdm remix to take over as the application's entry point, and then run the actual program in a url class loader

jovial warren
#

or do what Lucko did and use jar-in-jar fingerguns

quiet depot
#

then deps are loaded into that class loader

forest pecan
#

where you dominate the current classloader

old wyvern
#

mhm, but it gets weird when a framework controls the entrypoint

#

๐Ÿฅฒ

forest pecan
quiet depot
#

in what way?

old wyvern
#

As the actual entrypoint has a different classloader than what we want it to have

#

Or actually

harsh hawk
#

Where's the dev build for Deluxechat?

quiet depot
old wyvern
#

wait no

#

hmm

jovial warren
#

or that

quiet depot
#

I love how in depth class loaders can go

#

so many cases to consider

forest pecan
#

๐Ÿฅฒ

quiet depot
#

does any other topic in java go this far?

old wyvern
#

๐Ÿฅฒ

forest pecan
#

well

old wyvern
quiet depot
#

I mean some probably go further, like gc

forest pecan
#

perhaps jni/jna

#

maybe

quiet depot
#

oh yeah generics can go real far

#

although that's pretty much completely abstract

old wyvern
#

Executing a program with javac do be crazy

quiet depot
#

class loaders have lots of impl details

old wyvern
#

mhm

ocean quartz
heady birch
#

Oracle biscuit

quiet depot
#

niall

#

do u play with rust unsafe

heady birch
#

Once or twice

#

It is my fundamental belief that "unsafe" should be avoided at all costs

quiet depot
#

I believe that's not just yours

old wyvern
#

Maybe I can just change the bytecode at compile time to make all uses of new use the classloader ๐Ÿฅฒ

quiet depot
#

it's a pretty fundamental belief in life in general; not even unique to programming, that "unsafe" should be avoided at all costs

heady birch
#

Lol

forest pecan
heady birch
#

dpends on the CONTEXT

#

are you wearing a parachute?

forest pecan
#

No

old wyvern
#

Would it be considered bad if I try to change the entry classe's bytecode for this?

forest pecan
#

don't parachutes add extra weight

quiet depot
#

should be fine then

forest pecan
#

๐Ÿคก

#

Yeah thats what i thought

quiet depot
#

parachutes can choke you

#

all those strings

#

very unsafe

forest pecan
#

Exactly

old wyvern
#

piggy

forest pecan
#

More unsafe than safe

quiet depot
#

yugi worse things have been done

#

I'd keep looking for another solution before putting effort into that one

old wyvern
#

Alrighty

#

I guess googling time

quiet depot
#

look into osgi

old wyvern
#

oh yea I read about that on a stackoverlfow thread

#

Bundles

forest pecan
#

isn't there also stuff like the agents