#help-development
1 messages Β· Page 426 of 1
you can just adjust the module
your in boomer teritory so i thought you would have done modules befor
and tbf I was still hoping someone would've added a pathfinding solution by now
How do I enable royal economy shops? Whenever i click on the npc it says that shop is disabled, should I make changes in permission to open?
Someone about 6 months back did a huge thread on pathfinding
Ohk
I've had many instances where I've almost made a multi-module project, but then I don't
please help me i've trying to make my chicken attack me for 2 days π
i just need to add a "generic.attack_damage" attribute to it but i can't
https://paste.md-5.net/huduwaqeqa.pl
https://paste.md-5.net/iqidudobax.java
first is server crash stacktrace (tl;dr: attribute not found, so the pathfinder goal for attacking me crashed the server)
depressingly the hard part about this for me is just getting minecraft to move the entity, I've already implemented pathfinding a few times in a few different game engines, that's the easy part
I would use Pathfinder Goals
via 'registerGoals'
and use AttackEntityGoal
how would that help in adding an attribute
also according to screaming sandals it seems like attackentitygoal isn't in 1.16.5
Why are you using unmapped
also 1.16.5
I wonder if I can do something with this
EntityInsentient.p().a(GenericAttributes.ATTACK_DAMAGE, damage).a()
(found via EntityMonster)
doesnt exist
what about registergoals?
i have this code snippet that always says "no modifier"
which means that i fail to add the attribute
??
no it wouldnt crash
what about it
or throw an error idc
why dont you use it
yes and it does throw an error
because if it works don't touch it
yeah it throws an error when a chicken tries to attack me
so it works?
not when the chicken spawns
which is when i add the attribute
in general yeah, the chicken does try to attack me so the pathfinder goal is added perfectly fine
N O
the attribute ATTACK_DAMAGE by default is not on a chicken
and without it, the chicken can't attack
so i need to add that attribute to my chicken
you could just write code that checks for when a chicken is in a 1 block radius of you, it attacks you
I'm looking at the 1.19.2 Mojmapped code. Things shouldn't have changed too much. You cannot add the attribute like you're doing. You need to modify the supplier
bruh what the fuck
i mean like not the actual chicken just deal damage upon yourself
just a suggestion
according to this thread https://www.spigotmc.org/threads/nms-add-attack_damage-attribute-to-a-mob-that-doesnt-have-the-attribute.586397/ you can indeed add an attribute?
and what supplier exactly would i need to modify
yeah that's a super scuffed approach
yea
Well that's using the paper api
also, this snippet of code:
EntityInsentient.p().a(GenericAttributes.ATTACK_DAMAGE, damage).a();
this is "sort of" what EntityZOmbie uses to add an attribute
oh
hm alright i guess
Don't forget to change the craftAttributes too
so, if I get this right:
- i get the original attrs map
- i add my attack_damage attr
- i put the attr map back in with reflection
is it?
How compatible to you want to be with other plugins?
acceptably compatible idk honestly
(that are trying to modify the same thing)
i'm doing a commission so i have no idea
bro is running catserver so things are gonna fail sooner or later
oh no
yeah so far i told him that i don't guarantee that i'll get nms working
because i explicitly mention that i don't do nms in my comms details
so i'm just curious as to how far i can get
and maybe succeed
Hurr hurr post on spigotmc using paper api
wait
AttributeMapBase has an AttributeProvider field
EntityInsentient.p().a(GenericAttributes.ATTACK_DAMAGE, damage).a()
this returns an AttributeProvider
what if i mightily replace it
wait ur not on remapped?
nah 1.16.5 + i don't care enough atm
just tell me remapped and i'll take a look at screaming sandals lol
dont remember how to use acutal NMS lol
well like i said i used remapped
so not as big as you imagine
since yknow
methods have names
unlike native code
i normally use remapped π
but i just didn't care at first and now i don't care enough
AttributeSupplier supplier = Chicken.createAttributes()
.add(Attributes.ATTACK_DAMAGE)
.build();
AttributeMap attributeMap = new AttributeMap(supplier);
CraftAttributeMap craftAttributeMap = new CraftAttributeMap(attributeMap);
// Use reflection to inject them
^ This is untested and using mojmaps
hey there
oh thanks Olivo, I'll try it now
but i was also gonna try this:
try {
final AttributeProvider provider = EntityInsentient.p().a(GenericAttributes.ATTACK_DAMAGE, damage).a();
final Field field = AttributeMapBase.class.getDeclaredField("d");
field.setAccessible(true);
field.set(this.getAttributeMap(), provider);
} catch (final Exception ex) {
ex.printStackTrace();
}
whats the 1.8-1.12 line limits for scoreboards?
yeah
i mean
16 i think
nms exists in all versions
its just becoming increasingly more difficult to use the older it is
Any simple way for doing a cooldown before getting teleported?
no no
scheduler?
wait
I mean wait some time before doing x
a map<UUID, Integer>
A delay mainly
uuid long
value is seconds before it's accessible again
no no that no
int cant contain timestamps
or you can make Long and make it ticks
Im doing a teleport, so before teleporting i need to display:
Teleporting in 5 seconds
teleporting in 4 seconds
...
...
Etc
ah
So mainly a delayed schedule?
make a loop
well just get an int and decrease it until it's 0
exactly
Hmn
basically the following
you have 2 schedulers
one to teleport
one to send the message
the teleport scheduler will be ran in X seconds
and the sender will be ran every second
but when the int reaches 0, the sender stops
right ik, i having problems with the logic
one task
bro make a loop that loops 5 times
then just put a sleep(1) and then ur message
no sleep
Yes
is my browser logging or isn't CraftAttributeMap not a thing?
in mojang
Dont minecraft work on 1 thread, so sleep will make the whole server to stop π€
the fuck
?scheduling
Btw, what I am curious about. Let's say I somehow got a decompiled source code of let's say Minecraft 1.2.5 server. What if I take and re-implement the everything by myself using that source code as the reference. And by "re-implement" I mean not modifying the existing thing, but making my own thing from scratch. Does this still count as copyright infringement?
I know
Just having troubles with the logic
i was talkkng to sainte
probably consult mfnalex for legal advice
This is a hypothetical question, I am not going to do this
Just want to get the logic explained
Is he a lawyer or smth?
Yes, smth like that
Oh wow, that's actually cool
repeating timerjava int loop 5; @Override run() { sendMessage... loop--; if (loop == 0) { teleport; this.cancel; } }
right, but what about if i have many players?
Will the task get re executed?
one task per player
as they won;t run at the same time
unless it's a countdown for all players, then use a Set of the players UUIDs
@chrome beacon thanks for your help, i'm going to be trying this now
final AttributeProvider provider = EntityChicken.eK().a(GenericAttributes.ATTACK_DAMAGE, damage).a();
final AttributeMapBase base = new AttributeMapBase(provider);
final CraftAttributeMap map = new CraftAttributeMap(base);
try {
final Field attributeMapField = EntityLiving.class.getDeclaredField("attributeMap");
final Field craftAttributeMapField = EntityLiving.class.getDeclaredField("craftAttributes");
attributeMapField.setAccessible(true);
attributeMapField.set(this, base);
craftAttributeMapField.setAccessible(true);
craftAttributeMapField.set(this, map);
} catch (final Exception ex) {
ex.printStackTrace();
}
OH MY GOD
yes modifier
moment of truth
does the turkey deal damage now
i'd like to thank my parents, friends and everyone who supported me
and especially olivo
a life saver
i owe you my firstborn
yup
kk
lol thats sick
yeah haha
gotta now apply it to them
shouldn't be hard
i don't wanna eat my words
what type of commission is this lmao
well
yo modules are whack
the main part is that mobs now have customizable health, and after they die, they rotate 180 degrees instead of dying
one can them click them multiple times
every time they drop something
after a select amount of drops the mob dies
but also a part of the commission is that these mobs now attack the player
why would anyone ever need that
well i have no fucking clue
lol
what do u need json for
yay nms 
i really thought that writing a custom json deserializer was the hardest part of this project
silly me
libraries take care of that for you
etc
yeah no i wasn't writing an entire json library
i was writing a gson deserializer from the file to my class
well this project is quite fun
apart from the times when i wanted to rip my shirt apart
i need ideas for a project
lol
code a socket
a socket for what
an irl socket
yeah
sticking your finger in and getting electrocuted
like a server socket
is there really no way i can make a completely raw custom socket
and pass that through copper wire
make the electrocution power configurable through a .properties file
Make a server socket that charges the sender $0.50 per message then pitch it to Apple
why not make the price exponentially increasing

Why NMS? Why dont just code on none legacy versions
Legacy versions resources should be removed so then you oblise and encourage them to use latest versions
Cuz if servers doesnt add the ability for something its because its hasa reason if not they would allow to do everything
oh so non-legacy versions have a non-nms way to add custom pathfinder goals to entities?
Legacy src must be cleaned and so people just use latest versions
answer the question
?paste
I mean i dont understand what you mean, but just dont mess with legacy versions and stick to 1.19
Thats the way for going
i already code for latest versions normally
but this commission is kinda out of this world
it's not just 1.16.5
bro is running catsevrer
so it's probably gonna die sooner or later
who still runs catserver
like 2 pepople
whats sponge?
i have no idea
i never heard about those weird things
i thought you'd noticed that this commission is very weird
why ask questions
just go with the flow xd
yeah
maybe i should make a core
Oh no please, if us dev cotinues making legacy coding, they wont stop using them
π
So we must encourage ppl to use latest versions and dont use harcoded legacy versions
legacy >>
Not for devs, they just lost their time cuz of shity api
Also latest versions have better api implementations
ok but i dont like the latest version
You must code on it
i still hard code shit wdym modern code isnt hardcoded
nO
*new
Spigot doesnt give support on legacy versions, because they are already out of they hand
so? wtf
That why i have try to explain md5 plenty of times to delete the the legacy sources, so then people is encourage to use 1.19. If not the wheel of using legacy versions wont stop
π€
md5 is not the authority on minecraft, if spigot decides to take down old code just because people will just stop using the service
They should, because legacy versions only cause issues. That why they are deprecated
elaborate
legacy versions are stable and some software only works for that one version. People are allowed to choose which version they want to use
tf
+1
have you heard about opinions
or have you only heard about opinion
like singular and plural
Now I'm with the translator, what I'm trying to say is that if you keep supporting legacy versions people will keep using them and that will never stop. The reason for removing legacy sources is to force people to use the new versions. Since they are the functional ones, they are up to date and open to suggestions.
why does it pain you that people use legacy versions
code for your 1.19 and be happy and dandy
and whats the problem
with legacy
if I run a server that is 1.12 because there's a minigame that only existed for 1.12 I am not going to update because you forced me to update, I'm going to another server that allows me to download the version that will work for the software I want to use
yep
wdym support?
Anyway, I see that you are not understanding my point of view. So I'm going to continue in class. Because I will only waste time arguing. Besides it obviously makes too much sense to only use recent versions.
it really doesnt
you'd be a great politician
some people want to use old combat in games such as skywars etc
honestly i never play 1.19
Deleting legacy source sounds pretty dumb indeed
well fuck those people and go make your own fork with new apis?
Why? So then people must use new api functionalaty ΒΏ? New api versions have better things
bro why does it matter to you
not everyone wants better things
let people choose
like wtf is ur argument rn
Because thats causing 1.19 comissions global market going down, and we dev ends losting money
It is not possible to waste your time looking for solutions to problems for legacy versions and get paid a lot of money on top of that. When in 1.19 they wouldn't have that kind of problems, because the apis are correctly designed.
this has to be the stupidest take I have ever seen on anything
so we have to get rid of software that works for older versions so you can make money selling updates?
idk what u mean by this but even if hes gonna remove 1.8 spigot or whatever u mean there will be other people who make it
It is not possible to waste your time looking for solutions to problems for legacy versions and get paid a lot of money on top of that.
i'm currently working on an expensive 1.16.5 commission
bukkit will always exist
according to you 1.16.5 is legacy
exactly
Legacy is up to 1.16, 1.16+ are newer
you said this implying that 1.16.5 is legacy lmao
otherwise why the fuck did you say that
tell me
YOu never mention u where on 1.16 π
major coder beef
so why did you even mention legacy
1.16 is still legacy
did you just assume i was coding in legacy because i was using unmapped
what the fuck
yeah but that's not the main point rn
this is
and this
The point is that legacy versions are a mess and they should be taken out of market. So we latest versions get paid the money they should
what the actual fuck
bro what the fuck
what is ur argument
we should kill old people so youngsters have more bus seats
And no getting paind less with the excusa that legacy versions are difficult to work and they get paid more by that excuse
old people are harder to look after, too
ur argument is like "they should delete other games so us minecraft devs can make more money"
You don't force anything with that
You just force people to get 1.8 from other sources
watching people discussing is always interesting
Sources that aren't as reliable
exactly
i dedicate at least 40 minutes a week specifically to argue with strangers on the internet
wasted time
Does running 1.8 make sense ? Fuck no, the software has not been maintained for eternity and is riddled with bugs
and after coding in nms for 6 hours i need to put my anger somewhere
That why, so them they will see thats 1.8 is not the way, and they will move to 1.19
π€
because game mechanics
That makes 0 sense
You are talking about a userbase that actively uses unmaintained software
i still play in 1.8 and code in 1.19
what's your argument
this is me
They don't give a shit about where and how reliable the server is
Else they would be using maintained software e
Imo we could have just let them die with log4j2
Or well it's exploit
the only sense in going with 1.8 is if you wanted a minimal code base in comparison to right now for some kind of custom fork or something
thats what im saying
start up times are meaningless
that's an example
1.19 takes 2 seconds on my laptop (using spigot)
regardless of server other then mc, start up times are meaningless
the hell
M2 zoom
starting up faster doesn't yield any benefits
i'm just generally talking about legacy software and hardware requirements
it does for development purposes
used minecraft as an example
+1
then disable stuff you are not using
Or hot reload...
you can't hot reload everything
but my point still stands π
jetbrains runtime gets very far
and sometimes you can't even hot reload things you should be able to
Far enough for the repeated tweaking you do during development
Use a hot reload focused runtime then
but, yeah in terms of server development, some people in the mc community are kind of spoiled between what some of the community provides and mojang though especially if you have a complain of how slow the server starts up and its not even past the 1 minute mark lmao
4.2 seconds when running anno 1800 in the background
i
'll buy your laptop
30$
it's a great deal
https://paste.md-5.net/ucavazifuh.cs this read() method intercepts every packet even with the generics. Is there a way to only intercept one packet without hardcoding the <PacketPlayIn...> ?
it would make sense to code towards that one packet
if all you wanted was that one packet
using generics goes in the opposite direction of that
im tryna make multiple classes that listen to different packets
and dont want to copy paste this method but i can if i really need to
then make a method where you can supply the packet you are wanting?
why not
the quick answer to that is that I have no idea of how to use modules correctly
I need something that will allow me to use mappings and also reobfuscate them per module
take a look at this: https://github.com/JEFF-Media-GbR/JeffLib
the "core" module defines an interface AbstractNMSHandler.
the "spigot-1.19.X" modules implement that.
"core" also has a method to create the matching implementation through reflection.
the "dist" module then depends on core and each implementaiton and shades it into one jar
imagine needing a dist module
it's not needed but this way you don't have to add all the specific versions to your pom
i should port jefflib to gradle
alex will kill you
good luck
can you even do that in gradle
yes
I should make a maven plugin out of jefflib
i do it
it only takes 3 weeks
i could do it in a few hours now
oh i thought you were hard against gradle lol
I thought you couldn't even run the mappings on gradle
text wall
then do it pls
paperweight
?paste
christ
but thats effort
this is just a nightmare
please either create a discord thread or upload your code to the paste
sorry
I see they like making things null
So me
yea
so then, who was the first π€
he owns minetweaks :kekw:
How can I add custom goals to my Entity class. I want it to fight for and follow the player. This is my entity class
https://paste.md-5.net/pujebekeni.java
I also already have a Goal class but I couldn't find anything on Goals in nms in 1.19
https://paste.md-5.net/icacalefir.java
yea performance is a big thing in 1.19
humans are not supposed to be doing this, we are supposed to be supposed to be picking up a big wheelbarrow like full of logs and building a house
by adding it to the goalSelector field
public class MyChicken extends Chicken {
public MyChicken(Level world) {
super(EntityType.CHICKEN, world);
goalSelector.addGoal(0, new MyGoal(...));
}
}
To conclude it does not seem right to me that a simple developer of 1.8, this charged more than a programmer 1.19. When the api of 1.19 is much more complete and more possibilities. So it is almost impossible to earn less in 1.19 on the contrary. They would have to earn much more
fire
I can't acces the goalSelector field in my class
I don't understand your complaint here
so because the tools are better and because the documentation is better and the work is easier people doing commission work for 1.19 should be making more money is your new point?
that is what you got from that? lol
why not?
yeah so a 1.8 should charge more because they have to work with that abomination of an api
on the other hand 1.19 has a shit ton more possibilities
thus opening the room for more comms maybe
dude what the fuck are you trying to prove
is it not what you did?
I don't think the LivingEntity class has that field, bc it doesn't seem to be there
no
then extend Mob
LivingEntity has no pathfinding
ok so?
what I got is they are complaining that devs for 1.19 get paid less or something then those for 1.8?
why does it bother u
ah, ok. Thank you
I mean that's part of what I said
but their typing makes it hard to determine
Exactly that
then get better
so I was right then
because they market better then you do
because you have to pay for people to wrangle with a shitty legacy api
which a lot of people are not willing to put up with
becase the api is so shitty, coding for it is harder. also nobody wants to mess with this shitty API, so less developers, so more money for them
and there is that, but really it just comes down to just doing business better. A developer for a recent version can make just as much if not more then a dev for 1.8
but the opposite is true too
it's almost like asking someone to do something harder to do costs more money than asking someone to do something easy to do
But that's server problems, they shouldnt be using legacy
really it just comes down to the developer knowing business
it's like I'm arguing with a toddler so I'm just going to stop
they can use whatever they want if they are the ones footing the bill
That's right, but why spigot doesn't support 1.8 anymore?
because it doesn't have to
spigot doesn't have an army of developers to maintain all the various versions and variants of code
why would spigot support ANYTHING that's not the latest version? o0
imagine doing apt-get upgrade then being upset that it uses the latest version from the repo, instead of an 9 year old version lol
lol
Right, but people doesn't have too, they should always stick to newer Versions. Is the same using oAuth 1.0 and complaining to Google that the versiΓ³n 1.0 has issues, while latest Is 2.0
verano is single-handedly lowering the room IQ down into the single digits
π€
the person who runs spigot, it is their choice in how spigot does stuff
not sure if that makes sense or not
literally if md_5 decided he wanted to start supporting old versions, that would be the thing with spigot from then on
its no different then other people who run servers choosing to use what they want because it is them that foots the bill
your map is not a Map<Object, ?> but a Map<Something, ?>
I am still unsure what exactly is your point or what is your argument other then you being upset that 1.8 developers get paid more
jefflib hurts
and key is not Something
So you are not being clarify at all, so far spigot comm wants to support 1.19 only, but they don want to remove legacy sources. So that doesnt make Sense at all. Cruz ppl Will Co tinues using legacy versions
If spigot removes them people will still get them
Better to provide an official source
legacy sources exist because it is part of the git history
Oh ok
if you wanted spigot 1.6 you can still get it
have you never heard of buildtools? o0
buildtools won't build 1.6 spigot π
however you can do it yourself since you have the entire git history
Guys just stop, there is nothing to understand. Verano is just mad because other people are making more money than him and he thinks it's unfair because they are doing support for legacy versions when spigot does not, so he can't get the help he would need to figure out how to do these services. His solution is to just remove old versions, because if he can't make money programming for them, then they just shouldn't exist. There is no deeper meaning or discussion here, it's been ongoing for the last hour at this point.
literally anyone who uses buildtools everyone has the entire history
yall are making money?
of course
dolla dolla
Lol rude, no need tho
yes, but is it inaccurate?
its not rude when that seems to be the truth
if your opinion sounds rude when read back to you then maybe you have a problem, not me
I just wondering yo get a real explanaciΓ³n of why sources are there, but they dont want to sipport them?
That's my question
I just having some english issues
because there is no reason to remove them, and because people depend on them and will find them elsewhere if spigot takes them down
sources are there because you are allowed to use them, just because spigot stopped providing support doesn't mean sources need to disappear too. This would literally be counter intuitive to open source philosophy
wdym?
Oh ok i understand the reason with tour text frost
however when you decide to use old code, its is up to you to handle any problems you encounter, spigot won't provide the support if you do. That is the only catch
Okay that's what i was wondering yo Heard
Just the reason of why they dont support them
Thanks to all, and sorry for being so ashole
imagine someone comes to you and is angry because there's a bug in version beta 1.3 of your software. Would you now fix the bug in version beta 1.3 that's 15 years old, or would you tell them "it has been fixed in version 1.6 10 years ago"?
and if they were smart enough, and it was open source
they could back port the code themselves
I would tell to sitck to newer Versions, because legacy are deprecated. If not it Will work on that versiΓ³n
I dropped my last brain cell help
I warned about this very moment a while ago
we're going to have to create a containment zone to stop this intellectual disaster from spreading
public final void toggle() {
if (toggled){
enable();
} else {
disable();
}
}``` it feels wrong
the way you're supposed to structure packages inside of modules is eluding me
so each module gets its own package directory, and the core also gets its own package directory, and you also make the pom that handles all of the modules and that pom is at the top level of packages? Does it still need a package because I seem to be having a hard time linking the modules together when it doesn't
what do you even mean by module
id rather call it a feature
parent pom: doesn't really do anything
core pom: declares the interface that the nms modules implement
dist pom: has core and all the nms modules as dependency and shades them into one jar
is that what you mean?
it fixes some overlappings so thank
Everyone has forgotten the worst kept secret reason for keeping sources open.
One day you might have a catastrophic failure built upon a bad decision made many many moons ago.
Always good to have the safety net of the old code if god forbid that happens
Doesn't need to be open source for that
when github get suspended cause you gave kids a ram eater π
No but encouraging even a tiny community to bodge job with your old source code ain't a bad problem to have if u do ever have to 20 billion steps backwards π
how do i do the thing where i can send different strings based on a boolean?
in onCommand, what is contained in the label?
if (boolean) {
sendMessage(1);
} else {
sendMessage(2);
}
Or
no there was another way
String message = boolean ? "a" : "b"
ternary operator
Ternary
I'll tern your ary
/blabla asd -> label is "blabla"
thanks
so what i need is args[0] i guess
It's whatever alias is used basically
public class FeatureManager {
private static List<Feature> features = new ArrayList<>();
static {
Feature fly = new FlyFeature();
features.add(fly);
KeyBindManager.initKeyBind(fly);
}
public static List<Feature> getFeatures() {
return features;
}
}``` good feature manager?
or bad very naughty
i heard not use static if you create object or something
but i forgor
you shouldnt make the manager static like this I think
it will limit your options
if you really want only 1 instance of it, just create it in your plugin class and create a getter for it
but if for some cursed reason you need multiple feature managers you cant make it static
in https://github.com/JEFF-Media-GbR/JeffLib/blob/master/pom.xml that pom.xml file is in the jefflib package but the way it is referred to in other poms is through com.jeff_media so my question really is do I need to put the parent pom in a specific package setup?
i am not sure what you mean with "package"
groupid
i use the same groupid for all modules
but it doesn't matter what you use as groupid and artifactid, as long as you use the same thing in your modules to declare the parent
just be a gamer and don't use java
Just ternary everything
I keep getting these pom.xml files to tell me that they are referencing themselves or trying to get the parent from remote instead of getting it from the one that is meant to be managing the modules
sureeee
MyLib-parent:
groupId: me.username
artifact: mylib-parent
dependencies: none
packaging: pom
MyLib-dist (or just MyLib):
groupId: me.username
artifact: mylib-dist (or just mylib)
parent:
groupId: me.username
artifactId: mylib-parent
dependencies:
me.username.mylib-core (compile)
me.username.mylib-1.19.4 (compile)
me.username.mylib.1.19.3 etc...
plugins: maven-shade
MyLib-core:
groupId: me.username
artifact: mylib-core
parent: same as above
dependencies: spigot-api
MyLib-1.19.4:
groupId: me.username
artifact: mylib-1.19.4
pΓΌarent: same as above
depencencies: core, spigot
plugins: specialsource (for remapping)
nah that causes problems
1.19.2 and 1.19.3 have different mappings but the same package R1 version thing
for example
or was it 1.19.1 and 1.19.2? whatever
How can I cast Block into Switch?
1.19.3 is R2
what is a switch?
damn convention
and 1.19.4 is too, yet different mappings
something you can switch on and off
1.19.4 is R3
It's the subclass, which is just a lever in minecraft
i checked it
cast blockdata
ok then it was 1.19.1 and 1.19.2
both have R1
yet the mappings are different
that's why just using the R1, R2 thing is not reliable
they are the same in 99% of cases, but not 100%
I was told .1 is R1, .2 and .3 are R2, and .4 is R4
talking about this deprecated stuff?
both 1.19.1 and 1.19.2 are R1
Deprecated? More like "really awesome to use"
what even is a "switch type block"
Levers
why doesn't it just use BlockFaces, like ItemFrames do
Uhh
Why is a lever
When pulled one way
A Material.LEVER
And the other way it just simply isn't
When you pull a lever down, and check if it is of Material.LEVER, it isn't
But when pulled up (off) it is Material.LEVER
what is it when it's pulled down?
Item frames are entities
Previously levers were able to be placed on ceilings, walls, and floors. Buttons could not be. They were only placeable on walls
So the Switch.Face property was for levers exclusively
Idk
print it out
on
If you're using < 1.13, they were different blocks types iirc
did anything big change in 1.13? Materials were added a looong time prior
Everything was flattened. It's when byte data was removed
Uhh
yeah but the byte shit was deprecated since at least 1.9
I have no fucking clue
Or, more accurately, hidden by implementation
Hey,
Has anyone any Idea on how to let players enchant an item multiple times in an enchanting table?
Bukkit deprecated it because they were magic numbers
It is of lever
Its replacement in Bukkit was an abstraction layer, MaterialData
But I guess it doesn't want to be a lever when checking it on one way
Lmao
It is a lever both ways, but only on way way does it want to be a lever in an if statement
which wraps magic numbers 
Yeah behind some more sane API
It just was never complete lol
You can!
With Fabric or Forge!
Can we fix server side ones
if you want to fix bugs, use minestom
Why is the BaseComponent[] not appearing correctly?
Code: https://paste.md-5.net/nejolavehi.java
Output:
lookin good
Because the chat event doesn't support components
because the + operator calls toString
and how can I fix that?
TextCOmponent.toLegacyText turns a BaseComponent[]into a string, but not sure if that'd work with click events and such
yeah sure, what else would it do
to properlly turn an array into a string, you'd use Arrays.toString
but then I get the component in json
to properly print out an array normally, one would use Arrays.toString(), e.g.
public class Test {
private static class MyClass {
private final String name;
private MyClass(String name) {
this.name = name;
}
@Override
public String toString() {
return "MyClass{" +
"name='" + name + '\'' +
'}';
}
}
public static void main(String[] args) {
MyClass[] myClasses = new MyClass[] {
new MyClass("a"),
new MyClass("b")
};
System.out.println("" + myClasses);
System.out.println("" + Arrays.toString(myClasses));
}
}
first sout prints [LTest$MyClass;@7229724f, second one prints [MyClass{name='a'}, MyClass{name='b'}]
no, I just wrote that
if you really need to use components, the easiest way is probably to cancel the chat event, then loop over all players and send it through Player.Spigot#sendMessage(ChatMessageType, UUID, BaseComponent...)
Pretty much the only way
Im using this load function before joining in players into the game, yet they get stuck on loading screen, any clues why?
the UUID is the UUID of the sender of that message
calls String.valueOf π
and that calls toString
im unloading those worlds btw
when I generate them, bcs they we're taking like 90% of my CPU.
I have 87 of them at once, so it isn't very perfomance effective
ill teach ir rawrr
but now it sticks to 7%, just players can't load the world
lags the crap of other players
thats why I pool those worlds at boot
thats why im instantly unloading them and loading them as I need them
thats what im trying to do
just players can't join into them.
Even tho it says the world has been loaded
yep
just after I tried to join the world, tp'd myself back via console
not when joining
I'm probably setting players gamemodes tho
lemme check
nope i'm not
but even with creative, nothing changes
and ik that its safe to tp there
worked before I tried to spare that CPU
no that's not working, do you have any other ideas?
^
Ok thank you i'll try that
How?
It does the same if I use ```java
// Set Format
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
onlinePlayer.sendMessage(player.getName() + ChatColor.GRAY + " Β» " + ChatColor.RESET + message);
}
Player.Spigot#sendMessage
why didnt you use the method I mentioned?
more context
for example, this is ambiguous and won't compile:
public class MyClass {
public void doSomething(String string) {
System.out.println("Simple parameter");
}
public void doSomething(String... strings) {
System.out.println("varargs parameter");
}
public static void main(String[] args) {
new MyClass().doSomething(null);
}
}
does the main method call the varargs, or simple parameter method? nobody knows
Because varargs can take a single string
java isn't kotlin, you need to clarify it
And so can the other method
because it could be a boolean array I guess
someone might do update("someString", true, true, true, true)
is this now the String, Object... method, or the String, boolean, Object method?
lol, this is part of the reason why Object varargs are sketchy
the moment you pass in a byte array where it expected an object varargs go brr
It's to do with reifiable types and heap pollution. Compiler just wants to make sure devs are being safe lol
It's a fancy SuppressWarnings for generic varargs
yeah but I don't understand what heap pollution is supposed to be lol
That's mildly concerning
well any warning that makes sense
you suppress all warnings that make sense?
howis this always false? I annotated T[]with NotNull, not the array contents
you already threw an exception if the length is 0
yeah but t[0] might be 0
T @NotNull [] t I think
I could do this
public static void main(String[] args) {
new Test<String>().doSomething(new String[] { null});
}
cmon dont code like that
but that is exactly what I don't want
I want to allow null elements, I just don't want to allow passing null as the whole array
the @NotNull would apply to the array in this case
(@NotNull T @NotNull [] t) :(
that is the opposite of what I want
Cursed
shouldnt tell me
basically I want to do this: tell java that
new Test<String>().doSomething(new String[] { null});is ALLOWED, butnew Test<String>().doSomething(null);is NOT ALLOWED
actually I don't need it, I'm just bored and tried whether it's possible
which annotation is that? jetbrains?
jetbrains, but I suppose any NotNull annotation will work
weird that it works like this, I would assume the "Object" is to be annotated with NotNull instead of the [] thing
on the other hand, it makes sense, as the [] ARRAY is NotNull so that's where the annotaiton belongs to
so yeah this is what I was looking for:
public T doSomething(@Nullable T @NotNull [] t) {
Nulalble refers to the elements, NotNull refers to the array itself
I would have thought it must be the other way around, but thinking about that [] is the array itself, it makes sense
yeah it's weird, the first @Nullable applies to both the array component and the method parameter
man I sort of regret starting this
wait can a config have something like this
sound:
group: "e"
soundid:"e"
That is because jetbrains did a serious blunder when drafting the annotations api
How noone fixed that blunder is beyond me
Heck, even eclipse knows better
no
ok
Hm, I might want to use eclipse's annots in the future.
ik that
do you guys use gpg keys on github?
somehow i need to enter a key while i only configured it for my other gh acc lol
I only use gpg on macOS
i picked a 78 char key and it looks like it doesnt accept it
I used to - but not anymore!
im kinda fucked then
These days SSH keys are used for signing (at least for me)
is there actually any benefit in signing commits, given that you need write permission on github anyway?
ig im better with just removing that key cuz entering 78 characters every time goes brr
not like i can remember it so i gotta save it somewhere
Well it is an unofficial third factor that it is actually you committing changes
yeah sure, but I meant for repos that I own myself, anyway
I guess it's pretty useless then
But honestly it is a marginal difference outside of the verified badge
hmmh
ordinarily gpg should remember the key
Or at least git will. Did you complete the setup of the key?
Unless you say that the passphrase is 78 chars long at which point I just have to shake my head
uhh not sure what completing the setup would mean
ig so
removed that key anyways, copying it every time doesnt really improve security β’οΈ
Though I must say if you are on windows you might get mixed results
i managed to set it up easily
its not about that
Hm. I think I had a similar case back then
But ever since openssh is used for entering teh passphrase it remembers the key
before there used to be something different that required me to copy the key as you mentioned. That is if my memory serves me right: That should be over two years ago
alr
It's been ages since I all set it up^^
is there a big difference between gpg and ssh keys anyways?
SSH are far more useful
Are there any examples for defining what a config should have with a class?
Not sure if YAML or Spigot have anything built in for it or if I'd need to do it another way
They allow SSH access and also allow to sign commits since Fall 2022
GPG is only really useful for sending signed or encrypted messages in a well-accepted manner
"what a config should have with a class"?
Defining what should be in a yaml file
With an annotation or something instead of the mess that Spigot has for plugin yamls
so if I'm doing a multimodule project for NMS I use reflections to select which module will be used, correct?
Ordinarily yes
not really required
I guess I'm sort of looking for the best approach here, or at least the one I'm likely to regret doing the least
Not truely but reflection is the easiest way to find the NMS version currently used
public class NMSManager {
private static final String PACKAGE = "me.jishuna.blueprints.nms.";
private static NMSAdapter adapter;
public static void initAdapater(Plugin plugin) {
String version = getServerVersion();
try {
adapter = (NMSAdapter) Class.forName(PACKAGE + version + ".NMSAdapter").getDeclaredConstructor()
.newInstance();
plugin.getLogger().log(Level.INFO, "Supported server version detected: {0}", version);
} catch (ReflectiveOperationException e) {
plugin.getLogger().log(Level.SEVERE, "Server version \"{0}\" is unsupported! Please check for updates!",
version);
Bukkit.getPluginManager().disablePlugin(plugin);
}
}
public static NMSAdapter getAdapter() {
return adapter;
}
private static String getServerVersion() {
return Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
}
}```
Tis what I use atm
ah a fellow blueprint package enjoyer
imagine needing to init it
Hi, im pretty new to spigot programming anyone have some idea's for plugins i can code to get practise?
Small questing plugin is what I started out with
like a gui with quests??
that smells advanced lol
Nah, all done passively
so the adapter in this case acts like some sort of master class from which you will in some way access methods?
Yeah quests are usually quite dynamic
I'm talking about like really small
interface
i probably did a homes plugin
with all the methods that require nms
what kind of quests?
And the quests were global and there is only a single quest at the same time
my first plugin was implementing the just cause 2/3 flying system in mc
Hi, I'm trying to use classes from one of my plugins in another one. Do I have to make a maven dependency or can I achieve it without it as I have it as a local jar (I've already set the plugin as a plugin dependency)
can probably use jitpack to pull from github, local jar would probably work too
Basically the entire server had to contribute towards working a certain goal (at the start it was just donating wheat) and then those that contributed got a reward
thats a very good idea.. thx
You can expand the idea of server-wise collaboration pretty far.
unfortunately that idea didn't grew popular for whatever reason
Heck, none of my plugin ideas gained any traction
well im not planning to release it anyways just for practise
marxism intensifies
how do you define popular
Used on more than 10 servers
(To be fair the cause of it failing to gain traction is due to me mandating paper - which meant that it was literally unfindable unless you knew the repository of the plugin)
that really is not a very high bar lol
I was going to say I think I could make that same plugin concept get 1k downloads in under a month
that calls himself bri'ish
i have 33 concurrent people so that counts to something
I mean I have a plugin with 45k combined downloads accumulated over 2.5 years ... but it is a fork of another plugin
name it
I think Iβve hit near 100 servers when 1.18 dropped
Itβs much lower now since most of them have died
Named it plenty of times already: EnchantmentsPlus (which is forked from Zenchantments)
you only had 84 cap according to the top
Close enough
but this sasys you have had 203
I'm sort of idling between 750 to 1k right now
damn thats you?
Yeah
who hurt you
I wonder what plugin has the most active servers
rainbow slam fucking sucks
spiogot probably
essentialsx, wonder no more
Spigot isnβt a plugin
then worldedit
a really fuckin annoying enchant in enchantment plus
Does it make anyone nearby the slam gay?
then vault, protocollib, worldrguard, placeholderapi, mv-core, essentialsxspawn, coreprotect
Also I fail to understand how downloads are made up. devbukkit is only responsible for 1/3 of downloads and still has 2/3 of running installs
no it sends them flying
Lame
I never tweaked the default values of most enchantments after forking the plugin
What does the fork do
You can disable it
no one needs it in the first place
Just regular maintaince.
I.e. making sure it works after 1.15.0, a very large amount of performance fixes, a few exploits being patched and also a few extras here and there (such as colourable lasers)
Laser beamz
Also trident and crossbow support - but I think that change is stuck on the repo unpushed for a good year now
lol
With unpushed I mean unpushed to a release. It's still pushed to the public source repo
oh how do you keep track of where the download comes from
do you just have a field you change per site
Robots in peoples walls
whoa
Yeah I had to be drunk or something while choosing the names of the classes and packages
sounds like me on a friday afternoon
Though to be fair on me I had like 1 1/2 years of experience when doing that change
Well I will NEVER change that
That would be like 20 hours of work at my normal working speed
But https://github.com/Geolykt/EnchantmentsPlus/blob/4xx/src/main/java/de/geolykt/enchantments_plus/Storage.java#L82 is the bigger hack here
I think one of the spigot tutorials shows you both di and a static getter
?scheduling maybe
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
π
look at that snake cas