#dev-general
1 messages Ā· Page 41 of 1
uh
what language is what in?
let chars = input |> stringToList |> map charToInt |> filter (\x -> x /= -1) i think this is fairly obvious though?
oh wait nevermind
I thought you were talking about elara
if you know what |> does
i am
we are
i think
š¤£
idk bro
I've got no clue what |> does
Has elara actually made any real progress ? :o
ok. why |>? is there a specific reason? a mathematical notation maybe?
or was that what you thought is cool?
it looks kinda cool š„²
but I feel like it'd slow down the typing a bit
btw, I can't find the last commit. I'm not sure which repo I'm actually supposed to look at?
yes!!! it works for a lot of simple examples
like actually works
with 1 very small catch
lmao
looks like a left to right arrow
𤣠(just to make it clear, this was meant for the "with 1 very small catch" message)
ok. I'm not 100% sure about that. maybe with different fonts? but sure
Do we get to know the āexploitā?
you have to disable the jvm security verification lmao

elara == virus confirmed!
(you can probably tell I don't actually know what the security verification does, I just assumed from the name)
it's kinda virus protection
its mainly protection against stuff like buffer overflows
from malicious bytecode
or bad compilers like mine

with ligatures it does
nice
as for why it's needed in the first place, the trick is that things like filter and map are all just top level functions rather than methods. so you could also do map charToInt ['1', '2', '3']. the |> just swaps the arguments - ['1', '2', '3'] |> map charToInt is the same
so you get something that looks kinda like OOP without actually needing objects
yeah thats the only issue really, it's kinda hard to type
not settled on the idea, might change it
i think i will hopefully get a 1.0 release working by the end of this year
thats my new years resolution
the thing about new year resolutions is that they usually don't come true (see PlaceholderAPI 3 for reference š¤£)
true...
but papi3 has higher expectations so it's easier to get burnt out
whereas im just making this for me
Jokes on them
True. Well, I understand almost nothing of your haskell code but that's because I've never used haskell
Haskell is pure torture
yeah
its fun
Na Alex u donāt understand the amount of theory and code we had to write in haskell
whats wrong with that!!
you sound exactly like our teacherās assistant lol, he just went nuts w it
I mean the basics are fine, I think what got most annoying was when we had to do actual projects and not just simple tasks
what kinda things did you do?
parsers, raytracing, wait let me check the other stuff
Well, at least you should thank your teacher for not making you do it in C#
wow thats sick
like monadic parsers?
Sorting as well
I think it was called that
does that count as an "actual project" lol
well, we get a week to do these things
And they have to pass a set of unit tests and be⦠well⦠cleanly written
Isnāt C# like a dream to work in
Got everything Java does not have

its also fuck ugly
yeah. I was moslty talking about aspect š¤£
it does have some nice features that java is missing such as operator overload
imagine not having custom operators
where you have like newtype Parser a = String -> (a, Maybe String)
and compose them
rather than just writing a recursive descent or whatever
static final BinaryOperator<Vector> MUL = (v1,v2) -> ā¦;
Isnāt this just, enough? 
Yeah alex, I kinda forgor almost everything since we moved on to rust
:ac_cat_smile:
ā¤ļø
Lmao
rust is like when someone says your joke louder
takes all of haskells good ideas and makes them mid
lol
Tbf haskell is really cool, esp how it works underneath with its gc and everything
yes!!!
But its just⦠too pure
no!!!
Lol, but !!! is just a triple negation, so u mean no!!!=no!=yes ? 
no š¦
š
im biased here but i think the coding style that haskell forces you into is how most software should be written anyway
obviously it gets a bit silly when you need a whole monad stack for like logging
but the whole architecture of pure "core" surrounded by impure makes a lot of sense imo
in any language
Hmmm, well I havenāt read any larger code base that does this, would certainly be intriguing tho tbf
I think Java and all these other languages allows you to be ālazyā with how you write your code, that is writing code that may cause code symptoms in the future, unlike haskell to some aspect
yup
Yeah obviously you can write shit code in Haskell also, but like
its easier to not do it, if that makes sense, at least on the scale in which I touched it
yes
very much so
same with rust, in a different way. its a lot harder to learn & write, but in return, you get code thats much more maintainable, and much safer to run
refactoring pure functions is so easy it's basically impossible to break anything
indeed
having to "tag" all side-effects with a monad means it's impossible to accidentally add some code that changes a variable at the wrong time
The only bit I didnāt appreciate with Rust was multithreading, but maybe just since Iām used to Java and TS/JS
I should probably put aside helpchat stuff and actually start learning rust. I've been saying I'll do it since last year ||funny, I know|| (for a few months now).
doesnt rust have async await
Something like that
very true
so its the same as js lol
well except u dont have the gc
isn't that like one of rust's "features"?
sure but does that make a huge difference?
idk ive not actually seen it
but async/await cant be too outlandish
Ugh, I think its just cause Iām used to java async which is fairly rich and these high level langs with side effects where u can just dump everything when done w it
I mean its not that it was hard, just ran into a lot of issues quickly
yea
yeah that checks out
although i think it's still better than java's in a lot of ways
since the memory model means it's a lot harder to get race conditions or concurrent mutation or whatever
How do servers like this one make their prefixes these images?
Dang
I can't post images
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.
Yeah, sorry my flight just landed now, but its powerful i believe, just hard to use imo with lifetimes, borrows and ownerships (and then well, you run into a lot of small issues in my experience )
does anyone know a good plugin where you can use vault eco money to pay to create a private warp. You can have unlimited just costs money to create a warp
Guys, a small question if i can resolve this problem, i do now a cracked server for all players to can join, the problem is, i think because of launcher, someone with SKLauncher sees my design heads placed on ground like notch heads, its supposed to look like bedrock and other skins of npc looks different, its possible to resolve this or its launcher problems?
Like this:
https://imgur.com/a/xrJaWyD
it uses a resource pack which replaces unicode characters to images
can I somehow stop player from closing GUI
No. Can only reopen it.
its npc give it to him co claim item but if he closes it he cant claim it again sooo maybe with permissions ?
Probably your best bet.
Wrong channel @atomic kestrel don't spam every channel
Wrong channel @gloomy anchor
I'm so confused
skullMeta.setOwningPlayer(Bukkit.getOfflinePlayer(someUUID)) doesn't work while skullMeta.setOwningPlayer(Bukkit.getOfflinePlayer(someName)) works??
Yeahhhhh welcome to Minecraft lmao
dont use cracked uuids
Donāt think theyāre intending it that way
Probably something like a island top gui where you need the players skull even if theyāre offline
Unless Iām thinking of something totally different
?
pretty much
just for a GUI
Is the offlineplayer from someUUID null?
Just to be sure
nop
it works when the player is online
pretty sure it doesnt work for other players is because it doesnt make that http request it would when passing a name
idk
Might be a bug on spigots end then.
how do i get access to the patched jars where i can take a look at the code
--remapped
?
run the server once, then itll be under versions or cache and open with like recaf or something
the spigot, paper, etc jars are just small boot programs that dont actually provide the mojang jars
if its not found they download them and patch them on the fly and then the jar is stored under either versions or cache, dont rememeber which
yeah
just opened the file but
it doesnt have Bukkit.java?
nvm
CraftServer does the job
yeap
only gets all the important stuff if its a name
Open the jar with winrar (or your preferred) open META-INF then versions
tf
Otherwise go to your local git repo org/spigotmc/spigot
yea i got it
tho in intellij if your using someething like paperweight you should have access to bukkit internals and you can just middle click to see its code
i am not
yeah so basically when you get the name, it does a request and creates a real GameProfile internally so that works
if you get the uuid, and it isn't cached yet, it just creates a game profile CraftGameProfile{UUID:Bla}
without all the important internal stuff attached so thats that
so thats stupid
why?
because Bukkit.getOfflinePlayer(playerUUID) != Bukkit.getOfflinePlayer(playerName)
makes sense?
it should be the same player?
it would be the same wouldnt it?
from what i can tell they both would get the same profile
id assume they would cache all players that have played before
but if a player hasnt played before they arent the same? is that what youre trying to say?
that makes sense
exactly xD
i wouldn't mind if they weren't the same
they just had to include the same information
from what i can tell the only thing that would be different is the uuid and player name, the rest is default data
because neither method would call the mojang api to get the correct other data, if you had uuid call for correct username, if you have username call for correct uuid
Spigot does this too now?
On spigot don't you run buildtools to get the server jar
yes
Guys, do you know a plugin that is similar to Bungee Advanced Proxy ?
hello i need help
can someone help me with sourcecode to jar file?
i tried maven install but it failed
wrong chat @visual schooner
I dont got time
its easy probably for u
to fix it please gaby
we have been friends for years now
@distant sun please man
What have you tried and what happened?
i tried maven build
and it failed
ill send u the github link okay?
to the sourcecode
check dms @distant sun
with what error message?
do mvn package
open a console and type it?
download maven, google how to do that
i have maven installed
if mvn is not recognized, you don't / you didn't finish the install process
i got an error
do you want to see the error message?
@distant sun
when i did mvn package
build failure
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] There was an error in the forked process
[ERROR] TestEngine with ID 'junit-vintage' failed to discover tests
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] TestEngine with ID 'junit-vintage' failed to discover tests
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:631)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:285)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:250)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1240)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1089)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:905)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:328)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:316)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:174)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:75)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:162)
[ERROR] at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:159)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:261)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:906)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:283)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:206)
[ERROR] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:580)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:283)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:226)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:407)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:348)
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
this is the error
@distant sun
for god sake
if you are trying to compile a freemium plugin
then either learn how to properly do it
or just buy it.
don't expect other people to spoon feed you
but yeah true
+1
package org.core.chunkloaders;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.entity.Player;
public class ChunkLoaderPlaceholder extends PlaceholderExpansion {
private ChunkLoaders plugin;
public ChunkLoaderPlaceholder(ChunkLoaders plugin) {
this.plugin = plugin;
}
@Override
public boolean persist() {
return true;
}
@Override
public boolean canRegister() {
return true;
}
@Override
public String getIdentifier() {
return "chunkloader";
}
@Override
public String getAuthor() {
return "YourName";
}
@Override
public String getVersion() {
return "1.0";
}
@Override
public String onRequest(Player player, String identifier) {
if (identifier.equals("countdown")) {
long expirationTime = plugin.getExpirationTime(player);
if (expirationTime > 0) {
long currentTime = System.currentTimeMillis();
long remainingTime = expirationTime - currentTime;
long remainingDays = remainingTime / (24 * 60 * 60 * 1000L);
long remainingHours = (remainingTime % (24 * 60 * 60 * 1000L)) / (60 * 60 * 1000L);
long remainingMinutes = (remainingTime % (60 * 60 * 1000L)) / (60 * 1000L);
long remainingSeconds = (remainingTime % (60 * 1000L)) / 1000L;
return remainingDays + "d " + remainingHours + "h " + remainingMinutes + "m " + remainingSeconds + "s";
}
}
return null;
}
}
@Override
public String onRequest(Player player, String identifier) {
if (identifier.equals("countdown")) {
long expirationTime = plugin.getExpirationTime(player);
if (expirationTime > 0) {
long currentTime = System.currentTimeMillis();
long remainingTime = expirationTime - currentTime;
long remainingDays = remainingTime / (24 * 60 * 60 * 1000L);
long remainingHours = (remainingTime % (24 * 60 * 60 * 1000L)) / (60 * 60 * 1000L);
long remainingMinutes = (remainingTime % (60 * 60 * 1000L)) / (60 * 1000L);
long remainingSeconds = (remainingTime % (60 * 1000L)) / 1000L;
return remainingDays + "d " + remainingHours + "h " + remainingMinutes + "m " + remainingSeconds + "s";
}
}
return null;
}
} this method here @Override is underlined in red. Any idea how to fix?
- use https://paste.helpch.at
- Use the power of your IDE and check what it says lol. Maybe it's not even needed (didn't read the code)
read it lol
too much work if you won't even properly send it. + 98% of the time it's user error, so check the IDE, I am not your parent and you are not a baby that needs to be spoon fed
anyone here worked on model language?
i work with foregin language
pretty good contract not sure where to start from how ever
i imagine
to just use the input and args in text for example if "what is a good present for a women" then build (what is good present for women) and return answers
i found a person who will be translator
how ever
what do i need
PDF books
so it memorize ways words > words and etc
what the fuck are you saying tony
typical
the fuck lmao
Tony is confusing me
Tony is confusing me
how much of a difference can L3 Cache make when in comes to a minecraft server?
CPUs in question 7900 vs 7950x3d (64mb / 128mb)
not exactly what youre looking for but the "most" information on the topic i have seen
in admincraft
probably not noticeable
^
It is noticeable for very optimized apps with high data throughput but eh Minecraft isn't
Is it possible to set a limit of parameters provided when your method has method(Object... obj) {}
Ex; method(int[3]... values) Would require 3 ints.
Just preference. Its a bit cleaner than method(int i1, int i2, int i3).
Just preference.
bad preference
well, I'm not using varargs in situations where vargargs shouldn't be used
š¤·
You lose the ability to name each parameter which sucks, weird preference :>
Didn't need the parameters to be named and the order only matters to me.
Can someone help me with something important about custome plugins? If yes dm me please
create a dependently typed subset of java such that you can encode the length of a vector into its type & then use that :))
FixedSizeList3<T>
Thruple<T>

Tripel, oder Tuple3
š
peak OOP
oh this is beautiful
why stop at 22
we should have one for every letter of the alphabet
that sounds like something i would do
lol
is there a way to convert 1.20.2 texturepack to 1.18?
@ocean quartz i sent a message on #1191515714033565738that i could make a free plugin.. but now i cant make a paid service, it should not let be friendly and do free things then ruin business.
i have deleted the post, can u open for me for a paid offer service?
what? in english?
I'm confused as well
what
i cannot post in #1191515714033565738
i posted a free service, to be friendly, but that means I cannot earn money when being friendly.
so? your decision to make it free?
also, what does one have todo with the other?
I was just asked about the update needed on my plugin about Papi not supporting my placholder format by 2.13.0
come to find out the issue is Purpur most likely
ah true
now i remember updating to on my other project when I had this issue
also, anyone tried using JOOQ in minecraft plugins?
anyone know how to change the mincraft version of a mod from 1.20 to 1.19.2?????
I can
uh I don't think I've used it in mc? but, it's not like that really matters
true
was just wondering if there are any caveats of integrating into a plugin, though I suppose thats kinda a dumb question
potentially very painfully
can u try for me?
i cannot
if your wanting someone to do it for you then #1191515713022738634 #1191515716608868402
that's unfortunate
Who knows
hey
Maybe, just maybe
have you missed Tony's random convos with himself
oh that? i ve even replied to those
v relatable ngl
Don't you talk to yourself too?
that's rly normal
not.. In a public discord
multiple times
welp, ye mby, idk haven't happened to me yet
i only scream on my servers chat n talk alone there
Same
Keeps us sane Kris
Hello!
Could someone help me with a question?
My server is version 1.20.1 and when entering with 1.8, people sometimes do not load the chunks, the players and entities also become invisible.
Does anyone know how to solve it?
”Hola!
ĀæAlguien podrĆa ayudarme con una duda?
Mi servidor es versión 1.20.1 y al entrar con la 1.8 a la gente a veces no le cargan los chunks, se hacen invisibles los jugadores y las entidades tambien.
Alguno sabe como solucionarlo?
Donāt use 1.8
Just for the soul fact of, that is 12 major versions different. So thereās bound to be compatibility issues.
Not really.
Either support less versions, or just take it at face value that thereās going to be issues between those versions.
ViaVer has fixed a lot of the issues, but some are core game mechanics that canāt be changed.
Wrong channel. Use #minecraft
Gonna assume you're using ViaVersion so I recommend asking there.
Does someone know a good book about design patterns?
effective java
it doesnt necessarily discuss the Piss Poop Factory pattern but in my experience you dont actually need a lot of these patterns (hence the hilarious name)
Oh I was actually going to try to learn the Factory pattern rn lol
i didnt actually mean Factory was bad, that's quite a common one
and a fairly easy one
but some of them get a bit silly
i have never used the Bridge pattern in my life and couldnt tell you what it is
I'm about to setup a system of custom enchants for a prison server. Not sure what the most optimal way is, I usually just use a "manager" that handles everything and then something like an interface called CustomEnchants
though i probably have accidentally used it
Lmao aight I see, there are probably a lot of patterns out there that aren't really that useful
maybe they are useful but just niche
Do you have any recommendations for setting this up?
I believe he does
uhhh
i mean it depends what specifically you want
How did you even find that so fast? hahah
yeah this is good but i wouldnt really say it's using any Design Patternsā¢ļø
Enchants for a pickaxe in prison that can be like jackhammer, explosive etc. but also fortune, efficiency and so on
yeah lol, i mean what advice you want
about which aspects of design
i think going into a project thinking "I'm going to use a Factory pattern and a Delegate pattern and a Proxy pattern" is a bit of a fallacy though. the patterns exist to solve particular problems, you shouldn't be reaching them until you get that problem
Basically how should I separate the classes? I was thinking just interface CustomEnchant an EnchantManager and then a package of implementations
yeah that seems fine tbh
Yeah but I want to make the code easily extensible and easy to use
Without making it a mess lol
sure, which is where refactoring comes into play
because as you're designing the system unless you spend hours planning, you cant know specifically what issues you'll run into
so the best thing to do imo is design it badly first, then do a big refactor once you know all the constraints
even when I try to plan a lot in advance I just end up spending more time on the initial mess and still refactoring
if u just want to make something simple that works i think my example will do you pretty well though
so just having a fast POC is usually pretty good
Gotcha, that's what I do most of the time lol, a lot of refactoring, and then I suppose I just need to learn from my mistakes / refactoring?
Yeah same lol
if you're doing that already then you probably dont even need to change much of your behaviour
I just want to learn making "professional" code ig
POC?
short for proof of concept
eventually you might get an intuition like "oh this would suit a factory" but i dont think it's strictly necessary outside of technical interviews
Ah makes sense ye
What defines a factory though? It's just what would create the enchant instances in this example right? Or what
factory pattern is really useful when you
- want to hide exactly which implementation is being created to avoid leaking implementation details
- need to do a lot of complex logic for creating an object
- both of the above
Oh so this is actually a factory? https://paste.helpch.at/vumubigusa.typescript
š¤£
but these patterns are usually a lot more atomic in that they literally only do one thing, this is doing a lot more than just creating objects
Makes sense lol, so factory only creates the instances really?
If I did that in this case it would be way too abstract imo, right?
yes, exclusively instance creation with maybe caching as a treat
it depends just how enterprise-ready OOP you want to design things
you could turn this into 5 different classes and it might be more "well-designed" but it arguably wouldn't matter
If you just want to understand what factory pattern is, there are some easy to google resources out there. You can also find common java patterns and what they are.
true
Hmmm yeah I guess, but it wouldn't make it easier to understand, which is what I'm mostly going for
At least not easier to understand for me lol
it's quite subjective
Yeah makes sense, just not sure when exactly to use it but yeah as bm (brister (idk lol)) just said it's subjective lol
the main benefit of enterprise-ing everything is futureproofing, in that making big changes later becomes a lot easier when you have clearly separated behaviour and lots of abstractions
though i think most plugins dont get big enough to matter
True. Also, over "abstractisation" (is that the word?) is a thing
abstracting? perhaps
i'd just say over-engineering
and yeah it definitely is
theres a reason why theres the meme about AbstractProxyFactoryProviderBridgeBeanWrapper
Oh Nial how I miss you
Lmao yeah I definitely won't end up there
I hope
That's what everyone that ended up in there said
Hahha but in some cases it's probably not bad, when developing bigger projects
yes and no
i'd argue this is just an example of OOP actually not being very good, but we can't really change that
the comically long class names is just the endgame of enterprise-design
What would be better than OOP? Not really sure what the options are lol
You've just opened Pandora's box
Oh. Nvm
Not overcomplicating it. Just go with the flow. If you feel something isn't right, rethink it
Ye makes sense
java is inherently an OO language and while you can kinda incorporate other paradigms you cant really fundamentally change it (though you can get kinda close)
But kinda curious what other options would be?
I've only ever used java, c# and a little python
do you mean for plugins or in general
In general for programming
Referring to this
hehe ok here we go
i am a big advocate of Functional Programming which is a totally different paradigm (i could write a whole essay on why I think it's better, but it's probably best not to do that)
a more conservative view, staying in the imperative world, is procedural programming (like C). a lot of modern languages like Rust and Zig are staying mostly procedural, with a few functional aspects incorporated
https://www.youtube.com/watch?v=QM1iUe6IofM this video is a big advocate of procedural programming instead
havent watched it in years, cant remember if it sucks or not
Functional programming is for example Haskell right?
I remember looking at an example for it and the code just doesn't look right to me lol
It looks so damn confusing
yes
But it's probably (definitely) because I'm so used to OOP
it's very different, totally different style of thinking
though that's only partly true
if you've used streams or completable futures in java, they're like a free trial of what FP is like
Streams š¤¤
Oh, how's that? I'm starting to like streams more and more
But in functional programming do you not have methods etc? How can you run a section of code multiple times without just looping or statically writing it every time?
You have functions
well, the functional paradigm is basically this: you dont have any mutable variables, you do all your work by combining pure (meaning they dont modify anything) functions on data. that's it.
you have functions yes
as for loops, that depends on the language
and how "deep" you wanna go
Ohhhh what that seems annoying to work with lol
Your language is based on Haskell isn't it? Can't remember
@timber oak this recent video actually helped me grasp at least some small parts of functional programming: https://www.youtube.com/watch?v=nuML9SmdbJ4
Watching later, thanks :))
so for example, let's make a very contrived example of adding together the first 10 even numbers. in imperative java we'd write it like this: ```java
int total = 0;
for (int i = 0; i < 10; i++) {
if (i % 2 == 0) {
total += i;
}
}
whereas with "functional java" using streams it's more like ```java
int total =
IntStream.ofRange(0, 10)
.filter(i -> i % 2 == 0)
.sum();
and then the haskell equivalent ```hs
total :: Int
total = sum (filter (\i -> i % 2 == 0) [0..10])
you can see that the last 2 are quite similar (excluding syntax), and I think they're a lot more obvious on what you're actually doing - there's no changing variables you have to keep track of, the code doesn't keep jumping up and down between blocks
the key difference is more general and it's between the Imperative paradgigms (which includes OOP) and the Declarative paradigms (which includes FP)
In imperative programming you write code which says how to do what you want
whereas in declarative programming you just write code which says what you want
Ahhh yeah that actually looks nice enough, but isn't that just because there's a function called sum that calculates the sum with given filter on given array?
speaking from experience you 100% get used to it, though it can take a while
sure, there's no magic going on here
it's just a different style of expressing the same problem
there's no changing variables you have to keep track of, the code doesn't keep jumping up and down between blocks
Yeah I can agree with this, that's actually nice and easy to read if you understand what's happening
now take those ideas and apply them to the entire programmming language :))
Not really sure what the difference between those 2 explanations are sorry
Ah I see
I like being able to kind of use both in Java. I wouldn't survive without non-pure functions lol
notice in the first example youāre specifically writing all the little details: do this, then loop over blah, then add blah, etc
Whereas in the second example youāre almost just writing English: āgive me the sum of every number from 0 to 10 thatās divisible by 2ā
The key difference is that the declarative style doesnāt really care about how the code actually works
But isn't that hidden away behind the sum function in Haskell anyway? Like the stream in java
Makes sense, but also seems like it makes it way more difficult to debug
yeah thats fair, and it wouldnt be very productive in java anyway as the language isnt designed for it. though there are libraries like Vavr which can help you get close. and really it's more about limiting impurity rather than removing it altogether, because every non-trivial program needs some impurity, even in haskell
yes and no, it's hidden away, sure, but in haskell the implementation is also declarative. the streams library is so complicated i honestly have no idea how it's implemented specifically, but consider parallel streams. they automatically split the work between threads and none of the code you write changes. the implementation might be very different to sequential streams
again, there's no magic here, it's just a higher level of abstraction
just like in java you dont have to care about manual memory management because the language takes care of it for you
go 1 level up, and you dont have to care about the messy mutable implementations
Do you know roughly how it would look in the haskell implementation? And yeah I've never dared even looking into how streams work, I just use them and try different stuff until it works lol
thats an interesting answer, though i think it's usually the opposite. when you have pure, mathematical functions, they're a lot easier to test - so much so that you can often write tests which, for example, prove that the sum function always works for any combination of inputs. more complicated debugging is hard in haskell but for a different reason
sum [] = 0
sum (x:xs) = x + sum xs
That's because of the garbage collector or something right? Is that not a thing in haskell? Or any functional programming languages in that case?
in reality it'll be something much more efficient than this but this is the simplest and cleanest implementation
This might be very wrong lol
That's because of the garbage collector or something right?
yes*
Is that not a thing in haskell?
no, it is, it almost has to be
it's very hard to design a proper functional language without a gc for various reasons
but that's kinda not relevant
im more just talking about the principle of languages building abstractions
Ah yeah that's true, you can easily test if the outputs are what's to be expected, but if they aren't I wouldn't know where to begin to figure out what's wrong
thats when you do have to start looking at the implementation
theres no magic fix there (though a few languages attempt some)
It's what C++ doesn't have right? So you have to manage the memory usage yourself
yes
C would be a better example since I think C++ does have some memory utilities now, though not a GC
you have to manually allocate and free memory
in java you don't
At the implementation? As in the code of the function or whatever? I suppose debugging that might be very similar to Java, I'm just not familiar with it
yes, the code
That seems like a nightmare ngl
given that it's caused probably 90% of bugs in all software, you're probably right
or more generally, C not being memory-safe has caused 90% of all bugs
not just the manual management
I've only just learned how IntelliJ debug system works, and that beats everything for me lol, it's actually so nice
yeah it's really nice
Is C++ built on C? Or what is the relation between the two?
it was, originally
nowadays theyre so different there's not many similarities apart from main syntax
Sorry most of these questions could probably be googled lol, you're just good at explaining :))
I appreciate you taking your time to help
the original elevator pitch for C++ was "C with classes"
nah it's cool, i enjoy talking about stuff like this anyway
Ah alright I see, but C++ is the most common language in that "category" right? At least for modern applications
wheres the names lol
We are just numbers now
which category? languages without gc's?
nowadays it's more like "C with a billion overcomplicated features that arguably make the language worse"
xp? From sending messages?
yeah
Yeah I suppose
i think it's to prove that i clearly dont mind talking here lol
As you can see, there's no one who likes talking more than me and BM :))
yep haha
So you don't like C++ it seems lmao
C is probably more popular from raw numbers
ive never properly used it actually, but yeah im not a big fan
Hahah yeah I see
Damn
dear god
Hahahah
brister loves to just yap
covid be like
But mostly on older software no?
Almost 200k tho
nvm C++ is more popular according to stackoverflow 2023
the good old days
its over 200k. those are just the ones you can see
of being the most obnoxious people imaginable
though C is very close behind
given that SO is probably biased to more modern projects it's probably safe to call them even
But that's probably just people using it right now? I mean like C is older so it's probably used in more software through the time?
I have no idea if that even makes sense lol
Wait fr?
yes and probably yes
it's hard to say about the exact details but for example Linux is still entirely C
Yeah, it's crazy how many useful resources there are on SO tho. They basically have an answer for all my programming issues lol
apart from the infection that's taken hold of it
There's also the fact that most of the gaming industry still uses c++
Oh, do you use linux? I actually still use Windows for everything which probably isn't optimal for development but yeah
Because of unreal? Not too familiar with game engines
i use a mac actually, that wasn't really the point though :)
That is a big one. But also a lot of non public engines are still written and use c++
yeah
Ah alright I see
given that WSL exists i'd say for most development experiences it doesn't really matter now
WSL?
Ohhh yeah I've heard of that before, never used it though
so you can use nice things like apt and vim and emacs without needing native windows binaries
I once had a dual boot but got tired of swapping all the time
it's either a game-changer or wont affect you at all
mm
yeah it's not rly worth it imo
vim š š š¢
But how does it work with IntelliJ then? Do you "store" IntelliJ in the shell somehow?
that is my relationship with vim
i think you'd still use the windows intellij
real
But then run servers etc. in the linux shell?
but you can just find all the linux files in explorer as if they're a normal folder
yup
Oh that's actually smart
it's pretty cool yeah
I've tried multiple times to learn it but always gave up very very fast. Its just too much for me. I think the main issue is my lack of memory. I've always been very very bad at remembering keybinds
worth playing around with if you wanna kill some time, but only really useful if you're comfortable with the linux experience
yeah same here, i only remember the basic keybinds and just use everything else nano-style
which is probably very bad
but it's nicer to use than nano i think
Probably. I've only ever used nano for simple text edits
I don't really have that much experience with linux, I quickly got back to windows, but it was actually pretty nice
and has stuff like syntax highlighting & LSP support built in
i specifically mean the shell, too. desktop linux isnt gonna have many concrete benefits compared to windows, it's really just personal preference
Well, there's the performance difference.
true actually
Is linux a lot faster?
not a lot but definitely faster than windows for a lot of things
at the cost of a lot of software not working and ur system being pretty unstable :))
in my experience at least
When you have old haldware, it definitely feels a LOT faster.
I used to have a laptop that barely runs windows 10 but on pop os it was like I had a new pc
also on ubuntu
Ah yeah ubuntu is what I used
smh
Waking up in 6 hours :))
im sorry
yes... yes!!
Not going to lie. I was hoping this conversation wasn't going to end so soon
me too
Would you store the enchants like this
private final Map<String, CustomEnchant> enchants = new HashMap<>();
Or like this?
private final Map<Class<? extends CustomEnchant>, CustomEnchant> enchants = new HashMap<>();
Same, it's actually rly interesting, but work calls for tomorrow ://
Yeah same I think, might also use an enum, hmm
What's the benefit of doing that? I never really use it
a bit more dynamic than the Class while not being as vague as a String
wouldn't that just act the same as a String tho?
yeah but you have the namespacedkey already
oh
you know one exists, and you can access it from a lot of places
Yeah I don't see how this is less vague than using a string hahah
it's only slightly less vague
but every Enchantment subclass has to have a NamespacedKey already
so it means you dont have to bikeshed about the string format, whether it should be allcaps or all lowercase, etc
I won't register them to bukkit I think
I don't see any reason to at least
you have to i believe
I was thinking I'd just use BlockBreakEvent and handle it from there
actually that might not be true
if you want the glowing im pretty sure u have to register them
or just use a fake hidden enchant ig
Ah yeah I usually just add a fake hidden enchant
Like power on a pickaxe or smth
And hide it
But it also means more manual typing when adding a new enchant lol. I know it's pretty much nothing but if I use the class it's all automatic basically
thats true
it depends on your use case, i suppose
but my reasoning for the enum is mainly that it's easier to parse from a string
I think I might start with Enum yeah, then if I see it fit I can always change to the class type instead
Yeah true, especially when using it with a config or something
yeah just depends on your priorities
you could justify any option
except String dont use that
Yeah String is bad lol
I've got 15 enchants to create now so I really need to make a new interface or smth for them lol
Maybe I should separate effects and enchants, like haste, speed etc.?
theres only so much you can abstract out here, the bukkit Enchantment class is probably a good place to start
if you have enchants which just apply a constant effect, they could be an abstract class, or even just a single class
Extending bukkits Enchantment class adds a lot of useless functionality in my case I think. The enchants will never be in book version really, just something stored in the pickaxe instance
As in a separate abstract class from CustomEnchant? Something like PickaxeEffect or whatever?
Actually when I should actually use an interface instead of just an abstract class? lol
This is probably something I should learn when I started on java but yeah
a subclass of CustomEnchant
Ahhh yeah that'd make sense
im not sure you can define any hard rule but my rule is just make everything an interface unless it has to be an abstract class
Making this abstract would be good I think, to have default variables like name etc. for the enchant
sure
You can force properties in interfaces as well trough methods.
Okay it might be time to sleep, I don't even know what else to add lol https://paste.helpch.at/rafapiwotu.csharp
Oh how?
You'll figure it out tomorrow
Yeah might the better
Thanks for all the help / explanations everyone! Time for me to go sleep
np, gn
So, how about that <insert controversial topic here>?
i hate object oriented programming
Hate?
yes
Hmm. One thing I don't understand about functional programming, is how do you actually store state? From the little research I've done, having state is something frowned upon. Do you read -> change -> write? That feels like a waste
it depends on the context, for a lot of things you dont need state at all
sometimes you do that loop yeah, but it's not quite as inefficient as you might think
removing the first element from a list is O(1) for example, and that covers most list processing functions
I'm thinking more about the read/write parts
for more complex things the language usually allows actual mutable variables, either natively in impure languages or by pretending theyre not mutable using monads
I don't know. The whole concept is a little too much for my small shiny brain
can you elaborate a bit
perhaps an example
Same as the 9th. The input doesnt scale do neither does the complexity of the function
I mean, I'm not exactly sure what I mean either but for example, I have a website and I store sessions in a table, what is usually recommended is that sessions are cached in memory but how I understand FP, you can't do that. You'd have to read the table every time you want a session.
that's not true in an immutable cons list whch is what I was talking about
nah you can still do that, how exactly you'd do it would probably depend on how the web framework is designed though. the simplest way of doing state is just having recursive functions which pass the new state to the next invocation. there are also ways of having global mutable state too, even in haskell, they're just not recommended if there's a better alternative
i think the simplest and most versatile example of FP is the Elm Architecture
which is mainly for designing functional frontend apps, but handles state and things too
it's almost like MVC too, just immutable
I'm a bit unsure what you mean by this:
having recursive functions which pass the new state to the next invocation
like in that video you linked, where you have const newIndex = index + 1
like that
tryna think of a good example where syntax wont matter too much
Oh yeah. This makes sense now. I was trying to put it into the context of http requests with sessions
mmm thats a bit more complex cuz it doesnt map quite as neatly
also http requests are inherently stateful & impure
most web frameworks would probably work fairly similarly to an imperative one under the hood, they just let you hook into it with mostly pure functions
funnycube at work
hi yes
Dont functional programmers use linked lists for everything?
And how is it O(1)
Also whats cons
Cons is "prepend an element to a list" basically
hello im looking for a dev that can make me a plugin Not payed dm for more info
no one checks that
So misbehaving is the solution to that?
ig
gl with that mindset
It's almost like no one likes to work for free lol
The reason is that a singly linked list is just an element in front of another singly linked list (with the special case of an empty list), so you just use that list behind the first element
probably because everyone wants to make some income, and not even beginners can take the requests because people ask for entire servers to be made for free 
proof
..
my personal favourites are when they want a "real quick plugin from <x> server" and its literally like
hypixel skyblock
ye but they said "real quick" so that must be true, right?
TRUE
and then even if its in #1191515716608868402, budget $5+
i also enjoy the super vague and varying price budgets $100->$3k
Yeah cons list is a singly linked list, so separating the first element and the rest is just a 1-2 pointer reads
Even if it was a doubly linked list which i presume is what you thought, removing the nth element is definitely not O(1)
Requests nowadays are kinda I want minecraft redeveloped in Rust, btw my budget is $5
Smartest rust fan
css minecraft
Oh nvm then
Anyway i was kinda just pointing out that saying smth is O(1) for n (where its constant) can be said abt a lota things cuz duh its constant
I mean its a technicality but its why i think conplexity isnt always the most important
But n isnāt constant
I said getting the 9th element always performs the same number of operations
Yeah i guess lmao
But i specifically said 1st element rather than nth for that reason
what r yall bludding about
hi guys can someone help me
?
i made /shop and i added my custome head id and when i open shop and i try to buy the item is not buyying is only taking my points but is not giving me the head
how to fix ?
If this is about DeluxeMenus, you should use #general-plugins or #1007620980627230730
i did
and no one helping check because i did
Well, you are not going to get any help in this channel. I was just mentioning since I thought maybe you didn't know what channel to use.
in what channel to get help then?
Hello, my situation is the following, I have a menu that when you open it you can choose sanctions, and when you select it the command is executed which perfectly marks who to sanction with the arguments, but how can I make it say who was sanctioned? How do I get it to take the nickname of whoever put /punish and then mark it, since I use forward
real
big o notation be crazy
in the ones mentioned, if no one answers, you take your grown up butt and be patient.
okay i fixed
Lol
I would actually code in that too
https://spark.lucko.me/7R1wh6wDUg
any ideas? I'm aware of M0-Pagrindai, being rewritten as we speak.
that ram allocation makes me cringe
why just why
set xms to 16 xmx to 16, and if using pterodactyl set container size to like 18-20 gb (or whatever you want)
is protocollibs background compiler set to true?
if it is, try setting it to false
I feel like the main thing is it having a "cpu bottleneck" - too many players on the server so there's like a trillion events and stuff running
On phone tho so can't check much
its just basic mc stuff except M0-Pagrindai (maybe protocollib, but that is most likely being called somewhere else)
yeah plib itself isn't lagging, it's the plugins hooking onto it
idk server owner doing janky stuff as usual
thought about it too
16 aint enuff my dood
very very much is
rn youre using 12.6
(and java tries to use what its allocated)
so no, you dont need more
16-18 gb tops
I smth to do with your plugin M0-Pagrindai > tickets module https://spark.lucko.me/7R1wh6wDUg?hl=30591 (switch to plugins view)
"being rewritten as we speak"
yeh as I mentioned, have to re do database queries to async
Ooo never do any io on main thread
In plugins
Including file, network, database
Got a bigger report.
MSPT all over the place.
https://spark.lucko.me/zFj5frTMcE
I mean your first report specifically measured ticks with over 50ms but not this one so that'd make sense (i think it only recorded 3 periods) - i think its better to only record >= 50ms ticks though
38ms isn't horrible
but yeah i think it's the same situation
lots of chunks/blocks and entities being loaded, and the players are resulting in a lot of events being called which all add up
but the average tps is 20+ here (and average mspt is < 50ms)
Learning JS right now, ofc using discord as something to use. Took me too damn long for this:
https://i.imgur.com/j3Hz0Gj.png
Finally proud of myself but DAMN, took too long. But such simple code lmao. Just was over complicating it.
Lmfao
Wanting to eventually do a whole logging system similar to Dyno, but simplified. As well a leveling system kinda like yours and Mee6ās.
But thatās a bit further down the road haha.
Yes loggers are fun
Yeee
Was messing with this as well as I want to mess with embeds now too, but started getting hungry lmfao.
Yeah getting the ban reasons is funky
Barry doesnt do it since it requres extra perms he doesnt have
Rip
Yeah since itās my own little discord idm just doing what I need, if I went crazier and put it in MCHubās discord than maybe Iād optimize it a bit more and have more niche perms.
yeah fair
Need to figure out what next tbh, not fully sure yet honestly tho.
Go play with canvas
Oooh?
That's what barry uses to generate all the images
Looks scarier than it is
Yeah fair.
I learnt stuff isnāt always as scary, especially after learning MCHubs code space xD.


yeah forgot to turn it on lol
the heap memory graph looks odd
jumps from 9g to 14g
love grafana, if I had the patience to configure mine, I would 100% use it
the dashboard layout itself is from UnifiedMetrics
the installation process, well, if you know what you're doing, about 15-20 minutes.
its allocated ram, rather thrn actually used ram more then likely
The increase in nonheap memory is kinda sus but that also depends on many factors
stabilizes at some point
Yeah thatās fine then
1.7 šš
better than beta 1.7.3 atleast 
Very true š looking forward to the day we get #1191515713022738634 / #1191515716608868402 for even more ancient versions
btw is there a reason the latest fabric version of your tebex plugin recode is 1.16.5
In our survey we did, 1.16.5 was the highest choice for Fabric
when was that survey done?
Recently, a few months back
Anyone know how websites do the "click to copy ip"? Ik its on tebex but I cant figure it out
They use the clipboard api
any examples you know of online?
Something like this?
button.addEventListener("click", writeClipboardText("<empty clipboard>"));
async function writeClipboardText(text) {
try {
await navigator.clipboard.writeText(text);
} catch (error) {
console.error(error.message);
}
}
Nope just pure html css and js š
I have a plugin that does some cool stuff to the names of entities, and I only want to show the names if the player has a direct line of site not blocked by blocks. Should I use raytracing? And if I do, how often should I be checking? I dont want to lag the server, if anything, the opposite
i cant find match data on the topic and 0 mood for trial and error reversing the mojang dogshit
u can do raytracing aka plane on 3D its not expensive operation
how ever u got a bukkit method for that just saying
check can run every tick even server wont lag
i pretty often make lines on 3D dimensions and many calculations up to 10k a second 0 lag on a shared epyc 7502 theard
not a second a tick*
do you know how to raytrace multiple entities at once? I want to know when the player is looking at them, and I want all of the ones within the raytrace size, but it only returns the first hit entity, do I just do it again and add it as a filter until it doesnt return anything?
i told u
plane line calculation
and return collection instead of entity
work with an distancee limit oo
you also said to use the bukkit method
which doesnt return a collection
hey guys, any1 know how to fix this? I update Intellij and it broke (also delete most of my import)
i tried to add the dependecies back but it keep saying same root cannot be added (also the dependencies tab is missing)
did you configure this
that is the part that it say same root cannot add thing
hmm, can you screenshot that?
what if you double click ctrl and type "gradle run"
or is that what you did
thats an odd issue tho
š¤
ok so when the ide update, it decided that it should generate for me some iml file and change my main class
so it was Arsky.TheCellBeyond.Main then main class before and that is where i config it, but they decided to update it to TheCellBeyond.Main and spawn in some junk, which broke my entire project sdk and dependencies
like im extra confuse, like why they need to migrate my entire code off a predefined Main and make their own
update: i fix it by removing all the junk the IDE spawn in and remove all the gradle dependency, import all the library again and it finally work
duplicated texture spawned? wrong index perhaps ?
anyone has a good tutorial for creating paper patches?
this shit be confusing fsr
I'm aware of the git patch system and all, but don't tell me you just look at existing code and write the patch yourself
Look at the contributing.md
mamaged to fix the texture indexing, but 1 if the imaged is not flipped by the stbi flip
public Texture(String filepath) {
this.filepath = filepath;
// Generate texture on GPU
texID = glGenTextures();
glBindTexture(GL_TEXTURE_2D, texID);
// Texture parameters
// Image repeater
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
// Image style
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
// Downsize
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
IntBuffer width = BufferUtils.createIntBuffer(1);
IntBuffer height = BufferUtils.createIntBuffer(1);
IntBuffer channels = BufferUtils.createIntBuffer(1);
ByteBuffer image = stbi_load(filepath, width, height, channels, 0);
stbi_set_flip_vertically_on_load(true);
if (image != null ) {
if (channels.get(0) == 3) {
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width.get(0), height.get(0),
0, GL_RGB, GL_UNSIGNED_BYTE, image);
} else if (channels.get(0) == 4) {
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width.get(0), height.get(0),
0, GL_RGBA, GL_UNSIGNED_BYTE, image);
} else {
assert false : "Error: Unknown texture channels '" + channels.get(0) + " '";
}
} else {
assert false : "FATAL: Texture failed to load! '" + filepath + " '";
}
stbi_image_free(image); //Free memory and prevent memory leak
}
ops stbi flip need to be before load š
yeah well I'm more interested in how to create a personal fork instead of modifying and submitting changes for paper
than don't submit a pr
yo sparky that's smart asf
or you want like patch patches
like what paper does with spigot?
I wasn't aware exactly how the paperweight build process works, somewhat figured it out
Don't worry pal, I'm in the same boat - I have no clue about the patch stuff, always wanted to learn
But I want it for my own personal benefit
yeah well we use purpur as our main software for server
the process is fairly simple (from what I understand, might be more to it)
fork the repo -> run applyPatches -> modify either purpur-api or purpur-server -> create commit -> run rebuildPatches -> a patch is automatically generated in patches dir -> either generate a jar or run dev
for me it doesnt even work lmao
patches won't be a thing anyways soon enough
once paper hard forks, patches will be made source
lol
Wait really?
Then it's gonna have the DMCA problem thingy
yes
that side no idea
For the API only
Makes sense though, Paper have such a dominant market now
Wen hardfork is the question tho
what about the all the bukkit apis?
true.
They are already starting preparations for it. For instance, brigadier being built-in, registery api, paper plugin system, etc.
Hohogho
lets phrase it like this, hard fork we are nearer than far from it, aka give it a year's time or so.
yuuup
business is booming
one thing I can tell for sure
minecraft (and everyones who contributed to paper/spigot/purpur/pufferfish) code is a fucking mess
