#dev-general
1 messages · Page 552 of 1
Ah whoops wrong channel
Oh bungeeguard
Thought I was in #general-plugins my b
do add a bungee server I need to restart the whole network, right?
nah. just the bungee
....
welp that still kicks everyone
soo xD yeah
thought you meant like restart every single sub server
👍
public Future<ResultSet> query(String query, CheckedConsumer<PreparedStatement> initializer) {
return Future.of(() -> Try.withResources(dataSource::getConnection)
.of(con -> con.prepareStatement(query))
.andThenTry(initializer)
.mapTry(PreparedStatement::executeQuery)
.get());
}
``` this might be the coolest library ever
that's a full sql wrapper with no try/catches needed in 5 lines
what about closing the resources? Seems like you need to handle that on your own
Try.withResources seems to do that for me
and closing a connection also closes any resultsets iirc
although i might be wrong
we'll see once i get it working
ah yeah might work, depending on how the future deals with it
What are the advantages with git bash?
Well cmd lol
oh
well
it's bash
it's about as close as you can get to a linux shell without installing WSL
hmm
Wait buildtools doesn't also build craftbukkit after 1.13?
It only builds spigot jar
Why in the actual fuck would you want craftbukkit

NMS?
import spigot not spigot-api
from maven local
Why would you have multiple build.gradle files :what:
you can use the apply if you wanna import a.gradle into b.gradle
build.gradle is one name
you can't have two build.gradle files in one directory
so you need to clarify
Yeah mb, I mean two .gradle files
To build the jar
I'm more confused now
wat
what
nvm
has nobody ever heard of a multi module build before or something
though I'm not sure if that's even what he was talking about
Definitely not
Lmfao
I can be hopeful at least
i use ant, wat u talkin about
I use spider
lol
Oh no
I need to setup Emacs with wakatime
Then I can get everything that isn't java on the graph
🤣
hopefully we'll see Oak on the graph
How about poseidon 3500XR
🥲
that post is made for you dkim xD
-_-
interesting
hmmmmmmm
yes
u b u n t u
u t n u b u ?
Am I the only one who forks repos just to save them in case the original repo might get yeeted lol
Can someone give me a like really quick explanation of the different dependency types? Like compileOnly and implementation etc.
myes
compileOnly means you only have it on your compile classpath
thus you also imply that the dependency is already provided at runtime
for instance placeholderapi
its fully loaded when a server runs
you never load it
So the dependency can only be used on startup?
so you only need it at compile time
no
uh
im terrible at explaining this
tried 3 times before lol
Nono you're doing good, I think lol
ye
it doesnt get loaded automatically or well, not by anyone else (kinda)
and that means we should have implementation for it
because it will most likely be us who provide it at runtime
if you use shadowJar, it will get shaded (as well as added into your jar when building one)
wait so you're talking about implementation now?
yes
Alright
I edited
yup
hmm okay
I can see how they work, but not what difference it makes
Like when the server runs
What the difference then is
then we have runtimeOnly, compileOnlyApi, api and some others which you in theory dont have to concern about for now
they dont make any difference in ide
because they're both added to the compile classpath
its how and who's providing them which makes the difference
or maybe not how
but yeah
How does it make a difference though, they both still work when the server is running?
Not necessarily
yes BM take it from here
if you compileOnly some external library you'll get a ClassNotFoundException
I suck at explaining this officially
like, I can't just pull the classes for that library out of nowhere
But that's what repositories are for, no?
No idea lol
well no it doesn't
If you have some jar then the only stuff in that jar is gonna be the stuff in the jar
Gradle is a build time tool, it changes nothing about your program at runtime
runtime being when the server is running right?
Dependencies are needed in two different places. When you use some.library.Class in your code, first the compiler needs to know this class in order to validate that you're using it correctly. That's a compile time dependency.
In 99% of situations, when you use a class in your source code it is also needed when the program is executed. That would be a runtime dependency. Now, runtime dependencies are loaded dynamically through the classpath system, meaning you don't have to put literally every class you use in your jar. For example, the standard library is always in the classpath. Or if you're working in the Spigot environment, the Spigot server and API are also already in the classpath.
You use compileOnly for dependencies that are already in the classpath at runtime, implementation for dependencies that are not
Yes
Or more generally, whenever any program is running
Not necessarily a server and / or plugin
Then there's runtimeOnly.. we don't talk about that one here lol
Ahhhh thank you very much for taking your time to explain this
So how do I know which are in the classpath at runtime? lol
well, you need to know what your environment will be
And what you expect to be there
If you're writing a plain java application, nothing except the standard library should be expected to be present
it's pretty much common sense
for a plugin yeah
And also other plugins sometimes
kinda
I'm not sure if they're literally on the classpath or spigot makes it work somehow
Hmm alright
I'm asking this because I'm trying to migrate an old project from maven to gradle
But I can't get the dependencies to work
Not even the Spigot one
well that's a whole other issue
"it doesn't work" isn't really enough information for us to be able to diagnose the issue and suggest a solution
Is the project registered as a gradle project?
No, I need to change that
But not sure how
Well I got this menu
So maybe it is?
C:\Users\Valdemar\IdeaProjects\fncore>gradle build_vald
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all dependencies for configuration ':compileClasspath'.
> Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'MVdW Public Repositories(http://repo.mvdw-software.be/content/groups/public/)' to redirect to a secure protocol (like
HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.1/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more det
ails.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
1 actionable task: 1 executed
Didnt fix
Should we move to #development BM?
probably
that error kinda says the issue though
Switch Maven repository 'MVdW Public Repositories(http://repo.mvdw-software.be/content/groups/public/)' to redirect to a secure protocol (like HTTPS)
http 🥴
So that repository is not working in gradle?
just change http to https
there's no such thing as a gradle repository
it uses maven formats
why does java not have the walrus operator
the what now
:=
😌
im genuinely confused how java missed to add it
What would java do with it?
why not
why not what?
Not neccessarily
This has nothing to do with less line anyway
how dare you contradict my theroem
yeah the less lines was a joke but I mean why would you have it then?
I wouldnt particularly care if they added it
oh right
exactly
okay if its unnecessary why does a language like py have it
1-2 languages having it does not make it useful everywhere
well what does it do in python
true
other than assignment
basically assignment within expressions
wdym?
x= 1
print(x)
is equivalent to
print(x:=1)
sorta
You already have that
ye in python
in java too
:=
int a;
System.out.println(a=5);
also that's a terrible feature imo and you shouldn't add it even if it didn't exist
yes but that would declare the variable above
so you want System.out.println(int a := 5)?
Whats the point of that
that's evil
lol
Like how would you even scope it
wow what a great feature
😌
no one would ever use it
okay but why does some languages have it?
how about something like ```hs
let a = 5 in print a
Again
Some languages having something
Java's assignments are already expressions...
yeah right, is it useful in python, maybe asking this to bm since he kinda likes py
"Oh js has some cursed coersions! Why doesnt java have that!"
it's a nice bit of syntax sugar but it's not game-changing
🥲
again it's useless, it doesn't add anything and makes code more confusing honestly
lol
if some_var := some_function():
print(some_var.blah())
there's no real equivalent to that in java
but yes
as johnny said
so arguably I should avoid using it even when its available in the language?
It seems that the website doesn't even have https, so can't use it in gradle I guess?
https://img.bristermitten.me/screen_2021-07-24_22-54-45_lhKU.png seems like it does
that's...
not same
a different url
lol
lmao
seems unlikely
Classic mvedwe guy
did he die btw? Ik there was some rumors about that
oh nvm then
I aint lying lol
compare the 2 urls
ah that answers it lol sorry if im being a bit rude now
yeye got it working now
nah nah
Also removing the "/s/" didnt fix it
are you sure about that
But with .com it works
yes
which is the one i had
Yup, the one you sent is working
but uh yeah Valdemar there's a lot of outdated plugin wikis and shit on spigot
Just not the http one that was on the plugin site
Yeah this plugin doesnt update anymore...
mvdw bad
If it doesnt suppourt ssl you're just get a warning on the top left, not some error page
in the certificates toolbar
mvdw papi < papi 😄
hapi!
🥲
lol
hpapi
hlaceholders hay pee aye
oh this is cool https://hoogle.haskell.org/
hoogle 😌
hoogle > google
lol true
!!
heypapi
Someone is clearly too rich
lmao
LOL that guy has to be joking
kek ye
uhh @proven hearth if someone actually wants you to pay them $50.. unless you don't care about money that can be coded in like 1 minute xD
just saying in case ur not joking :)))
lol
oof
you're awesome
Heyo. Is there a way if the whole bungee network goes down, I can have a separate server as a fallback server if the whole network goes down?
Like a backup server
Pretty much
Like if I need to restart the proxy, there would be a server players can get sent to that will be unaffected by the proxy restart.
no
the players are connected to the proxy, and so would need to reconnect to a different proxy
also, Velocity on top :p

thinking about Velocity, I actually spent a bit of time the other day extending Steinborn's super fast var int writing method to 10-bit var longs lol
https://paste.lucyy.me/gaxesuholi#kotlin this was the result 🥲
Lucy's Pretty Pastebin
say goodbye to your ability to sleep at night
implying i had any left lulw
James!!!!

kek
I'm trying to start on world generation rn in Krypton lol
werent you doing world generation like months ago
all these octaves and amplitudes and scales and randoms and lowest frequency value & input factors are making me go crazy lol
luckily, I have vanilla as a reference
Myes the half line code
no way lol
James I await an update for terrible plugin!
oh yeah, that reminds me: on request, I also made that in to a one-liner that I posted in the Velocity Discord, lemme see if I can find it lol
(it was a joke request btw, I was just bored)
there are currently no pull requests
i would love some new contributions
i even set up a jenkins job for it lmao
Oh nice effort

Holy cow
if you could still sleep at night before that, you definitely can't now
I understand 1% of that code
wait kt has a and keyword?!
yes, it's the same as &
and or?
It got all the good stuff
well, not a keyword, it's an infix function
it used to be a keyword before infix functions existed
wait wat
back in the early days, before I started using it lol
What’s an infix function, educate me bbg!
function without the . and ()
Oh
its a function that is infix
Hmm right no arguments then?
one argument
Oh I’m dumb
so ```kotlin
infix fun Int.plus(other: Int) = this + other
// Without infix
1.plus(2)
// With infix
1 plus 2
yea that
just looks a bit cleaner in some cases
it runs 25% faster because there are no . or ()

looks very groovy-ish to me :MonikaPeek:
so you don't end up with ```
(((3.and(7).or(5)).shl(7).shr(42)).xor(Int.MAX_VALUE))
i think that looks nice
of course
Kotlin is literally the Yatopia of programming languages, but if Yatopia was actually good
wdym?
they steal most of their stuff from other languages, improve on the syntax, and put it all in one place
oh
for example, extension functions are from C#
yes
😮
I believe there are some Rust-inspired things in Kotlin as well
like what
public string append(this string val, int arg1) {
return val + arg1;
}
```not the greatest example, but iirc that's the syntax
string 🥴
idk, I heard it somewhere
I can't really think of anything
head empty
And Scala too, although scala's implementation is much weirder
Scala just has weird syntax overall imo
Didn't kotlin come before rust?
actually, probably
Rust didn't seem to get relevant until a few years ago
neither did Kotlin
well, actually, it was like 2017 when they had stable release iirc
kotlin 1.0 released sometime in 2015 iirc?
2015 sounds about right
yeah sounds about right actually
Possibly 2014
2017 was when Google announced first-class support in Android, which is when it blew up
what
The emoji
y...yes...?
Ok thank you life savior honorable functional programmer
😌
lol
Rust has a bit of a history actually
but it changed quite dramatically in its early years
rust has always existed, just as an idea. Like america, it was always a holy land, just out of reach from most
the rustacean dream
https://www.spigotmc.org/resources/advanced-cheat-blocker.94084/reviews#review-411057-901405 your daily spigot community at your services
Rust is a higher power. It is the higher power
which comment are we looking at? Jxyy's or superdominic's?
also, I can see we have another Spigot plugin "developer" who can't code to save his fucking life, what a surprise
https://i.imgur.com/QRT67c5.png oh yes, because Git is just there to look good
lmao
Jxyy
He went on rampage after he found out the terrible truth his plugin was badly coded sorta
lol
is he just talking out of his ass then?
also, I learnt something new today
I learnt that java.util.Random uses a linear congruental algorithm for pseudorandom number generation
ThreadLocalRandom is just a java.util.Random that's local to a specific thread, so yes, and splittable random, maybe, probably a faster version though if it does
also, https://paste.helpch.at/qakasazonu.cpp kill me pls

weeb
proof?
Yes
No
Uh wait
I don't remember anything
I have a screenshot
yes
No you don't
what you gonna do? hack his PC and delete it? lol
Guys someone who's used jetbrains academy, #development
how could I delete something that doesn't exist?
ThreadLocalSplittableRandom when 🌚
https://github.com/SRombauts/SimplexNoise/blob/master/references/SimplexNoise.java jfc this is messy
Most readable java code
I have a screenshot too lmao
I knew this would happen!
No you don't
I do not have a screenshot.
Correct
Lmao
😳
Caught in 4k
Damn they've got the edgy font and everything
wow you guys all talk here this server is like at the bottom of my server list
@prisma wave you're not gonna like this
move it up
What do you think you're doing here!!
nerd
@BM Explain Yourself
It's not the same brister mitten
nitro happened smh
I'm not sure what you're talking about
lies
LOL OH yeaaaaaaaaaa Weeeeb mitten
a fake and a fraud
Come back when you've got actual proof ☺️
wait wait I can prove its from a long time ago
since thats the old profile design
before banners
and stuff
🦿
admit it, you're a weeb at heart
👨🏫
I'm the only sane one left ;-;
👩🎨
🤣
please stop spamming.
I wasn't
oh ok 😁
I get it
If u aren't careful I will go back to the java bad kotlin good phase
Don't be careful plz
uh oh
:))
everyone shut up
Cringe
😈
Monad Mitten 😌
It’s cringe to say cringe
awe right as he goes offline
who?
sirsquare
I do not not not caren't
Oh my
No lol
Lmao bitch phone has got some nerve
go to bed
will be in your dreams (:
@prisma wave have nightmares 






Indeed
Altho JS can be nice for short stuff
And when you aren’t doing something particularly large that is
I'd say anything console.log('loaded') and below is fine for JS, agreed
private void levelUp(User user) {
user.setLevel(user.getLevel() + 1);
Option.of(xpConfig.get().levelUpSound())
.peek(levelUpSound ->
user.getPlayer()
.peek(player ->
player.playSound(player.getLocation(), levelUpSound, 1f, 1f)));
}
vavr is my favourite library ever
literally looking like desugared haskell over here
that looks like what would happen if someone tried to port arrow to Java
Jesus
it's hot isn't it
im still really sad about my bar
Nice stairs
lol ye
Question, is possible to show a "virtual" entity to a player and make it have gravity then despawn it after a few seconds? Like, to simulate a mob that was spawned from a spawner that is placed in air (and obvious it is affected by gravity)
packets?
Yea should be
Hello
Hi
i need help
There is no time to wait! Ask your question @obtuse gale!
Try 999
No not like that
A discord account?
69420
Use your own phone?
Use your own phone?
Wait. For. Your. Parents.
From their number i m already banned
don,y have one
Then dont bother
ask your grandpappy
😦
why not?
Probably very young
Died 😭
Yeah not sure we can assist with getting around a ban :/
That was a fun interaction lol
Stupid ass. Why did you not provide link? Now you're stuck with the same problem. Dumbass
yo like a file called access.txt or something appeared on my desktop, it had like a login a website and a password or something, i deleted the file in the recycle bin
ok
good for you 🙂
e
f?
hilarious pfp btw lol
thanks lol
@cinder flare u around?
I've seen you work on the essentials expansion to add the baltop feature. Do you have a build or anything for it?
the code on your github as well?
so I can see the placeholders
nope its not. ty tho.
no just a little local boi
guess I could make a branch on the essentials expansion page
yeah u could. but its fine. I just want to test something that's all. welp when I get a bit of time
you could also put it in #placeholder-api btw when you want. and just ping me to pin. like lleave a message saying it will only work with 2.19 builds and its a test build as well.
oh yeah I mean bet
alright. pinned. can u maybe move the placeholder list to the same message?
so when they read pinned it actually explain what it is?
oh I was just showing you that
you can do a big consolidated announcement if you want lol
cleanup my formatting and all
@old wyvern separate version for the maven plugin?
yea
Im thinking of separating the repos
some people seem to be confused by the different versioning
👍 👍
does slimjar have a discord
Yes, it's HelpChat ;p
lol fair
😌
Matt u making IJ plugins by any chance? XD
matt monopoly!
I did work on one once, why?
mf-ij
any chance you can make one that just generates a .gitignore file with .gradle, build and all that by default? xD
when you crate a new project
and this is how a conversation between me and HELLSHOWERS aka Terfs aka Adam aka LagClear goes.
Intellij already has that blitz
oh?
yep
name please?
Its built-in
oh shit posted in wrong channel 
cry
oh wait what? how? please gimme me link or something.
one sec, lemme open up ij so I can find exact where it was
Its somewhere in the right click menu in the heirarchy
Yeah pretty sure IJ does it
If not, just use https://www.toptal.com/developers/gitignore
ty ty ty
right click a directory -> new -> .ignore file -> git ignore
Then select the idea template, java template and gradle template
k. ty. will try a bit later. ty ty ty
ugh
right click a directory? what directory? bcz I can't find .ignore file
anywhere under New
oh
you need the .ignore plugin lmao
@quiet depot hi pig guice expert, how do you like to handle registering listeners with guice? like, no other class depends on them, but they still need to be instantiated. i was thinking about binding them all as eager singletons, unless you have a better idea?
That comes with ij?
Are you on community edition?
oh yeah
Yea that might be why
Im pretty sure it comes with ultimate atleast
Because it was always there for me
never manually installed it
Registrable
[Service] Discord Bot Developer
[Request] Virtual stocks creator (stock market game to convert to money in minecraft)
[Description] Thats all!
what's the point of a description if he's not going to put any description
you figure out everything about how it works on your own and just make it happen
thats not the clients job idiot /s
that hit
oh uetf
Yea
16 in germany
For Germany it’s like 16
he was only 15
Yeah
🥲
its only a handful of countries that have difference age laws tho, like most of the world will use 13 as the minimum age
ah
then u'd be banned?
you're 15?
I’m AMERIXAN
lol
Visit efe and join the banned gang
Nop
trumph-flag
blitz you owe me one!
what?
add to deluxemenus or ban
why do I owe u one?
I really suck at this stuff, can someone help me change my server from 1.17 to 1.13?
wh- why would you do that
oh my god
someone that isn't us posted a kotlin meme
it's actually pretty funny as well
lmfao
lmao
Wait what. 118 members?
Lmao. Reddit requires you to type in passeord to be able to disconnect
From their mobile app
Password*
Ic the community js growing and improving xD
i scan for classes extending listener, get an instance via injector#getInstance, and then register the instance
no point making them singletons as the instance will never be accessed again via guice, by you
ah so yeah classpath scanning
I'm not sure I can be bothered to set that up just for a single thing
eager singleton seems to work
So minecraft sends the map-image via a byte[], with the size of 128*128, right
Does anyone know how i convert color to a byte / get the closest matching byte for a given Color
You have to use dithering algorithms
there are many types of algorithms out there, like floyd steinberg dithering, filter lite
choose one, apply it to the pixels of an image
etc
i have some examples
yeah i get that there are limited colors, and dither would add "fake" color depth
but my problem starts sooner
What about it
i have trouble converting even those colors that can be displayed in a single pixel
I have a R, a G, and a B value
Yes
and i somehow need to create a value between 0 and 255 from that, right?
Uhh
what does that mean
you talking about combining it to an integer?
all rgb colors
what "value" are you creating here
Yea?
every pixel, is a byte
Mhm
i have the R G B value for every pixel
Ah
ic
Let me look at my code at that packet
I remember using a bytebuffer
that is filter lite dithering
with a bytebuffer
then for the bytebuffer
in my nms code i applied it as such:
Thanks ill take i a look at it
np
I don't think they do
Ehhh seems a bit weird
mmmmm
Sneaky
wow okay
Anyone good with system administration? I’m kind of killing myself over it.
Still looking?
Yeah, I'm super stuck on opening port 22 on a Ubuntu 18.04 VM.
How come you're using a VM?
Trying to set up an old computer as a server PC.
Why not just install the OS directly on the old computer?
Didn't think of that lmao.
@lavish notch So, I ran the command ssh -p 2200 alexersion@localhost.
That works, yet when someone replaces the localhost with my IP, it doesn't.
Did you portforward?
btw ubuntu isn't required for a server 
It's usually used because it has better performance than windows iirc, but if you're using a VM, the vm will probably slow it down anyways
Also the VM might be the one messing up port forwarding
¯_(ツ)_/¯
at least i think thats why its used
¯_(ツ)_/¯
As in port 2200?
WSL 
This.
I'm unsure. I port-forwarded 25565 earlier and it worked fine.
What about 2200?
Haven't tried.
Assuming what you're saying is ssh doesn't work when using your external IP, then port forward 2200.
What OS?
*What OS is the old computer
MacOS.
What version of MacOS?
Good luck port forwarding that bitch
Took me like 3 days to get something working out of it
lol
Got it finally working.
My stupid problem was that I did 127.0.0.0 instead of 0.0.0.0 lmao.
This is why I should not be in charge of system administration.
Lol
material ui is gone?
oh that's a review
lmao
I can see very well guys. I Definitely don't have focus and visual problems
package private is kinda underrated
hide those implementations!
yeah
package private = poor man's jigsaw
like
you can have mutable pojos but hide the mutator methods and then provide public manager types that wrap them
it's sick
bm... likes oop?
😦
but sure oop is fine as long as you don't go crazy
clojure plugins?!
🤢
i think i've actually come to the conclusion that i prefer java over kotlin
with modern versions and a few libraries java is really nice
until you have to code a plugin for a 1.7 server
i'd rather die
mood
idk theres something about java where it heavily encourages you to write clean code
whereas with kotlin i still try but it doesnt feel quite as organised and well structured
This is one of the things I keep saying why I don't like Kotlin, Java is very constraining in syntax (and overall ways you can do something) whereas Kotlin is really open about it to the point I don't know if what I'm doing is right or wrong
yeah I agree - the tools kotlin gives might be more productive on paper but they also introduce a lot more complexity and are easier to abuse
extension functions for example are nice until you try and make them work with dependency injection
maybe I'm not using the right libraries but Kotlin's syntax feels so much cleaner and more expressive than I've ever seen from Java
especially related to like functional stuff
sure the syntax is nicer in a lot of places
but i don't think it "scales" as well, there's something about the language that means it usually develops into a mess with larger codebases
I mean you can still follow the Java-style for your code in most cases
You wouldn't code in Kotlin to write java, would you
^
Maybe you just have stockholm-syndrome for the heavy chains of Java
maybe lol
there's just something about kotlin that doesn't feel as nice with larger codebases
i think it's because of the temptation to use the syntax sugar-y stuff everywhere
I mean if you're worried about scalability and managing larger codebases, surely you can treat Kotlin as Java with some better syntax and modern features like coroutines
It's way easier to write messy code with Kotlin imo
yeah
Well of course
That's part of freedom
Java is one of the most restrictive languages in existence
And it produced enterprise code that we all groan at
for me, Kotlin is more like for prototyping, quick implementations of simple things etc
Are you a GPL supporter now as well BM?
no
That's the same argument
