#help-development
1 messages · Page 896 of 1
🥲
durability can be used for texturing
not sure if this is still true in modern versions
basically make sure you or your texture packs aren't abusing durability for textures
yea i alrdy figured it out. thanks tho :d
oh I didn't see :P
use custom model data if possible
You'd need to override their behavior using NMS as far as I'm aware
or just move them yourself
does someone have the dependency for paper 1.8.8
🧑⚖️
1.8 augh
maybe ask the people who make it?
they dont give support for it anymore
and you gotta serach the whole internet just to find this stupid dependency
and since when did spigot started providing support for things that are not theirs?
idk just asking ppl
with good reason, i believe
1.8.8 is 8+ years old
get over it
Too old! (Click the link to get the exact time)
Too old! (Click the link to get the exact time)
Fucking hell
so amended
L slow
Sniped on both
Great minds think alike*
I'll never stop playing on 1.8 🥲
but you can spam click 
But coding against it is pain
1.9 was the worst update in minecraft history
There are like 9 total blocks in 1.8
not even lying
You can't even use like end rods
1.9 was a great update
you just don't like it because you can't spam click and win pvp
it was horrible for the exact reason that 1.8 still exists
Eh it's opinionated, maybe we should not entertain this conversation??
Or at least not in this channel
anyway we won't/can't provide whatever paper 1.8 he wants
how to bypass 1.8.8 nametag 16 characters limit there has to be a way
Isn't it 9 years old already
Pvp is not a reason
You don't
Uhm actually I lied
Mod the client
abuse the log4j exploit if some people still run that 
Oh smart
probably won't work since it's patched at the launcher level
Hmmm gonna have to have a custom client then smh mojang
theres a work around using packets with minecrafts code but i dont do that to myself thats complicated
hmm in kotlin are you supposed to be calling == or === to compare with null, == would call equals, but whats the point of equals(null)?
Doesn’t matter
so the same code gets generated?
yes
Note that there's no point in optimizing your code when comparing to null explicitly: a == null will be automatically translated to a === null.
an optimizing compiler, good
💯
I am not sure whether that can even be treated as an optimization
It's no like it calls Objects#equals(...) when comparing with null
(like most compilers lol)
i was talking about javac
the point is still that the jit compiler does most of the work
wtf 1.20.4 doesn't have apache common...
i mean yeah JIT is crazy in optimizing, but there's also a bunch of CT optimization
this is not true, the java compiler actually does quite a bit of work in optimizing your code
the jit just goes further for during runtime
Why did they remove apache common from spigot?
would it optimize this
bool a = expensiveCalc() || true
bool b = expensiveCalc()
if (a || b)
lemme actually look at some bytecode
i'd assume so
The JIT also optimizes at some point
I'd hope so
if it is able to, yes it would
It's an implementation detail now
it would not. It is basically the same as if (expensiveCalc() | expensiveCalc())
No because they can return different results
(Yes, for some reason there is a diff between || and |)
bitwise OR
yes, one is a logical OR and the other is a bitwise OR
actually dumb example, yes expensiveCalc() might return different values 💀
So here is the trick question: Isn't it the same?
no
Nope
Yes I know
If you have done any kind of programming degree you will understand the difference between | and ||
So how?
logical or runs the right only if the left isn't true
correct.
While the bitwise OR literally runs the bitwise OR operation, requiring both expressions to be evaluated
well either way it doesnt do it when it sees that call returns a constant
for short-circuiting ones, which is generally true
well it changes the bits using the ones from the left and applying them to the one on the right
I mean yes
I'm not sure if <bool> | <bool> even runs a bitwise OR, given that the JVMS does not properly define the values of booleans (only those of booleans in arrays)
what do you mean doesn't define the value of boolean
Fake!
it doesn't properly define boolean as a data type, booleans are just bytes
I mean, not sure what you would define with a single bit
It doesn’t even define it as a single bit iirc.
it's a full 8 byte @wet breach
well Boolean is an object and is a type, boolean is a primitive
Yes, but that's the java syntax spec & java std lib, we're talking about the JVM spec
the JVM itself doesn't have a boolean data type
the size of a boolean in java is 1 bit, however in terms of actual memory usage may be larger since most data types involving bits are backed by an integer anyhow
booleans are not a single bit
The verifier does not care whether a boolean has a value of let's say -1 or 1. Different JVMs may interpret it differently
does an ior
well all the JLS says is this The boolean type has exactly two values: true and false
is paper now already marking NMS fields as deprecated or where is this coming from lol
so, if implementation wise a JVM uses -1 and 1 to distinguish between the values I suppose its fine as long as true and false are returned
normally it shouldn't be a concern for a java application to care about implementation detail if it doesn't change the outcome
Well in C 0 is false and non-0 is true. In java, 1 is true, 0 is false and everything else is JVM-dependent
sounds fun
But yeah, javac makes use of IOR for this
Furthermore, the JVMS defines the IF<cond> opcodes as tests against 0 - C-style
btw geol, would you know some kind of program that translates bytecode mnemonics to actual bytecode?
I do not know what bytecode mnemonics are
i mean like imagine typing istore_1 and stuff
Like I have heard that word, but I cannot attach anything to it
if you want actual bytecode open the file in a hex editor
istore_1 is an actual opcode I think
uh ye
actually my question sounds silly, translating bytecodes in text form to actual ones
yeah that one is deprecated in a patch but I don't think it's actively done anymore
was looking for something that reads this and compiles it to an actual .class file
I have heard of a few assemblers that do have such support, but honestly there is probably little reason to not use an more standard assembler such as https://github.com/jumanji144/Jasm
The openJDK team have their own assembler and krakatau is another known assembler
probably could literally just do it yourself, I mean all you would be missing is the compile sig that its a class file
ye i could just write a quick parser
and some of the headers etc
well ye the constantpool would be an issue lol
There is also the absolute hell of https://github.com/Starloader-project/java-bytecode-differential/blob/main/src/main/java/de/geolykt/starloader/bcdiff/assembler/SLAssmbler.java which uses a slightly modified version of Recaf 2X syntax, but it's sub-par in quality and nigh untested
i mean i wrote a classfile reader so making a writer should be a fun project too \🤓
Do it
i actually might
Do it
there is no reason to do so.
but got enough to work on in the meantime
I think that might be Mojang
Since the TPS can be changed now
ASM is more than great. If ASM is too high-level (e.g. due to obfuscation or if you need direct access to the constant pool), cafedude (https://github.com/Col-E/CAFED00D) should be used
Yes, that is the library used by recaf to transform heavily obfuscated classes to comply by ASM's standards
oeh nice to know
I also use it for some "do it fast" mass transformers - such as https://github.com/Starloader-project/galimulator-lwjgl3ify, https://github.com/Starloader-project/smatterDI or https://github.com/Geolykt/TTDeploy
It's only shortcoming is that it isn't great when you need to compute stackmaps, given that it lacks the built-in support for it and doing it yourself is more than eternal pain
you seem to be a transformer enthusiast
i even forgot what stackmaps were used for again
They are required for Java 7+ bytecode for the verifier. That is pretty much it - I believe the JVM doesn't even use it
I've written an extreme amount of modloading-related code from scratch given that galimulator doesn't have a native modding community. So I extremely like my java bytecode
ahh here they are, once wrote a definition for them
Is that rust?
// Each stack map frame specifies (either explicitly or implicitly) a bytecode offset,
// the verification types for the local variables, and the verification types for the operand stack.
odin, you wont know the language
yep, never heard of it
?
"general-purpose programming language with distinct typing built for high performance, modern systems and data-oriented programming. "
Especially in combination with bugs you made outside of stackmap writing code (such as https://github.com/Col-E/CAFED00D/issues/24 which bit me last time I tried this heh) computing the stackmap offsets is fun for the whole family and mainly consists out of trial-by-error
looking forwards to a lot of bugs
oh, and depending on what kind of classes you want to read you'd also need to write your own low-level zip reader
hmm?
though chances are you do not want/need to
Java supports jars that aren't exactly conforming to standard zip principles
oh dunno, im still waiting for a pr that adds zip files reading to the lang lol
oh wow, that much be an incredibly immature language then
i mean it has a lot of things but not everything
could always generate a c binding
still community driven
what's exactly the point of using this lang specifically
Hm, the main advantage of go that interests me is that unlike java, the unsafe is actually supported over there
But I have never used go (nor most other languages) so I cannot comment too much on it
go is pretty interesting
I used it for a proxy way back when and it was actually pretty decent
The problem with a lot of programming languages is that they are remarkably difficult to use in a multi-platform environment
especially low level languages yes
Main reason I am not at all interested at C# even though it should be a better java according to some
one might call it less bloat, but at that point just use kotlin
im gonna get a lot of criticism on this one
Kotlin is a remarkably bloaty solution
Oak is the perfect programming language
C# works well for windows
I've been debating for a while now whether to use kotlin scripting or XML/HOCON for my build tool and given kotlin's size the latter might be the better option
id even call it cleaner the moment you start to use it
started converting some of my java projects to kotlin cuz its less bloat and has some cool semantics
Yeah, problem is that I am on Linux - where the CLR assembler/disassembler doesn't even roundtrip correctly which is an extremely major red flag to me
why are we still using xml in 2024 though \🥺
For all intents and purposes it is a solid configuration language
where i can find a good git ignore template?
github has a repo full of gitignores
.* - done
what does that?
not dynamic enough in my eyes and then it gets bloat
Evrrything
i don't really understand it
although target and build probably should get excluded too
i just want to have the src there xd
Exclude every hidden file and folder
then use that
you can type gitignore yourself
but likely a good idea to use one for java generally
Here u go a gitignore https://github.com/EssentialsX/Essentials/blob/2.x/.gitignore
i don't really know how that works
Good chance to learn
do i really have to learn git ignore?
The problem with a configuration language being dynamic is that you WILL get into a situation where everyone does it their own way.
lets say data types
Gitignores are trivial in nature
there's no method to just exclude everything but src?
heres the format https://git-scm.com/docs/gitignore
data types as in ints versus floats versus doubles or wha?
There is, but you should not. You should at least include your pom.xml or build.gradle
i was thinking about build files, in xml you just stuff everything in between two tags and call it a day
any particular reason of why?
just learn git
to be able to build the project from source
Gitignore is just a list of files to not be added
i mean if you look at gradle build files, it gets a bit better already
Rather, to keep untracked
but thats just my opinion
You can use something like follows:
*
!src/
!pom.xml
!build.gradle
!gradlew
!gradlew.bat
!settings.gradle
!gradle/wrapper/
!README.*
!.gitignore
(You'd also need to include the license file but given that there are a bazillion paths for those I choose to not add it here)
I don't exactly understand the problem with that? Shouldn't that be the definition of a good configuration language - to be able to do things quickly without having to look at it again?
(Also I haven't tested such an approach - but in theory that ought to work)
dunno this conversation just started because i dont like xml
Yeah, but wouldn't yaml, toml, hocon or anything else for that matter suffer from the same drawbacks?
i'm currently using a yml based build system 🥲
then use JSON
https://taskfile.dev/, a bit like a Makfile though
or json5 if you're cool
I knowingly did not include JSON because even I can state that it is complete bullshit for configuration files
Json is nice
Yeah, but the lack of comment support doesn't make it attractive to me
which is why I use JSON5
just do "__comment1": "hello there" lol
and then use a JSON5 parser -> JSON -> parse that
Or just enable comments
easily integrate into existing json environments
So if I ever need a JSON-like language with comments I use HOCON, whose only drawback is the fact that it doesn't have many implementing libraries
Doesn't gson already have comment support I'm like 20.3% sure you can do some settings on their builder
Maybe I'm just hallucinating
I am working on a project (http://code.google.com/p/plovr/) that is trying to use JSON as the format for a config file. The inability to comment something out is making me consider XML instead :( Y...
this?
doesn't seem like it went anywhere
And well given that I use configurate to implement my configuration files in these cases I can easily switch/support different config languages if I want to
Clearly just hallucinate then
youre AI
I am pretty sure that gson supports comments, at least in it's lenient mode
lenient just makes it swallow exceptions and try to read anyway
JSON does not allow comments in the spec
Well, looks like comment support to me anyways
is there a decent enough json5 lib for java even?
what does the license file?
This is a lightweight library to parse and serialize JSON5 data. - marhali/json5-java
all you need is something that spits out valid JSON
State what people can do with you code
and then use whatever JSON lib you want
I like using jankson but I know there are others
Pretty much a must-have if you want to distribute your code online, as by default it is ARR (all rights reserved) which makes the act of publishing the code pretty much useless
com.sk89q.worldguard:worldguard-bukkit🫙6.1.3 was not found in https://papermc.io/repo/repository/maven-public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of papermc-repo has elapsed or updates are forced
Try to run Maven import with -U flag (force update snapshots)
When trying to load maven changes I get this error 😦 somebody that knows why
https://mvnrepository.com/artifact/de.marhali/json5-java/2.0.0 hm, 41679 bytes - not bad
can i just put a license file and write "do what you want with this code"?
because worldguard isn't in the paper repo
you can check the index yourself.
You need to add the world edit repo
Though CC-0 is the more professional approach for that ;)
or the unlicense
instead of teaching us about licenses in college they teach us a bunch of ethics
Who tf cares about ethics 
nobody, we are doing cs
Teach me my licenses so I know who I can sue
what is cs?
Compsci
computer science
ooooohhhh
why licenses? isn't coding community like we all have the code that some dude made years ago
Where do I find the worldguard repo?
because your intellectual property is yours
Licensing is nice becuaase having no specified license is much less freeing to other devs than something like gplv3 or MIT
oh god not the GPL
GPL INFECTION!!!!
You give me nightmares with these three letters
woo fun
It's not that bad stay mad
is gpl a cancer?
(especially once you put the letter "A" in front of them)
It being cancerous is what makes it a nice license tho
i believe even vanilla has that
Actually you might beable to edit the log4j file to not log
Yep
But that stoll requires a patch
log4j probably has one or the other hidden features where you can add log filters
And you can easily specify custom log4j configs via system properties
you can even reconfigure on runtime
Yes
All that just to display "Nag the authors..."?
indeed
lmao
was about to say
@eternal night you should know that smh
Why do you guys nag just asm sysouts into logs 
System.setOut ig
get people to use logger
I prefer writing to new FileOutputStream(FileDescriptor.out) myself
did you commit something to chunky
uh i think
i got pinged by chunky and i thought i saw you on it
yeah i'm in the chunky channel
oh
i see
pop is saying he pinged me directly because i contributed lmao
yup
how do i specifically disable those kind of warnings in the javadoc?
gradle?
yes
kotlin or groovy
Groovy
javadoc.options.addStringOption("Xdoclint:none", "-quiet")
it should be that anyway
yes, i tried that
i didn't mean to super react
but it also disables another kinds of warnings
@slender elbow I've ascended I use gradle.kts now
i just want to disable to that specific warning
Oh no!!!! Now you gotta pay discord your soul
not paying a cent
you're welcome
you have nitro, you have unlimited
omg look it's nanahira
omg its the chunky guy
@river oracle you know what
what do you know
Heart emoji
wait a mother frickin minute
where the fiuck is reobfJar coming from
thats not in patrick choes remapper
it's paperweight so that people won't have to run buildtools for 12 versions
smh
oh no
just use the totally legal codemc nms repo
didn't it get nuked?
not that i know of
meh, I am too lazy to see for myself
Nexus Repository Manager
You can syncronize
In computer science, mutual exclusion is a property of concurrency control, which is instituted for the purpose of preventing race conditions. It is the requirement that one thread of execution never enters a critical section while a concurrent thread of execution is already accessing said critical section, which refers to an interval of time du...
synchronized can lock on an object
so it locks on the object and unlocks as soon as the synchronized block goes out of scope
in other programming languages you may have to manually unlock or if you use other kind of locks
atomicity regards to an operation being indivisible, that is, either it did take action, or it did not, we cant observe the progress/the middle of the operation
the keyword volatile is not enough alone to guarantee atomicity, you will need something stronger that either ensures mutual exclusion to one thread at a time, or something that calls a low level arch instruction that can atomically swap the value if a variable if that value is equal to some other expected value
for instance AtomicReference is nice since it has an getAndUpdate which does it atomically
however if you have multiple state variables that share invariants to one another you’d probably need to use an intrinsic lock (java synchronized), or some other mechanism like semaphore, reentrantlock or stampedlock
Hi, I'm trying to detect when the player has broken an elytra
@EventHandler
public void onPlayerItemDamageEvent(PlayerItemDamageEvent event) {
if (event.getItem().getType() != Material.ELYTRA) return;
Damageable damageable = (Damageable) event.getItem().getItemMeta();
if ((damageable.getHealth() - event.getDamage()) > 1) return;
DbHelper.setTrackedMissionEligibilityToTrue(event.getPlayer().getUniqueId(), "BreakElytraMission");
}
however it wont cast the item metadata to damagable when the item takes damage
[16:33:02 ERROR]: Could not pass event PlayerItemDamageEvent to NebulaSurvivalRanks v1.0-SNAPSHOT
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R3.inventory.CraftMetaItem cannot be cast to class org.bukkit.entity.Damageable (org.bukkit.craftbukkit.v1_20_R3.inventory.CraftMetaItem and org.bukkit.entity.Damageable are in unnamed module of loader java.net.URLClassLoader @61e717c2)
ahhh
classic one :,)
At least it isn’t structure
You’re lucky I didn’t call the new structure class Structure as well :p
So you considered it at least?
It was tempting
lmao
volatile isn't much about atomicity but visibility
most field type writes are atomic excepting for longs and doubles (which are not guaranteed but jvm implementors are encouraged to make them atomic anyway lmao)
volatile just makes that change immediately visible to other threads
"just"
yeah true, but its kinda needed if you want to optimistically write without heavy locking (like try to CAS and if it fails, try again)
oh apparently writes to non-volatile longs and doubles are not guaranteed to be atomic (but encouraged to be)
talking about a read modify write op
:^)
oh yeah defo
inter thread will certainly need volatile at the most basic level
without it your program is flawed
yup yup
hey
whats the enum for last damage cause
cant find it
in other words, what are all possible death causes for a player
what does it return, EntityDamageEvent itself cant be an enum, where's the list of all possible causes???https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Entity.html#getLastDamageCause()
declaration: package: org.bukkit.entity, interface: Entity
Get the cause from the event
what does it return
damagecause or smth
are you writing code on notepad or something
no im just guessing right now since im gonna do this project tomorrow
There’s also the new damage api if you are on the absolute latest version
EmilyTypingEvent
DamageSource and DamageType
discord
this is similar https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDamageEvent.DamageCause.html
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/damage/DamageType.html
declaration: package: org.bukkit.event.entity, class: EntityDamageEvent, enum: DamageCause
declaration: package: org.bukkit.damage, interface: DamageType
Mhm
just reorganized? were there any code changes
But damage type is registry backed
Death to the enums
poor enums
Keyed will take over the entire spigot
Lol yeah
every enum will become Keyed
Well mojang sided, more stuff gets registrified for each version so having that transparent in the api might be a huge W
Imagine if spigot was rewritten from scratch
how much work would paper have to do xD
and all forks
Would fix a lot of mistakes that were made ages ago
If spigot is so good why isn’t there spigot2
Its just… a lot of work
If minecraft is so good, why isnt there a minecraft2
Well technically
yea
There was the April fools snapshot
walmart minecraft2
Spexx I also don’t know if I know the mojang codebase good enough
Something something just slap a codec on it
Illusion does
Like, I know it better than most people probably lol, but you’d need a couple of big brain devs to cover the entire codebase
yeah
I dont know how much I know about it.. I know some things.. but the more you know.. the less you think you know
Also like, caring about thread safety whilst keeping transparency in a proxy like api can be hard
that was deep
True
lol
xD
you never know maybe there will be spigot2 in a few years some dude on github who you've never seen before will present its own version and get popular and the cycle repeats.. eh
I think the biggest pivot point towards an entire rewrite would mainly be to upgrade the transparency that the api holds between mojangs source/impl and bukkit api itself
but like, there is a certain fork that I wont name, which does try to do this within the bounds of the legacy api remnants
cant confirm nor deny
Ah yes of course the default emoji isn’t :paper:
It’s page_facing_up

The enum PR will help make things much more cohesive with Mojangs stuffs
Eventually™️
It’s not toooo bad from what I’ve seen
W
It’s mostly just turning invokeVirtual into invokeInterface afaik
ah yea, makes sense
is that valid syntax?
thought y’d had to to sth like
implementation(project("blh"))
For each one
thought that meant like "group”, “artifact”, “version” lol
as a means to separate the different operands
instead of :
In that case
You got nested modules right?
yes
but i think i found the issue
that dependency is compiled with java 21
while the project is on java 16
but 1.20.4 is built with another version too and it works fine 🤔
Ugh, I’m not keen with gradle anymore, but java versioning both for gradle and for the build pipeline itself can be painful
Hi i want to have multi module for nms multiple version, i have a module v1_20_R2 with this build.gradle:
compileOnly 'org.spigotmc:spigot-api:1.20.2-R0.1-SNAPSHOT'
compileOnly 'org.spigotmc:spigot:1.20.2:remapped-mojang'
compileOnly 'com.github.Mojang:DataFixerUpper:e843dac1eb'
}
I just want to make sure if it's good, in case anyone knows
I don’t think you need DFU separately
You also don’t need spigot-api if you are using spigot
truee
So i can put it in my root dependencies ?
What do u need dfu for
And its quite rare to use it explicitly nours
Yep i will remove api and dfu so and just keep the spigot:1.20.2 remapped
i doubt u rely on dfu classes right?
but how are you going to obfuscate the spigot again when building?
Hopefully they have one of the unofficially remappers :p
Do I have to use remapped?
I can just do that right ? :
compileOnly 'org.spigotmc:spigot:1.20.2-R0.1-SNAPSHOT'
}
its highly recommended , as in (do it for ur own sanity) to use a remapper
and you need to obfuscate it when building
only if i use the remapped one ?
But I love Level.a().h().c();
yes
hmm i don't know how to do that, i will use without remapped so
even though this is the spigot server, you can use the paperDevBundle, which gives you the remapped version and take care of the obfucation part
idk if it works with multiple versions
Actually, to tell you everything, I've been trying to configure everything correctly in Gradle between the root and the different modules for several hours, but I can't manage it because most tutorials are done with Maven
:,)
but wait, in first i was using the paper dev bundle
and someone tell me that if i use paper dev bundle, my plugin will not work on spigot server
all clients i had and have use a paper based server
unless you use paper specific things, you wont have problems
Your plugin can still run on spigot provided you don’t use any paper specific code
like , if you use the adventure api which only is available in the paper server
Which can get a bit annoying with NMS because who knows if the method is from paper or not
ohh i understand, paperdevbundle add more stuff, and until i don't use this, the plugin will still work on spigot ?
it can be a bit annoying to get the paper stuff in the way, but its doable
Yup
So, do you recommend that I use the Paper Dev Bundle?
Well I always use it, buut as coll said, maybe there are special source gradle plugins
might be worth looking at
i will use paper dev bundle and try to not use paper stuff
huh is yt experiencing an outage?
So in my settings.gradle:
include 'NMS:v1_20_R2'
my root build.gradle:
https://pastebin.com/hD9SjYVF
Okay, so I have switched to the paperDevBundle. For example, the sendMessage() method is now deprecated. However, I can still use it, and it should still work on Spigot and Paper servers, if I understand correctly, right?
Yes
Thx u all 🙂
I'd reccomend the remapper here
It works great
And doesn't require you to depend on legacy paper methods
I tried to use it, but I couldn't set it up on my project idk
Why? What went wrong?
Expound because I can verify it works
Should I use packets or should I make some hardcore listeners for cosmetics
Think I'll go the packet route
Don’t worry he already got a DM
I'll build it if he don't finish in a week
I do believe he was making good progress tho
He's doing it in kotlin iirc so it'll take longer since not java
@river oracle Can i pm u ?
No
Hey guys I am wondering how I can use the latest spigot version and still have access to NMS, currently my server is running 1.20.4 and i need to use this in my project. I've had trouble attempting before so I ask for help.
https://paste.md-5.net/omiwituyeq.bash (my build.gradle)
You should be able to run BuildTools for the latest version and use the local maven repos.
repositories {
mavenLocal()
otherMavenRepos()
etc
}
But why we need to obfuscate it back ?
Because legal
thx
you guys don't get it, I REALLY want to make sure the spectators are gone
Lol
You sure that’s enough though?
lol, sounds solid 👍
you know what's kinda annoying, extending match types but having them be event-based
so when you're extending methods they might be cancelled by the super and the state needs to be checked downstream
someone call mr java and tell them to make this less annoying
Yea, that’s why implementation inheritance in general is annoying
You get these really tight parent child class relationships
Well, parents and children lol
yea
That gives me the same vibe as using fclose in C on the stdout stream
books have a hard limit of 50 pages right? or did I dream that?
hm I'm reading 100 in reddit posts
Weren't they increased to 100 before
I had this situation. I load config data into special objects that store data about their sections. I have 2 files and their objects depend on each other. I will not be able to upload 1 file without the data of another and also vice versa what to do?
the only thing that comes to mind is to create a 3 object that stores everything in string or number values
two objects have references to each other?
almost
more precisely, the files have unique ids and 2 files use each other’s id, but in order to use them you need to collect the object of these files, but in order to collect the object you need to get the Id of another object that has not yet been collected
well one thing to consider is to make your concrete classes depend on interfaces (possible abstract classes) instead
another concept is ownership, that is that one of them owns the other, essentially making one of the classes responsible for referencing each other
the ugly way to do it is obviously lately use a setter to get the job done
i think i will use 2 option
yeah, then its likely to see similar semantics to
new Other(this)
in one of ur classes
As I understand it, this happens to everyone when they try to use objects that do not exist at compile time but only at process time
😂
what are DFU classes
Data fixer upper
Its a mojang lib that uses mathematical concepts to conveniently express transformations between data format versions sorta
like merging different data transformations, or optimizing them, or incrementally building them etc
Yeah well, one could argue for that the design is bad when this happens
tho I wouldn’t worry too much about that
interesting 😂
'convenient'
🥲
think u better run that a few more times
same vibe as
function test() {
if(condition) {
return;
return; // Protecting against solar flares
}
}
how to set noclipstate for falling blocks
What do you mean by coclipstate? Is that supposed to be an nbt tag?
no
in 1.16.5 nms you could set a entity to have no clipstate
so it can go through ground
but now i cant seem to find it
the falling block just falls and sets on ground but i want it to go thru the ground
Def need nms for that. Let me check if i can find something.
There is no field for that so you need a custom FallingBlockEntity implementation it seems
ugh
yo is anyone online who could help me figure out some things regarding building the architecture of my project? Working of a minigame network at moment and have questions how to improve what I've got so far and what practices I might use
In case you have some spare time to help me im in the voice chat
?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!
hard to explain in chat so in vc it's easier to show and explain
Gotcha, np
can u guide me how to do that
Wouldnt it be easier to use a BlockDisplay and let it fall manually?
how can i let it fall manually
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Display.Brightness.html set the block brightness
declaration: package: org.bukkit.entity, interface: Display, class: Brightness
o alr
declaration: package: org.bukkit.entity, interface: Display
idk I have only set block light to 15 and it worked
Does somebody know what the Bukkit.getOfflinePlayer method does internally? Is it expensive?
which one? String or UUID?
Under https://www.spigotmc.org/wiki/the-chat-component-api/#events, the code:
message.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Visit the Spigot website!").create()));
Is listed as the method for setting hover text of a text component. When I use this code in my IDE however, it seems to be saying that the method is depreciated. What would be the newer way of implementing some hover text for a text component?
Thanks.
Are you using paper
No, I am using Spigot
And the imported api on your ide is spigot?
Both
I'm not sure if maybe that method has been depreciated, but the wiki page is outdated
Let me double check, hold on
the UUID one shouldn't be a problem - the String one checks the cached player data and makes a web request to get the UUID if not found locally
Thanks
Yes, it seems like it is. It seems that I'm able to pass three different data types into the method, so I'm fairly certain it's only the data type that ComponentBuilder().create() is returning.
'HoverEvent(net.md_5.bungee.api.chat.HoverEvent.Action, net.md_5.bungee.api.chat.BaseComponent[])' is deprecated
teleportduration is for 1.20.x + i am on 1.19.5 ;c
wrap your BaseComponent[] into a Text(...)
new HoverEent(action, new Text(myBaseComponentArray));
Sorry, would you mind linking that for me? I can't seem to find HoverEvent in the spigot docs, so I'm guessing it's somewhere else?
https://ci.md-5.net/job/BungeeCord/ws/chat/target/apidocs/net/md_5/bungee/api/chat/hover/content/Text.html
the link is at the top of the spigot page you linked
declaration: package: net.md_5.bungee.api.chat.hover.content, class: Text
Also, would I be able to edit the wiki page for this method, or should I request that someone else does that for me? Thanks
If you see the Edit button on the page, you can edit it
Oh never mind, I was logged out for some reason. Thanks for the help! I'll edit the page now.
Is there anything in this code that could cause an unhealthy amount of connections? I have just experienced a "too many connections" error after having ran the api for 24 hours
https://paste.md-5.net/erecepuwoz.cpp
Yeah I know those exist but I never took the time to actually try to understand how to use them
so is there any other way to make falling blocks
Ktor (rest api lib i use) seems to have an entire guide on how to integrate hikaricp into it. I guess I gotta do some readig
I've set one up in my more recent plugin. If you set up your database accessor classes to use a method like getConnection() instead of creating a new connection, you can make the change easily.
This is the DatabaseAccessor class I've set up, but ofc you'd be able to do it another way.
To be honest, you don't really need to worry too much about how it works under the hood at all once it's set up
Thanks for the intel 🙂 I like understanding what I am doing though. This code seems intuitive enough indeed, but I'm still going to do some reading on good practices etc
Yeah of course haha. I found this post really helpful when setting this up, maybe it'll help you too :) https://www.spigotmc.org/threads/guide-datasource-and-try-with-resources-how-to-connect-to-your-database-properly.480002/
I've changed my Database class and it now looks like this:
https://paste.md-5.net/cecipireta.pl
Admittedly, this does feel much cleaner, especially the block in query that I added
What's the method to do coloured dust nowadays? I can't find any recent thread
I've gotten here
attacker.getWorld().spawnParticle(Particle.DUST_COLOR_TRANSITION, attacker.getLocation().add(0, 1, 0), 100, 5, 1, 5, data);
``` I'm not sure what data to put
public int countBlockInChunk(Chunk chunk) {
LevelChunk nmsChunk = (LevelChunk) ((CraftChunk) chunk).getHandle(ChunkStatus.FULL);
LevelChunkSection[] chunkSections = nmsChunk.getSections();
int count = 0;
for (LevelChunkSection chunkSection : chunkSections) {
if (chunkSection != null) {
PalettedContainer<BlockState> allState = chunkSection.getStates();
for (int i = 0; i < allState.getSerializedSize(); i++) {
BlockState blockState = allState.get(i);
// Check if the block state is not AIR
if (blockState != Blocks.AIR.defaultBlockState()) {
count++;
}
}
}
}
return count;
}
Hi back I'm exploring ways to optimize a block counting function in a chunk, and I'm seeking advice on potential improvements for better efficiency. The current function iterates through chunk sections, accesses a PalettedContainer to obtain block states, and counts non-air blocks.
The goal is to make this function as fast as possible. If you have any alternative approaches, optimizations, or best practices for counting blocks within a chunk, I would greatly appreciate your insights
This doesn't really answer your question, but It might be more efficient to iterate using simple for x,y,z loops than creating unnecessary memory overhead to iterate through sections, unless you do it asynchronously
Since the size is known, you could also cut the iteration in half
yep right
But what do u mean by cut iteration in half ?
Instead of iterating 16x16 you can iterate 8x8 and subtract from the 16th block. So you essentially do your air check twice in the most inner for loop
But if that really gives you any boost, only god knows
But I understood that using blockpalette was faster than iterate over all block someone explained this to me a little while ago
It might be, I don't know the underlying specifics of get block anymlre
U might want to have a look in Bukkit's source
Looking lovely!
anyone know how to disable a specific check in gradle's ktlint plugin?
HikariDataSource().apply {} \😉
and you could replace .use { rs -> block(rs) } with .use(block) if you really wanted
?
Oh yeah makes sense
doesnt that require me to declare all the rules I want to use in a file?
I want to use the default settings and only disable one specific check
💪
Try just disabling one and see if the default settings persist
Or maybe there's a default file somewhere
no reified generics?
Coolio:)
also where am I even supposed to declare this?
Not atm
.editorconfig
See the rest of their wiki 😅
I don't see any wiki? there's only a readme
and the readme doesnt mention anything about .editorconfig except that using an "additional one" is "not supported"
your wiki abilities are as impressive as ever 
yeah well where is it?
oh I only checked the gradle plugin on github, not that one
what happens if 3 different codes work in 1 event one after another?
like code process 1 -> code procees 2 -> code process 3 -> end event
in the event there will be 3 methods working with it, which method will work and which will not, will this cause errors?
all work
then what the effect will be
depends on the code ? xD
"what is the effect of three different pieces of random code running after one another"
Will the effect of method 3 cancel out the effect of method 2?
depends on method 2 ??
if method 2 sends a message to all players
but method 3 doesn't
that doesn't magically not send the message
The state of the event at the end is what matters
if method 1 mutates the event instance but method 2 mutates it again
them methods 2 mutation to (e.g.) cancelled state will take "priority" because well
its run after
let's say method 1 makes a broken block air and cancels it after method 2 drops the block via dropNaturally
you can literally just think of it as the code of the two joined
with methods 2 code running directly after method 1
okay so
if method 1 cancels it
and method 2 uncancels it
the event will not be cancelled
if method 1 cancels it
and method 2 does some other stuff
the event will be cancelled and method 2 will still run
so that means the subsequent effect of the code can cancel the previous one, as I understand it
in legacy version wath is the oak planks?
its like you put your stuffed teddy bear into the trash bin, then your mom comes and take it out from the trash bin which basically undoes whatever you did thus ur mom has a higher priority in what course of action was operated
if you send a message in method1, method2 can't stop that
i.e. only reversible actions can be reversed
like setting a method as cancelled
I'm talking about those situations in which the effects of the 2 methods are not compatible
give me an example
block.setType to air -> block.dropNaturally idk
if the event has a clone of the block (usually a BlockState) then that won't matter
i.e. method2 will still be able to drop the BlockState, but the actual block will be AIR
oh ok
That is a very brutal comparison 😢
is ItemMeta#getAsString() supposed to be valid SNBT?
hmmm
WTF
when was all of this added?!
I never knew bamboo planks were a thing?!
1.20*
It's SNBT, yes
You can pass it as an NBT suffix for items in a /give command
A while back
Using the hypickel money?
@worldly ingot Thanks dude youre a savior!!!

I'm glad you have so much free time to work on spigot!!!
Where would we be without you
Does this event exist? player receives message
Maybe PlayerAsyncChatEvent
Yeah that's just the chat event. You can check the recipients list
Or actually maybe could use CommandPreProcessEvent
how to use
?jd-s
Well, what do you mean with "receives message"
What kind of message? A private message via /w? Or a chat message?
declaration: package: org.bukkit.event.player, class: AsyncPlayerChatEvent
Does this mean I have to do the SNBT abstraction API
thx, yeah I thought it was bugged because somehow it weirdly escaped the item name with additional quotes but turned out it was just me printing it wrong kek
can I somehow keep comments and javadoc when I compile my jar so whenever I lose the source I still understand wtf is going on
or even better, put the sources into the same jar
No, both get stripped at compile time because they're not necessary in bytecode
You can compile a sources and javadocs jar, though I don't imagine the latter will be particularly useful
I constantly lose the source code of some small plugins I make and then when I need to change a little thing I gotta decompile
it takes like 30 seconds to upload it to github 🥲
I mean your alternative is to compile and save a sources jar each time you make a change as well
Arguably more annoying
oh I know
I'll write a gradle script that'll just put my source code into the jar lol
jk
I'll go with github
Particles are thread safe right
yes
Very thread safe incredibly thread safe it's so thread safe you'll go oh wow now thats thread safe!
also which jar did you use from BuildTools
You should just use the jar it puts in the directory you ran bt in
the jar from \Spigot\Spigot-Server\target
spigot-1.20.4-R0.1-SNAPSHOT
it's about 17 MB
also what is original-spigot
A good spigot jar is 50-60mb
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
no ._.
Use the one generated in the folder where BuildTools was ran
@inner mulch
don't open any of the sub folders
which is the bootstrap jar
Those are jars from different steps of the build process
ah
spigot first applies patches to bukkit and craftbukkit, and then builds those. It then clones those repos and turns them into spigot-server and spigot-api. does more patching, then builds them. Here is where the final jar is produced, it is then copied to the root directory and renamed.
so you can if you wanted pull the jar from the build directory that is the right one and use that
thanks frostalf
Rly?
idk probably they just send a packet
you can send packets asynchronously
Nah just wondering if that will be my reaction
oh, the voice channels are frequently used. I never looked into them so I cannot tell what is going on
What do we call a spigot developer gathering
Like, a bunch of crows is called a murder for exapmle
different people all dealing with a spigot? A plumbing company I'd say
That's a good one
I'm praying that this is working - multi-word arguments
looks like some live coding
Yea usually live coding/coaching
Nerd Herd
do something crazy and start streaming kotlin
Insane
suicidal to some degree
YES they updated holographicdisplays to 1.20.4, I dont have to recode any of my plugins which use its api
A fix to you being nerds?
🤔

look at my fancy /tp command
class BasicsTpModule(context: ModuleInstantiationContext) : AbstractBasicsModule(context) {
private val permission = permissionManager.createSimplePermission("basics.tp", "Allows teleporting")
override fun onEnable() {
commandFactory.parsedCommandBuilder("tp", permission).mapContext {
usage = "<x y z>"
path {
playerOnly()
arguments {
named("coords", XYZCoordsArg("Target Coordinates"))
}
}
executor(TeleportCommand(this@BasicsTpModule))
}.register()
}
}
class TeleportCommand(module: BasicsTpModule) : CommandContextExecutor<MapContext> {
override fun execute(sender: CommandSender, context: MapContext) {
val player = context.getOrDefault("player", sender) as Player
val coords = context["coords"] as XYZCoords
val location = coords.toLocation(player.world)
player.teleport(location)
}
}
Is there a way to differentiate between a code made inventory and a renamed chest? Itll be thru an event as well, is there a smart way of doing it
?gui
yep
good smile post
Ill report back if I'm dumb as fuck and can't fix it
inventory holders!?
no xD
||not on spigot||


💥
is there any way to teleport vehicle without unseating the player?
oh i could just tp the player
the nesting already scares me
parsedCommandBuilder returns a ParsedCommandBuilderFactory
mapContext returns a MapContextParsedCommandBuilder
path is a MapArgumentPathBuilder
arguments is an ArgumentBuilder
🥲
go ahead
you can write modules in java
run gradlew createModule, then enter java, then the module-name, and then you have a template for java
oh sick okay
I would have thought it would be weird to have both kotlin and java in the basics thing
I'm not sure how well the kotlin-java interop works though, e.g. registering commands using the ParsedCommandBuilder will probably be a bit nasty lol. But unparsed commands should definitely work fine
ah right
praise alex for writing the kotlin code java compatible
https://hub.jeff-media.com/javadocs/basics-core/javadoc/ I mean most things should be fine - but some functions expect a KFunction1 as argument or return Unit etc - although even those should work from java I guess
didn't you used to be pink
wtf
alex
who wrote that?
what the fruck

9 years old