#dev-general
1 messages ยท Page 195 of 1
private static final Object nil = null;
Nil means more like 0 to me but
The football game is nil-nil
It's like empty instead of non existent i think
goroutines ๐ฎ
semantics
null is more traditional for "empty" but the 2 are basically interchangable in programming
please loop
What is it with all the Optional<Supplier<Optional<T>>>
Optional supplier
if x is nonpolite throw NonPoliteException()
Arc<Mutex<Option<Box<dyn u32>>>>
I like this example
feels like a dumb design
None
if x is niall
Option::None >> None
same thing
please turn off the electricity
I thought you meant python None
One thing I dont mind is OR and AND
Everyone seems to be making languages
But I have no need. My perfect language already exists. Rust. People just dont understand yet
what
go
please stop;
pbl
func main()
yes there would
no
rust useless
drop box using it
do you have a drop box account
No
No
there would be outrage and disorder without it
go
NOOO
Why do people make ugly languages
What are you on about bm lol
Gaby, why you calling everything ugly
sry mom told me to always say the truth :(
is called an o b j e c t
Just return an object array
Yup
Ez claps
No ??
Actually rust can do this
no it can't
Yes
:kEk:
Speical enum
it can't
fn read(token_type: &mut TokenType, text: &mut String) {
*token_type Changing its function
}
How do you use the return lol
Python can do that
ok
I mean the value
And yeah
oh
token, text := Read()
What is rust used for though
Fair enough
To rust things
enum CoolResult {
Success {obj_A: ?, obj_B: ? },
Error {why: String }
}
return CoolResult::Success(a, b);
๐
readability
Rust will be the new C and C++
ok
Is obj_A: ? something like objA: Any?
no
dumb language
I just put question mark
Tf is that
dunno
rust in "production"
what
too many symbols
@prisma wave they had to make use of all symbols somehow
there are literally about 350 symbols
option compile to pure null poiner check
alt 21
no stupid objects
dont care
elara only about 55 symbols
Browny checker
better language
๐ค
๐ณ
This was complicated to achieve, now working with <g:#123:#123456> up to 5 times
Any suggestion on making this better?
https://paste.helpch.at/cuyomalulo.java
Hey Matt, have you had time to work on that MF rewrite so I can do my stuff with it yet
mf msg, yes
Not yet sorry, it was super boring working on it so had to stop for a bit
super boring
me with the pdm rewrite
I can see that yeah, for me a project needs to be kinda challenging to be cool to work with, the rewrite had a bunch of copy paste, review, etc
I'll still work on it though dw
Html is nice
High Tier Machine Learning

html is the best javascript library for machine learning
How do I un-arrowify this piece of garbage?
private fun bakeAsSubcommand(): List<CommandVariance> = listOf(name, *aliases).fold(mutableListOf(), { list, name ->
list.apply {
variances.forEach { existingVariance ->
this.add(
CommandVariance(
linkedMapOf(
name to LiteralArgument(name).with(
permission,
existingVariance.requirement,
{ _, _ -> arrayOf(name, *aliases) }),
*existingVariance.arguments.entries.map { (key, value) -> key to value }.toTypedArray()
),
existingVariance.requirement,
existingVariance.executor
)
)
}
}
})
I don't see how to refactor this to make it smaller :/
Oh I guess I maybe don't need to fold, I could just map the outermost list
but other than that...
oh no can't map because of the variances.forEach
nothing
but in this case you're just adding an extra tab
that's a lot of spread operators
kinda disturbing
well yeah the one thing that bugs me is that I can't add new elements to the first place of a linked hash map
java.lang.NoClassDefFoundError: kotlin/jvm/internal/SpreadBuilder
What in the...
The kotlin lib is in the jar
implementation(kotlin("stdlib"))?
(or implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.4.0' in Groovy, for those of you who for some peculiar reason think that's better)
No, it was the shade plugin's "minimize"
for some reason, the spread operator inside a lazy {} block was not determined by shadeJar to be of importance lol
wait... minimize?
that sounds a bit counter-intuitive, as the whole point of shading is to produce fat JARs
yeah but you don't need all the stuff inside the dependencies you add. Only the stuff you actually call gets added if you minimize.
ah okay
No reason to include a bunch of methods and stuff you don't need in your application
yeah true
but aparently the minimize doesn't work reliably :/
Yo why tf did I write an NPE on my year 8 italian book
This was before I started java stuff...
๐คฃ what the fuck
Can I override a getter from an interface or whatever? Like if I have to override
getPassword()``` can I do that within the getter or do I manually have to do that method
Basically can I simplify this
data class User(
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private val id:Long,
private val name:String,
private val email:String,
private val password:String,
private val locked:Boolean,
private val role:UserRole = UserRole.UNVERIFIED
):UserDetails{
override fun getPassword(): String {
return this.password
}
override fun getUsername(): String {
return this.username
}
override fun isAccountNonLocked(): Boolean {
return !this.locked
}```
since the getters have to override and if I juist do val password:String the getter wont override
That also means I need to manually make the setters :/
@obtuse gale Try override val password: String
Odd i'd just keep the methods
Did you find this on a tutorial?
I never saw a tutorial that approached it this way (extending the UserDetails class)
Those spaces Aj, makes my eyes bleed
But considered upgrading to it.
Also, isAccountNonLocked wouldn't isAccountUnlocked be nicer :p
or just isAccountLocked()
Or that yea
Usually what I would do is make a new instance of org.springframework.User
Then on each page load/controller method load the database model from the User
Else I expect you risk the model becoming unsynchronised from the persistance context
Any suggestions as to how one would clean this up? https://paste.helpch.at/ukokesezot.java
Also,
isAccountNonLockedwouldn'tisAccountUnlockedbe nicer :p
@hot hull im not making the rules here.... tell that to spring
Why tf does Ctrl + W close chrome kek?
imagine not doing that to people in the computing classes at school
Why's my bulma burger not working
ctrl alt arrow-left/arrow-right is my fav
Why tf does Ctrl + W close chrome kek?
@hot hull it closes an individual tab
not chrome in general
I don't believe it's functionality unique to chrome
for example, sublime also does it
Kinda odd, but mk
Mind looking at my above link and giving me some suggestions on how I'd approach cleaning stuff like that up?
#getCreatorWrappers
return storage.getInformation().keySet().stream()
.map(this::getWrapper)
.filter(CreatorWrapper.class::isInstance)
.collect(Collectors.toList());```
creatorWrapper.setSupporters(+1);
+1 lol?
idk mostly looks fine to me tbh
@hot hull
Yea that's just bad method naming, it increments or decreases, should probably rename it (made it +1 so it's visible on what it does)
ctrl alt arrow-left/arrow-right is my fav
@distant sun yep :))
is it necessary to close input/output streams that are of bytearrays? and if not, should wrappers of those streams be closed too?
just close wrapper i beleive
niall what shit needs to go in my application.properties? atm ive got nothing and obviously it cant connect to a db
This project has been a rollercoaster of emotions
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.jdbc.time_zone=UTC
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
spring.session.jdbc.initialize-schema=always
spring.datasource.url=jdbc:mysql://IP/DB?useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&rewriteBatchedStatements=true&serverTimezone=UTC
spring.datasource.username=USER
spring.datasource.password=PASS
logging.level.org.springframework.web=INFO
logging.level.org.springframework.security=INFO
logging.level.org.hibernate=ERROR
logging.file.name=server.log
logging.level.root=INFO
spring.disable=true
I made resourcepack with custom data model and now few textures are mirrored idk why XD
anyone know how to fix this?
ok nvm i know
anyone knows uuid char range?
and is it increasing because registered minecraft user count
๐ yeah you are correct
It's from 0-9 and a-f, 32 Characters
About 3.26*10^16 possible combinations
something like 17 sextillion
minecraft 2 will use 64-bit uuids
soonTM
Minecraft 2 what?
Ah I see
256 bit*
its so cool ๐
minecraft 2 2 then
Lol
IntRange
object
In rust that probably narrows down to pure machine code with no overhead
Ping who?
Why?
What is broken on it?
who says u should have perms
Yeah i don't think you're supposed to have permissions for that
Not even support does
iirc i believe he said u dont have it as u can only make so many requests to Google per day or smth
uve never had it lol?
It was my 3rd fav command :(
Add the perms
it probably needs about 30 different types of punctuation to make though
๐
Sometimes you gotta appreciate small but pretty cool features from IJ
Poor design
Wdym?
Snip and Sketch but its Snip and Record
Sometimes you gotta appreciate small but pretty cool features from IJ
Breh I use that all the time
Sameee
EnumSet
Or pure bit falgs
private byte modifierFlags;
modifierFlags |= MODIFIER_BOLD;
if (modifierFlags & MODIFIER_BOLD != 0) {
}
Aa yes the ands and ors
EnumSet<ModifierFlag>
That is just overcomplicating it, and it doesn't even apply to my situation lol
Absolutley not
Each are required to be separate booleans because it'll visit each node and set and unset each time it does depending on the result
Ok
Er
Barry's =pl
Is it looking through all Spigot plugins or all Bukkit/Spigot plugins?
Almost sure it's just Spigot
Yes
ui
It's working ๐ฅบ
�[**this**](command: Test) **is &r*Sparta***
are you making a markdown web editor type thing
Ah &r only resets the color, interesting
Nah, that's just showing it working without me needing to open it in game
Basically just showing because I remade literally everything, no longer using regex for like everything
And yeah &r to reset color, couldn't make it reset format because it'd break a lot of stuff (also &m, &l) won't work for now
Wonder if I can make a builder in Rust
some_obj::builder()
.with_some_option(1)
.build()
Awesome it works ๐ฅบ
๐๐๐
feels like 1973
Sorry, wasnโt too sure where to post
Thank you
These are usually good projects 
inb4 "no rust"
Spring is an absolutely essential skill to learn
wheres SPRING
march
i said where not when ๐
Imma make the best plugin ever
I get a custom mc texture
That looks like thingy
That shoots colored snowballs
So its Splatoon but MC
:D
Hi, is there easier way to build structures by plugin than writing line by line which block to change? It's boring, weird to read and even hard to think about that
World edit?
^
Or for 2d art
Draw pixel art in photoshop
Than use that one program
that puts it in MC
mcedit I think its called. Might be wrong
But they are one time use solution, i need to be able place this automatically by plugin
But they are one time use solution
??????????????
Eh nvm
B r u h
I mean using the WE API is probably your best bet tbh

Er
Rainbow
Not even like rainbow letters
But gradient letters
Pog
Make Barry open source
^
no
First run time before caching stuff, it used to take about 46ms to even 80ms
Now it's taking less than 10ms
speed
@ocean quartz can you use kt extension functions on java? Are they like static methods or?
I actually don't know how that would look like ;o
I think bm said smth about a method that takes the object as param
I don't think you can though
@file:JvmName("DemoUtils") interesting
imo its cleaner to use import static i don't remember the exact syntax but its osmething like
import static FooKt.bar;
public void baz() {
bar("blah");
}```
odd flex but ok
Very interesting
IS it possible to disable enchanting/repairing a specific item in minecraft?
Ideally I would want a plugin that would completely disable anvil interaction but the thing is I want it for a specific item i.e. a special pickaxe I'm selling in the store
and I don't know if minecraft has "unique" item identifiers
right now the only idea I have is setting the repair cost to an absurdly high level like 10,000
You can probably use an NBT tag and then set the repair cost if that item has that tag
Yea you can use NBT tags for it
Yeah that's what I'm already doing I just wanted a cleaner way for lack of a better word
this approach seems hacky
wait, can I have like a "custom" nbt tag?
Not really, NBT is usually cleanest when it comes to non user visible info storage
Yes that's possible
since all instances of the item will have that repair cost tag anyway
This class is useful when it comes to easily assigning and getting NBT tags
(Server Version class which you'll also need for above: https://paste.helpch.at/qesanefaxu.php)
@author Rich Hickey
So just browsing through spigot checking random plugins main classes, and sheesh https://github.com/InventivetalentDev/NickNamer/blob/master/Plugin/src/main/java/org/inventivetalent/nicknamer/NickNamerPlugin.java
That's what I heard as well, but looking more into his plugins source codes I'm honestly just ewing, like some are "ok" but some are just sheesh
@hot hull her
no one ever said inventive was good at coding, she just makes useful stuff
I see
Isnโt she hired at hypixel?
lol
what we talking about in here?
@hot hull what are all those config values doing in the main class lol
i need help
There is no time to wait! Ask your question @abstract ledge!
and the horizontal alignment is just no
honestly, I expected better from Inventivetalent
@abstract ledge Don't we all, woulf help if you explaini your issue
i did in #placeholder-api , was that the wrong place?
Then wait for someone to respond
ok
Not the right channel
I swear I just spent like half an hour converting existing code from Kotlin to Python (because I wanted to write an example for people in Python, donโt ask, itโs a school thing), and I swear, after that, I donโt ever want to have to use that piece of shit language ever again in my life
@quiet depot I am now a proud member of the โfuck that Python shitโ gang xD
like every time you want to use an instance function or variable from an instance context, you have to use self
instance methods in Python are also a mess
I donโt understand why the fuck anyone would ever want to even remotely come anywhere near that shitty language
OOP in python is not nice
@prisma wave yeah... I found that out the hard way
Python doesnโt even have immutability
and itโs type system is literally worse than JS, like you canโt declare variables with types, but you have to explicitly convert between types
I mean... wtf?
It has sort of immutability
and itโs type system is literally worse than JS, like you canโt declare variables with types, but you have to explicitly convert between types
@jovial warren glad you agree that js > python

py is ew
fun getLevel(robotType: RobotType, level: Int): RobotLevel {
return levelsTable[robotType, level] ?: levelsTable[robotType, 1]
}```
Is this how you use the elvis operator thingo?
ye but there should always be level 1
what's weird about it?
puts every param in one line ๐ฆ
Change your formatting settings
Doesn't for me
@jovial warren not at the moment but yeah
because I unfortunately need to install a Windows system to play Roblox (and also maybe some other games), so I've had to turn to dual booting
fun getRobotByUuid(uuid: UUID): Optional<Robot> {
return Optional.of(this.loadedRobots.first { it.uuid == uuid })
}```
It says that `first()` will throw a `[NoSuchElementException] if no such element is found.`, is there a way to just return an empty optional?
problem is: I have an existing Arch Linux system, that is using MBR, because I couldn't use UEFI as my old board (which I was using at the time) didn't support it
I imagine you use UEFI right?
what I'm asking is if there's another way for me to be able to either:
- Easily convert AL to UEFI without having to backup my data, format the drive with GPT, and then grab my data again
- Make both systems use GRUB as the boot loader so I can pick, rather than Windows using its own boot loader, changing the priority, and always booting itself
- Another method that I haven't thought of
is it worth me migrating to UEFI?
@distant sun optionals in Kotlin are kinda unnecessary, but you can use firstOrNull
Potentially
well what should I use instead of optional?
wouldn't that mean uploading my over 100 GiB of data to a cloud service and then putting it back?
so just Robot?
yes Gaby
fun getRobotByUUID(uuid: UUID) = loadedRobots.firstOrNull { it.uuid == uuid }
```should work
though that's an expression function, which will probably confuse you
mhm
wouldn't that mean uploading my over 100 GiB of data to a cloud service and then putting it back?
@jovial warren if you think it's worth it. Ngl I don't know too much about bootloaders and things, but I'd say UEFI + GRUB is probably the best since it's always worked for me
can I dual boot with MBR?
since uploading 100 GiB of data on my internet connection will take hours
No idea
When server stop, is there a reason to delete or clear maps lists..
what
yes
I feel like when you write code and nut over it
uh
OnDisable()
Remove hashmap, list
Is not maps, lists removing automaticly on disable. You need to remove?
You shouldn't need to
I'm soury four may bed england
You shouldn't need to
@ocean quartz i see in forums a lot i was confused thanks
What kind of drawbacks?
The only one I can think of is it getting very hard to read if you overuse it
why are isSmall and setGravity different though?
like one is a variable and the other one a method
variable?
dunno how to call it
property?
isSmall = true is different than setGravity(false)
Kotlin uses properties instead of getters and setters if thats what you mean
It auto converts getters and setters to property syntax where it makes sense
^
Usually it's if the setter / getter isn't a classic setter / getter or if it's from an interface iirc
don't mind if I do ๐
@prisma wave i've been messing arouynd with what we were talking about earlier. is there a way to make the orUntil param type be Class<Event> so it could technically be any event without an error
https://paste.jaims.dev/yusuhuqela.coffeescript
Class<out PlayerEvent>
ah ok cool
infix functions can't have more than 1 param
F
they can in Elara
intellij plugin for elara plz
lol
what would be the best way to check if users UUID is premium or cracked?
but wait, that doesnt help does it, if server is cracked it will always be cracked UUID... hmm
u look for a 4 in the uuid iirc
you still gotta have somesort of premium UUID or something
Why do you want to know if they are premium or cracked? ;o
eh, i just want to test some stuff ๐
kinda want to do something for my private server.
i loved how FastLogin worked.
Haven't done this many commits in one day in quite a while
My commits are like "300 files changed - I forgot what I did here but hey, progress is progress"
xD
I have no idea which bugs they were, i don't even know what changed on that commit xD
For hacktober thing do you have to contribute to other's repos or to your own too?
I think has to be others
Others
Mhm
Matt, expect a lot of PRs to your stuff 
What's their website @ocean quartz
Sounds good to me 
9 Days to go
Will pr mf to add a comment saying "hacktoberfest"
If anyone wants ez PR, contribute to FJ 
do you mind if I break it?
I've got a PR ready for Floodgate and Geyser already
Anyone wanna help me redesign this message options stuff? ๐ซ
Basically reworking the old FormatOptions cuz it sucked
sout hello, world!
Does it matter how much you PR?
As in the actual contents of the PR, or can it be just random shit
I guess it has to be merged though
Currently it works like this:
Message.create(); // Defaults with everything
Message.create(FormatOptions.builder().without(Format.BOLD, Format.ITALIC)); // Removes BOLD and ITALIC
But currently this sucks
Yea that's kinda ew
FormatOptions.Builder maybe? (Inner class)
How about something like this:
Message.create();
Message.create(FormatOptions.include(Format.ITALIC));
Message.create(FormatOptions.exlude(Format.ITALIC));
Maybe
FormatOptions.builder().addFormat(Format.BOLD).removeFormat(Frmat.ITALIC).addExtension(Extention.create()).setDefaultColor(new FlatColor("blue")).build();
Jesus
I guess stuff cant always look pretty
Plus is better when is wrote on multiple lines
Yeah, just don't like the builder() method
Inner class
On my item builder I have ItemBuilder.from() which looks good, but can't do that here
How Gaby? A full example pls xD
of how it'll look
build() will return a FormatOptions object
just make Builder an inner class of FormatOptions and then add methods to it
What if create gives the format options, which you then use build with the get to final message
Look at Request.Builder from okhttp3
Because i'm trying to avoid needing to be like new FormatOptions.Builder()
mhm
Yup exactly what I said xD new Request.Builder()
I guess stuff cant always look pretty
๐
Welp
Static doesnt help?
Keep in mind that it doesnt have to done in one line
Like, the builder can be defined before being used
Yeah I might just go with that
Whats an open fun btw
A function that can be overriden
Ah nice
Kotlin is like the opposite of Java in that way, where everything is open and you have to mark them as final, while in Kotlin everything is closed and you need to mark them as open
My habit of Kotlin ๐ซ
it really do be like that ๐
๐ฌ
this might be useful for some peeps https://learngitbranching.js.org/
Oooh that's pretty cool ;o
Ty 4head @frigid badge
No
Yes
Yes
Tbh the only reason i do well with Git is because of GitKraken 
Www ew
Gang gang
b*
Im ok with left side
๐คฃ ๐
me too ๐
๐
And elara isnt even the problem lmao
what is
Also dumb question, but and EnumSet's contract is with a Set right?
asking cuz it's an abstract class instead of a direct implementation
the picture scares me
female*
๐
I'm pretty confused too like, EnumSet<?> set = EnumSet.allOf(class); or Set<?> set = EnumSet.allOf(class);
Yeah it's what i was thinking too
github desktop good
Hi
Hello
is it possible to create a challenge menu with deluxemenu resembling skyblock challenges
thank you
ok
@ocean quartz Git isn't even that hard lol
git branch checkout rebase fetch stash --force -b master set-url --cached -rm a6b21f9 merge --vim
Ez
okay what
that's multiple commands in the same command, which isn't possible afaik
first startups: ```
git create
git remote add origin git@whateverthefuck:WhateverTheFuck.git
git commit -m "Messages oof"
git push -u origin master
ez right?
you forgot the last one
which is?
git commit --force rebased <sh:84ac21d> --no-preserve-root -v -u .git@github
@jovial warren I know lol
replacing sh:84ac21d with the latest shortened commit hash of your upstream ofc
also git init*
you also need stuff for like forks and merging and shit which gets more complicated
which is why something like gitkraken or gh desktop is good
git fork merge origin/remote master/knightzmc -repo PDM -b rewrite --force --accept-upstream
not that hard really
idk i think its easier to just use one of the git GUIs cause then i don't need to remember all that stuff
how can you not remember it
it's easy
Specific git-branch actions:
-a, --all list both remote-tracking and local branches
-d, --delete delete fully merged branch
-D delete branch (even if not merged)
-m, --move move/rename a branch and its reflog
-M move/rename a branch, even if target exists
-c, --copy copy a branch and its reflog
-C copy a branch, even if target exists
-l, --list list branch names
--show-current show current branch name
--create-reflog create the branch's reflog
--edit-description edit the description for the branch
-f, --force force creation, move/rename, deletion
--merged <commit> print only branches that are merged
--no-merged <commit> print only branches that are not merged
--column[=<style>] list branches in columns
--sort <key> field name to sort on
--points-at <object> print only branches of the object
-i, --ignore-case sorting and filtering are case insensitive
--format <format> format to use for the output
idk i probably could i just never took the time to learn it cause there was a gui available
ยฏ_(ใ)_/ยฏ
yeah there isn't all that much to remember
just git remote and git push for IDEs such as IntelliJ, since the rest of the stuff can be done without commands (I know pushing can be done without commands but it's terrible lol)
i was wondering if you were joking
but you also know a lot abt this stuff
so i figured you were serious
Are you guys playing with unicode font on or off?
Gucci
no
@quiet depot Does your hotswap guide https://www.spigotmc.org/threads/guide-windows-extremely-productive-development-environment.394754/ work with gradle dependencies changing? I can't seem to get that to work correctly.
Warning, it's pretty funky with Kotlin
nearly 100% chance that it doesnโt
I have it working for my plugin but it has a dependency on a lib jar and when I change that lib jar and refresh the gradle dependencies to rebuild the project, it doesn't seem to work correctly
doesnโt kotlin have itโs own hotswap thing?
and hotswapping says "nothing to swap" or something like that
yeah that wouldnโt work blocky
I think so, but even that one if i am not mistake is pretty funky
hotswapping doesnโt rely on your build tool with your buildtool
yeah that wouldnโt work blocky
@quiet depot Why not though? Doesn't hotswapping rely on the plugin jar in the working directory?
I am not quite sure how that works actually
erm it does, but hotswapping doesnโt actually update the jar file
it changes the bytecode at runtime
or does it build the project and then hotswaps the classes with the same package names in the working server jre?
it changes the bytecode at runtime
@quiet depot Only the direct plugin bytecode though, not the dependency bytecode for some reason?
Like I don't quite get why or how tbh
I already told you why
No I understand it doesn't rely on the build tool
but the lib is still in the jar and in the bytecode
how so?
but thatโs merely a file on the system
that doesnโt affect whatโs actually on the server, in memory
but if the plugin uses the lib methods that means it has to be part of the jre classpath at runtime (not sure I used those words correctly but you get what I mean hopefully) no?
So the lib classes get added to the jar via gradle. the jar gets placed in the plugin folder. the server gets started in intellij. that server loads the plugin with the lib methods and stuff. so far so good?
yep
what is it trying to swap when I trigger the swap action in intellij?
like which classes does it try to swap?
only the ones part of the current project?
Iโm not exactly sure how certain classes are triggered for swapping, I assume the hotswapagent plugin simply monitors source files
but itโs only swapping files you edit
that includes resources iirc, not just classes
however, things like dependencies are not part of your source set
ah yeah I can't edit dependencies directly from within the project
theyโre added during the compilation, by your build tool
makes sense
and your build tool is only triggered for the initial compilation
any compilations after (i.e. hotswaps) are handled by intellij/dcevm
any chance of telling intellij to compile the lib as well?
I guess I'd have to tell it to add the source as a dependency, not the compiled jar itself
so basically a module...
But does intellij know about gradle submodules though?
if it's a gradle submodule, that's again just the build tool
IntelliJ won't compile that after the initial compilation either
Maybe composite projects...
I'd have to look into that
I think I will go with composite builds. That way all the projects are independent and the lib can be shared freely between all plugins, without having to have all plugins within one single gradle project
It seems that they get added to IntelliJ all the same
Piggy how would you abstract 2 classes that are basically the same except one uses a JsonArray and the other a StringBuilder? (to append components)
having a brain fart right now
check if JsonArray implements Appendable
Then you could do something like
AbstractClass<T extends Appendable>
and then use
JsonClass extends AbstractClass<JsonArray>
and
BuilderClass extends AbstractClass<StringBuilder>
It isn't Appendable, they are pretty different
then make a JsonBuilder class that extends JsonArray and implements Appendable
and use that instead of JsonArray
Interesting, i'll leave that for tomorrow me though, brain is frozen right now
and ofc map all the appendable methods to the appropriate json array methods
Anyone got any thoughts on how comprehensive and doable it would be to recreate ARK in MC? Cause like that'd be cool af
Whats ARK?
That dinosaur game thingy from 2-3 years ago?
ARK survival or whatever
?
Ark survival evolved yea
Would be really cool and somewhat unique. I don't think it would be an easy thing. But definitely doable
sounds like a cool project....
It does haha
Someoneโs gonna make ark in minecraft? Wth
I mean most stuff is doable, just the different building stuff doubt it would be
I mean pixark exist?
Well yea but that's completely different
What does Ark consist of? Im not really familiar with the game
The only part I have seen is on youtube about taming dinosaurs I think
I mean most stuff is doable, just the different building stuff doubt it would be
Depends who is doing the building I guess. But I don't have much skill with building so not sure.
No I mean as in, ARK uses a "template" style building for components, it'd be pretty hard to make that in mc, especially trying to display and manage where the component will be placed
Civs?
That uses entire buildings, which I guess could work, whereas ARK uses components (ie. foundations, walls, roofs, etc)
Ah I see
There's still a few other major things which I doubt are doable, or easily done since mc gae
No clue
I mean if they did that, performance would be a non existent issue
I guess so
However there's still so much of the game which is "hardcoded" that really doesn't help when trying to do custom af shit
I mean that could come to a change
Let's hope so
Wdym?
No one even really talks about or uses 1.14 lol
inner iface should have @FunctionalInterface smh
actually thatโs not inner, itโs just @heady birch โs bad formatting xD
Quick question fellas, so I have an enum which indicates my "user" statistics (health, stamina, oxygen, weight, etc), and now I have an experience statistic, however I'm not sure if I want to have that in the same enum as it's completelly decoupled from the user stats (if that makes sense)
Quick question fellas, so I have an enum which indicates my "user" statistics (health, stamina, oxygen, weight, etc), and now I have an experience statistic, however I'm not sure if I want to have that in the same enum as it's completelly decoupled from the user stats (if that makes sense)
@hot hull Couldn't you make a enum for other stats like exp, exp level, achievements, etc?
Idk if exp actually fits that criteria
Isnt the annotation just for reflection or something bardy?
@steel heart
That annotation just tells the IDE that that interface is supposed to be a functional interface and thus should only contain exactly one function to be implemented

Heres an example. It helps the IDE to remind you to have only 1 function there
Well the experience is a statistic, however is more "general" than the other ones, since it's used in everything, instead of just specific things like the weight and health
Quick question, should I store a level for certain statistic as well, or would it be good enough if I already have the base value, and the level incrementation so I can just do math to get that level?
Thoughts on the format of this? I dont love it.... Maybe too many colours? Or maybe the blues too bright? idk
the click [here] thing? Im using Matts lib for that, https://mf.mattstudios.me/message/mf-msg
idk how youd do it without it, heres the code for that message...
Message.create().parse("""
${ORANGE}$playerName ${AQUA}has challenged you to ${RED}**$gameName**\n
${AQUA}Click [${GREEN}**[here]**](hover: **/accept $playerName**|suggest: /accept $playerName) ${AQUA}to accept,
${AQUA}or click [${RED}**[here]**](hover: **/deny $playerName**|suggest: /deny $playerName)${AQUA} to deny.\n
${GREY}Please note this request will automatically close in 30 seconds!
""".trimIndent()).sendMessage(player)```
I mean it probably is
I just use that lib to make things easier for myself
you can probably do shit with /tellraw if you tried hard enough
Should simple stuff be done async? Like putting a value into a map or whatever?
so in reality what should be done async, if you arent meant to interact with spigot for the most part on another thread
There's no performance increase and you increase the risk of things like race conditions
Intensive calculations
IO
Etc
Things that will take a long time to complete
ah
Yeah race conditions are bad
tf is a race condition
fun removeAllRequests(requestor:Player){
requests.filter { it.requestor == requestor }.forEach { requests.remove(it) }
}```
Also is there a better way to do this? idk why but the way im doing it feels kinda weird
oh wait
requests.removeAll
Yes
๐
fun getRequestByRequestor(requestor:Player):Request?{
return requests.find { it.requestor == requestor }
}``` is that what .find does? Just returns the first one it finds matching the predicate?
not true
so why are there two
find will return an empty list if it finds nothing afaik, findOrNull returns null if it finds nothing
or null if no such element was found
yeahhh
Literally the exact same documentation
almost
thatโs really weird, since single for example throws a NSEE if itโs empty
NSEE?
NoSuchElementException
ah
when youโre in Physics giving development help over Discord whilst everyone else is going through homework you didnโt bother to do lol
why can I see private there?
Hehe maven goes brrrr
Why y'all talkin shit about private here
Maven goes โIโm so trash you should just use agrรกdeleโ
^
@obtuse gale bruh that spacing after , bothers me so much..
Why y'all talkin shit about private here
Iโm worried thatโs a field
didn't he say it was a list?
oh lol fair enough
Quick question, should I store a level for certain statistic as well, or would it be good enough if I already have the base value, and the level incrementation so I can just do math to get that level?
@hot hull
also, you should learn what an expression function is @obtuse gale
I know what it is lol
I just havent been using them
Im inconsistent af for some reason
fun createRequest(requestor: Player, requested: Player, gameType: GameType) {
val request = Request(requestor, requested, gameType)
requests.add(request)
Bukkit.getScheduler().runTaskLater(plugin, Runnable {
requests.remove(Request(requestor, requested, gameType))
}, 600)
}``` this the best way to remove from a list after 30 secs?
also also, why set requests to private when you could allow users to use property syntax on that?
wdym
Smh
isnt it bad to expose the lists fields directly or whatever?
Let me give you an example
Let's say Weight is my current desired stat, which has a base value of 100.0 and an incremental value of 1.3.
The user can now level up that stat and it will increase by the incremental value each level.
Should I now also store the level that it is at, or would doing simple math be fine for getting the level?
Why you creating 2 identical Requests
property syntax means you can just call MyClass.requests[myindex] instead of getRequest or whatever
Why you creating 2 identical Requests
because I no smart and forgot to change it
small brain logic xD
Bruh don't be dissing my boi Aj like that
property syntax means you can just call MyClass.requests[myindex] instead of getRequest or whatever
mmm, but I never need to call .get on the list so
what about inserting elements?
I still thought it was bad to directly access it like that as well...
Just because a feature exists, doesn't mean you should use it everywhere
requests[myindex] = my new element
Let me give you an example
Let's say
Weightis my current desired stat, which has a base value of100.0and an incremental value of1.3.
The user can now level up that stat and it will increase by the incremental value each level.
Should I now also store the level that it is at, or would doing simple math be fine for getting the level?
@hot hull Do you actually need the base value? if don't, i'd say store the actual value
@hot hull I'd store the level too, you can't always guarantee that the algorithm would be easily / quickly reversible
Unless I misunderstood
Well it's a consistant increment so it would always be the same speed
Well division is pretty quick
I'd only store the level and the value is calculated
I'd store it purely for convenience
Also, yes I need the base value
since it's 100 + 1.3*level
anything to do with maths is done natively using C, meaning itโs super fast, probably some of the fastest operations on the JVM
No doubt, but a math function called 20 times per sec for x players is not really efficient
Couldn't you use a hasmap?
Simple division is neglible
Like, <basevalue,actualvalue>
Simple division is neglible
^
Might be better to just store the level as Lemmo said yea
However I'd store it for convenience rather than for an optimisation
as I said, maths is computed natively
Sure
pretty sure most CPUs have an instruction specifically for multiplication / division
But that's besides the point
the ALU handles logic like maths
MUL/IMUL in assembly
ALU = Arithmetic Logic Unit
the ALU handles everything lol
Funny thing is that i'm studying how cpu works rn
and all it does is maths anyway
Like, my degree is in software engineering
true lemmo
It is all maths!
and registers

