#dev-general
1 messages ยท Page 144 of 1
ah
sad face
clip left too ๐ณ
๐ณ ๐ณ
ยฏ\_(ใ)_/ยฏ
Yeah i wonder if i should make it small regexes instead hmmm
Odin doesnt* use regex
Yea lexers shouldnt actually use regex
regex does a lot of unneccessary matching for this case
And also it seems like it would be difficult to maintain
but its short and sweet if you dont want anything very fast
I just don't know how to do it the normal way, was getting pretty confused trying
oh thats simple
It's small but a bit too much for this i think
Loop through chars,
collect looped chars to a String or collection,
check if current String/collection is = any of the tokens
drop current if any space or splitting character occurs
Remember the papi performance PR
pretty much the same thing
let me try to find that
Hmm alright tomorrow i'll retry that again, I'll hit you up if i have questions ๐
Alrighty ๐
Alternatively i could use a markdown lib, but i kinda wanna do my own way so i can learn new stuff
Its mostly that ^ except we match for tokens needed to be found instead of something like %.+%
Oh okok
That's the dude from xseries nice
Yeah
damn
@somber cradle Using MiniMessage (newer from Kyori), how can I convert my Component (output from #get()#parse()) into BaseComponent[] or something provided by Spigot? Even Json, which I can parse into BaseComponents using the deserializer.
So close ๐
ayyy
bruh
Cant this be simplified to like a multi-catch thing?
https://github.com/paypal/PayPal-Java-SDK/blob/master/rest-api-sample/src/main/java/com/paypal/api/payments/servlet/ValidateWebhookServlet.java#L63
catch (Exception|exception|exception e){
i know lol its not my code
There isn't a multicatch in kotlin is there?
no
Shame
Ive done this before lol
when(exc){
is IllegalArgumentException-> message.textChannel.sendError("That is an invalid currency!")
is NumberFormatException-> message.textChannel.sendError("That is an invalid cost!")
else-> throw exc
}```
probably better to just use multiple catches tho lol
Deffo
What would be the opposite of "append"?
And I don't mean "prepend", I mean opposite in terms of undoing the appending. Yeeting the appendage so to speak.
depend 
Depends on the concrete meaning of append I'd say
append = depend in a way
Depends on the concrete meaning of append I'd say
@lunar cypress Alright so imagine a train network of cities. Appending a city A to another city B means creating a one-way train connection from B to A. Prepending A to B means creating it from A to B.
I need a term that communicates the yeetage of that one-way connection from the train network.
Whoa there hold on
Are you trying to make an analogy or is this the actual subject of your code
analogy, the actual subject would take longer than a sentence to explain
doesn't matter, the important aspects are there. append, prepend, one-way connections, yeetage...
in the actual context it makes sense
Connect/disconnect seems more reasonable here
connect/disconnect doesn't imply a one-way connection
Append doesn't imply any "connection" at all. It means you add something to the end of something else to get a bigger something
And who says that "connect" can't be one way? This can be defined by the order of params and known from the vocabulary you define for this problem
in the actual context it makes more sense than connect/disconnect.
I just need a word to communicate the "disconnect" equivalent
Again. Can't help you if you don't give the context
well fuck
alright let me try and break it down, maybe I can do it in once sentence after all.
So I have a network of branches that contain a series of ranks. players traverse the branches in one direction to rank up and the branches are linear. But you can have a branch connected to multiple branches in that 'ranking-up-direction' and you can have multiple branches connected to one branch. I am coming up with the commands I need to provide to manipulate the network so appending a branch to another means you add it to the end of a branch and prepending a branch means you add it before the branch. "Connect" does not have those same implications.
So now I need a word/command do destroy those connections @lunar cypress
What parameters to you need for "destruction"?
@empty flint Just ask Niall if you need shit named 
Wait what do I need for a spigot plugin project? https://prnt.sc/trmvop
Basic
@somber cradle Using MiniMessage (newer from Kyori), how can I convert my Component (output from
#get()#parse()) intoBaseComponent[]or something provided by Spigot? Even Json, which I can parse into BaseComponents using the deserializer.
@hallow crane you don't really want to convert it into the dum bungee API, but there are serializer available for that. Ideally you look at the bukkit platform, it allows you to create an audience where you can send component as message, boss bar, title, action bars etc.
It also handles converting stuff to the right client version, which means you can send rgb messages from your 1.15 server to 1.16 clients if you have via installed, it will handle all that automatically for you
By down converting the rgb back into the non rgb colors for outdated clients
In general, I am unable to monitor this discord, you should ask in papers discord or kyoris discord
A wild Mini appears 
We also maybe are working on making even better integration with paper
Well, I don't appear, I was summoned ๐
7 hours ago but oh well ๐
I already forgot what this discord is, I am in too many discords :/
I never used that ๐
Wow
I am a developer, I don't need to relay on 3rd party placeholders, I can just do the hooks for my stuff myself, since I don't do public stuff
And the last time I touched Minecraft was updating paper to 1.16, soooooo
Been working on other projects that will greatly impact this community tho :)
which feature request? I'm curious
Is it only me or is the PlaceholderAPI maven repository down? https://repo.extendedclip.com/
It's off rn, will be back up in a few hours
ok, thanks
is it bad if i run code every second for hours on end?
Elaborate a bit more on that
im checking/updating stuff every second with
BukkitScheduler scheduler = getServer().getScheduler();
scheduler.scheduleSyncRepeatingTask(this, new Runnable() {
@Override
public void run() {
regenMine();
}
}, 0L, 20L);
is it bad for the servers porformance or anything?
and what does regenMine() do
it's not bad unless whatever is in the regen mine method is running sync and does process intensive stuff like set a bunch of blocks or something
ok
most of the time it will just check if a statement is true
it will just regen every 10 minutes or so
why not run it every 10 minutes then?
Also why not use a runnable instead of a scheduler, schedulers ew
Lambda
?
also yeah lambda lol
why not run it every 10 minutes then?
I also need to update a value for a timer
runTask(() -> {
//code
})
but you can run using the scheduler instead of scheduling
Instead of the new Runnable() { @Override public void run(){/code/}}
Afaik lambda doesnt actually create a new Runnable instance for the record
Or not the same as just invoking a new Runnable interface explicitly
ok
also how would I have multiple, example, chests that regen the items every 10 minutes with a timer and the owner can set how many chests they want?
items in the chest
like spawn new items, i can do the regen part, i just dont know how to setup the timer parts
Quick question, do I risk it for the buscuit and just use the normal LP user manager (which means perms may not be up to date), or do I use a shit ton of callback and querry the db?
Why would the perms not be up to date?
If you're so worried about it, load the user before you do whatever you need to
However, remember that this instance may not represent the user's most up-to-date state.
Where's that from on the wiki
This is from their UserManager, surely you could just use the future it returns as your callback Frosty, and then you'd have the users most up to date state?
Issue with that is, I have to either block the thread so it waits for the user to get loaded, or use more callbacks
idk how to make a timer for example 15 minutes for one chest and 10 minutes for the other
You see why I did cooldowns in ASF conclure

Bukkit.getScheduler().runTaskTimer(plugin, ()-> {
//code
}, 0L, 20L * 60L * 15L);
๐ Pray or hi five
Iโm that you donโt use BukkitRunnable doom

People who does that should leave
I'll test it a bit and see katsu, if it doesn't break completelly I'll just leave it as is, and fix it if anyone reports any issues 
mhm
I'm fairly sure most of it does
Well obv depends how you implement it but thatโs nice
F
baked beans
If I hold a reference to a cancelled Runnable what will happen if I use it again? Will it be null or?
You canโt cancel a runnable
BukkitTask?
I donโt think anything will happen
It will only attempt to cancel it
my spring things telling me
A
|
\/
B
|
\/
C
|
\/
and thats whats causing the cycle
but I dont see a problem with that lol
Fam I'm at 2.2mb with FJ :sheesh:
Why is your FJ at 2.2mb 
The bigger the better no?
2.2mb for a join plugin
@steel heart
You canโt cancel a runnable
Why not? What does thecancel()method do then?
You'd think a method called cancel would cancel it huh?
I need a way to "pause" a runnable, so I was thinking cancel it, after x tick run it again using the scheduler
ew
neeeh

[10:57:40 WARN]: [FrozenJoin] Failed to load LuckPerms API provider! (Ensure LuckPerms is properly installed!)
Why do you need LP again?
normal checkperms system doesn't account for inherited permissions
(optional addition ofc)
lmao
Lol
What does it mean blue text
@heady birch Ha interseting
It was actually a non final variable which makes sense
niall how would one go about getting the body of an @PostMapping thing? I already have @RequestBody for one of my objects can i use it again for the whole body?
what
what you mean
everything gets mapped to the single @Requestbody I believe
you can try
Multiple @RequestPart
well Ive got a @RequestBody that is the type of one of my pojo's, but paypals api takes in a body for the verify method so
also on an unrelated note im getting a cycle dependency thing but I dont see a problem with what ive got
what do you mean it takes a body
just a string
or a servlet request or something
cylcic dependency is when you have this:
a depends on b which depends on a?
hm ill have another look i guess
also heres the example of what im tryna do
Have you got an Api context already?
yea
and im just passing it the headers map, that should be good right??
Its just the body I need to work out
Just add HttpServletRequest to the controller parameter
then copy + paste their getBody method or ?
indeed
it says
pay -> paypalService -> JDAComponent
pay does depend on paypal service
what is pay
but paypal service doesnt depend on pay
@Service
class PaypalService @Autowired constructor(
private val jda:JDA,
private val guild: Guild,
private val config:Config
) {```
wait
is it because guild depends on jda?
JDA is provided by JDAComponent
I'm guessing its a bean?
yea
Do you need Jda in that class?
@Configuration
class GuildComponent @Autowired constructor(
private val jda:JDA,
private val config:Config
) {
@Bean
fun guild():Guild {
jda.awaitReady()
return jda.getGuildById(config[Setting.GUILD])!!
}
}``` pls no bully about the `!!` idc
PayPalService shouldnt depend on any of them I dont think
It should be completely separate if you can
What are you using it for in that class?
actually i can probs remove soem
I dont need jda
I need the rest tho since that channel does the logging (I know it shouldnt)
๐ฆ
have like
Use exceptions
throws PayPalError or something
then use jda where you call it
ehh
ok
ill rewrite it
is it ok to depend on a repo?
or should it purely be to provide data to other classes
I spent an hour trying to figure out why LP api isn't working, would be nice if I used the right version of it :((
https://bin.katsumag.me/SmAAw8bE.cpp what do you guys think of this
Imagine actually having it embed smh
REE no one line functions :((
I also just realised I ran it the wrong way for my start function
Fine AJ
5 mins ok
Some people say it makes it harder to read
Some people also dont vaccinate their children
I swear my IJ is broken, legit showing me as if a method I am for sure calling is not used anywhere
Some weird shit going on
https://bin.katsumag.me/vrqTADnv.kt Ok now what do you think of it
:)(:
ok actual critiscism
why have a cancel function if it's just pause
cos kidsll be like HoW dO I cAnCeL iT
KM, I'm so close to having this how I want it ๐ฎ

nice
var timeRemaining = TimeAPI(time).ticks @errant geyser everything about this line disgusts me
Might need you to clean some stuff up tho 
aight
Well that's not good
[13:13:56 WARN]: [Essentials] Permissions lag notice with (GenericVaultHandler). Response took 31.510217ms. Summary: Getting group for Frcsty
speedy
Why
a whole tick
Whats up with that BM
mutability, and "TimeAPI" is a horrible name
Actual criticism, for cooldown i feel like it's better to use timestamps, like, save the time of the action then get the current time and check if it has passed x time since then
Talk to Piggy not me boi
not to mention if it's the same class frosty is using it's basically useless
Thats not mine
:/
It's the same :kek:
In java it's not useless, but in kotlin it is
I cleaned it up in FJ
Sauce?
a lot of the code was useless in kotlin
well
iirc a lot of it was just a copy of TimeUnit
https://github.com/Frcsty/FrozenJoin-Kotlin/blob/master/src/main/kotlin/com/github/frcsty/frozenjoin/action/time/TimeAPI.kt @errant geyser
I changed it to this
does the same thing but cuts out the boilerplate
btw KM,
TODO the contract of this function is a bit vague. If there's no match, we return the input, but then we return null based on if a chance succeeded or not?
Only way I could think of without having to have an object returned (would be better if it was a boolean, but you still need the returned text), hence the null check was easiest
Never used that, so no clue 
it's basically an Optional
but more functional
I was mainly confused why you would return the input if it doesn't match
I gotta fix it, cause it appears to cut of messages for some reason
But hey we'll get there eventually 

add unit tests
hm?
add a suite of unit tests to make it harder to break stuff
when I was converting I was worried that I'd accidentally break something subtle
unit tests would've ensured that I didn't
ngl I'm kinda confused as to what exactly you mean
oh
Just like tests which get run on compile or?
yeah
to check the regex and shit
well
unit testing is usually small, repeatable tests of specific bits of functionality
so you might test that a specific function is returning the correct values
I'll play around with it
@Test
fun `Assert Simple Decimal Addition Functioning Correctly`() {
val code = """
x = 3.0
x + 1
""".trimIndent()
val result = runtime.execute(code)
result.exceptions.shouldBeEmpty()
result.leftoverStack.first() shouldBe decValue(4.0)
}``` I have a bunch of super simple ones for frigga, but they're really useful as it makes sure I don't accidentally break something
would recommend 
Gimme dependency and repo
testImplementation 'org.junit.jupiter:junit-jupiter:5.6.2'
testImplementation 'io.kotest:kotest-runner-junit5-jvm:4.0.6'
testImplementation 'io.kotest:kotest-assertions-core-jvm:4.0.6'```
for latest JUnit + Kotest
all in central I think
Ayyyy, I missed the exact time but it's actually happened!
Noice
I'm annoyed you use ' instead of " KM
Cause I cba to change the color for ' and it looks horrendous
wat
color
it looks the same on my theme

Also, (IntelliJ IDEA) is not responding
It's pretty bad for me too
๐ฆ
It's a shit green
๐ค
Gonna probably make it blue or something so it looks nice 
The color difference
ah

Custom Atom One Dark
ew Matt
one dark best theme
Why ew? It's literally the best dark theme
Oceanic better 
Too much green
It's all blue for me :))
Still wanna edit a bit more of mine, i don't like the oranges, but idk what color to use
the orange is a bit strong I think
That's a rainbow almost sheesh
It's a lexer, would that be considered an util?
Actually Sx does make his lexer an object yeah
Here:
https://paste.helpch.at/hihonorapa.php
not enough upper snake case
yeah that can definitely be static
also don't use a parallel stream there
a parallel stream would only benefit that specific case if there were millions of items in that enum
right now, it's making it a fuck ton slower
Gotcha, though this will all probably be scrapped, going to retry doing it without regex
yeah that is a pretty chunky regex lol
God I love IJ,
"this method can be private"
I try to compile and I use the method in another class, like what the fuck
very smart software
Can I disable intellijs warning for any methods with a certain annotation?
kind of
Just annoying cos with matts cmd framework it tells me all the command methods are unused
you can disable unused warnings
eh
Oh yea that's annoying as heck yea Aj
SuppressWarnings unused
gross
Doing that all the time get's annoying tho Conclure
Yeah I usually do it though
Could matt make it so the annotation itself does that already?
I don't believe so
you can mark @Subcommand or whatever as an annotation that ignores unused though
wait
for the sole purpose of annotation based frameworks
Yeah we should be able to add custom annotations which integrates with intellij
o
but you gotta do that for every project :((
It prints shit in console correctly just not ingame, assuming my game is fucked then 
Hey @lavish notch I just saw this post https://discordapp.com/channels/164280494874165248/452279708856614912/736957263994159204 in showcase and was wondering if you do commissions?
I can do
Mind if we dm?
I'll pay you 1$ to make me a dynamic portfolio site 
@ocean quartz #showcase message fucking holy
sure blocky
There is also horizontal scrolling instead ;p
yeah that's pretty cool
yo matt you ever going to update the framewrok? if yes could you add an option for aliases to not be recommended after a command so I only get the command or subcommand recommended?
I might pr a Supplier<ItemStack> constructor for guiitem if someone would go with a custom item builder, they could easily make it compatible with yours by letting themselves implementing Supplier<ItemStack>
() -> ItemStack 
@static zealot Yeah i'll update at some point
Can you show me an example of that happening?
I gotta fix the aliases for Frosty i can look into that too
Probably because it's a big ambiguous
Would the supplier be called every time the Inventory is opened?
Once?
who knows
How would that work Conclure? ;o
I will pr that later
Matt I'm talking about tab completion to be able to disable it for aliasses

My TriConsumer builder is very cool
Oh okay, i think for subcommand it's easy, but for command i'm not sure, since it's handled by spigot
well subcommands will be fine
its just for example I have a gamemode command and I added aliases like c, 0,1,2 cr etc.
and I don't want to do /gm or /gamemode and see all of them there
xD
Matt, any luck with aliases? 
just dont make them tab completable at all blitz 
Boy you asked me that like 15 minutes ago
:)
Your response was shit so matt :p
Kotsu I have a pr for that as well
shit means I haven't xD
I thought i could try abuse sk- for evaluating in my bot, but realized their classes and expressions are unorganized af
ofc they are
Kotsu I have a pr for that as well
Spicy, what you improving?
just like the language
Gradle is fast they said,
BUILD SUCCESSFUL in 1m 27s
Is it just me, or it's weird compared between this Nashorn eval and JS-Expansion on the fact it doesn't need ;?
afaik semicolons have always been optional in JS?
yeah but not in js-expansion for some reason
but tbh I never set the engine to nashorn
so maybe that will not require them but yeah dk for sure
I always set nashorn as engine for every js papi, but without ;, it keeps returning error somehow
@onyx loom Got time? ๐
nope
:c
4heads
boot it up urself 
bruh it takes 15s to switch fucking channels..
What gif
fRoZen jOiN
Example of how to use the djoin config converter
Whats that
wdym what's that
The converter
it converts djoins config to fjoins
Wth is djoin and fjoin
omg
smh
Jesus
Dissapointment intensifies
Your probably the one guy still using a as a variable name
wot
Excuse me what?
val daddy: Plugin? = Bukkit.getPluginManager().getPlugin("PlaceholderAPI")
๐
=pl Frozen Join
fRoZen jOiN
@onyx loom
=pl DeluxeJoin
essentials messages 
Impressive?
wdym by that?
"iPhone", you've said enough sir
read notifications pls k thanks
Itโs impressive you got essentials msgs in to your plugin
What no
which ones?
You asked which one's the best, and I jokingly said essentials messages
no
Then why?
Because it's 2.2mb for a join/leave plugin 
๐
1.3mb kotlin
Sec lemme decompile and I'll see how much is what
nope
So Frosty, does it have an api?
Not yet, but it's mostly setup to have one
FrozenJoinEvent ๐ฎ
Lol set up like a giant api
Kali 
๐
Like PreFrozenJoinEvent, FrozenJoinEvent, PostFrozenJoinEvent, PreFrozenLeaveEvent, FrozenLeaveEvent, FrozenLeaveEvent, FrozenJoinActionEvent, FrozenLeaveActionEvent. PreFrozenReloadEvent, FrozenReloadEvent & PostFrozenReloadEvent
FrostEvent

Lol

๐
I'm about to defrost it's so fucking hummid here
๐
Been sitting still sweating like crazy
So, kotlin, Matt's command framework, bstats, xseries (gonna remove this since it's no longer used), luckperms api
Cause I already handle it myself, and xseries ew
It'd be used in like 3 places so it's kind of a waste
For?
It'd be used for that single material check (it's a thing btw)
@prisma wave Can you load up FJ since I know you've got the stats plugin installed and just check how many lines it is (pull first tho
)
Ktnx
kk, pong me cause I'm curious
Quick: React or Angular 5 for web development?
Personal preference
Not on the table
Afaik Angular does more though
Angular it is.
it's full MVC, react might be the same idk
If you don't know, decide out of Facebook or Google
Some weird ass shit again
Hello, I am looking for an update for DeluxeMenus 1.16.1, which works the feature of the CustomModelData, someone help me please
What plugin 
Its compiling now 
It is not


when you have most important test life results today
and teacher gives you wrong password
and you cant see them
Nice
For some reason the protocol lib repo aint there
gimme a sec
wait it is but he specifies a non existant version
kek
@old wyvern I require your big brain ๐ฅบ
This is what I have so far gonna do just asterisks for now will handle the rest later
https://github.com/ipsk/mf-msg/blob/master/src/main/java/me/mattstudios/mfmsg/base/Lexer.java
The result of that is:
[TEXT = Some <#g:000|fff>]
[ASTERISK = *]
[TEXT = text]
[ASTERISK = *]
[TEXT = [<#ffffff>Some more]]]]]]]](action: Other\) <#g:000|fff>text) and ]
[ASTERISK = *]
[ASTERISK = *]
[TEXT = finally]
[ASTERISK = *]
[ASTERISK = *]
[TEXT = some more [#000](/guild/164280494874165248/channel/000/)text! This will [#000](/guild/164280494874165248/channel/000/)continue \*to\* be ]
[ASTERISK = *]
[ASTERISK = *]
[ASTERISK = *]
[TEXT = more]
[ASTERISK = *]
[ASTERISK = *]
[ASTERISK = *]
[TEXT = \~te]xt]
[ASTERISK = *]
[TEXT = ~ sadas~ds)a asdasdsa!]
private static final Pattern stylePattern = Pattern.compile("(?<HEX><#.+?>)|(?<ACTION>(?<!\\\\)\\[.+?(?<!\\\\)](?<!\\\\)\\(.+?(?<!\\\\)\\))|(?<BI>(?<!\\\\)\\*+.+?(?<!\\\\)\\*+)|(?<STRIKE>(?<!\\\\)~+.+?~+)|(?<ESCAPED>\\\\[*~\\[\\]()])");
It's a \ chonker ๐
Yeah, that's why I am trying the other method xD
Matt, are you sure you want to check per character
?
I meant as in wont you have longer Tokens?
I am not sure of anything, i am lost send help
Ah one sec Ill try to move it slightly to use Strings once electricity comes back
Im sitting in darkness at 12 am
๐
Oh shit, leave it for tomorrow then, go sleep! xD
Nah Im not sleepin rn
Have to "design a new type of steering" for a class tmr
Im pretty sure with my level of creativity itll take me a few hours ๐
What do you mean by type of steering? ;o
For human computer interaction course, we are going through a module that deals with improving how users interact with machines. So our project for tmrs class was to ideate something better than the "steering wheel" as that is very old and not upto modern standards
idk he asked us to do it last class but we all came up with stuff like this and then he got mad and postponed it to tmrs class xD
Not sure what he expects us to think of at this point
VR while driving in a car 
wha? xD
idk
๐ ๐
Oh jesus, sounds complicated xD
jesus sounds complicated indeed
@ocean quartz What grammer are you implementing for now?
Like can I have an example of all possible tokens?
like thr strike, bold... things
he has a gif somewhere above
It's basically markdown
@prisma wave I can just yeet my entire plugin to run async right? Like should I be worried of anything or can I just make my own thread and just do everything on there, since rn performance ain't the best due to the perms and format checking
ah I couldnt find the gif but found this [#000](/guild/164280494874165248/channel/000/)Some text [Some more text](hover: Hover text) *italic Ill work off of that
Basically for now I'll do only bolds and stuff like that, i'll handle the rest later so *italic*, **bold**, ***bold italic***
Ah alrighty
@ocean quartz had a look, I think the single character one could work fine for what you want ๐ You can add a collapser to collapse 2 or 3 continuous Asterisks into one token, might make parsing it easier after.
So like after lexing, go through the result and replace 2 and 3 Asterisk tokens that appear together with a token specifically for ** and ***
Other than that, looks lit!
@old wyvern Ooh gotcha I'll try that in a sec
Though for the other stuff might be better to do more characters right? since I still need to add other stuff like [#000](/guild/164280494874165248/channel/000/) and [something](action: something else) though i feel like i could do this part with regex maybe?
I mean i think current might work,
When current token is < You can assume it is a color and pass next Text token to parse as hex ang ignore thex > token after
same for [ but you will have to parse tokens between this and the next ]
for action ( next Text token defines type and after colon, all tokens till a )
I think doing more characters like I initially suggested might be a harder situation , it would work fine for <color> and (action) but with [] since there can be colors and stuff inside it, it would fail in that case. If you want you can implement multiple character for other cases and and leave the sq. bracket case as the same
thats:
color: < Text >
action ( Text : Text... )
actiontext [ Text... ]
Hi clever people. This is quite a strange question but I'm hoping someone knows the answer. In my language I've implemented decimal addition (it just adds 2 doubles behind the scenes). It all works fine for simple things, but when I introduce a degree of randomness (adding 3 calls to Math.random()) I find there's a tiny loss in accuracy - for example, the expected result might be 1.4707189606734465 and it turns out to be 1.4707189606734463
I honestly have no idea what might cause this (as it's literally just a + b with a few layers of abstraction), any ideas?
Does it happen consistently?
not really
about 1/5th of the time
my only guess is it's the JVM trying to optimise by throwing away a decimal place
1.4707189606734465 and it turns out to be 1.4707189606734463 Did this example happen?
hm ok
the only thing I can think of is strictfp
but I doubt that will fix it
or BigDecimal?
but not sure it's worth the overhead
it just makes sure that the same floating point system gets used across all JVMs I think
actually wait
km, can you give me the 2 operands used to sum up to that?
@prisma wave
yeah 1 sec
it uses random numbers and I didn't print them so it will be different results
but I'll take them from a test that failed
Sure ๐
interesting. it works when it's just random() + random() but fails with 3 operands
How are you determining the actual value?
the test is basically kotlin assertEquals(valueCalculated, actualValue1 + actualValue2 + actualValue3)
0.3042658268398106
0.778885550060943
0.9309784732298717``` this is one set of data that fails
I'll send code hang on
Alrighty
hm actually
I have a theory
I'm using string interp to fill the random values into the code, could there be some truncation there?
?tryandsee
ยฏ_(ใ)_/ยฏ
@RepeatedTest(RANDOM_TEST_COUNT)
fun `Assert Random Decimal Addition Functioning Correctly`() {
val start = Math.random()
val param1 = Math.random()
val param2 = Math.random()
val code = """
x = $start
x + $param1 + $param2
""".trimIndent()
val result = runtime.execute(code)
handleExceptions(result)
result.leftoverStack.first() shouldBe decValue(start + param1 + param2)
}```
Here's what's happening to produce the problem
i'll try with String.format or something 1 sec
doesn't seem to fix it, tried with BigDecimal too
Whats the decValue function?
it's just for integration with frigga's type system
it makes a Value with the Dec type and the given value
it's stored as Any rather than Double if that makes any difference
have you tried printing x + $param1 + $param2 from frigga ?
Ah
but I'll check that asap
Alrighty
Finally Sxtanna is gone, now I can talk >:)
Hi people
@prisma wave You're cool btw
lol
๐
thanks?
Ranald hates my guts lmao
The kult may have something to say about that
The Xtanna's you mean?
no no
๐
we've... indoctrinated a fair few people into the Kotlin world
I've seen
Is Ranald there?
daily reference to r/kotlinmemes

@old wyvern interesting. I implemented a print function, and the problems persist, so it's probably an error in my addition function
yeah I was thinking of BigDecimal
although that isn't exactly the problem
the problem is that after running the same addition process through my language (which uses JVM doubles behind the scenes), you lose 1dp of precision
investigating with some hardcoded values atm
Alright
hm
I think I might have an idea of what it is
currently I'm doing 0.9346341244777236 + 0.11992406936196554 + 0.096298675640208. I imagine the JVM would do that left to right, but because of how the parser is implemented my language seems to do 0.9346341244777236 + (0.11992406936196554 + 0.096298675640208)
is it possible that the different order causes a tiny drop in precision?
Does it match the output of your script tho
Ok
which basically confirms that it's to do with the order of operations
I mean you could probably just ignore that in that case
looks like BigDecimal is the best way out?
yeah I could
but it's making my tests fail
which is annoying
alrighty
The best way out would be making your script do the same order kotlin does
yeah that's probably the best long term fix
but unfortunately I suck at using antlr
or maybe I don't
we'll see
Are you stuck with it for expression solving?
might be worth a look
What's the output for 0.9346341244777236 + 0.11992406936196554 + 0.096298675640208 again?
JVM doubles resolve it as 1.1508568694798973
using BigDecimal it becomes 1.15085686947989714 consistently
I wish I could send screenshots here
Interesting
Off to the dms we go
imgur?
actually I think this is the parser's fault, because of how I tried to avoid mutual left-recursion
repeated binary operators favour the right hand side
when in kotlin it favours the left i think
ooh yeah this is totally gonna break stuff
it parses 10 - 3 - 4 as 10 - (3 - 4)
Remind me not to use Antlr
Why not just make your own?
but I think it's still better than attempting to write my own parser
effort
basically
Mmmm
I could do it, it's just a waste of time testing it when a (mostly) functional alternative exists
"it can be infuriating sometimes"
only sometimes though
๐
I doubt it tbh, yet again I haven't finished mine yet either
Did you ever make a document for your language?
Alright
it's in very early stages
I am making a mine plugin and I want the server owner to be able to create new mines with the config but I dont know how to make it so It resets every certain amount of time specified by the player, basically I dont know how to have an unspecified amount of mines all with different reset times, they will also all have warnings for when it resets the mine
Lmao
Not wrong
shush
I can read entire schematics in like 20ms
@keen creek love it kinda sounds like you want someone to spoonfeed you code
I'm sure most of that time is like... warmup or something...
Speaking of which
each individual test is like 3ms so
lol
Which you will for your server implementation
It's pretty lit ngl
I have a small update for it but I need to do some testing on it first
See this is why we do testing
Damn, how do I get send image perms on here
you gotta be tier 2
:C
Where
@keen creek love it kinda sounds like you want someone to spoonfeed you code
@nimble jungle no, just what would you do to do it?
@nimble jungle no, just what would you do to do it?
@keen creek uhhh code it?
if the answer is just, code it then why do people ask for help?
well people ask for help with their code, not to code something
and plus you're kinda in the wrong channel anyways
๐ช#development
Ayyy not bad Lexed in - 0.5226ms
pretty speedy
Only doing * and escaping so far
cool stuff
Updated the NBT library
Alrighty so if I add mf gui to my core, I look to be hovering around 1.8mb, lol.
Oof, that's the entire core size?
with Kotlin or without?
Without
On the bright side tho, when PDM is finally finished, I can just PDM this
And then any plugin I use this in cal just pull from it
I'll also add in that I am not minimizing yet, when I add that, it takes off like 300kb.
Oof MF-GUI is 123kb, 60% of it is xmaterial lol
Oh wait that was compiling the commands too
Hmm?
88kb, nvm xD
Damn, not bad.
Oh so I know how you said that you didn't want to maven xmaterial cause it got all of xseries too, but I found out that there's actually a maven artifact simply for xmaterial
Is there? That'd be awesome
At least there was at one point.
Okay maybe I jumped the gun on that
I can't find it anymore
Yeah he only has xseries on maven central https://search.maven.org/search?q=com.github.cryptomorin
Hmm okayt
Gonna try asking him later if it's possible to release it separately, but i'm assuming it'll be a lot of trouble to do it
kk
Yeah I noticed that I would always boilerplate code when adding in dependencies so I made it so I can just do GuildCoreBuilder.addLangFile().useAdventure().useConfigMe().build():
And it allows me to 1 line everything that used to take like 100 lines
๐ฌ
๐
NOOOOO @chilly jungle white theme? For reallll????? Expected more from you
My eyes
Omg
Atleast now I know my pc isnโt that bad
Dark themeeeee
@old wyvern Made it expandable now, so just adding a token and it'll try matching it, also escapes correctly and removes the \ when escaping
https://github.com/ipsk/mf-msg/blob/master/src/main/java/me/mattstudios/mfmsg/base/Lexer.java
I have a comment there about \\ to prevent escaping but not sure if it'll be needed or not, sounds ass to do xD
Well now to the hard part which is parsing, i have no idea how i'll tackle this
@quiet depot, if you wanna judge too, go for it, i wanna make this pretty good so i need all the criticism i can get, plus will be good to catch some 4am mistakes xD
tokenTypesshould beTOKEN_TYPES.tokenTypesshould be a set.- lex#stringBuilder should be final
@ocean quartz
nice!
Also, added a small grammer matcher. Gonna go sleep for a bit rn
https://github.com/Vshnv/mf-msg/blob/master/src/main/java/me/mattstudios/mfmsg/base/Grammar.java
Ill PR this once the Parser is somewhat ready
I was looking at PAPIโs commit history and I saw version 2.10.9-DEV-${System.getProperty("BUILD_NUMBER")} in its build.gradle and I was wondering if there was a maven way of automatically adding the build number to the version?
MAVEN BAD
Unacceptable behavior
and i never did add fuck1.8 support...
NOOOOOOOOO
F
You don't even do anything with the BukkitRunnable
Finished the world builder @steel heart, what do you think?
Also if anyone has any suggestions that'd be great
Yeah, they were the only ones I could think of soooooo
Play around with actual world gen, like custom terrain using noises and shit
use the plugins api?
What's a better way to handle making "custom items" ig a feather that grants /fly upon use. Currently I'm checking if the item has a certain name and lore


