#dev-general
1 messages · Page 370 of 1
github issues are more to report stuff and less to keep track of your own progress
GitHub issues + GitHub projects
oh damn thats kinda cute
Not Started
seeing others' skins
oh no
glad seeing your own skin is done though
yeah last time I tried to fix that I got a really really weird bug
you can see others’ skins, you just can’t see the parts of their skins
setting that metadata turned others’ skins into my inventory
well, it turned my alt’s skin into a picture of my inventory
it was really cursed
oh also, if you load up the server, you may notice quite a few missing sections
if you load up a proper world
still gotta figure out what it doesn’t like and why it skips certain sections
Can plugin development help later on in life if I get into programming? Like I won't be making plugins later on ofc but like yk
any practice is good practice really
every time you program something, no matter your experience level, you generally learn something new
Yeah but the things I learn, will they be useful later on?
Or is it just learning how to learn basically
Yes but mostly the basics I feel like
whats the "basics"
if you break complex projects down they are all "basic"
so if you know the basics
you can make a project
exactly
most bugs in programs, in fact probably around 95% of them are very easy fixes
But to directly answer your question, when you do plugin development your learning a programming language, that language you can apply to any other project since the syntax of the language doesnt change project to project, so yes they will be useful later on
For example, I started plugin development about 9ish months ago now
and i got an internship for software development
coming up
2 completely different projects but the skills transfer
Yes
Absolutely
The generic programming skills can be applied everywhere
Especially if you do plugin development outside of mc scope
aka you use docker to make something which is an absolute overkill and will probably never be used
generic programming skills
Yes, especially so in a worth with turing complete generics 😌 💀
also once you know one language any others become a LOT easier
Still waiting to be able to add elara to my resume
Can we all start pinging Gian and tell him to update java?
forcing me to compile a plugin on java 8 ;C
uh I kinda forgot it existed
🥲
You start and everyone else follow lol
@kindred hatch update java.
@kindred hatch update java.
@kindred hatch use Haskell
@kindred hatch use Haskell
@kindred hatch use Haskell
Goddamn it
omg
15/16
The circlejerk lol
I would still build with 8 for older versions, but use that as your JDK yeah
I need someone to make me a plugin for my 1.7.10 server on Java 7
I hope you stub your toe
wdym?
take a look at the example bellow that
yeah but docker, what can that be used for in programming?
np ill use kotlin, then if u want u can use java 6!
I havn't really used it before
Its used to deploy apps
ye but plugins aren't apps?
They aren't no
idea was to run the brains of a plugin in docker to allow for scalability
Docker good
isn't docker just for making an app usable on multiple OS's?
You know you can actually run Minecraft in Docker?
No
Docker is for containerisation
Why...
It allows you to separate your apps into their own little worlds
Because Docker good
🥲
You could build a Docker image for Minecraft in about 4 lines
I mean imagine the scalability
Literally everything
I guarantee every major tech company uses docker somewhere in the stack
or k8s
which has seemed to have superceded Docker on RHEL
and Google uses their own form of deployment system that is basically now kubernetes
Yea k8s seems to be more sophisticated tho
k8s works alongside docker?
does it?
k8s is just clusters no?
did someone say docker
k8s is an orchestration tool for docker / containers
aka it lets you automatically deploy docker instances, load balance across multiple machines, scale
you're pretty much required to use an orchestration tool like k8s / docker swarm / etc. if you want to use docker in production
I was wodering why rider was showing me a warning there 😂
Took a while to actually see the double assignment
@oblique heath btw, I decided not to start with docker, but with the actual bungee implementation itself
since it'll be easier to test that if I have the sub server shit done
that's fair
Anyone got suggestions for bulk buying of pens, need something ergonomic and cheap
that's a bargain
Just buy pens lol
It can't be that hard
Also, is it just me or is Sponge obsessed with IAbstractSpongeFactoryProviderBeans lol
I hate store bought pens, most of them are not ergonomic at all, and the ink is absolute trash
ew no
@jovial warren I presume I shouldn't have marked HOCON as SmartyConfig right?
broke all my colors ;C
fixed
I know a server that has a antilag that stops redstone... but is there a way to make it stop without breaking like redstone farms?
How are you supposed to stop breaking of redstone farms if you disable redstone
🤷 but a server that i used to make plugins for claimed they did
I'd presume storing states before you shut it down and then reapplying said states, but that'd be inefficient af
the only thing i can think of is that or just not turning on redstone (so if it's on, it'll stay on)
Mother fucker
${version} ftw
be gone with maven
?
I might steal the redstone update logic from PandaWire
Yeah I saw lol
Yeah HOCON ain't gonna be able to parse that as a string
That's not a hocon issue
It's parser is good, but it's not that good lol
That's a yaml issue
dis why YAML bad
Laughs in 60mb java file for a spring boot todo list
😖
Anyone uses VoxelMap here? I need to ask something
This one confuses the hell out of me, because I do not understand what I should do
There is no time to wait! Ask your question @heady birch!
There is no time to wait! Ask your question @regal gale!
Wot
I mean, yeah sure
I have this "data" file from the cache folder (aka region folder)
But I don't know how I could read the data file in code, cause of the confusing doc there
@jovial warren What am I missing
ur mom
Wdym?
bukkit yml ftw
die
y
Because it's absolute fucking horseshit
bukkit configuration is pretty poopy yeah
Gotta get that as a map
removing entries is a nightmare
Show code
code is legit ConfigFactory#load(path), and then getString
seems to be deserializing the entire plugins folder 
Wow
It’s like the best
What the fuck
It uses File obv superior
It uses Java obv superior
True
Lol
Also, Bukkit's configuration system sucks ass
That's just a fact
Just the way it's designed is a mess
dw hes joking i promise
Just look for yourself
Yeah
He has to be ironic
MemorySection is a joke
It’s the best dw
And the idea for configs to know who their parent is just seems counter intuitive
Since we want to turn it into a tree
I mean it’s a feature
One of my favorites
Are you actually genuinely being serious about thinking Bukkit's broken configuration system is good Conclure?
bardy back at 3 brain cells again
smh
i think you swapped brain cells with dkim
lmfao
Pulse stfu
lol
I might have exaggerated but it hits my good vibes
I wouldn’t say broken because it isn’t
Cmd + alt + shift + K in IJ is better
the more the merrier
Then ofc the File thing isn’t nice
Please someone back me up
But it’s not terrible
I do use Configurate as it has more than just yaml impl
But I like bukkits config system
I mean, maybe the actual API isn't awful, but the way it's implemented is
MemorySection is a joke
lol
Yeah the implementation may be somewhat dodo
I mean it’s very out to date thats in a sense true
But doable 
"Somewhat doodoo" is an understatement
Bukkit's config system has a lot of issues though
I haven’t encountered any significant issues
it's a pain to go from
banana:
tasty: true
to
banana:
You mean unset the value of the key banana?
Change the type of it
I guess
Also, YAML in general is just a mess
The YAML specification is a joke
Specify what specs are a joke
shade triumph config :)
I feel like yaml makes fine
NO unquoted, by the specification, turns into a false boolean
Oh yeah that shit is somewhat unorthodox
This looks familiar...
StrictYAML exists for a reason
json exists for a reason :^)
Was talking about the implementation instead of usage issue
Like it has many methods that are useless, many that redundant and it has shit in the Config and some in JavaPlugin, there is no organization
how do you unset a value
JSON is easy to create, uniform and easy to parse, but some people find it difficult to read
see you'd think so
It works fine for me
Lack of organisation is Bukkit all over
Why would you want it empty without a value
JSON
actually wait sorry, what i really want is to completely remove a key-value pair
so from
banana:
tasty: true
smelly: false
to just
banana:
tasty: true
iirc setting it to null would do that or no?
setting it to null gives
banana:
tasty: true
smelly: []
Hmm let me try ivan
alright, lmk if you figure anything out
because the way i work around this is a pain currently 😢
Fact of the matter is: kotlinx.serialization superior
that's factually false

hmmmm
Bukkit's thing setting something to null effectively removes it from the backend map
Yeah haven’t checked impl but I think the api is fine as it is rn
that's just an empty list
﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍
︴ Package Extension ︴ VLC Binaries? ︴ Algorithm ︴
︴------------------- ︴--------------- ︴------------- ︴
︴ (.deb) ︴ Nope ︴ ︴
︴ (.rpm) ︴ Nope ︴ ︴
︴ (.txz / .tar.xz) ︴ Yes ︴ ︴
︴ (.tgz / .tar.gz) ︴ Yes ︴ ︴
︴ (.zst) ︴ Unknown ︴ ︴
︴ (.eopkg) ︴ Unknown ︴ ︴
﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉
does that table look good
It looks cute
I mean just have it as a map?
ur cute
Oh also, the methods that take default values are a joke
ah yeah, they are marked as nullable.. because it lets you pass null....
that's legit shit
yea those are terrible lol
if (value == null) return null
Haskell pattern matching in the maths textbook 😳 😳
lol
the fuck you talking about
dw lol
p x = case x of
| -2, -1 -> 0.1
| 0, 1 -> b
| 2 -> 0.2
im so tempted to use a deprecated method rn
lol
what does it do?
gets the display name of the player
use components for that
as a string, nice and simple
im gonna have to look at a another youtube video, arent i?
Minecraft got rid of strings complelely ages ago
^
^^
they are legacy
wait wot
adventure
why?
do not use them
it's just md5 dragging legacy shit over
d;spigot Player#getdisplayname
@NotNull
String getDisplayName()```
Gets the "friendly" name to display of this player. This may include color.
Note that this name will not be displayed in game, only in chat and places defined by plugins.
the friendly name
use chat components
uh
because components are better
^
d;paper player#getdisplayname
@Deprecated @NotNull
String getDisplayName()```
in favour of displayName()
Gets the "friendly" name to display of this player. This may include color.
Note that this name will not be displayed in game, only in chat and places defined by plugins.
the friendly name
d;paper Player#displayName
@NotNull
Component displayName()```
Gets the "friendly" name to display of this player.
the display name
you're right 😢
i have no idea what I was doing to get different results before
but yeah i tested this because I was unsure and it does remove it
btw, will i ever get the right to post images
tier 2
alr, im gonna go watcha another youtube-
oh yeah forgot, gotta uninstall oracle jdk
youtube tutorials are great /s
well a youtube video had me install oracle jdk which has strings attached to it >:((
read 👏 the 👏 docs
hence the /s
youtube tutorials suck
what does /s mean-
sarcasm
/s = sarcasm
You learn something new everyday
you know what's a genuinely good youtube tutorial
no
BM's Java Tutorials Episode 1
also, OpenJDK good Oracle JDK bad
nice
Oracle JDK is licensed under a semi proprietary license
Well to be fair Bom, I knew I was doing something weird when signing up just to use the jdk. I know developers hate proprietary stuff
OpenJDK is GPL
the worst part is someone said adoptopenjdk in chat without any context and i didnt know what they meant 😔
lol
u have to adopt the jdk
hopefully openjdk will just uninstall oracle java because i'm on windows
yeah Oracle’s move to require signing up is just going to push more users away and towards OpenJDK
yo theres a java 21?
oof lol
sounds a bit like Windows 12 haha
Btw, I've never touched oracle java in my time of using java until now. Just told to download openjdk via apt
you know someone’s actually rebranded a Linux distro into Windows 12 and is selling it for $40 on the net
TheAPI
you should use skdman romvnly
best API ever wdym Fefo
sounds scary and not compatible with the openjdk i already got on my vps
nah, in all seriousness, the title for the greatest plugin API in existence atm has to go to LuckPerms
LuckPerms best
Maybe later on once I get a grasp of what im doing in my plugin commands
lol
rn im looking at the docs
lol
I like him, doesn't like reading the docs 🦾
wait is that an adaptation of the LuckPerms API
oh no....
I have no idea what that is
"I know its good and I have to learn how to use it, but It sucks so im gonna make my own"
😂
lol
lets think. what will take longer. making a good perms plugin, or learning how to use the LP API
because that's going to turn out terrifyingly well
he's a developer! he doesnt use gmail, he creates his own email service just to read the email saying that he wasnt accepted into the coding school
lol
Joins helpchat two days later
Why isn't this code working
insert code from terrible-plugin here
Jokes on you, I accidentally joined this discord and I was just gonna sit in the server
lol
oop
how many of you can say you've accidentally joined a good discord because you had your phone in your hand while not paying attention-
lol
idk if its an accident but im only in here bc i joined a while ago for help with deluxechat lmao
dkim please
where is this happening
no
those messages look 2 weeks old, you're late to the party
lame
yes
good point
gimme link now or imma come to your house
btw does anyone watch ben awad?
rarely
lol this is my reaction
i do sometimes
ill get some food ready
lol
i cant believe this guy though! he's treating custom plugins like custom built pcs
lol
I mean ngl I wouldn't mind $200+ for a fork of LuckPerms with different message styling 🙂
id love LP with a messages.yml
imagine not knowing what localisation is
but i guess its open source so i can do whatever i want im just lazy
en.properties
is that a thing
LP is on crowdin for a reason lol
facts actually
It's not in the locale folder but you can throw it in yeah
The english locale file is bundled in the jar
luckperms_en.properties
These TextComponents are very different from Javascript
Why are you comparing chat components with javascript lmao
it's the only coding language i knew prior
well java and javascript are basically the same so it should be an easy transition
controversial
well car and carpet are the same so you can just hop right in and drive anyway
exactly
oh wow
no clapping 😔
😳
lmfao
🥲
h
i
LMAO
The reason to this could be explained below
Or not
Yeah but "could" isn't correct lol
i meant can
idk, I feel like "is" fits best
but y'know I'm not the native speaker
oh ffs
Aren't you american?
Ya
The reason to this is explained below
Oh ic
🥲
🥴
Did you ask for a American? I'm a Floridan, top tier American.
Florida man!?!?
Terrifying
:)
oh thanks barry...
Pulse keep doing it please
🥲
are people really that stupid?
Well yes, yes I am
Florida >>>
@jovial warren This is how we gonna go cliff jumping, excuse it being a tiktok
https://vm.tiktok.com/ZMeDTjyDL/
lol
good luck!
dont carry parachutes while jumping off cliffs!!
parachutes add extra weight!!
makes you go down faster!!!
true!! this is why people die when their parachutes dont open
^^^^
if they didn't have the extra weight they would be alive!!!
actually even if your parachute fails you have a 100% chance of surviving
every single person who I've talked to who had a parachute fail is alive
thats true
😎
Lmao
indisputable evidence
Is there a fast way to loop through 1.5 million values in a list?
and run some stuff in each loop
don't question why
Question is why tho
parallel stream would be fastest no?
d;list#parallelstream
default Stream<E> parallelStream()```
Returns a possibly parallel Stream with this collection as its source. It is allowable for this method to return a sequential stream.
This method should be overridden when the spliterator() method cannot return a spliterator that is IMMUTABLE, CONCURRENT, or late-binding . (See spliterator() for details.)
a possibly parallel Stream over the elements in this collection
void forEach(Consumer action)```
Performs an action for each element of this stream.
This is a terminal operation.
The behavior of this operation is explicitly nondeterministic. For parallel stream pipelines, this operation does not guarantee to respect the encounter order of the stream, as doing so would sacrifice the benefit of parallelism. For any given element, the action may be performed at whatever time and in whatever thread the library chooses. If the action accesses shared state, it is responsible for providing the required synchronization.
action - a non-interfering action to perform on the elements
yessss
bruh just
for (final Whatever item : list) {
new Thread(() -> {
// do stuff
}).start();
}
do it
🥶
oh god
Does this make sense? Having the default command name as a constant in the Default annotation? 
d;player.displayName
public interface Array```
Array has 1 implementing classes, and 5 methods.
The mapping in the Java programming language for the SQL type ARRAY. By default, an Array value is a transaction-duration reference to an SQL ARRAY value. By default, an Array object is implemented using an SQL LOCATOR(array) internally, which means that an Array object contains a logical pointer to the data in the SQL ARRAY value rather than containing the ARRAY value's data.
The Array interface provides methods for bringing an SQL ARRAY value's data to the client as either an array or a ResultSet object. If the elements of the SQL ARRAY are a UDT, they may be custom mapped. To create a custom mapping, a programmer must do two things:
- create a class that implements the
SQLDatainterface for the UDT to be custom mapped. - make an entry in a type map that contains
- the fully-qualified SQL type name of the UDT
- the
Classobject for the class implementing...
This description has been shortened as it was too long.
That worked well.
Something else basically TriumpH DEFAULT
Just don't know if it makes sense to be inside the annotation or would be better to move it to somewhere else
Well, I officially declare myself confused with these text componets or what the docs mean
What are you trying to do in the first place
ok
public class GreetCommand implements CommandExecutor {
private final Main main;
public GreetCommand(Main main) {
this.main = main;
}
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (sender instanceof Player) {
Player player = (Player) sender;
player.sendMessage(ChatColor.GREEN + "Hello, " + player.displayName());
}
else {
main.getLogger().info(ChatColor.GREEN + "Hello, Console!");
}
return true;
}
}
simple greet command but im struggling 😄
Right.. thing is you are mixing strings (legacy shit) with components
Component.text("&ayour text");
They'll eat you alive for that at Kyori
wait no that won't get parsed because adventure is fucking ass
Those don't play well together, you can do something like this
player.sendMessage(Component.text()
.content("Hello, ")
.color(NamedTextColor.GREEN)
.append(player.displayName()));
In simple terms, the only reason why the original methods are deprecated is cause of the replacement of the new system
the dumbest implementation humanly possible
Reject adventure and complex strings, return back to simple string
i disagree
legacy shit is deprecated
components don't define "a text" or "a string"
components define a format
reject strings, return to char arrays
i dont think you have seen the potential of adventure yet
this lol
boutta start fucking sending json
I haven't-
I'll take it!
to put it in the terms of Paper, "Spigot has been holding on to backwards compatibility for years, not allowing the API to move foward. Minecraft removed all of the old strings a while ago and replaced them with chat components, so we have updated the API to reflect that."
adventure has translatable components, color component builders, actionbar builders, so many other features
and everything
I don't want to use ChatColor ever
I mean you can just
player.sendMessage(Component.text("Hello, ", NamedTextColor.GREEN).append(player.displayName()));
``` too, but that creates 2 components eventually
you are literally the stupidest human being in this channel
lol
SO MEAN
Ah yes let's hardcode everything
yes, some of kashike's coding practices are questionable
hes talking to frosty
but Adventure is good
look at the reply
it is amazingly well designed
It's not
it is
what's wrong with it then genius?
but why are you using NamedTextColor instead of ChatColor
because you have to
bc its for components
Because adventure uses TextColor, not ChatColor
NamedTextColor is Adventure's version
it's adventure, not bungee chat
^
Oh
the BungeeCord chat component API is a mess
^
Learning java is gonna be fun
I've already made my plugin based on paper because paper good
components to do 😔
oh btw, did you know Paper is considering a hard fork soon?
a hard fork?
basically where you no longer keep in touch with the upstream
for any patches or anything
Been in the talks for like a year already no?
with the upstream
Now that sounds scary.
probably, I only just found out today
Supporting spigot is getting harder and harder
Jesus caveman
I hope it will mean the death of Spigot
this
more abstraction
🥲
watch as paper breaks all spigot plugins 😔
I really really fucking hope a hard fork from Paper will kill Spigot
bardy, don't get me wrong, adventure is better than what we currently have, but it's still long ways from being perfect
oh yeah, ofc
but it is the best we have
matt
Who said I don't use it smh
I have like a small board set up with the basic stuff we gotta add, we might need to break that down further into smaller tasks tho
One more thing, why do so many plugin devs use H2 and not SQLite?
Amazing config deserialization lmao, fucker deserialized my entire server folder
Looks fancy
this is paper api, not java itself exactly
Just use a proper db, fuck sqlite, etc
The future is now old man
iirc h2 is on file
so if you don't have a database you can use SQL on H2
It's possible to host my email on a pi right?
well frosty, ive failed to install mysql already.
imagine not having a db
Yes
ew
mariadb
^
best
isnt sqlite a file based database but a database all the same?
wot
mysql 5 🌚
obviously paper and pencil is the best database possible
i prefer using minecraft itself as the database
database.json
Engrave it
StoneDB
lol
Fuck storing data all together
StonedB
as I said, welcome to whacky Java paths
Unsure of what the solution for this is bardy kek
dkim I respect your wrong opinion
omg my greet command worked
Microsoft SQL Server
lmao
means get lost squidward
😑
That's one challenge done, time to do the optional part
OracleDB 😬
Redis
cookie to anyone who gets that reference
RabbitMQ :moan:
infinity war
🍪
🥠
i dont
how to cause infinity war in the server? what controversial topic would that be
lol
disgrace
same
Disgrace
sponge
both of you
disgrace x2
burn burn
Disgrace
imagine having a life 😔
spongeDB
Kali, 6pm tommorrow
SkriptDB
ElaraDB
Captain Russia
ah ok cool
Captain Russia 😮
spooderman
AsyncDB 🥵
is taht 6 ur time btw?
Yes
SplinterMan
so 5 your time
yup ty
DB.async = true
Dkim19375DB
Now, imagine if paper devs could just do
Paper.multithreaded = true
oh btw, can anyone tell me what could cause this to randomly stop the server when it thinks the last tick time was too long ago? ```kotlin
while (server.isRunning) {
val tickTime = System.currentTimeMillis() - server.lastTickTime
if (tickTime > tickThreshold) {
LOGGER.fatal("A single server tick took ${"%.2f".format(Locale.ROOT, tickTime / 1000.0f)} seconds (threshold: $tickThreshold)!")
LOGGER.fatal("Considering it crashed, shutting down...")
exitProcess(1)
}
}
bear in mind, I don't think it's getting behind
exitProcess ?
don't do that
ty for using a boolean for the while loop
Krypton soon
better flow control
that's not what I meant

dkim
it currently waits 60 seconds by default you moron
Romvnly
LMFAO
you never told me how to make a plugin that drops your tps
oh lol
you can change your tps you know?
how?!?
if you want to
how
it requires nms
just make tickrate always 20???
but here is some code
oh lol
const val tps = "20"
nms I remember that, the essentialsx devs didnt want to use it
tps is a string :sus:
wait is that actually possible?
lol
😦
200 tps wtf
no need to make it an int. you never change it. it will only be displayed as a string
im gonna set my server on fire and put it to 200 tps, let's see how it will peform
Can anybody welp me with decompiling lua ;c
just edit the gamerule idot
no tps = tps always 20
what I mean is when could System.currentTimeMillis() - server.lastTickTime possibly return more than 60000 when lastTickTime is set to System.currentTimeMillis() every time the server ticks
no
Pulse
other than when the server is actually running behind
lua
that image lmao
lol
what image
Because it's professional software
clearly
They free if you smart
Just like Photoshop and the Adobe suite
my student thing won't work
rider won't recognize my student license
do you have toolbox?
Toolbox?
Jetbrains toolbox
get an OS license 🙂
manages ur jetbrains apps and projects in 1 place
e.g u can open a project from goland or a project in IJ from toolbox
And that'll allow rider to recognize my student license?
Probably
wait.
It's always worked perfectly for me and I use it
I have the student license for github tho
it was the opposite for me 🥲
student license works fine on web for me, didnt work on toolbox ☹️
is there a separate one for jetbrains?
Do you get IJ ultimate for free?
it just links ur gh to ur jetbrains account afaik
Yeah
The JB one is separate but if you have GitHub student then u can get it really easily
but how does it know what my jetbrains account is 
I'm slowly losing my shit
It doesn't... Unless you link it ...
over?
This fucking hocon ConfigFactory
I legit can't get it to give me the config from the file I need
Literally go onto the student pack website and there's instructions on how to get the Jetbrains stuff
I assumed youd already done this
nope
im gonna try my luck with toolbox again
imma get toolbox first tho
theres a link on education.github.com or whatever
just click it and it walks you through linking your account and getting the products
@west fjord OS.
Yes
ppst BM
Wot
Im thinking of selling my server tho
i was wondering about this yesterday but why does
putStrLn $ "list: " ++ $ show $ input num
putStrLn $ "list: " ++ (show $ input num)
the first one not work
there are hooks
Because chaining infix operators doesn't make sense
Oops wrong channel
It's like doing + * 3 in java
@west fjord #dev-general message
@jovial warren Can you assist me please, I'm losing my shit, legit boutta switch to fucking yaml
Pathetic
hehe
what's up?
Hocon, how the fuck do I get the config from a desired file
sell what @west fjord?
his world gen
ConfigFactory.parseFile
👀
lol
that was SO hard wasnt it frosty
for this
putStrLn $ "list: " ++ ((show . input) num)
are the inner parentheses necessary because i need to make an anonymous function out of the two
why can't I just do "list: " ++ (show . input num)
well if you just read the FUCKING DOCUMENTATION then you might have actually been able to do this on your own Frosty
because "Normal" function invocations have a higher precedence than infixes
reading docs is for plebs
Like you
ah gotcha, so it's trying to dot operator on the input num portion
i see
not reading docs and wasting time trying to go it alone is moronic
I mean you can do show $ input num I think
lol np
??
yeah that's because source.conf doesn't exist as a key lol
ah something else
I always see user input as two lines
input_line <- getLine
let num = read input_line :: Float
is there a way for me to get a float input in one line / be able to call it from a function
i'd like to be able to have a function that takes an int parameter and returns a list of that amount of floats inputted from the user
but that's the file name tho?
show code
update: I can't find the linking support on the github page so I sent in a ticket for help 🙂
Above method
Why don't you just... pass a... File?
ew Fefo
num <- (getLine >>= (return . read)) :: Float
``` I think
Not 100% sure if that's correct
😮
Doesn't change anything btw
Monads 🙂
oh snap i havent started trying to learn monads yet
input :: Float -> [Float]
input amount
| amount < 0 = []
| otherwise = ??? : input (amount-1)
how would that line fit into here o.O
do i have to use another weird operator
Did you try with passing new File(getDataFolder(), "source.conf")? 'cause if you're doing it with strings Windows uses \, not /
otherwise = (readLine >>= (return . read)) : etc
You might need the :: Float but I'm pretty sure it could infer that you want it as a float
Because of the function signature
that gives me a warning, do i try adding the float like (readLine >>= (return . read)) :: Float : etc?
yeah try that
still warning 😦
@vague pond I meant here lmaoo
You might need parens before the cons
Easiest way might be to use a where clause to define a function
otherwise = readFloat : input (amount - 1) where readFloat = ...
Then you don't need messy parens
ahhh
Again I'm not sure that'll work though
i'll try it
Seems to be working now Fefo
Alrighty
If all else fails, define a separate function readFloat then input can just reference that
oh actually the error might be because of the function signature
my current signature is Float -> [Float]
readLine returns an IO String, binding that returns an IO Float, so your list is going to be [IO Float] rather than [Float]
ooo
Which is probably not what you want
can i use <- or something to turn the IO float into a regular float
nope
Not in that function anyway
you would use <- at the call site
But more importantly you probably want it to return an IO [Float]
Which I can't remember the function for lol
of fucking course it's a monad
wait what if
Anyway I think the function you want Ivan is sequence
So then input can return an IO [Float]
sequence :: Monad m => t (m a) -> m (t a)Source
Evaluate each monadic action in the structure from left to right, and collect the results.
In other words, it turns a [IO a] into a IO [a]
i see
If we're sticking with the Future analogy it's like CompletableFuture.allOf
Pretty much
anyway once you've got that IO [Float], you can do something like ```hs
inputs <- input 10
print inputs
So I have this https://paste.helpch.at/zereyogici.cs and this https://paste.helpch.at/tozeyazejo.cs while trying to use an SQLLitedb, but I keep getting an exception that "java.sql.SQLException: no such column: world". I don't think I've messed anything up but could someone explain what exactly I did mess up if I have something wrong?
am i still using the where clause
ideally i want to see if i can do it in one line >:)
Maybe
👍
now i'm here right now
input :: Float -> IO [Float]
input amount
| amount < 0 = []
| otherwise = readFloat : input (amount-1)
where readFloat = (sequence (readLine >>= (return . read)) )
but i feel like i'm still missing a lot of things
for one i dont think i can just return an empty list as a base case
Why not?
well it expects an IO []
ah yeah

