#dev-general
1 messages ยท Page 354 of 1
BM you any good at profiling?
memory safe circle jerk time
there's 6,470 non-CPU-profiled classes ๐ฅฒ
7,207 total classes
yeah something is wrong
24 total threads, good to see that's working
Does it not show you the objects using the most?
memory leaks?
Lol
Why not
and block states
1024 block state longs for every section in every chunk
so that's (1024 x 16) x ((render distance * 2 + 1) ^ 2)
Ok lets be real how many blocks have a block state I wonder if their is a way you can reduce that somehow
Im probably talking rubbish
this is how many of those longs are being allocated
lemme just do the calculations for the 10 render distance I use on the server
right, ready for this?
7,225,344
it's 16,384 per chunk
or am I wrong actually
yeah I'm chatting shit
it's not 1024
it's 4096 ๐ฅฒ
so 65,536 per chunk
x 441 chunks = 28,901,376
yeah...
is that a lol?
if I didn't, I wouldn't load them
I mean, I could do what Mojang does, where they have a ticket system, and any chunk that doesn't need to be loaded gets unloaded
that sounds like garbage collection for chunks
its chunk unloading
which seems to be exactly what you need
yeah that's basically what it is
but I need a lot of chunks loaded at any one time anyway
since the client needs them
and re-loading chunks when the client moves between them seems a bit inefficient
when something you made is in the top 20 for most memory
there are 3,682 NamespacedKeys
and 3,666 RegistryEntrys
right, round 2
omfg there's 343,720 namespaced keys now
and 339,180 chunk blocks
107,136 chunk sections wtf
16 chunk sections x 441 chunks
7056 chunks is a lot
something's wrong here
no, 7056 sections
yeah but it's very far from 107,136
mhm
funny how the longs disappear if I run a GC
like completely
that just proves that they ain't used after that point
which means if there's no references then they will get loaded again when another player joins
weakreference
ah
any from the wiki.bristermitten.com website
probably
yeah
I think you can declare a module like you would a package
it doesnt need the =
elvis operator in f#
Okay thats pretty nice
looks like a funky regex boi
i kinda like it
this F# thing is kinda getting to me
yea u cant use : in custom operators so i had to improvise
it's hot
yeah cant use bind here
Actually does haskell have anything similar to this ๐ฎ
maybe fromMaybe
But no operators ig
yeah true
(?:) :: Maybe a -> a -> a
maybeA ?: b = fromMaybe b maybeA
{-# INLINE (?:) #-}
That works ig
not bad
as a purely oop developer, that is an extremely confusing set of symbols that somehow do something?
ok
beautiful isn't it?
cuz its more hopeless
??
than just saying help
what do you even need help with lol
When someone feels hopeless or does not know what to do about something. So it is used in replace to "well" sometimes in a conversation. A combination of "help" and "well".
and why you gotta be so weird about it
Why do I have to explain you basic things
if you need help then #development
lemme try explain this because why not
(?:) this is just the name of the function. () denotes that it's an operator with special symbols
:: this is just the same as : in kotlin
Maybe a -> a -> a this is the signature of the (?:) function. In kotlin terms it's Maybe<T>, T -> T
although slightly different
https://i.imgur.com/H8v1o83.png what have I done
no players online, 2GB RAM
very nice
hehe
actually I'm on
run GC and that drops hard to like 200 MB
but you can have a vanilla server run on like 1 GB with like 5 players or something
maybeA ?: b = fromMaybe b maybeA
this is the actual function body. it's basically ```kt
fun ?: (maybeA, b) = fromMaybe(b, maybeA)
wait what's that?
the types dont need to be specified because we declared them in the previous line
elvis operator in haskell
{-# INLINE (?:) #-} and this is just some marker to say that it should be inlined
man, we need those in Kotlin lol
custom operators?
yeah
https://img.bristermitten.me/mstsc_crsDgN6Wlb.png f# elvis operator
oh so is that the elvis operator
i don't think I know what : does in kotlin
I don't know what T -> T means in Kotlin eitehr
(T) -> T
Yup still lost boss
val x : Int
first class function*
still don't know what that be
(Maybe<T>, T) -> T
(T) -> T is a function that takes T as a parameter and returns T
forgot u need parens
oh like a lambda
yeah
I swear if you've been using Function<T, R> all this time
yup
|| I won't say anything this time ||
I really don't write that much Kotlin
|| you just did say something ||
I wish I did, I just don't have much reason to
haskell > kotlin
oh also, I just noticed something
@ocean quartz why tf do you use 1.4 line spacing lol
I use the default lol
way too fat for me
I use 1.2 lol
1.2, Fira Code Medium, 15
perfect font settings
Yea
Another awesome one is overloaded strings
Allows you to use custom string types like the native one
ooh
No
Kotlin has operator functions
so Kotlin allows you to override the functionality of all the operators
you don't even know
But not new ones
You can only modify the ones already present in the language
Unlike F# and Haskell ๐
e.g. ```kotlin
class MyClass(var value: Int) {
operator fun times(other: Int) = this.value * other
}
actually that's a terrible example but you get the point
oh also, any suggestions on what I should do about the scheduler?
better languages
like should I use an executor? coroutine dispatcher? both?
might expose both for compatibility
yeah
like expose the dispatcher and its backing executor
or is that a bad idea
Could you actually override the Dispatcher.Main?
How does android and javafx provide their own Main dispatchers?
ยฏ_(ใ)_/ยฏ
Might wanna check that
why would I make my own main dispatcher btw?
To make switching between the server thread and user threads easy
What thread pool does it run on?
so fj common pool
I believe IO uses a dispatcher scheduler if it can, or else uses FJP
from what I read in the code
I mean if you ever wanted safe mutability somewhere ig
Thats what android does for its UI
You cant change anything on the UI from other threads
Just throws an exception if accessed off thread
yeah ik
oh btw, just looking at LuckPerms, it has an interface called ClassPathAppender, which is for adding JARs to classpath
any idea how I could implement that?
Link
I think it's part of LP's new jar in jar system
just be as smart as Lucko and I'm sure life will come easy to you
he came up with jar in jar to allow hackery on Java 16 lol
wdym hackery?
he does what PDM does basically
Also why the "jar in jar"?
downloads JARs and loads them into classpath
ah
that's why the LuckPerms folder has a lib folder
he made an actually useful PDM basically
with relocation
๐คท
what u saying
lol
I'm saying that PDM is a BTEC LuckPerms lib
Wait what?
only British people would get that
other way around
Wait so pdm could still work after java 11?
yes
Why arent you remaking it yet my guy xD
I thought you just gave up coz it wouldnt work after modules got added
to bypass hackery
that makes it work in a non hacky way
whereas before it did things with reflection
It's sad ๐ข
๐ฅฒ
thinking about Java 16 stuff, I wanna see if Krypton will run on Java 16
Why wouldnt it?
idk, not sure if any of the dependencies use any hackery
Java almost always focuses on backwards compatibility
yeah but if one of the dependencies is using reflection to access something it shouldn't be then we got problems lol
I mean in the context of breaking modularity
What such dependency would you be using?
idk, Netty? Retrofit? something that uses reflection
What are the Java 16 reflection changes?
Lemme check
none, just modularity changes
you know how in Java 9 they warned everyone about encapsulation with modules?
well as of Java 16, they now enforce that strong encapsulation
Oh java 16 got released today?
it's now, by default, set to whatever tf
It did yeah
Doesnt look like anything affects reflection
https://metebalci.com/blog/what-is-new-in-java-16/#jep-396-strongly-encapsulate-jdk-internals-by-default
This may affect4 classloaders
not sure
yeah that's what I said
that's what everyone's talking about
that's the thing that BM said could be the end of PDM once
and what caused lucko to implement jar-in-jar
Yeah that's why i asked
I mean I think removing open use of classloaders would be a step back
They most likely wont change that
the internal class loaders shouldn't be used though
A lot of projects depend on them working
e.g. the bootstrap, system and application class loaders
Those cant be used even rn afaik
I asked a stackoverflow question about dynamically loading jars in java 16 https://stackoverflow.com/questions/66698942/how-do-i-load-jars-into-the-runtime-dynamically-in-java-16
maybe someone will find a way
๐ฅฒ
that's an entire post right there
probably no one will answer. to much to read
lmao
It did block that?
Yeah
oh actually, should I just expose a scheduled executor service for scheduling and be done with it?
or can I unfortunately not do that
maybe I should just back it with SES
wut xD
lol
lmaoo
oh also, is it worth having tasks bound to plugin instances?
i mean that's just how bukkit is
I never really considered if that was a good idea lol
it's good for debugging
would make it easier if I could just use pure SES lol
I mean I think it's necessary to some extent, plugins disabling and all
Yea
plugin disabling is a very long way off yet
Or you could have a separate lifecycle handler and observer
like them disabling themselves while the server is still running
Let users create new lifecycle handlers and observers if they want as well, tasks die when their initializing lifecycle handler gets the Dead state
You would have a some class that holds a lifecycle state, lets say for eg: "LifecycleOwner" who would know its current state in the plugin's lifecycle. By default you would provide a plugin with a lifecycle owner. To create a new one, the user should have to link it to another lifecycle owner. The lifecycle owner should receive changes to the plugins state like "Initialized", "Dead", "Reload" or any extra states you may have. This state would be passed to all linked lifecycles.
Then you could have a lifecycle observer which can be registered in your "LifecycleOwner" which would be called when any state in the owner changes, so the plugin can make required changes.
So when applying this to tasks, You would take a lifecycle owner when leting users schedule a task, and then you would internally register a LifecycleObserver to that owner. So when the owner goes into the "Dead" state, you can cancel the remaining scheduled tasks...ect...
as you can probably tell, I got literally none of that lol
what's the actual point in that though?
no access ๐ฆ
Having things not run when its not expected to
ah right
hm
Conclure is popular now. he'll forget about all of us in less then 2 hours
why does my 1.8 server take 5 seconds to startup
but my 1.16 takes 40 seconds
;-;
because 1.8 sucks
my 1.16.5 server takes 7 seconds to start with 20 plugins on it ..
how
easy
mine takes like 40 seconds with 10 plugins or smth
just know that plugins usually add a lot to the start time
that was a joke but 1.16.5 on paper takes a few seconds to start with no plugin.
like 4-5 max
[17:29:45 ERROR]: [CPSCounter] Unhandled exception occured in onPacketSending(PacketEvent) for CPSCounter
java.lang.IllegalStateException: Override onPacketSending to get notifcations of sent packets!
```what does this mean?
?
nothing
Is JetBrains Academy good? I have github student dev pack aka free jetbrains products.
yeah
BM recommended it so it must be good ๐ข
PHP sucks
๐ controversial opinion there /s
1 thing that was fixed in the latest windows update and I don't hate is that my pc finally starts in dual screen every time. I don't have unplug and plug back my hdmi cable
why are chrome extensions so annoying to make smh
FOSS?
bcz google sucks
Free open source software software
software software
object oriented programming programming
lol
Programming Object Oriented Programming
Object Object Programming
FAP
Functional Accountable Programming
YAML Yugi Accountable Multiparadigm Language
@half harness At it again
Pin it
------------__________________________________________------------
Why do you like wet code
DRY
i just cba to make a new method
for 5 lines of duplicate code
that only happens twice
That's how you create spaghetti code
"It's just twice"
"Ay only one more time won't be bad"
cap
but why
Yes
Wdym no one uses?
lol
Well because VSCode is not an IDE and it's not for Java lol
vscode is garbage for plugin dev compared to intellij or even eclipse
highly doubt that
sure, 100x slower with 100x more bugs
Gradle is still building though?
You can code plugins on notepad, doesn't mean it's good
Does it still affect build speeds?
builds are barely important in an ide
Can you welp me
It affects a lot of things, VS code is a text editor, it's not exactly made for things like Java
any idea if there's an api for displaying items texture on a website?
Yeah ik, but it has a lot of java extensions
sounds like a #development question n3w0rk
Give it a shot, if you like it you use it, it's horrible though
ValdemarF trying to use vscode for java development is like hacking together two bicycles, adding an engine, and calling it a car
Ehhh what?
ahhh I see
lmao
I thought you told me to try and do that in vs code lol
adding an engine to this and calling it a car
yes, it has 4 wheels, yes it moves, is it a car though? Should it be used as a replacement for a car? Ehh
birds are going to shit on you and pebbles are going to fly in your face
it wonโt be a nice experience
just get a real car
Lol, I see what you mean I just can't see any examples of when Intellij is better
just use intellij
I used Intellij before, but now vscode
if you canโt find anything, then you probably werenโt using intellij anywhere near to its full potential
Only switched because of the codetogether thing tbh
It's nice to have though
it nearly never works out in the real world
IJ hascode with me as well
yeah ^, also floobits, take your pick
The other person used VSCode already and the one in intellij is slow af
not for me
Weird
For me it had like 3 sec delays and it kept going around when writing
3 seconds??
yugi does code with me have the same issues as floobits? As in you both canโt edit the same file at once
That part worked though
in code with me
In intellij
aight
But where can I learn to use Intellij correctly then?
intellij has tips every time you open it, they also make videos on little known features
Yes afaik
Havent used it yet
essentially though, the idea is, if youโre doing something manually outside of your ide
thereโs a good chance you could automate it inside your ide
But thats what bm said earlier
I think i tried it with Gaby and we could edit the same file, but i could be wrong
ooh
e.g. if youโre dragging a plugin from your build folder into a server, and starting it up via a command
you could automate that in intellij
Problem is that I couldn't get git to work correctly in intellij, and noone was able to help
make it all happen from a single button
Does it only apply to ij ultimate?
yikes
I cant find it on the other IDEs
yugi did u check out papi 3?
ah
I was told to interview this dev and he said "maven is easier than gradle" 
lol
Idk how that's possible.
it depends on the context
gradle indeed has a steeper learning curve in general
but you can't say something is easier or harder than one another
just cause its learning curve is steep
Welcome back @pale shell
Hi, @regal gale.
No.
oh nvm then
I don't know anyone.
oh ok
lies
?
Reduce the font from settings if you want to?
rip
ok its back
Personally, I like it at that font size
๐
Easier to read
๐คท
these are my font settings
the more I see the better for me but not smaller than 12 because that's too small
20?!
ok
um
how do i change console font
console font is big
but editor font is small
lol
I think that's appearance
where?
I'll tell you in a bit xD https://i.imgur.com/NQVaMNK.png
xD
i dont use custom font
or just the rest
๐
where's that at?
the file
yayyy
it worked
no fonts changed
just color
this will take some time getting used to
lol
i might change it back
ngl
xD
I really like it
Same
this personally literally has 52k commits
for the past year
Sounds like someone made a commit bot instead of doing their work lol
honestly lmao
yea it is
its every hour
lol
the duality of helpchat, either 5 conversations at once or literally silent for hours on end
!!

What's your name? md_5?
Lol
Thinking about md_5, I think he had a seizure yesterday lol
Result of looking at Conclure's DeluxeAsyncJoinLeaveWhateverTheFuck
fantastic plugin ๐
About the first time I've seen md_5 talk in a while lol
I still gotta figure out why a 10 render distance (441 chunks) is allocating over 100k chunk sections (16 sections per chunk) ๐ฅฒ
Wait where was this?
md_5 saw krypton?
No
I think I confused you
He spoke about Conclure's DeluxeAsyncJoinLeaveMessage
Lol
Where?
Spigot Discord
Ah okay
^
Someone on PC search by messages from md_5 and link it lol
#694661573125472256 message
What I meant by md_5 going insane
holy shit did Conclure's code inject him with LSD lmaoo
Lol
What too much async does to a mf
bm, what did you use to cross compile go?
oh wait
I might have got it to work
ok yea, weird wasnt working earlier
yo stop insulting my race
AbstractAsyncConclureProviderFactory
jesus what is that md message lmfao
my monitor is not big enough to see exactly which ones you marked
The first means exclude from serialisation
The second means the state of the variable is shared and updated across threads
The third are just random type annotations
String joinmsg = Bukkit.getPluginManager().getPlugin("").getConfig().getString("join-msg");
idk if "" is ok in getPlugin
what
what should i put after .getPlugin?
i mean i did .getPlugin("") because i can't just ()
should i put my plugin's name?
if thats ur plugin then u shouldnt be doing that
^
You should be using DI
If you need to get a different plugin then use the name of it
i'm doing that in another class
?di
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
yes so inject the plugin instance
getPlugin(java.lang.String)' in 'org.bukkit.plugin.PluginManager' cannot be applied to '()
oh i need to inject my main?
yup
ohhh okay ty
@NonNls indicates that localisation tools shouldn't localise the annotated string @obtuse gale
It contains nothing that can, or should, be localised
Oh btw, thinking about JetBrains annotations, is it just me or is @Contract so much cleaner than Kotlin's contract DSL
Kotlin contracts are big ew
Actually they're not that bad, just the annotations look better
hm so I tried setting up OpenSSH on a windows pc (for using sftp)... but I couldn't get it to work.
When I did ssh Username@localhost, no password worked, including the computer pass. (and I replaced Username).
Anyone have any ideas? (Note: I dont have access to the pc rn, so im just trying to look for ideas)
and in the Services, OpenSSH was enabled and running
why are you sshing into localhost
because i didn't want to switch pcs
later i'd ssh from different pc
but for now i want to just do localhost
๐ฆ
um.. how come when i type the following in request-free, it says it doesnt meet the guidelines...
[service] Custom Plugin
[request I need a bukkit plugin that implements minecraft manhunt in version 1.1 of minecraftminecraft
it's [request]
you forgot the ]
oh my bad
bump
Iโll bump you in a minute
;-;
Kinky
Lol
I started writing a backdoor cause i was bored lmao https://github.com/PulseBeat02/Among-Us-Backdoor
a
bump ๐ฆ
2
Space
Indent
lmao
that creates a batch file that runs everytime the computer starts up
which runs the backdoor (jar file)
and then starts up the server
๐
You're despicable
lmao
buuuuuuujmp
lol
๐ฆ
Random jump scare ๐ฉ
yep
i hope u dont mind me bumping
just because i feel like ppl wont scroll up
@pale shell hows life
ok, i guess..
long time no see ๐
#off-topic plz ๐ฆ
๐
#816184747024711693 message lol nice
mhm
I'm pretty sure ssh into localhost usually doesn't work
it didn't work from other pc either
but i setup ssh on my own pc that i use every day
and it worked fine
is it the windows password?
like the one to login
just making sure
did u open the port
No idea but probably
well inbound 22 was already open
since when has SSH on windows even been possible
if u want to connect to your pc from another why not use RDP
The stuff you can do with CLI on windows is extremely limited
There's hardly any point
why not?
bc ppl with be using that computer
What's the use case here
how to connect all args after the first one?
what do you need to connect to it for
Arrays.copyOfRange and String.join
the server thingy, i can't find out how to make the scripttt
jsahdyugasd
so you're sshing into a Windows machine to do what exactly
weren't you storing the files on the pi?
yes
i need to download the files from the computer
onto the pi
i setup ssh in the pi already
so i need to do it to the other computer too
No you don't
oh
well
i dont have access to that pc as much as i do with my own
so in case i want to access file
i need ftp
or sftp
also
What commands would you be running on pc A that couldn't be on pc B
how do i zip and unzip
idk if thats possible with cmds either
but i dont think its possible with ftp
Linux or windows?
windows
Ew
well... Yeah?
StringBuilder sb = new StringBuilder(); for(int i = 1; i < args.length; ++i) { sb.append(args[i]).append(' '); }
is that fine?
nooo bm dont leave meeeeeeeeeeeeeeeeeeeee
just use String.join
a StringJoiner will do better :)
won't work cuz it starts at index 1 in their case
ic
String.join is beetter
args[] starts from 0 or 1?
bitter
0
silence
bitter misten
everything starts from 0 unless specificed otherwise
specified
?
like sql ResultSets
That's why I said you should use StringJoiner lol
StringJoiner joiner = new StringJoiner(" ");
for (blah blah) {
joiner.add(blah[blah]);
}
String joined = joiner.toString();
the fuck you think String.join does..
bro thats not efficient
bUt It LoOkS gOoD
Arrays.asList(array).subList(1) obviously
oh my bad
btw, benchmark saga part 3 (4?): I need to find a sensible way to test removing elements from collections
turns out creating a 100 million element array as a base isn't the best idea
Kek
dont click on the mp4 btw
you will regret it lmao
bruh i literally said
its the jumpscare
smh
what about starting mc server
๐คจ
or a discord bot
why would u not do that on the pc ur actually using
ssh and sftp u nerd
i told u before
doesn't workkk
scroll upp
i bumped it like 10 times
no one know how to fix?
staaaahhhppp
๐ฆ
Anyone know if it's possible to access cmd prompt (windows) from a different computer? without SSH or RAT
might just expose an SES for scheduling in Krypton for now
Velocity and Bungee's schedulers have just gone straight over my head lol
might take a look at CB's scheduler
actually no this is a bad idea
Anyone used gdb?
1 /toolchain/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc: No such file or directory.
Do I have to setup it?
Anyone know if it's possible to access cmd prompt (windows) from a different computer? without SSH or RAT
bump
should i just code a rat somehow (just cmd though)
๐
@half harness #off-topic
im literally talking about coding-
im not talking about some minecraft bedrock java thingy
hm
ill have to do some research about this ๐ซ
bro use teamviewer ez /s
i dont want to take control of the mouse
guys how to export a .jar with IntelliJ? i cant export that
ProcessBuilder pb=new ProcessBuilder(command);
pb.redirectErrorStream(true);
Process process=pb.start();
BufferedReader inStreamReader = new BufferedReader(
new InputStreamReader(process.getInputStream()));
while(inStreamReader.readLine() != null){
//do something with commandline output.
}
```oooo this looks cool @half harness
are you using gradle or maven?
or none?
none
intellij spigot
You should use gradle ;p
just so that realKyu doesn't get confused with the main class stuff
ok gtg
wat
for a bit
seems like some reading up on Velocity's scheduler has gave birth to Krypton's scheduler
๐ง
also, I have two variants on all the functions
one takes a Runnable as its second parameter (with parameters after it, like Bukkit's schedule methods for example)
the other takes () -> Unit as its last parameter
gross
meaning we can schedule things like this: ```kotlin
scheduler.schedule(this, delay = 0L, period = 0L, TimeUnit.MILLISECONDS) { println("Hello World!") }
What's the point of runnable methods
Java compatibility xD
true
actually, I'm gonna remove the runnable functions
also, how am I gonna get coroutines working on Java?
actually why am I bothered about Java compatibility
also, I probably want tasks to be bound by plugin BM
so just making a custom scope ain't really gonna work
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: com/realkyu/kessential/Kessential has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 52.0
??
yeah you can't run a Java 16 compiled plugin on Java 8 lol
or maybe 59 is Java 15, can't remember
should i update java 8 or downgrade java 16?
if Spigot runs properly on Java 16, I'd be genuinely surprised
you can set sourceCompatibility and targetCompatibility in Gradle to make it compile with a different version
and how can i downgrade
im not using grandle
nothing
๐คฎ
try project structure then I guess?
might be in there
file -> project structure in IntelliJ
queue the "I'm using Eclipse" response
lol
oh btw, someone with IQ level 3000 might be able to answer this: LuckPerms seems to require a ClassPathAppender, which adds JARs to classpath
is there an easy way I can implement that?
sorry, i have only 2 iq
java: error: invalid source release: 15
Expose the addURL method to the plugin classloader
Can you add new blocks with vanilla "data pack"?
LP doesn't have this jar-in-jar system in Velocity and Fabric because their class loaders expose it
guess it's time to make my own extension to URL class loader then
i need help, when i export it says that
Go to Project Structure and screenshot the uuh... modules? tab
cant send files
So what are the best"shaders" to get nowadays
Because i am playing on latest snapshot
why does everyone keep asking that
#minecraft message heres what Starmism thinks
well
#minecraft message this is what ori thinks
SEUS or Sliders looks good
https://paste.helpch.at/gisonikuto.xml
any help?
Do I need good graphics to run these
you're making an instance of your main class
Can I run it on Intel HD Graphics 4000, Lol?