#help-development
1 messages · Page 106 of 1
Does anyone know if you can somehow bypass certain modifiers in EntityDamageByEntityEvent (ie. Ignore armor when damaging?)
Maven or gradle?
how can I make it like custom echest will not be counted here?
like crates
if someone uses echest as their crate. and any player clicked on that, this code will not work on that. like this
you have to have a more complex system to determine whether it is custom or not
what name would fit a class that holds wins/loses/playtime etc?
PlayerStatistics
i have a question , i want to have a CustomHead in Minecraft so i edited the meta of the skull but when i join my Server the Head is still a Skull:
SkullMeta meta = (SkullMeta) stack.getItemMeta();
ArrayList<String> lore = new ArrayList<String>();
lore.add("c7e2aa79fc62fa4f5a8919f3dd0f12ab35e2d30f8e234bfea896c4ef31eee3db");
meta.setLore(lore);
stack.setItemMeta(meta);```
whats the mistake?
i wonder why skinsrestorer needs setOp method...
weird
??
can someone explain?
A comment in their source code says "workaround..."
Honestly just don't use SkinRestorer
Online mode is all you need
workaround? wdym
That's their comment
?
Why are you using legacy skull? Also you're not setting which head it is
what does workaround mean?
You can look that up in a dictionary
i pasted the texture code in the metaLore or where should i paste it? what method also?
The lore isnt the texture
And what is that string from it doesnt look like a texture string
Yes
ok
Yep
SkullMeta meta = (SkullMeta) stack.getItemMeta();
meta.setOwner("3297b7ac-0f7b-45bc-ae4b-2dfa8bce7570");
stack.setItemMeta(meta);```
it doesnt go anyways
i made the material to PlayerHead and set the meta Owner to the texture
but in game its still a steve head
Use the setOwner with an offline player
The method you're using right now is deprecated and takes the username rather than UUID
ok
Uuid should never be passed as string
Omg
What did i just post3d
@tender shard sorry for ping https://paste.md-5.net/poluwefacu.cs
bro what is that
Man i accidentally posted p**nhub link
💀
None of thise would work
Telling me?
who else
I love myself a 2 slot inventory
Is not it working?
Wtf bro
why ping?
Thats a joke right
You replied this night but i couldnt answer
send the full class
because I still don't see you declaring "inventory" anywhere there
only "inv1" and "inv2" etc
and obviously the whole code is cursed
you can only create inventories with a multiple of 9
Man dont fuck with me
wdym by "inventory"
the stacktrace you sent said that the variable "inventory" is null
weird that I remember it because I was heavily drunk
it didn't say "inv1 or inv2 is null"
it said "inventory is null"
if you hit a player when enderpearling at them do they take damage
wdym with "when enderpearling at them"?
literally what i mean
Enderpearling
if u throw a pearl at someone
the enderpearl ONLY does stuff the moment it hits the ground
do they take damage or nah
oh you mean whether the actual ender pearl hit does damage?
Let me open the ide
One message removed from a suspended account.
i don't think that the ender pearl hit does damage, mr. light furry but you'll have to try and see
bitch
i dislike static instances to access
many people dislike it
Static is god
no
that's why I explained both approaches in the blog post
Why do you hate man very pwerful keyword
?paste
what
having a static instance getter is no static abuse
https://paste.md-5.net/jazuvavaga.cs Click class
https://paste.md-5.net/fevagabuva.java Bazaar class
https://paste.md-5.net/epituzuber.java Setup of the inventories
not that part, i just don't like to use it if i don't have to because i end up using it for everything
It’s not a joke
what the heck
Reduce your boilerplate man
wtf
variables where
sorry for big sentences
Pazar
NINENTH???
i am trying to obtain something
thats a funny name ngl
shut up
You’re abusing static
Its Bazaar
A lot
yes i love it
I cant tell if this is a joke
its not
neither
there are so many wrong things wit hthat code
like?
Boiler plate, static abuse
- static abuse
- getters for every numbered field
- misuse of if and else statements
Not a big abuse. I dont think it will cause problems.
It is big abuse
So why it throws error
Anyone know if you can somehow bypass certain modifiers in EntityDamageByEntityEvent (ie. Ignore armor when damaging?)
plz tell me if i just gotta write my own event to manage that
Judging by how you code, you’re new to java. Try and avoid using static
Especially if you dont know why it’s bad to abuse it
its 1.5 year
you're new to java
😡
you didnt study for 1.5 years, thats impossible
maybe 2-3 hours per week
unless u studied at some type of indian school that teaches u how to open ur computer
Look at my old messages. Joining time of this spigot, i prolly started java 2 months before i joined this dc.
Man
I'm not
I am not doing essentials or world edit
just a fucking simple plugin
cool, then you should know why your code is full of beginner mistakes
What is the error anyway
im just helping u actually
No ur judging
u gotta lower ur ego a bit if u wanna learn
and plus ur gonna run into many other errors later on if u dont learn java
better to learn it now
yep, u dont know java
One of your inventories is null
that error is completely self explanatory and u would know what it does with 0 knowledge of spigot
meaning you're lacking java
I am instancing all of them
public Pazar(int number) {
if(number == 1) {
inv1 = Bukkit.createInventory(null, 2, "FİRST");
}else if(number == 2) {
inv2 = Bukkit.createInventory(null, 2, "SECOND");
}else if(number == 3) {
inv3 = Bukkit.createInventory(null, 11, "THIRD");
}else if(number == 4) {
inv4 = Bukkit.createInventory(null, 2, "FOURTH");
}else if(number == 5) {
inv5 = Bukkit.createInventory(null, 16, "FIFTH");
}else if(number == 6) {
inv6 = Bukkit.createInventory(null, 3, "SIXTH");
}else if(number == 7) {
inv7 = Bukkit.createInventory(null, 8, "SEVENTH");
}else if(number == 8) {
inv8 = Bukkit.createInventory(null, 8, "EIGHTH");
}else if(number == 9) {
inv9 = Bukkit.createInventory(null, 8, "NINENTH");
}
}```
https://paste.md-5.net/epituzuber.java and this class setups
Calling this from main
show ur Click.java
which is a very weird naming for a class
p.openInventory(Pazar.inv1);
Pazar.inv1 is null
Probs
no
That woukdnt make a diff
you just didnt initialize inv1
You could rewrite this in like 10 lines of code dude
Using a constructor to initialize static fields. nice
would you not rather use a switch case here?
we already talked about this
Pazar pazar1 = new Pazar(1); So this is initialization
ok
he wants to do things his own way, without knowing java
if(number == 1) { inv1 = Bukkit.createInventory(null, 2, "FİRST"); }
You cant create an inventory with 2 slots
ASOIDJASOIDJOAISJDOIASJDOIASJOD
yes ik
my bad
is this bait
We all thought so
bruh
he always comes and asks very beginner questions
questions don't get answered because bait 😭
2Hex stop judging me
Do not manipulate 😡
Guys just stop
He is just judging. Yes i ve heard his advices but still insisting.
wtf is that
Okay, DamageModifier API is deprecated, I need to be able to alter modifiers. Am I forced to write my own damageEvent API or is there some way to bypass this that anyone knows
i just join this channel and wtf
hey is there any better way to use plugin messages to get the playercount without having to do wacky stuff and violate numerous OOP principles?
wdym plugin messages to get the player count?
,logger?
I mean yeah, how would you do it the wacky way?
the playercount of any bungee server
just use the tag PlayerCount
why am I getting this?
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.file.FileConfiguration.options()" because "this.config" is null
at com.roughlyunderscore.politfrontreports.PolitFrontReports.onEnable(PolitFrontReports.java:66) ~[?:?]
code:
saveDefaultConfig();
config = this.getConfig();
config.options().copyDefaults(true); // 66
saveDefaultConfig();
reloadConfig();
i've used this code in numerous other projects and it never bugged. spigot (paperspigot) 1.16.5, the data folder is never created
why so though
why having a config field too
i have it in my resouces
a 42 line config.yml
should be created with saveDefaultConfig, no?
You probably wanna call reload after save
you can also ask why i have saveDefaultConfig twice - i don't know lol
Since saveDefault copies the file from jar to plugin folder
And reload would load the contents of the file (from the plugins folder)
oh yeah i guess i could, one sec
nope that didn't help
saveDefaultConfig();
reloadConfig();
config = this.getConfig();
config.options().copyDefaults(true); // this
Do you override getConfig()?
no i don't think so
wait
that's the problem
i have lombok's @Getter
with config
lmao
doesnt copyDefaults just mentions that the default should be copied but what if you dont specify defaults?

nice deduction

xd
what I meant is something like this https://www.spigotmc.org/threads/get-player-count-of-bungee-server.442276/
Oh yeah
Whats wrong about that
the guy said at the bottom that he is using mysql, is that necessary?
No
no
whats the best way, the most convenient and cleanest.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
not my question
Obviously
But generally when you rely on stuff like this, you have one component that stores the player count, one that updates it (might be a sync buffer etc) and then you facade it with an api
everything works now, thanks Conclure!
I am trying to support multiple versions using NMS, so I came across this resource explaining how to do so using Multi Module Maven projects aka pom projects:
https://www.spigotmc.org/threads/maven-nms-tutorial.347254/
Now, I tried following through all the steps but it does not seem to work. Upon startup, the plugin jar cannot be loaded because it does not have a plugin.yml in its resources folder. In the tutorial however, it stated the project did not need a plugin.yml, and if I did want one, that I should put it in the core module (which I did). Can anyone help me?
how can i check if player is x blocks away from any location?
is there any method?
Is there any information on how DamageModifiers in damageEvents work or how DamageCause may effect these damageModifiers, I'm desperate and not finding enough looking through the spigot classes or online :I
I’d advocate looking at this https://github.com/Sxtanna/VersionedMaven
player.getLocation.distance(location)
or (distanceSquared, preferably)
Thanks
I'll take a look, thanks
im struggling here plz :(
So some class that holds the data and then I query it from where ever?
Isnt those just appended at the end of the damage pipeline
You have one class that basically writes to the bungee server every x duration, and then in the same class, or a different one you listen for updates, the update callback just updates the data transfer class
Hi, how can I safe scheduled task in block, so I can cancel scheduled task with block reference? (I want trapdoors to open/close after n sec, but if trapdoor is clicked again, then cancel scheduled task)
looks like smth copilot would do tbh
I mean so its applied when getting final damage, but I can't manually set final damage in an EntityDamageByEntity event, since different causes are effected by different modifiers, if I use a DamageCause CUSTOM does that mean no modifiers are applied (or if you know which class/interface modifiers + cause interact)
I mean there are two ways, one is to listen for the click if its too early and cancel, else you just check if the state is correct once the task gets executed by the scheduler (eager vs lazy)
But speaking of which, cancelling is almost always a hell and gross to deal with
I wanted to check is there exist scheduled task and is so, then cancel it, if not - create. in task toggle trapdoor open state.
The only problem is I don't know how can I store task in block data, so I can actually check if task exist for this block
will this work? before i try it
have a Map<Location, Task>?
will what work
shooter is always an entity iirc
Yes
thx
is it better to clear the internal state of an object rather than creating a new object?
basically trying to get a new empty object with 2 number fields and a boolean
Depends
I can go a bit deeper into pros and cons if you wish
just clearing state by this now cuz the object is mutable anyways and i dont want to create three new object every loop iteration
sure
hmm thats gonna be a long bible

Actually this is a really complicated design choice, but let us just state the differences. Either mutability exist in low level layers, or higher level layers. Generally speaking, if mutability exists in the lowest level layers you reduce reusability but you increase abstraction because higher level layers do not have to care about managing direct change of state. If pick the other design choice you increase reusability as the component becomes more pure through the application’s lifetime with the extra cost of having to deal with mutability in higher level layers thus might indicate leaky abstractions etc.
what have i done
also no gc if you reuse
it holds stack variables so doesnt matter
Oh yeah I should say you can still have a fair amount of reusability when you have mutable components, just that it in practice becomes exponentially difficult to deal with
Using callbacks for my plugin message receiver how can I ensure its not another incoming message but the one I wanted?
anyone has ideas of stuff to learn?
Elegant objects principle
aight ty
Lol nw
Well I mean theres no real guarantee
first time in my life that i write that much of documentation and still people dont understand how my code works
🥲
💀
so if you were car dealer, which would the guarantee percentage be?
well ye if you see my maths it makes sense
Thats why you just filter plugin message that go to the right channel and then just push the update to whatever variable
Principles:
No null (why?)
No code in constructors (why?)
No getters and setters (why?)
No mutable objects (why?)
No readers, parsers, controllers, sorters, and so on (why?)
No static methods, not even private ones (why?)
No instanceof, type casting, or reflection (why?)
No public methods without a contract (interface) (why?)
No statements in test methods except assertThat (why?)
No ORM or ActiveRecord (why? and why?)
No implementation inheritance (why? and why?)
wow
removed 90% of java features
kekw
Hehe
this looks interesting
x *=10;
x += y;```
or
x = x * 10 + y;```
I see, your an absolute gigachad super coder god my man
Theres also data oriented design, as well as data oriented programming which you might wanna look at (theyre not the same7
thx for the help
no orm I can strongly stand behind xD
No static methods, not even private ones
das dumb
When you realize instance methods are (almost) static methods 💀
hey, anyone familiar with acf? i have this command:
@Conditions("player")
public void report(Player player, String reportedName, String reason) {
// whatever
}
i expect it to work when i do /report <player> <reason>, but for some reason it falls back to my @catchunknown command, any idea why?
also i can't put Player as the second parameter for other reasons that are in my method
why dont (Player sender, Player target, String reason).?
.
Where should I listen to events? I have put the PlayerToggleSneakEvent in the main plugin class, but it is not fired.
i believe it thinks that it needs a method of signature (Player, Player, String)
but why won't it work with a string though
Youd have to implement Listener
it should work just fine
And register an instance of the class that implements Listener
/report a b or /report obtm some reason - neither work, just fall back
ah wheres your @Default on the method?
do you have any idea where i can find how these two interact
@Default @CatchUnknown @HelpCommand @Conditions("player")
public void defaultCommand(Player player) {}
uhh @HelpCommand is basically the same as @Default
i believe we are going off the topic
wheres the @DEfault
.
also you can use OfflinePlayer or OnlinePlayer instead of name
.
is the @loud prismditions the only param?
oops sorry for ping
wait
💀
lmao
lmao
thanks
hows that a subcommand lol
wait yeah
yeah that should be default
should be @CommandAlias("report") on your class
Yeah
Well its an interesting view point
it is
So its worth being knowledgeable about it
so if it's /report for fallback and there's /report <name> <reason>, do i need to annotate both with @default?
Why is null bad?
just send the whole class instead of multiple code blocks lol
the one with only a player should be default ig
I mean ides try to be useful
so it's better to just not use null
Well
If you can, express it at type level
Optional for instance
Altho Optional is suboptimal
both can be default
mhm
// package & import
@CommandAlias("report|rep")
public class ReportCommand extends BaseCommand {
@Default @CatchUnknown @HelpCommand @Conditions("player")
public void defaultCommand(Player player) {
// fallback + help
}
@Subcommand("today|t") @Conditions("player")
public void today(Player player) {
// all reports today (works fine)
}
@Conditions("player")
public void report(Player player, String reportedName, String reason) {
// this
}
}
so i want to annotate report with default?
hmm javadocs
Personally @grim ice I have sth like
Well I dont use it for every except one project that is running on limiting resources but yeaa
whats the point of IntNil over OptionalInt
I have a subtype that ensures a value is always there, and one that contracts a value is absent
Its just a bit more powerful and expressive, but no real point Ig
Bootleg kotlin nullability :>
yeah it works now
Yeah
I mean rust got it fairly figured out
are you still doing rust?
Scarcely
reached lifetimes?
Ive been busy with ugh well some stuff
rust 
i stopped when i saw lifetimes
:3
I stopped when I saw the first actual usage of it
smh
Hehe
that syntax is painful enough to make me wanna code kotlin
Lol
wrote some cool things
Guys, I don't want that when a player die drops item with a specific enchant, how can I do it?
I mean I like the examples they show everyone how good, innocent and satisfying rust is to write, but in practice its just not that 😔

Guys, I don't want that when a player die drops item with a specific enchant, can someone help me?
is this english
what?
Uanaa I think its better to translate the question into english
when a player die drops item with a specific enchant
i'm sorry but i didn't nearly understand what this means
^ and use deepl.com
Neither me
Guys.
I presume they want to keep an item in the player inventory if it has an enchantment
a partial keepInventory based on an enchantment
Not like keep inventory
rip
failed to presume 💀
Oh, do you know kitpvp?
he doesnt want that a death players drops its enchanted items?
well yes
@old geyser please use a translator because its I possible to help
lol
uhhhh i think you should also translate this from english to english
tf
lemme translate a big text, you wont even be able to understand
https://deepl.com @old geyser
@old geyser
Just ask it!
welcome to #help-development i'd say
why dont you just include the functionally from the other classes to the interface
in the examples here
he has TrimmedText PrintableText CapitalizedText and other stuff
When a player dies they usually drops enchanted items, I would like them to not only release enchanted items with a specific enchant, how could I do this?
why not have the interface Text contain methods contain, trim, toPrintable, capitalize
Well remember yegor has very opinionated takes on design
would they still keep the item
Nope
But
declaration: package: org.bukkit.event.entity, class: EntityDeathEvent
How tf can I explain
idk
does somebody know why the meta hoe is still normal and not a customModel ? i edited the meta but it doesn´t work
ItemMeta meta = stack.getItemMeta();
meta.setCustomModelData(4);```
yes
have you inspected the item in game
Ok so
yes
cuz not all text implementations have a meaningful impl for those methods?
and its nbt does not contain the custom model data ?
no
well then, double check you are actually setting the item meta back
I guess
your code snippet does not include it
so /shrug
the rest looks fine
hmm yeah that too
This design is much more flexible and reusable than a more traditional one, where the Text object is smart enough to perform all said operations. For example, class String from Java is a good example of a bad design. It has more than 20 utility methods that should have been provided as decorators instead: trim(), toUpperCase(), substring(), split(), and many others, for example
is what he says
that is pretty dumb
I mean, yeah depending on viewpoint you could argue for that
a decorator for this makes no sense whatsoever
you don't want a lazily computed String#toUpperCase
if you would want that, write that decorator around the string class itself
dont see any reason why trim() and uppercase() and whatever methods should be provided as decorators
like, if I want to print a string as upppercase, I'd call String#toUpperCase, which returns me a decorator which I then have to compute in order to get the upper cased string I want ?
I try to explain it like this.
Player1 has in his inventory an iron sword with sharpness 4 and another with sharpness 5. I would like that when Player2 kills him he only releases the sword with sharpness 5. How can I do that?
smh wrote two pages of paper about my math solving algorithm and its slow asf
im out of ideas
remove the one with sharpness 4 from the drop list ?
tbf
Java is shit
i dont really agree with the 'ctors must be code free'
😂 😂
it makes 0 sense
I mean, you use a constructor as a pure form of validation of its parameters
Java lang itself its really oddy
OK, BUT HOW
literally you grab the list
CALM DOWN
in an ugly way
loop over the drops enchantments lol
and then remove the items from it you want ??
Lmao being so rude I wont help
There
@EventHandler
public void on(final PlayerDeathEvent event) {
event.getDrops().removeIf(i -> {
return i.getType() == Material.STONE;
});
}
🥄
removes all items with the type stone from the drop list
event.getDrops().remove(Material.IRON_SWORD);
remove all iron sword
no
Lmao being in that way you wont be helped by anyone
check the type of event.getDrops()
Guys
?learnJava
Never mind
awww
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
wow
LMAO
rude lol
anyway, you cannot just remove a material from a list of item stacks ?
thats not how anything works
wondering why the signature of the remove method isnt remove(T elem)
there is a DamageCause.CONTACT, but i cant seem to get the block involved, is there another way? im trying to check if the player was impaled by a stalagmite/cactus/sweet berry bush
Because he was being really painfull and i dont like that type of people
i'm doing this in the entitydamagevent atm
you are useless

check the block at their feet?
Oh come on shut up and go to learn java before comming to swear
hm ok but that doesnt really work for cactus, or stalagmite because if theyre jumping or if they only clipped the block it's hard to find the relative stuff
Lmao calling usless to use when we spoon poofed full code
What are u doing mate?
didn't even get my name right 😭
you guys really save me a lot of time tbh
i woulda done some really hacky stuff if u hadnt told me that
lmfao
but no
Lymx its the Spanish thing that correct the words
Because not many americans uses xd
oh ?
Its more used by Spanish
rust be like
enum DamageCause {
PlayerKill(Player killer),
Block(Block block)
}```
smh just needed to say that
👉👈
imma change a single one of your dependencies in your cargo.toml and you grow old before your project builds
@sterile token what ya dont like bout it lol
I dont like none highly typed lsngs

I don't think you get more statically typed than rust
to process
could you translate that from whatever language to english
i think ill have to reread a few times
I just like "Lenguajes fuertemente tipados "
what
dont even know what that means
Strongly typed is the correct way right Lynx?
but anyway, does not mean you should dislike rust
it has a very robust type system
lol xD
i was thinking about learning rust but i changed my mind
learn go instead 😛
Go what that shit
i saw some go syntax and it looked horrible
Never heard about that
saner than rust
Yes, because is not strongly typed as Java
you have not been correct with a single statement in the last few minutes
I am impressed
it shows
Lmao translator go really bad
then he tells someone to translate his question 🤓
Its translator or word corrector?
nice help development btw
Hey please we dont need another one calling us usseless
When we just serverd him the food on his mouth
just doesnt seem like the right channel
no
Yes please be nice, relevant and all that stuff in between thanks <:
does CompletableFuture.runAsync(new Runnable() work with spigot okay?
As well as any other off main thread computations
don't touch the main thread inside the runnable and you are fine
@ivory sleet one more question, in which module should I put the resources such as config files?
fully auto generated lore :D:D:D:D:D:D
1 times
wtf
:(
well
and it just got generic support 😛
there are many "famous" languages
fuck i confused it with typescript
*time(s)
Is possible to detect when another plugin is unloaded?
java will never die out, C will never die out, and the worst thing is, cobol will never die out
yeah
declaration: package: org.bukkit.event.server, class: PluginDisableEvent
cobol is the lang of the future
Is Fortran still used lmfao
what are you talking about
too early to tell
not yet
my bank is using fortran in their mainframe
any improvements? idfk my english well so
LMAO
ignore the extra param
imma learn c++ instead then
o -> oes
o yeah
got it
bruh
entry -> entries
you cannot do it generically
im gonna add the o and the y-ies
deer -> still deer
thats it
there are too many "exceptions" of the rules
woman -> women 🤓
enlighs moment
you couldnt even do it generically for latin
womans
kekw
🤓
latin has such a strict grammar and it won't even work there because you don't know whether something is a-decliniation or 3rd declinitation
e.g. terra -> terrae. but also, dux -> duces, virus -> vira, puer -> pueri, filius -> filii, bellum -> bella, dominus -> domini, mensa -> mensae, meus -> mea
first going to the end and them looping over it twice 🥺
can minecraft names display unicode characters?
no
well
part of it
I mean a-z is unicode too 😛
screw you too
I basically just do a regex to check for a valid name
name.matches("^\\w{3,16}$");
hmm regex
but that's not 100% fool proof
because there are still certain usernames that are less than 3 chars, and some others still contain "."
but they are like >0.01%
isnt using a pattern faster?
ah no what i meant is that i want to know if its possible to spawn in a npc with a name tag that contains greek letters
thats all imma do
but "never change a running system" and I doubt that people need to validate usernames 200000 times per tick
i cba to add more because there wll be no end to it
its useless anyway
im literally using it for one thing
anyway, to whoever tried to do the singular -> plural thing:
you need to query some online dictionary
it's the only reliable way
there are just too many exceptions to the general rules (e.g. y -> ies)
as said... mouse -> mice
it's random
womans
men't
spriggyan ?
english is so weird in general
e.g.
woman, women
the last vowel changes
but the pronouncation only differs in the FIRST vowel
woman = woman
women = wimmen
kinda weird
there lmfao
english grammar is so easy but their spelling and pronounciation is just totally random
the bart the
good thing 99% of the internet types
imagine everyone using voice chat
it should be "Der Bart, der"
haha
my singular year of german B)
👀
german would probably simple to learn in my case
the equivalent to a D ?
a cock
I'm already used to masculine and feminine languages
caw caw
i dont get it tbh
I just hope that german isn't like portuguese and doesn't have like 25 different cases for each verb
in german we got grades from 1 (best) to 6 (worst)
english however skips the E part
tree is feminine here
you only have A (1), B (2), C (3), D (4), ... (5), and F (6)
so is table
the argument usually made is 'it speeds up recognition'
Das auto
yeah
we don't have neutral here
latin is even worse. they sometimes use the passive word for active meaning
URGH
bro i hated latin
dont remind me
hocus pocus
2 years of pain
my school was like 'youre taking two foreign language courses' and i had the choice between french and latin
all those cases
and my dumb ass thought latin was easier
e.g. you say "I murder md_5" (active form)
but in latin you'd say
"I was murdered md_5" but it still means that you murdered him
Y’all get off topic in here a lot XD
yes
but only for some words
nobodys asking a question anyways
murder is the infinitive form
thats fine when noone asks anything serious 😄
learning french + german + latin = worst combo ever
here you say "I murdered" or "I had murdered" type deal
it can also be a noun
yeah that's a killer combo
why use many word when few word do trick
In my case I had exactly the same method like you did, but when I realized how many edge cases there were, someone made this class for me: https://github.com/eccentricdevotion/TARDIS/blob/master/src/main/java/me/eccentric_nz/TARDIS/utility/Pluraliser.java
Nominative, Vocative, Accusative, genitive, dative, ablative
all singular/plural
"the trick is to undercook the onions"
I got a classmate that was named "quevin" just to fuck with people
YEAHHHHH
thanks
i had two sets of identical twins in my year
fun times
for the nice method
oh god
i will be using walruses
i dont see the problem
you need to remember to optimize the right problems
is he talking about the words
fun fact: what's the plural of octopus?
not the code
octopi
octopuses
poor md_5
isnt it just octupus agin
octopussy
💀
8x pussy
octopussys
james bond
ies*
indeed
James bondies
okay calm down y'all were slipping
identity theft is not a joke, LeGuernic!
Map<String, String> a = b.getOrDefault(xyz, ImmutableMap.of());
How can i rewrite this so it only creates the empty map when needed?
i know i could just do a null-check but that‘s so long, literally 4 lines 😭
isn't oit related to spigot ?
possessive plurals when
spigot development gotta touch grass every once in a while ngl
by using computeIfAbsent
grass is over 5 metres away
(if you wanna put it into the map as well)
or use a shared empty map instance
bro
Map<...> a = b.computeIfAbsent(xyz, __ -> ImmutableMap.of());
Collections.emptyMap() always return the same map, idk about Guava ImmutableMap.of()
ahh thats good too
does b.get(xyz) just return null?
true
that's better
If there isn’t an entry, yes
^
Map<String, Map<String, String>> b = new HashMap<>();
final Map<String, String> a = b.getOrDefault("key", Collections.emptyMap());
shared instance
why not just do if a==null then return end
tbf
because they might not wanna return yet?
ah
some things never change
actually now that u say it SecretX, it seems that it just uses the same static empty map every time
so no new map gets made i think
emptyMap() reuses the same thing, yes
that's the point of it
the method is only there for generics and stuff
nah i mean ImmutableMap.of()
otherwise you could use the static field directly
oh
no, ImmutableMap.of(...) creates a new one ofc
it does?
how else would it work if you toss in stuff
two constructors
oh wait you mean the empty one
sorry yeah
xD
yeah the empty of() one just returns the static empty one
at least thats how guava does it
no idea if there's a builtin one, I only use java 8 
Java 8 is the most amazing one it doesnt lot of shit like does java 17
🤔
😂
lol?
the one advantage of java 8 is backwards compatability
plus
java 8 already has lambdas
whut
java 17 doesnt do shit
it adds "nice to have things" that noone actually needs
they are nice to have but that's it
I would switch to java 17 if there still wouldnt be so many people on 1.16 that use java 8
if I do standalone apps like discord bots or GUI stuff, I always go for 17
or comissions, when they say "java 17 is fine" ofc I also go for 17
can you give one useful example
the enchaned switch e.g.
1 sec
item = switch(...)
in java 8 it would be like this
huh thats interesting
or e.g. pattern matching
one sec
I do "instanceof Slime slime"
so in line 93, I can use "slime" and it's a Slime
I don't have to do Slime slime = (Slime) entity
it remembers from before that I did the instanceof, so I can be sure that "slime" is now a Slime instead of having to cast it "again"
or records for example
records are basically java's version of lombok's @Data
i dont think records are that useful
for immutable data they are
if you want to change a single value you recreate the whole thing
well if you don't use lombok, then records can make your classes WAY shorter
lemme give you an example about why records are awesome
yea i do most of my work with mutable data
so i dont get much use out of records
i believe they should add the same way to defining a class as a record does
yeah okay
I usually use lombok if I want mutable data classes
so yeah
- Wanna have it immutable and use Java 15+? Use records
- Wanna have it immutable and use Java 5+? Use lombok's @Data with final fields
- Wanna have it mutable and use Java 5+? Use lombok's @Data with mutable fields
- Using Java 4 or older? Damn where did you download this jdk bro
using java 1: die
my old linux laptop from 2010 but thats besides the point
I'm still waiting for 1.20 to get rid of the enums
why
what announce emnt
nope
basically ALL enums that implement Keyed will get removed "soon" (TM)
e.g. Material
ah from spigot
yeah
what will they replace it with
public static variables ig
with "public static final" fields in a normal class
...why?
im still waiting for generic enums in java
e.g. something like this
public class Material {
public static final Material DIRT = new Material(NamespacedKey.minecraft("dirt"));
Because enums are for things that don’t change
well thats just the same problem in a different form
Registries are slowly becoming modifiable
you still cant add a new material or biome
You can, it just wouldn’t have a final field
They’ll likely be a getByKey or something
whut
of course you can
you can just do new Material(...) yourself
client would have to know about it smh
I mean
i spent about half of the last week trying and failing to add a new biome
just look at the PersistentDataType class
for various reasons
it has a few public static final fields, like PersistentDataType.BYTE
100% possible for biomes atm, materials one day hopefully
but of course you can still add new ones yourself. Just saying... https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/