#dev-general

1 messages · Page 596 of 1

olive jackal
#

so basically, to build spigot plugins you use outdated buildtools, but now you just need to use paperclip or purpurclip

#

where do I install paperclip/purpurclip

#

and also does paperclip/purpur nms or whatever I'm supposed to use have a guide

humble silo
#

Looks like the 2b2t map

#

oh wait

#

freddy already said that

sick belfry
#

google doesnt help

humble silo
#

wdym make it?

sick belfry
#

yeah gen one

#

any links, docs, etc?

humble silo
#

like from maps?

#

*a minecraft world

#

I have no idea lol

sick belfry
#

like any guide, docs, link

humble silo
#

lol litearlly no idea

#

im sorry

#

never done anything like that

olive jackal
#

does anyone have any answers to my question?

sick belfry
#

damn

humble silo
sick belfry
#

nope

#

like dis

humble silo
#

but like

#

the one i sent could probably be scaled up

#

idk

sick belfry
humble silo
#

copy their source code!

#

ol

#

lol

#

um

#

well idk i got like a thousand hits when looking it up

#

so

sick belfry
humble silo
#

uh

#

nvm thats not helpful

#

You could create a question on stack overflow or something ig

#

might get a response

sick belfry
#

ye

viral grove
#

First time playing with proper tests in my code: do I need to put them in packages like how I put my main code in packages? (Java/Kotlin)

old wyvern
#

Im not sure about the anti-vaxxer allegations, never heard of his opinions on that. About the other 2, he was never a hindu supremacist afaik neither does our constitution fall behind on women rights. The problem that arises with women here have more to do with the people( either criminals or people who dont move on from old traditions ).

slow fjord
#

hello

#

i have a bug

static zealot
slow fjord
#

i cant upload files???

#

crash report ^^^

slow fjord
static zealot
#

ah. my bad

slow fjord
half harness
#
Executors.newSingleThreadExecutor().submit {
    throw IllegalStateException("test")
}.get()
```never completes - anyone know how to fix it?
gusty glen
half harness
#

i don't remember what the issues were but i think it was something which coroutines not being in its own separate thread, idk

gusty glen
#

well, idk what you're doing, but I think Future have a getOrExceptionally or something like that

half harness
#

¯_(ツ)_/¯

gusty glen
#

oooh I know

#

you can't just throw stuff inside futures, dkim

#

you have to catch them and use completeExceptionally​

#

then whoever calls get() will get ExecutionException with your exception nested iirc

half harness
#

what do I run completeExceptionally on

#

ExecutorService#submit only has a runnable or callable parameter

gusty glen
#

let me hop to my ide to make an example code

#

ooh, and you should be using some method of CompletableFuture class which accepts an executor

gusty glen
#

oh wait, I think nvm? If you figure out a way to force the usage of Callable, them you should be good, else probably what I said of using CompletableFuture will be a better option

half harness
#

i just froze intellij 🥲

#

was testing this

#

and

#

rip IJ

steel heart
#

well afaik

#

You can provide an exception handler or whatever that’s called

#

(Through a thread factory)

#

Idk if it would have an impact on the future but worth a try

gusty glen
#

that snipped throws my "some ass" IllegalStateException nested inside a ExecutionException ```kt
fun main(args: Array<String>) {
println(someAsyncComputation().get())
}

fun someAsyncComputation(): CompletableFuture<String> {
val executor = Executors.newSingleThreadExecutor()

return CompletableFuture.supplyAsync({
    throw IllegalStateException("some ass")
    "ass"
}, executor)

}```

half harness
#

👀

#

what is supplyAsync?

gusty glen
#

a method?

half harness
#

no i mean what does it do

gusty glen
#

I just created the executor inside the method for demonstration purposes only, you probably should handle them differently (like caching them) or smt

steel heart
half harness
#

no i mean what's the difference between that and #submit

steel heart
#

CompletableFuture::supplyAsync is a static factory method which begins a future with where it uses the supplier passed to compute a value through the given executor

gusty glen
#

yeah I know, but my example was just showing that dkim could throw exceptions inside the supplyAsync and it would work

#

if you have an exception ready to be returned before running the async part of your code, you can just use CompletableFuture#completeExceptionally to accomplish that feat (by creating an empty completablefuture, them completing it using that method (instance method)

steel heart
#

Anyways dkim

#

Have you tried
smtng like
Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setUncaughtExceptionHandler((t,e) -> e.printStackTrace()).build()).submit(blah).get()?

half harness
#

uhhh

#

that only prints the exception tho :/

steel heart
#

Yes but does it complete?

half harness
half harness
#

nope it doesn't seem to :/

steel heart
#

Hmm alright

#

Ima try that also

half harness
#

using this

gusty glen
#

hmm could you try future.get without the timeout, just in case

half harness
#

same result 🤔

steel heart
#

So how are you testing this?

half harness
#

scratch file

steel heart
#

Try setup a unit test

gusty glen
#

in my experience, snippets don't handle exceptions very well

half harness
#

but the exception should have been caught

half harness
#

okay welp ig it was scratch issue

#

interesting

steel heart
#

Running some tests rn

half harness
#

nvm i think my issue is something else

#

sorry D:

steel heart
#

Yuh

half harness
#

ohhhhhhhhhhhhhhhhhhhhh

#

🤦

#

if you want to know the issue: I had another Future that ran that future but I didn't do Future#get - I just looped and checked Future#isDone

#

so

#

it never threw

steel heart
#

🥴

half harness
#

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#

do u think that would work 🥲

#

wait what

gusty glen
#

🥴

half harness
#

now nothing is happening

#

whaiusdhjknwasjd

#

wa

steel heart
#

🥴

half harness
# half harness hm

i removed the future.get() and now its printing "got error" (my debug) but with future.get() it doesn't print that

#

#

above is underlined bc of the throw

steel heart
#

what does it say?

half harness
#

wdym?

#

the underline is to test the error (it says "Unreachable code")

steel heart
#

oh yeah

#

whats above it?

half harness
#

the throw

steel heart
#

which is?

half harness
#

throw IllegalStateException("")

steel heart
#

that makes sense

half harness
#

it's not printing anything

#

🤔

#

but if it's done it should be able to get the value, right?

#

oh wait

#

nvm i think i know the issue

steel heart
#

yeah well these 3 lines snippets you send is extremely hard to puzzle together and decipher

half harness
#

sorry - i think the issue is that the 3 lines are being ran async so the throw doesn't go anywhere 🤔

#

¯_(ツ)_/¯

steel heart
#

?paste

compact perchBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

steel heart
#

yeah paste the damn thign lol

half harness
#

the entire thing is like 400 lines ;-;

steel heart
#

ok idm

half harness
#

wait lemme test this first

steel heart
#

at least it would fully contextualize it

half harness
#

ooh i think it works

#

:D

#

ez

hot hull
#

You disgust me

static zealot
#

lmaoo

half harness
static zealot
#

not catch Throwable

prisma wave
#

It should only throw CompletionException iirc

#

Or maybe that's join()

half harness
#

ye

#

well

#

maybe i should wrap the entire code around a try catch

#

throwable

#

eh

#

idk

onyx loom
old wyvern
#

Turing complete excell

#

😌

prisma wave
#

Simon wrote an article about that

#

He probably had something to do with its design

ocean quartz
static zealot
#

I'm using Rider and I have console applications and I'm trying to get user input but every time when I do so I get a fucked up terminal. For example I want to read a number and when I enter a digit, it doesn't display it in the terminal. the program works well and it prints the correct number but for the user that entered the number it looks like its missing the first digit.

#

Also another problem I have is that backspace is displayed like a space

#

Here I entered 2245 then double backspace then 2444 and the output is right

#

is there anyway to improve that terminal?

#

because it annoys me so much

#

it is just the RUN terminal

#

not the normal terminal. that one looks fine. just like the one in IJ

prisma wave
static zealot
distant sun
onyx loom
#

ye u can

#

but vb 🤢

prisma wave
#

No need for VB anymore 😌

old wyvern
#

Prof. Simon Peyton Jones is a computer scientist who specialises in functional programming languages. He is most known for being one of the designers of Haskell, and a lead developer of the Glasgow Haskell Compiler. Peyton Jones currently works at Microsoft as a Senior Principal Researcher. He has also been heavily involved in advocating computi...

▶ Play video
old wyvern
#

Episode 7 | January 10, 2018

When we look at a skyscraper or a suspension bridge, a simple search engine box on a screen looks tiny by comparison. But Dr. Simon Peyton Jones would like to remind us that computer programs, with hundreds of millions of lines of code, are actually among the largest structures human beings have ever built. A princi...

▶ Play video
half harness
#

POG I REINSTALLED MY RASPBERRY PI AND GOT IT WORKING 🎉 🎉 🎉 🎉 _ _ _ _

#

|| i dropped my pi a couple months ago but ig it works now that i reinstalled the os 🤷 ||

viral grove
#

I just cut instead of copying a script I worked on for 3 hours, and deleted it. There goes my work 😦

gentle sparrow
# old wyvern Im not sure about the anti-vaxxer allegations, never heard of his opinions on th...

Here’s a quote from his book “Vaccination seems to be a savage custom. It is one of the poisonous superstitions of our times the equal of which is not to be found even among so called primitive societies […] Vaccination is a filthy remedy. Vaccine from an infected cow is introduced into our bodies; more, even vaccine from an infected human being is used […] I personally feel that in taking this vaccine we are guilty of a sacrilege.”

#

He has stated many times that he believes that Hinduism is the most liberal and tolerant religion of all of them

prisma wave
#

damn this is the most serious conversation we've had in this channel

#

like

#

ever

viral grove
#

Can a compiled c++ file be run by end users without installing the C compiler?

prisma wave
#

assuming they're on the right system, yes

old wyvern
#

Nor is he an author on the constitution

viral grove
half harness
#

or ctrl z

#

¯_(ツ)_/¯

viral grove
half harness
#

cut = ctrl x?

#

afk

viral grove
viral grove
half harness
viral grove
#

Yep. But for some reason, it doesn't get saved in my clipboard

half harness
#

interesting

gentle sparrow
gentle sparrow
#

Anyway I don’t think this is the place to argue about this. I probably won’t respond again

old wyvern
prisma wave
lavish notch
#

Is anyone aware of a way to get a specific name on bStats that is already claimed? - I want BungeeStaffList and the current claimed name has 0 stats and the Author appears inactive for over a year and a bit.

half harness
#

help

prisma wave
#

no

static zealot
half harness
#

i need a name for a module

basically im planning to have one (mc) server to be sorta like the "hub"
and a bunch for the other servers
the hub is where im going to make a websocket server that will communicate with the other servers
atm i only have 1 module - plugin which is for the other servers but obviously that won't work either..

#

🤔

obtuse gale
#

i need help

compact perchBOT
#

There is no time to wait! Ask your question @obtuse gale!

obtuse gale
#

@everyone

loud gyroBOT
#

The 'everyone' mention is disabled so you can't annoy people.

prisma wave
obtuse gale
#

I actually do

prisma wave
#

i disagree

obtuse gale
#

I do, I need to see a psychologist

prisma wave
#

No, I really don't think that's the case

ocean quartz
#

Yes you do, now go do it now!

obtuse gale
potent nest
#

hello

half harness
#
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException
    at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
    at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1908)
```anyone know how to fix this? I'm using CompletableFuture#get

lines 382 - 398 in `CompletableFuture` (won't be same as stacktrace prob because of different java versions): ```java
    private static Object reportGet(Object r)
        throws InterruptedException, ExecutionException {
        if (r == null) // by convention below, null means interrupted
            throw new InterruptedException();
        if (r instanceof AltResult) {
            Throwable x, cause;
            if ((x = ((AltResult)r).ex) == null)
                return null;
            if (x instanceof CancellationException)
                throw (CancellationException)x;
            if ((x instanceof CompletionException) &&
                (cause = x.getCause()) != null)
                x = cause;
            throw new ExecutionException(x);
        }
        return r;
    }
obtuse gale
#

fix what?

half harness
#

should i just.. try/catch NullPointerException 🥲

obtuse gale
#

there's like nothing in there that can throw an npe lmao

half harness
#

ik 😩

#

wait

#

wait

#

it says Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException

#

but

#

im confused

obtuse gale
#

yes, that means that the task ran in the cf threw an NPE

#

thus failing execution

half harness
#

but why doesn't it show a stacktrace of it

#

:(

obtuse gale
#

I mean you shared like 3 lines so idk

old wyvern
#

Post the entire stacktrace

half harness
#

then it just keeps repeating

obtuse gale
#

something something run with java 15+

ocean quartz
#

Something something 1.8 can't

#

Spongeextras Bukkitconsumer bigthonk

half harness
half harness
static zealot
#

Hmmm. So I have a string input that's made out of 0s and 1s. And you can basically replace the 1s and 0s with brackets. I need to tell if the string is a valid bracket sequence.

This would be valid sequences: 00100111, 100100
This would be invalid sequence 011001

first checks I made is for the string length to be even and then made sure that there's an even number of 0s and 1s. but how would I proceed from here? because it still doesnt count stuff like this one 0101 for example.

prisma wave
#

why is 011001 invalid?

#

oh, because there are 2 )'s?

#

ok

#

easy

#

use a stack

#

actually you dont even need a stack

half harness
#

im confused

prisma wave
#

literally just an int

half harness
#

why can't you just check if there are an even number of 1s

prisma wave
half harness
#

oh wait

prisma wave
#

theyre the same number but unbalanced

half harness
#

0 = (?

static zealot
#

no no

#

my bad

#

didn't explain it well

prisma wave
#

🥴

half harness
static zealot
#

00 = () 11 = () so basically 1 is open and close

#

0 is open and close

half harness
#

oh

static zealot
#

well actually 11 = []

prisma wave
#

that makes even less sense

static zealot
#

yeah yeah I know. I got like 30 questions on my assignment already written down. this teacher has no clue how to explain the homework lmao. he's like tell me if the answer is wrong or right and then tell me what does it mean to be wrong or right lmao

#

I think I'll just give up for now and ask the teacher monday

prisma wave
#

oh wait

half harness
#

Hmmm. So I have a string input that's made out of []s and ()s. I need to tell if the string is a valid bracket sequence.

This would be valid sequences: []([])(), ([])[]
This would be invalid sequence [()][(

first checks I made is for the string length to be even and then made sure that there's an even number of []s and ()s. but how would I proceed from here? because it still doesnt count stuff like this one [(]) for example.

#

can't you just check if they're both even?

static zealot
half harness
#

wait is 0101 valid or invalid?

static zealot
half harness
static zealot
#

the question

static zealot
#

yeah... as I said pretty bad teacher

prisma wave
#

so, let's just say 0 = (), 1 = []. is that ok?

half harness
#

aw cmon bm

prisma wave
#

this is easy i think

#

the hardest bit is understanding the question

half harness
#

☹️

prisma wave
#

yeah ik

static zealot
#

well that's the problem. we don't know. its just what I remember from the class. but it might not be that. I'll just ask the teacher.

prisma wave
#

i just wanna make sure that's right

half harness
#

oh

static zealot
#

I remember in class we did something similar where 1010 would be [(])

prisma wave
#

and the overall problem is checking if that bracket string is "balanced"

static zealot
#

this is just a mess overall. theres problems that just tell you to work on numbers and don't tell you what type of numbers. like it could be doubles, it could be integers, it could be unsigned integers. as I said I already have 30 questions about this homework to ask xD

prisma wave
#

woozy face

#

ok

#

well

#

you can probably do it with a stack, but if you don't know what the problem is then i sure don't

static zealot
#

oh also. one more thing lmao. can't use arrays or lists at all

#

like any collection at all

#

and the input can maybe be a string or just be 1 read line for each character. not even that is explained

prisma wave
#

ew

#

cringe

static zealot
#

yeah

#

like at least the other teachers just steal the questions from books and stuff

#

this guy makes the questions but its a mess

#

lmao. I have a teacher that basically told us shes learning with us bcz she has no idea what shes doing. apparently its her first year

#

thats uni in Romania for you

#

well school in general

prisma wave
#

fun

#

we had that too tbf

#

our latin teacher was just reading the textbook, a few weeks ahead of us lmao

static zealot
#

another teacher also works as a medic so she's never coming to class but she told us to be present every time otherwise ... she never told what happens if we dont go. but I never went xD

static zealot
#

like half of my teachers don't even know what they're doing,

#

its fun

prisma wave
#

🥶

#

are you paying to go to uni?

static zealot
#

got in one of the free spots bcz I had ok-ish grades

prisma wave
#

that's good ig

static zealot
#

well. didn't get in the free spots at first but the thing is, that free spots are distributed across all profiles and other profiles got no students at all so they redistributed those spots to us

static zealot
# prisma wave that's good ig

To be fair, the only reason I went to uni is the degree. I was aware that the school system here is fucked so didn't expect much than I currently get

#

@half harness what u doing?

half harness
#

coding & testing

static zealot
#

wanna take a break?

half harness
#

uhh

static zealot
#

xD

sweet cipher
#

Dkim they brackets / parenthesis just have to be next to each other?

static zealot
#

ask my teacher

#

well I'll ask him monday

half harness
#

lol

static zealot
#

and probably will come back to ask here after

sweet cipher
#

What's the question?

static zealot
#

dw about it master. its messed up. like most questions in this assignment. very unclear instructions

steel heart
half harness
#

xD

viral grove
#

If I distribute a lib under LGPL, does a person who shades my lib have to make their code LGPL as well?

#

Are there any benefits of using Github packages over Jitpack?

viral grove
half harness
#

iirc github packages require auth - which I still don't know how to setup so I just download the jar from libs that use github packages lol

#

and jitpack requires creating a new github release for each version

#

im pretty sure

#

and jitpack is limited

#

for simple libraries jitpack is fine though

#

since mvn central/hosting a maven repo for the first time is not easy

ocean quartz
half harness
#

wait

#

but wouldn't you need the commit id 🥲

#

wait are tags git or github?

ocean quartz
#

Yeah jitpack lists all commits there and you can choose one as the version

half harness
#

ah

viral grove
#

Is it worth submitting a small lib that (realistically) only I will use to Maven Central?

half harness
#

imo depends on how often you're going to update it

viral grove
#

True, will probably start on jitpack, then move to maven central if it gains enough mass

rotund finch
#

hi

cosmic raptor
#

I'm the owner of a minecraft-centric Discord bot. It doesn't currently have that many features (they're currently focused on skins), so which features would the mc community like to see?

humble silo
#

Roles by stats in servers like hypixel or something

cosmic raptor
#

Oh, good idea

worthy wren
#

is it possible to make a calendar claim daily plugin using deluxemenus?

near ember
#

I believe so, yes

worthy wren
near ember
#

Problem is, Its hard for me to explain but i can show you it. 🤣

worthy wren
near ember
#

Ummm, Cant really show you or send anything at the moment. Due to im really busy and Working on something for a client.

near ember
#

ummm maybe in like 1 or 2 hours.

#

or tomarrow

#

depends

gusty glen
#

how do I use Applicative with new version of Arrow KT (1.0)?

#

their docs say Option.applicative() but that doesn't exist

half harness
#

ooh kotlin 1.6 came out

#

i wonder what was added 👀

#

are the changelogs even out yet ;-;

#

sorry for ping #2 but @gusty glen do you know how to use exposed gradle plugin?
i at least want to try a bit more before using raw sql because i have 0 experience in sql 🥲 (yesterday was my first day of touching sql lol)

#

me = smol brain

#

and i remember u saying that the issue fixes (but rarely) with this plugin

#

but as far as i can see all it does is instead of configuring the db in the code it configures in build.gradle instead 🤔

gusty glen
half harness
#

what task do u run? or is it just shadowJar?

#

since i assume u need the exposedCodeGeneratorConfig for gradle generateExposedCode

#

but you don't have it

gusty glen
#

I stole grabbed this build gradle from the project I used Exposed, just shadowJar, just pay attention for the kotlinRelocate on the shadowJar task

half harness
#

whats the difference between kotlinRelocate and relocate? and am I supposed to relocate or kotlinRelocate kotlin? (since the line relocating kotlin is commented out for yours)

gusty glen
#

the other guy suggested using kotlinRelocate for all relocates in case you get this issue https://paste.helpch.at/okeroqiciw.md, but tbh I didn't even bother testing it, since it wasn't gonna work, probably

gusty glen
half harness
#

no idea what ASM is but im assuming it also relocates stuff in Exposed that shadowJar normally wouldn't?

gusty glen
#

yes it should

gusty glen
half harness
#

👀

#

its that simple?

gusty glen
#

haha, my secret method was exposed to the internet

half harness
#

🥲

#

nice pun xD

half harness
# half harness woah

i couldn't figure out how to do this so I just ended up going back to build.gradle

half harness
#

unable to resolve class com.jetbrains.exposed.gradle.plugin.shadowjar.kotlinRelocate

#

uhh

#

:/

#

secretx u have any idea?

#

🥺

gusty glen
#

did you add its gradle plugin?

half harness
#

yes

gusty glen
half harness
gusty glen
#

you're missing the very first line of the build.gradle I've send up there

#

you need to manually add that line in most cases

half harness
#

and com.jetbrains apparently didn't exist

gusty glen
#

It might only be compatible with KTS dkim

half harness
#

true

#

D:

#

convert to kts?

gusty glen
#

do you want to switch to KTS?

#

probably a good idea

half harness
#

welp this is going to be like the 3rd time xD

gusty glen
#

haha, at least now you have a working example of how to copy the jar and how to parse the resource placeholders

half harness
#

mhm fingerguns

gusty glen
#

also why do you delete your plugin.yml from the build folder?

half harness
#

just randomly stopped updating itself

#

and i didn't want to clean on every build

#

so

gusty glen
#

oooo I had that

half harness
#

👀

gusty glen
#

I know a better way of fixing that

half harness
#

how do i fix?

gusty glen
#

the second line of this snippet forces the update, so that bug never happens kt ​tasks.processResources { ​    outputs.upToDateWhen { ​false​ } ​    ​val​ main_class ​=​ ​"​${project.group}​.​${project.name.toLowerCase()}​.​${project.name}​" ​    expand(​"​name​"​ to project.name, ​"​version​"​ to project.version, ​"​mainClass​"​ to main_class) ​}

#

I need to studyyyy, ping me if you can't import kotlinRelocate, I'll be back to Anki

dawn pilot
#

is my this ok

#

idk i have compilin issues with macen

#

maven*

eternal compass
#

what issue?

dawn pilot
#

wait a second im runnin it showing the logs

#

uf

#

i cant upload anythin bruh

dawn pilot
eternal compass
#

?imgur

compact perchBOT
#
FAQ Answer:

You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/ to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.

eternal compass
#

oh wait

#

yeah

#

cool

#

don't send screenshots

#

of text

#

especially blurry ones

#

I can't read anything there

#

copy it and paste it here:

#

?paste

compact perchBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

half harness
# gusty glen It might only be compatible with KTS dkim

yep it imports now - but doesn't work :( ```
Can't relocate from org.jetbrains.exposed to me.dkim19375.coolplugin.libs.org.jetbrains.exposed as it clashes with another paths: org/jetbrains/exposed/
Caused by: java.lang.IllegalArgumentException: Can't relocate from org.jetbrains.exposed to me.dkim19375.coolplugin.libs.org.jetbrains.exposed as it clashes with another paths: org/jetbrains/exposed/

dawn pilot
#

@eternal compass

forest pecan
#

But it says it cant find it

eternal compass
forest pecan
#

Sure lmao

#

wait i think i found the issue

eternal compass
#

Please don't ping me. I'm busy atm

dawn pilot
#

ok

forest pecan
#

managed to fix the issue

gusty glen
static zealot
#

in c# Array#toString returns the type. this is fun

steel heart
#

Doesn’t it do that in Java also? Or well along with the memory address thingy

quaint isle
#

Hello turbo smart devs,
I'm taking a course called "Advanced Programming" at uni this year and the first two classes were tough. We had to solve problems from programming contests such as ICPC and I realised I'm super bad at this kinda stuff.
I plan to do some challenges from reddit every now and then and maybe participate in an event like advent of code.
Do you have any other tips on how I could get better at this kinda stuff?
(average smart devs may reply as well)

static zealot
ocean quartz
#

Don't you love JS?

static zealot
#

No. I do not.

old wyvern
#

I wonder what actually is going on there

obtuse gale
#

yo how can I get the name of an entity by String, im trying an dying inside, getName is also deprecated.

#

This is what i got so far
@EventHandler public void onPlayerHit(EntityDamageByEntityEvent e){ String ent = e.getEntity().getType().getName(); DEPRECATED e.getDamager().sendMessage(ent); TRYING TO FIGURE OUT WHAT getType() RETURNS boolean check = this.getConfig().getBoolean("entities."+ent+".check"); if (e.getDamager().getType() == EntityType.PLAYER && e.getEntity().equals(this.getConfig().getString("entities."+ent)) && check) { e.setCancelled(true); e.getDamager().sendMessage(Objects.requireNonNull(this.getConfig().getString("entities." + ent + ".message"))); } } }
Config
entities: villager: check: false message: "Non puoi uccidermi, smetti di colpirmi >("

#

I want the users to set as much entities they want from the config so I check in there with e.getEntity().equals(this.getConfig().getString("entities."+ent)) but getType does not return a string so I added getName

half harness
#

nope doesn't work

#

:(

#

looks like it didn't work for u either

#

🤔

lost edge
#

Hey, so I've been messing around with fake blocks using spigots sendBlockChange and I'm looking for a way to detect when a player clicks these fake blocks.

#

I've been able to disable right clicks to prevent them from going away but I need to do this only for the select blocks. Just really need the cords and maybe material. Is that possible with what I have? Just looking to be pointed in the right direction.

#
        getServer().getPluginManager().registerEvents(this, this);
        protocolManager = ProtocolLibrary.getProtocolManager();
        protocolManager.addPacketListener(
                new PacketAdapter(this, ListenerPriority.NORMAL,
                        PacketType.Play.Client.USE_ITEM) {
                    public void onPacketReceiving(PacketEvent event) {
                        Player p = event.getPlayer();
                        if (event.getPacketType() == PacketType.Play.Client.USE_ITEM) {
                            event.setCancelled(true);
                            i++;
                            p.sendMessage("Use Item event fired! " + i);
                        }
                    }

                });
ocean quartz
#

@old wyvern Yugiii my PR for SlimJar ugh

static zealot
#

Ben Dover

onyx loom
#

IMMATURE

static zealot
#

yes

half harness
#

yugi when slimjar on central or repo back up 🥺

half harness
#

btw

#

if i lose my key that i used for maven central

#

what happens

onyx loom
#

u die

brittle leaf
#

does anyone else start to work on a project and then end up procrastinating most of it and after a couple hours get very little done?

half harness
#

¯_(ツ)_/¯

static zealot
#

dkim is not a developer so don't mind him

brittle leaf
#

i started working on a plugin that was a replacement for the vanilla enchant table and now im trying to make a box system that stores all the items that could be lost from custom inventories cause i didnt want to just drop it on the floor

#

and then ended up rewriting half of it and now i have a project that wouldnt do anything cause i havent got it working yet

#

also i tried to organize my code and ended up making a bunch of little classes that do small tasks and just interwiring them together and now im stumped and bored and going back to watch youtube about game design

#

i have no clue how people come out of it with a viable project

#

quite happy that im not the only one

#

i might just scrap the box since its more trouble then its worth and ill come back to it another time

half harness
brittle leaf
#

i need to stop overcomplicating things

forest pecan
#

smh

eternal compass
#

;) ;)

forest pecan
static zealot
eternal compass
prisma wave
#

R /woosh

sweet cipher
forest pecan
half harness
forest pecan
brittle leaf
#

can you talk about server developement in this channel or is it just for coding related stuff?

half harness
brittle leaf
#

so would #minecraft be the place to talk about server development?

half harness
brittle leaf
#

its just cause i was in the planning stages of a server i wanted to make and those seem more plugin help sorta thing instead of actual design talk places

half harness
#

hmm

#

although most of the active members here code rather than manage a server

brittle leaf
#

i mainly wanted to brainstorm a couple ideas and make some sort of prototype just to see if i could do it rather then release publicly

#

because public servers are a bag of snakes that i dont want to get into really

#

i just wanna code some stuff and see where it goes

#

and also wanna look at nms and see what packets i can modify

#

also looking at the wiki.vg site gives alot of info on the packets but not much on how to actually go about manipulating them

brittle leaf
#

currently 1.17.1

half harness
obtuse gale
#

I mean wiki.vg is that, a wiki, info about the current minecraft "spec"

half harness
#

i just look at how packetwrapper does it and do it on my own 😌

half harness
#

or does someone decompile mc

obtuse gale
#

packet manipulation has nothing to do with the packet stream spec (so neither with wiki.vg), and how you achieve that also depends on the platform you use, it's not the same for bukkit than for fabric

obtuse gale
half harness
#

o

#

impressive

obtuse gale
#

very

half harness
#

especially before deobfuscation mappings were released

brittle leaf
#

because the spigot api atleast doesnt allow me to put any random itemstack on my head i wanted to figure out how to do that, and packets are the way to go it seems

half harness
#

wat

#

but

obtuse gale
#

I'm fairly certain you can do that lol

half harness
#

^

brittle leaf
#

i mean click on the slot

obtuse gale
#

inventoryclickevent not enough?

brittle leaf
#

inventoryclickevent doesnt fire when you take for instance a stone block and click your head slot

obtuse gale
#

hm

half harness
#

like place a stone on ur head slot?

brittle leaf
#

exactly

#

i want to do that.

half harness
#

what about if you put a helmet

#

into head slot

brittle leaf
#

it does

half harness
#

huhhhhhh

#

interesting

brittle leaf
#

helmets or player heads work

#

but no event is fired when i try to do that with any other items

#

it fires when i take it off but doesnt when i try to put it on

#

im going to figure out how to make a wrapper that console logs every packet that gets sent and received

obtuse gale
#

that's gonna get really spammy real fast

brittle leaf
#

yeah ik

#

i might just use the protocolLib api for packets

brittle leaf
#

ill just use ProtocolLib

half harness
#

its not that hard - protocollib PacketType has a thing that lets u get all incoming packets

#

just filter out the move packets and stuff

empty flint
#

I got bored and wanted to do some gui stuff. So I made a log file reader:

#

Wdy guys think? 🙂

dawn hinge
#

It looks pretty good

#

which language was that made on?

empty flint
#

Kotlin/TornadoFX which is a Kotlin Framework on top of JavaFX

dawn hinge
#

Aha! I'm also not sure if it's just me but it looks somewhat difficult to read stuff there since a lot of information are displayed within close reach

empty flint
#

I have no trouble reading it on my Screen, it looks different from what Discord shows in the screenshot though

#

perhaps I just got used to it, idk

sly sonnet
#

i believe it's just discord

reef maple
#

Hi there, I have several questions about loading/storing datas on database:
My plugin saves datas for each players connected on the server every 5 minutes from the player connexion but:

  • Isn't it better to save the data of all players connected at the exact same time ?

  • In that case, shall I keep the desync data save?

winter iron
#

I would save at 5 minute intervals based on server time rather than player connection time

#

it just makes coding it a bit simpler too

#

You can do batch updates then too

reef maple
#

That means I should save all players simultaneously ?

oak coyote
#

If it’s async yeah

#

You will just idle out that separate thread for a bit but otherwise no issues really ever occur

#

Make sure to make your onDisable a main thread save

reef maple
#

Ok I use async by default, I should add it sync on onDisable

prisma wave
#

Yes

#

You need it to block onDisable

#

CompletableFutures are nice here

#

You can have it async by default or force it to block when you need

reef maple
#

Ok thanks !

static zealot
#

oh @half harness btw. the 1 and 0 problem turned out to be just 0 = ( and 1 = ) lmao ...

gusty glen
#

Kotlin 1.6.0 just released (10 hours ago)!

static zealot
#

cool

obtuse gale
frail glade
#

Just saw that.

#

Just updated one of my projects to it and my jar size went up over 1MB and then I realized my old jar was minimized and I forgot to minimize the new one. Got scared for a second.

compact perchBOT
#
Hey, I'm Barry!

I'm a unique Discord bot created especially for HelpChat.

Authors:

I was created and I'm maintained by @pallid gale with support from the Staff team.

Code base:

I'm created in Javascript using Discord.JS

Source code:

At this stage I'm closed source due being a mess and some secret internals. However you can contribute to my links/version knowledge here.

static zealot
remote goblet
#

intellij no like kotlin 1.6.0

#

and discord doesn't like sending messages

#

this is fun

#

oh now you send

viral grove
#

Kotlin 1.5.31 and earlier had issues with kapt when using Java 16 or later. Kotlin 1.6.0 was supposed to fix it. Haven't tested though

static zealot
#

oh did they say they'll fix it in kotlin 1.6.0? I didnt know

#

oh wait nvm... I Knew that lmao

#

I had to use the release candidate for Krypton lmao

static zealot
#

yeah. its fixed. it was fixed in the release candidate as well

prisma wave
ocean quartz
#

Dw they think they are the cool kids

obtuse gale
prisma wave
forest pecan
prisma wave
#

based

forest pecan
prisma wave
#

no

#

I cannot

forest pecan
#

Wow

#

so bad

viral grove
static zealot
shy tartan
#

can someone help me? I got a new extended storage devise for my computer and I have set it up and it appears on my files and it works as I have tried installing a game on it but there is an application I'm trying to download on there but it download on my normal storage which is full and cant download it is there any way to make it to download it on the extended storage device?

half harness
shy tartan
#

adobe premiere pro

half harness
#

are you setting the correct drive in the installer?

shy tartan
#

yes

#

I put the place to install as my extended storage but it keeps trying to install on my normal storage space

prisma wave
#

im afraid not

steel heart
#

:objectively-no-kotlin:

tranquil crane
#

is there no actual way to modify a final field past java 12 without adding extra commandline parameters?

forest pecan
#

it gets inlined iirc

tranquil crane
#

it isn't static

#

trying to replace the spawner field specifically

forest pecan
#

i meant no, as in there is no possible way

#

sry i was confusing lmao

steel heart
#

I don’t know if reflectively setting the field’s value would overwrite it, but if not then I guess good ol’ Unsafe

tranquil crane
#

I'm currently trying unsafe to see, using reflection was a no-go

#

I believe it's only static final fields that get inlined

forest pecan
#

Yeah nvm my life is a like lmfao. i just realized that is an anonymous class

tranquil crane
#

yeah it would be real hard for that class to get inlined lol

forest pecan
#

i originally thought of unsafe but i didnt know if it'd work

tranquil crane
#

well we're about to find out

forest pecan
#

but if you find a way can you tell me how to do it

#

lol

tranquil crane
#

I will yeah

#

hm I couldn't even access Unsafe

#

java.lang.IllegalAccessError: class dev.rosewood.rosestacker.nms.v1_17_R1.NMSHandlerImpl (in unnamed module @0x3ee60427) cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @0x3ee60427

forest pecan
#

what code are you using

#

to get Unsafe?

tranquil crane
#
Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe");
unsafeField.setAccessible(true);
unsafe = (Unsafe) unsafeField.get(null);
#

It doesn't look like it was the reflection that failed but simply trying to use the Unsafe class

#

that was with the jdk.internal.misc.Unsafe class, I'll try the sun.misc.Unsafe one and see if that's any different

forest pecan
#

Yeah try the other one

tranquil crane
#

oh my god it worked

forest pecan
#

Yeah i read a post online regarding it

#

cause one is exposed

#

but the jdk internal one isnt

tranquil crane
#

particles were just a placeholder to see if it would work, answer is yes Dab

forest pecan
#

can you show the code lmfao

tranquil crane
#

I'll get you the code one sec

#

yeah

forest pecan
#

Kk ty

half harness
tranquil crane
#

primitives and strings I believe

forest pecan
tranquil crane
#
Field field_SpawnerBlockEntity_spawner = ReflectionUtils.getFieldByPositionAndType(SpawnerBlockEntity.class, 0, BaseSpawner.class);
Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe");
unsafeField.setAccessible(true);
Unsafe unsafe = (Unsafe) unsafeField.get(null);
long offset = unsafe.objectFieldOffset(field_SpawnerBlockEntity_spawner);
unsafe.putObject(spawnerBlockEntity, offset, new StackedSpawnerTileImpl(stackedSpawner));
half harness
#

|| naming conventions 🙃 ||

forest pecan
#

i was gonna say too

#

lmfao

tranquil crane
#

I purposely name my reflection variables terribly like that so I can actually read them

forest pecan
#

and also just cache unsafe ig in general if u havent done it

tranquil crane
#

yeah it is cached I just put it all together there for you

forest pecan
#

mhm thx

half harness
#

cache getDeclaredField too

#

(if you haven't already)

tranquil crane
#

complain about my reflection variable names all you want lmao

half harness
#

💀

tranquil crane
#

that reflectionutils thing is because I use mojang mappings so the fields end up having different names during runtime

#

can't be bothered trying to switch between the two so I just look up fields based on type and position

ocean quartz
#

Huh interesting someone forked my lib and committed "changed reflection naming to be more readable" and they also named the variables like that thonking

tranquil crane
#

I just came up with that naming style on my own, who made that commit lol

ocean quartz
#

A dude called "evernife"

tranquil crane
#

that is kinda similar

ocean quartz
#

Yeah not exactly the same

#

Also theirs are very inconcistent xD

tranquil crane
#

mine goes reflectionType_className_fieldName

#

reflectionType being field/method

#

I do it purely for readability even though I know it goes against conventions

#

anyway glad I can do this with unsafe at least for java 16, going to hope 17 also works since 1.18 is using java 17 confirmed now

forest pecan
#

poggers

ocean quartz
tranquil crane
#

Discord mobile is nearly unusable on android right now

#

ever since a couple months ago performance has just plummeted

ocean quartz
#

It has been fine for me, but yeah it's always buggy

humble silo
tranquil crane
#

do you use a phone made within the past 2 years

#

I use an LG G7 ThinQ and it's so incredibly painful to use discord

#

going to be getting a new phone at the end of the month though so hopefully it'll be better after that sweat_eo

humble silo
tranquil crane
#

hhh both my phone and tablet can hardly run discord

#

I blame my hardware

ocean quartz
#

I blame discord ugh

humble silo
#

lol fun

#

Ive like never updated any apps on it, so i could also just have an outdated version of discord

#

idk

ocean quartz
#

That is definitey possible, one of the versions did make it worse

steel heart
half harness
#

DkimCord™️

half harness
#

😎

steel heart
#

That’s pretty pog ngl

#

🍉

half harness
#

😋

#

any suggestions? (mostly towards design)

humble silo
forest pecan
#

now make discord v2

half harness
#

jetbrains

#

=

oak cypressBOT
#

@half harness, Help menu!

half harness
#

best

humble silo
half harness
#

ok barry

forest pecan
#

=

oak cypressBOT
#

@forest pecan, Help menu!

humble silo
half harness
#

for kotlin native

steel heart
ocean quartz
#

Dkim making Discord 2?

humble silo
#

=

oak cypressBOT
#

@humble silo, Help menu!

humble silo
#

=

oak cypressBOT
#

@humble silo, Help menu!

humble silo
#

messages pls send

half harness
humble silo
#

omg

#

messages

#

SEND

steel heart
#

Lol

ocean quartz
forest pecan
#

Lmao

#

mf-discord

humble silo
forest pecan
#

you know i always wonder why

#

you chose mf

#

like

humble silo
#

=

steel heart
oak cypressBOT
#

@humble silo, Help menu!

forest pecan
#

motherfucker

#

lol

humble silo
#

shut

half harness
steel heart
#

=

oak cypressBOT
#

@steel heart, Help menu!

half harness
steel heart
#

😫

half harness
steel heart
#

Wth

ocean quartz
#

Done

half harness
#

😠

humble silo
#

lol

forest pecan
#

smh dkim

steel heart
#

Lmao

half harness
steel heart
#

Dkim cancelled

ocean quartz
#

People on the main project watching the github logs like whatthe

half harness
#

xD

#

oh u deleted the repo

#

☹️

steel heart
#

lul

forest pecan
#

it says page not found now

#

😡

ocean quartz
#

Yeah i deleted it xD

forest pecan
#

I type rage

#

and i get

#

🔞

#

unde😡

steel heart
#

Pulse I always forget how old you’re

#

But must be like 13 now or something

half harness
#

👀

steel heart
#

Last time I checked you were 12 hahayes

ocean quartz
#

Pulse is a baby

steel heart
#

Yeah lol

forest pecan
#

Im not a baby

#

conclure is

#

Conclure is underage guaranteed

ocean quartz
#

Both are 😔

forest pecan
#

Nope only Conclure

#

conclure is kotlin karen

#

=

oak cypressBOT
#

@forest pecan, Help menu!

forest pecan
#

underage

#

Fuck

steel heart
#

Kotlin Karen lol

forest pecan
#

Yep

#

das u

steel heart
#

I guess gradle kotlin dsl kinda hits the vibe

forest pecan
#

:kotlin:

#

Uh oh

#

I use that too

#

Nah lets flip that over

steel heart
#

So you’re one also suspiciouseyes

#

Lol

forest pecan
#

people who use groovy gradle

#

= underage

#

@half harness

half harness
#

i use kts

forest pecan
#

Hmmmm

half harness
#

since a couple days ago

#

thanks to secretx

ocean quartz
#

Dkim is fluid, one day it's one the other it's other

half harness
#

🥰

forest pecan
#

So you just hit puberty?

#

damn

#

congrats

steel heart
#

lol

half harness
#

👀

forest pecan
#

You got some baby hairs growing

half harness
#

👶

#

🚼 🧑‍🦱

forest pecan
#

🪑

steel heart
#

🍼

half harness
forest pecan
#

Nevermind

#

he didnt hit puberty

#

yet

half harness
#

🥲

forest pecan
#

hes still a toddler

#

👶

#

👨‍🍼

half harness
#

man

forest pecan
#

Ur mom

ocean quartz
#

One only becomes a true adult when they contribute to the jdk

forest pecan
#

If you contribute to the jdk arent you officially part of the shit show

#

Lol

obtuse gale
ocean quartz
#

Emily!

half harness
#

stars 😌

#

i dont get why people dont like them

ocean quartz
#

Same tbh, i don't want adulthood

obtuse gale
half harness
ocean quartz
#

Wildcard imports visibledisgust

forest pecan
#

eww

steel heart
#

less lines = faster code pepestonks

obtuse gale
#
  1. They slow down compile time, and it's not precisely negligible
  2. Like it or not, you're gonna have ambiguities
  3. They suck, get over it
forest pecan
#

do you know what else you can suck

obtuse gale
#

sucl

forest pecan
#

Sucl

half harness
#

SUcl

ocean quartz
#

import *

obtuse gale
#

You could consider that to be the case already, since you don't have to declare imports for classes in the default/"unnamed" package 👀

ocean quartz
#

Maybe, or it imports every possible class from every possible library in existence and causes a blackhole

obtuse gale
#

God I wish

#

Make it start in my room please

ocean quartz
#

It probably wouldn't have enough energy and would just disappear ugh

obtuse gale
#

sad

ocean quartz
obtuse gale
#

I don't remember using any features exclusive from ultimate edition, my workflow was the exact same when I got it, been the exact same when it expired

ocean quartz
#

Only thing i really use is the database integration

obtuse gale
#

I did try using it once

#

It was, meh idk

#

I used it once for a reason lmao

#

The only thing that achieved mostly was "data source not present" "errors" all over the place lmao

half harness
#

is netty a type of websocket?

#

idk what socket type to use for a server

obtuse gale
#

Netty is an asynchronous event-driven network application framework
for rapid development of maintainable high performance protocol servers & clients.

half harness
#

o

obtuse gale
#

Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. It greatly simplifies and streamlines network programming such as TCP and UDP socket server

half harness
ocean quartz
#

CIO

#

Doesn't really matter though, the end result is basically the same

sick belfry
half harness
#

🥲

obtuse gale
#

:Star:

#

:Star: :Star: :Star: :Star: :Star: :Star: :Star:

half harness
obtuse gale
#

:Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning:

sick belfry
obtuse gale
#

:Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning: :Warning:

sick belfry
obtuse gale
#

:Warning:

humble silo
#

smh @compact perch do a better job moderating

ocean quartz
#

Barry is the victim here

old wyvern
static zealot
#

lmao

old wyvern
#

I have no idea whats going on

#

Its just the default textfield

static zealot
#

Idk. I'm more attracted by that keyboard sound rn

old wyvern
#

oh theres sound?

#

oh

static zealot
#

yes

old wyvern
#

xD

#

I had my speakers on mute, didnt notice

distant sun
#

Lmao

old wyvern
#

Ok I guess time to fallback to swing for the textbox

prisma wave
#

😷

old wyvern
#

😷

old wyvern
steel heart
#
fun includeProjects(vararg names: String) {
    names.map {
        include(it)
        return@map it
    }.forEach {
        sanitizeSubProject(it)
    }
}

Does there exist a cleaner way of doing this? Yeuhah I'm new to kotlin lol

old wyvern
#
fun includeProjects(vararg names: String) = names.onEach(::include).forEach(::sanitizeSubProject)
#

@steel heart

steel heart
#

oo thanks

static zealot
#

oh. 1.18 will require java 17. cool

onyx loom
#

W

sly sonnet
sly sonnet
#

how can i add my public ip on oracle cloud to my vm?

#

it appears that the machine doesnt have it

boreal needle
#

@quiet depot how do i add my own javadocs to a docdex instance?

#

everything in the config looks predefined

boreal needle
#

ah so the api and bot are separate?

#

that's rather confusing

distant sun
#

Dont you just add the javadoc jars on a folder and they will be loaded or whatever?

sick belfry
#

oh wait not that

#

now that

static zealot
sick belfry
#

dunno how its said lol

static zealot