#help-development
1 messages · Page 2038 of 1
NamespacedKey.fromString("_:" + key);
new NamespacedKey("_", key);
and it's not worth using a deprecated internal method and breaking its contract
good point
agree? mfn
sure I agree
I tried your method, but I do not know how to get what is being damaged by the lightning.
but it wouldnt make sense to hide a constructor to then introduce a whole fromString fancy parsing method that does the exact same thing
why have the contract
what
i dont understand a single character of that lmao
what the hell does that do
package com.jeff_media.morepersistentdatatypes;
import org.bukkit.NamespacedKey;
import org.bukkit.persistence.PersistentDataAdapterContext;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.persistence.PersistentDataType;
import org.jetbrains.annotations.NotNull;
import javax.xml.stream.events.Namespace;
import java.util.Collection;
public class DataCollection
<C extends Collection<D>,D extends PersistentDataType<?,D>>
implements PersistentDataType<PersistentDataContainer,C> {
private static final String MUST_NOT_BE_NULL = "Collections stored in a PersistentDataContainer must not contain any null values.";
private final Class<C> collectionClazz;
private final Class<D> dataTypeClazz;
public DataCollection(Class<C> collectionClazz, Class<D> dataTypeClazz) {
this.collectionClazz = collectionClazz;
this.dataTypeClazz = dataTypeClazz;
}
@NotNull
@Override
public Class<PersistentDataContainer> getPrimitiveType() {
return PersistentDataContainer.class;
}
@NotNull
@Override
public Class<C> getComplexType() {
return collectionClazz;
}
@NotNull
@Override
public PersistentDataContainer toPrimitive(@NotNull C collection, @NotNull PersistentDataAdapterContext persistentDataAdapterContext) {
PersistentDataContainer pdc = persistentDataAdapterContext.newPersistentDataContainer();
int index = 0;
for(D data : collection) {
if(data == null) {
throw new IllegalArgumentException(MUST_NOT_BE_NULL);
}
pdc.set(getKey(index++),dataTypeClazz,data);
}
}
@NotNull
@Override
public C fromPrimitive(@NotNull PersistentDataContainer persistentDataContainer, @NotNull PersistentDataAdapterContext persistentDataAdapterContext) {
return null;
}
private static NamespacedKey getKey(final int name) {
return getKey(String.valueOf(name));
}
private static NamespacedKey getKey(final String name) {
return NamespacedKey.fromString("_:" + name);
}
}
it allows to save collections to a PersistentDataContainer
but yeah hm
what format does it use internally? 👀
oh the toPrimitive converts it to a map or something
strings?
that can be serialized
I need a third generic type
I am so stupid lol
I wanted to save a PersistentDataType<?,PersistentDataType<?,?>>
that doesn't make sense
ah yes of course
Is there an event for the player rotating it's head?
PlayerMoveEvent
Didn't know that included that, thx
every mouse or keyboard movement counts for it
when comments are missing in a generic class:
yeah
jk ik ur still working on it
nah but i get so confused by that shit
and my lib comments are still kinda messed up from older versions
it looks intimidating
not really
at first glance
hey all Im in need of some assistance with a plugin im using. Its suppose to give a player a heart each time they get an achievement but when ever I use it on a paper server the hearts are only visual and dont actually boost the players health. Where as it doesnt work on a spigot server. It will load the plugin like normal and even allow you to run the start command but it doesnt give you extra hearts when getting an advancement
DataCollection is a class that needs a collection of D and its named C. D should extends persistent data type of <?, D>. DataCollections also implements PersistentDataType<PersistentDataContainer, C>
simple
does anyone know how to reset a plugin without having to restart the server
does it work on a spigot server?
?learnjava (i only need the links go on with your convo)
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.
hopefully the plugin has a proper reload implementation, i would consider /stop
dont
^^
not as simple as you think
It doesnt. It will allow me to load the plugin and it will also allow me to issue the start command even giving me the go ahead in chat but once i get an achievement nothing happens and it gives me an error in my serer log
I have no idea on how to continue in the pdc.set method
crys
simple for the reader
not the developer :)
but whats ur problem
even though you know way more than me maybe i can help dunno
paste the error
?paste
check the line with ???
public class DataCollection
<C extends Collection<D>, T extends PersistentDataType<?,D>, D>
implements PersistentDataType<PersistentDataContainer,C> {
private static final String MUST_NOT_BE_NULL = "Collections stored in a PersistentDataContainer must not contain any null values.";
private final Class<C> collectionClazz;
private final T dataType;
public DataCollection(Class<C> collectionClazz, T dataType) {
this.collectionClazz = collectionClazz;
this.dataType = dataType;
}
@NotNull
@Override
public Class<PersistentDataContainer> getPrimitiveType() {
return PersistentDataContainer.class;
}
@NotNull
@Override
public Class<C> getComplexType() {
return collectionClazz;
}
@NotNull
@Override
public PersistentDataContainer toPrimitive(@NotNull C collection, @NotNull PersistentDataAdapterContext persistentDataAdapterContext) {
PersistentDataContainer pdc = persistentDataAdapterContext.newPersistentDataContainer();
int index = 0;
for(D data : collection) {
if(data == null) {
throw new IllegalArgumentException(MUST_NOT_BE_NULL);
}
pdc.set(getKey(index++), ???, ???);
}
}
give me a moment Let me restart the server and do it once more
I took a screenshot of it but didnt copy paste it since its on my server pc
I need a PersistentDataType to store a collectio nof other persistentdatatypes
🤔
I think I get it
@tender shard ur not restricting the type of Collection
any one can tell how it this done
i can also use Collection<Integer>
and u wont cry about it
<C extends Collection<D>
it can be any collection that can be instantiated with an empty constructor
even a set of integers for example?
No
ey origin realms
hey
I am curious how they rotate player hands and body
sure, why not
there's a bug too, when you do such a thing and rightclick, it kicks you
it cant find the method, which means that it isnt supposed to work on paper
is it a spigot plugin?
its a spigot/paper plugin
lol is it a popular plugin?
first ???: dataType, second ???: data
"this plugin requires a papermc/spigot server to run"
or are you just using a wrong server version?
Im using the server version from the video they posted
The plugin was created by FredtheDoggy
lol how old is that video
Im also in his discord
A couple weeks
they used 1.18.2 because they had the new caves and what not
I GOT IT WORKING
congrats
public class DataCollection
<C extends Collection<D>, T extends PersistentDataType<?,D>, D>
implements PersistentDataType<PersistentDataContainer,C> {
private static final String MUST_NOT_BE_NULL = "Collections stored in a PersistentDataContainer must not contain any null values.";
private final Class<C> collectionClazz;
private final PersistentDataType<?,D> persistentDataType;
public DataCollection(Class<C> collectionClazz, T persistentDataType) {
this.collectionClazz = collectionClazz;
this.persistentDataType = persistentDataType;
}
@NotNull
@Override
public PersistentDataContainer toPrimitive(@NotNull C collection, @NotNull PersistentDataAdapterContext persistentDataAdapterContext) {
PersistentDataContainer pdc = persistentDataAdapterContext.newPersistentDataContainer();
int index = 0;
for(D data : collection) {
if(data == null) {
throw new IllegalArgumentException(MUST_NOT_BE_NULL);
}
pdc.set(getKey(index++), persistentDataType, data);
}
}
well of course not done yet but the only hard part is done
https://www.youtube.com/watch?v=ox-Sw7l3qyY&feature=youtu.be this is the paper server. It gives you hearts but its only visual and doesnt actually give you health
what did you say?
this?
this
Question when I'll try to spawn Block_Crack particle how can I set the block type?
yeah
yeah of course the first one is the data type and the second the data 😄
yeah so what was the matter lol
the problem was I used the generic type T in the persistentDataType field instead of declaring it to be PersistentDataType<?,D>
are there pdc data types that serialize into binary directly?
yes
how do you make one
PersistentDataType.BYTE 😛
literally the same though?
the builtin datatypes all are mapped 1:1
byte = byte, byte[] = byte[], ...
int = int
I changed it in the field
or am i misunderstanding
here "dataType" is a field of type T
and here it's a field with type PersistentDataType<?,D>
yes, the toPrimitive thing is working
i have another controversial coding opinion but idk if i should post it
post it
post it
nbt is better
or get rekd
L
NBT is like the small ugly drunk grandfather of PDC
lmfao
I mean
agree, but hes buff
without NBT there wouldn't be PDC
abstraction is cool
i just dont like how pdc is implemented in this case
pdc > nbt
and nbt serializes straight to binary
it's done ❤️ https://paste.md-5.net/suyexunina.java
the question is only now
how to use it
lmao
nice
the comment doesnt explain anything
Lol
C extends Collection
// C is a collection
no way
its a start
you know i actually got a small adrenaline rush from posting nbt is better lmfao
thought i would have to run from the entire development community
nah
more types
its kinda cool i checked it out
kinda
persistent data types
i mean i cant say "nbt is better" and then say yeah this is sick bro
doesnt pdc already have a toprimitive method
but it is cool
it does
no
nms bad
i know packets but not minecraft packets
little to no abstraction
What are you trying to do sysdm
yes sure
Isn't there like 189237 forum threads on that lol
lets add (@ for help) behind my name too
Ah 
Literally unusable
:(
Doubt
bruh
i dont have a fancy orange name color
fourteen how many years?
Fantastic website
uhh
Literally all I can see 😂
lemme think
fourteen doesnt suck afaik
thats not little
whats the most complicated thing u know if u remember @tardy delta
UUUUH
code battle
how do u not understand english
who more experienced
lol what
I need help D:
no you read it
dont go to fourteen because sysdm states he has too little experience
futures and asynchronous things were probably the most difficult things
lol i dont know all those abbreviations
only oop
and abstraction polymorphism and design patterns
i always confuse the names lol but i know how to implement them
Just google it
to some extent yes
kiss is 💋
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Have you tried Mob#getNavigation().createPath()
I love to use this
i dont know all the acronyms but its a bit unfair to go by coding practices by an obscure name. if you stated all of them in normal terms i bet most people would know a good amount of them
i know each one he mentioned :o
well on compile time, it works. but a bit hard-to-read. I'll probably turn it into a static constructor
and then see if it really works lmao
why did u use the constructor here
2Hex explain humble objects principle
bruh
just to see whether it throws any error messages on the syntax
ah
to understand before i was able to use them
dude List is uninstantiable
@ivory sleet i actually dont know that
the implementation is important sysdm
I am instantiating the list with reflection
so liskovs sub principle doesnt apply
yeah that won't work
because my DataType expects an ArrayList
or well
when reading, it requires ArrayList
List is an interface lol
when writing, a list is fine
abstraction is hiding impl details, can be done in multiple ways using interfaces and abstract classes
it wouldn't work with a list
a short one
well it would work with a list if one only needs to write to PDC, and not read
Humble objects principle is a principle applied when designing design in multi threaded environments, it states that any object which encapsulates logic that does not relate to multi threading and concurrency must be isolated into its own object rather than combined and exposed to multi threading and concurrency details. This should help testing.
exactly what he said
Abstraction is yeah detail hiding, expose high level terms such as what but avoid how
well
but do you need to know all these principles to write a program? or are they just something that you do automatically
it can enhance the design of a system orbyfied
it becomes significantly important in enterprise and team projects
good practice should come with experience, not knowing what the good practice is called and where it comes from
might help on an interview
altho it is quite difficult to master them as they only focus on general problems and not exceptional cases that you will run into frequently
LOL
nah
@glossy venture Have you worked for an actual company?
Or are you some kid who learned Java via Spigot?
thats true
but thing is
no im 14
Then don't comment on things you know nothing about.
i started learning java like 1.5 years ago because spigot
these "good practices" that have been discovered have over the years been turned into theorems, principles and patterns
yeah
would like to hear an explanation :)
im just saying, using this 'good practice' is experience, you are not experienced if you know all these fancy names
it might help on an interview
^
you do up experience by learning them
Thank you was just typing something like that out.
idk if "you do up" is english but you know what i mean
Good practices are not based on experience.
For all A and B there exists an A and B such that A and B can be expressed in terms of S. Then if and only if exposed to A, then A must be substitutable to B.
You can make a program, and have it run. Doesn't mean it's a good program.
then to make it concurrent for example you can make another implementation of it
im saying its the other way around
right>
2hex
yes
general idea is to create a delegate for the logic itself
and let it be wrapped around the concurrency accountable object
forgor
guys i have a probelm with titles api i imported titleapi with
import com.connorlinfoot.titleapi.TitleAPI;
and in the player join event i put this
TitleAPI.sendTabTitle(event.getPlayer(), "Players Online:", "Tell your friends!");```
and if i join in the server not work
well that sides in SRP
since like
an object does only what it should do well
SRP is extremely shallow tho
adding the logic of concurency
did u make sure its getting called?
what is defined as one responsibility tho?
will add another thing to do
its not exactly clear
put a println there
for example
as its very interpretative
If you go full on srp you might as well just have one function per class
i imported the TitleAPI.jar
a class shouldnt have a method to kill a player and to say hello in chat
Making a object and it's sole responsibility is to... run the entire program 
look what im saying, you usually learn what the good practice is and how to use it by practicing, doing up experience. knowing what these principles are about and how they are called doesnt make you a good or more experienced programmer
help??
it does make you more experienced tho
yeah sorry
It does make you a better, and more experienced programmer. Just because you can make shit work doesn't mean it's good shit.
You are way out of your field here. You have no idea who you're talking to
wa
because when you can formalize practice into theory you become a far more powerful programmer
i dont think ur getting my point
ok
You have a massive ego.
Your point is retarded, and invalid.
help
Put simply
Because I earned it.
I have 8 years of experience with Java. I work with Lunar Client developers, and have been offered positions by numerous large networks such as PvPWars.
For instance you often see List<O> list = new LinkedList<>();
Yeah i get that
now that would be changeable to ArrayList right?
Just because you've become an accomplished developer over the course of 8 years doesn't mean you should belittle the ones that are still learning.
yeah
since ArrayList and LinkedList offers the same functionality
then we can simply expose the variable in terms of List instead of ArrayList or LinkedList
well
or r we talking about liskov principle
liskov substitution principle does imply polymorphistic existence
Clearly he's not learning as he believes he knows everything.
i know that and its greek origin
No, I get that more from you than him. And trust me, you don't know everything.
For instance
yes
Never said I know everything.
Neither did he :)
But he's acting like it. I suggest you stick to things that concern you. This is none of your business, random.
Lmfao
its fine to sometimes do
ImmutableList l = ImmutableList.of()
or
IdentityHashMap m = new IdentityHashMap<>();
altho this is usually very questionable
EnumMap<X> m = EnumMap.of(X.class);
^do u know why 2hex?
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.
Guys lets not be rude now
because uh
alr, dont want this chat to turn into a principle and validation of experience source war
nah im stating my opinion
LMAOOOO
It's a matter of fact, not opinion.
its fine to argue but avoid heating it up 😄
so well
IdentityHashMap breaks the contract of Map and ImmutableList breaks the contract of List
however EnumMap does not break the contract of Map
2hex
ISTG I KNEW THAT
ye
this is a debate and im trying to convince you of my opinion
I WAS GONNA SAY IT BUT I DELETED IT LMFAO
I'll repeat myself for you.
It's a matter of fact, not opinion.
but then i thought EnumMap accepts 1 param and Map accepts 2 so i deleted it
Thank you
@glossy venture Admitting you're wrong is a part of learning.
what facts
altho people still do Map m = new IdentityHashMap(), mostly due to convenience
i know and sure ill stop
and has nothing to do with liskovs sub principle
but i stand by my point
oh ic
That learning design patterns, principles, and practices that are proven to work make you a better developer than others.
Check this out: https://github.com/iluwatar/java-design-patterns
yeah but knowing the names doesnt, you need to be able to use them
so using e.g Inter Impl is better than Impl Impl
IdentityHashMap map = new IdentityHashMap() too long
java8+ lol
What? Yes of course, we never said anything about knowing the names. To use them you need to know the names though, you wouldn't know of the pattern otherwise.
everything under java 17 is deplorable, sorry for your loss
because it abstracts away the impl details, achieves polymorphism, then encourages LSP
xd
ye
well object oriented programming sucks to some extent also 2hex
I'm in love with it
i always struggle when trying to learn any language that isnt oop
sysdm just sent a bunch of acronyms and then i stated "you dont need to know what those acronyms mean to be able to use those principles, you might not have even known you were using them because its such common practice"
it almost always sucks, but it provides a decent solution, tho never the correct one, just not the wrong one
but if i understood wrong, then thats on me
It's not common practice.
what should i use for normal messages in the console? sout or getLogger().info(ChatColor.<color> + "message goes here"); ?
99% of developers in this community are retards
i prefer logger
learning
ig
because functional is gonna twist your mind
also @cosmic pelican you definitely wasted time on these 8 years, because those 8 years will never increase, theyre always an eight, due to your ego lol
and procedural is just oo but less powerful
yeah
@glossy venture the chat it's bugget can you open a new ?
they both dont support color codes too, Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "message") does however
and oop makes sense
They increase everyday, this is you just being retarded.
I don't let my ego get in the way of facts.
let me tell you the issue of object orientation then 2hex
^^^
open a new threat
barely increasing
oh xd
Yes because I already know a lot. It's not exactly easy to learn more once you get to a certain point.
cant you click on the help thing under the channel?
You just started a useless argument because you're butthurt.
yes can i click on but when i press enter discord get's error
oh sure ill open a new one
okay
You know a lot?
i agree but they can learn
Why wouldn't I?
you know fucking shit if youve been learning for 8 years and you still act like this
I haven't been learning for 8 years.
I said I've been programming in Java for 8 years.
yeah?
How I act doesn't take away from my knowledge.
That's a dumb argument.
and i bet someone like
i dont get what ur saying sorry
?paste
My guy, all you have to back up your statements is my attitude. Get over it, and cry.
Redempt who has a similar amount of years of experience as you
knows way better than you do lo
i know
Considering most people talk in here consistently, and you're the new guy, pretty sure you're the random bud
he said "an API"
Ha funny
Spigot's community maybe, not MC in general.
Well that's where we are, isn't it? 😛
In a combination.
I remember when someone used to call Spigot a "Minecraft Performance Software Engine"
thats why the ?learnjava command exists, sadly like noone ever listens, but thats because they want to get straight into development
True
without doing the "boring" stuff
@faint sage works for Lunar Client
@weary geyser works for MineWars
And the list goes on but I don't want to bother a bunch of people
okay I got a question. What would you prefer?
DataType.asList(DataType.ITEM_STACK)
or
DataType.list(DataType.ITEM_STACK)
??
At some point but sold it for a large sum.
what does it do
Still has the entire VanityMC & Mythonia management backing it.
it erturns a PErsistentDataType<PersistentDataContainer,List<D>>
Literally 🤣
He gets the server 1k+ alone.
He changed it to the cat!
Well
It's changed a couple times
but the Lil Peep one is the OG, yes.
Yeah haha
sysdm and I are still in the Management GC for MW loool
🦛
🦛
HAHAHAHA
SPACEMC
Dude I remember that
That was so long ago
Old name?
what was the drama i missed
Meh I don't remember it anyway
big stupid argument
I forgot already
was kind of fun
lol
lmaoo
Gizmo?
Oh god

Of course lol
Callum isn't a random
he's a very "spooky hacker man" 
He used to think he was spooky
LOL

Pls dont ddoz me
I am scared of ddoz
😮
😭
ah not anymore
fair
would updating an item stack from PlayerInteractEvent updat e it in the inv?
yeah its passed by reference right
well Java's always pass by value
for objects it passes object references
stuff in classes update tho
which are 64 bit values i think
well in the eyes of Java
Yeah
they even mention in their specs that the language only provides pass by value
ofc objects are just references under the hood
yeah
if i do
MyStuff stuff = //
stuff(myStuff);
// if i edit myStuff.something it will also be edited after the method call
Yikes
what happened
yeah
what happened
OMG YOU CAN'T BELIEV HOW HAPPY I AM
what a smart boy

wonderfully amazing
now I can just do
pdc.get(someKey,DataType.asList(DataType.ITEM_STACK))
thats useful
builtin is almost nothing
yeah, PersistentDataType.TAG_CONTAINER
but that only maps NamespacedKeys to data
I want to make it work with HashMap<Object,Object>
oo
:o
my Lists and Sets already work with every possible custom data type
how
one sec
he's a witch, burn him
he's too smart 
I need to add dependecy for this version if I want this to start working ?
Yes
https://github.com/JEFF-Media-GbR/MorePersistentDataTypes
check out the last fields in DataTypes.java and the whole DataCollection.java
btw
oml
yeah the description isn't lying
why not just use jitpackio
"adds a ton of new persistent data types"
why?
jitpack is the slowest, worst repo ever
yes
o what to do then
I have a nexus running anyway for my internal stuff and all remapped spigot stuff etc
so why not just use it for my public stuff as well
what if u dont
central :3
maven central?
ye
if I ever find out on how to upload sth to central, I'd use that
but I like selfhosting anyway, this way I can also see how many people roughly use my stuff
oh and another downside of central:
de toute facon, j'ai besoin d'une idee d'un library
you cannot redeploy and I tend to upload stuff with forgotten debug messages
ok french is prob not allowed
i need an idea for a library
me too
milked
a worse commandhandler
I always just come up with library ideas when I discover I already made the same thing twice
e.g. parsing custom recipes
oh
I already made that half a year ago though
how to get a recipe materials
wdym?
is there an event that fires when a FallingBlock turns into a regular block-?
for example
EntityChangeBlockEvent
its seeming to call as it falls through the air
o.O ?
or i am just plain stupid
Recipe.getMaterials() returns {DIAMOND, DIAMOND, DIAMOND, DIAMOND, DIAMOND, DIAMOND, DIAMOND, DIAMOND, DIAMOND}
for a diamond block
that might also be some other entities who are currently changing blocks 😄
yea probably
thanks !.
that's on my todo list already :3
is reflection allowed though?
no
reflection good for many things
but does it serialize to readable text?
can you show an example of a serialized entity?
fr example
serializin
an entity to
"dumbIdiot"
then u can convert dumbIdiot to the entity back
so it's not really serialized to text
its kind of a kv pair
but i used "Serializer" since it would be easier to understand like that
we need sth like "serialize(pig)" which turns it into a json that you can copy over to another server, and then deserialize it
well one could probably easily get all field values with reflection
at least everything serializable
UUID, name, health, attributes, ...
gson could probably deal with that rather sophisticatedly
btw mfn
hm are you sure?
nope
gson has failed me many times
I guess with structures
yay
yeah that's why I asked whether you could turn them into actual text
or byte[] or whatever
I guessed that because this way it's saved internally
you should add a toJson method
alex do you want your next big challenge
even if the json just consists of a byte array
always
how do i use a custom font in item lore?
data driven potion recipes
but I still have to add maps to my lib
and make the brewing stands work with custom materials somehow with packet fuckery
oh no NMS for my libs
nms is cringe
what are you a liberal
I only use a tiny amount of NMS in JeffLib
e.g. sending packets or changing materials maxStackSize
sometimes it's required
e.g. my StackResize plugin just needs NMS, there is simply no other way
what does it do
considering forking spigot and adding data driven potion recipes
I want it to be formatted with json files like Mojang does it for the recipes and shit
bump
Nope. That lore is something you have to set yourself
and possibly gpu accelerating slimes x)
sir I am not a smart man
gpu accelerate my ass

of a recipe
allows to change stack sizes
yeah I'll upload it in a few days
amazing
some things are still buggy
Does it work with hoppers?
and in containers?
yes, but let me double check
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ShapedRecipe.html#getIngredientMap() discovered this
declaration: package: org.bukkit.inventory, class: ShapedRecipe
If so, I want that on my private survival server immediately
i can loop the entryset
how do i put a text component in item lore
I have some auto potion machines and the storage of those motherfuckers is atrocious
You don't
You put a string in item lore with spigot
mfnalex told me u can
mfnalex is wrong
how do i use font in item lore then
what did I say?
I guess 99% of people here actually use paper lol
Instantaneous death
I mean, everyone uses paper to test, spigot takes way too long to start the server lol
The inquisitors will weed them out
The Paper Inquisition is nigh
yeah and paper is like 2 seconds for all worlds lol
only times when I actually use spigot is when I am debugging since 3 hours and can't find a reason why it behaves so weird
i find them the same
anyone? please?
then I have to make sure it's not a paper bug
wtf
wait yall dont go pee when ur server is starting
??
wow
dehydrated fucks
more.
no.
i still have plenty
of liquid
Try using .toLegacyText() after you build your component and put that in the lore
Not sure if it'll work but it's worth a shot
i did
Spigot be like:
Preparing spawn area: 0%
it still counts as a text component
that takes 1 min max
2Hex most patient person here
guess you wouldnt live a few seconds with my biological family
Sadly Spigot lags behind on proper component implementation for items
You could look into the Paper api, I feel like it'd have something for that
fuck the system
adventure is great for tooltips and stuff
absolute hell if you want a simple string with lots of colours
fuck the system a bit more
papermc Component doesn't have font
what?
time to learn nbt fuckery then
no pls i beg
There is no escape
I have to admit, until a few months ago I always thought a Map is also a Collection
I'm genuinely annoyed that spigot lacks a proper api for making items and entities nbt files
if you are annoyed, PR it 😄
who what where when
mfn
that don't have a no-args constructor?
are arrays collections
makes sense
Arrays implement Iterable<T> though
well then
a map is a (sort of collection) of nodes :troll:
also remove(Object)
collections are flawed though
they have an add method but there are MANY collections that don't allow adding items
so why is add part of the interface
it makes no real sense
indigo
do you people do
void asd(final @NotNull C asd)
or
void asd(@NotNull final C asd)
?
The latter, like a normal, sane, functional human
I never remember the "proper" way lol
but yeah I guess the second one makes sense since fields mostly also look like this
@NotNull
private final C asd;
second
ISP
Interface Segregation Principle
another "style" question
i like Lists.newArrayList(T... elem)
would you move the red part into the try catch block?
Yeah, I would
I thought so too when I looked at this
a bit cleaner
Yeah it's less jarring.
I think I'll have this piece of shit done in an hour
then I'll celebrate by staying awake till 7 am doing nothing
Maow was that you who had a lib for collections in PDC?
or was that redempt?
hm then it must have been redempt or someone else
that would be nice
there are many but I never liked any of those
why can't interfaces have private fields >.<
Anyone know if there is a replacement for LocalDateTime for Spigot? Since timing in Spigot aren't necessarily aligned with real-world times?
eg: server isn't always running at 20 tps
LocalDateTime represents a real time, what are you trying to do?
LocalDateTime represents a real date and time
I want the time between some time captured in the past and time captured now, but yea, I guess I can use the tick values
You can return the amount of seconds between "now" and another instance of LocalDateTime
and then secs * 20 to get the ticks
why do you need any ticks for that?
I've not seen any evidence that suggests the TPS matters in that conversion
or just compare a long with system.currentimemillis?
Scheduling, probs
doesn't java have timers builtin that run at a specified actual time?
ye
Yes. But basically, I'm checking for the time since a scheduled task was scheduled
forgot the name
So 1). schedule task and store tick count, and then 2). compare current tick count to stored tick count
how would i get the name of an inventory
declaration: package: org.bukkit.inventory, class: InventoryView
I wonder why there's no Inventory#getTitle
Ello guys, could someone explain how "ascent" and "height" works in texture packs? Specifically...
"type":"bitmap","file":"path","ascent":2,"height":42,"chars":["ꌖ"]}
``` These
wtf are those weird symbols on the right? I've never seen that before
nothing
my brackets are rainbow colored 😄
they are different depending on the nesting
ah I think it's the code folding
weird, I've never seen that before
not much, only installed a plugin for fancy bracket colors
but that was months ago
and I only saw this now lol
Pretty sure that’s git
It’s matching with my git edits atleast
ooh indeed
yeah you're right
thanks:D
mystery solved
hi alex ❤️
they tend to do that
generics are cool
yeah
of course they are
type parameters are necessary if you ask me
but they are also very disturbing
i n d e e d
I am so happy when I'm done with this lib
pog
collections, arrays and maps for all datatypes
e.g.
PersistentDataType type = DataType.asHashMap(DataType.UUID,DataType.asList(DataType.ITEM_STACK));
that would return a PDC datatype with which you can store and load a HashMap<UUID,List<ItemStack>>
woah
a CommandHandöer?
Oh sweet
Reminds me of like, type tokens... in a weird way
no idea what that is, tbh 😄
gson typetokens
com.google.common.reflect.TypeToken :p
serialization
never used that
It's a reflective utility for capturing a parameterized type
aw
typically used in libs like Gson for type parameter information within serialization/deserialization
iirc...
final Type type = new TypeToken<List<String>>(){}.getType();
yea I think it's that
Pretty sure Guava's TypeToken is a little cleaner but yeah
is there any map impl that allows null as key?
I thought HashMap allowed so?
Oh yeah btw
since PDC doesn't support null
Have you considered checking out Lamp?
Just sayin', it's a pretty good command lib
no need to reinvent the wheel a 20th time
Fair 'nough ig
is it true that the following are actually valid for a NamespacedKey?
.:some-key
-:some-key
_:some-key
the docs say
Namespaces may only contain lowercase alphanumeric characters, periods, underscores, and hyphens.
so I guess that's fine?
awesome
first
wait
depends I guess
SubPermission sounds like "node" is also needed as permission
add both
SubPermission requires the base permission too
Just Permission on a subcommand does not require the base permission
ACF simply uses CommandPermission
so in ACF you have a CommandPermission on the class itself, and a CommandPermission on the SubCommand
no idea whether both are required for subcommand
so if you make it two annotations, SubPermission and Permission, it's clear what it does
:wassup:
I've pinged @ Nullable and @ NotNull on github sooo many times lol
without it, noone's gonna use it
i guess
I really wish java would enforce a proper naming scheme