#help-development
1 messages · Page 811 of 1
C/C++ isn't hard its just different
WHAT ELSE DO I DO
no im referring to reverse engineering those
he's a beauty isnt he?
Shooting myself in the foot isn't an issue I had myself, yeah since it's programmable it allows you to do a lot more, but for me maven is just incredibly verbose, hard to read and generally slower. One question that comes up to me is why you don't see a benefit in using the groovy dsl at all
yew leaked yer email
everything legacy is beautiful
groovy 😨.
Groovy is a pain in the ass, the syntax highlighting is shitty and so is the auto complete it makes the build files a literal pain in the ass to make I much prefer to just use kotlin when I get around to it
i dont care
!
i have it public on
spigot
ig
idk
ok
also I do have slight brain damage so I love xml
ur disgusting
how would you like
xml
that shit isnt readable
you the type of person to avoid using yaml for your configs and instead use xml
I use json
its if html was fugly
html also shit
Yeah, you don't get proper type completion with groovy, but at least currently it's actually faster than kotlin. There are some longstanding regressions that make kotlin slower than Groovy. Given the protect size most minecraft plugins though, that's negligible
Valid
I'm starting to like toml
javascript is if java didnt require classes and was dynamically typed
main thing rn though is I don't have the time of day to learn gradle, It took me like 15 minutes to fully leverage what I needed with maven. The docs for gradle as far as I've experienced have been horrendous and I don't have the time going around and searching through random stack overflow threads to copy paste an answer that wasn't really explained well
JOMLConfiguration when
omg just use .txt as config files
!
ok, now that i used BuildTools for 1.8.8
how gradle can import that
Can anyone explain the differences in syntax between pdc and metadata please?
In my experience the gradle docs are actually pretty good once you got a really basic grasp of gradle
pdc is permament
metadata is temporary and leaky
aka metadata kinda suks and PDC is pretty great!
So for example I would set my namespaced key to whatever and plug in the values?
im actually about to punch a hole in my wall
?pdc <3
I was reading that, just having a hard time understanding the syntax
so my server keeps saying address in use even when im running kill -9 $(lsof -t -i:25562) after the server stops
maybe after finals 🥲 I've got so much learning rn though idk even if then I'll have time. I'm still learning C, server internals for spigot and nms as well so I can more effectively optimize spigot
I also still have a few PRs in my backlog I haven't been able to start yet
FINALLY
so for the time being we cope with maven :P
sudo reboot
Gradle always breaks when I use it
goot idea
what do you need help understanding?
its so easy to shoot yourself in the foot if you don't know whats going on :P
Usually ends with me spending hours trying to fix it
or ss -tulpn to see pid using that port
What made me change to gradle was the process of delomboking my Sourcecode to attach it as a sources jar. That was the biggest PITA in maven
Like 250 lines of buildscript for that shit alone
I just don't use lombok 😎
gradle is ez
Also valid
@river oracle just get good bozo
Gradle has been something I've had my eye on for a while though
mostly because of kotlin scripting
i will fight you if you kotlin for spigot
@young knoll can i bother u?
always bother coll
do you though
NVM omg CHICKEN NOODLE SOOP!
bye everyone
okay
bye
!!
WHY MAKING ADAPTERS IS SO DIFFICULT
Because that's not api thats supposed to be interacted with
thats the bukkit package
craftEnchantBookMeta is craftbukkit
so in org.bukkit.craftbukkit not org.bukkit
🤓 org.bukkit.craftbukkit
shut up miles
yea it is that way
error says its
org.bukkit.craftbukkit.v1_8_r3.inventory.meta.CraftEnchantmentBookMeta
but when i see on code
do you have just spigot api
if you only have spigot api craftbukkit wont be there
IT DOES EXIST
just imported
craft bukkit
with gradle
here it is
but i can't import it
its like this
is it package private
do you have mavenLocal() in ur dependecioes
just image i spelled that right
I'm getting trolled by resource packs
It might be package private tbh
mavenCentral
you need to ad mavenLocal too
i swear to god if its that
somehow this model and this model alone has extremities that go over the rsp size limit
im gonna cry
it probably is
no it isnt
?paste ur build.gradl
i hate craftbukkit
hm
holy fuckin shit
why does it exist?
cause yes
and make it compileOnly
dont shade the spigot api holy fuck
dont shade spigot either
thats what you DONT want to shade
compileOnly made it
then reload gradle and check
craft meta enchanted book is package private
how do i check that
thats why you cant import it
you would need to use reflection
its super fun
i understand the concept
but idk how to like
code it
same as LinkedList 😻
dont know how to code it
!
try and write a serializer for enchanted book meta first
thats probably it
It is
write the adapter for the data from the meta
Average minecraft dev read documentation / Google their problem impossible edition
Don't judge man us minecraft devs can't read
?
Also miles, I got my company to pay me to learn rust, even though we only use Java lmao. "Professional Education"
lol too bad they'll never see it in prod
All that money for what
Its good you have a company though. All I got Is student debt that continues to build every year
ur studying?
Well I got hired to do devops, now I only do admin stuff lmao. But eventually I'll get to do devops
Hopefully
What else would I do go worm at the local grocery store?
Idk what devops is I'm not software engineer enough yet
I've always assumed that was cl/ci
i thought you were on school
And build tooling
CI/CD, docker, Kubernetes etc
I'm in my first year of college
cs?
Yes
Automating the shit out of stuff
Funs one of my friends jobs was editing maven files for an airline for months at a time xD
Idk 🤷♂️
I mean we're soon migrating to git from subversion
apparently, my adapter didnt work
Can't wait to torch that server
Don't even know what subvert is. Some ancient shit I assume?
legacy goes brrr
Also technically I'm a senior in highschool
I just dual credit for every class
ha
Centralized VCS
When the project was started, git didn't even exist yet
sounds like the stereotypical legacy hellscape
cs can be fun just gotta be ready to pull your hair out
well
I'm focusing on specifically doing systems programming
idk whats the level on my country
im already studying oop and data structures
cool
it doesnt have enchantments
@young shell seems like the slime commented time to sit back and see if any of the paper folks say anything xD
Like OS Development or system design
Embedded Systems
😂
Oh good luck
the path ahead of me is a challenging one with many professors who do not speak english that can be comprehended, but I am willing to accept such a challenge
can someone check my code? https://paste.md-5.net/ohuvihopij.java
Low level code is fascinating but I prefer my languages garbage collected
Be ready to learn to understand the Indian English accent
Idk any low level languages, (learning C ATM wooo), but I simply tend to be obsessive about resources which can be hard to control in java, feel like systems is my calling for that, and its fairly different than my hobby projects etc which all use garbage collected languages etc
C isn't really low level though 🙃
I mean, it depends from which perspective you look at it from
from the perspective of java it definitely is
whats low level?
And in embedded systems your oftentimes so memory constrained that you'll need to use assembly
asm?
in the grand scheme of things it really isn't
Yeah
low level is relative really
in the grand scheme of things C is in a weird inbetween area
Yeah
I already know assembly, but it'd be stupid to make anything with
It's like not low level enough to have major efficiency gains but low level enough to shoot yourself in the foot
most job offerings I saw in my area were C/C++
though I wouldn't mind assembly if they had lots of well made macros
even compared to x86? which was painful
I can't imagine developing a full extensive project in pure assembly
im sure very small ‰ of devs can imagine that 
it sounds fun though
but it'd be more practical to learn C than continue with asm
can plugins create advancements?
I don't think so right?
what's hard about adapters
i tried to write my own
thoughts on this coll?
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/1307/overview
Idk what to say I feel like this warning should just be there. Don't really thingk CB impl should be working around plugins using NMS. We can't really control that, any alterations they make to the server is the fault of the plugin not using Datapacks or API
but well, meta is empty
it shouldnt
i give a sharpness enchanted book
i get a enchanted book normal
without enchantments
It’s not NMS
There is a method in UnsafeValues to load an advancement from a json string
why in unsafe values?
is it just not stable enough for API?
or do plugins not get loaded at the right time for it to be API
how are you registering that (de)serializer
.registerTypeHierarchyAdapter()
It’s just not proper api
You shove in a giant json string for Pete’s sake
same question
@hazy parrot maybe i got a solution
cause, yeah im returning meta
but its never applied in ItemStack
something that could go on the back of the log you think?
smth like that i think it is
Bukkit#addAdvancement????
granted reading it from a json file is still kinda cool API i like that even though it seems kinda lazy
ik, but reading it is so easy
hi, i wanted to make a fork of Spigot so I could fix something and add a pull request, but when I tried to log into my account it said I don't have permission to access BitBucket. would it be better for me to just submit a bug report? (it's almost more of a feature request than a bug report so I was hesitant, and it was a super-easy change so I wanted to just try and do it myself)
?cla
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
awesome thank you so much
cla cla real smooth
However yes you are welcome to submit a feature request as well
@echo basalt !!!! sorry for the ping, in your minigame structure guide specifically in the PhaseChain class, how would the event registering and unregistering work? LIke putting all the events in a private list and unregister them using HandlerList?
would it be better to have an EventBus class or can I put it in the AbstractGamePhase class?
Maintain single responsibility across your classes, separat eit
Alright
public abstract class AbstractGamePhase implements GamePhase {
private final AppleCore plugin;
private final EventBus eventBus;
public AbstractGamePhase(AppleCore plugin, EventBus eventBus) {
this.plugin = plugin;
this.eventBus = eventBus;
}
public <EventType extends Event> void registerEvents(Class<EventType> eventClass, Consumer<EventType> handler) {
eventBus.subscribe(eventClass, handler);
}
public void scheduleSyncTask(Consumer<BukkitTask> task, int delay) {
//TODO implementation
}
public void scheduleAsyncTask(Consumer<BukkitTask> task, int delay) {
//TODO implementation
}
public void scheduleRepeatingTask(Consumer<BukkitTask> task, int offset, int delay) {
//TODO implementation
}
public void onStart(Runnable task) {
//TODO implementation
}
public void onCancel(Runnable task) {
//TODO implementation
// This might be called by external factors, make sure to not just set a new task, but to "add" to the old one
}
public void onEnd(Runnable task) {
//TODO implementation
}
public void dispose() {
//TODO implementation
// This is where you cancel all the tasks and unregister your listeners
eventBus.dispose();
}
@Override
public void end() {
// Call the end task
dispose();
}
@Override
public void cancel() {
// Call the cancel task
dispose();
}
}
alr so just ignore the other stuff
I implemented the EventBus
and listener and stuff
Make the gamephase depend on an EventBus, not impl one itself
oh so like put it in the constructor?
init there or something
updated the code
oh wait
I should just make a new class
implement EventBus in that class
and then use that
So I followed the SimplEventBus and did the implementation there
I put the EventBUs class as my constructor in AbstractGamePhase
basically just did this
You can skip the eventbus stuff if you want
and just impl Listener
in the gamephase
and register itself or sumn
on start ig
There are multiple approaches
I am not too happy with how minigame code turns out
lol
I think ill keep it since I think it can be like uh used in the future for more advanced stuff
also thanks a lot for helping me understand java more lol
I didnt know that I could seperate so much stuff into other classes
Hi i think this is the right channel i have a waterfall server and it wont display how much players i have online unless in lobby which is default server do you know how to fix this this is for bungee btw
actually before I make this pull request / feature request I mentioned, I guess I should ask here... is there a particular reason why TrimMaterial and TrimPattern are interfaces and not enums? I feel like they make way more sense as enums and enums are also way more convenient to code with.
We tend to avoid enums now
As minecraft is becoming increasingly data driven
Iirc trim material and pattern have corresponding registries, so they are registry backed
ahh is it because datapacks are starting to adapt custom trims? i know they cant actually do that yet but it does look like they're working toward it
that makes sense, got it
what im trying to do is totally possible without enums, it's just way more annoying so i figured i'd ask lol
things worse than death:
* enums
* french
what about french enums
what do you have against french, emily?
choco speaks it
i love choco then
Is it right/good to check a Bedrock players via their UUID leading by zeros?
when using Player#setGliding = true, it does it in a way that when u land on land, like get in contact, it doesnt disable the glide, like vanilla does
Je suis un LEGACY_WOOL
no you arent
Hon hon hon baguette je suis crepe du garcon baguette hon
hon hon
oui oui
i listen to a rapper in french and he sounds hella different than the normal french u see
maybe because he is from senegal but french immigrant
can someone explain to me why in networking we use mostly big endian byte order in multi byte structures. Ok this kinda makes sense if the last bits are lost the most significant digits aren't so its not that bad as it was lost almost completely, but why the is the order in bytes not in bits, why don't we have multi bit ordering where most significant bit would be at the first closest address, and the least significant bit at the last in the end, wouldnt that be even better in this case?
That tracks
i get it that big endian in networking byte order, orders Bytes MSB being first while LSB last, but why not bits are ordered like that?
its not as if networks receive data in bytes and not bits (lost packets, connection interruptions, etc)
lmao i read it as Indian Byte (im indian)
chat gpt says that big endian in networking is a joke and its just a compat thing that we dont need anymore but exists
but i guess big endian could provide some safety regarding if the packet is corrupted and you have first bytes only
those bytes could show the magnitude of the value, thus recovering some of the data
still that wouldnt make sense since you can even provide more precision for data loss if you arranged bits also, so its not the reason why its arranged
and i was so confused why tf we use such complicated an unnecessary operations
Hey my plugin is having issues with finding the main class. TO run the spoigot plugin I use cardboard which is a spoigot plugin runner for fabric btw. recently after adding more randoms to my code the plugin just stopped working.
All I added was the chat colors and more random options
What is the recommended method to check a Bedrock player?
oh boy, im sorry but this looks like thing that yandere dev would do 😳
Geyser has an api
Ye its really basic and bad I bet but it worked untill recently
You should really just make a fabric mod
Cardboard isn’t supported by us or by fabric
well it was working until like 20 minutes ago
when i added chat coolors and messages
have you tried adding debug messages?
just code a fabric mod bruh
it ain't that hard
I believe in you
No i do not think so
Look I spent a few hours working on this and it just broke now worst comes to worst ill do the fabric mod but it broke minutes ago so its something new I added*
Could not load 'plugins\OriginSwap.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `skii.originswap.OriginSwap is what I keep getting
I am confused if I need to rename my main class or sometihng
probably just jank from the runneer
Thank you!
i'm still horiffied of the big endian byte ordering nature its so bizzare
you arrange most significant byte at the first place
least significant at the last
but most significant bit of each byte is still kinda little endian in bit level
Thanks so much that fixed it your a legend
I run with a bungeecord. Just to make sure, so it requires Geyser to install on all backed end servers? Just yes or no.
I would imaging you need it on the backend yeah
Or send the data from the proxy
Although just checking the uuid should be fine
How can we use its API without installing it on the backed end server?
ItemStack#serialize() covers enchantments and stuff?
Yeah I think it has no problem, since that type of UUIDs are very different from ordinal.
May I ask more. I've tried 2 days for no best solution. I want my server to have mixed mode auth. How can I accomplish it?
My solution is running two proxies, one for online and one for offline. But I see other server can use only one proxy to auth both type.
technically yeah
I've been doing research on it several hours. I couldn't find the solution.
i kind of forgot that stack overflow is an actual error
i just got it
and am now trying to figure out why it happened
lmao
Yes
How do I log with color to console?
Ik u can do it with ChatColor.translate but
here you go if you want to ignore me
I do want to ignore u
You can also just cheat it with the console sender
i do gui and add items from list
but i want to start these items from specific slot
and I want it to be cut in specific slot
it doesn't happen when i put air item up to a certain slot and then put normal items.
should i set items with a loop?
ty
true
how would one counter the decrease in speed caused when gliding using an elytra that decreases the speed
i want to make it constant
I'm spoofing the PlayerInfo packet
But if the players had a custom tab name set before the spoofing, the nicknames in tab remain
the same as the player's default name
Alright i will try it once i back home .
is there a way to check if an item.getType is a banner without having to check all the different color etc.?
(i alr tried instanceof banner)
declaration: package: org.bukkit, interface: Tag
thanks
can anybody help me with a plugin im doing in eclipse please?
?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!
i would like to add a lore to an item. im not learning im just trying to fix a plugin so im editing the source code.
so you get a golden head by using a comand, would like to add a lore.
What have you tried?
this.setLore(lore);
Gj
this. i think sould be the golden apple right?
only if the class extends ItemStack
don't get it sorry
click save and copy the http link it gives you to us
like this? meta.setLore(lore);
then set teh meta to the skull
ah I see you do
I didn;t notice teh lines
you need this.meta.setLore
you also need to provide lore
Now its not giving me any error , but nothing is happening , how i can know if its sending the data?
so would be this.meta.setDisplayLore("§6Lore"); ?
no, there is no setDisplayLore
still says lore cannot be resolved to a variable
yes, you have to provide the lore
how friend?
what lore are you trying to set?
both lobby , game connected to same redis server :
"this golden apple will heal you"
make a print statement inside your consumer, i guess.
this.meta.setLore(Arrays.asList( new String[] {"this golden apple will heal you"});
do i have to import "Arrays" java.util?
yes
Ok let me try friend, thank you for you time
do i need to send anything else in this?
i mean i do publish thats correct right?
amazing friend worked thank you!
you are only subscribing to the channel "arenaHeartBeat"
you clearly have a specific channel to subscribe to, it's in your chanel variable.
so use that
stop sending random photos and read what i said
because you are spamming the channel with giant photos
look at this
what channel are you subscribing to
and what channel should you be subscribing to
No, you have a specific channel variable called chanel
why are you not subscribing to that?
forgot about that , its my first time using redis
try subscribing to that one and see if it helps
you're welcome
Thats super amazing
now i have a question if you don't mind
i want to get this data and show it in a gui for arena servers
how would i do that for every server that connect , and load its arena?
in the future, consider using a pastebin like paste.md-5.net, instead of sending photos and put all your code there, even if it's multiple classes. it might take a little longer but it is much easier for helpers to read and figure out
Is this bungee?
1 arena per server , so yes
i was about to use bungee messeging system , but i didn't like it and allot of friends told me to not use it , not safe or fast
well on bungee you can listen to the serverconnectedevent, and when that server loads up you can dispatch a redis event and your spigot servers can listen on a special channel for that so they know to load an arena or something, I guess
but that's kind of open ended
So for example what iam trying to achive is this :
Or something similler!
yeah, i would listen to the ServerConnectedEvent, meaning bungee has a new server available to use, and when you get that, send a message on redis to a special channel that contains what server is available (like, what game does it serve or something) and your spigot servers can receive it and update their state about what's available. then when a player wants to join, from the spigot server, send a redis message to bungee requesting to join the arena for the player, and then on bungee you can move the player to that server
if you dont want to use bungee messaging you dont have many other options unless you want a third party system like redis
you're basically coming up with a simple protocol between your client "the user" and the bungee server
he is using redis already
well that's why i want to use redis in the first place ..
it's just a question of how to do what he wants
which there are many ways, but what i just said is one way
if you do havethe option i'd recommend redis any day
i will do the code my self , i just want to know how would i structure it
what i said is one way to do it, and probably not a bad way
could have your own packet implementation with tthe bungee proxy being the manager
but it's open ended, you can implement this a lot of ways
alright thanks
friend what if i want to add another lore on same item? so lore 1 and lore 2?
this.meta.setLore(Arrays.asList( new String[] {"this golden apple will heal you", "Second line"});
that was quick, thank you friend
List<String> lore = item.getLore();
lore.add("...");
item.setLore(lore);
or remember the original lore and do above
think this is better and visible so if i need to edit
up to you
thank you friend
I'm making a little whitelisting plugin for my private server, what would be better, storing the players in a txt file split by newlines or storing it in a yml file? I don't really care about two microseconds of performance or readability, so idk.
if you don't care about the performance, yaml would be better in terms of ease since libraries exist but reading the text file would need you to write the code to open the file, read all the lines, load them into a list, and then use them. neither are "better" in this case, but one is less work (yaml)
yaml as it's already included
Well, neither seem to make any difference
so you've done both?
No
I mean, it looks like it
I'll make a new class anyways and there is gonna be a file
performance wise unless you're talking about millions of lines, you aren't going to notice any major performance difference. computers are fucking fast. and if it's a small amount of lines, chances are it reads the entire file in one syscall when you go all the way down either way
so, choose one and go with it
when you boil away the file format details, pretty much. yaml will be doing more to process its file format and load it into data structures that you can access, but when you don't have relatively many entries in that file the performance difference is negligible
so i'd just go with yaml. it's easy, it's included, and you don't really have to do all that much extra work
yup
Well, time to try
asList() takes a varargs
anyone know why the client isnt displaying the formatted title, again might be a protocollib or minecraft issue but want to know if this is a known bug/fix
using packets btw, this is the code https://paste.md-5.net/udujijisod.java
what are the permission needed when using upgradablespawner plugin silktouch enabled
im using it and when mined i dont get the spawner
read.
bet
#help-server in le future
Hi
If i have an async storage system, would it be ok to do stuff with a completablefuture in the storage's thread
Can i do Gson#toJson(JsonObject)?
sure
how can i change ores generation? like just replace 50% of all ores with stones or deepslate?
is there a way to stop chunks from being loaded past a certain area
mainly just looking for a cancellable ChunkLoadEvent
but idk if theres smth like that
Don't think so
honestly it's easier to just make a data pack for that
the chunk generator api doesn't really let you modify vanilla generation, you have to replace an entire stage with your own logic
ty
you could use ChunkPopulateEvent and replace blocks but idk if thats a good idea
Note: Do not use this to generated blocks in a newly generated chunk. Use a BlockPopulator instead.
i think a bad idea
how do you cancel the click event everywhere, in both player inventory and upper inventory?
also is it possible to only show the upper inventory without the player inventory and hotbar slots
No, you can't.
InventoryClickEvent should already handle this. How did you check?
I fixed it
Now I'm dealing with shift-click and drag events
Those are covered by inventory click event
Sometimes when you cancel the click event but the player tries to move an item quickly it is still cancelled and just a client side visual error that your item is where it was last cancelled
if you're placing items the drag event will still be fired when, well, dragging, it's separate from the click event
is there an approach to ensure that lore stays in place? (when i want specific lore to be at the bottom of lore that it will remain at the bottom no matter how the lore gets changed?) or do i need to have checks in every method that changes lore? :(
Guys, could you help me, practically in my lobby system I'm adding the possibility of creating holograms, so far so good, but sometimes wrapped randomly for no apparent reason the entity no longer spawns, not even if I try to place it via Item compare, a fun and even if I touch a part of the code and move a folder not related to holos everything explodes start a server from scratch to try but nothing, the plugin and with api 1.20 ditto the server and Paper 1.20. I no longer know how to resolve it, the event that disables the entities obviously doesn't work, in fact item frames appear without problems
Yes
pls tell me more about it
Oh i said yes to the last part
You could make a method that changes the lore with checks and just call it each time instead of the normal way
yeah i will probably create a customitem fabric, thanks for the advice
how to make it so a player's speed never decreases (when they are gliding using elytra)
Keep setting some velocity to the player probably?
hmm
You could do it with a scheduler
and how do i increase the speed of player that is flying like creative, like essential has /flyspeed X
declaration: package: org.bukkit.attribute, enum: Attribute
oo
How do you get the bottom and top inventory on InventoryClickEvent?
Help
get view then get top or get bottom iirc
Yes but how do I get access to getView()
where is it
on the event
yeah
so to detect either dragging or shift-clicking, do I have to use InventoryDragEvent and InventoryMoveItemEvent, or can I handle this in InventoryClickEvent. I need to check from where the item was dragged or moved and to where
I want to prevent players from moving anything at all to the upper inventory in all ways possible
i think shift clickis inv click event
moveitem isn't really applicable here btw
it's for when a hopper or a dropper place an item in a chest, for example
Oh
so on InventoryClickEvent how do I get from where and to where item was moved
or I cant
https://www.spigotmc.org/threads/a-modern-approach-to-inventory-guis.594005/
maybe this helps you, it is a really good framework on how to work with guis
oh wait
i didnt read correctly
This is only for specific entities
For player use setFlySpeed
( @ashen quest ^^)
isShiftClick and check the getClickedInventory
there's also the hotbar numbers, and F
you can check the click type for those
da heck ty
whats the normal speed
1?
is there an event for when a potion runs out
Yes
The Action Enum
is there for that
As its contents tell you (ADDED, CHANGED, CLEARED, REMOVED)
Wiki for Action is here, it explains a bit more about each value
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityPotionEffectEvent.Action.html
declaration: package: org.bukkit.event.entity, class: EntityPotionEffectEvent, enum: Action
I add my custom enchant via addEnchantment and addUnsafeEnchantment, everything works until I fix the item I enchanted or rename it, etc. for example, I have a sword for custom enchantment, which kills mobs immediately when I hit them if I add durability or some other enchantment through the anvil, then mine is simply deleted, also with renaming and repairing. How can this be fixed?
Reminder EnchantmentWrapper will likely be removed by 1.20.3
PDC?
?pdc
thx
persistent data containers can are used to well store data
how can I make a specific group of players glow for each other and in a specific colour? like having a group of 4 people who are in a team glow for each other in their team colour
i tried using scoreboard teams but the colours dont seem to work
Okay, thx
they should work
you can put pcds on entities or blocks
Do you use EnchantWrapper? To make your enchantments
Not blocks
Entities chunks items etc
And what should I use then?
pdc
Use lore and item PDC
That change is gonna fuck so many plugins lol
This is why you don't extend api
its gonna be alright
plugins that actually many people use will take a few days max to fix that
usally if the dev doesnt care about the plugin anymore and doesnt update it doesnt have many users anyways
How do i determine what packet is this? Packet@7bcdf983
usually get the type not it's identity hash
why do you only have the id
System.out.println("Received packet from " + socket.getRemoteSocketAddress() + ": " + packet.getId());
Just wondering what bard can do
Why this does not set maxhealth?
thats minecraft font
i know
sure
val ins = player.getAttribute(Attribute.GENERIC_MAX_HEALTH) as AttributeInstance
ins.addModifier(AttributeModifier(
UUID.randomUUID(),
"bear_change",
(pet.level.toDouble() * 2.0),
AttributeModifier.Operation.ADD_NUMBER
)
)
thx
Yeah its working now
i dont even know how to use that wiki
Received packet:
ID: 97
Data: [97]
for example
how do i search for packet with id 97
why do i need to give names to attributemodifiers even tho im setting attack damage which is a default minecraft value?
is packets even numbered?
97 would probably be Clientbound
They'd have to be how else would you know what packet it is as a server?
if you are giving the correct id
Minecraft font really xD
does anyone know what event fires when a suspicious sand/gravel block is fully brushed
BlockDroppItemEvent
oh i thought that was only for blocks being broken
Obtain the hex form of the number and look it up in https://wiki.vg/Protocol
97 is 0x61 = Set Title Text
Note that the packet ids greatly depend on the protocol version
how is main class loaded
result = loader.loadPlugin(file);```
public interface PluginLoader {
@NotNull
Plugin loadPlugin(@NotNull File paramFile) throws InvalidPluginException, UnknownDependencyException;```
oh
PluginClassLoader actually
URLClassLoader actually...
ClassLoader actually
everything ends here java /** * Finds the class with the specified <a href="#binary-name">binary name</a>. * This method should be overridden by class loader implementations that * follow the delegation model for loading classes, and will be invoked by * the {@link #loadClass loadClass} method after checking the * parent class loader for the requested class. * * @implSpec The default implementation throws {@code ClassNotFoundException}. * * @param name * The <a href="#binary-name">binary name</a> of the class * * @return The resulting {@code Class} object * * @throws ClassNotFoundException * If the class could not be found * * @since 1.2 */ protected Class<?> findClass(String name) throws ClassNotFoundException { throw new ClassNotFoundException(name); }
Why are you in the classloader
just curious
i'm thinking about Unity's MonoBehaviour
where every class is loaded without a constructor
when scene launches
nah just delving deep in that
everything ends up in native defineClass ,ethods
i thought it's smth related to Reflection
but well, i only found native define methods which contrsuct a Class object
oh no i'm wrong
it's in the classloader class
it's actually using newInstance along with those native methods
im pretty sure what it does is
- read the plugin.yml from your JAR
- create a new custom loader extending or using URLClassLoader in some way (i think its called like PluginClassLoader)
- get the main class property from the plugin.yml
- load the class with the PluginClassLoader and verify it extends JavaPlugin, then construct and register the instance
yep
dont think its that hard to do, but bukkit does some special class loading shit tho and abstraction of plugin types and load order etc which makes it more complicated
i'm mostly interesed in step 4
i knew the first 3
yeah and that's what i posted above
ah ok
loads of jdk code
i thought u wanted the bukkit code/process
well thats just hte method declarations
there is also code lol
that's from class loader
idk what that does that seems to make a secure class loader or smth tho
interesting
and well, other methods are native
so i probably shouldn't care much about them rn
for java that's the furthest i can get
this code is pretty unrelated to actually loading classes tho
if only you knew how much loadClass methods i passed through 99 classes to get to it
lmao
🙂
that code is called on vm start to initialize the system class loader tho
if u want more details look at URLClassLoader
well as i can see the loadClass method has 3 steps
first one is to search for class in already loaded classes
if it's there return
second one is i forgor
and third one is findClass which uses defineClass
yeah
yeah
if ur interested this is the native code https://github.com/openjdk/jdk/blob/a2c5f1fc914ef5c28d044b75598f895cf6097138/src/java.base/share/native/libjava/ClassLoader.c#L216
pretty immediately delegates to more internal jvm code tho
so doesnt really show much
c++?
yeah
well this is C
the actual logic will most likely be in C++ though
as the jvm is
is it really
yeah
nvm
i can't find the difference tho
i'm sure i can copypaste that to cpp and there would be no errors
yeah
i'm only curious if cpp actually has NULL
oh lol it's just #define 'd from std::nullptr_t
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/classfile/classFileParser.cpp#L5158
i found the code which actually defines the class
scary
yeah
imagine this code without assert()
well, ig unity does the same stuff
wtf is a miranda method lol
but for every class which extends MonoBehaviour
unlike only one class in mc plugins which extends JavaPlugin
so you don't use constructors in unity unless you want your class to be non-monobehaviour'd(abstract/interface/static)
i cant find anything on so-called miranda method wth
yaeah
maybe that's for ones below 1.8
oh thats prob like operator overloading but for other shit than operators it seems
like extra-early java
its still in the code tho
A ValueGuard is used in the E language to guard the return value of a method.
E language
E is an object-oriented programming language for secure distributed computing, created by Mark S. Miller, Dan Bornstein, Douglas Crockford, Chip Morningstar and others at Electric Communities in 1997. E is mainly descended from the concurrent language Joule and from Original-E, a set of extensions to Java for secure distributed programming. E co...
guys im trying to make an item not droppable on death and from inv, i would like to code it in my plugin and not download a whole another one just for 1 item
I'm trying to change GameProfile to a PlayerProfile so I can set player skull to the textures that I want, how can I do that?
String identifier = Main.getHeads().get(Main.RANDOM.nextInt(Main.getHeads().size()));
GameProfile profile = SkullUtils.detectProfileFromString(identifier);
PlayerProfile playerProfile = Main.getInstance().getServer().createPlayerProfile(profile.getId(), profile.getName());
skull.setOwnerProfile(playerProfile);
skull.update(true);
can anybody help me?
onDeath if inventory contains that item remove it from e.drops
probably
💀
lmqao
how friend?
wait gcc had a java compiler?
you don't know how to code or smth
No, im just trying to edit a plugin that is outdated so im fixing it
oh lol
anyways do you know how to code
well, it would be extremely hard to help you then
i did so many things with help from you guys here alr
how is there an "old" and a "new" effect on an entity potion effect event
💀
😿
ItemMeta meta = this.skull.getItemMeta(); this should be the item right?
it's meta
yes
this.skull is the item
what should i add to make it not droppable and loosable on death?
so it destroyes basically
you need to make an EventListener
which listens for player death
i still dont udnerstandt if thats the case whats the point for the action enum
i though the action enum determines weither the effect is applied or removed
who knows
check javadocs
can you help me friend?
wait but if you don't provide own method program won't compile lol
maybe if an abstract class implements an interface
idk
or if the compiler fucks up
good compiler
he needs to code a listener for player death
im trying to make an item not droppable on death and from inv when alive
if player had special item in inv then not drop it, but destroy it
if not
no how do i make it?
okay
make a class call it PlayerDeathListener
implement Listener
let me show you an example
yes please friend, thank you for your time
i can finally close all of that shit
NULL
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
public class PlayerDeathListener implements Listener {
@EventHandler
public void onPlayerDeath(PlayerDeathEvent e){
//Do what ever here
}
}```
nullptr
@noble adder
ok i did
now on the player death u can check if the player has ur item in his inventory
or wait
actually
u want to make the death not happen if the player has the item right?
in that case
playerdeathevent is too late
cause you cant cancel that
instead
use
entitydamageevent
Fixes and old jdk 1.1 bug where the linker tries to resolve a symbolic method reference of an abstract class, which doesn't define that method but inherits it from an interface, the sun jvm didn't look for declared methods in interfaces, only in classes. javac doesnt emit miranda methods anymore since java 8 though
e.g. ```java
interface I { void x() }
abstract class A : I {}
class B : A { void x() {} }
void main { new B().x() // wouldn't be resolved at runtime as its not declared by any non-interface parent }
no i wan't when he dies no matter how item destroyes,
been coding C#?
: lmao
no
do you want to destroy all items of a certain kind?
also wtf is class C
i assume u meant B
i mean is a kitpvp so the only way they can achive heads is if i give them so
