#dev-general
1 messages ยท Page 251 of 1
"$variable in string"
"${some.variable} in string"
var ๐ฌ
this is KOTLIN
with(event){} :))
IJ is literally warning u about var too lmao
final by default
use var only when neccessary
Altho this is just to prevent you from making mistakes mostly
fun SomeEvent.blah() {}```
let blah(SomeEvent e) => {}
^
when {
blah -> blah
match {
blah => blah
}
when (variable) {
something -> doSomething()
otherThing -> doOtherThing()
else -> doElse()
}```
true -> blah
false -> blah
true -> {}
false -> {}
handle each of then
This is useless, it can only be true or false
not really
yea use a normal if for that
but yea when isn't really useful there just do kt if (!player.hasPerms()) { // ... return true; }
when(expression) {
value1 ->
value2 ->
range or type checks?
}
ORRRRR
when {
condition1 ->
condition 2 ->
}```
when is only useful when u have multiple outcomes, which will stop u from using if-else which looks disgusting
wdym
wha
horrid
CLASSIC kotlin
ha
iโm gonna try when i finish eating
You COULD do it in one line
Dependency Injection
Dependency Injection is a way of providing objects with the objects they need ("dependencies"). This is usually done with a constructor, but can also be done for individual methods
Read more here: https://en.m.wikipedia.org/wiki/Dependency_injection
Dependency Injection in Java:
https://paste.helpch.at/yijawupoju.java
Dependency Injection in Kotlin:
https://paste.helpch.at/esogakutod.kt
๐ง
nice di
good start
there no static keyword and iโm not telling you how to do it
"static" in kotlin
thats an abstract class
Why are you trying to construct it
Did you mean to use YamlConfiguration?
One class inside the other with the same name .-.
There you defined a type
static val lol: String = "hello"
nice try
what what
val <VARIABLE_NAME>: <TYPE> = <EXPRESSION>
i know how to use static in kotlin, but that defo werent the way so i was confused if they added it in an update ๐คฃ
You COULD copy paste and let IJ convert to see
they did
in 1.5
๐
In kt it'd be
class Brodcaster(private val plugin: Main) {
private val MESSAGE_DELAY = 5*320l ;
private val ROOT = "BrodcastMessages";
private val config = plugin.getConfig();
init {
createDefaults();
}
spoilers
No I meant like it just triggers when you paste java code into kotlin file
You can also use the shortcut bm suggested
Did it not ask you if you wanted to convert>
?
||Feels like the missionaries all over again||
weird
Can't put code in spoilers lol
Are you sure you pasted into a kt file?
try this
?
did it in 12 lines if you dont include imports/package/whitespace lol
put it in a paste james
Which class are you trying to do in few lines?
Let me try
https://paste.helpch.at/ijofifeman.cpp im ignoring whitespace and header lines but thats what i got
if config.set returned the plugin i could cut another line smh
hey i recognise that meme
๐คฃ
very good meme from very good community
Lmao there is a typo startBrodcast
lol
import bukkit/scheduler
struct Broadcaster {
Plugin plugin
}
let delay = 5 * 320
let root = "BroadcastMessages"
extend Broadcaster {
let createDefaults => {
plugin.config[root] = (0..3) map (s => "&6Default Message $s".color())
plugin.saveConfig()
}
let pickMessage => plugin.config.getStringList(root).random()
let startBroadcast => bukkitScheduler.scheduleSyncRepeatingTask(plugin, pickMessage.apply(Bukkit::broadcastMessage), 0, delay)
}```
how's that
disgusting
excuse me?
@ocean quartz how do you tell to your core lib what plugin to use for tasks?
pretty good
Get provided plugin
however i cant help but notice you cheated by forgetting a method
WHOOPS
struct ๐คข
struct good
import bukkit/scheduler
struct Broadcaster {
Plugin plugin
}
let delay = 5 * 320
let root = "BroadcastMessages"
extend Broadcaster {
let createDefaults => {
plugin.config[root] = (0..3) map (s => "&6Default Message $s".color())
plugin.saveConfig()
}
let pickMessage => plugin.config.getStringList(root).random()
let startBroadcast => bukkitScheduler.scheduleSyncRepeatingTask(plugin, pickMessage.apply(Bukkit::broadcastMessage), 0, delay)
}```
fixed it
There are no "methods"
ah ok
you extend a struct to add "methods"
Yea but it acts more like extension functions
pickMessage.apply(Bukkit::broadcastMessage)
@old wyvern thoughts on this btw? or we could go F# and dopickMessage |> Bukkit.broadcastMessage
i think it's hot
first is better imo
the second would be a language feature rather than a standard library thing
https://i.imgur.com/DpQUPfV.png my tshirt ๐ญ
๐คข F#
F
Yes!
Block#move
don't diss F# like that
easy
man that's horrible lol
no
which? |>?
i doubt it
Yea
good
d;spigot block#Move
it's cool
pls no yugi wtf
There was no direct match for that query, did you mean any of the following?: block#getx() block#gety() block#getz() fallingblock#remove() boss#remove()
what's wrong with it
everything
#off-topic bad staff ๐
could use |> for lambda or smth (still horrible)
hacktoberfest tshirt smh
|> isn't a lambda tho
in F# it's the pipe operator
smh kids these days
dont even know about hacktoberfest
H O R R I B L E @prisma wave
ur horrible
nah it's nice
how the fuck am I supposed to track the package now ..
u dont ๐
go to sleep
efe ask in #development
Lambdas make no sense for a functional language
Functions exist as entities themselves
im not sure it's necessary
ok now thats disgusting
mkay
one |> is nice
@obtuse gale
better than let result = rev(toStr(square(512)))
here, you forgot this none
its a good design but |> feels rather annoying to type
annoying doesnt mean hard
why not use a more COMMON syntax?
Like?
{==>
definitely not |>
You can still use the normal function calling
tbf im not sure elara needs it if we can already chain receivers, eg let result = 512.square().toStr().rev()
This is just something on top
{[;==^2-=->
$:
:=
)
)=>
same as
let a(Int a) => {
}
and
let a = (Int a) => {
}
being valid
Yeah this is as small as i could make it https://paste.helpch.at/xuvebokinu.cpp
hm true
offtopic, has anybody tried game development such as unity?
Yes
Yeah
I study game developement
lucky mf
I study math analysis smh
That sounds nice
yugi gonna make new fortnite ๐คจ
makes sense @ocean quartz
Mine is just a specialization in Game dev tbf
yea thats about as good as it gets
brister mitten
professional language designer
we can switch
xD I wish
id like to give it a try but I hate the design part
I program the programming language Skript which ngl is better than I thought
everybody here should use Skript
ban this man
no if you suck at any kind of design ๐คฃ
We had a Game Design class every month for our first year
I mean its not graphical or anything
Just stories and user interactions
no you
ahh, that's not what I meant
JavaSkript > Skript > Kotlin > Java
You meant graphical designing i guess
I'm talking about the visual part of the game
like, I can probably learn a thing or two about programming part but would stuck on design ๐คฃ
We just used models from mixamo and some my friends made for our project exhibition
There are a lot of free assets tho
ye I saw that
You can probably buy assets later on if your game goes real well
@prisma wave Question, if I create a sealed class that extends another class, would it contain child unoverridden functions?
wdym?
Doesn't sealed class, block some functions? Or am i thinking this wrong?
I don't think so?
Technically its just a package protected abstract class right?
Ooh okay, i had the impression it would restrict public functions, that's a bummer
@old wyvern can you just download them?
Yea
They also provide all sorts of animations
That was litrally our saving grace for my project
got an S ๐ฅณ
lol I see
but I guess you focus more on the technical side of game dev, right?
since game dev and game design are two different domains
Gab let's make Minecraft 2
agree
Me personally, yes. but a lot of my batchamates are also into Audio and Modelling
damn
We have courses for both
what uni do you go to Yugi?
VIT
You can probably still apply for some lateral entry programs
still ๐ฆ
I mean getting a CS job doesnt really require CS anymore does it
If you like it, focus on it more
One of my friends got out with EEE and now works in zoho as a mobile app lead
yea, I need to find a domain that I like though
Have you given game development a go yet?
no but tbh looks interesting
didnt had much free time since uni started unfortunately
Ah fair enough. Do you have vacations this year?
and before that my pc couldnt handle unity
Same tbf
my last laptop took ages to open Unity
My first class I felt so annoyed waiting an hour for the shit to load
rn im in winter break till 11th of January but exams are coming ...
Ah
what year are you?
oh, ok
Having an interim weird semester rn
tf 4 semesters?
Not sure how this fits in?
each year?
no 2 sems a year
smh yugi
xD
who say it like that
like what?
.
ye ig
Do you guys refer to each semester of year separately?
Like 1st sem of 2nd year ...ect?
im 1st year rn and is kinda boring and annoying since I couldnt go to a CS uni ๐ฆ
ye
ah
You could still try for any possible lateral courses
Math will be helpful either way tho
Fuck math
xD
Too much stupidly complex stuff
Its ussually fun once you get the hang of it
and I hateeeeee stuff that is not practical
yea I kinda screwed up with laplaces last year as well
Where is a tone of theory
I mean it does
Issue is they dont speak about applications before teaching
we are doing vectors and other stuff at algebra but the applications are to weird for me tbh
like, the teacher explain them as something that you can't reproduce irl
eh its more of techniques to solve in a lot of cases
Like they just go through diff methods of finding solutions
Which is why you might not know where to apply them
I like math, I always did, but these stuff are explained very poor and seem impossible
I KNOW
man i found this woman on youtube who write formulas and stuff backwards on a glass placed in front of the camera
I think a youtube channel called Because Science also did that, it's freaky
did BM's episode 1 ever go up
Yeah and needed to adjust the audio
ah ok
MIT grad shows how to find derivatives using the rules (Power Rule, Product Rule, Quotient Rule, etc.). To skip ahead: 1) For how and when to use the POWER RULE, constant multiple rule, constant rule, and sum and difference rule, skip to time 0:22. 2) For the PRODUCT RULE, skip to 7:36. 3) For the QUOTIENT RULE, skip to 10:53. For my video on th...
MIT grad shows how to find derivatives
nice ..
That looks so weird to look at
Like shes writing on the board by writing forward but its still on top
She even writes with the wrong hand
AAAAAA
Anyway, gtg almost 3 am
AAAAAAAA
which let us study on our own ..
Good night ๐

gn yugi
Gn!
shame
Kotlin will help you
kotlin pill?
btw im confused is the minecraft that is played on phones
is that bedrock edition?
ik there is a windows 10 edition
It's both bedrock edition
Should
thats insane lol
Is it possible to host a maven repo from just a jar?
Huh?
uh
so when I use jitpack
It uses the github code
but I just want it using a jar file (in the release)
is it possible?
Not on jitpack
Local
Not that i know of, other then maven central
is maven central free and good ๐
Yes but it requires source, every other one will
hm
Just used local lol
ยฏ_(ใ)_/ยฏ
What do I do for gradle?
gradle seems more confusing xD
that or I just suck at googling
Also when should I use compileOnly and when should I use implementation?
because I see lots of plugins use compileOnly and I don't know if i should use it also (since jitpack says to use implementation)
please @half harness if anyone answers.. as I really need one soon!
๐ I just went on that
Psst Matt
compileOnly Is for dependencies that won't shade, implementation will shade
<https://stackoverflow.com/a/20700183/3783087> doesn't attach the embed
Too much trouble
so if my plugin is in the plugins folder use compileOnly?
Yes
thxthxthx!
It's like 3 keystrokes at most lol
should i use ```gradle
dependencies {
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
}
3 too many
then all jar files in libs folder
Fuck, when you edit it pings
?
wait- then can't I use implementation instead of shadowjar?
Oh okay, it's odd
It doesn't really ping
๐
Huh?
I didn't say implementation shades, things that are marked as implementation will shade
If you have a shading plugin 
Brister Mitten repository
He doesn't want public, bm
That's on him
your loss
ack im stupid I just used the jar file for my mc server from my projectdir/libs (where I put my local dependency) and thought it was projectdir/build/libs ;-;
also any suggestions for dev plugin test server :>
Yes, remove plugman 
yes thats very important
๐ฌ
um but what if I don't want to restart the whole server and wait 1 minute which feels like 1 hour
sometimes im on 1.8 client tho
and takes too long to switch
um but what if u get random errors and dont know whats causing them?
and makes my computer die
oh right ofc, its from plugman :clojuremoon:
I can restart server after that, I can sacrifice a minute :>
In that case reload, as shitty as it is, still better than plugman lmao
/reload lol
I thought restart > plugman > reload
Yikes
Are you fucking aware of the shit you're saying?
Yup
lmao
/reload is literally /plugman reload every single plugin
That's horrendous
That's catastrophic
It's all catastrophic
Reloading single plugins is way better than throwing everything to shit
Just restart, like everyone
Was talking to dkim
arghh MC server soft "command remembering" system is getting annoying
do u guys use a server wrapper
??
๐ I guess that means no
๐
question:
Will this break anything since I have another plugin that has VaultBaltop has a dependency?
"this"?
the image
Right, it's cropped on mobile
o
Yes it may potentially cause harm on plugins that depend on that
actually i need to restart server
You would need to disable those first
makes sense
I wish there was a way to restart the server with restarting it
like a /reload that works
/restart 
;-;
Run your server on IJ and hotswap 
Piggy has a good guide on it, but i don't remember
Trying to re-brand my warps plugin as i've completely re-designed it, and trying to think of a good name, wanting it more unique... Anyone got good ideas?
Warps+
Was thinking something a little more unique and original ๐
Warps 2
PlusWarps++
pretty original. don't think I've seen something like this
OmegaWarpsPlusUltraExtra+
Omega, what all does it do
I settled on HyperWarps (surprised it wasn't taken)
FrozenWarps 
warps then freezes half way (halve all the coords for the warp then freeze the player)
Thanks for the idea
@ocean quartz Quick suggestion, have the Italic format disabled by default on mf messages, as it conflicts with stuff like _<username>_ (for convinience sake
)
java.lang.NoClassDefFoundError: kotlin/collections/CollectionsKt why would I suddenly be getting this error?
not shading the standard library?
not using pdm
how would I go about shading it?
fatJar 
yeah I am
Obviously something gone wrong
P
D
M
!
๐
Also anyone here has used ListenableFuture? Is it better than Completablefutures?
oh pdm is bm's lol
bug free
WHO is bm
good question
who is bm
WHO
looks just like me
Exactly
Itโs fake hair
Is it bad that I don't know who that is?
the ceo of covid
...
Yes
Thats the director of the WHO
WHO let the dogs out?
reliable source
If you think the virus is fake, then just wait a bit, let natural selection sort shit out 
humanity should die yes
Non believers
We dont exists
Nothing exists
No as in
We specifically
Dont "Exist"
we are a matrix?
As in a personality
Atleast in some way
According to the many worlds interprey
Interpretation
We branch to a "new world" on every decision
what does the many worlds interpretation have to do with existing
Think a bit more
Once branched
Which branch is you?
Are all branches you?
Is the reminiscent of some random first branch that has nothing to do with who you are now also you?
yes
Then your personality is not defined
Its simply a probability
With existtance only upon joining your system
Or as in "on observation" the state collapses
From the text book words
Or rather the wave collapses to a state actually
But yea
๐คจ
I wouldn't say they're you
Then do you exist at any point
Yes
Anything so as to even think would make a branch
that's a certainty
Every thought is a decision
If every minute thing you do branches you
And all possibilities do occur
There is no person
As in its a illusion
of course there is a person
you must consider time here
every instance
if time is not considered then yes, there is no person
there is nothing
apart from light
Maybe?
you'll have to excuse my lack of knowledge here, for i'm a mere programmer
because if it can not split concurrently, and time is factored in
then it is certain that you exist
Parallel stream
unfortunately whether it's concurrent or not only matters to an observer like us who can experience time .-. As yugi said, we don't really exist, but that's not due to mwi afaik
not that I know anything about anything
This one got me
That seems kinda harsh
But either way
wym harsh
Mwi doesnt really do much except try to present a possible explanation for scrodingers cat
the universe doesn't factor in emotions lol, how is it harsh
Which they actually made intially to mock quantum theory
Ok thy universalesse
๐
I have no damn idea
even though I was already confused
Im equally confused
Oh i read that wrong
My bad
I thought you were being sarcastic
oh no lol
Intellectual conversation starter
what's everyone's favourite syntactical feature in any programming language
not lisp
๐
Not |>
๐
:= for declaration and = for reassignment
Whats delegation?
in kotlin terms or in general?
yea pretty much
val a = 5
val b := a?
nah gaby
in Go, probably the same in V it's like ```go
a := 5
a = 4
๐
in vlang it's like this:
a := 5
// won't work
a = 6
mut b := 5
b = 6```
actually
hey don't go trashing Go
thats nice
What's the equivalent in java?
java doesn't have an equivalent
int a = 5;
a = 4;
java only uses =
altho i wouldnt say better than val
it's not the same
theyre both good, but := is possibly cleaner
ehh
Ah, ok p1g
if ur skimming over smth it might be hard to spot, idk
fun fact python has := too
That makes it a shitty thing tbh
i think the point is that it's supposed to look similar bc declaring a variable and reassigning is practically the same thing
Pig imma pr smth to barry
ig
You better merge it
a := 5, a = 5 look the same because you're making a equal to 5 in both
idk
that's just a theory
i still prefer val ๐
val is verbose when comparing to v's style
And whats wrong with that
lol
Yea
speaking of verbose, has anyone ever heard of F#
ya
very nice language
how does vlang look anyway pig
But, like, I want to KNOW what the f somethig means
v.v
v := "v"
it's easy
if there's no prefix, it's immutable
if it starts with mut
it's mutable
what
C's spltkn for String#split is that good?
what
Then what is wrong with stuff being verbose :((
๐ฌ
lol
Amazing system
click it
no
y not
you can just tell there's at least 30 viruses on that site
strtok @prisma wave
smh
uhhhhhhhhhhhhh
What did you expect efe lmfao
its not like the viruses will do anything ๐
oh i see
triple x movie website
yeah they are no match for me
but anyway
// 'name' is inferred to be a string based on usage.
let printMessage name =
printfn "Hello there, %s!\n" name
// 'names' is inferred to be a sequence of strings.
let printNames names =
names
|> Seq.iter printMessage
let names = [ "Ana"; "Felipe"; "Emillia" ]
printNames names
what does everyone think of this
|>
gaby will have an opinion on |>
it's definitely unique
|> is just horrible mate
Whats it purpose?
^
names |> Seq.iter printMessage
``` is the same as ```fs
Seq.iter printMessage names
``` I believe
yeah
Ok why |> and not . as EVERYONE ELSE?
hmm?
unique
ew it uses let
this is very different to .
Also why ; for array values lol
idk
use commas
Cant copy the text but im talking about let names
also why spaces for the []
Too many questionable things smh bm
The |> is good because it means you can use receivers like methods
Piping applies a function on an input while . Is to dereference
What's next, <o/ for callbacks?
Apparently there's also >> for composition and <| for a backwards pipe
Anyways, gl with your project
Project?
=pl auctionhouse
Does anybody know this guy? Like have this discord or smth
Elara, noob
Ye until you meantion this abomination |> ๐คฃ
yeah don't do that bm
no
do what u think is best
I swear every spigot plugin has gotten then "great plugin, can i put on http://www.mcbbs.net/ ????"
It already has an alternative
Ik ori
oh god, <| ?
Should have stop right there
Man looks like a thing you would use for console lol ---<| TEXT HERE |>---
F# only uses them because it doesn't have parentheses and commas
that's a good thing
not a bad thing
So they are necessary to denote precedence and resolve ambiguity
Just add .... them?
Whereas elara has parens so it doesn't need them
Yeah elara has them
Ehhh
not awful
Thats the moment when you get accepted to the premium spigot website
Similar to hogwards, they send people after you
literally free money for you lol
Not bad, rewriting a lot of the interpreter because my implementation of the type system sucked a lot
*cough* |>
no
I need that on paper
ew
Tf
dvorak
W tf ?
Why
Ok ..
Z looks nice in bottom left corner for me
Thats the only difference?
special characters have different places
Ok ..
In ro keyboard they are around enter where punctuation is
But I only use that when I need them
we just use US International as our layout
we do have a dutch layout though if necessary but only difference is like replacing the dollar sign with an euro sign iirc
yeah neighbour
๐
I live a bit more south
in Noord-Brabant
near from you what
it's only like 250km
omw
When does the bike arrive @frigid badge
which bike
Yours
I haven't bought it
When do my winter tires for the lambo arrive @frigid badge
once you buy them smh
Oh u mean I gotta buy them
I'll write a check
what would this be AuctionHouse::Task: com.spawnchunk.auctionhouse.menus.ActiveListingsMenu$2 ( Timings )?
a lambda or
too many tasks omg
I wanna mess around with some search stuff
Anyone have a somewhat big dataset to search?
what format does this dataset need to be in
multiple datasets or just one?
it's already json
Okay
Do you guys have any idea about forwarding player to different ports on same DNS?
@signal tinsel https://cdn.piggypiglet.me/docdex/justmaffie.7z
Aight thanks
expands to ~1.6GB of searchable data
hmm, how tf do I open a 15gb tar.gz file ๐คฃ
tar -xzf blah.tar.gz
mhm
@signal tinsel how are you searching it btw?
if you deserialize all those objects and load it into memory
well, you can't
mhm ok p1g
there's too much
aight
We'll see what I do
if you come up with a better algorithm than mine be a gentleman and make an issue with the details on https://github.com/PiggyPiglet/DocDex so I can implement it
any idea if coreprotect is OS?
believe it is
First trying to open a data file in sublime text lmao
I have only found this https://github.com/PlayPro/CoreProtect but that's the documentation =/
guess not then
could just look at the project I linked which uses it lol
Meh
@quiet depot I've spent 20 minutes writing a python script to make it into a readable format
Aka prettify the json
Lmao
And now it won't even load at all
Okay now lets see what to do with this
Hmm, not much of a useful dataset
Is there any way of making a gradle module's repositories transitive? atm i have to add them all to the root module just to get dependencies to resolve
Wouldn't api make it transitive?
Oh wait, repository
I think it'd need to be on root module yeah
that's annoying
so much for "independent modules"
just gonna have 30 repositories in the root buildscript and the others empty
I mean, that doesn't sound like a good idea, since that's part of the standard, you could just do \_<username>\_
Well how will you escape it if they type in chat lol
Or their name get's parsed in a gui
You feel me? Don't worry about it, I just gotta remember to always remove it
Yeah might be better for you to remove it instead, since i feel like it's too core to be disabled by default
๐
Gradle project with multiple modules, A depends on B - B cannot be resolved until its repositories are added to A
Which I guess makes sense, but it would be nice to have it working
3.87 seconds
Yeah lol
1s - 1000ms
What's the problem with adding the repos to all submodules if you don't want to repeat yourself
38.7s
So it's 38.7 seconds
Not a lot, I'd just rather have everything clearly separated
Repo declarations don't really affect the modules
Just additional sources for dependencies that in the worst case will not be used
Yeah ik it doesn't matter, it just seems odd having to add a repo everywhere for a dependency that's only used in 1 module
What is procedural programming now again?
should kotlin extension functions be in their own respective classes?
I normally have them as top level
Here is an example of how i have them https://github.com/TriumphDev/chat/blob/development/plugin/src/main/kotlin/me/mattstudios/triumphchat/func/Declaratiosn.kt
What's internal, I assume package enclosed?
project apparently
Module
Interesting
would a module be the whole project?
If you only use a single module yes
It can be, but for example in my case on my project i have 2 modules, api and plugin
Ah, ok gotcha
so putting the functions in their own dedicated class(file?) is standard?
File yeah
okay maybe trying to make a generic config processor using snake YAML wasn't such a great idea lol
Generic?
Declaratiosn.kt ๐ฅฒ
trying to use something that @heady birch made and make it bukkit and bungee compatible without having to deal with bungee's shitty config API
does it add in Kotlinised improvements?