#dev-general
1 messages · Page 170 of 1
yea i think so
i've never used it, but i know like CMI does, and I used them for a while
https://www.hostinger.com/tutorials/sqlite-vs-mysql-whats-the-difference/#:~:text=SQLite is a server-less,to interact over a network. here's an article on the difference between the two if you're interested
hmm thx
welp some things I could use placeholders api nha?
like get unique joins
from the server
also first time joined
etc
last login
Anyone know how to add custom JSON msgs to deluxechat
im setting up a repo on my website, and when i access it at http://ip:port/ it works fine, but when i access it from the domain which i have setup, it looks like this screenshot
https://paste.jaims.dev/jegexebopa.nginx - my nginx configuration for this
any ideas why this isn't working
It’s like Java but better
thats kotlin
No py is superior of kotlin
No py is superior of kotlin
@steel heart
. Lets agree to disagree
yes
I love how everything has to be relativised to Java and/or Kotlin here
@lunar cypress Not at all, it's just, python sucks
Name a language other than Kotlin that doesn't suck
C, C++, C#, Scala, Go
Ok now I wanna know why you think Python sucks lmfao
How do I declare this in Kotlin:
catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e)
I dont think kotlin has multi catches
catch (e: NoSuchFieldException | IllegalArgumentException | IllegalAccessException ) doesn't work
I think you gotta use multiple catch things
ugh
pro gamers catch Exception then throw it if its not the right one
Ok now I wanna know why you think Python sucks lmfao
Mostly personal preference tbh. Off-side rule. Slow. GIL. 🤷♂️ . Its good for researchers for whom its easier to use when they really don't want to take the time to learn something more time consuming but I feel like its not so useful for people familiar with other languages.
Off-side rule? GIL?
And you really think python is just an elaborate playground for academics?
I'm afraid you couldn't be more wrong about that
More of just personally dont like it
I'm afraid you couldn't be more wrong about that
Do reason
Im not an expert about this but from what I know of it, dont like it much
Python is one of the most widely used languages in the entire industry
And things like tensorflow aren't a joke
Did not deny any of that.
Or data science stuff
Well you said it's not so useful for people familiar with other languages
Already stated those
It does have a lot of libraries for data science
Great. But* not everyone has use for that
Great that it's by far not the only thing python is used for in the real world
Btw I asked about two of your three points because I literally do not know what you mean
Oh indentations and the lock
Yea as I said, Dont know that much about it
Indentation, honestly... that's honestly 100% personal
Just dont like a few of the "features" of the language very much
Indentation, honestly... that's honestly 100% personal
mhm 🤷♂️
What new features
new?
Didn't that just say new
But you do like the mess of language features that is C++? Interesting
I dont feel of it as a mess
It just doesn't get in my head that people complain about python's language features but defend C++
do you know why people hate skript?
I like C but I certainly do not like C++
because it's the exact same reason why most people hate python
you get these beginners, people that go to a code camp or whatever, who learn how to make a calculator in python
py indendation remind me of yaml xd
and suddenly, they're experts
and they go around flaunting their newly attained python knowledge
I am an expert what u mean?
That's not why most people hate python. That's why a minority of programmers with a big ego hate python
is py considered a scripting language or smth?
Yes
is it worth to learn it?
who doesn't love some 'elif' on their life
python is used everywhere, shooting yourself in the foot by not knowing it
Lol never heard people hate on python. What d ou mean most people tho lol
I dont hate python :P
I hate xml 🤷
But then again I am an expert, not many people are
I really wish java wasn't using xml for mobile apps design 😦
because it's disgusting - imo
fresh are you being ironic, or do you actually consider yourself an expert?
yes
I once was gold nova 🤷
Bro i barely know loops xD
personally I absolutely hate the language
why do you think most people hate python?
Bad OOP, Aesthetics, failure at big scales
definitely my least favourite language
I have trouble with loops I almost gave up learning JAVA again
That's a statement
wdym?
Like
for example
1
1 2
1 2 3
1 2 3 4
Took me days
to figure and understand it
and I probalby cant do ita gain
well i can but thats cus i am memorized a bit
its quicker to just like print that normally isnt it lol
I cant even do:
-
* -
*
i wouldnt be able to do that either tbh
i've literally never needed to do something like that in real life, you encounter that shit on sites like hackerrank
Yes but the point is to understand loops
i mean
thoroughly
You never really need to do that tbh
I mean maybe in some circumstances but eh
I also am bad with Arrays, Collections and generics. Manipulating Strings and stuff.
It's worse than concatenation obviously
ive never made an array in my life, collections are easy, i dont fully understnad generics yet either, idk what manipulating strings means tho
but I once found on google smth like | %s-5 | %s-15 | who would generate a table with 5 and 15 spaces between and fit the given string inside
ALSO i am bad at math :/
Yes
Formatters have a lot of useful flags
And you can see what happens if you try that without formatting
but why people suggest not to use them
Who does?
everyone say String#format it's bad
I've never seen anyone say that
😦
I often actually suggest people to use it
But yea i dont like moving on to Spigot. I was told by many people to learn Java first as I dont really know it. (i DONT WAnna be spigot dev X_X aka laggy buggy code)
you'll be told that in any support group
some people just can't recognise that spigot is a perfectly valid way to learn java
Well Splodgebox told me that when I used his API poorly
he only had 1 week of java before he moved onto spigot lol
I had 2 days but still
He also said to use HashMaps instead of SetMeta or FixedMetaValue
not sure what the latter 2 are
if (p.hasMetadata("lastSoulAnvilUse") &&
System.currentTimeMillis() - p.getMetadata("lastSoulAnvilUse").get(0).asLong() < 30000L)
somehting like that
Or, you know
But i feel like
I am just bad at Alogirthmic, LIKE actual coding typa shit. Not syntax or watever if you get wat I mean
Just a set that you remove the player from after some time
Like forexample
sort thorugh even and odd numbeers
^ This is just a simplified example
BUT given a problem sorta like that but complex, I cant seem to do it
Will give py a chance but atm I want to learn some web design
ye
web design is hard :/
ik 😢
You're just bad Piggy
bruh
Very bad
Does python have the ternary operator?
it doesn't
Frick
i mean it has single line if's
Yh
like kotlin
Yeye but like ternary can be little handy sometimes
Although it’s negligible difference
@lunar cypress any updates on that map lib?
you right there niall?"
Fine thank you AJ
xml bad
Your statement is objectivley wrong
it wont work with versions that doesn't have filled_map
probably 1.8 🤮
legacy versions actually
Ah yeah then the issue might be that I used spigot's legacy system and you didn't
Not sure how to work around that
I mean its still cast to the same thing so why not just do like
ItemStack itemStack;
if(Compatibility.isLegacy()) itemStack = new ItemStack(Material.MAP);
else itemStack = new ItemStack(Material.FILLED_MAP)``` or is there more to it
wdym
Yeah I think I'll implement that
I mean that I don't have both enum constants when compiling against one particular version
But I'll just use valueOf
ah
does hologrpahicdisplays have like repo so i dont need to have jar on my pc for dependenci?
I mean shouldnt you compiule with 1.16 anyway?
It has a repo Gasper
then that does have both enums
and how do i get it frosty*?
Well does it?
It's on the bukkit page Gasper
I think so
i got it.
I think 1.16 has both FILLED_MAP and MAP
how can i add some variable to list like
.addStuff(
blabla
blabla2
if(somevariable = true) adds blabla3
)
? Kotlin
see that's a good example for cond-> in clojure @prisma wave
(cond-> [blabla blabla2]
somevariable (conj blabla3))
:ČP?=???
sorry
What you can use is lists that ignore null values
bit hacky but
listOfNotNull(blabla, blabla2, if (somevariable) blabla3 else null)
aha oke.
@obtuse gale version 2.1.1 should be live now
epic
should fix this
Johnny what if i canta dd nulls?
wdym
my list doesnt support nulls
I thought you wanted to create a list
Well, then... use an if statement?
some one make a kiteboard extension
For?
What would be the point of that?
assign scoreboards based on what region they are in
@heady birch sure, gimme access to the plugin
If ive got a game that has like multiple "steps" should i use something like this?
interface GameStep {
fun run()
fun nextStep():GameStep
}``` Then implement that for each step? Or is that a weird way to do things?
Actually some of the steps would involve waiting for the player interact event so idk how that would work
Im just tryna think of the best way to do this without it becoming a mess
kinda satisfying 😄
Nah, 666 is best
Just copy my connect four code aj 
@lunar cypress conj-> sounds useful
isnt ur connect for in clojure lol
Well, you know. Just mentioned it because it works similar to my own macro I explained earlier
Yeah it is but I have a mechanic for waiting for input 
Fancy
Anyone having the pdm Intrinsics issue available to test something real quick?
Coroutines
sounds complicated
how would I use it for this?
Kotlin also has channels
You could write a listener that puts events on a channel
And use suspending take to get them
That's sort of what I do in clojure
Kotlin also has stuff like Flow, whatever meets your needs
I mean basically what im gonna need to do is
Send player message
Wait for player to run command
Build arena (5*5 box)
Teleport players
Listen to interact at entity event a bit
Reverse steps
so what should i look into lol
Well I would separate the setup and the actual in game state
Good reminder that I should continue working on spiglin and add event waiting
coroutines first
GlobalScore.launch{
delay(1000L)
println("!")
}
println("hi")
Thread.sleep(2000L)``` im basically a pro now
its to keep the jvm alive frcsty smh
this totally isnt copy + pasted off the kotlin website
GlobalScore
shutup
kek
Why does this Collectors.toMap call not work in Java?:
String constant = "const";
List<String> list = getListFromWhereever();
Map<String, String> map = list.stream().collect(Collectors.toMap(k -> k, constant));
It doesn't let me use k as the element of the list and as the key of the map.
bruh moment
because you're missing a .
@prisma wave That's just a typo
You didnt provide a argument for second function
You didnt provide a argument for second function
@old wyvern Yes! That's it! Ty
🍉
private final Multimap<Class<?>, Consumer<?>> map;
void t() {
map.asMap().forEach((clazz, collection) -> collection.forEach(consumer -> consumer.accept(clazz.cast(obj))));
}
``` for some reason `clazz.cast(obj)` gives me this https://discordapp.com/channels/164280494874165248/695431668944732270/747424959147671624
Yes because the Consumer in the map is not restricted to take in a element of that type
The Class could be a Class<Integer> and its corresponding value could be Consumer<String>. and so on...
I mean yeah makes more sense ig
although I cant really make that
man I forgot ? super E exist
You can never pass anything to something that accepts a wildcard with an upper bound
It's not type safe anyway, in those situation I often end up using raw types because generics simply aren't expressive enough
because generics simply aren't expressive enough
That's very true
whats better to use NMS for NBT or just use default bukkit stuff: PersistentDataContainer
persistentdatacontainer is 1.15+
Use nbt then yea
i mean i could search for some nbt util online but thats extra code eh.
Check Matt's GUI lib, it has an nbt class which has everything you need
since if i want to use 1.13 - 1.16 i would have to use nms for each ver
where?
oh
there
since if i want to use 1.13 - 1.16 i would have to use nms for each ver
@dusky drum what do you want to do
You may be interested in this as well then, this is one possible (and very fast) solution to version issues https://github.com/johnnyjayjay/compatre
If it's java, without any boilerplate this is a lie 
The others would be some library that has an implementation for every version or reflection
Matt's NBTUtil class is nice af
That does not work before 1.15.2
why wouldn't it?
If it's java,
without any boilerplatethis is a lie
@hot hull it's literally true in this case lol
liar liar chicken frier
(I'll see when chrome decides to stop being a whore and actually opens)
@dusky drum frosty already told you that this api did not exist before
did he?
Yes? That's the whole reason you asked about nbt in the first place?
Mate
You got an answer to this
"i know" 
And you said you want it to work on older versions
So the question becomes obsolete
omg i firking asked whats better nms or friking built in stuff i didnt ask for verison support.
eh
And yes you did mention versions lol
no?
this is getting controversial
What is your memory
bye
i fucking asked whats better to use nms or default stuff since with fucking nms you have to do wierd stuff.
is it so hard to anwser that?
Gasper..
You were given an answer to everything, just read....
IF you're only worrying about 1.15+ then use PersistentDataContainers
with i know i anwsered that i know persistentDataContainer is 1.15.
Otherwise use NBT
i mean
customTagContainer = persistentDataContainer*
spigots nbt api has changed like 2 or 3 times iirc
"I want to store data on 1.13-1.16. What's better, PersistentDataContainer or NBT?"
"You can only use NBT then"
"That wasn't my question!"
Spigot doesn't even have an NBT api
Or was that added recently
@dusky drum Evo ti https://paste.helpch.at/tokiribusa.java
frosty sej bi to uporablo sam k pol morem string dat v int
Vse je k string stored
stroke language
bruno mars
srma orunb
Conclure these doggo pics keep getting better
There has to be a way to make this more concise:
fun formatUuid(uuid: String) = if(uuid.length == 32) "${uuid.substring(0..8)}-${uuid.substring(8..12)}-${uuid.substring(12..16)}-${uuid.substring(16..20)}-${uuid.substring(20)}" else null
(inserting dashes at certain indices)
[Service] custom Plugin
[Request] a simple plugin that when i do/fit makes everyone on the server typefin the chat
@civic bramble Ez skript:js command f: permission: f.use trigger: loop all players: make loop-player say "f"If you don't know how to use skript, https://www.spigotmc.org/threads/how-to-install-skript.302512/#:~:text=More videos on YouTube&text=Try watching this video on,file in the scripts%2F directory.
Typed it here because I can't type there
zero two
Or @civic bramble this: https://www.spigotmc.org/resources/masssay-troll-plugin.63742/
we dont do that here
Skript? I find it useful for simple things
Skript you you skripting skripter
Leave.

Sometimes I make it a challenge to package a block of Java code with a couple of lines into a one-liner in Kotlin as I am converting my lib to Kotlin. This is the best one yet 😄
you can make that better cant you
Get fucked, future Blocky, trying to debug this
remove the return and remove the { }
Still waiting for multi catches in Kotlin 🥺
its been like 5 years since someone requested it
its not happening any time soon.....
Also matt is MF-MSG ready for use yet or na?
remove the
returnand remove the{ }
@obtuse gale true, I could
Hm What's the difference between fun and inline fun? Like when should I make something an inline fun instead of a fun?
@empty flint why not just use OfflinePlayer.uniqueId ?
@empty flint why not just use OfflinePlayer.uniqueId ?
@prisma wave Is that a thing? What does it do?
And how do I get the OfflinePlayer from the name?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/OfflinePlayer.html#getUniqueId()
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Bukkit.html#getOfflinePlayer(java.lang.String)
declaration: package: org.bukkit, interface: OfflinePlayer
declaration: package: org.bukkit, class: Bukkit
getOfflinePlayer by name is deprecated
exactly
but thats possibly what you are looking for
No that's exactly what I wanna avoid
I mean you are already fetching by name
but it's not deprecated afaik
no
is there a sort of transformation function like map {} where it takes a string and outputs a string?
Then I don't see why not just use getOfflinePlayer by Name. With spigots history of using deprecated annotations, they probably just meant to ask people to not map thigns by username
Not completely sure tho
Do you by any chance need UUID of players who have not yet visited the server?
Then I don't see why not just use getOfflinePlayer by Name. With spigots history of using deprecated annotations, they probably just meant to ask people to not map thigns by username
@old wyvern Because I don't want to have to re-write this if they do decide to delete it and it's not like I am using that method so often
Do you by any chance need UUID of players who have not yet visited the server?
@old wyvern Yes
Because, bungee
I've learnt some basics of the spigot API - (sending messages, event listeners/handlers, config) - can anyone suggest what I should learn next?
Ah then you cant possibly use OfflinePlayer
It only resolves UUIDs of players who have joined the server prior afaik
alright - for the database, should I just go with an SQL-based one or something else like MongoDB
It only resolves UUIDs of players who have joined the server prior afaik
@old wyvern tbh I wrote this like two years ago or so so I don't remember the details of OfflinePlayer but I do remember having tried everything else before resolving to this hideous mojang api and json fuckery
I would scrap it if there was a better alternative
I see
I already know some, but not really very much
my experience is limited to typing in " OR 1=1 in search boxes and hoping that the page is vulnerable to SQLi lol
its tutorial crunch time then
(JSONValue.parseWithException(IOUtils.toString(URL(getNameUrl(uuid)), StandardCharsets.UTF_8)) as JSONArray).map { it }
Why does it have type Any? when I call the map function from a JSONArray?
oh wait
it is the contents of the array, right?
nvm
@empty flint getOfflinePlayer queries mojangs API if the player isn't in the server cache
so if like player never joined server its gonna query the mojang?
getOfflinePlayer queries mojangs API if the player isn't in the server cache
It does?
iirc getOfflinePlayer it's never null
/**
* Gets the player by the given UUID, regardless if they are offline or
* online.
* <p>
* This will return an object even if the player does not exist. To this
* method, all players will exist.
*
* @param id the UUID of the player to retrieve
* @return an offline player
*/
@NotNull
public static OfflinePlayer getOfflinePlayer(@NotNull UUID id) {
return server.getOfflinePlayer(id);
}```
yea but last I tested it failed to fetch the right UUID when hasPlayedBefore was false
is daisychaining and nesting methods better than to declare variables?
for readability, declaring variables is better
@empty flint getOfflinePlayer queries mojangs API if the player isn't in the server cache
@prisma wave Are you sure?
I believe that is correct
Still, I don't like accessing the deprecated method of getting an offline player via the name
The only way to get around that would be making an API request with the name, or somehow getting the uuid a different way
apirequest is exactly what im doing
do objects have to be encapsulated by some top level declaration?
I have no idea what that means
object PluginManager: PluginManager by Bukkit.getPluginManager()
object Server: Server by Bukkit.getServer()
IntelliJ doesn't like this
It's stuck in the code analysis
lol
Probably failing because they have the same name
It's like class PluginManager extends PluginManager
Browsing stack overflow is great, every once in a while you find a question without negative votes lmao
i don't think i have ever just browsed stack overflow lol
What, how do you code then?
Lol
i go on stack overflow
i just don't browse it
i search for questions i need to know answers to
Under what circumstances does an ItemStack not have an ItemMeta?
When it doesn't have an itemmeta 
AIR doesn't have one
oh interesting
KM, u nub, my air has lore
Does renaming the item on an anvil affect the localized or the display name?
display name
Tf is localized name even used for?
It's for different languages i think but i have never seen it used
But
It doesn't ever work
ItemStack goldSwordStack = new ItemStack(Material.GOLDEN_SWORD);
ItemMeta goldSwordMeta = goldSwordStack.getItemMeta();
assert goldSwordMeta != null;
goldSwordMeta.setLocalizedName(ChatHelper.colorize("&6GOLD SWORD"));
goldSwordStack.setItemMeta(goldSwordMeta);
I wonder, would I be allowed to publish to maven central a modified fork of a "BSD 2-Clause "Simplified" License" project?
Localized name is only internal iirc
is there an equivalent of BroadcastMessageEvent on 1.8?
yarr
You trynna tell me you don't use it all the time? @empty flint
Aye
(the yarr language)
yarr
wth is localizedname?
Gonna ask again xD
Would I be allowed to publish to maven central a modified fork of a "BSD 2-Clause "Simplified" License" project?
I guess as long as i don't change the license it should be fine?
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
So, the contents of the license and a copyright notice whereever you can
Gotcha, basically just need to modify it because for MC there is a few things that aren't great, so would need to have it somewhere for easy access
An example is that it instantly strips any tag like <g>
There is in the html parsing, but the way I do it there isn't, basically instead of letting it parse to html then handle it, i have to use it's node visitor to check for each node, and the parser doesn't have any options as far as i know
And another one that i'll really need to modify is that t__est__ this is not an allowed syntax in commonmark
Why are you messing with commonmark again?
You mean why i am using it? It's the base of the markdown lib
Or you mean why i need to modify it?
prepend means place in front. append means place in back.
is there a word like "inpend" or something (other than insert, ending in -pend)?
(something like prefix, suffix and infix)
No, i use commonmark to handle that xD
I was trying to make my own, but was getting too complicated
So Sx showed me that i can use their visitor to get the parsing stuff without much work
It's pretty small and fast so i think it's better than anything i could write
Fair enough
But I mean you kinda have an own markdown flavour
So I guess that makes for a lot of complications
Yeah, there is a few complications, I managed to solve most of them
Only 2 that requires me to modify the parser, and only one that has been pretty complicated to do which is the underscore rules
Is it really 2 progress bars? lmfao
rip 😂
I think I hate python again
Nah
Found the dumb delimiter condition for this t__est__
Removed the if and it works just like discord t__est__
var ItemStack.damage: Int?
get() = when {
!hasItemMeta() || itemMeta !is Damageable -> null
else -> (itemMeta as Damageable).damage
}
set(value) {
if(hasItemMeta() && itemMeta !is Damageable) (itemMeta as Damageable).damage = value ?: return
}
How do I improve this?
(itemMeta as? Damageable)?.damage
shouldn't it be (itemMeta? as? Damageable)?.damage then? Or does the safecast already take the nullability of the object into account?
That's not right
Well it's redundant because null as Anything will still be null
var ItemStack.damage: Int?
get() = (itemMeta as? Damageable)?.damage
set(value) { (itemMeta as? Damageable)?.damage = value ?: return }
much cleaner
ty
Disgusting
Oh sorry, I didn't mean that, I looked in the mirror
😛
Why the ?: return?
I would use 0 instead of nullable Int
Bruh you reading my fucking mind lmao
Why the ?: return?
@lunar cypress right I forgot to take that out, ty
Bruh you reading my fucking mind lmao
@hot hull Nah man, not your mind. The future.
I would use 0 instead of nullable Int
@prisma wave That would be ambiguous with actual 0 dmg value
Damage is stupid
I think so
You add to reduce damage
Bruh
Like what fucking idiot decided that
I get so confused between damage and durability
wait
Yea talking about dura rn
maybe I fucked up
Isn't damage the old way of doing wool colours and stuff
Yes KM
Bruh what
¯\_(ツ)_/¯
durability is the same as damage
Damage only exists in newer versions
Big brain spigot again
Meta
=haste
Please use a paste service to share configs, errors, code and long logs.
• HelpChat Paste
Meta
@hot hull Are you sure?
oh yeah ur right
So then this is the final result:
var ItemStack.damage: Int
get() = (itemMeta as? Damageable)?.damage ?: 0
set(value) { (itemMeta as? Damageable)?.damage = value }
maybe the set won't work though
because I might have to re-assign the meta?
set(value) { itemMeta = itemMeta.also { (it as? Damageable)?.damage = value }} this would be the workaround I guess
kinda hideous
idk I like it tbh. Especially since I can then just do itemStack.damage = 1000 and the code will be so much cleaner with that
no more assigning and re-assigning the meta
hmmmmm
[18:51:14 WARN]: Can't keep up! Is the server overloaded? Running 5455438ms or 109108 ticks behind
thats quite a lot
Hm
Next one:
fun tryCreateHead(headDescriptor: String): ItemStack? {
val descriptorElements = headDescriptor.split("\\(|\\)")
if(descriptorElements.size != 2 || ItemMaterial[descriptorElements.first()] != Material.PLAYER_HEAD) return null
val headElements = descriptorElements[1].split(":")
if(headElements.size != 2) return null
val valueType = headElements[0]
val value = headElements[1]
return when(valueType.toLowerCase()) {
"texture" -> createTexturedHead(value)
"player" -> ItemStack(Material.PLAYER_HEAD).also { (it.itemMeta as SkullMeta?)?.owningPlayer = getOfflinePlayer(value) }
else -> null
}
}
Any ideas how to clean that up? I don't like the array split methods but they are necessary unfortunately. Any way to make them prettier?
Me when I make a plugin:
me when clojure 😎 
that's only half your pom.xml
GRADEL
ew
when you run mvn clean compile does that error happen as well
@runic flume Gradle or crusade
or
okay, cheers
👀
@hot hull It's technically ready
Just need to do some documentation and i really want to DRY this code a bit, this part is bothering me
Also in word underline also works now
smells like rainbows in here
Oh yes
You're a genius with this classes for colors
my tag parsing logic was absolute trash so I hope you've at least improved that much of it
I had to change a bit yeah, it's not great either but for how i handle the colors it was a bit easier to work with
<(?<r>r|rainbow)(?<sat>:\d*\.\d*)?(?<lig>:\d*\.\d*)?>
My regex writing capabilities are pretty bad lol
I was at one point going to write my own token parsing system for tags and hex colors but just said screw it and hacked together some parsing that worked instead, much less work
This is my code handling part, which is kinda bad xD
https://paste.helpch.at/onosigajuy.java
you might as well simplify it by removing that if statement entirely
I should look into how the regex groups work because that looks a lot nicer than mine
that's a good point
Also another change i made to yours is that I allow 3 hex characters too for example: <g:#000:#fff>
I was going to do that but decided it was too much work at the time lmao
People don't really use the 3 digit versions that much so I just shrugged it off, it's good to support though
Yeah, i think i copied a bit of it from Niall and the rest was on my own xD
@ocean quartz chat format framework when?
soon™️
lol
God i hate writing javadocs in java, shit's so repetitive
yeah KDocs are so much better because they use markdown
God i hate writing javadocs in java, shit's so repetitive
@ocean quartz Aren't you supposed to write them in plain text? *ba dum tss*
markdown vs HTML isn't even a competition lol
@ocean quartz Can I send you some Dollaridoos to support your framework
Sure ;o
Gonna need some paypal info or something...
you be out here getting paid for your open-source work lol
@jovial warren Have you heard of Wikipedia?
It's important to support the things you are excited by. Wikipedia, The human genome project, ESA, Matt's color framework...
I'd set up a Patreon or a Buy Me A Coffee but I know I wouldn't get any donations since nobody uses my shit lol
Wikipedia recently asks for donations on every few visits now with a weird banner or something
yeah
I guess fair enough
I'd set up a Patreon or a Buy Me A Coffee but I know I wouldn't get any donations since nobody uses my shit lol
actually, not strictly true
my bot seems to be used more and more these days
I can buy you a coffee if you want
https://github.com/BomBardyGamer/BardyBot/stargazers wait I got more than just me starring my bot now? wow
nice
km I did it
I'd support PDM if you'd get your ass in gear and fix it lol
wtf did I write
I'm messing with you anyway
log with base 2
That was so random
idk what you're talking about rly
I question from #off-topic
ah yes
log base 2? why base 2? lol
huge
log base 2? why base 2? lol
God knows at this point
My guy just told us about a simple minimax implementation and then went on to make us write a "minimax heuristic function"
@onyx loom lies
unless its a feature
everything is a feature
Anyway, gn bois
you've got the standard common logarithm (at least that's what I think it's called, or log10), and you've got the natural logarithm, denoted loge
then you've got every other logarithm
I used log with base 2
you don't even wanna know how long it took me to fully understand logarithms lol
gn
I spent a few days of non-stop research on that
wait why xD
natural logarithm is usually ln
because I wanted to know about it @old wyvern
I mean what more is there to know?
@prisma wave yeah ik, but denoting it loge makes it easier to see that it's using the mathematical constant e
I think it meant e as base notation
Its not ussually written bard
its implied
when you dont specify a base and use ln
oh it does?
I think so
I ussually specify the base so havent noticed
O(log n) means log base 2 iirc
oh you meant that
"the logarithm is the inverse function to exponentiation, meaning the logarithm of a given number x is the exponent to which another fixed number, the base b, must be raised to produce that number x" (source: Wikipedia)
basically, if logb(x) = y, b^y=x
lol
don't ask me why I explained that lol
we know
I was talking about the function
anyone who didn't know what a logarithm is, now ya do I guess
I'd set up a Patreon or a Buy Me A Coffee but I know I wouldn't get any donations since nobody uses my shit lol
@jovial warren Idk how much you think I just paid Matt but I'm not using any of his stuff either. I just really like that idea and wanted to show my support.
I really like the idea of a clean library for runtime dependency downloading
it would be really cool if somebody donated to this hypothetical library
xD
Base doesn't really matter in landau notation for exponential / logarithmic complexity if that's what you meant earlier
Good point actually
It's just about the growth behaviour, not about concrete values
Which is why you discard constant factors etc too
(Typically)
Sometimes it makes sense to mention them, e.g. for clojure vectors
Their random access is technically O(log n), but in reality the base is 32 because of the branching factor, which essentially makes this near constant time for most use cases
Oh because they're persistent data structures?
Yeah
Makes sense
They are implemented as a tree like structure
Which makes it possible to share a lot of structure but obv increases the complexity for reads over regular arrays
Yeah
It's measurably slower but again the most important part is the scaling with the number of elements
Which is near constant
But even if you need high performance (esp memory wise) (because you insert like a million elements sequentially or sth) there are transitives which are basically write only mutable data structures that can be turned into persistent ones in O(1)
clever
😮
yea i love that feature
@ocean quartz noice
@prisma wave Do you know if gradle has some way of auto.versioning your builds?
how do you mean?
Well generating an incremented version of your build
So like 0.0.1 -> 0.0.2?
right, gonna see if I can find something regarding that 😄
@empty flint I have a repo for that
@steel heart You mean you created a plugin that does that?
Though code behind it is ugly it works good
Kinda a single file
Going to make it a plugin
So you increment the versions by running the appropriate task?
Yep
And it finalizes by the shadowJar task
Well edit it how you want
Just a template anyways
Tryna learn groovy little
what does the shadowJar task do?
Builds a shaded jar
Yeah alex but that would be full groovy and no Java?
Well I have no clue what the restrictions would be
You can write plugins in pretty much any JVM language
Ah
@empty flint assume you might want to replace it with build or jar otherwise
(Task names)
Maybe I have the wrong idea of what finalize means.
task1.finalizedBy task2 means whenever task1 has run, task2 will try to run after
Sequentially
so after shading a jar, the tasks are triggered?
First the task majorJar, minorJar or patchJar runs then the shadowJar task
(:
In that way shadowJar isn’t dependent on the other tasks 😉
Well need to sleep gn
gn8
I found this: https://github.com/davideas/GrabVer
Gradle Automatic Build Versioning Plugin - An easy Gradle plugin that follows semver.org rules to automatically generate the Patch version, Build number and Code version, while Major, Minor and Pre...
But I can't get it to work for kotlin dsl
the buildscript seems to work but as soon as I add id("eu.davidea.grabver") to plugin {...} it just breaks
what kind of construct is this in groovy:
versioning {
// Required (number)
major 1
minor 0
// Optional, force custom patch (number)
patch 7
// Optional (any string)
preRelease "RC1"
// Optional, custom task name to trigger the increase of the version
incrementOn "<task-name>"
// Optional, custom task name for which you want to save the versioning file
saveOn "<task-name>"
}
I have been convinced to use IntelliJ instead of Eclipse (and now will be using it 75% of the time) 😄
why 75
because of the workspace
but when I don't need it I'll use IJ
or should I use notepad
biggest pain when coding is when ur stuck on why something isnt executing but then u realise u misspelled something 😔
Logical errors do be the worst 😦
but when I don't need it I'll use IJ
why would you ever needs eclipses one
just use notepad
or ms paint
@empty flint seem that one but didn’t work for me
Bruh that last #738969308746612766
what a deal!
Gg
Frosty, couldn't release the lib yet cuz of a bug with subtitle, but I'll do that first thing in the "morning"
Yea no rush
Where should I like construct my GUI's? Like what should the class where I do that be called? Just so I can open it onCommand and I dont want the gui making to be in the command method cos itl get messy
MenuFactory
Where should I like construct my GUI's? Like what should the class where I do that be called? Just so I can open it onCommand and I dont want the gui making to be in the command method cos itl get messy
@obtuse gale I have a GuiHandler that constructs all my guis on load and the command calls GuiHandler.populate(...) with only the parameters that are user specific
is this open source?
I have a GuiFactoryProvider<Inventory> which creates, manages, deletes, stores and map guis
is that open source lol?
Can maybe share that one when arriving at home
I have an abstract Handler class with an init method. Each implementation calls it in the constructor and checks if it worked or not and throws an error if not (wrongconfig and what not)
Cos im using matts lib for the actual guis, i just need an easy way to get them in my cmd
Yeah just create them on startup, store them in a map, call the get in the command
private val invs = mutableMapOf<String, Gui>()
init{
invs["invOne"] = createInvOne()
}```
something like that?
well mine's a bit more complicated but yes
not in your case aparently
Aj, would be best if you make a non gui specific factory, then you just pass in what gui to construct, cause you know, futureproofing 
Are these guis going to be customisable from config?
naa
Well Idk but the class I have is in java and is maybe around 700 lines
Aj, you disgust me
Doesn't matter, you'll learn
ree
I mean my original plan was to just make private methods in the command class that made them
Srp 
yeaaa
Yup
Aj, do what you think is best, it's the best way to learn
bruh
Don't bruh me bruh
Have a class that is responsible of storing guí, have a class that can manage the storing etc
At the end exactly how you didn’t shouldn’t matter too much
It should be maintainable for you or anyone else who reads it less or more
Aj, do what you think is best, it's the best way to learn
class MenuHandler {
private val gameMenu = Gui("Game menu")
init{
setupGameMenu()
}
fun getGameMenu(challengedName:String):Gui{
gameMenu.updateTitle("Challenge $challengedName")
return gameMenu
}
private fun setupGameMenu(){
gameMenu.addItem()// Just add in all the items here
}
}``` Thats what id do but I know theres probably better ways lol
Handler shouldn't contain any gui code, it should only handle it
so is this a problem with the name of the class or like it being a bed way to do it
As dogoo boi said, have a Handler or something class which stores your guis, and manages the calling of them, then have a seperate class for each gui which you load on enable
The SRP strikes again
Kind of a dumb principle
You're a dumb principle
:(
:)
Also is it just me or is maintaining a big Java codebase really difficult? It constantly feels like it's become a huge mess and needs rewriting
happens in every language imo
I guess
cuz u write shit, then leave it for a while, and when you come back you’ve learnt so much more
It seems to happen more with Java in my experience though
well I’ve noticed that too
Like it starts off really clean and then after you add a few things it's turned into a stateful mess
simply because java is my primary language
true lol
the clean stuff is the stuff you’ve written thousands of times before
the ugly is the actual functionality
That makes sense
As dogoo boi said, have a Handler or something class which stores your guis, and manages the calling of them, then have a seperate class for each gui which you load on enable
o, like a class per gui that just has a method that makes it or something?
Not per gui unfortunately. Per command. One command has 2 guis and the other has a variable number, depending on the config
the commands are called /ranks and /rankup, hence the naming
If that's java, finals 
@obtuse gale Here's what happens in the /ranks command
static 
And the RanksGuiHandler gets created once in the loading phase:
public RanksGuiHandler() throws InitializationException {
this.lw = BlockyRanks.getLogWriter();
initialize();
checkInitialization("Failed to initialize the ranks gui.");
}
The initialize() method creates all the guis
basically
Static 
I want a new keyword
Something interesting
Static is getting boring
strictfp abuse
Now that would be fun
I want a new keyword
@prisma wave what would that keyword do?
If that's java, finals :GWsetmyxPeepoCry:
@hot hull wdy mean?
I mean if it's java everything should be final
As it should
Something cool
@prisma wave it's a raffle for the presidency of the united states. Whenever that keyword gets processed, somebody else gets the nuke codes.
I propose something like
potus static final gimme(...)
That definitely is cool
Waiting for Kali to drop the nukes
Does anybody know the correct maven repo for McMMO?
Lol
. Lets agree to disagree
