#help-development
1 messages · Page 1242 of 1
Dang rad going for that senior engineer position huh
i can do $122/h
I'll offer $580/h
damn it keep raising =)))
All on black
Hey [NuclearKat],
Thanks for reaching out! I really appreciate your interest in working with XrossHearts. Currently, we’re a small server with no budget, but we’re hoping to grow into something big.
I’d love to offer you a Dev rank and full credit for your work, along with future profit share if the server starts generating revenue. While I can’t offer immediate payment, I’m committed to making sure you’re recognized for your contributions.
If this sounds like something you’d be interested in, feel free to DM me, and we can chat more about it!
Best regards,
Hamzacross100
Owner of XrossHearts
uhhh
this shit is made from chatgpt
bro f*cking spam it
dude holy shit
lmaof
“Full credit” what am I getting company fucking coins?
bro we are totally all interested, hit us up
bro 💀
you get a pat in the back for working your ass off
you're collecting walmart points if you have those in the us
@worldly ingot can you obliterate this dude
impressive
Pretty sure like every place has reward shit like that lol
bro just make us pay our times for "full credit" wtf
Learn java lil bro
guys fr stop I have a dev but i need more
At least here
I didn't know how you americans call them
bro then keep that mf if you don't pay don't expect shit for free
ik but it needs time and I'm dev i learned python
I think they call it a “rewards program”
You need either time or money to develop a server lmao, if you have neither, glhf
lol
yes ik but anyways i was giving who was working with me 200 month
u said no payment
that's like, not a lot
also its like nothing
true
I live in America, 200$ a month is enough to pay for my weed… maybe
Mate let me say, no developer in here would work for free, you'd have to either pay an hourly rate or a salary. Good luck with that.
it was test and you dont care right?
k thx
good yard
and i said i will pay monthly with no stop 200 and if the server is getting money i will increase
purple how are you
It's not worth it at all for any developer
I'm good, what about yourself
I said I'm fucking new server
how's the kids purple
I can do 200$ a month for about 8hrs of work
get money bro
lmaooo
how's wife man
$25/hr is fairs
she's gucci
didn't know you and april had kids-
damn she cool then
good deal for ,me
got that house?
nah not yet
ahhhh get it, interest and shit i hate banks fr
nah I just broke
Purple gonna be in a wife beater soon
we both are, plus I'd probably move out this year with her 👀
WHY SHOULD PURPLE BEAT HIS WIFE
wtf
good shit
I have to leave
damn guys you all grown up im like 20
yes pls
Weren't you two looking for a ring the other day
?mappings
Compare different mappings with this website: https://mappings.dev/
bro wtf is going wih you
shit that wasn't just the other day, weeks ago lol
bro im not saying anything dw about it
i add aliases with command.yml
but i have a problem when i use alias my command logging on console
how can i fix that?
I mean I'm 20 right now
21 in a month
good shit, in italy its impossible
it's impossible to age!?
lolol
i might have a good message to send but i believe it would be border cyberbullying
idk u guys tell me
what kind of problem? What's going on on the console?
there is something i don't want to see on the console
"something"?
Let me say this straight up - no developer here would work for free or for "compensation with profits" because it's way too risky. If a developer puts all their time into the server, building it up, developing it, and get's like $200/month afterwards. Would that really be worth it? That's like 8 hours of work for a typical developer.
Going with profit share it's not a stable income for a developer, and it can cause many developers to not be able to pay for food or bills if they live in their own house. Yes, some developers may be desperate to get a job and may take the offer, but after some time of working, with no income, if it takes 2 months to complete. They will soon realise that none of their work was worth it.
If you want a stable developer, and to start a server, I would recommend learning how to make plugins yourself, as starting a server is YOUR passion and no-one elses. Otherwise, get a job, get some money built up, and pay a developer a stable wage.
succo di frutta, sei all'ace o alla pesca?
quick question: how do i get the pumpkin screen?
Alla pesca
good shit
Pumpkin screen is client-side only. To do it you'd have to make the player wear a pumpkin on their head. Or have a custom resource pack and send a title with a custom font to show the "pumpkin"
mamma mia (damn)
oh man I haven't spoken Italian
data components!!
what are the words you know of italian
like other than mamma mia pizza caffè and other simple shit
Diglielo che la pizza all'ananas spacca :trollface:
ananas pizza is ass, if you do that in italy they will legally decapitate you
hmm there was one word in particular that caught my attention
lets move to general, shall we?
I am confined in this channel for the rest of eternity
I cannot escape
unless it's choco sharing doggo pics
sad
can i make it client sided? so other players see the normal helmet but you see yourself with the pumpkin?
i mean you can send a packet to the player that changes his helmet slot to a pumpkin
but for the server its still a helmet
Yes you could
that would also make it so armor damage is still applied to the player
literally this is the solution ( i hope and believe )
Player#sendEquipmentChange
what will happen if the player move the pumpkin to another slot?
or you can set the camera_overlay in the item's equippable component https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/components/EquippableComponent.html#setCameraOverlay(org.bukkit.NamespacedKey)
i guess it will update and come back as helmet
NBT API devloper version available?
what
hm what about it isn't working? it was updated well after the latest Minecraft version came out
with limited functionality only
So can i have full developed version of it?
that is implying the dev builds have fixed this issue you're speaking of
the plugin is actively maintained, the latest version should work fine, what issue are you encountering?
plugin throws bunch of warnings such as 1.21.4 is not fully supported
15.03 14:21:27 [Server] INFO [NBTAPI] [NBTAPI] Using the plugin 'AuraSkills' to create a bStats instance!```
you aren't using 2.14.1
you're using 2.13.1-SNAPSHOT
go get the latest stable release
Can i have the link
it's the first link when you google "nbtapi"
guys i handled it by myself using nms lol
damn purple's older than me
not hard when you are the sucker said to have been born yesterday
tiny baby
don't worry, you look a young 40
ok dinosaur
say how does it feel like knowing someone 50% older than you is more fit than you
crazy the things you need to stay alive
I keep telling you not eating the greasiest food known to man is not as crazy as your entire life has led you to believe
I'm going to the gym in 31 minutes
you're probably just ordering a pizza
or eating a $1 horse/dog meat paddy
im younger than illusion 💀
Pizza is healthy, if you don't eat the base
he just eats the grease
eat cheese ?
and vegetables?
no wae
Don't forget the pineapple
had like 3 egg last night
what bout chocolate
the only reason you could afford all of those eggs is thanks to trump
???
you better have thanked him for each individual egg before eating them
I'm working full-time
kekw what
he's only working full time
so you're on a holiday
how much dollar / hr
your egg finance depends on that
if you're not pushing 100h weekly are you even working
if you're not working 30 hours a day, 10 days a week are you even working
all this and he still lives in a shoebox
I'm actually cutting back on sleep to work more
something something health money something
the funniest part is that he's been to my place
this place is so big I'm looking to buy smaller
small home, lots of land is best
I live alone, I don't need 6 bedrooms
also I hate being in an apartment
I can't tell if I'm using virtual machines incorrectly or if they're just slow
they feel really sluggish
does anyone here use VMs on windows
that are good enough to, say, play games on
I don't really plan to play games but the stuff I've tried is just infuriatingly slow
anyone ever used flyway for database versioning and migration? trying to use it with postgres, but always giving me errors (i had version 17 and downgraded to 14.17 because i saw it was not yet compatible with latest but damn the 14.17 is pretty old now)
Caused by: org.flywaydb.core.api.FlywayException: Unsupported Database: PostgreSQL 14.17
at org.flywaydb.core.internal.database.DatabaseTypeRegister.lambda$getDatabaseTypeForConnection$7(DatabaseTypeRegister.java:131) ~[flyway-core-11.4.0.jar:na]
at java.base/java.util.Optional.orElseThrow(Optional.java:403) ~[na:na]
help someone pls. how to load shader into the client through a plugin like from shaders/post/invert.json? i saw this on one server
use a resource pack
The spigotmc Maven repo appears empty when I use it with my own Nexus repository server. Does anyone have any experience with this?
https://hub.spigotmc.org/nexus/content/repositories/snapshots/
how can i make that the lapis doesn't go in my inventory but they go in the enchanting table? @EventHandler public void ench(PlayerInteractEvent e) { if (e.getClickedBlock() != null && e.getClickedBlock().getType().equals(Material.ENCHANTING_TABLE)) { e.getPlayer().openEnchanting(e.getClickedBlock().getLocation(), false); e.getPlayer().getOpenInventory().setItem(1, new ItemStack(Material.LAPIS_LAZULI, 64)); // Set lapis in the Lapis slot (index 1) } }
OpenEnchanting returns InventoryView
So you could use that for setItem?
declaration: package: org.bukkit.entity, interface: HumanEntity
But its deprecated. I would switch after reading that
and how i should do that (sorry for bothering)
InventoryView inventoryView = e.getPlayer().openEnchanting(e.getClickedBlock().getLocation(), false);
inventoryView.setItem(1, new ItemStack(Material.LAPIS_LAZULI, 64));
idk something like that?
get the item meta cast to potion meta
modify potion meta and then set it back to the item
ye i know that the problem is to set it to like Speed
Where is the problem with that
declaration: package: org.bukkit.inventory.meta, interface: PotionMeta
no vram?
pretty sure you needed some virtualbox extension to have more than 128mb vram
qemu my beloved
Has anyone tried protocollib with spigot 1.21.4? I tried using the dev build jar but I get a NoSuchMethodException on ClientboundPlayerInfoUpdatePacket constructor when running my plugin. Is anyone able to provide insight to this? Any advice is appreciated
how can i hide the effect of a potion?
[Server thread/ERROR]: Could not pass event PlayerJoinEvent to PrtclLbtest v0.0.1-SNAPSHOT (first line before stacktrace)
Depends on what you mean. You can hide the icon (outside of the inventory) and the particles
i want to hide the "description" https://imgur.com/a/FMP38se
Looks to me like you're missing two fields https://mappings.dev/1.21.4/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket$Entry.html
version: 1.21.4, hash: e006f1b9ca
declaration: package: org.bukkit.inventory, enum: ItemFlag
Do you think this is an error on ProtocolLib's part? I never interact w/ ClientboundPlayerInfoUpdatePacket directly
I mean I hope you know it is since it's your code
Could you send the output from /version ProtocolLib
That's not the latest dev build
I just realized. Thanks Olivo for your help
is there an event thats called when the durability of an item goes down
PlayerItemDamageEvent iirc
alright thanks
does .teleport() not work for item displays? if not then what do you use to move them? if yes then uhh it isn't working?
it should work fine, are you sure your method is being called?
ill double check rq
Move them with transforms so the get interpolated clientside
yeah its working now i just had a stupid mistake ty
wdym?
display entities can be transformed in different ways, like rotating or expanding them, and that transformation can be interpolated for a smooth transition
is there a way to get a list of players affected by an explosion
if you are just trying to rotate the item display, it is probably better to use transformations
if you are actually moving it around, then yeah teleport
so im rotating them in a circle around an entity (so moving them)...would transforms be better / faster?
for that purpose, teleporting is fine
EntityDamageEvent and check the damage source
welp I have a new question as they all individually rotate around in a circle but they don't move together...it's quite strange they are individually rotating in these skinny ovals instead of a circle pattern... probably has to do with the center of the entities? (like they are being teleported but the center of display item is off?)
for block displays you do have to put them in the center but I don't think the center of item displays is off
maybe your math is off
like, by an entity/block or one created by yourself?
one i create myself
Either way, checking the EntityDamageEvent's DamageSource is going to be
DamageSource provides the source location so you can use that to check whether it is your explosion
of course, you'd have to track the location(s) independently of the events
idk, here is how they look
I mean, I can't really say anything about that without actually looking at the math lol
how do you do the code block thing
?codeblock
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
there we go
double xMod = amp * Math.cos(Math.toRadians((i * 6) + (j * 120)));
double zMod = amp * Math.sin(Math.toRadians((i * 6) + (j * 240)));
boneLoc.add(xMod, 1, zMod);
j++;
bone.teleport(boneLoc);```
why are you adding 240 to z and not 120
Maffs
np, though I agree with md on the oval motion looking better tbh
lol it kinda does
I do wonder if one could achieve that effect with transformations instead of teleportations
it might be less laggy?
well, it is ran on the client side so potentially
though im not very familiar with transformations
the issue with them is that you have to time things properly
I think they only interpolate linearly so probably not unless the math falls out of the transformation matrix (which it might idk)
I think its fine as is lol
same, just food for thought
The Nexus repo server of spigotmc sends an invalid Content-Type header which creates an error in my own Nexus server not letting me download any dependencies:
2025-03-15 22:04:10,081+0000 WARN [qtp876945112-566] admin org.sonatype.nexus.repository.view.handlers.ExceptionHandler - Invalid content: HEAD /org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/maven-metadata.xml: org.sonatype.nexus.repository.InvalidContentException: Content type could not be determined: org/bukkit/bukkit/1.13.1-R0.1-SNAPSHOT/maven-metadata.xml
I checked the Content-Type header and its malformed:
content-type: org/bukkit/bukkit/1.13-pre7-R0.1-SNAPSHOT/maven-metadata.xml
pre7 is Not 1.13.1
yeah the content types for old versions are cooked, and idk when/where nexus did it
pretty sure you can configure your nexus to ignore them idk
that being said, it seems fine for me
on the /public endpoint anyuway
so I'd just use that rather than snapshots
I just rebuilt metadata which fixes the maven-metadata types, but the artifacts are still cooked types
any way to get rid of the particles that appear when dealing a lot of damage, because when I hit an entity in my plugin and do a lot of damage there are a ton of particles and this happens and it lags out the game:
Are you the one spawning more particles?
nope
So this is a side effect of your plugin?
The Nexus option to disable strict content type validation option does not seem to have any effect
minecraft does that when a lot of damage is done based on how much damage. in this case I am dealing 1,000,000 damage so the particles just appear
yeah lol
well that's not a normal amount of damage
yeah...
have you tried using sensible amounts of damage
so do I have to move to my own damage system? or is there a way to get rid of particles
Maybe just reduce that kek
Why do you need to deal that much damage in the first place?
this OP damage stuff is stupid. Instead of sharpness 5000000 with protection 1000000 armor, lets just have sharpness 5 and protection 1
like it's the same outcome at the end
if you are dealing that much damage, yes.
Thats what everone else does
That's dope!
alright thanks
lol made that by mistake but its kinda cool
yeah
it's like everyone starting off with an OP pick
yeah!
reminds me of fun accidental visuals made by algorithms built for physics rendering or something similar
ik, and the 1 million was just an exaggeration to show the issue, generally damage is roughly 1000, but that still causes a lot of particles. was just hoping there would be an easy way to get rid of particles as I already made damage indicators for it
yeah thats probably the best option its just more work :/
Is that much damage really needed tho?
Could be an rpg server
rpg plugin; probably not but eh idc
you never know the context
ah
til rpg = insane damage
the fun ones, yes
big number = brain likey
You could always cheat and display damage scaled up by like
despite it being entirely useless
100x
why not keep it damage of 1 or 5 and simply multiply it in teh damage marker
Thats a broad statement
yeah I was just hoping there was a way to get rid of the particles entirely as they are just annoying
my point is that everything being in units of 100000 is the same as everything being in units of 1
Idk where everyone is getting this assumption from one screenshot
I mean you need to have at least some range
Imagine an RPG where the tutorial enemies have 10 health and then the final boss has… 20
can someone help me about removing "When on Head" text from item tooltip
if (itemData != null) {
Material material = Material.getMaterial(itemData.getBaseItem());
if (material != null) {
ItemStack item = new ItemStack(material);
ItemMeta meta = item.getItemMeta();
if (meta != null) {
meta.setUnbreakable(true);
meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
meta.setDisplayName(itemData.getSerializedName());
item.setItemMeta(meta);
player.getInventory().addItem(item);
}```
If you're running Paper you need to add an attribute
?whereami
yes running on Paper
yeah, with 1.21.5, the vanilla item format finally supports doing this again, so won't be an issue then
update: I was able to get rid of the particles using protocolib and canceling packet 🙂
how can i add it ?
You should move over to Papers discord since you're not using Spigot
Valid
I played some 255 wow with donator items instead of normal when i was younger cause i loved the high numbers and heals. Was great
anyone know how you make an IJ theme?
any picture
what?
Any picture works
I might be thinking of the background
yeah, i meant like how on the plugins marketplace, there is like "nord' and shit. i was wondering how you make your own
install the plugin devkit plugin from IJ's marketplace, then in the project wizard select theme as plugin type and off you go
why the fuck you need a JDK for a theme?
and also, the "Create" button does not work
because themes are plugins
soo 17 will work?
Probably
I mean, as far as the java version goes, yes
the platform versions documentation above goes into detail as to how to set the IDE version compatibility as well as tooling required to suport multiple versions if that's what you wish
does plugin development use its own SDK? i use IJ all the time and do have JDK installed.
you probably don't need to care about that right now though, just make the project and start editing the default color scheme
plugin development does have its own SDK, yeah
fock okay
but that's separate from the JDK, wonder why it isn't giving you the options
I'm guessing it's probably jbr
nah, that's IJ's runtime, the plugin platform SDK is completely separate from the JDK, it is meant to be used to make plugins
Ah
for themes, I believe it provides the IDs for the UI controls and whatnot
i wish i still had slaves who'd make themes for me
IJ provides little customization for themes, I personally don't find it worth the effort
not that it is much effort, it is just editing the color schemes in a json file but still
?paste
heres my current code
https://paste.md-5.net/ulasetocud.java
can someone tell me why i can still move items in my GUI even tho i have event.setCancelled(true);
Dont use titles to check inventory interactions
Also also you could cut down like 80% of this boilerplate
What can I use instead
https://www.spigotmc.org/threads/a-modern-approach-to-inventory-guis.594005/
Check out this guide, fundamentally just a hash map and a manager to discriminate inventories
and as for boilerplate, each punishment could just be an enum
TL;DR
Add your inventory to a Map<UUID,Inventory> when you open it, remove it again in InventoryCloseEvent
since InventoryEvents are always called sync, that will work fine
Hey, I wanna make a plugin that accesses a Minecraft API endpoint that requires authentication, but in order to get the token I need to create an Azure account, but that piece of garbage requires my credit card!
Is there an alternative?
I simply want to change my skin using a command ._.
I really don't believe you need an Azure account to get a token.
What's the documentation you're reading?
First thing mentioned is an azure account 😭
This makes no sense, I literally just want to change my skin
Not sure if you need a credit card but yeah seems like you need an account
But are you trying to change your account skin or just on the server
Yeah there are ways to change skins in the particular server , like skin restorer does
Creating an azure account requires a credit card :/
My global skin. I know it sounds weird, but that's my requirement.
I know, thanks for the suggestion but I want to change my skin on all servers.
I'm speechless, it's just a skin change, I didn't ask for more API requests per minute or something similar
My skin
Or just steal your own user token
yeah, if it is yours you don't need such azure accounts
How do I get access to it?
you can use your microsoft stuf
Might even be in the client logs
How so? can I get the MC token straight from the microsoft account?
But I'm not sure why this needs to be a command
I would need an hour long story to explain xD
I just googled "microsoft api token" and I can't find anything helpful
it leads me to the azure account again
you can simulate logging into your microsoft account
like just logging in with a browser
then fetch 2fa then login
oh god
Selenium against Microsoft doesn't sound like a good idea
yeah, they might flag you as a bot
I don't think whatever you have planned is a good idea lol
if their html stuff isn't even obfuscated lol
without azure, this is the only way probs
You can decouple the word "plugin" from the context, does it make sense that one would need an azure account just to change their skin programmatically?
within a mod, plugin, springboot project, anything
wait can you hack around the client?
the client can change the skin no?
are you saying or asking?
it can
im asking if you can hack the client to automate skin changes
like you want
are you talking about mod programming?
like forge
No i mean the minecraft launcher
Oh yeah its asking credit card verifiation for azure account verification 💀
that is awful
To be honest? I don't even have an idea what Azure is

I don't trust microsoft with my first name, why would I trust them with my credit card?
I mean, it isn't about trust
Azure is their cloud provider platform, which is where the Minecraft skin API runs
I don't even know what Azure is, but I know that every authenticated minecraft API request needs an azure account(to get an MC token from)
so it's not just skins
Azure is just a cloud provider solution like AWS or google cloud
and yes, anything minecraft API runs under azure authentication, because that's where it is hosted
they want to prevent api spamming their servers so they added a verification prolly
same for oracle free vps
otherwise there would be so much abuse of free stuff
Oh, I understand now
but let me ask you guys for real
would you give your credit cards for microsoft for any purpose?
why would I not, it is Microsoft not thepiratebay
yeah i would just give my details atp
i don't mind it
it is so much simpler than using selenium
I mean, if you really care about that, you can deploy your own skin server, I believe there are some clones around in github
but I personally don't see the point in going against it for anything practical
there are many oss api
which are already hosted even
but then others can't see it
How would that work?
Sorry for my lack of knowledge
you deploy your own skin server and have a client mod so that they can switch from minecraft's one to yours
but it is a very convoluted process, I wouldn't personally recommend it
but it seems to be linked with t launcher so i would be cautious
but then only the mod's users would be able to see custom skins, right?
yes
You could mod the server as I believe the url is hard coded on the server not client
There are events for profile filling one could use to circumvent the official Mojang API
this dude has never purchased anything online
is there a thread-safe method of Bukkit.getPlayer?
is Bukkit.getOfflinePlayer().getPlayer() threadsafe?
no
I think getOnlinePlayers is thread safe due to being backed by a copy on write list (but not guaranteed to be so by the API)
?whereami
I CAN'T TELL
// Paper - ...
also
I have never seen this man in my life
@mortal vortex stfu
bitch
is there an alternative?
?
cuz manual search
he just said its threadsafe?
yes but it's not a map look up
Why do you need this anyway
Virtually none of the API is thread safe
netty threads
You need to call back into the main thread and back
I have, and I prefer giving my credit card to a homeless rather than Microsoft.
I'm a homeless
( bro lives in 10000000000 acres of land he bought in 1998 )
1898*
noo, you ruin it all
Homeless guy prob max out your spending limit 😂
that's the point 🙂
its not like they are going to steal money
o.O
microsoft may be a large corporation but banks and the financial sector is far larger then microsoft
not only would a bank take issue, but so would visa. Could you imagine how crippling it would be if visa banned microsoft from any visa payments
no not yet
how can i check on EntityDamageByEntityEvent if the damage is 0 or it's more because i want to check if the pvp start in a region where the pvp is off it'snt
i think there is quite literally a method in that event called getDamage
or getFinalDamage
?jd-s
yes i tried with it but it's 1 in the region and out of the region i will test with finaldam
You may need to change listener priority
if pvp is off for a region, the event might be cancelled all together? idk
i made a sout for see it and it was always 1
nope final damage is always 1
and how this will affect?
i'm using worldguard and i want that in the region where there pvp is not enabled they will not join a function otherways they will
ik im late but did you find out that is it allowed or no? xD
Hey guys
So i made a plugin following a tutorial. Its a /warp plugin
this is the error i get
?whereami
I know
But the plugin is spigot
and thats what its causing the problem
commands are of wrong type
what does that mean? And why only for that plugin and not the others?
Your plugin.yml has the commands section as a string instead of a section
do you have a paper.yml too?
no
that plugin.yml is not in the jar you are testing
why so
probably using an old jar or smth
i did the same things i usually do with the other plugins
one of those commands is not the same as the others
wdym?
look at all 3 commands
I miss the description section
yes, its just a string instead of a map
yep, you are no longer permitted to use a computer
D:
starts programming plugins with smartphone via app
hey @eternal oxide
do u remember the freeze plugin i was trying to fix?
^ FreezeListener
It still cant freeze players
@shadow night be like
Where is the @EventHandler on that method
Indeed
which method?
you need to add @EventHandler
after which method
?eventapi
how can i push the player back?
setVelocity?
is it true that PlayerJoinEvent is always the first event that gets called when a player joins the server? (excluding the prelogin events and allat)
im sorry why do buildtools for 1.21 download 1.21.1?
It contains one critical server crash fix, server 1.21.1 is compatible with client 1.21
no reason for 1.21 to exist
not exactly spigot, but how do I change the update interval for PAPI placeholders
Wouldn't that be handled by the caller or placeholder implementation
I don't think PAPI caches anything for you
Did you run it and build 1.21.1
yes
Did you use the remapped flag
yes
what did you do to run it?
righty
👍
i need help 😭
ok so
C:\Users\USERNAME\.m2\repository\org\spigotmc\spigot
in here
the spigot 1.21.1 file is like
0 bytes
2 0 bytes files
and 1 18mb file
hmmm
is that normal
um you have a lot of bad files in there
do i like
folder names are wrong
delete all the filders
done
now run buildtools and build 1.21.1 (if you want .1)
i ran 1.21 and it gave me 1.21.1 because of a server crash fix
so ill just run 1.21.1 again
1.21.1 is compatible with server 1.21?
in the repo?
yes
if you are using nms then spigot. if you are not and just wat the api then spigot-api
ok run buildtools again with the remapped flag
ok
now your project shoudl have access to 1.12.1 (nms)
shower thought: why i don't seem to find an example where java dev uses underscore to denote private function names and variables? Why? sure we have private accessors but prefixing with underscore you can instantly know its not meant to be used outside internal uses also it filters out such functions and variables from autocomplete suggestions internally
i guess hungarian notation duh, but isnt verbosity here is better tho
ngl im gonna probably break the rules here and adopt it in java
i dont care if nobody uses that
names are for clarity and not for pretty words
if it tells me info i need, im down
As long as you're consistent
their glow strength can be set but not be adapted dynamicslly unless you do the logic yourself afaik
you probably can, but you can always use good ol' armor stands method
declaration: package: org.bukkit.entity, interface: Display
oh, so the default of -1 is to ignore?
yeee thanks brotha
will test it out
By default it should just use the lighting of the position the entity is in
That setter is really for when you want to change it outside of that
And the default is null
But you can try combing with Block#getLightFromSky and Block#getLightFromBlocks and adjusting it until it fits what you want
oh now that's convenient
Why do you need to know if a field is private? It will be private most of the time if you can access it
incovenient
easier to mention field rather than _field when programming
easier to read and comprehend whether what youre accessing is internal or not
what if lets say i have Static helper method
which is private and only to make it to remove DRY or just for clarity
Foo._constructSomething() instantly lets you know that you shouldnt expose it to public
without reading access modifier
this might work with IDE access
but what if a person reads it from github
or other git repo
sometimes exposing it under normal name doesnt make sense if its private because method might depend on the specific object state and its only to make it easier to read
but that's the point, its harder to mention, thus its harder to mutate something you shouldnt internally
_ instantly make you think: hold up you do know that calling this function or accessing field might have complications, right..... right???
so does c++
ah
I don't get it how the underscore changes anything for this situation
it doesnt change anything, its just that the name instantly tells you in what context it should be used or is being used
without looking up for a declaration of it
skill issue tbf
I don't think I ever had to look up the visibility of a field
just don't use public fields
because you usually write code from IDE
but if you would need to review PR's mostly
it would be a lot better imho
i do not
im just suggesting if its private field denote it with _ prefix also
so your mind could comprehend the logic better
without looking up for modifiers constantly
Optimizing your code to be easier to read in PRs is definitely the wrong approach
^
if code's readable in PR's, its readable for everyone
uh wrong approach
at least that's what i think
I mean conventions exist
In Java a field will be private or protected most of the time
i just feel like when you have mixed bag of methods which are public and private and you access them internally, whether its in the same class or not prefixing it with _ could give you context of what you're reading quicker
its a preference
put private methods at the bottom
Why do you need that context? I search my methods by name and not by visibility lol
private foo() {
this.bar();
this.baz();
}
method calls are ambigous on its own, calls do not tell themselves which are internal which are public access
private foo() {
this._bar();
this.baz();
}
this does tell which is internal and which is not
sure with IDE's there's no problem, but when you add on the fact that java verbosity adds to the line number amount, constantly having to jump around file in lets say git repo is kind meh.
its just easier to comprehend what's going on
just like when i add this
everywhere
i can omit it
Honestly I feel like that's a solution to a non existent problem
but i decide not to because i want to know where its declared without having to jump between files
But that actually gives an actual benefit, especially since fields and local variables can be named the same
yea, but i also use it for denoting where the method is from
i just prefer using this even if its optional
and static with full class qualifiers
Foo.staticfoo()
Yeah I agree on that
ItemBuilder library recommendations
But for underscores I think it messes up more than it actually adds any benefit
its just that its not common to write like that, and usually languages which do not have access modifiers write variables like that
Java has always been like that so it is common for Java
The uncommon thing would be to break convention and still use it
I would like to use: import net.minecraft what should I add in my pom.xml please?
?nms
Hi, yes I've already done this but I get this error:
[ERROR] Could not find artifact org.spigotmc:spigot🫙remapped-mojang:1.21.4-R0.1-SNAPSHOT in papermc-repo (https://repo.papermc.io/repository/maven-public/)
Is this valid above 1.20?
You need to build the remapped jar locally using BuildTools
Does Paper have a builder tool or is it necessarily spigot?
?whereami
paper uses paperweight for NMS
its a completely different thing from buildtools
Okay thank for you help
here's a tutorial how to setup NMS on paper
Oh thanks but everything is explained according to Gradle (which I don't know) I only use Maven xD
How do yall mark slow methods in java? like methods that do things over the slow internet such as db lookups
for methods that are "slow" because they block on e.g. IO like you described, throwing InterruptedException is a good indicator that it might take a long while and could include interruptible waits
I mean you could use the Blocking annotation from JB annotations
hmm
no blocking annotation from jb for me but ig ill js make my own one
cuz I also dont want to catch InterruptedException
you can just get them from maven central
org.jetbrains:annotations
interrupts do get thrown with blocking io most of the time anyway, so you should be handling them already for internet and db lookups in your example
or are you try-catch-ignoring them? ♿
If i knew what i was doing i wouldnt be here
rn im only using try-with-resource at the whole db stuff
but that does sound smart
ig ill try that approach. Ty everyone
Hello, InventoryDragEvent seems to not be called when I move an item from a custom inventory to my inventory :```java
@EventHandler(ignoreCancelled = true, priority = org.bukkit.event.EventPriority.HIGHEST)
public void onInventoryDrag(InventoryDragEvent e) {
EmerixeMurder.getInstance().getLogger().info("onInventoryDrag");
e.getWhoClicked().sendMessage("aaa");
System.out.println(e.getView().getTopInventory().getHolder());
//if (!(e.getView().getTopInventory().getHolder() instanceof KillWitherCoalFurnaceTask.KillWitherCoalFurnaceHolder)) return;
e.setCancelled(true);
}```
And I never see those prints. Also, my class with events implements Listener and is registered with getServer().getPluginManager().registerEvents(new InGameListeners(), this);
note that ignoreCancelled=true means you will not see cancelled events
https://imgur.com/a/6Tj02vG
How can i allow a lambda to throw an exception?
When i use an anonymous interface(i think thats what its called) I can annotate it as @SneakyThrows but that gets rather messy
and priority highest means that most plugins will get a chance to cancel the event before you get a chance to see it
unless there is an overload that accepts a Callable rather than a Function/Runnable, you're stuck with sneakythrows
this is a large part of why people don't like checked exceptions in java
or try/catch
damn
ig thatll have to do it
try/catch is even worse than sneakythrows imo because then you're losing the type of the exception for no reason, and for upstream to handle it appropriately you'll have to like catch a runtime exception and get its cause and do a bunch of instanceof spaghetti to handle it
what if i js dont handle it 🙂
i mean its only some fun perk in the lobby so it doesnt matter if it doesnt load
not exactly a good habit to make but yes you can "handle" it where it's thrown by printing a message and a stack trace to stderr
alr ty
personally though i just wrap lambdas like these in sneakythrows; there's not really any meaningful reason not to allow exceptions to propagate without being caught in these situations, it's strictly a language limitation
so although sneakythrows is super evil i find it acceptable in these cases
a Bukkit#createInventory with a custom holder class
try without the annotation
already tried
i mean without parameterizing the annotation
specifically ignoreCancelled
if you completely remove the annotation it of course won't work
the next question is whether you've registered the listener
a lambda is no different than a formal method, so why would they get special treatment when it comes to exception handling?
syntactically, yes
hence language limitation
in practice and in principle, however, a lambda body here is essentially local code which shouldn't be treated differently from other local code
🤨 not just syntactically, semantically it's just an unnamed method
it looks sooo unsatisfying tho
yes, the language is defined in terms of syntax and semantics
what the programmer intends with it is a different matter
and here we have a conflict between the two
just as you can't throw a checked exception in a named method that doesn't have throws declarations
again i fail to see why lambdas should get special treatment
not all lambdas; lambdas in this specific kind of case
but the language can't know that
yes
hence, language limitation
a limitation of the language
i'm not saying the language should be changed
it's also not specific to lambdas then lol
absolutely not, it also affects anonymous local classes and other ways of going around this
i'm saying there's a limitation to it and we're getting around it with sneakythrows
and sneakythrows is evil specifically because it lets you get around the language's checks and balances
but since we're using it to cross a language limitation, using it is fine here
eh
the more proper solution would be to wrap it in and throw an unchecked exception
sneaky throws is just.. a hack
that has its own issues and doesn't match programmer intent
then i'd argue that the intent is flawed
take for example
map.computeIfAbsent(key, (k) -> someThrowingMethod())``
yes, that is flawed imo
this is fundamentally equivalent to (and is default implemented in Map as)
if (!map.contains(key)) map.put(key, someThrowingMethod())
one compiles, the other does not
yet there is no fundamental difference apart from the language syntax; the programmer intent is the same
what's wrong with the intent?
am i not allowed to call a method that might throw, to put something in a map?
now, the language reason why the former isn't allowed that there is no guarantee in terms of the language that the passed lambda will be executed on the same thread and right now; it might be executed by someone else on some other thread's stack, which would make it impossible for the checked exception to propagate to a handler that expects it (the "check" i checked)
however as the programmer we can tell that this isn't the case, as it isn't the case in the former example
so i circle back to what it is, a language limitation
// ...
Tasks.newChain()
.delay(5, TimeUnit.MINUTES)
.sync(new SaveChangeToActualStorageTask(uuid, perk, millis))
.execute();
}
@RequiredArgsConstructor
public class SaveChangeToActualStorageTask implements TaskChainTasks.GenericTask {
private final UUID uuid;
private final Perk newPerk;
private final long millisAtChange;
@SneakyThrows
@Override
public void runGeneric() {
if (nextHandler == null)
return;
boolean isLastChange = lastChangeMillis.get(uuid) == millisAtChange;
lastChangeMillis.remove(uuid);
if (!isLastChange)
return; // avoid spamming requests
nextHandler.handleUpdate(uuid, newPerk);
}
}
is this fine?
cuz the name is so looooong
where scheduler
just remember to eventually catch and handle the exception
that will only run once i think
SaveToStorage?
try using BukkitScheduler::runTaskTimer
unless you only intend to save once for whatever reason
i only need to save once
its js pushing the cache to the persistent database
i feel stupid
Lombok 💔
whats wrong with it?

you see, records
can i use them the same way like classes??
they pretty much are classes
I mean they're kind of just glorified immutable classes
sight another hour of rewriting
imho records is the worst addition to modern java. Concept is great but it has too many cons of using it
it doesnt work with javabeans spec
it just feels like fisherprice version of a simple class with private constructor and bunch of getters
enums on the other hand is a just enough for them to be useful
im not smart enoughj to discuss that
i rather need to know how i can handle an exception in a schedular
neither am i tbh, if i said this to some OOP madman he would 99% disagree
They suck
i don't mind records, i think they're alright and i haven't really ran into any issues with them
I mean records are more DOP styled than OOP styled
nvm i dont even need to do what i was trying to accomplish
another hour wasted
how can i remove only one from the item in the hand ?p.getInventory().remove(p.getInventory().getItemInMainHand());
Decrease the size of the itemstack in the main hand
If it's 0, set it to air
how can i descrese it?
iirc setting the amount to 0 nowadays turns it to air automatically
ItemStack::subtract
this actually used to be a difference between the craftitemstack and bukkit itemstack impls, bukkit stacks would keep their type and meta even if their amount was set to zero, but craftstacks wouldn't
so there is no need to check if it become 0?
not on paper at least
Hello, does anyone have a code for changing a player's nametag?
With protocolLib or other
can someone explain rq why my /chooseStyle command isnt showing up in game?
What do you mean by not showing up ingame? What happens when you run it?
Also make those commands lowercase
as in
You put /chooseStyle as the command
I don't exactly remember if it's case sensetive but make sure it's not that
no its not case sensitive
if the plugin is disabled or fails to enable all of its commands are unregistered
Yeah that too
no the /chooseexpertise command works
let's see your startup logs
?paste
nope i found it, my plugin had an invalid yml file
that should print an error at plugin load time afaik
always good to look at the entire log from start to finish, not just when your plugin enables
Hello, would anyone know how to modify nametags without teams ? Thanks
Hello, how can I fire an event when a player moves an item from one slot to another (in the same inventory) ?
and also getting the start slot and the end one
Getting the end slot is a bit tricky
but you'd use the InventoryClickEvent and then calculate where it would end up
based on the type of click that was done
and what the state of the inventory is
getting the end slot is trivial for regular drag-and-drop inventory actions, but for shift clicking, collect to cursor and so on, you'll have to replicate the client/server logic for them
usually what people do is just cancel those events and only process the simple drag and drop ones
there's also the inventory drag event for when the client drags a stack across several slots to place items in multiple slots at once, and counter-intuitively this also fires for when only one item is placed in one slot; if the mouse is moved even one pixel's worth with the left mouse button held down, it will fire a drag event rather than a click event, so you typically must listen to both
ok so looking online it seems the problem could be that the yml file is in the wrong place inside of the plugin folder iself or its not being complied properly but both of those seem normal for me
mount a text display onto the player
x) no thanks
lol, not sure what solution you were looking for
I would like to use protocollib
for what exactly, modifying the player's profile?
But I can't really find...
I wouldn't recommend doing that but off you go
Add rank, /rename,..
what's the error you're getting precisely
Could not load 'plugins\ExpertiseStylePlugin.jar'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:170) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:158) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:122) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_21_R1.CraftServer.loadPlugins(CraftServer.java:465) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:236) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1017) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[spigot-1.21.1-R0.1-SNAPSHOT.jar:4344-Spigot-a759b62-19bf846]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
... 8 more
how are you building it
bet you they have ij and just hit build instead of the green arrow thing thus they are using ant instead of maven or gradle
make sure you properly restarted the server and not by /reload
ant 💪
im using an artifact
oh, well not quite what I expected. They are actually trying to use ant for this lol
run mvn clean package from the console, or open the "maven" sidebar on the right and under lifecycle, double-click "package"
your issue is that you have configured your resources to be copied with maven but you're not building with maven
If you really want to do it you need to modify the PlayerInfoUpdate and Remove packets, as well as the Entity Metadata + possible others such as the ones related to tab completion. It really depends on how much you want the change to affect things
You can find a list of packets here
?protocol
thx
as long as they don't need anything fancy like shading, they technically would be fine with just using ant if they set it up properly to do so
for sure
though from that pom.xml being there i'm guessing they're trying to use maven
you could setup ant to shade too, but its more of a pain to do then to just simply use maven 😛
yeah, I guess they didn't understand that the IDE internally uses ant for the properties stuff, but if you want to use maven you can't use that
and instead everything gets declared in the pom
yeah so you were right in the duping, there are two of them, and i did clean package on both of them but it doesnt work
there was this error when cleaning the second one tho
oh
I see, thanks
Hello my code uses protocolLib, my code works but does not change the nametag :
public static void changePlayerNameTag(Main main, Player player) {
PacketContainer container = main.manager.createPacket(PacketType.Play.Server.PLAYER_INFO);
container.getPlayerInfoActions().write(0, EnumSet.of(EnumWrappers.PlayerInfoAction.ADD_PLAYER, EnumWrappers.PlayerInfoAction.UPDATE_DISPLAY_NAME, EnumWrappers.PlayerInfoAction.UPDATE_GAME_MODE, EnumWrappers.PlayerInfoAction.UPDATE_LATENCY, EnumWrappers.PlayerInfoAction.UPDATE_LISTED));
container.getPlayerInfoDataLists().write(1, List.of(
new PlayerInfoData(WrappedGameProfile.fromPlayer(player), 0, EnumWrappers.NativeGameMode.fromBukkit(player.getGameMode()), WrappedChatComponent.fromText("TestNPC"))
));
for (Player player2 : main.getServer().getOnlinePlayers()) {
main.manager.sendServerPacket(player2, container);
}
}
ah
I don't think that's what it is, but I can't find anything relative.
Hello, how can I remove the item on the player cursor in InventoryClickEvent ?
Change the name in the GameProfile and remove the enum actions you don't need
declaration: package: org.bukkit.event.inventory, class: InventoryClickEvent
