#help-development
1 messages ยท Page 1072 of 1

finished doing the support ticket anyway
I really need to do stretches / yoga before worrying about lifting
OrbitMC DependencyTree code is being written now ๐ช๐ช
orbitmc?
Ala CabernetMC, MilesMC. LYNXPLAYZMC, PushupMC
OrbitMC by Ananas or something
RaydanOMGShushMC
miles you cant even do a push up
๐ why do you have so little faith
Ik it's not much harder but I can do clapping push-ups
I think I can manage with a regular one
can you do a pull up
Yes my triceps are probably the strongest muscle in my arm
how do I set a Attribute.GENERIC_MAX_HEALTH(10);
fun setMaxHealth(attributable: Attributable, v: Double) {
attributable.getAttribute(Attribute.GENERIC_MAX_HEALTH)?.baseValue = 1.0.coerceAtLeast(v)
}
In kotlin code
Is there any event that catches trident break pointed dripstone event? BlockBreakEvent not called though.
how to do in java?
its pretty much the same thing
same, use getAttribute() to get an instance and setBaseValue() to modify
max(1, v)
public void setMaxHealth(Attribute attribute, double v) {
attribute.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(Math.max(1, v)))
}```
@quiet ice I love you
this look-up time is just amazing
it's like 8x faster compared to a ConcurrentHashMap
and we're not even accounting for the trash it would generate
how do i stop an event from continuing to go through listeners
you need to cancel
depends on what you're trying to achieve there are many different solutions
something like this
listener1
listener2
stop listener
listener3
listener4
listener5
it should fire listener1, listener2, and stop listener
anti crash
ah I see
then here
you need to modify the listeners
themselves
hold on lemme send you how I did it
I meant the array
oh
pretty easy tbh
i thought you mean to modify each listener class
nah
Maybe u can't stop it from passing the event to other listeners
if ur using built in events
I know how to do that
I'd send my github with it
but github isn't responding
wtf
no
it wouldn't
ic
i sitll dont understand tbh
each event
is invoked with this
HandlerList
you can override this handlers var
and replace it with your own implementation
cant u just do it with reflect
nope
it's static final
I mean you can try
but I think last time I tested it wasn't possible
not really
this just counts the HandlerList
the actual invocation is here
~0.0035ms look-up time
nice
at a certain point, it's useless to be faster
I'm writing a firewall
pretty crucial here
in some cases even a 0.01 ms makes a difference
like here
but for an anti crash, most of the stuff is async anyways
like
all connections are async
but it still needs to be stupidly fast
doing the checks non async would be hella laggy
like imagine for each packet sent by any player you hold the server like 0.01 ms
more like a way to crash the server
(I do know that you're supposed to use iptables for that, but I'm doing it for the hostings that disallow root perms)
it's not actually that bad
like 30 max?
20 moving + 10 if you're doing a lot of other stuff
if each check is 0.0015 ms, which is almost impossible to be that fast
actually its not that bad
ms is still tiny
I mean, ConcurrentHashMap on my pc had 0.015ms
for ::get
which is almost impossible to be that fast
it's not
arrays r pretty fast
no like
xD
idk if each index is stored in its own place
it is
or if all of it is stored in the same place
it is
how can they both be right
ah
the next byte, whose memory address is just different by 1 (since it's a byte array)
will be the 1st index
computers r just fascinating
it can do stuff blazingly fast, yet we still bully them for running "slow"
yeah, I once read java achieves 70% the speed of cpp
yet still gets bullied for being slow
java is mostly bullied cuz of the syntax
https://streamable.com/wcr8lr btw have you seen what I made a few days back?
I like the syntax tbh
same
that kinda looks like a clock
idk if it is
yeah it was kinda the thought
but what type of captcha is that
a player joins and to captcha verify he just needs to select the red blob
i'm blind
i mean the hotbar says that
yeah it is
but why would a minecraft server need a captcha
ddos attacks
I wanted to rotate the entire hand but it didn't quite work
or is it some kind of anti bot thing
antibot
and bots
yeah well that would happen differently
bots arent a big threat to me ngl
not really sure how captcha could help
like imagine spending hundreds of dollars on minecraft accounts to bot servers
you dont stop a ddos by accepting them onto your server to solve a captcha lmao
you can forward them to the captcha server
I did it for non-premium servers
ew
and did it for spigot
I honestly always found way more cheaters on premium servers
and this is where our opinions diverge
i never found a single cheater since i bought minecraft
๐
i mean, did you play it?
alot
he didn't mean singleplayer
so I guess you were playing on creative servers only?
i mean, i'm not trying to be rude to cracked players. i'm just saying my opinions about cracked servers not the players
i was a cracked minecraft player myself for 3 years
im always on crack
ayo
stop saying it like you smoke crack
not that hard to retrace
we got here from the captcha not the anti crash
how many packets does someone need to send in 1 second for it to be considered crashing?
switch case
how do you just try that
i dont know how many packets a normal client sends a second
I have a question.
being a former anticheat dev, you can't do it this way
legit clients can send a lot of packets per second
for example because of lag
and your job is to account for it
true
How can send a message with my plugin and cut it into pages so that it isn't too long ?
cut it yourself
at each . add a new line
good way
every 10 lines add a new page button
would that work for a baltop command for exemple ?
can you give me an exemple because I don't really understand how I could do it ?
Thank you for helping me ๐
๐ณ I did not expect such an extreme difference
without looking let me guess enum map or something
lol obviously, its all synchronized
it's not
concurrenthashmap is
it only synchronizes on the currently modified bucket
or Node, if you will
CHM is much better compared to other methods of "concurrent" implementations of datastructures
si, yet thats where the performance downfall comes from lol
And ConcurrentHashMap is like only 20% slower than HashMap from my benchmarks so an 8x difference is a bit large as that would still surpass HashMap by like 6 times at least
i wonder if they actually tested it with JMH
or did the good ol System.currentMillis
I benchmark with in-field testing using async-profiler these days. Is it biased? Probably. But it's easy.
just dont benchmark and let the user figure it out
real
what's a benchmark, precious?
That's what I did with ConcurrentInt62Set tbh
stupid developerses, ruining server performance
goofy ass name
a pen on a bench
oh that's easy to answer, it's ConcurrentInt61Set++
you can store numbers that are up to 62-bits
It is because that is how it works for performance reasons - it's a set of 62-bit unsigned integers (https://github.com/stianloader/stianloader-concurrent/blob/main/src/main/java/org/stianloader/concurrent/ConcurrentInt62Set.java)
unsigned
yes
in what case do you need a set of 62 unsigned inetegers?
It's the largest size with the smallest footprint while still having all the concurrency guarantees
You can also use it to store a packed medium pair, which is what this structure was written for
1 bit is the read protection bit and another bit is the write protection bit
They both act together to prevent duplicate values within a bucket (as #add first needs to scan if a value already exists, then will set a value with the write prot bit set to true but read prot to false, and then look again for duplicates - if it found a duplicate, the value will be erased again otherwise it will set read prot to true)
how does it compare to ConcurrentHashMaps set view thingy?
Apparently 8x faster. Truth be told that is plausible if you have a high amount of buckets preallocated as it will rarely do iterations on the bucket's internal arrays. Further CHM will try to redistribute the hashcode to be even, ConcurrentInt62Set already assumes that all values have equal chance of occurrence (from a security standpoint it's a dangerous assumption, but it's great for performance)
can someone give me a brief idea on how a dark auction system would work (similar to hypickle)
i cant wrap my head around alot of things, like what happens if someone just bids something and somehow loses their money
Not really. While I've been thinking about doing it, it would require Java to expose CMPXCHG16B (or similar), but alas it does not
a good MC auction system would reserve the funds that a player bids
or have some sort of completion system
Just give back the funds to the bidder on overbid? Both are values already tracked anyways, no?
Though Int30 -> Int32, Int31 -> Int 31 and Int32 -> Int30 Maps are all possible under the current design.
Technically speaking that would suffice to store Objects if you are working with 32-bit refernces, but chances are you won't - hence you'd need more than 64 bits total.
Though uh, Java also lacks the means of converting between Objects and Integers so that isn't an all too feasible approach anyways unless one wishes to enter the realms of FFI/FFM or JNI
then its called gambling
how do i make sure that my plugin messages are not sent to the player?
cancelling the PluginMessageEvent? BungeeCord
yes
'org.bukkit.ChatColor' is deprecated what should I use?
no its not
Its only deprecated if you use Paper because they have a different formatting system called Adventure.
Otherwise ChatColor is perfectly fine.
also 'setCustomName(java.lang.@org.jetbrains.annotations.Nullable String)' is deprecated
Again: Its not. Only if you use Paper
I am making a vanish plugin but I have a problem, players can't see me but mobs can see me and revelate my postion to other
I have try https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityTargetLivingEntityEvent.html but we can see that mobs try to target and it revelate to other player that someone is vanished.
any idea?
just setInvulnarable and mobs wont see you
what event gets called when a play get any item in their inventory?
declaration: package: org.bukkit.event.entity, class: EntityPickupItemEvent
There are more than half a dozen methods which could result in an Item appearing in a players Inventory
there is one event specific for players afaik
Its deprecated
disgusting
Why so?
I refuse to elaborate
Is there and inventory change event?
Persistent data Container (pdc)
is it a good way for item with abilities etc?
wdym?
You can add a tag to the pdc to identify it
then on click, check if the item has the tag
then do your abilities
Yes, although you should find a way to minimize the amount of data store on the ItemStack
yeah I just store the abilitie name?
Yes
I plan to also add a raritie system should I also apply them on the items
just add a rarity tag
ok
crisis averted, for a second there I might actually hit 100k lines of code for my main plugin
now I'm just shading the core of it
what is your plugin abt?
True for zombie, but no True for animals like cow or pig
all in a Main class of course
smoking dank weed
do you need help
[14:50:54] [Server thread/INFO]: [PreBuiltStructures] Confirm placement - Target: Location{world=CraftWorld{name=world},x=-47.0,y=131.0,z=-152.0,pitch=10.184632,yaw=3.9626145}, Opposite Corner: Location{world=CraftWorld{name=world},x=-43.0,y=133.0,z=-148.0,pitch=10.184632,yaw=3.9626145}
[14:50:54] [Server thread/INFO]: [PreBuiltStructures] Overlay dimensions: 4x2x4
[14:50:54] [Server thread/INFO]: [PreBuiltStructures] Schematic dimensions: 5x3x5
[14:50:54] [Server thread/INFO]: [PreBuiltStructures] Calculated paste location: -47, 131, -152
[14:50:54] [Server thread/INFO]: [PreBuiltStructures] Pasting structure at: (-47, 131, -152)
Good thing my logging fkcing helps
Are you competing with rad
(the overlay / schem dimension discrepancy are unrelated, this is because I hardcoded the schematic used in that function)
No this is an unrelated project actually
i mean the location can be the same, the direction can be different
is this good for custom items ? https://www.spigotmc.org/threads/custom-items-made-simple-code-guide.609537/
https://gyazo.com/93b84b81fe074f03520d013428ed10b4
previously with a hardcoded offset for the paste location, works in all directions but only for this schematic smh
I love math so much
Keep in mind, at this point I've pretty much removed all manipulations of the blockvector3 object used for pasting / overlay display
Well between them I mean
Ie: vectors are the same for both overlay / pasting functions
@quiet ice
could you write me a non-concurrent version of the Int62Set?
I'm honestly not confident in my own abilities to remake your class
I suppose I could, although quite a lot of things could then easily be nuked
wdym by nuked?
ah, removed?
Are you sure that Fastutil's LongSet doesn't win out here?
oh wait
there's fastutils
IntLongSet, is that a thing?
IntLongSet?
whats the meaning of the 62? bits?
I guess IntOpenHashSet
ye
pretty sick
and I still don't get how the control bits work
I'll guess I'll use this if I ever need
anyway, this class is still very useful to me
but what did you even use it for?
WHAT ARE THOSE WORDS
triangle of stars
FAST
When a player join to the server, it writes Invalid Player Data. New players are not let in at all and old players once in a while
[23:17:36 INFO]: UUID of player FanatRegionUa is 99d151af-3997-305a-9e68-f7d38c5ee9e8
[23:17:36 INFO]: FanatRegionUA lost connection: Invalid player data
It has no meaning lol - I began with FA as a reference to FAWE and once I appended "Star" to it and saw FAS I instantly knew I had to append a word beginning with T to make it FAST
aaaaaaaa
nice
Fast Alix System Tetrator
FAST
It's still a bit slower than I'd like though, it spends too much time blocking in the spin wait loops
Might be better off in #help-server ? Or what is the connection to actual dev work here?
Also gotta love how this is like the 10th time people are confused about the properties of ConcurrentInt62Set even though it's exactly what's written on the tin
thank
I should probably publish it to maven central soon-ish, though I think the ConcurrentInt62Set has a rather rare (and thus hard to reproduce) race condition related to the control bits. I'll need to look into that before publishing.
developers when they see a number in a class name
At least it's not a map. Having something like Int312Int31Map would be hyper cursed
"have to be something internal"
Int30Int30ConcurrentOpenHashMap
Yeah I suppose dropping the 2 makes more sense
Also, fastutil versus fastutil-core as a dependency for a library?
Technically only fastutil-core is needed, but I'm afraid it'll brick the dependency graph
it could just be an extension to the fastutil lib
As of now it depends on fastutil already, though it should only depend on fastutil-core
That being said, I don't think all too many will be aware of the fact that fastutil is a superset of fastutil-core and shade in the full thing twice by accident (or rather negligence)
does anyone know what I could do for this to not be considered "dynamic"?
doing ByteBuddyAgent.install()
btw
for geol's set the look-up time was 0.0035 ms
Is geol a professional developer
for the fastutil it's 0.005ms
and this mf is non-concurrent
java is making loading agents require explicit consent
same for unsafe and jni, for some stupid reason
but spark also loads a bytebuddy's agent and this message doesn't pop up
??? why JNI
seems restarted, yeah
forgot the exact details
INTEGRITY
integrity by design โข๏ธ
cuz fuck you, integrity
First I had to stick to java 8 for years now I gotta stick to java 21? ๐ญ ๐
I'm just gonna do what should always have been done
While I might pass off as one, no - I'm not a programmer in a professional setting. I'm not even interested to work there in the future, but we'll see what future beholds for me
override System.err
what do you know so much stuff for
Blame autism probably :p
Understandable
It's such a great thing when it doesn't fuck up your life
Sometimes I'm thinking that it would be great to have autism
But I think it's always a tradeoff, one thing for another
I'm kinda left off lucky on that front since I have almost none of the downsides of autism (even compared to other people with Asperger's), but the few downsides I do have I really hate. Being unable to proper communicate with most people is just jarring. Especially when it comes to people you love since communicating affection is one other world
ow
cuz no idea what else to do
What does Spark even use Bytebuddy for?
all i know is that it segfaults the jvm when using JBR
Description The JVM segfaults either on server initialisation or once starting the profiler. Only happens when running the server with the Jetbrains Runtime. When using something like Adoptium, it ...
could be a bug with async-profiler, who knows?
ยฏ_(ใ)_/ยฏ
that's why I reported it
since paper ships with it now i can't use JBR until this is fixed :p
(it segfaults on init or on profiler start, pretty random)
Lmao
yup, sucks
It's particularly bad if you have a crush on a girl that probably is autistic too (although in that case it was undiagnosed, but later on I figured out that she likely was on the spectrum), so you'll end up in a deadlock. On the other hand, I can't quite imagine me being together with "normal" people, mostly because interests diverge too much, but we shall see.
People are strange, anything can happen
relationships are temporary the grindset is forever
What about kids
buddy I'll be grinding in my afterlife if it turns out there is one
oh, i thought you were talking about work
I am
grinding work
You better pray every sunday so god permits you to
I don't have a GF, but I almost could have gotten one. Though it would have been incredibly awkward for both of us if that happened, so I'm not entirely sure what my definition of almost is.
You don't have a job if your occupation is a hobby
no, but you can have a grind
However, don't let your hobby become work - incredibly important distinction here but I don't think anyone (not even me) knows what that distinction even is
or, you know, do, like I did
almost is not have, so there's work to be made
it's a lot of fun
which hobby are you refering to?
Programming lol
why would programming be a hobby?
i like programming more than a hobby for example
i don't know what i can say about it being a hobby for me
Then your priorities are a bit misset
just get an ai gf
what a wild thing to say
so what do you think my priorities should be then?
Oh god no.
ai gf are no good
was kiddin
rather burry myself alive instead
(Says the guy spending 60 hrs/week doing programming or related tasks)
rookie numbers
I woke up nearly 24h ago and only took a break to hit the gym
wait actually no I forgot when I woke up, it's not that bad yet but I'm not done yet
hmm only 8 hours a day
24 hours of coding? that's nice
I'm having fun
I'm actually really happy
this shaded core library is actually really cool
only thing is sleep is non negociable
it's going good
so you're gonna do worse in the long run
yeah well, sitting in front of blue light isn't really a good way to tell when you're tired
i found out i only need like 4 hours of sleep with the current sunrise time
im probably wasting my sleep in the long term
if I don't feel tired and I'm performing well then it doesn't matter if I'm tired or not
also I've been doing this for nearing 11 years now
so
i always say sleep is for the weak, guess il find out in a few months
that's why you go to the gym and lift the big boy weights
nobody beats physics
did some nice calf raises today
i really should join a gym and get some muscle
i bet the girls will be all over me after that
surely
hi! Im trying to use nms but I have this issue, using 1.20.4, my pom.xml:
https://pastes.dev/Tz0hSl73ah
You need to build 1.20.4 with BuildTools using the --remapped flag
you need to use buildtools with remapped flag
I think I might end up creating 100 new classes tomorrow
this is going to be kinda whacky
new project?
this enabled, isnt it?
reason why i am not really a fan of annotation commands
gui user hehe
i saw some horror things regarding that
yes
intellij says my project has 1208 java classes
thanks!
I didn't know I crossed the 1k threshold
so what takes the lead then, if you don't mind me asking?
1000 still sounds like a lot
probably defaults initialization for plugin content, the way I have it set up it starts up from classes
a custom boss is a class, a custom item is a class, so on
and they get initialized via reflections
just for the defaults
oh i see
then there's at this point tens of thousands that get initialized from config files if people install everything
yeah it's getting to be a problem
i can tell
1000 classes seems like too many for the projects i currently own
i have like 15 classes for my config system
and that's because each data type has a class for deserialization / serialization logic
yeah I have quite the config system
The last one I worked on had 4 classes
i really like what i did with this
i don't see myself ever using something different
the end result is something like what configurate has
with annotations for each field in a class
yknow
I bet chatgpt could write a lot of these
it's pretty repetitive
and pretty simple
yeah... definitely worth a try tomorrow
chat gpt can get me so far before it's useless to me
at first i liked the output it gived, i was learning
it's a tool, not a replacement for a programmer
but it succumbed to streamyfing everything and calling that a simplification
I'm sure it can do this because it's literally taking from one template to put it in a differently formatted template
i agree, so far it's not as good as i want it to be
alright this day's been plenty productive, time to call it quits
i like for example how easy is to extract some data from a thing without me having to write code for it
alright, take care
@blazing ocean btw great call with reposilite, I'm actually really liking it and it's so much easier than sonatype, thanks
yeah I don't know how online services managed to make it more laborious to use them than self-host
that is a thing of wonder
i have yet to make an online repository for myself
all my projects are private, i don't see the point yet
rad uses reposilite?!?1
packed promo!?!???1eleven
orbit mc mention1?!?!/1 aka @river oracleMC aka lynxplayMC aka cabernet mc aka kryptidemc aka minecraftmc
https://maven.radsteve.net/#/public/net/radstevee/packed packed mentioned!!!???!????!!!
i publish sources
don't mind me if i look at packed source
oh theres sources on latest
kdocs are at uhh https://docs.radsteve.net but a little scuffed
convert gfm to javadoc jar smh
go ahead
uh kotlin, i regret looking at this
a javadoc type
or a dokka javadoc format
maybe i'll try it
gfm is shite
what does packed even do? i see keys, i see blocks i see items
RTFM
ill rtfm ur mom
that doesn't give me anything to go on, i'm not familiar with the abreviation
read the fucking manual
you can modify a resource pack on the go?
does the client allow this? i didn't know
well no
it's meant for generating resource packs on server load or when you're changing it
oh
should probably change the description a bit
yeah, it's a bit missleading
ask chat gpt
it does a good enough job
altho i don't like the 1900 style of writing
So, i was making a config and i notices that all the comments i put onto the cfg were removed when i start the plugin
How can i fix this
pre-build
and after
dont save it
are the comments in teh config.yml you put in teh jar?
only write the default config using saveDefaultConfig() and then don't save it again
I use that
or you are using an old spigot that does not support comments
What do u mean for dont save it
1.8.8
It was also not working on 1.18.1
Only the comments in the top are keeped
do not use FileConfiguration#save(...)
I do not use that
you do
i need to remove saveconfig?
yes
replace BOTH those lines with saveDefaultConfig();
if player logs out will bukkit task scheduler still work?
the scheduler has nothing to do with players existing
the server will still tick, and the scheduler will run queued tasks
is there a way to detect a headshot with an arrow?
not without diving to nms
how would that be done with nms?
in teh ProjectileHitEvent (Paper) exposes teh hit location
not available in Spigot though
ok
No but you can compare the location of the projectile in said event to the entities eye location
Seems I'm also wrong about it being in Paper
ok
I could have swore there was a HitAt or something
there is an easy way to do this depending on what you are making. If this is for some kind of game event then the ideal solution would be to create a bounding box around your players heads. This way you are not having to calculate distance from the eyes to various parts of the head. Also to increase accuracy if you want to be sure it did in fact hit them there is another event that lets you know if an arrow stuck into an entity called ArrowBodyCountChangeEvent
okay thanks
Anyone have an understanding of how chunks are packed and sent to a client. I cant figure out how to send chunk data so my server is empty. The client can connect but is stuck in an empty world. From what I have seen, Gzip is the compression algorithm used but I cant seem to get it working (attempting to decompress the byte array for chunk data to have a way to test back and forth).
Everything else seems to be working (players can join correctly) and now i just need to generate chunks. The current way im getting around this is by sending already compressed data intercepted by a working server and Wireshark.
For the Gzip examples i have found, all of them include all the logic then just call it. Since I'm writing my server in C, most of the examples are only useful for pseudocode but are useless when they abstract away the actual logic.
chunks are sent in columns
16x16x16 right then the stack is sent
I only remember the old way, it was something like 4x256x4 or something like that
as I said columns
we understand chunks as they are stored, but sending them is done differently
there is a wiki page that describes how chunks are sent, in fact I think wiki.vg does as well
I have been following the wiki but am stuck on the byte array of compressed chunk data
I dont actualy know how to compress the data i have. I have tried Gzip but it just breaks everytime
from looking at the wiki.vg, the bytearray is sections that contains biomes
that tells you how the data is formated for the sections
Oh sorry forgot to say this: im working on 1.7.2 so i have to use the old wiki https://wiki.vg/index.php?title=Protocol&oldid=5486 / https://wiki.vg/index.php?title=Chunk_Format&oldid=5218
1.7?
yea
let me try Zlib compression of my world data and see if that + the headers i have will work
I must have missed that the last time
So i have to send the entire vertical all at once
zlib deflate is what is used
is Gzip for newer versions. I realise i wasted 6 hours trying to get Gzip working
if I recall gzip has its own implementation of zlib that is not quite the same as it has minor changes
therefore you should use the zlib that comes from the mc jar
this way you are using the same version as the game uses
alright, let me go try that
a chunk section is 16x16x16, and a chunk column is 16x256x16. so that means there is 16 sections in a chunk column. and not all sections need to be sent
which most of the air blocks above a certain point for example don't get sent usually
air blocks are also not sent as well, only if there is a block in a certain location is sent, which reduces overall size
also note that the amount of chunks sent at a given time in 1.7 is different from the updated versions as well
would i be able to get around this by using the multiblock change instead of sending the chunk, Will the client crash if it recives block data in a chunk it has not been sent?
it would be horrendously slow but then i dont have to compress
client won't crash, but if the chunk is not loaded and it recieves data for blocks in an unloaded chunk I believe it just ignores it
but multiblock change should cause the chunks to get loaded though if you use that method
however it may cause some lag on the client if you send a large amount of data in regards to block changes
we're so old... it's not even 256 anymore...
right, but on 1.7 it is
yea
That's fine, Im doing this as a project in C, it dosent need to be "Playable" right now this is all i have
I'm going to kms
there is a project on github that made 1.7 in C if I recall
if you verify you can use them
oh
!verify
Usage: !verify <forums username>

You need to boost for external emotes
oh interesting, did not know that
I believe us staff can use them too, but I donโt have nitro lul

@young knoll you can suggest md5 give nitro to staff 
Do you guys ever feel like it and change the DPI on your phone?
is there a way to convert an ItemStack to String and then back to ItemStack?
what values would be lost (if so)?
yes, encode
base64, binary, pretty sure yamlconfig has a toString
of you could go with something custom
or ItemStack#toString() and https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ItemFactory.html#createItemStack(java.lang.String)
does toString include nbt?
No clue, but I remember Choco talking about toString() and the ItemFactory a while back
Will try
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
if not, i use this
BukkitObjectOutputStream
it saves UNSPECIFIC_META
How do I package a jar with Gradle?
./gradlew build usually does the trick
Other alternatives are ./gradlew shadowJar and ./gradlew reobfJar if you're running paperweight
Hi!
https://lunr.pics/JWmQ4BDq.png
I am trying to find the location of the end of the 4 cannons in the photo above. I am doing this cuz I want to shoot lasers from them. I would appreciate if someone could tell me the logic needed to fix this.
The problem I am facing is that as the player changes pitch, their perception of the vehicle changes. (ie it might look closer or further)
My vehicles are also set up kind of sketchy.
I have a slime that moves on awsd,space, and shift,
a zombie that repeatedly teleports to the slimes location (the model is an item with custommodeldata on its head),
and then the player is riding the slime
My explanation is definetly confusing so please ask questions.
you would have to get the relative coordinates of each point of the cannon and apply a quaternion transformation to rotate it with the player's pitch and yaw
you can do it all with vectors pretty easily
Vector has the rotatearound method
Is there an event that's get called if player's heart value change?
For instance, if player got damaged or got healed by regeneration potion, etc.
so they get healed or get damaged?
Hmm, I guess I could use those events, nvm I'm overcomplicating stuff atm lmao.
ive been able to get the position of each cannon when the player is looking parallel to the ground using vectors
the problem is that when the player looks up or down, the model looks further or closer, changing the distance of the cannons from the player
is there a way to keep the distance the same? whats the best way to make a modeled flying vehicle?
hmm i thought the vector would've accounted for that?
do you have a visualisation
zero the Y axis, then .normalize()
no imports, full path every time
perfect
also you need to import methods declared in the same class
including recursive methods
How I can get nms player channel in recent version?
I'hv done that
Player p = Bukkit.getPlayer(pname);
CraftPlayer craftPlayer = (CraftPlayer) p;
ServerGamePacketListenerImpl connection = craftPlayer.getHandle().connection;
but Idk what get after that
?xy
for what
just to understand how work nms
That's a wrapper
PRetty sure that .pipeline cones next
Might be a geyser thing tho
What api ver
1.20.6
You want to get player's connection?
yes
channel
then channel pipeline
item.getItemMeta().getTool().getDefaultMiningSpeed()
item being ur itemstack
is it possible to adjust actionbar position?
yes, with fonts and negative spaces
are you talking left/right or up/down
you're gonna need custom fonts and negative spaces for htat
hummm ok i guess ill google for some
is there a way to use a debugger in spigot?
remote debugging
?
Does anyone know an API to create inventories in a much faster way?
Wdym
FastInventory
https://github.com/MrMicky-FR/FastInv
goated lib, simple and easy to use
Simplicity is nice, sadly it usually compromises on scalability and often hinders complex behavior
i have to leave for vaca for a few days iโll send when iโm back
I can't find anything in the code that would contribute it to be "fast", actually the opposite as there is a lot that could be optimized. Minimal would probably be a better name
say it to repository owner
Fair. Just saying that there's possibly better solutions, if efficiency is a factor
Hey
In newer version ClientboundAddEntityPacket is sent in ClientboundBundlePacket
But in older versions like 1.18.2 bundle packet doesn't exist and add entity packet isn't sent individually. How is it sent?
Is it actually?
Yes, I'm listening to ClientboundAddEntityPacket individually and it doesn't work
I believe I'm not doing something wrong
(it was my bad, it's sent individually)
Does changing a player's GameProfile in PlayerLoginEvent change the player's skin on join?
Or do we have to send a respawn packet for it to apply
I have doubts that it is any faster to use than any inv library out there
Especially since it's very limited and you have to code basically every UI component yourself
Debug why Gradle can't find it
how i debug
Maybe you are not adding an appropriate repo
compileOnly(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
repositories {
mavenCentral()
mavenLocal()
maven("https://jitpack.io")
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://repo.codemc.io/repository/maven-releases/")
maven("https://repo.aikar.co/content/groups/aikar/")
}
dependencies {
compileOnly("org.spigotmc
1.8.8-R0.1-SNAPSHOT")
compileOnly("org.projectlombok:lombok:1.18.32")
compileOnly(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation("com.github.DevNatan:inventory-framework:2.5.4-rc.1")
implementation("me.devnatan:inventory-framework-platform-bukkit:3.0.8")
implementation("co.aikar:acf-bukkit:0.5.1-SNAPSHOT")
compileOnly("com.nickuc.chat:nchat-api:5.6")
annotationProcessor("org.projectlombok:lombok:1.18.32")
}
works on other dependencies on lib folder
but this specific .jar no works
Why are you adding the dependency outside the dependencies scope?
Oh it was just to point out.. mh interesting
Have you tried reloading everything?
I had sent the message separately
yes
close the intellij too
and open again
Have you tried refreshing dependencies?
Double click the jar file from intellij and see if it is the right package you are trying to import
Heyy guys
I selected a head with the (Kulls - The Ultimate Head Database) plugin and equipped it on a piece of armor. I want this head to contain specific items. I am looking for a plugin that will allow the head to break and drop the items inside when right-clicked. Which plugin can I use?
Seems more like a question for #help-server if you donโt know how to make the plugin yourself ๐
oh yea sorry
Weird, maybe itโs some kind of broken cache.. try refreshing dependencies again, I mean right click on the project on the gradle side bar and select โRefresh Gradle Dependenciesโ
i already do it ๐ญ
is it possible to just do setMaxHealth(0) to erase the health bar?
im just wondering what will happen if i do that... lol
Try and see
it only puts you at half a heart
prob need a resourcepack to get rid of healthbar :/
you can set some shit like wither hearts to an empty texture
humm ok ill check that out..
kinda wanna make something like hordes.io but in minecraft lol this is ganna be one long journey
Can you change the protection level of an armor piece ?
Like the bar displaying the armor toughness
if client send place block packet but for the server the client is in spectator, events will be called?
Yes
it ried
but no works
tried
you can't place blocks in spectator made.
if you are expecting the spectator to be placing
yes I know but if client sent place block packets
If the server thinks the client is in spectator but the client still sends a block place its unexpected behavior. Outcome is uncertain
ah yes I have test and yes
https://paste.md-5.net/osexekijob.java
just started messing around with packets. need someone to help me out here.. trying to make it so when a player opens advancement tab, it would cancel the event and force player to do command. The code just stops at line 27
and also the code only works when player is closing the advancement instead of opening... idk why
Protocol lib ๐ฆ
yup using protocol lib
Use packetevents
retrooper/packetevents on github
Its more fast and simpler
hummm is it this:https://packetevents.github.io/com/github/retrooper/packetevents/wrapper/play/client/WrapperPlayClientAdvancementTab.Action.html
or this:https://packetevents.github.io/com/github/retrooper/packetevents/wrapper/play/client/WrapperPlayClientAdvancementTab.html
declaration: package: com.github.retrooper.packetevents.wrapper.play.client, class: WrapperPlayClientAdvancementTab, enum: Action
declaration: package: com.github.retrooper.packetevents.wrapper.play.client, class: WrapperPlayClientAdvancementTab
.-. my brain cant handle all these api
i need some help
Init the packetevents' api in the main class
Make a new class and implement PacketListener
Then make a onPacketReceive function with PacketReceiveEvent as event
now create a statement where if event.getPacketType equals PacketType.Play.Client.ADVANCAMENT_TAB initializes the Wrapper for that packet
and then do your things
the action is just something you use when constructing the packet
i need help
for some reason when i run my start.sh on my vps in just 15-30 seconds my server shuts down
and in the console dont send any message from an error
like if u press CTRL + C
its bungeecord
@worldly ingot its probably not perfect, but I wanted to try to help out a bit
https://hub.spigotmc.org/stash/users/2008choco/repos/bukkit/pull-requests/1/overview
I cant use the spigotmc website, it's saying that I got banned temporarily from accessing the website.
Error 1015: You are being rate limited
Is this just a bug?
Wait like 2 minutes and try again.
https://paste.md-5.net/akofidoqac.java followed the sample i dont really know what i'm doing wrong .-.
WHAT IS THIS LMAO
Did you follow Packetevents' guide?
this was the sample
follow the attack detector
example*
the attack detector example
!!!
I have a question regarding class loaders. Atm I'm making a classloader for plugin loading. However, I am giving plugins the option to not add other depended plugins into their classloader
I'm not sure where to really start doing this tbh
that last part doesn't really make sense
I've not really worked extensively with them and the resources seem fairly stark
havent understood the sentence
disallowing dependencies from obtaining access to your plugin class?
more so you disallowing yourself from access to a dependencies classes. E.g. lets say you have a bootstrap plugin and you can simply use the Server API you don't need to add their classes to your ClassLoader
There is a hierarchy to the class loading chain. Ideally each plugin has their own classloaders which is extended from the server, the server has its own classloader which is extended from the JVM
I've already got the server bootstrap down so I've done the first part where the server has its classloader
you wouldn't really be able to disallow access to another dependencies classes as its simply just finding the classloader responsible for it and accessing from there
how work event canceling with packet? server send a packet who cancel the action? (for example if I take an item in a slot, server send a packet who place this item in the slot?)
okay yeah I think I get what you mean here.
the question is though if 2 plugins depend on eachother how would I go about joining their loader perse so they can ensure the plugin classloader can find the correct classes
thought you wanted them separate?
by default pretty sure if a lower classloader loads classes, the higher up loaders have automatic visibility of that
so If I wanted to do this I'd need to override the URLClassloader and do some shenanigans
not necessarily, if you wanted them to be separate you can, just that you wouldn't prevent complete separation. So you could make it to where a plugins classes are not automatically visible to another plugin, but you would need to run like 2 class loaders for your plugins.
whats the reason for the 2nd class loader when doing that
well the default setup is that the plugins classloader is going to register classes to the loader of the server or the one thatt is managing the plugins overall
this is how other plugins can see classes
the second loader would simply not register those classes higher up
but, plugins loaded with the second loader though wouldn't be accessible via classpath
instead they would still be accessible if they are in the same directory
since the classloader of the plugins can still load a jar
does anyone know why my bossbar keeps resetting to the max?
hmmm I was going to just opt to skip that for now, but if I want other plugins to beable to bootstrap dependencies pretty sure I'd need to prevent them from leaking up to the Server loader
especially in the case of overlapping dependencies of different versions
you will probably need to override the classloader and make your own then
code would help
never done this before time to break a lot of stuff ๐
fortunately making your own classloader isn't super difficult
yeah I know little to nothing about class loading currently
its basically glorified file loading
except you don't need to read the files yourself
could be because you are always creating a new one
rather reuse it
im actually so dumb
thanks
I don't have the brain capacity to write a classloader rn guess I'll be doing that in a few hours lol
lol
figuring out where to start uses a lot of brain power
this is why copying was invented
see this project is already yielding me great knowledge
I get to learn about ClassLoading
prob gonna look at the JDK
probably a good start
Looks so much better thanks!
looks like a plugin i made lol
made skill xp requirements follow a mathematical formula defined in config
glad to see
SynchedEntityData data = ((CraftPlayer) player).getHandle().getEntityData();
data.set(new EntityDataAccessor<>(6, EntityDataSerializers.POSE), Pose.SLEEPING);
data.set(new EntityDataAccessor<>(14, EntityDataSerializers.OPTIONAL_BLOCK_POS), Optional.of(BlockPos.ZERO.offset(player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ())));
((CraftPlayer) player).getHandle().connection.send(new ClientboundSetEntityDataPacket(pInt, data.packDirty()));```
what's wrong with this?
wdym
[11:51:44 ERROR]: Error sending packet clientbound/minecraft:set_entity_data (skippable? false)
io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:set_entity_data'
throws this error
player is the player, pInt is the .getinteger for them
on the client i very briefly go sleeping and then it promptly kicks me
Hi, I'm trying to create a plugin, but when simply using ItemStack stack = new ItemStack(Material.STICK);, the legacy material support turns on with this message:
[org.bukkit.craftbukkit.v1_16_R3.legacy.CraftLegacy:<clinit>:257]: Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!.
Can I do something to prevent that?
I have my api-version set to 1.16.
Does anyone here have itemsadder plugin purchased?
Hi, I'm trying to create a plugin, but
Nahhh
This banned
Grom2018 what is bro typing ๐ญ
Hello can someone help me with this, its my first time trying to set up a minecraft server:
I can ๐
okey thanks
can i send you the error?
Sure bro send it in here
i cant somehow.
i tried it wont let me. It says i denot have the permissions to send like Pioctures or text files.
Yes
Usage: !verify <forums username>