#dev-general
1 messages ยท Page 269 of 1
i think putting it on spigot is good especially if you dont have anything there yet
rack up those downloads so you can eventually put up paid plugins
wdym "if someone is looking for that specific thing they'll find it"
also OS because you can have a portfolio of previous works
that people can easily see when they want you to do something
Example, I made an offline server addition for geyser and floodgate, wasn't merged to the plugin, so if someone is looking for that specifically they can easily find it on github
Time to OS some plugins which were never used 
Code is a mess tho, cause old
my code is probably a mess
old code > no code
open sourcing my messy code ๐ฌ
could clean it up before open sourcing it :)
Can't say I'm lacking repos
๐
get to triple digits
Tofpu, that's effort tho
or quadruple digits
i spent like 15 minutes yesterday removing most of my static stuff in one of my plugins
Yikes
digits of repos = digits of salary
If only
๐ง
naturally
if you come up with a decent solution within a plugin then pull that code out and make it a standalone library
Already did for something
If someone wants to cringe https://github.com/Frcsty/DistrictCore
erm
I'm stupid, excuse me.
whaat does that do
MAVEN
Ivan, an assortment of plugins for a facs server
๐
interesting
public void addCommands(final CommandBase... commands) {
Arrays.stream(commands).forEach(this::addCommand);
}
how have i never seen this syntax before ๐
this is revolutionary
Don't judge the code too bad tho
oh i'm in no position to judge
which bit
probably the vararg
the (Object... objects)
though i was never shown how to use the stream API so i guess that's probably why i was never shown this
Idk it acts like this: x(new Object(), new Object()) but then in the method it's an array
Very yes
so just remove the new Object[]{...} part
Imaging having to do method.something multiple times
I mean the code is probably still cleaner than most spigot plugins
But oh well
I mean many plugins would be substantially better if it wasn't for their miserable ability to abuse static
what is "coupling"?
I've heard that coupling is the reason why you shouldn't use static
hard/tight coupling probably
Tight ๐
but im confused
Well that's a very good reason not to use static in fact
Well it means your code gets hardly coupled Idk do you know what coupling in general means?
If now it's the notion of two things being connected sort of
but i dont get how it goes into java
Well because everything you do in java is to connect different objects with each and another
i guess
tighter coupling means you'd need to change more parts of your code per change to the design
all this talk about coupling seems very familiar compared to the new micro architecture hype
well tight coupling would for instance be this design
class Class {
Class() {
new BukkitRunnable() {
public void run() {
//code
}
}.runTask(Plugin.getInstance());
}
}
//then
new Class();
huh
In this case we have tightly coupled the instantiation of a BukkitRunnable with the Class's constructor and then tightly coupled the runTask method with the static singleton of main
It's bad since it effectively "hides" code and makes your code more complex unnecessarily
uhhhh
efe?
Comparing it to this for instance:
class Class {
Plugin plugin;
Class(Plugin plugin) {
this.plugin = plugin;
}
void run() {
new BukkitRunnable() {
public void run() {
//code
}
}.runTask(plugin);
}
}
//then in main perhaos
Class cls = new Class(this);
cls.run();
now it's more loosely coupled allowing us for easier substitution as well as more maintainability since the consumer is starting the task and the consumer has to pass the plugin instance making it more obvious in addition of hiding less stuff.
Though sometimes you might wanna hide stuff or abstract away it. The problem is that many people do this wrong.
a static utility method taking ten parameters is rarely an actual utility method
more of a messy static method that someone didn't know where to place it
๐ค
I mean, might not be so clear why we should go with code snippet 2 over 1 but youโll probably encounter these problems yourself in larger projects
๐ฅฒ
can anyone help me pls
i made a new greeting with mimu and it says i have to use {embed: greet} i dont know what code to use
@lost kestrel what is mimu
a bot
big sad
๐ณ
ur LATE
๐
also i know someone that wants to code... anything I should do?
how much the cooldown duration for using =cr command?
alot
Why is singleton bad in the context of a spigot plugin Main Class?
but-
Yeah I know its not really but someone said people are telling them to use DI instead
because DI is better
It's not
just because it is a singleton, that doesn't mean you should be using static access everywhere
why not?
public class SomePlugin extends JavaPlugin {
private final static SomePlugin plugin = new SomePlugin();
public static SomePlugin getPlugin() {
return plugin;
}
}
```๐
gross
It follows all OOP standards (because it IS in the oop standard) and there are no performance tradeoffs
coupling 
Static getters aren't OOP
Singleton concept is
come on its not debatable
Just because the pattern exists, that doesn't mean it's proper OOP
Why would they be used and implemented in major projects if they weren't proper
Singletons solve one (and only one) problem.
Resource Contention.
If you have some resource that
(1) can only have a single instance, and
(2) you need to manage that single instance,
you need a singleton.
There aren't many examples. A log file is the big one. You don't want to just abandon a single log file. You want to flush, sync and close it properly. This is an example of a single shared resource that has to be managed.
It's rare that you need a singleton. The reason they're bad is that they feel like a global and they're a fully paid up member of the GoF Design Patterns book.
When you think you need a global, you're probably making a terrible design mistake.
That is exactly why I am using singletons ONLY for my main class and nothing else.
bm u should join vc
I would argue the main class isn't an exception
Yes
do i have to
yeah
the main class isn't a traditional singleton. It doesn't explicitly control its own instance, and can in fact be instantiated twice in the context of a /reload
and can in fact be instantiated twice in the context of a /reload
actually that's not true, my bad
๐
Are you sure?
But it is snapped
I thought reload just calls onDisable and onEnable
okay
either way
the main class doesn't explicitly control its own instance, so it's not a traditional singleton
ok
that's not necessarily bad design, but you should at least use DI
ty
ok
static bad
ok
welp
elara good
elara SLOW
yako stfu
wrong
oh really??
singleton or di
oh is that so
elara very fast
:))
they're not mutually exclusive
๐ฎ
couldn't be elara
The execution could be faster
frosty how would they make it faster?!!?!?!
Jvm compiler!!
yes !!!


well we are preparing for that
need to mentally prepare myself for the hell that's gonna be typing and understanding bytecode
๐ค
Sounds fun ๐ฌ
Matt, what sound even more fun is finishing triumph chat!
xD
Actually
theres one specific thing we forgot
#m-o
What's #m-o
Pain
I wanna work on the expansions but i first need to finish the basics ๐ฉ
โน๏ธ
see im not the only person who procrastinates!
๐ฅฒ
Fuck this rona man
Ikr, i need this shit to end
random info. I've finally got BF II downloaded. Even on low it barely runs ๐ฆ Sad day
oh
wrong channel
fuck
me
Kinky Blitz
xD
damn this sucks man. The game is so nice. and also Nvidia Geforce Now doesn't accept the game since its in origin games launcher even tho I got it thru Epic Store
btw BattleFront II is free on epic store still. if anyone wants to get it
yes please
@prisma wave What would you do?
val users = mutableSetOf<ChatUser>()
fun getUser(uuid: UUID) = users.find { it.uuid == uuid }
// or
val users = mutableMapOf<UUID, ChatUser>()
fun getUser(uuid: UUID) = users[uuid]
I thought it was odd to have uuid both as key and inside the value object
I don't think so
Fair yeah, i'll do map
I have uuid as value even though I store it almost all the time
?help
ยป Give the helpers some details
ยป Ask suitable questions
ยป Be polite
ยป Wait
In a plugin that i built
when i extracted the plugin, i found a file called "yggdrasil_session_pubkey.der"
Someone told me that they are almost positive its a session ID stealer
and I'm not sure
can anyone tell me what that means? or if its not meant to be there? because im not sure why its there
A quick google search took me to https://github.com/Steveice10/MCAuthLib/tree/master/src/main/resources
Assuming that's something to do with authenticating buyers or something like that
yggdrasil is mojang's auth lib
the only way i can think it getting there is if when i built artifacts in intellij is if it was malicious
What the hell even is a "session ID stealer"?
i doubt it's malicious
.der files contain certificates
not much you can do with that
Basically its able to steal your session ID, allowing the person to log in to your minecraft account without a password @ocean quartz
How would a plugin do that? It's nothing to do with the client
ok tyvm
in java is it better to do String.valueOf(int) or is it ok to do "" + int ?
"" its shorter ๐
First one
well I mean I'll trust Matt anyways xD even if he gives me the wrong answer lmao
I'll never trust you lmao
lol
Iirc "" + int will do more, it'll use a string builder to create the final string, while String.valueOf basically calls Integer.toString which is less steps
wait but then Why shouldn't I use Integer.toString() ?
or should I use that lmao xD
Some compilers switch String.valueOf to "" + x
I don't know a lot of java methods

Well String::valueOf is a null safe version of Object::toString
and Integer::toString just fabricates a string representation of an integer
That's a lot of words that I need google translate for lmao
Why does IJ's bytecode viewer suck for java
Yeah concatenation compiles to a string builder https://paste.helpch.at/exumuvelab.js
not generally, no.
that is, it isn't specified that way
And on later versions a lot has changed
yeah it uses a fancy MethodHandle thing in newer versions iirc
yeah
The real reason you should be using String.valueOf or Integer.toString instead of concatenation is that the latter is confusing
and the former are simply cleaner
That result i got was on Java 15 though, but yeah being cleaner is a better reason
Was just simple
String s = "" + number;
System.out.println(s);
Then just replace it with value of
how did you compile
or just run javap -v YourClass
and say what major and minor version say
Java is so fucking messy sometimes.
consider using elara instead
I mean I use kotlin but I'm learning java rn.
im over here learning go
pretty cool language from what ive seen from it
and ive only really covered the basic syntax
javascript is nice
scopes?
yeah i kinda worded that badly
wdym then
I think go is one of the few languages that I genuinely have no interest in learning whatsoever
lol
go learns you
ya know how in go, if you capitalise the name of a function
i like using lowerCamelCase or whatever its called, and capitalising the first letter feels odd to me
definitely a unique way of doing it, but not necessarily a bad way
I think go is one of the few languages that I genuinely have no interest in learning whatsoever
Go, C#, what else
C++ ?
C++ good
Ye its cool
I forgot all the C++ I've learnt in 4 years lmao
Not a fan of C#
also learn rust or learn death
C++ sucks but it's certainly more interesting than the others I've listed
C++ actually takes thought to learn
yeah it hurts my head
{ (and you can initialise variables here for some reason)
}
head hurt
i have very specific problems with most languages haha
or do you mean that legacy function parameter notation from C
runs
i use js for machine learning sometimes
still abusing Dave ๐ฆ
better than O(n!)
O(-1) is the best
dave deserves it
i mean, yeah
the dream
look
what have he done against you? :[
O(-1) = O(1)
i tried to use maps
but im not writing a hash implementation for every single type we have
are they equal?
so a list of entries is easier ๐
-1 can't happen
you sure?
wouldn't that make it go down in cost?
no
haven't seen the power of the dark side then Ig
that is not how this works
lol wheeee
The way this works is like this:
You describe an operation using a polynomial function. Then you look at the part of the polynomial with the strongest growth and take out constant factors. now you have big O
there is a formal definition for this as well but it's probably easier to understand this way
3n^2 + 2n + 3 => n^2
And although yes, practically you can't have -1, you can still derive big O from it
oh yeah and how Go declares types after the name hurts my java
and coolio
anyone wanna COC?
and yeah that would be one example
sure BM
๐
๐ฎ
idk lol
did you just add that to barry
No
The link was generated by a bot
lol
ah nice
can it start the game?
ah nice
we need a COC intellij plugin
Fr
There we go
the COC?
oh you're using f#
share code
I was like how is this 300 something
lol
Just ran it on IJ using jdk 15
can you do what I suggested after
i wanna know why Int.pow isn't a thing
Double.pow is
Idk how it handles number
I meant kotlin for that
Was to the int.pow thing
I think the error from the compiler once was that it saw a double or something
oh
let parts =
[0 .. x - 1]
|> List.map (fun i -> words.[i])
``` something was going wrong here for ages, idk what though
๐ฌ
ยฏ_(ใ)_/ยฏ
Oop yeah it says 52, so java 8, so yeah was wrong, let me try changing it
have any of you guys had experience with the PLAN plugin, or more specifically the crazy number of mysql connections it seems to make
> stares at LP with 10 conns per instance by default
at least LP lets you specify the amount
Tru
which is actually very much appreciated, pretty much any setting i'd realistically want to change is available to be set
LuckPerms ๐
@lunar cypress Oh yeah, 15 uses makeConcatWithConstants
Damn, Kotlin has been pumping out new versions fast recently. Wonder why.
they scared of elara
I wonder if it's because Andrey left
Who's that?
ex*
yes
One of the co founders of Kotlin
was he a good guy?
good question
Was he? @prisma wave
hmm
he's ex Kotlin
he's not co founder of Kotlin according to his LinkedIn
yo I'm going to make a LinkedIn just to show people why not to hire me.
I wonder if singing in with google account is a good idea
using ur real name absolutely isnt
I guess project lead, i think he was founder no co, yeah
ye I'm going to make an account called Blitz Gamer
and gonna say I'm the best time waster
Yeah I believe so
going to ruin my future
He basically designed it all
ah. great man then!
ah that's why he says ex-Kotlin
well
because he was Kotlin
In mathematics, a tuple is a finite ordered list of elements. An n-tuple is a sequence of n elements, where n is a non-negative integer. There is only one 0-tuple, referred to as the empty tuple. An n-tuple is defined inductively using the construction of an ordered pair.
It's usually a very short, immutable sequence of values
terrible idea
Pair<A, B> < (A, B)
A to B > ^
That's still a Pair though
You couldn't put that as a map key
Whereas a tuple could
Fair
the cool thing about maths is that they use tuples for pretty much everything and you have to know the order to understand it
yo someone can give me a wiki or a course or something for java? and I'm not talking just basics and just briefly explaining them. I want something to explain me in more detail lets say. there are terms and stuff I don't understand or don't even know about or how to use. is oracle docs good? xD
oracle docs are pretty good
Kaliber I've read the entire docs of kotlin

twice
oph yeah i boosted server
or maybe even 3 times
wait elara has a discord server?
Yup
A Cartesian coordinate is just a Tuple right?
Or a matrix
you guys ever knew this?
The name Elara is a girl's name of Greek origin.
Elara, a lover of Zeus who gave birth to a giant son (ouch); it's also the lovely name of one of the moons of Jupiter.
Didn't know the first bit
it's also the lovely name of one of the moons of Jupiter
๐
But it was named after the moon yeah
shoulda called it Odrigga
welp idk how long the docs of java are but see you on the other side
well I know basics and stuff but if it is to make a big project you'd see so much shit in it that you'd die just from looking at the first 3% of it
fair enough
I mean I've taken a java course. not yet fully done I have like 1 week left but they offered their own custom classes to make it easier and stuff and dind't really explain. well it would probably be helpful for someone that never programmed but I have 4 years of C++ so the basics are not hard for me to understand for a lot of languages
yeah 4 years but believe me wasn't that much xD
like the teacher was great
and gave us a lot of tips not just about programming just life and other stuff. One of the best person I've ever met but due to us having a big exam after we finish high school to go to uni she head to spend most of the time to teach us what the exam required

like I can give you the hardest problem on the exam to see what's all about xD
it will take a while to translate unless google helps xD
Ok lol
not that this will help anyone just to understand what the hardest thing was to do after 4 years of teaching.
Q1:
Print Hello World in c++
10 marks
nah first question is always some simple math problem
like this was the first 3+5.0/2+2 and you have 4 variants to chose from
second is a recursive function
there are like 9 questions but they get "harder" very quick I guess
Yeah, if by cartesian coordinate you mean something like (a, b) because that would be an element in the cartesian product of the base set
yeah that's what I meant
And yes that's isomorphic to a matrix with one row/column
I guess that's also a polar coordinate though lol
Well, it is one possible representation of an abstract concept
This is what the linear algebra I'm doing right now is all about
im so depressed i made a big ass sorter in mc and it doesnt work
it took so long to build


rip
The widespread general "Server Optimization Guide" will fuck with hopper transfer rates
Messing with sorters
@forest pecan
can someone help me setup composter php im first time using it and i dont get it from toutorials its too much for me, but i really need it for my mc server website
dm me if you can help
its not that
the redstone
its broken
like the item just doesnt even go into the chest
lol
welp I've done it xD ```yml
The "expenses.in" file has 10^6 or less lines, each line containing three natural numbers in the range [1,10^2], representing, in this order, data on one purchase: The type of product purchased, the number of such products purchased and the price of a product. The numbers on the same line are separated by a space.
TODO: Print on screen the biggest sum spent on all products of the same type and the number of products that the sum was spent on. Design a runtime-efficient algorithm.
Example: If the "expenses.in" file has the contents under, on the screen will be displayed: 26 2
4 1 10
1 16 1
4 2 8
2 1 5
1 5 2
Extra todo: Describe in natural language the designed algorithm, justifying its efficiency.
this is what 4 years of C++ required from us xD
its just about being careful at reading the instructions. because they literally had 15 lines explaing this shit. and the words used are usually very weird. They're doing that intentionally. sometimes they even have to give points to everyone because their instructions are not specific enough.
also you're welcome for the xp lmao
late? its 3 am here so must be 1 am for you
?paste
Paste Services
When asking for help with a config/menu/code issue please use one of these:
(However we do prefer if you used our paste :))
โข HelpChat Paste - Usage
โข Hastebin
hastebin seems to be broken r/n
use another pasting service like the helpchat paste or pastebin since they have a dark theme now
even tho its not that good
oh ok
Basically, I'm getting errors on line 83, where it says "boolean current is already defined in the scope", yet when i comment that line out, when i try to use "current" below that, it breaks and says no defined variable. Am I doing something wrong?
that's a lot of else - if's
yeah its quite a few O_O
Is there anything im doing wrong thats throwing up the error? it worked before but now its no longer working =/
Tristate 
because he's a cool kid
WAIT I shit you not Bungee components api uses Boolean as tristate for decorations such as italics, bold and that 
Oliveoil, don't lkill me I was joking
fefo should i stream smp today

its pretty easy to make one
to prepare stuff
2 repeaters, 1 torch 4 redstone I think
its a multi item sorter
yeah
lol
I've done a lot of redstone but still there's a lot of stuff I don't know or just don't want to learn
does it make a difference? O.O
wait what
he's gonna stream SMP
I like to code, play video games like Minecraft and League of Legends, and talk. Currently Playing On: Minecraft SMP
ebic
blitz is there any chance you could help me figure out whats wrong? its still broke
Well darn
oh 5 viewers
can anyone else help? ;w;
Damn, I love it when I live chat with paypal for like 2 months going back and forth, and they finally wanted to schedule a call, and its literally just a switch they need to flip on their end
incase anyone finds a solution ill bump it ;-;
On line 83 remove the Boolean from it
Also any reason why you use that over the primitive?
nullability ๐คก
@prisma wave How jucky is this?
Stream.of(
new CropGrowthListener(boosterStorage),
new EntityDeathListener(boosterStorage),
new McMMOGainListener(boosterStorage),
new ShopSellListener(plugin)
).forEach(it -> {
if (!it.isPluginInstalled()) {
logger.log(Level.INFO, String.format(
"Skipping %s registration, as plugin %s is not installed.",
it.getClass().getName().replace(".", " ").split(" ")[4], it.getRequiredPluginName()
));
return;
}
it.initializeRequirements();
pluginManager.registerEvents(it, plugin);
});
lmao java
:C
quick question, can I just map.toString() -> write to file
Quick answer, yes
But I presume your real question is if you can read it to a map again
mhm
Map.fromString ๐
Oh yea not even using a map, it's a set
@prisma wave
plugin.server.onlinePlayers.map { it.name }.filter { it.startsWith(args[0]) }
``` can it be simplified?
I don't think so
damn ๐ฆ
Pls use sequences
heh
or use filter { it.name.startsWith(args[0]) }
make sure you are using a collection that preserve the order
that means not a HashMap / HashSet
order doesnt matter tho does it
i mean
like its all running at the same time
and in the wrong order
and its just an arraylist
@obtuse gale code?
one sec
why the fuck isn't String#format a non-static method smh
public static String format(Stringย format, Object...ย args)
throws IllegalFormatException```
Returns a formatted string using the specified format string and arguments.
The locale always used is the one returned by Locale.getDefault(Locale.Category) with FORMAT category specified.
A formatted string
IllegalFormatException - If a format string contains an illegal syntax, a format specifier that is incompatible with the given arguments, insufficient arguments given the format string, or other illegal conditions. For specification of all possible formatting errors, see the Details section of the formatter class specification.
args - Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by The Javaโข Virtual Machine Specification. The behaviour on a null argument depends on the conversion.
format - A format string
?
trim, repeat, charat, concat xD
nice logos btw https://i.imgur.com/g2MVCIE.png
Piggy, can you add a โ reaction to let us delete the message? (maybe only support+), to reduce spam in #development
Does Enum#values() return the enum values in order of entry?
yes
pog
d;jdk enum#values()
public static Month[] values()```
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
an array containing the constants of this enum type, in the order they are declared
wtf
LOL
works very nice pig ๐คฃ
still going
d;jdk Enum#values
public static Month[] values()```
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
an array containing the constants of this enum type, in the order they are declared
no 5 is the right one
it's just showing a child method instead of the right one
the desc is correct tho
wont be a better idea to make the menu work only for the message author @quiet depot ?
issue pls
I need some opinions.
I have a Mod class which can be enabled, disabled etc.
I also have a UI and some mods can change depending on the ui (e.g. think changing the speed of a player).
Would I have the Mod be able to access the UI and add listeners itself or do I have the UI have the listeners and tell the mod to update?
wew lemmo asking for help
I'm making an abstraction layer between the actual pointers and memory modification
so you can just use actual objects and not some memory address
lmao
@quiet depot opinion
@prisma wave opinion?
@frigid badge Oh hi
that would also mean I'd have to have the enable checkboxes be listened on from in the mod
no
This isn't MC right?
isn't even java or mc related
Yeah I'd say first one again
Bruh what? "eg. Think changing the speed of a player"
e.g. means example
I know Piggy..
is that the only thing you read from that entire message?
I naturally assumed he was making a plugin by that example
"I need"
he was providing a minecraft specific example to make it more understandable for us
UI shouldn't depend on any other part of the application
No Lemmo, I sorry, I just not very bright
Afaik
Is it just for enable/disable lem?
nah
no I mean as in the effect on the UI
nah the UI has sliders and shit
dropdowns
and they all need to update a mod object
Maybe you could try a pattern like MVVM or something then
Yea
Does anyone happen to know a really good and easy to use JSON storage (setters and getters ofc) library?
Gson
json simple ๐คก
aight, cheers
Moshi is faster if you're feeling quirky
Oh
@prisma wave Any idea what this warning means?
Type mismatch: type parameter with nullable bounds is used T is used where T was expected. This warning will become an error soon
operator fun <T> set(property: Property<T>, value: T) {
settingsManager.set(property, value)
}
The value
And what is settingsManager.set
<T> void set(@NotNull Property<T> var1, @NotNull T var2);
But for it to be Any? wouldn't T need to be T?
Alright, that makes sense, I guess T : Any fixes it
it should
@prisma wave tutorial whenโข๏ธ
okay so if I have git submodule repos, why wont the parent git module repo see any changes in the submodules
sealed interfaces?
yeah I got that part, I was more referring to the purpose
like what use could one have for a sealed interface?
they're quite niche
but Java is adding them so
it makes sense that kotlin would follow suit
What is the use of a sealed class btw?
in kotlin they're usually for fancier enums
Ooh okok
I hate languages having the same keyword but for different things
fucking java still hasnt added those
they're also often good because you can guarantee an exhaustive pattern in something like a when expression
it has
well isnt a preview
and its not lts ftr :[
Java's added sealed classes, but they're so verbose lol
What does it do in other languages?
I think java's implementation is pretty good actually
"verbosity is good"
Kotlin's requires all of the subclasses to be in the same file
whereas java lets you spread them out more
public abstract sealed class Vehicle permits Car, Truck
yeah I'm not saying Java's implementation is worse, I'm just saying it's more verbose
yeah
Sealed classes are used for representing restricted class hierarchies, when a value can have one of the types from a limited set, but cannot have any other type. They are, in a sense, an extension of enum classes: the set of values for an enum type is also restricted, but each enum constant exists only as a single instance, whereas a subclass of a sealed class can have multiple instances which can contain state.
@ocean quartz
The key benefit of using sealed classes comes into play when you use them in a when expression. If it's possible to verify that the statement covers all cases, you don't need to add an else clause to the statement. However, this works only if you use when as an expression (using the result) and not as a statement.
sealed classes can be seen as equivalent to sum types/unions
indeed
Gotcha, thank you
a finite known set of subtypes
they're mostly useful when you want to make a class that has a known number of subclasses
well... that's the point of them lol
and you don't want to allow pesky outsiders to inherit from them lol
that's less of a reason, in my opinion
because you could just make the constructor internal or something to achieve the same
yeah the main benefit is for exhaustive pattern matching afaik
the point really is that there is a fixed set of specialisations
int getCenter(Shape shape) {
return switch (shape) {
case Circle c -> ... c.center() ...
case Rectangle r -> ... r.length() ...
case Square s -> ... s.side() ...
};
}
Okay but this is neat though
oo
any idea why intellij freezes everytime i try access the Material enum?
ikr
is it just because of the amount of values it holds?
its humongous
i is
return when ๐
return match
Actually no, in rust, the return is optional, therefore, one could simply use just match ๐
noobs
let getCenter(Shape shape) => match shape {
Circle => shape.center()
Rectangle => shape.length()
Square => shape.side()
}
๐
the hero we need
wait how did I set an integer to Nan ?
not the one we deserve
Not get_center ?
you can only borrow so much from rust before you simply become rust
int x = NaN; doesnt work bruuuuuh
No upper case, just prefix t_ for types ๐
what happened to you as well
tier 7 what notion of color does it have?
ye true
man how did u end up 100k xp more than me bm
Kaliber
skill
we were neck and neck at like tier 6 ๐
๐
noobs
u fell off after your nitro expired
Tier nine is orange right?
but im not gonna grind out xp anymore so someone will probably overtake me pretty soon
idk
I think I saw it on my mobile
depends on what you want to code in js
you need to learn babel grunt webpack node express angular react and vue and a few others
lmao
angular ๐ฎ
It heavily depends on what you want to use js for
cause only knowing plain js won't get you anywhere nowadays
d;Object
public class Object```
Object has 10 methods.
Class Object is the root of the class hierarchy. Every class has Object as a superclass. All objects, including arrays, implement the methods of this class.
[18:54:37 WARN]: [PlaceholderAPI] Loaded class net.milkbowl.vault.economy.Economy from Vault v1.7.3-b131 which is not a depend, softdepend or loadbefore of this plugin. What are these random ass warnings i get for multiple different plugins
how can i get rid of them
just by editing the plugin.yml right?
some plugins just load dependencies from other jars because that's how spigot works (I guess?)
even if they aren't meant to
It is what it is
for example ChunkMaster loads kotlin from one of my plugins, even though is shaded on another package
as long as its not red im good with it
you can ignore it
is fine
you have to understand what they are
stupid things added by spigot ^
it dont break server
well if a plugin breaks it doesnt stop the server it disables itself
unless something malicous or fishy
is inside that plugin
Anyone able to hop on my server and help me test something quick
sure
what does "native" mean on kotlin?
Kotlin/Native is a technology for compiling Kotlin code to native binaries, which can run without a virtual machine. It is an LLVM based backend for the Kotlin compiler and native implementation of the Kotlin standard library.
makes sense
how would i go about simulation players on my server
i wanna test plugin with multiple players but i dont got alts like that
offline mode
how does that work
idk no authentication
yea
unit tests ๐
spark ๐คค๐คค๐คค
mad sus
Quick question, do I have to close the previous inventory if I wanna open the next one?
In newer versions yes
indeed
If I want to open a new inv, do I have to like replace the items or what
ye boi
thats fucked up
spigot ๐
wdym spigot
minecraft ๐
dogshit game
Bruhh
my file isn't building again...
I'm not sure why, it says that its building but there is no output file.
are there any known reasons why it would just not build?
Code plz
Theres a lot of code, which code in specific do you need?
where you trying to build the file
๐ฒ ๐งข 


