#help-development
1 messages · Page 475 of 1
Yay, you're one of us now 🙂
idk why i blanked so hard on it
like i was using setItemMeta
The lifesaver is search on the javadocs
yeah tbh the javadocs are to blame sometimes - getItemMeta() doesnt tell you that you need to set it back, iirc
true, but you can often fine everything you need just by using a partial match
Sounds like a free PR to me :p
go for it, then I dont have to do it
I'd only typo it 😛
btw can we all appreciate that I added the comments to the particle class?
I want hugs now
thank you all for the help
oh yeah there's also the ItemFlags class that bugs me so much
i might never be able to repay you in any way
did you get it working?
That's me!
His name Jeff
yes
You mean to tell me you didn't find "Squee'ek uh'k kk'kkkk squeek eee'eek." to be descriptive enough? wtf?
CHoco ban that dude, he used my name

Wait so I was right the entire time 
im using the InventoryPickupItemEvent how do i get the person who picked up the item
get the InventoryView, then get the first viewer
getView(),getViewers(0)
sth like that
Yep
oh
the "normal" event for picking up items is EntityPickupItemEvet
the player evet is dep
Tbf it probably still works but yeah
I wonder if MD will ever implement a policy to remove deprecated stuff after X minecraft versions
I hope he won't, we're not paper
i have a question how can i upgrade my nms project to 1.19.4

spigot is there to be version indepedent
?xy
Asking about your attempted solution rather than your actual problem
what are you trying to do @earnest lark
im trying to see if someone is taking a specified item out of a gui i made
InventoryClickEvent & InventoryDragEvent
then check whether the clicked item is yours
yea
funny thing
PlayerPickupArrowEvent is not dep, but it extends PlayerPickupItemEvent
which is deprecated
It's deprecated by inheritance. There is an EntityPickupArrowEvent
but the javadocs don't tell that it's deprecated
to me, it looks like it's fine to use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerPickupArrowEvent.html
declaration: package: org.bukkit.event.player, class: PlayerPickupArrowEvent
Another free PR :p
someone should PR the Dep annotatio to that too. I would so, but setting up the repo for PR is annoying
let's just hope that @worldly ingot does it

ugh ok I'll do it
I feel bad having so many PRs open
well there's two things I dislike about paper.
1st thing is, they deprecated every string method i spigot. e.g. setDisplyName(String) - they want it to be a component. It kinda makes sense that they want this. But granted that it's a fork of spigot, which they claimed to be compatible with, they cannot remove this method. and if they don't actually wanna remove it, they shouldn't deprecate it imho. a normal @see annotation in the javadocs would be enough
2. sometimes, the add things, which are then later added by spigot, too. For example the AdvancementDisplay class, which they used an enum for (iirc, might be mistaken), then later spigot added it. or the Translatable interface, which I added
you're at a high risk of getting a whereami from a random member of the server
and then they complain about spigot adding it too
like as if they had any right to decide "oooh we added it 2 weeks ago, now upstream adds it too? Ugh" lol
One of my PRs is something I think paper already has
imho paper adds many great things, but they should just fucking contribute upstream. ffs
that's totally fine, if you didnt steal their code
not our problem hehe
True
what did you add @young knoll ?
But still
TNTPrimeEvent
and they already have that?
I believe so
IIRC paper uses their own package for events
Yeah but they’ll have to make sure both events fire
they will probably make one event extend the other
probably their event extends the spigot one
if a pull request dies with no obvious reason, I#d just ping md_5 every day
he also pings me like every third day sooooo I guess he wouldn't worry about a ping lol
So I just remade it, it was for legacy versions anyway
is there a way for a plugin to immediately stop server start up
like if something's wrong
like during load say
prevent all plugins after from loading
system.exit but it's dangerous
it does but I think it lets other plugins load first
Hmm
reminds me that i had a PR from a while ago that i never submitted, but id probably get shunned by paper shills bc they already had it since like 1.16 api apparently
and I don't want to use system.exit because its dangerous
Not sure you can do much else
alright
why should your plugin stop the server?
unfortunate
I'm good at being honest, at least
What’s the use case that if your plugin has an error all plugins must die?
its meant for updating plugins
so I kind of want to stop immediately if a plugin needs an update
its for auto downloading development builds from jenkins
erm sure, many. but it makes no sense
don;t stop the server, download the update into teh update folder. It will be applied at teh next server start
you could e.g. get the Unsafe object, then putAddress(0,0)
yes I know
but my plugin does that and then stops the server
or you just use Bukkit.shutdown() or however it's called
so that the new dev build will be applied immediately
anyway, admins will fucking hate you if you do that
^
its for development servers only
you should NEVER shutdown the server just because your plugin sucks
its not for production servers
until it accidentally gets pushed to prod 
its for developers to auto download the latest dev version of their plugin from jenkins
and a message isn't enough?
its not for my plugins
Make the plugin shutdown the OS
True
"Download latest version, otherwise, maybe, in a future, this plugin will kill your server"
no
I definitely wouldnt update
you misunderstand alex
maybe I did haha
anyway, you can use Bukkit.shutdown() or sth like that
yea that's what im using
just annoying i have to wait for plugins to initialize that are about to immediately shut down
Bukkit.getServer().shutdown()
that inits a "nice" shutdown - so it saves the worlds properly, etc
if you just wanna kill the JVM asap, you can do Unsafe#putAddress(int, int)
my putAddress method is even worse
you are a developer, you have a jenkins server that builds on git commit
unplug the system
my plugin will download the latest jenkins build whenever there's a new one of whatever plugin
so its meant for your own plugin that you're developing
for easier testing
yeah just print a message "Please, dear sys admin, press Ctrl+C" lol
not even
you are the sys admin
its your dev server
its really for my own purposes
because I test my plugins with other people
and I'm literally too lazy to upload it each time
yeah I got it lol, just use this: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Server.html#shutdown()
declaration: package: org.bukkit, interface: Server
aight
Whats your point ? i have seen you sending messages the whole day - hahaha
takes more than 2 seconds
do you people remember "EasyNicks" plugin?
vaguely
which basically added some crypto miner lol
exactly
Yes. what happen to it?
now thats my kind of plugin
#XMR 🚀
from what I know, the author went to jail
??? I'm trying to get assistance with my problems? is it that crazy?
yes
my bad
I think the effort won't pay off if we count the amount of seconds wasted on SFTP vs seconds wasted on coding this, but I gotta respect the hustle
Imagine WorldEdit quietly always using 1% of our GPUs and CPUs
They would be rich rn
don't worry about verano, he's usually quite high when he writes here
i mean
i've already made it
and have been using it
unmake it
lmao
but trying to reduce my seconds even more 😎 😎 😎 😎
"yo, boss, I introduced a major flaw in Log4j back in ..." ~ "JUST UNMAKE IT"
time unwaste
that's how log4j happenede
that's how they fixed it
you know what? fuck you
unmakes your plugin
What did md do
he added fixes to spigot, way back to 1.7
he could have said "no, we only fix latest"
he could have basically give the death sentence to old versions
you are transforming into verano and there's no need to
it does this and then stops the server if enabled in the config
Would be sad
and I have pufferpanel set to auto restart the server on stop
which I expected, because he's also the first one here to complain about "why don#t you just use latest"
1.12.2 modded gameplay still 10000% the best
so i just git commit and then /stop and wait
1.8 pvp still on top
but that has nothing to do with spigot
I love me some new features and better API don't get me wrong
It has, since less spigot 1.12.2 users -> less 1.12.2 modded users
Is it still alive
-> less content for me
I usually answer to people who at least use 1.16+. but I guess md did it to stop people using even more obscure forks who claim to be "spigot 1.8.8 but with log4j fixed"
?
I mean i wasnt trying to being rude, just wondering to get a why, because i didnt understand what he was asking for help
Pufferpanel
?
um no they have a discord
and they'll reply
but they don't really update it
it works well enough for me though
does puffer use docker too btw? and is it "mc only", or other games too?
docker optional
I trough that project evolved into pterodactyl lol
other games too
thx
no its kinda separate
pterodactyl was meant for big production stuff
oh lol, only for the reason of the auto miner?
So if u guys someday make a mc mod, make it 1.12.2. It is forever going to be the best modded version
good night @icy beacon
pufferpanel meant for small servers and stuff you just use for yourself
I hope you dream about horses
like not hosting
I will
false
create is on latest
therefore latest is best
😎 😎 😎 😎
No
im too cool to listen to reason
are you drunk or sth?
- I don't like Create 2. Don't take the only "good" new version content mod instead of 99% of all mods 10x better or more existing on 1.12.2
1.12 is outdated since like, idk. 2018
And its still best for modding
how so? beause you don't understrand the new API?
All those garbage updates all the different mods did...
"best for modding" is always "Latest"
Create is pog mod
Im talking about playing, not developing
1000% cap
1.12 sucks ass, and not in the good way that I can talk about as a gay person
And all those good mods not existing on latest
1.12 is so outdated, it doesnt even have turtles
Not for modded gameplay
who tf wants to play MC without turtles
It has turtles with mods
everyone wants to have turtles
Can someone help me with smth? lol
Yes just use a turtle mod then
?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!
Turtle helmet op
wtf no, we just use 1.19.4 and got turtles builtin
why use a turtle mod when you can get the same by installing the latest version? + you get updates
exactly ^
And no im not drunk last time I drank something was saturday :)
10000x better mods on 1.12.2
Latest has plenty of good mods
so you're still drunk from yesterday
Ye, so i wanna make a world edit selection like, something like that, so im creating the hoe for that but idk how to listen when the player is clicking the blocks and stuff, so someone can help me w/that?
Sure some good mods died on old versions
But there are new good mods that don’t exist on those old versions
You need the player interact event
Latest has plenty of good mods, 1.12.2 has literally all of them (not counting create)
listen to PlayerInteractEvent, then check #getItemInHand()
i tried look
i know the code isnt equal but in the moment i made it it was supposed to work.
Drunk coding is the best jking
And also, imo all the mod-updates and new mod-textures suck on latest
everything I ever got paid for was done drunk, so yeah
Wait really? Lol
DO NOT USE ==
ok
- Do not compare strings using == (use equals() instead)
- Do not check your items using lore, name, etc, but use PDC tags instead
== is completely fine for enums
it is, but they use it for the name
pdc?
Yeah but there are also some for enums, those gotta stay
I want to add to this that it's not just Strings, it's generally objects, unless you want to compare by reference
yes, ofc you are right - using == requires people to know what they are doing
Simple rule to keeps things easy
general rule: ALWAYS use equals() or Objects.equals(...) unless you know that you don't need it
gotta give it a try
Strings . equals
Maybe I should start writing my PDC api to finally use pdcs
And still have the vanilla feeling of nbttags
you should really do that. e.g. you can use a custom PDC tag like "my_custom_item:my_awesome_netherite_sword" or sth like that
okay, promised
why do i get like 20 outputs when i get the item
because you loop over the inv, and "like 20" items match that crit
no but i only have one of the items in my inventory
Why is your event handler a static void?
because it doesn't need any instance vars - that's fine
idk man
i never understood static and stuff
i need to learn it
i understand how it works
just not when to use it
your current usage of static is "okay"
however you are comparing itemstacks using ==
you should NEVER do that for itemstacks
Apparently paper is able to better optimize non static event handlers
Idk if that’s true
use equals() instead
how so?
does it complain about that too?
having a static event method is totaly fine
I do wonder why it's always true tho. There's no way they all have the same memory address
I should redo my blog's design lol
yeah I also wondered about that. my guess is somethig simple - they simply did not show their current code
Or the current item is AIR and the inventory is empty
or the GC is very quickly in getting rid of new objects lmao
Could be that they have a single AIR itemstack and reuse it
how are those two different
imagine this:
You got two people. both are called "mfnalex" and both are 28 years old
.equals() is compare by value
== is compare by reference
equals() wiill be true. Because it only checks "name" and "age". However, == will be not true, because it's still 2 different people,. who just by accident have the same name & age
You should ALWAYS use equals(), unless you know why you don't wanna use it
well its technically compare by memory address
yeah
the memory address kinda is the reference
also, yeah
But strictly speaking you are right, yes
let's just stick to saying "use equals()"
and do idetify itemstacks, you should use PDC tags
unless you work with primitives, equals() is right 95% of the time
Depending on the order of comparison you can also call equals with null
tbh, when talking like this, I do understad those kotlin simps
sure, that's what Objects.equals is for
The best part about kotlin is their streams imo.
i dont know anything about that
function types, null safety, coroutines and first ordered higher ordered function
They just added a lot of qol for streams
very nice stuff
all I know about kotlin is how much worse the code looks, how much more "mismaintable" it becomes by adding methods to classes that you didnt declare, and how unpredictable it is by using their fake getter/setter shit
their java interoperability is dog water yes lol
for example?
but its a decent lang otherwise
yeah idk, to me kotlin is like "wannabe java" that gets rid of all the advantages java has, while adding shitty things from other langs that nobody ever asked for
which dym?
like, not knowing what type a var has? java unfortunately adopted that 🥲
or allowing code outside of any class
i think null optional operator would be good
I strongly disagree on that
because?
I am based. I know that objects can be null in java, and primitves can't. this is truly one of those things where I don't have a strong "pro-java" argument about.
However, kotlin also fucked up,. I dont wanna use ?????? everywhere, just because it MIGHT be null
// java
List<String> playerNames = players.stream().map(Player::getName).toList();
// kotlin
val playerNames = players.map{ it.getName() }
i am strongly for that null type semantics in terms of statement and expression operator is better than null semantics in terms of statement and expression
u wouldn't use ? everywhere tho lol
the idea of null safety is "okay" / mediocre at best. it's either a stupid idea, nor was it ever needed imho
u only use it on incoming return values and variables where null may be a possibility
it's one of those things that kotlin "fixed" although it was never broken
null is good
if used correctly
because at some point
a program has to represent absence more or less
99% of programs have to atleast
good luck using a normal java lib in kotlin there, where everything now suddenly is nullable, despite the @Contract annotation
kotlin doesnt fix stuff because stuff is broken
the only real alternative to null would be throwing an exception]
that's not really their aim altho its not an irrelevant factor
that's completely besides the point
exactly, kotlin causes more problems than it solves imho, If the kotlin devs would actually care about improving things, they wouldn't have invented their own weird lang, that doesn't care about types, but rather would just submit their rhoughts (as weird as they may be) to the actual java specs
what problems does it cause?
their aim is to make a language more semantically justifiable for devs
it is not, imho. Java, and kotlin, are both tools that people use to "get the job done". and if "getting the job done" requires using a java lib in kotlin, it's not "completely besides the point" to be afraid about how shitty kotlin is
and java has also denied enhanced null control repeatedly
many java devs years after years have been complaining
yeah but it does the opposite
especially in enterprise
well look at the android industry see where it has gone
java usage is decreasing by time
its besides the point of how u're scared of ? everywhere which is far from true
you'd use other semantics that kotlin provide also
Another good thing about kotlin is the visibility modifier "internal".
No longer forces you to do a tradeoff between visibility and package-structure. Especially useful for libs/apis
im not saying kotlin is the ingenious solution alex
I hate that thing in kotlin for some reason, no package-private
but u cant deny that null is a problem in java, that kotlin has addressed better
that doesn't mean it's good though.
VHS also defeated Video2000, and trump also defeated the other... okay, let's not go into that.
My Point is, just because it "won" in some election doesn't mean it's actually better.
I also don't have any strong reasons to hate on kotlin. it's probably 200581% nicer than PHP. But I grew up with java so I defend java. idk why, but I just dislike kotlin and every "feature" it introduces, I always think "well java can do it too, just in a better way"
so yeah I am biased
technically internal as fabsi said could achieve equivalent
but it decreased because kotlin addressed many of java's weaknesses
Isn't internal module-private?
the industry in programming rarely adopt something because its worse
conclure are you drunk or sth?
ye
yes
no, why ask that?
"the industry" led us to windows / win 32 api and directX
when much better alternatives were available
As someone who uses both java and kotlin on a daily basis (java for personal projects, kotlin at work) I can say that I would swap to kotlin if I was as fluent in kotlin as I am in Java. Sadly 1.5years of kotlin != 8 years of java
fair enough, but still - just because "sth exists" and "has a greater market share", doesn't mean it's any better. I wanna remind that basically 100% of iOS apps are written in C# instead of kotlin (nor java)
mfnalex I just think your argument for "i dont like ? everywhere" is flawed in many aspects
additionally the fact that kotlin fails to enhance or substitute important weaknesses of Java I totally disagree with
mye
vbut yeah I am based against kotlin and their shitty attitude towards java, which is probably why I dislike it so much
Aren't IOS apps swift?
Depeds
well I hate jetbrains marketing
i hate java interop kotlin provides
i hate the fun keyword
its not fun
never was
will never be
XCode supports both C# and Swift, yes
but the lang is decent
And in the last years, it definitely moved to Swift, but you can still write iOS apps ini C# just fine
oh ye swift is <3
I also don't like swift, but that's a personal thing this time
I don't have any reasons to dislike it
for kotlin, I at least can bring up some things about why I dislike it lol
ye well I like swift more than the other alternatives
yea
i like to make the argument, that kotlin is harder than java, since java has fewer ways of addressing a problem in terms of design, as opposed to kotlin where u have extension functions, first ordered functions, infix, operator overloading etc. all these things can make a code base extremely cluttered if used unrestrained and wrongly, whereas java just has the very necessary semantics and also waits an enormous time before even considering to add new features as by a means of avoiding redundancy and bloating the language
idk @flint coyote if u may have anything to add here since u use kotlin
how does one make the default world "world" use a void generator (through code or configurations)
this makes java a more viable option conclusively (for large projects), inconclusively tho java is always the solution
yeah anyway, the worst thing I hate about kotlin is how they managed to make such a nice, descriptive language, into something so unpredictable. e.g. imagine this, I got the following thing in java:
String surname;
Okay, I got a String, and it's a surname - that makes sense. a surname is usually a string, it would never be an integer, right?
And then there's kotlin:
surname: String
Hm. I got a surname. This time, it happens to be a string. that it's a string seems kinda unimportant, it only comes in at the second place. Is it ia number in the next udpate? I don't hope so
Ik it's petty
and now imagine you just do val Sth = sthElse
is this a string?
is it a CharSequence?
who tf knows?
I think the benefit is that all the variables get aligned vertically
but the type is much more important than the name
idk, never thought about it that way actually
It will be highest type in hierarchy, string in this case
you can easily rename a var and everything still works
you change type? everything breaks
nobody cares about the name
While I do agree that you can do things a lot worse in kotlin by misusing or mixing to many features I wouldn't say that this is what makes it generally harder.
You can still not use a lot of those features and code "the java way" and you are good.
However it is true, that it's harder to "perfect" your code since there's a lot more ways to do it. Which is also why I still prefer java - java is where I know how to write clean code. I don't know all best practices in kotlin (yet)
and for return types?
the opposite should be true
yeah, makes total sense
What
You can return smth down the inheretance chain same as in java
let's just imagine that I create a method that takes in a CharSequence, and returns the "inversed" version of that CharSequence. Ofc everyone would in java just do isth like this
public static CharSequcnce reverse(CharSequence origial) {
// now return the reversed "string"
}
Pls tell me how this would look like in kotlin
oh I forgot, kotlin doesn't even have static methods lol
you'd need a companion object, whatver that's meant to be
basically it's a useless object that's only there because kotlin devs forgot to menton that not "everything" needs an instance
fun reverse(original: CharSequence): CharSequence {
// logic and return?
}
Functions in a companion object do behave like normal static functions tho. Unless you wanna use them from java, then it gets weird if they aren't annotated
funny. I can only see at the end of the first line what it returns. also what's "original"? Oh, a CharSequence. Seems to be quite unimportant what the type is, granted that the name is more important
Kotlin could have been so nice, but they took everything that's nice in java, and did it wrong
also what's the "fun" for?
Function
isn't it already obvious that it's a function?
what else would it be
oh and how do static init blocks look like in kotlin
Idk you seem first that hate it that much
I do
It's same in typescript, no one is complaining
inline fun CharSequence.reverse(): CharSequence {
//
}
//then
val x: CharSequence = ...
x.reverse()
this is how kt devs would do it
probably
how does a static init block look like in kotlin?
Why would you need static init block if there is no static var
class MyClass {
static { DoSometing(); }} ```
You define it in companion object
how?
idk what you mean
e.g. for fake enums, like the ENchantment class
in bukkit
if it's not the same, I guess it's not the same
thats right
Init block in companion object
this for example. how would this look like in kotlin? because I truly don't understand itr
That would just be object
EnchantmentWrapper ofc has a normal constructor, it looks like this:
wtf
object Enchantment {
val THORNS = Wrapper(...)
}
what's that annotation for?
and why is that needed?
Java static and kotlin object is not compiled to same code I would assume
Object acts as singleton
Only if using it from java, if using it from kotlin you don't need it
it's quite funny, evertime I discuss with someone about how shitty I find kotlin, the kotlin defenders come up with arguemtns that just make me belive that kotlin is even more shitty than I thought lol
?
well alex as said
"oh sure, you just did sth totally normal in java? well in kotlin you gotta declare that it's a JVM static something/whatever, idk"
the interop is shit
but like, kotlins way of dealing with global-"ity" encourages devs to avoid too much global state
Well you can just drop your api support for java and don't annotate it lol
there is not a single thing that kotlin ever added that java devs would find useful
Coroutines
I love having to add ???? question amrks? everyhwre
u dont "have to"
I have? to ? otherwise it doesn?t compile
its an optional feature that many java devs like
na not really
I don't know what coroutines are
loom?
project loom
structured concurrency api + virtual threads
erm can you people pls gimme a tiny example
Basically can run millions of "threads" and also use them to suspend async call and return result without blocking main thread
to what is it bound then, though?
it only uses an os thread during execution
Coroutines are computer program components that allow execution to be suspended and resumed, generalizing subroutines for cooperative multitasking. Coroutines are well-suited for implementing familiar program components such as cooperative tasks, exceptions, event loops, iterators, infinite lists and pipes.
They have been described as "functions...
and then the os thread can be reused for another virtual thread
okay I am not smart enough to understand that fully
Basically run smth async, wait for it to complete, when it complete resume
yes, but it isnt bound to a java thread pool
which is bound to a pool of os threads
which is expensive
and less scalable
especially if u just use small tasks with short lifetime
like an io request
https://github.com/Goksi/PteroBot/blob/main/src/main/kotlin/tech/goksi/pterobot/util/AwaitAction.kt this is for example how I make cf return result without blocking thread
but you gotta wait for it anyway, I dont really understand how it's any better than a nornal thread
You can't really suspend normal thread, as its expensive
You can run million of coroutines
As its cheap as fuck
Idk how, don't ask me 😄
mfnalex read that
but in short its not the coroutines themselves
its how its implemented
vs how java has its current concurrency api implemented rn
hm maybe i just don't need to do enough of millions of "read files" to understand the advantages that kotlin offers
that makes kt coroutines better
it becomes important for the enterprise tho
because in that regard scalability horizontally becomes urgently crucial to consider
yeah I did not study CS or anything similar, maybe kotlin indeed offers great advantages over java that I just don't understand
well, I find some stuff kotlin offers better and some worse
after using it judgement freely
all I can tell is that I never experience ANY situation where I'd be like "oh this'd be much easier in kotlin" - for me, the opposite is true, but as said - I didnt study this, so no clue lol
mye well
its not like java cant the job done by any means
so in essence I think ur opinion is somewhat factually valid
conclure you do study CS stuff right?
oh no well I meant, do you study CS stuff at an actual university or sth?
aaah nice
yeaa
you're just old runs
I'm 24 aswell 🤷♂️
oo
maybe I should really look into kotlin stuff more often
i think u should give the language a genuine try
one more year until getting older will actually feel bad
but it's so annoying when you come from java
after that, u dont have to like it
everything claims to be the same but it's still so different lol
That's why I'm currently still using java for my personal projects. I might try kotlin for some smaller things in the future. I didn't start with enormous projects in java as a beginner either
IIRC there's a "pull request" about kotlin to add "actual" static methods - if they'd actually add those, maybe my hate for kotlin would go down by one level
yeah I'm probably double based - whenever I tried to leanr kotlin, I also strated to use gradle
and I'm a big maven fanboiii
groaaadle
nice" what kind of car?
haha yeah gradle can be frightened, maven 4 is not that far from being released
souns like u could very much be the author of this very "PR" u so speak of
And while I know how to code in kotlin I definitly got a lot more to learn there.
Jumping from Spring Boot projects to spigot plugins with Kotlin might not be that easy.
Since spring boot has done the abstraction already and in spigot you still have to create a lot of utils yourself
and the impact of performance between maven 3 and 4 is huuuuuuuuuuge
2016 hyundai elantra
:,)
my passenger side light died :P
its really my moms car :V
nice. I just got my headline replaced in my Opel (I think it's Vauxhall in USA) and it costed like 50€ lol
just to replace the light
bet you drive a vauxhall corsa
shut up
whut? I thought you dont even got a license
it rly is, i cant afford a car lol
ive been a legal driver since i turned 16 n got my permit
who let 16 year olds drive
yeah cars are hela expensive. my bf looked up how much it is to just do the driver's license exam, or however it's called in germany
3400€!!!
16 is when you start to drink
wtf
huh? no
the practical exam is like 100€. If you fail it you will have to take like 5 additional driving lessons which basically brings the price to 300-400€
I paid like 1400€ for my complete drivers license 5 years ago.
And I can believe that it can cost up to 3000€ these days. But that's not just the exam
yeah but those numbers are a few years old, right?
it's really gotten very expensive
I also paid only like 1500€ but that was like 12 years ago
then I did my bike license (A class) and it also was 2000€
my flying license (PPLA) was surpsingly cheap at 15k€
alex the license collector
Why did it not work out?
Afraid of heights
oh many issues. first one was corona. You have to have at least XYZ hours of "flying yourself" during the last, I think, 3 years
I then lost my actual normal license, because I didn'f fullfil that
meanwhile you can not drive a car for 20 years and still have your license lol
`
Interesting statement!
i just realized this wasnt #general
then later on, the authority was like "yeah okay but covid19 and stuff, bla bla" and they losened trhose restrictions a bit. So I got my "normal" license back. then I started to go get the insctructor's license done. I'm still on it, but it's also extremely expensive. you can expect to pay at least 50k€ from you rown pocket
You would barely see me type in #general since I never check that channel
and then there's also my fucking alcohol addiction. I went to rehab justr a few weeks ago. the flying school doesn't know about it, all they know is that I "didnt have time" for a few weeks
Yeah I know that those are expensive. I studied with someone who wanted to become a pilot. But he said he would have to pay like 100k in order to get a license to fly a commercial plane
yeah when Lufthansa pays for the rest of it
if not, it's much more expensive
And then you have to stay with them for multiple years or you end up paying yourself. Got fired? Well, you're in debt
I don't know much about that
He was a lufthansa student
I am not, nor will I ever allowed to be, to fly "normal" planes. I will, if at all, only be allowed to teach general aviation - that's already quite hard
I am only allowed t ofly those small planes, e.g. cessna 172
Luckily my passion (coding) is a lot cheaper and easier to get started with
I already dislike driving. Idk whether I'd like flying
I'm a member in my local fly club - you pay "only" a few hunred € per months, and then you can just call them and say "Yo I#d like to get the 172 on the 17th of may for a day" or sth like that
The good thing about flying is that nobody is driving 2 meters behind me while I'm already over the speed limit lol
that is true, however it's still exhausting
it's a bit like driving a car but there's an additrional dimension
Checking your rear mirror while driving perfectly normal and seeing another car pretty much sitting inside your trunk is just a weird feeling
Atleast there's no obstacles in the sky
and you gotta be prepared for all kinds of failures
in a car, if sth goes wrong, you can just stop -
You can in a plane too, but the end result differs 🙂
You can do it exactly once. Just like you can bungee jump without a rope
even the situations in the simulator are fucking exhausting
and there you even know "nothing can go wrong"
on the other hand, you also know "okay but it's very unlikely this will happen in real life"
It can't be that bad just step on the brakes before you hit the ground!
yeah anyway, we e.g. tried the hudson landing (there's a movie about it), I tried it 3 times, and ofc everyone always died lol
just jump out to cancel fall damage
has to work I've seen it in cartoons
bring a haybale
go download MSFS2020, then we can speak again lol
I played MSFS back in 1990 something. I think I only ever managed to land a cesna once.
nope was in teh 80's
yeah the funny thing is, you can definitely don't do it wihout instructions, but even with with simple instructions, almost everyone could do it. But the real challange is to land safely even with failures
I have plaid like thousands of hours in simulators before my first actual landing and I was still scared as fuck
All I know is that you want the rear wheels to touch the ground first (so you basically have to pull up a little right before the landing)
early 1987 to be precise. I could take off ok, but landing was a no no
https://www.youtube.com/watch?v=2NQGuJvSaxU here's my first ILS landing at my howm town
ILS (engl. instrument landing system)
Unter Instrumentenflug (umgangssprachlich auch Blindflug) bezeichnet man das Steuern von Luftfahrzeugen, bei dem die Fluglage ohne Bezug auf äußere Anhaltspunkte mit Hilfe von Instrumenten an Bord gehalten wird (Ausnahme - der circling approach ist ein Instrumentenanflug, der unter Sichtbedingungen durchgefü...
(when I was still in flying scool)
ILS 25 haha
I remember the outrage when the airport wanted to extend the runway but some people complained because it'd have killed some specifies of ducks that were living there or sth
looks like you had a lot of cross wind in that vid
how come this is just not sending to bungeecord?
not really, I just sucked
ah
ByteArrayDataOutput out = ByteStreams.newDataOutput();
switch (args[0]) {
case "classic" -> out.writeUTF("hexhunt");
default -> {
p.sendMessage(ChatColor.RED + "Invalid game mode!");
return false;
}
}
out.writeUTF(p.getUniqueId().toString());
p.sendPluginMessage(HexHuntExpansion.getPlugin(HexHuntExpansion.class), "bungee:queue", out.toByteArray());
p.sendMessage(ChatColor.GRAY + "Finding you a game of HexHunt...");```
it says "Finding you a game of HexHunt..."
but on Bungee nothing comes through
bungee
@EventHandler
public void onPluginMessage(PluginMessageEvent e) {
System.out.println(e.getTag());
if (!e.getTag().equals("bungee:queue")) return;
DataInputStream in = new DataInputStream(new ByteArrayInputStream(e.getData()));
try {
String channel = in.readUTF();
UUID uuid = UUID.fromString(in.readUTF());
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(uuid);
switch (channel) {
case "hexhunt":
HexHuntServerManager hm = HexHuntServerManager.get();
if (hm.getServers().stream().anyMatch(s -> s.getInfo() == target.getServer().getInfo()
&& s.getState() == MinigameState.IN_GAME)) {
return;
}
hm.matchmake(target);
break;
}
} catch (IOException ex) {
ex.printStackTrace();
}
}```
it prints random things but never "bungee:queue"
isn't the actual name "BungeeCord" instead of just "buncee"?
you can register any channel you like, so long as it has a : in it
i have registered it on the spigot side
?pmc
from what I know, bungee willl forward anything you like - might be mistraken, though
that's only "BungeeCord" channel stuff though
rem,ove if (!e.getTag().equals("bungee:queue")) return; see if you get any messages
yes
welp that would be it
Does anybody know how the spigot AsyncStructureSpawnEvent was done in spigot 1.19.3? Or how I can find out how it was done.
?stash
Still a wip I think right?
I checked a few days ago and there was still a pr related to it
Oh nvm must be dif event in the pr
Thanks
would i have to make a new Event for finding if someone placeda item into an inventory or is there a way to find that out with InventoryClickEvent
The InventoryClickEvent will work just fine for that.
You could do a simple check using InventoryClickEvent#getAction() to see if it matches InventoryAction#MOVE_TO_OTHER_INVENTORY
ok i was looking at that but i didnt understand that one
does anyone know if theres a way to add additional arrow models in the resourcepack and display them? or any ideas how to implement it
target.getInventory().setItem(event.getRawSlot(),event.getCurrentItem());
}```
this is just not working
== for enums
how would i check what server a pluginmessage came from
on bungee's end
I dont think you can check that
Because plugin message are not sent from the server itself
Its a player packet, which means that the plugin messaging is sent thru the player connection
so can you not check what server the player is in?
if (e.getSender() instanceof ProxiedPlayer p) {
ServerInfo serverInfo = p.getServer().getInfo();
if (serverInfo == null) return;
System.out.println("test");
}```
it never prints "test"
does that not do that?
the thing i just sent
try adding a debug to serverInfo and see if there is any output
Can you share your full sender and receiver code where having the issue
Because i cant help you much with little of it
@EventHandler
public void onPluginMessage(PluginMessageEvent e) {
if (!e.getTag().equals("bungee:minigame")) return;
DataInputStream in = new DataInputStream(new ByteArrayInputStream(e.getData()));
try {
String channel = in.readUTF();
if (!channel.equals("state")) return;
System.out.println("new state received");
String state = in.readUTF();
if (e.getSender() instanceof ProxiedPlayer p) {
ServerInfo serverInfo = p.getServer().getInfo();
System.out.println(serverInfo);
HexHuntServer server = HexHuntServerManager.get().getServer(serverInfo);
if (server == null) return;
server.setState(MinigameState.valueOf(state));
System.out.println("test");
switch (server.getState()) {
case IN_GAME:
HexHuntServerManager.get().newServer(); // create new server when game starts to maintain server level
break;
}
}
} catch (IOException ex) {
ex.printStackTrace();
}
}```
so that basically is for the minigame servers to update the server manager when they have started
etc.
test never gets printed
but "new state received" does
sout(event.getSender() instanceof ProxiedPlayer)
Before the second if check
Also why are you using plugin messaging channel?
because people here suggested it instead of sockets or whatever
its for my server deployment system
minigame
If you are planning making a plugin which work with multiple servers and also need really fast server communication you can make use of redis pub-sub
But depends on what you are doing or will specially
eh it doesn't need to be too fast
it only communicates when the minigame state changes or someone wants to join
Right i mention because there are some things you cant do with PMC
let's focus on what he's asking for
instead of immediately trying to shift him to an entirely different tech
Yeah just mention it as an approach on future
So far have you try what i said?
.
sout(event.getSender() instanceof ProxiedPlayer)
Before the second if check
yep
I'm trying to generate a giftcard on tebex with BuycraftAPI, and I got UndeclaredThrowableException and I don't know what should I do next.
Error: https://paste.md-5.net/ofepavigim.pl
Code: https://paste.md-5.net/ohewitupub.cs
which is MainCommand.java:130
How does cancelling a BukkitRunnable work exactly? Does whatever it's doing immediately get interrupted or does it have to check if it's cancelled during the task?
it says false
It's this part
Call<GiftCardSingleListing> task = this.api.createGiftCard(new BigDecimal(amount), ConfigValue.GIFTCARD_CASHOUT_NOTE.replace("{player}", player.getName()));
something on that is throwing an exception
Caused by: java.lang.NoSuchMethodException: java.lang.invoke.MethodHandles$Lookup.<init>(java.lang.Class,int) so im guessing its something in buy craft api
does player.setAllowFlight(false); also disable flight (if the player happens to be flying)?
?tryandsee
Maybe not?
its like
such a simple question
I just don't wanna build and find out
cuz it'd be simpler just for someone to say yes/no
I'm bs at coding, how would I make a console command apply only to a certain world
Just apply it to that world?
Like /give @a but like only for 1 world and does this work for multiverse
Uh
You'd have the specify the world
Yea I'm dumb
Since the console isn't in a world
My brain ain't braining lol
I dont think there's a simple way to do it
Yea then I dknt think I can make the plugin
I wanna make an afk area, ppl in the afk area are given a gold ingot every 10 mins which is traded in for smtg
Smth
Obv with certain meta and stuff
Determine the BoundingBox of the AFK area
Every 10 minutes, iterate through all online players
if the player is in the correct world, and the BoundingBox contains the location of the player, give them the item
I really need to learn more coding before I do this, but thanks
Does anyone know the event for when the composter changes to bone mail when its full?
PlayerInteractEvent
That is getting the item, i mean when its full and it changes to full and complete and has the white stuff on top
put you dont click it when it changes
There's a stage where it will change the texture and play a sound. He wants that stage.
^ that
I'm sorry if my questions are dumb as hell, what's a bounding box and how do I check if the player Is in the correct world
Yes, ik
you have to check the block itself for that. There won't be an event fired when it reaches that stage
You'll have to check the block based on InventoryMoveItemEvent and PlayerInteractEvent
That doesnt explain how using the debug stick or w/e can active it and make it change to full and complete
When it changes to stage 7 it always changes something in the backend does it with no player interaction
It isn't a separate event though
That doesn't fire for it
I can stop everythign else with a block state like crops growing
Guys i was thinking here. Using reflections to access NMS codes is legal?
Yes
Yes
yeah
What i cannot do with NMS exactly?
Distributing raw source code is where it becomes illegal. So as long as you aren't doing that, you are fine.
A guy a time ago told me some things at using NMS isn't legal
idk how to explain it dude
They don't fire an event for when the composter reaches stage 7 cuz it reaches that state by detectable events.
and i'm just trying to figure what i can/cannot do with
Can i sell plugins/codes that uses reflections at the NMS?
As long as you follow the rules laid out in the EULA, which is very lax btw, you can do whatever you want.
The basic rules are don't distribute raw mojang source code and don't do anything malicious.
Tbf selling any sort of mods is not legal.
But yeah
Sure spigot will sell it for you etc.
I'm sorry if my questions are dumb as hell, what's a bounding box and how do I check if the player Is in the correct world
A bounding box is the rectangular box around something that determines where it can be interacted with
Blocks, entities, etc all have bounding boxes
player.getWorld().getName().equals("world")
Do I need to make a config to enter coordinates on where it needs to be or can I use it straight from a java command class
You can just compare the world directly, you don’t need to compare the name
What are you talking about?
Can you explain more clearly what it is you’re actually trying to do
yeah, but it isn't sounding like he is bout'a use the actual World objects lol
?xy
Asking about your attempted solution rather than your actual problem
I didnt attempt a solution since I dont know what to do
What are you trying to accomplish
You can hardcode those coordinates if you want to
It's generally recommended to create file configuration to pull those coordinates from simply to make it more user friendly.
At a high level, don’t worry about implementation details right now
This is what I'm trying
What are you actually trying to do
Ok
So it depends on how you want that area to be defined
Is it intended to be configurable by the server owner?
Is it intended to be saved on server restarts?
you seem to have this lol
Do you even want the area to be rectangular
Or do you want to support more complex areas
I am the owner, I'm always ready to go in and change it but i would like configuration
We’re just getting started lol
Yes
Then you should build in a config file yes
Thanks alot for helping me now btw
Bro you're gonna start having him question his life choices next XD
Alr
“Hmmm, very interesting. So tell me more about your relationship with your mother.”
"Why did you decide to become a programmer?"
"Why would you ever want the pain of debugging over your head?"
So I would create the item, get the players in this world. How would i give the item?
"Well, it all started when I was 9 and my mother started shoving me out of her life"
Debugging is only a pain if you don’t know how to do it
Forget the rectangular area I'll make a world with multiverse and use that
Iterate through all the players in the world and check if they’re inside the bounding box
but its still a pain
If they are, give them the item
I remember in one of my college classes we had a debugging exam. Only me and one other guy finished, he’s now one of my closest friends. We always argue over who did the exam better, he finished before me but I got over a 100% because I found and fixed a bug the professor didn’t mean to include 😂
LMAO
LOOL
wait
Wrf
Discord
Wrong message lol
I'm dumb, I barely know coding. How would I do it? Is there something like p.iterate().worldcheck or sm shit
Also an on and off command will be executed by admins
If on, well yea every 20 mins it happens
declaration: package: org.bukkit, interface: World
if you want it to be fully accurate for every 10 min that player is in the world track uuid + instant in a map and then a runnable starts for each player or run a runnable every minute to check if its been 10 minutes since saved instant then update the map and off it goes
Thanks
You can also use this https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#getNearbyEntities(org.bukkit.Location,double,double,double,java.util.function.Predicate) if you still want the bounding box
declaration: package: org.bukkit, interface: World
Alr
Does multiple worlds use multiple threads?
sadly not
Can I add the dependency of multiworldqnd add the name of the world?
mc is single threaded
With some minor exceptions of course
you get the world with the world name
player.getWorld().getName().equals("world")I would replace world with world name right?
If you already have a World object you don’t need to compare it by name
for (Player player : Bukkit.getWorld("worldname").getPlayers()) {
//do something
}
Ale
Also, if you’re looping through the players in the world you don’t need to check that they’re in the world lol
Alr
So just a run through, I implement command executor and start with this.
Next since the world is mentioned I just give the players the item, before this I would create the item. How to loop?
And how to make it an on and off switch? I've seen this somewhere and I know it's really basic but it's been some time
create a toggle command and save if its on or off in that + having a boolean somewhere you can check, and have a runnable/scheduler that runs every X min, checks the boolean if its on runs the for loop
?scheduling
Alr, thanks
how would i copy text in a resource and put it into my FileConfirguration?
never used bukkit's system before
kinda sucks ngl
i got
@Override
public @Nullable FileConfiguration loadFile(@NotNull String path) {
File file = new File(plugin.getDataFolder(), path);
if (!file.exists()) {
file.mkdir();
try (InputStream in = plugin.getResource(path)) {
Files.copy(in, file.toPath());
} catch (Exception e) {
e.printStackTrace();
}
}
return YamlConfiguration.loadConfiguration(file);
}
``` which ain't workin;
[22:31:39 WARN]: java.nio.file.InvalidPathException: Illegal char <:> at index 17: plugins\MobCore\D:\Testing Server\plugins\MobCore\generators.yml
What's your input file look like?
ew:
test: "string"```
And you're trying to copy all of that into another yaml file?
Yeah
Well one way I do this is with 2 instance of FileConfiguration. I just iterate over every key and set it in the first config file.
File file1 = new File("File you want");
File file2 = new File("File you want");
FileConfiguration config1 = YamlConfiguration.loadConfiguration(file1);
FileConfiguration config2 = YamlConfiguration.loadConfiguration(file2);
for (String key : config2.getKeys(true)) {
config1.set(key, config2.get(key));
}
if you just want to save the resource in src/main/resources just use JavaPlugin#saveResource
Alr, bukkit's system for this is so goofy
But probably will get better since I don't know it
IIRC, there is a way to convert a #getResource call to an actual file. I just can't remember what it is.
you have to convert it from input stream to an input stream reader then you can load it iirc
so like?
@Override
public @Nullable FileConfiguration loadFile(@NotNull String path) {
File file = new File(plugin.getDataFolder(), path);
if (!file.exists()) {
file.mkdir();
plugin.saveResource("generator.yml", false);
}
return YamlConfiguration.loadConfiguration(file);
}```
yeah
Yeee, that was it. Cause #loadConfiguration() has a method that takes Reader as it's parameter instead of File.
do you just want it in datafolder
ye
if yeah, dont take a path and just set the child as "generator.yml"
my bad
okay now
it create's file but nothing's in it
@Override
public @Nullable FileConfiguration loadFile(@NotNull String path) {
File file = new File(plugin.getDataFolder(), "generator.yml");
if (!file.exists()) {
try {
file.createNewFile();
plugin.saveResource("generator.yml", false);
} catch (Exception e) {
e.printStackTrace();
}
}
return YamlConfiguration.loadConfiguration(file);
}```
wait
would i have to save it?
#saveResource() takes the file you provide in the jar and copies it to disk. It will overwrite any modifications made if you make the boolean true.
is the generator.yml actually in your jar
I know what scheduler is, don't understand runnables tho? Is runnables a way to loop? And the delay for looping is in ticks right?