#dev-general
1 messages · Page 348 of 1
I guess
the problem with floating point isn’t the standard, it’s binary
Bardy, how's the plugin manager going in your Kotlin stuff?
Awesome!
Is the end goal just a learning experience or do you plan to use this for something? I was thinking it could be a cool limbo-like system depending on how light-weight it was.
hmmmmmmmmmmmmmmmmmmmm
sus link
how is it sus
._.
It is just a fun side project, but I intend it to perform better than vanilla by a decent amount
theres no discord embed thing
wdym
Ahh alright that makes sense.
I mean, it uses coroutines so it should be alright
Plugins and commands use their own scope with twice the amount of available processors and the amount of available processors in threads respectively
Coroutines just helps you thread switch, right? I don't think I've used those natively in Kotlin yet
Coroutines are asynchronous subroutines
On the JVM they use thread pool executors
But I am probably the worst to explain how coroutines actually work lol
@prisma wave maybe you can do a better job
Or one of you other Kotlin wizards xD
Would having static registries be acceptable when dealing with a larger project
As in teams, arenas, upgrades etc, so it doesn't become big mess
Ping pong cause am in class
It lets you write sequential code that is converted to continuation passing style like youd with Futures and* stuff. It lets to dispatch stuff onto different thread as well if needed.
yeah coroutines are basically a frontend for a messy web of callbacks
the way you write coroutine code is in a blocking fashion
Ahh
Oh btw, Krypton API in DocDex coming soon™️
will also probably add official Kotlin documentation whilst I’m at it as well
and LuckPerms Krypton also coming soon™️
maybe FAWE Krypton as well
and any other plugins that have a large enough abstraction layer that I can make an implementation for Krypton without rewriting the whole plugin
FAWE should work really well on Krypton as well, as concurrency is built into Krypton’s design
don't the plugins need to be in kotlin tho?
yeah, but calling Java from Kotlin is easy
hmmm
well, they don’t need to be in Kotlin, but you will have a much better day using Kotlin
and some things, like commands, won’t even work in Java, since the execute method is suspending
you would need to define all commands using Brigadier’s argument builders
There is one
Admiral is in Krypton
Oh also, Glare, you should join the Discord server 🙂
It’s in the README
Is that advertising!
Answer my question hoe
er... does that really count?
Not this, the one I asked earlier
which
Eternal fame
.
wdym by static registries
if you mean singletons, ew
Ew you, should I just have a registry class and have that static so everything else doesn't have to be
anyway, I’m in English lol, cya later
Mf.
Lmao
maybe
I mean, just make it work and fix it later
it’s what most of us here do I think
you could have the best looking code in the world, but it’s pretty useless if it doesn’t work
Well yea duh
But why not spend a litle more time from the start and have less ugliness to fix later on
Goroutines are basically the bukkit scheduler on steroids
Coroutines*
In that a coroutine is a "micro thread", usually running on some thread pool that can be paused, cancelled, or rescheduled later
Because a coroutine can be paused (or "suspended"), you can write multithreaded code that looks blocking
Your coroutine makes a web request on another coroutine / thread, pauses, and then resumes when that request finishes
A coroutine itself is a lot more complicated than that and I don't really know enough about them to explain but that's the main principle
|| Goroutines ||
Goroutines are an actual thing
does anyone know a plugin that allows wheat to work on its own like on a hypixel skyblock
did you ever played on hypizxel sb?
also #general-plugins or #general-plugins-2
no
i ahve lol
okay
like pulse and efe
do you know the plugin
Hypickle wheeet plooogin
a) #general-plugins / #general-plugins-2
b) what is the hypixel wheat plugin
#816184747024711693 message
fork of a fork of a fork of a fork of a fork of a fork
🍴
You're in the wrong channel
i alredy send help
Sir this is #boosters-paradise
Then wait
I wonder if
And don't expect people to know
saaadge
No /
bm fix ur site
lol
to be fair, paper and spigot are free
ok but were paper and spigot created from #816184747024711693
yes

Yes someone put it there and Aikar accepted, totally
There's already so many 😦
Almost have to make a website to track the latest download of each fork.
isnt that purpur a fork of tuinity too
barack obama once went out and saw a young boy crying on the street. "Why are you crying boy?" He asked. The boy explained that he just found out how inefficient and unoptimised bukkit was. Obama thought for a second, and then said to the boy "you know son, bukkit is open source. PR or shut up".
That boy grew up to be md5 and saved minecraft
"saved"
Many intelligent people have compared md5 to jesus
"intelligent"
When you do the research there are a lot of similarities
lol
I mean, I have a lot of respect for md_5 for the time, effort and dedication that he has put into the Spigot project over the years
to keep it running
Md bad
I mean, he has some... questionable programming practices, but I can't really hold that against him, as that's primarily personal preference
please cite the sources exactly with links to these sources
I have collated a list here https://wiki.bristermitten.me/why-MD_5-is-jesus
ah fair enough in that case
I got F#!
yes
ive heard great things about wiki.bristermitten.me, must be reliable
they should have forked purpur
Hmm you must have a virus
who?
fork of a fork of a fork of a fork of a fork of a fork
Just because it's a fork doesn't mean it's better
im talking about #816184747024711693
i just said that because then it'd be a fork of a fork of a fork of a fork of a fork of a fork 🤣
maybe i added too many forks
or missed one
🍴
Let's make a fork called Forkkit and have people fork it, to make the most forked fork
;-;
tuinity > paper > spigot > bukkit > vanilla
Oh really?
There is another one of these out there, I'll have to find it.
lol
bit of an unpopular opinion you got there
uh
u might start some real controversy with that!
ur saying spigot > paper?
ive never met anyone else that thinks paper is better than spigot!
The glorious Yatopia?
Yatopio > purpur, change my mind!! (With no tags)
gian said same about purpur iirc
probably
gian knows what hes talking about, surely 🙃
what happened to good old tuinity !!
How can it be bad? It's a mix of all the forks! Plus, it's made by the one and only Ivan
wot
o nvm then
what the fuck
Hell yeah, throw every change in 🙂
i have a question
There is no time to wait! Ask your question @half harness!
smh
is this open source too? im sure they merge conflicts too! because a PR is still a PR right? must be good!
Tier 4 and still asking to ask
how does paper and tuinity and stuff apply optimizations on every new release?
5 🌚
i didn't ask to ask
Yes you did
patches
no i didn't
They press the optimize button on Github
i said "I have a question"
Aikar made a script that can optimise any version
not "I have a question?"
;-;
seriouslyyy
actually
i gtg
but
plz ping me with response
🙂
thx
well there is a reason paper takes a few days / weeks to update
Hope one day we'll see dkim talking in just one sentence
They just ... Do it
hope one day well see dkim ask a question then not expect people to give him an answer after he says "i gtg"
You should've seen the team when 1.16 came out. We sat in a Discord call on and off for like 5 days straight with minimal time in-between and they just round robin working on the patches.
Literally impossible
That was awesome i remember the voice channel was always full
Yeah it doesn't just magically get optimised lol
@ocean quartz
oh my god
I think we hit even more at one point but that was just like day 1.
Can't wait for 1.17 ;p
Holy shit
im gonna assume most of those guys are muted because of how hectic that would be 😂
Wait is glare on the paper team?
I'm just a mod.
Oh
lol
Yeah it was crazy
oh
i thought there was a way to like... idk, apply the patches
oh yeah, Glare, I'm at home now, so I can explain a bit more about how the API works
the registration is kinda the same, it instantiates the class for you, but you can write your own constructors
I mean init blocks
you have to take PluginContext as a parameter in your constructor, and that has to be the only parameter it takes, but apart from that, you have much more control than say Bukkit gives you
commands are fully asynchronous because they can be
patch files?
how do patch files work?
OH YEAH I was there
I remember that
you basically make changes and git can convert them into summary files
patches basically tell git "this is what you need to change"
I've got a quick question regarding some spigot methods if anyone is familiar with the following:
#player.playSound() <-- Plays a sound that only that player can hear, from what I can tell based on the javadocs. (this is ideal, if thats the case).
#player.spawnParticleEffect() <-- Spawns a particle but ALL players around can see this particle effect. Does anyone know if theres a simple way to flag that particle to only get seen by a specific audience? Or is this going to involve going into packets.
I've been doing some testing but I'm getting some weird results and its bundled into a much bigger plugin with other factors, so I want to make sure if anyone has worked with these and understands them a bit better.
new javadoc conventions?
Maybe packets if you just wanna send a particle for a specific player
as far as I know those methods are bound to that player only (playSound, sendTitle, sendActionBar, showParticle, sendBlockChange, etc etc)
The only thing this proves is the ultimate supremacy Python imposes over other lowling D tier languages
lol
is that project just a really simple socket wrapper?
yes
well a bit of both
netty has a lot of customization to it which is nice but also daunting to people that just want their plugin to work
yeah
Netty also requires a lot of reading and setup
like understanding how the pipeline works is a pain lol
yup 😂
i tried to get this to need as little mucking about in wikis and guides as possible to get working
https://github.com/KryptonMC/Krypton taught me how much of a nightmare Netty can be sometimes
but once it works, it just kinda works, and it works god damn well
do you know anything about anything?
public keys are fine to be public
i wouldn't recommend it
I wouldn't recommend hard coding anything though
no matter what it is
getting out of that habit now is important
yw
y r there 2 keys?
read up on RSA encryption
my turn
right, so you have two types of encryption
symmetric and asymmetric
in symmetric encryption, you use the same key for both encryption and decryption
this is generally used in places where you want very fast encryption, and don't rely on the key being public
then there's asymmetric encryption
in asymmetric encryption, you have one key for encryption and one key for decryption
if you encrypt something with your private key, it can only be decrypted by your public key
and the same applies for the other way, if you encrypt something with your public key, it can only be encrypted with your private key
make sense?
sorta
or do I need to dkim it a bit more
;-;
i have to admit i'm not actually using asymmetric to its full potential in my project
asymmetric encryption is nice
oh btw, you know there's two ways of establishing a shared secret?
o.o
one is of course diffie-hellman, which just about anyone who knows cryptography knows about
and the other is just encrypting the shared secret with the public key
which is actually what Minecraft does funnily enough
Literally overkill
It's like using hibernate for a single table
yeah
well, using Hibernate at all unless you also use something like Spring or don't care about size at all is overkill
but I get your point lol
Yugi what was that
I dont have an alt xD
if you have windows + android there's the Your Phone app
@jovial warren How did english class go
lol
Yeah I have never actually used normal hibernate, just JPA together
Diffie-Hellman is so nice. I remember learning about it and having my mind blown
@errant geyser uwu
Holarino babes
ily
😘
Whoever owns that repo needs to be shot
I got home at 7 😔
oof
You love that gif don't you
gonna start working on adding KDocs into DocDex btw
average php user
why?
I need this meme but "average <cool programming lanugage> user"
Average java developer | Average kotlin developer
‘Can You Feel My Heart’ is out now
Get it from iTunes: http://smarturl.it/BMTH_CYFMH_iTunes
Get the limited edition 7” picture disk: http://smarturl.it/BMTH_MusicStore
Taken from the album 'Sempiternal' out now through RCA: http://smarturl.it/semp_bmth_digi
Sign up to the official mailing list:http://www.bringmethehorizon.co.uk/#s...
For m...
Nice
since when did you think Kotlin is cool
xD
Average java developer | Average Jython developer
Jython developers are saving valuable time
jruby
SuperX++
Jython developers are trying to make something that shouldn't run on the JVM run on the JVM
🤣
Cant say the same about O:XML
i forgot a court of law decided python shouldnt run on the jvm
sadly
Jassembly
The cobol one sounds cool
java provides a number of guarantees that bytecode doesnt
like
such as
.class public HelloWorld
.super java/lang/Object
.method public static main([Ljava/lang/String;)V
.limit stack 3
.limit locals 1
getstatic java/lang/System/out Ljava/io/PrintStream;
ldc "Hello World."
invokevirtual java/io/PrintStream/println(Ljava/lang/String;)V
return
.end method
you'd be fronting literally no one with that
democrats 😫
expenses
numerous democrats have been quoted saying they "do not care" about the growth of ocaml on the jvm
indoctrinate them when they are young
why would clojure ever need to bind to python
why wouldnt it!!
when it could have been written in jvm JYTHON anyway?
Isnt Clojure JVM as well
Win win
JavaScript (or Java, for short) is the top programming lang....
a small price to pay
also barely any interop
it runs on jvm
a bigger price to pay
interop with all jvm language
just use reflection
that's not how it works lol
name a language that doesnt support good old Class.forname... go on, ill wait...
you just made that up
hell
Quercus
god is dead
oh dear... it would seem you have forgotten about new Java("Class.forName", "me.BristerMitten.Main)
try again
😐
I already add native to all my methods so they are faster 🙃
sounds like james WANTS java to be one of the slowest languages
it is a pity that java devs must sacrifice memory even something as simple as a variable
amazing game
how do you mean?
Like when you cast to a different type, its supposed to try to use that class's vtable or something right?
I remember something along that lines from a course
what does graalVM do
ur mum
That was always the case, that is the "default implementation" (that is overridden) because md_5 is dum dum and doesn't know abstract classes are a thing
It's like that even in base Spigot ever since that was introduced
never knew that was a thing since it was introduced, ofc its overriden but just seeing that is pretty funny
Yeah lmao
Omg dynmap uses .txt for config
sorry, got interrupted, I was about to say that casting isn't really a thing on bytecode level
not in the same way as in the language
you can invokevirtual anything on anything and it's still legal bytecode
what casting does is really just insert a CHECKCAST instruction
ah I see
Just a thought, Does it provide anyway to handle checkcasts?
I mean it makes sense because every Java class just becomes the reference type in the JVM
Handle how?
As in respond to that instruction. I'm guessing its not really possible, but that would have been interesting
Is there anyway to hook into the jvm natively maybe?
not as far as I know, it's really just "throw class cast exception if the reference doesn't match the type"
ah
anyone else here agree that KDoc generation is a bit whack?
like it turns Java methods into their Kotlin function equivalents
also puts abstract in front of interface functions
and shows you the verbosities of the internals
e.g. open override fun (another converted Java method)
I mean why are you using kotlin docs for Java?
converted Java method
just it's taking Java methods from Java interfaces extended by these Kotlin interfaces and turning them into Kotlin functions
You wanted it to show Java methods separately in the docs?
@jovial warren native NPCs support when
I think it should maybe do what Javadocs do, where it just links to them
open an issue so I remember pls 🙂
k
did that really take you 3 attempts
Im just gonna make the vcard outside
it won't embed the image
io dispatcher
not my fault
didn't know there was an IO scope
private val ioScope = CoroutineScope(Dispatchers.IO)
since Dispatchers.IO implements context
ah right
This was just what sx recommended when using CoroutineScope
ah
oh also, https://docs.kryptonmc.org/krypton-api/ pog
now I can show you what I mean
wait did I copy it half finished
-_-
lemme try that again
#bestdocumentationever amirite
right, uploading the new docs now
aight
hopefully it has everything this time
oh btw, look at navigation.html lol
no idea what's going on there
seems like the CSS just doesn't render
oh also, turned on browse so you can just go and see all the files in /var/www/docs lol
one of the cool things you can do with Caddy
Seems there is no style provided in the head?
following the spigot tradition i see
docs.kryptonmc.org {
import hsts
tls /etc/letsencrypt/live/docs.kryptonmc.org/fullchain.pem /etc/letsencrypt/live/docs.kryptonmc.org/privkey.pem
root * /var/www/docs
file_server browse
}
```my config for Caddy lol
¯_(ツ)_/¯
lmao
I mean, this is heavily based off of Bukkit anyway
I purposely excluded any singleton shit though
krypton spigot but actually good?
If someone had done a Bukkit 2, the perfect name for a 3rd iteration would just be 3ukkit
it's Bukkit but useful
cant wait
https://docs.kryptonmc.org/krypton-api/org.kryptonmc.krypton.api/-server/index.html they're there now Yugi
srsly
can't wait for Krypton to actually function properly?
true
I forgot who brought up the GTA thing a few weeks back.
also, it should be more than just me working on it now
Nicole's now part of the core team
I cant kotlin that well so wont be able to pr and cba to learn
Rockstar thanks GTA Online player who fixed poor load times
Rockstar be like "Oh why thank you!" and say good day lmao
I mean I know stuff like Unit -> Unit etc
oh btw, Fefo, did you notice?
but not good enough
the issue templates
ye
what do they look like
who's did I totally not at all completely 100% steal and give 0 credit to
The suggestion one is.. well... I mean not much to it lol
may or may not have nicked those from LuckPerms
It did look familiar lol
lol
wonder what implementing KDocs into DocDex would be like lol
since they're literally completely different
with Javadocs, everything is on a single page, but KDocs splits things up inside of the page into types, functions and properties
and the languages have minimal similarities
also, why tf is the sidebar not rendering ffs
oh btw, what should I make next guys?
1.8 pvp /s
we (almost, waiting on BM to get his shit together and approve the changes) got particles now, courtesy of Nicole
cough @prisma wave cough
get on it 🙂
oh btw, did I actually mention that logging to files is now a thing?
Agree
particles are the only important part of a server implementation
without particles there is no joy
Can't agree more
Happiness machine
Yeah Bardy, add a Smith & Wesson Model 29, that will bring me happiness once I get to use that happiness machine on myself
Modern, I like it
Dafuq
It's happening
Rockstar admit bullsh*t
Scroll up like 50 messages
why don't you ever talk in the correct channels
is it even possible to prevent ddos such that it wont work regardless how big the botnet may be?
Yes, get an even bigger network setup
get the $1000000000000000 antiddos plan 🙂
lol
Is Oracle virtual box even good?
okay-ish
Hmm cloudflare sucks anyways
why does cloudflare suck
whats wrong with cloudflare?
nothing wrong but I got hit with something that broke even cloudflare
or the server I help
did they hit the mc server?
because cloudflare doesn't proxy non webserver ports with their free plan
hmm perhaps, faction servers are a toxic community so doing scetchy stuff like ddos isn't to rare of a sight
if the ddos went to cloudflare itself it wouldn’t of got through
it’s just not realistic
well, like ivan said, cloudflare doesn’t protect mc servers on free
that may be it then
just sites iirc
@hot hull You'll be happy to know i'm being pressured to finish triumph chat, so i'll be working on it xD
Sir, this is #dev-general
What about me :(
Hey, so I have this test server for new plugins, but every time I join with 1.7.10, and after a couple of seconds I get disconnected for io.netty.handler.codec.EncoderException: io.netty.handler.codec.DecoderException: The received a byte array longer than allowed 61696 > 32767. While I'm on 1.8, it works fine and there's no problem.
Sorry if this is the wrong channel
I have 2 plugins, Worldedit and protocolsupport-1.8
using a 6+ years old software
this discord server whenever it finds a new language
lol
lol
depends on the language
If it's Modern we will try and indoctrinate everybody
The "clojurer" clearly discovered pure (real) functional programming
what
👏🦍
just logic
hmm
ProtocolSupport supports latest only
it literally gives you a warning when you download it saying there’s no support
Not really
god no
but also
no general answer to that
because it completely depends on your machine and what the jvm is doing
if you call an empty method often enough most vms will simply get rid of it I think
but yes there is overhead to method calls if that was your actual question
yeah there's a very small amount of overhead
yeah, I guess its negligible just curious
it's not something you optimise in Java because most JVM implementations are smart enough to do this for you, but in other language you do optimise stuff like that
oh okay, ty then 😄
man looked at WW1 propaganda for inspiration
lol
I still gotta make a roadmap for Krypton at some point, that’s gonna be a pain
anyone here got any tips or methods on how to make good roadmaps?
Senpai
Rockstar is about the fix the json issue.
The reverse engineer get 10k
dollares
No way
Oh my god
This just makes Rockstar look really stupid
That a single person fixed a bug that their entire development team missed for 7 years
lol
There is no time to wait! Ask your question @half harness!
Lol
whats the best way of getting statistics like Statistic.PLAY.ONE.TICK but for different server versions? i want to implement it into 1 jar so that i can easily update it instead of having multiple jars
wait is it different for each version?
yes like Statistic.PLAY_ONE_TICK for 1.12 and below i think then Statistic.PLAY_ONE_MINUTE for 1.13 above
well they're whole different things...
oh wait
wtf
d;spigot Statistic%PLAY_ONE_MINUTE
public static final Statistic PLAY_ONE_MINUTE```
Name is misleading, actually records ticks played.
its not

yep lol
a compat module (short for compatibility) with an interface that has like getTicksPlayed(Player), then a 1_13 module or smth that has a class that implements the interface (which uses PLAY_ONE_MINUTE), then like a 1_12 module
then you can get the version and do like SomeInterface interface = new 1_13Impl()
sorry if u dont know what i mean, i suck at explaining things 😫
uhh are you using eclipse or intellij?
eclipse
alright ill give it ago
just do exactly what he said, but change the class stuff and you only need to do like 1_13 and 1_12
since 1.13 - 1.16 is the same
(also this is assuming you don't use a build tool)
ye ive already added 1.8 and 1.13 jars to buildpath
intellij fucks up yet again
what happened?
what-
nothing
blue gang
🥲
That spacing is making me want to die
man
my old gcse cs teacher
assigned variables like
urmum=7
urdad=True
like ffs
use the spacebar
u nerd
Fucking monster
also, notice python
cause the Welsh Joint Education Committee thought we needed python above all else
the nerds
ok so ive done what the classes for each version but i still dont get how ill be able to get both statistics from each version
in the interface, you can have a getTicks method or something like that
then in each of the classes, you can implement that method
@half harness this is bad advice
and use the statistc to get it
I couldn't think of anything 😕
since spigot just poofed it out
Use Statistic.valueOf
Extract the current version from e.g. the package name of craftbukkit
just use this @vagrant bobcat, it's much better
If it's legacy, use one string, if it's new, use the other string
so i dont need those extra classes i made?
nope
No, you could follow a multi-module setup but you definitely wouldn't need one for each version
And since it's just for one enum constant it's kinda pointless
ye all i need it for is for the ticks / minutes
i have no idea why they changed it ;/
1.13.2 changed a lot
spigot actually has automatic conversion for Material but not for Statistic I think
here's an example of how you might check for legacy
@half harness https://github.com/dkim19375/MagicItems/blob/master/src/me/dkim19375/MagicItems/Main.java
?
.................
well u guys told me to unprivate
"since high school"
left high school 2 months ago
Kek
ive been programming since the womb
this is confusing me lol
still in highschool*
when cocatenating strings
is String#join fine?
public static boolean checkMapBoundaries(@NotNull final CommandSender sender, final String str) {
final String message;
final long id = checkLongValidity(str);
if (id == Long.MIN_VALUE) {
message = "is not a valid argument!";
} else if (id < 0L) {
message = "is too low!";
} else if (id > 4294967296L) {
message = "is too high!";
} else {
return true;
}
sender.sendMessage(
String.join(
" ",
ChatColor.RED + "",
"Argument",
"'" + str + "'",
message,
"(Must be Integer between 0 - 4,294,967,296)"));
return false;
}
public static long checkLongValidity(final String l) {
try {
return Long.parseLong(l);
} catch (final NumberFormatException e) {
return Long.MIN_VALUE;
}
}
(part of utilities class)
I'm triggered by those variable names
well the l
private int TicksPlayed(Player p) {
stat = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
if(stat.equals("v1_8_R3"))
return p.getStatistic(Statistic.valueOf("PLAY_ONE_TICK"));
else if(stat.equals("v1_13_R1"))
return p.getStatistic(Statistic.valueOf("PLAY_ONE_MINUTE"));
return p.getStatistic(Statistic.valueOf("PLAY_ONE_TICK"));
}``` like this?
o
🤢
i just named it that cause i wanted to see if i could parse a long
try splitting the _ too, so you only get like 8 or 13, then you can do an if statement like < 13
no
you only check 2 specific versions there
see the example I linked
#split("_")[1]
i had a look but looked confusing haha
what about it looked confusing?
is there a way to do
for (final MapImage image : images) {
if (image.getMap() == id) {
images.remove(image);
break;
}
}
in streams
im trying to fix a ton of my loop code
obviously, streams cant do everything a loop can do
yes they can
What is images and what does remove do
not used anything like it and i dont understand it from the example
You'll get a ConcurrentModificationException
removeIf
lol
Dkim what
Ah
🪄 flatMap🪄
lol
flavormap?
is there a way for removeIf to break after the first ocurrance?
Don't think so
If you want to break use Iterator
yea ik
or use a stream
that exists?
Well you can filter, findFirst and then call remove
ifPresent(images::remove) :^)
hi
ih
hows ur day
It's been alright, woke up too early
ok
yes cuz we all know streams are slower than pure loops
who cares about readability anyways
not like trump will read your code anyways
What time is "early"
From 7am to 1pm
As in you woke up at 7am?
lmao
As in I woke up at 1pm
@obtuse gale
@forest pecan
do you know how to get a specific argument
in brigadier
lol
like for ex
private int resetMap(@NotNull final CommandContext<CommandSender> context) {
final CommandSender sender = context.getSource();
final long id = ChatUtilities.checkMapBoundaries(sender, ?????);
if (id == Long.MIN_VALUE) {
return 1;
}
final Iterator<MapImage> itr = images.iterator();
while (itr.hasNext()) {
if (itr.next().getMap() == id) {
itr.remove();
break;
}
}
MapImage.resetMap(getLibrary(), (int) id);
sender.sendMessage(
ChatUtilities.formatMessage(
ChatColor.GOLD + "Successfully purged the map with ID " + id));
return 1;
}
the question mark
it should be the last argument
of the command
for example, /map reset map [ID]
what is this server for?
It's based on the argument you defined when building the tree
brigadier lol
yes
context.getArgument(name, type)
red the discord server name?
i just dont know type
Or something like that
yeah
Smh
the class will infer the type
read?
Well did you define it as a StringArgumentType? An IntegerArgumentType? Etc
Ah
It's what it'll return basically
💩
instead of
Type t = (Type) getArgument("haha")
we have
Type t = getArgument("haha",Type.class)
never used brigadier
but ye
cloud is the way to go
hm
so I get a LongTypeArgument
or i meant
LongArgumentType
how would I fetch that value?
You can either LongArgumentType.getArgument(context, "name") or context.getArgument("name", long.class)
The first one is more of a convenience method
i really like it
they should look into jython
= 🥺
I mean as far as you relocate it I don't see why that is a problem
Kotlin collection extensions good streams bad
It is, after all, a command library
declarative good imperative meh
public static <T> Stream<T> >>=(T -> Stream<T> fun)
Brigadier is awesome though because you can extend it to just about anything
If only someone made a non disgusting framework for it
frosty
C L O U D
-_-
Cloud?
yes
Link
We need to make a framework to use this framework!!
Haven't seen admiral yet so idk
Krypton’s commands are nice
its basically acf but he advocates both annotation based and object orientation style
and then supports so many platforms
I drowned in happiness when it released
Brigadier but with monads
lol
Now that would be good
how predictable you would be the one to say something like that
of course
Admiral is just a Brigadier DSL
You know me too well
I tried to make a lexer in F# earlier
Surprisingly tricky
Couldn't figure out how to consume multiple characters
when is the LexerParadigmFunctionalObject compiler for H#a#s#k#e#l#l coming?
🥴
Might ask for assistance when I get home
I got to a point where it Stackoverflowed which was nice
lol
builder
.requires(super::testPermission)
.then(literal("reset"))
.then(literal("map"))
.then(argument("id", StringArgumentType.word()))
.executes(this::resetMap)
.then(literal("all")
.executes(this::resetAllMaps))
.then(literal("set"))
.then(literal("map"))
.then(argument("id", LongArgumentType.longArg()))
.then(argument("mrl", StringArgumentType.word()))
.executes(this::setImage)
.then(literal("dimensions"))
.then(argument("dim", StringArgumentType.string()))
.executes(this::setDimensions)
.then(literal("rickroll"))
.executes(this::setRickRoll);
then
when i format it using google code formating
the fucking tree structure
turns into a hierarchy
sucks
lol
@lunar cypress can i use that in my plugin ill give you credit on spigot
my code is your code comrade
our helpchat
our discord
use what?
whats your spigot name ill credit you
our code*
❤️ https://en.m.wikipedia.org/wiki/Karl_Marx approves
Karl Heinrich Marx (German: [maʁks]; 5 May 1818 – 14 March 1883) was a German philosopher, economist, historian, sociologist, political theorist, journalist and socialist revolutionary. Born in Trier, Germany, Marx studied law and philosophy at university. He married Jenny von Westphalen in 1843. Due to his political publications, Marx became s...
I don't care for that just use the snippet as you please
Based
it's just a couple lines of code
We all serve the union here
👀


