#help-development
1 messages · Page 1075 of 1
They'd get a lot of infected systems if they did
You must be getting so many warnings by now lol
OMG! guess what happened
not warnings (i hope)
Absolutely nothing?
you're right!
If I don't put this line the compiler runs with any other version even if it is in 22
that's why I use this line
Yeah I know gradle well enough to know what these lines do
So you made a mistake because the Java version changed, but the problem persists. 🤡
I don't know and I didn't know if this was normal.
But it would narrow down the faulty java version hypothesis, but that's not the thing here
but it's worth remembering that I suffer from this problem in maven too
intell i config maybe
Are you SURE that lombok is compatible with J22?
why do you even need to use J22
well
The better question is how can he use J22 with minecraft 1.8
i used yesterday
only if the lombok crazies accessed my pc and changed it to a version without me knowing
and I have also tested it on Java 17, 21 etc.
pandaspigot
why te emoji @blazing ocean
why even use 1.8
I'm getting scared
Yeah, then I have one hypothesis remaining on that front, lemme see if I can find a way to invalidate that hypothesis
ah yes, hacker emojis
I ran buildtools and it gave me spigot 1.20.6
If I start this topic I'll die talking only about the advantages
which the hypoteshesis
That JavaCompile is for some ungodly reason not configured to run the lombok AP
is the most certain
There is advantages just most people dont have the ability to do it
Ah yes, custom mc servers
choco rn:
Like if you wanted a good base to implement your own fork for example and want a swerver with not much on it
Minestom is great tho
mine uses 1.20.6 as a base and it works just fine ¯_(ツ)_/¯
forking 1.8 is a PITA because of dmca tho
I meant a bare server.
wdym
compare hosting prices brother
Only way I could think of that would invalidate it would be
tasks.withType(JavaCompile).configureEach {
//enable compilation in a separate daemon process
options.fork = true
}
however to invalidate it you'd need to look a bit into the build output when running with --debug, but the debug output contains confidential information and thus shouldn't be sent over the internet
hosting isn't that expensive and there's not really price differences lol
I mean, a hetzner node is identical for both
no sane host charges you based on version
whats the command
1.8 doesnt have much in terms of code in regards to entities and logic what have you. This makes it optimal base platform to add things you need or want and good for a bare hub server etc
yes the processor is identical for both too ?
yeah
Bro, can you host 1000 players on a 4th generation Intel processor on 1.20?
Minestom makes it possible
sure if you do the right optimisations
what is minestom
you won't be able to do that with 1.8 OOTB tho
Or Folia
Yes if you know what you are doing
only really makes sense when you have a good cpu tho
folia requires at least 16 cores iirc
I already did that lol
Well yea
1k players on a single server was accomplished way back in 1.7 days
minecraft 2.0?
that certainly wasn't a regular default spigot 1.8 server on that cpu
take advantage and leave java
also "4th generation intel processor" says basically nothnig
that could be anything
was yes
pandaspigot
I have no idea what those numbers even mean
paper fork
Yeah it only gives a range of cpus lol
but with paper its possiblet oo
not spigot 💀
regular default spigot 1.8 server
"pandaspigot"
and i try on 1.8
You'd try it out with Folia either way
ALMOST THE SAME THING
Make it an apples to apples comparision
i don't have 1000 players to join a server rq :p
do this in paper at 1.20 then
but let's be honest, we both know it was going to explode
whats the devbug cmd
^
whats the problem
what is this theoretical comparison for
why do you need 1000 players to play on ONE server
./gradlew build --debug iirc
in an open world are you going to make separate servers?
reliably and stable
yes?
and folia
Hear me out: https://github.com/PaperMC/Folia
mooooooooooooods
How many resources does this really require?
Just a shitton of cores
what do you even really need this for lmao
just realise that you will need a good cpu to handle 1000 players lmao
to be fair though if mc was built for it from the ground up it really wouldn't take that much processing power
but ya know
it definitely isn't
hmm i should try this out on my new server
However at 100+ concurrent players you'll make so much money that you probably don't need to be worrying about the server hosting costs
2 xeon cpus 👁️
I mean
in 1.8 no
Technically already a thing
But only for render culling
(And other internal logistics)
yeah but I want it to be a real, real thing
Ah yea - I'm the groovy person. Wait until someone can translate that piece of code to the "objectively" "better" "kotlin" version
infinite up infinite down
ok
dude i bought a server with these specs yesterday:
- 144G of ddr3 ram
- 2x xeon X5690 cpus
for 63€ (one-time payment)
come on mojang don't be cowards
tasks.withType<JavaCompile>
tasks.withType<JavaCompile>().configureEach {
// enable compilation in a separate daemon process
options.isFork = true
}
gpt translated for me
thanks rad
hacker
❤️
why is kotlin in quotation marks tho
is kotlin not real
I have no idea whether kotlin script and kotlin is the same language
yes
well, kinda
❓
what is kinda
it means kind of
kindof
hey augusto are you portuguese
yea
god damn it
SIUU
kekw
now I really want him banned
magma is hacking once again
real
isn't it kinda funny how
im messi fan too
there have been three people called gongas all working on a pandaspigot 1.8 mc server called twinsmc
what a coincidence
why do I keep getting "can't invote .setMaxStackSize because meta is null"?
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
System.out.println(event.getCurrentItem() + " " + event.getCursor());
ItemStack item1 = event.getCurrentItem();
if(item1.getType() == Material.POTION) {
ItemMeta meta = item1.getItemMeta();
meta.setMaxStackSize(64);
item1.setItemMeta(meta);
}
ItemStack item2 = event.getCursor();
if(item1.getType() == Material.POTION) {
ItemMeta meta = item2.getItemMeta();
meta.setMaxStackSize(64);
item2.setItemMeta(meta);
}
}
Here is console output: ItemStack{POTION x 1, POTION_META:{meta-type=POTION, potion-type=minecraft:swiftness, custom-effects=[]}} ItemStack{AIR x 1}
Shouldn't the meta not be null if the type is Material.POTION?
if(item1.getType() == Material.POTION) {
ItemMeta meta = item2.getItemMeta();
It’s not null
item1
I don't know. Probably things like your configuration, ip addresses, perhaps even maven publication passwords/tokens
and after item2
i will send on dm ok
signature gpg keyphrases are probably also included in there
damn tf
public SetupToggleCommand() {
super(List.of("setup"),
Stream.concat(
Stream.of("toggle"),
EMPackage.getEmPackages().values().stream().map(emPackage -> emPackage.getDungeonPackagerConfigFields().getFilename())
).collect(Collectors.toList()),
"Toggles the installation of specific content.",
"elitemobs.*",
true,
"/em setup toggle <content_filename.yml>");
}
last try before I give up and just go make a proper class, any way I can make a list on a single line that takes in lists as an argument without flattening it?
I mean, it's a debug command
what's the command
And it explicitly tells you follows:
2024-07-23T00:50:27.588+0200 [LIFECYCLE] [org.gradle.launcher.cli.DebugLoggerWarningAction]
#############################################################################
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
Debug level logging will leak security sensitive information!
For more details, please refer to https://docs.gradle.org/8.7/userguide/logging.html#sec:debug_security in the Gradle documentation.
#############################################################################
man I can already tell that this is going to end up with a really filthy builder pattern too
Not really a command, but just the --debug flag
what?
interesting
any good ways to hook into registry update code in Minecraft client code
./gradlew --debug build?
cant seem find proper way to hook in a way that my code would run when one of the dynamic registries updates
forget it
nope, just a bad interpreter
geol see dm pls
windows moment maybe
line ending problems usually
i send yout he debug
Well your IDE probably also allows you to pass access flags to gradle but yea
i've had this before
i'm on windows atm
convert your file from windows line ending to unix
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
i dont know initial name of it
version: 1.21, hash: c7ec270d47
thx
how am I getting a null itemMeta here?
just look for Client|Serverbound....Packet
or (?:Client|Server).*Packet afaik
damn i'm getting decent at regex
hi is it normal that when i add an AttributeModifier to an ItemMeta it overwrite every others AttributesModifiers (for an armor or a tool for exemple) ?
yup it's correct :D
Yes
okay the annotation processor seems to be on the classpath, so that's correct at least (unsurprisingly)
ok is there a way to get the armor/damage values of the item ?
Material#getDefaultAttributeModifiers iirc
You have no idea what to do?
You could try to add -proc:full, but that should be the default
-verbose might also help to debug javac further
./gradlew -q javaToolchains -proc:full -verbose
?
oh no
wait
no, it's defined in the JavaCompile task
It looks like you're talkign to yourself
What can you not see unverified people?
options.verbose = true and options.compilerArgs += "-proc:full"
My discord is racist, if you're not verified it wont show you
Oh that guy, i blocked him, ig i cant see the user blocked messages
modify what
they've blocked them and probably are using a discord modification for fully nuking them
Ah lol
I dont even remember addign that
Looks cool haha
IRC-style
jail time
idk how modify
i just watched a space be added
kek
so that happens when it hides the message ig
Yes
Useful addition tho, I always find myself still reading the blocked peoples messages
the "blocked" makes it so much more appealing idk why
I was wondering why it was so quite :-:
I just use blocked messages as a reminder to not help a given person
xD
Fair enough kek
Usually awarded to jerks or total idiots
I'm a total idiot but can at least listen to and follow direction
no you can't
Not coding in console rad
you are refusing to learn to code in console
That seems to be a rather rare trait in the newer people .-.
vim too
Forever will ❤️
i love vim
.-.
tasks.withType<JavaCompile>().configureEach {
options.isFork = true
options.verbose = true
options.compilerArgs.add("-proc:full")
}
Though take it with a grain of salt, I am a dunce when it comes to writing kotlin code (groovy supremacy here)
rad just likes to bully me ig
#nanoisbetter
Helped him one time with testing or something and now he's like my fcking father
lazyvim tho
idk clunky
Though by now I've accustomed myself to both
nano is cli too 🤨
but i dont code in cli
sucks to be you
Ikr
who would have guessed after you suggested vi
Only emacs remains
i suggested vim, not vi
Who tf codes in cli
I love making things harder on myself, every edit no matter the size has to be done in the ide or its a no go man
oof, thats a statement
Noone uses vi instead of vim anyways.
And realistically neovim is better, so I've heard
you could have sent it in groovy and I talked to gpt
i dont have either install ._.
Smh go back to 1985 and code for the NES with your CLI
no
smh my head
it probably works tho
i mean it really depends on your distro
arch had vi preinstalled iirc
not nano, not vim, not nvim
ChatGPT will probably be of better help than I am
... lies
i haven'T installed nano to this day lol
Who needs IDEs, or compilers, just write fcking assembly
That’s what they did!
Ik
http://www.lazyvim.org/ is great
LazyVim is a Neovim setup powered by 💤 lazy.nvim
but since our friend @blazing ocean is so keen on being a grampa, he should probably write assembly ._.
grandpa
Bet grandmas know how to arch :p
oof
That is typically the default
we cannot beat frostalf with gifs
verbose is private
Grandpas used dos
I've only got 2 favorited
I have 0
tasks.withType<JavaCompile>().configureEach {
options.isFork = true
options.compilerArgs.addAll(listOf("-verbose", "-proc:full"))
}
gpt send me this
I manually look up gifs to use lol
you OWN gifs
I do too
But the two favorited are somewhat applicable to anything
nobody finds macking cheese from the michael wave
macking cheese is getting old
no 😭
rad
ebic
you have 2 macking cheese gifs
Like you?
i have four
i have one favourited and its diff
I am not getting old smh
Yk when people say I am x years young, even though they are 60+
I'm hungary
i'm denmark
As long as you pretend to be young and keep up with what is the new thing you will never be old until you die of course
Had a stroke
tasks.withType<JavaCompile>().configureEach {
options.isFork = true
options.isVerbose = true;
options.compilerArgs.add("-proc:full")
}
and what command i execute now?
#SkibidiToiletRizz
./gradlew build --debug ?
Except that lmao
ye
I need a stabbing utensile
Aw cmon I thought that was the "young" thing to do right now smh
I mean it is, but that and the so called mewing has to the most stupid at the moment
Can I compile my plugin against 1.21 which uses HASTE (the name changed from fast_digging) but still have it work on 1.20?
Hopefully it will pass lol
No
Or I guess I need to compile against 1.20 and it should work on 1.21
You can only do the other way around
compile against 1.20 and it will work on 1.21
MethodHandles/Reflection ✨
Ok ok thank you
Have you heard of modules smh
Too much work
Dude I kid you not, the other day at the water park me and girlfriend were in the lazy river with tubes, this kid swims up.... tickles my feet... then says "Skibidi Rizz fr bro" then swam off...
Have you heard of france smh
yeah you really need a module with a provider and an abstract class, need an abstract factory provider too here
I left immediately
Gotta write the gradle buildscripts and all
💀
@cedar saffron opinions on this
Assault*
The main thing is compiling for the appropriate java version. You can technically compile against a higher api version so as long as the methods used exist in the lower versions if java version is not in question
is your girlfriend goth
No
You mean: Assange?
:/
She's latina and short
i love this discord
Körperliche Gewallt
i codeed nothing today but mostly chilled on here
^
Ah, Corporal Execution
No girlfriends allowed
whered that come from
Unless you brought enough girlfriends to share with the class
Hey why not
I have no idea what that even means
only boyfriends or what
Its what i mostly do now a days and occasionally randomly decide who i spoonfeed
I need spoonfeed
Tried to translate it 1:1, didn't go well after my brain stopped working
i'll spoonfeed you once you learn to code in console
nah
I don't need your spoonfeed rad
ill spoondfeed your console before i do that
And well, evidently it's starting to get too late for me anyways
You friggen kotlin weirdo
yes you do
Not hard but annoying if you make a mistake lmao
you always need me to code in conslle
@quiet ice i sent on dm
Just dont code in console
That's why we commission you to do so
no no you don't get it
it's an inside joke
You're right, I dont
It's a big inside joke kek
I think me and rad are the only ones with context to the code in console joke lol
Way back in the 90's it was required in programming to learn to program in binary. I remember my moms book of games you can program in binary lmao
Took forever to do that
understandable
maybe shadow too
he was in the vc too
I hope he remembers
Also if you make an error it was incredibly hard to spot
Yeah, no idea. It looks as if the AP doesn't run, but I despise APs so much that I have no experience with debugging such issues. Hell - I generally prefer it if they don't run, but in that case you can't exactly not run it
surely
If anything that shit was a whole skit
real
Bro is still on that?????
why do I keep getting "can't invote .setMaxStackSize because meta is null"?
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
System.out.println(event.getCurrentItem() + " " + event.getCursor());
ItemStack item1 = event.getCurrentItem();
if(item1.getType() == Material.POTION) {
ItemMeta meta = item1.getItemMeta();
meta.setMaxStackSize(64);
item1.setItemMeta(meta);
}
ItemStack item2 = event.getCursor();
if(item1.getType() == Material.POTION) {
ItemMeta meta = item2.getItemMeta();
meta.setMaxStackSize(64);
item2.setItemMeta(meta);
}
}
Here is console output: ItemStack{POTION x 1, POTION_META:{meta-type=POTION, potion-type=minecraft:swiftness, custom-effects=[]}} ItemStack{AIR x 1}
Shouldn't the meta not be null if the type is Material.POTION?
At this point he could've actually just written the friggin getters and setters by hand
'member what his dev sent me after the fact too? lmao
I got cooked tho he pulled my whole DyNaMiC iP
yea :sk
thanks anyway
apart of the joke
bro thought he doxxed him
I'll have to remove the lombok manually anyway
Yeah, but at this point I'd just abort helping since I don't know further.
RTFM would be my final advice.
I'd been more impressed by a google picture of my house but eh hope in one hand shit in the other
yeah
Your if statement is wrong
the second one*
what is rtfm
If you setup your ide properly you could just have your ide do it
read the fucking manual
Real time future manuscript
Did you try running with skip tests like I said
I have a custom refactor setting to make setters and getters
Dayum, just doxxed somebody in chile
Arrest him
public SetupToggleCommand() {
super(List.of("setup"),
SkibidiArgument.skibidiInit().skibidiAddString("toggle").skibidiAddList(EMPackage.getEmPackages().values().stream().map(emPackage -> emPackage.getDungeonPackagerConfigFields().getFilename()).collect(Collectors.toUnmodifiableList())).skibidiFlushToilet(),
"Toggles the installation of specific content.",
"elitemobs.*",
true,
"/em setup toggle <content_filename.yml>");
}
Flawless code!
here, have an ip: 192.168.0.3
...
i'll tell you mine
192.168.0.111
it wont let me put a skull
Here: My IP: 2a02:b98:f181:2ddc:89af:2550:95c4:57e
10.186.23.5
Even better ip
how
mine
192.168.0.1
Wait isn't this what the guy sent me too? @blazing ocean
my ip is 192.0.0.1
no
Gradle build -x
Bedless is a router
I paid for a vanity IP actually, it's "localhost"
it's like vanity plates for ip
i OWN dns
"Show ips"
my domain is "rad"
@echo basalt review my code #help-development message
I really need to configure my rDNS one of these days
Im also in shenzen supposedly
I rate it a gyatt out of ohio rizz
that's why I'm the best in the biz
damn didn't know
Gradle build -x test
@echo basalt you use lombok?
Mb
why me
what did he do to you
dev akumamc
oh yeah illusion meet the new worst portuguese dev on here
i just telport whenever i use the internet
I worked at akuma for a couple months
except not really new but wahtever
@echo basalt @torn shuttle You guys are bringing my ptsd back
ah yeah same
I wanted to know your opinion about lombok. Do you use it?
how do i remove a player from a hashmap that they are a member of?
Anyways I use lombok but I've been making an effort to use it less
returns errors
map.remove(player)
hashmap.remove(key)
Use uuid for the key pls
But eh, IP-094046093245.static.medianet-world.de. is a funky enough rDNS name either way
^
it doesn't do anything for some reason
what the fuck is this story man
idk even know what my rdns is
🤷 I left immediately after
Have you ever experienced the compiler not recognizing Lombok?
Just join a random IRC channel
strings fuck it up?
If you're using gradle you need to both use compileOnly and annotationProcessor
i used
Though sadly irc.spi.gt is dead :(
although I believe the proper method is to use a gradle plugin
but no works
not works too
UUID.parse(String) or smth
Make sure that the version of lombok you're using is supported by your java version
Gradle plugin would result in random dependency resolution issues
I used the latest version of lombok with java 17, 21 and 22
So something like 1.18.24 won't be recognized by java21 and will throw nasty errors while 1.18.34 works
Oh you using player name?
player uuid as a string
eh, p4fe41c0d.dip0.t-ipconnect.de is also good
Oh? That should work fine
why as string
Can you send code
Can optic make my premium plugin into free so that way all the version history is not lost?
Yeah why not just id
cause im weird like that
But yeah as string is sorta weirs lol
Just use the uuid object
alright now that I have my skibidi code I can actually start making these commands
it's
okay-ish
got that gyat
What's this plugin for btw
/execute self
Rizz sumlator
oh dear
short explanation: old bajancanadian server he gave up on
me migrating out of sonatype
sonatype deez nuts
Like the uhhhh whats it called
me using my own repo for a while now
hunger games?
used to use jitpack 💀
I remember importing an mcmmo version that had some dependency on an old version of worldguard that no longer exists
and it taking 5 fucking minutes to index
Hmm I only remember that guy from hunger games
it didnt last long
and sparklez was the only notable person i remember streaming it
lombok 1.18.34 and java 22 the compiler does not recognize lombok. Do you know what it could be? imllusion
So I assume kingdoms is somewhat like factions?
depends on the project
Blame nossr50
this was a commission project to update some crappy plugin to 1.21
uh oh
But I resold the update :) so I made my money back
bet you have a pizza in the oven rn
You guys need a duck to complain to? Let me know I've got a bag of them
had an artesanal italian pizza at a fancy restaurant like 2 hours ago
ok so did you stop eating greasy chicken because you're now squatting in the attic of a pizzaria or something
you've had more pizza in the last 7 days than I've had in the last 7 years
I mounted an air conditioner with my dad on the building next to the pizzeria
I knew it he's living inside the walls of a pizza shop
it was for some old lady
that reminds me
I'm starting to creep up to my target weight
I'm going to have to find new goals
maybe I can still do a 450 press before the end of the year
I don't have any accurate way of measuring it and I don't really care outside of just having it at a reasonably low level
fair enough
still have a couple of months left to go though so not a rush either
Use the BMI standard
Gives you an idea
yeah a bad one
also I do have a bioimpedence scale, it's just they're not that accurate
bmi my beloved
Wouldnt say BMI standard is bad
it's bad if you're going 3.5 times a week to the gym and have a diet made for nothing but build muscle
the gym is full of bodybuilders that are obese by bmi standards
Not if you do it properly
...
then it's not bmi
for some reason java v if (plugin.getChatFocus().get(player.getUniqueId().toString()).equalsIgnoreCase("STAFF")) { if (plugin.getStaff().containsKey(player.getUniqueId().toString())) { for (Player p : Bukkit.getOnlinePlayers()) { if (plugin.getStaff().containsKey(p.getUniqueId().toString())) { if (playerRank.get(player.getUniqueId().toString()).equals(ChatColor.DARK_AQUA.toString() + ChatColor.BOLD + Rank.JRMOD.toString())) { String format = ChatColor.AQUA.toString() + ChatColor.BOLD + "[S] " + ChatColor.DARK_AQUA + ChatColor.BOLD + Rank.JRMOD + " " + ChatColor.DARK_AQUA + player.getDisplayName() + ChatColor.WHITE + ": " + eventMessage; event.setFormat(format); } else if (playerRank.get(player.getUniqueId().toString()).equals(ChatColor.YELLOW.toString() + ChatColor.BOLD + Rank.MOD.toString())) { String format = ChatColor.AQUA.toString() + ChatColor.BOLD + "[S] " + ChatColor.YELLOW + ChatColor.BOLD + Rank.MOD + " " + ChatColor.YELLOW + player.getDisplayName() + ChatColor.WHITE + ": " + eventMessage; event.setFormat(format); } else if (playerRank.get(player.getUniqueId().toString()).equals(ChatColor.GOLD.toString() + ChatColor.BOLD + Rank.SRMOD.toString())) { String format = ChatColor.AQUA.toString() + ChatColor.BOLD + "[S] " + ChatColor.GOLD + ChatColor.BOLD + Rank.SRMOD + " " + ChatColor.GOLD + player.getDisplayName() + ChatColor.WHITE + ": " + eventMessage; event.setFormat(format); } else if (playerRank.get(player.getUniqueId().toString()).equals(ChatColor.DARK_RED.toString() + ChatColor.BOLD + Rank.JRADMIN.toString())) { String format = ChatColor.AQUA.toString() + ChatColor.BOLD + "[S] " + ChatColor.DARK_RED + ChatColor.BOLD + Rank.JRADMIN + " " + ChatColor.LIGHT_PURPLE + player.getDisplayName() + ChatColor.WHITE + ": " + eventMessage; event.setFormat(format); } else if (playerRank.get(player.getUniqueId().toString()).equals(ChatColor.DARK_RED.toString() + ChatColor.BOLD + Rank.ADMIN)) { String format = ChatColor.AQUA.toString() + ChatColor.BOLD + "[S] " + ChatColor.DARK_RED + ChatColor.BOLD + Rank.ADMIN + " " + ChatColor.LIGHT_PURPLE + player.getDisplayName() + ChatColor.WHITE + ": " + eventMessage; event.setFormat(format); } event.setMessage(eventMessage); } } } } doesn't work
bmi is a specific formula
it sends the message publicly
weight / height (squared) iirc
what in the hardcoding
made some minor improvements in terms of readability after sending that but yeah
yes assuming height is in meters and weight in kg
I do assume that because I live in a real country that uses real units
otherwise it's weight / height^2 x 703
?nms
does BlockSpreadEvent#getSource() actually return the source mushroom block for mushrooms that spread?
because it's giving me air
and I want the original mushroom block
why is it 99
Why not
idk i just added an itemstack with like 200 items and it gave me that
guess i have to do it in chunks
hello guys, im creating a region bgm plugin, and I've got a problem
@EventHandler
public void onRegionEnter(RegionEnterEvent event) {
Region region = event.getRegion();
Player player = event.getPlayer();
if (region != null) {
player.playSound(player, Sound.MUSIC_DISC_5, 1, 1);
}
}
@EventHandler
public void onRegionLeave(RegionLeaveEvent event) {
Player player = event.getPlayer();
player.stopSound(Sound.MUSIC_DISC_5);
}
it works very well but I wanna fade out when it's stop sound how can I do this?
You can slowly reduce the volume in a runnable.
got it , thank you for answer!
can I modify the volume while it's playing ?
not seeing anything for changing whilst its playing, maybe look into https://www.spigotmc.org/resources/noteblockapi.19287/ ?
it's custom sound so i can't use NoteBlockAPI
pretty sure once the packet is sent, you can't change it
I'm trying to update an outdated plugin but it seems there is no longer an available API for one of its dependencies. How can I manually add the plugin as a dependency using the jar?
what build system are you using?
Intellij with Gradle Kotlin
guys im coding stats, should i make a Map<Stat,Double> or should every stat have its own field?
some stats might want to have their own field, so that when accessing the getter or the setter code can be executed, but on the other hand a map is much better to expand on the stats
depends what your use case is, do you plan on persisting these stats in a database? are all your stats doubles?
no and yes
then I see no issue with using a map 🤷
As your data gets more complicated though, you would definetely be better off using a record or a POJO
so a pojo with fields?
yep
Believe the limit is 99
What would be the best way to have a chain that rises? I want this to end at a certain block so it just kind of goes into a block and disappears, should I have a bunch of small block displays that move slowly up and hide each of them at the exact right time
Instead of hiding you could adjust the content of the display instead
This way its a single display and no need to remove or add displays all the time
And the way i would do it is using custom fonts
So each font is a different length of chain
but if I teleport it up in a delayed manor, it will go through the ceiling
I was going to use a block display
Amazing, thank you
No it wont you can adjust the content at same time or just right before teleporting
Issue is I dont use packs
Then where does the chain come from?
the chain block...
Yeah I assumed it wouldve rolled over once I add it to the inventory. It sort of does..
oops
Well a chain is less then a block, so yeah it would partially enter the block. Before it gets to the top of the block you can remove it
Shouldnt be able to see it if done that way
So the best way would to spawn like 25 of them in a stack and move them each up a certain amount in intervels then hide it
Yep
So move it up like .85 on y and when it hits that value in intervals remove one
Not sure on the exact length of a chain. And it doesnt specify on the wiki either
So i think .85 distance is a good starting value
yeah I'll just play around with the magic values
public class CustomItemChoice implements RecipeChoice {
..other shit
@Override
public boolean test(@NotNull ItemStack itemStack) {
CustomItemType type = ItemManager.getItemType(itemStack);
if(type == null)
return false;
Iterator<CustomItemType> var2 = this.choices.iterator();
CustomItemType match;
do {
if (!var2.hasNext()) {
return false;
}
match = var2.next();
} while(match != type);
return true;
}
}
gives me
.IllegalArgumentException: Unknown recipe stack instance com.mitchg.dev.sritems.item.crafting.CustomItemChoice@6e5d5b0d am I just not allowed to use my own recipe choice or can i register it somewhere?
hello people I need quick help
I want to make command which hides all operator command output from other operators like if I use /gamemode command it doesnt broadcast the message that DINOxANAS changed gamemode to creative to other people
what method or event handler i can use to make it work?
This is a server setting
"broadcast-console-to-ops=true" in server.properties
ok
hey guys is there any way to play mp3?
convert to note block sound and play the note in correct pitch and volume
Why is it not working? ```package com.example.loginplugin;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
public class CommandListener implements Listener {
private final LoginPlugin plugin;
public CommandListener(LoginPlugin plugin) {
this.plugin = plugin;
}
@EventHandler
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
if (event.getMessage().toLowerCase().startsWith("/login")) {
String playerName = event.getPlayer().getName();
plugin.getLogger().info(playerName + " used the /login command.");
event.setMessage("/login ***"); // Hide the actual password
}
}
} package com.example.loginplugin;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.HashMap;
import java.util.UUID;
public class LoginPlugin extends JavaPlugin {
private final HashMap<UUID, Boolean> loggedInPlayers = new HashMap<>();
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(new PlayerLoginListener(this), this);
getServer().getPluginManager().registerEvents(new PlayerQuestListener(this), this);
getServer().getPluginManager().registerEvents(new CommandListener(this), this);
getCommand("login").setExecutor((sender, command, label, args) -> {
if (!(sender instanceof Player)) {
sender.sendMessage("This command can only be used by players.");
return true;
}
if (args.length != 1) {
sender.sendMessage("Usage: /login <password>");
return true;
}
// some more login code here
return true;
});
}
public boolean isLoggedIn(Player player) {
return loggedInPlayers.getOrDefault(player.getUniqueId(), false);
}
public void logOut(Player player) {
loggedInPlayers.remove(player.getUniqueId());
}
}```
what if i use this ?
File file = new File("myfile.mp3");
file = file.getAbsoluteFile();
try {
AudioInputStream stream = AudioSystem.getAudioInputStream(file);
Clip clip = AudioSystem.getClip();
clip.open(stream);
clip.start();
} catch (LineUnavailableException e) {
throw new RuntimeException(e);
} catch (IOException e) {
throw new RuntimeException(e);
} catch (UnsupportedAudioFileException e) {
throw new RuntimeException(e);
}
I assume you just play it in your machine not in minecraft
ahh
what about a resource pack
i think you might even be able to add custom sounds but i dont remember that much
well it work in difference way and you won't be as flexible as converting it on the server side
well its either that or note blocks which dont sound nearly as good
this isn't the way you register a command
eventually it is decently good
you can see some of video of note block playing with barely correction
it depends, theres a lot of sounds note blocks simply cant reproduce
Sound is just a bunch of pitch
anyway just a suggestion
you can add as much layer as you can
that is the way to correctly reproduce a music or etc
well i dont know what their use case is but something like vocals wouldnt work with note block sounds
most of sound is missing bass or drum which can still be added in minecraft
The command works correctly, I registered it in various ways, but the password is not hidden from the server console. ```@Override
public void onEnable() {
saveDefaultConfig();
loadUsersConfig();
discordUtils = new DiscordUtils(this);
loggedInPlayers = new HashSet<>();
inventories = new HashMap<>();
playerLocations = new HashMap<>();
getCommand("login").setExecutor(new LoginCommand(this));
getCommand("register").setExecutor(new RegisterCommand(this));
getCommand("changepassword").setExecutor(new ChangePasswordCommand(this));
getCommand("exiva").setExecutor(new ExivaCommand());
getCommand("discordId").setExecutor(new DiscordIdCommand(this));
getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
getServer().getPluginManager().registerEvents(new CommandsListener(this), this);
getServer().getScheduler().scheduleSyncRepeatingTask(this, this::updateBotDescription, 0L, 1200L); // 1200 ticks = 1 minute
}```
eventually yes
for vocal it is too much stuffs to handle so it be nearly impossible.
if you want to do this you can try to filter your console.
I tried, but it seems that only one filter can be set at a time and other plugins override it
eventually you can change it in the spigot.yml
I've read that the best way is onPlayerCommand Preprocess
just set the commandlog to false
I don't want to throw out all logging commands, only those for logging in, registering, and changing the password. I would use authMe, but my login is linked to the gamer's discord account
In short, I'm making, a server for players who are on my Discord and need to connect their Discord account. If someone does not have a discord account and does not belong to the discord server, they cannot play. I don't want server operators to see user passwords in the console while working with it.
Everything works fine except for this one thing. I tested various examples from the Internet, those with filters and with onPlayerCommand Preprocess, but it seems that none of them work properly. The password is always shown in the console.
Hi, I am working on plugin themed around Greek Gods and I am adding abilities each role has. For Hades I had this idea of player throwing splash potion on the ground and it creating portal to nether made out of particles at hit area. My question is if it is possible to create some sort of shapes out of particles using just plugins? Circle for example. I have made circumference of area of effect particle indicators for different abilities but those are large so I can just spawn particle above each block but here I would like to be able to create shape in small area. At this point all I managed to do is spawn a bunch of particles, play nether portal sound, and teleporting player to nether.
Yeah it’s just a lot of maths but possible
There are a few tutorials out there if you google it
ok thanks I'll check for some tutorials
What are all the methods for PluginManagement? Such as onPlyerJoin, onPlayerLeave, onPlayerCommand. Where can I find the full list?
?jd-s
private FileConfiguration usersConfig;
private File usersFile;
private DiscordUtils discordUtils;
private Set<UUID> loggedInPlayers;
// Mapa przechowująca ekwipunek graczy
private Map<UUID, ItemStack[]> inventories;
// Mapa przechowująca ostatnie pozycje graczy
private Map<UUID, Location> playerLocations = new HashMap<>();
private class CommandFilter implements Filter {
@Override
public boolean isLoggable(LogRecord record) {
String message = record.getMessage();
if (message != null && message.toLowerCase().contains("/login")) {
record.setMessage("A player used the /login command.");
}
return true;
}
}
@Override
public void onEnable() {
saveDefaultConfig();
loadUsersConfig();
Bukkit.getLogger().setFilter(new CommandFilter());
discordUtils = new DiscordUtils(this);
loggedInPlayers = new HashSet<>();
inventories = new HashMap<>();
playerLocations = new HashMap<>();
getCommand("login").setExecutor(new LoginCommand(this));
getCommand("register").setExecutor(new RegisterCommand(this));
getCommand("changepassword").setExecutor(new ChangePasswordCommand(this));
getCommand("exiva").setExecutor(new ExivaCommand());
getCommand("discordId").setExecutor(new DiscordIdCommand(this));
getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
getServer().getPluginManager().registerEvents(new CommandsListener(this), this);
getServer().getScheduler().scheduleSyncRepeatingTask(this, this::updateBotDescription, 0L, 1200L); // 1200 ticks = 1 minute
}``` Why doesn't this apply a filter?
it looks like Bukkit.getLogger() return wrong console logger...
is 1.8 support discord server still exists
what server version are you targetting for?
if its legacy you have to use legacy logger api ig
1.20.1
No
... This is the fucking solution
// Try to set the log4j filter
try {
Class.forName("org.apache.logging.log4j.core.filter.AbstractFilter");
setLog4JFilter();
} catch (ClassNotFoundException | NoClassDefFoundError e) {
// log4j is not available
consoleLogger.info("You're using Minecraft 1.6.x or older, Log4J support will be disabled");
ConsoleFilter filter = new ConsoleFilter();
logger.setFilter(filter);
Bukkit.getLogger().setFilter(filter);
Logger.getLogger("Minecraft").setFilter(filter);
}
}
// Set the console filter to remove the passwords
private static void setLog4JFilter() {
org.apache.logging.log4j.core.Logger logger;
logger = (org.apache.logging.log4j.core.Logger) LogManager.getRootLogger();
logger.addFilter(new Log4JFilter());
}```
I have spent a good 12 hours today working on a fake crafting table (and other systems)
just for it to look like ive 'done nothing
damn
copy task
?
do you use shadowJar?
not
use it
Try to add this into your build.gradle
tasks {
jar {
destinationDirectory.set(file("$buildDir/someDir"))
}
}
doesn't quite work
also I use Kotlin for gradle
ok
copy task is easy as fuck
tasks.create<Copy>("copyShadowOutputToLocalServer") {
from(tasks.shadowJar)
destinationDir = file(.....)
}
there
yeah just one question
uh'
do I need some shadowJar branch?
and in the tasks.create<Copy>("copyShadowOutputToLocalServer") {
what do I replace the
str with?
whatever task name you want
it is not correct i think
be creative
"it doesn't work"
vomitOutputJarToUnderpoweredServer
still compiles to libs
I mean, you are running the new task right?
:clueless:
I meaaaaaan
I just click build
Yea
which will not run that task
if you want build to run that task, just have build depend on it
yea
i changed, try this
declare a dependecy from the build task on the just created task
tasks.build {
dependsOn(tasks.copyShadowOutputToLocalServer)
}
like this?
oh
yeah it works
thanks
np 👍
java.lang.RuntimeException: java.io.NotSerializableException: org.bukkit.craftbukkit.v1_20_R1.inventory.CraftItemStack
for this
and the paper method lacks as well
How can I make http request in kotlin? I saw a library called okhttp.
let me see
where can I find the docs page for the http request
So does anyone have a reliable way of serializing a player's inventory?
i hate this lol
public lib moment
Cuz friend doesn't know
So can anyone tell me how I can serialize and deserialize a PlayerInventory?
BukkitObjectOutput/InputStream
does this seem like reasonable english? fail(f'git clone needed for bootstrapping build system failed with exit code {exitcode}', exitcode)
depends on what you need it as.
byte array? base64? yaml? json? or some weird puzzle?
when I write a message in chat I get the name of the world first and at the end of the name $f how can I remove it? what plugin is it?
also you don't need to put it in a bytearrayoutputstream, you can just pipe the object stream directly to a file output stream
essentials? -> #help-server
Will test it out
Well I just wanna save it and be able to read
All I need, really
Don't care about the extension
what's more important? saving a few bytes less or have it human readable?
then just throw it into a BukkitObjectOutputStream and you'll get a byte array
Okay, so here I just need to use the Bukkit version of the Out/In streams?
(In for reading)
yes
Alright, thanks
Weren't we over thus
Use internals
add api
I would love to but unfortunately I cbf to deal with Bukkit ItemStack
yeah
I might soon tbh I can just delegate to an unsafe method
Bukkit ItemStack Is just Craftbukkit ItemStack internally when???
🤔
@worldly ingot how likely do you think slime would be to support moving ItemStack to an interface
Depends on how you do it because you might end up fucking up tons of Bukkit behaviour as a result
You need to retain the concept of copies vs mirrors
Well that is probably doable
I can't imagine making copies would be to hard to achieve
I think a good first step though would be mindlessly easy to add.
deprecate ItemStack constructors and add static methods to ItemStack that can either delegate to Bukkit or UnsafeValues
If you do that, ItemFactory is the place to do it
Oh yes I forget about that but yeah
Could delegate to there since it's an interface
over at {{ fork }} we did {{ thing }} wrt that
idk what wrt is
world record time?
with regards/respect to
can anyone give me a hint how i can change the Playertag of a Player in the Tablist and above the head with NMS Packets in Version 1.20.4
step one is to not use packets because you don't need them
I already found the ClientboundPlayerInfoUpdatePacket but for that packet to work I have to change the players Gameprofile which is private and final should i use reflection for that
ok than give me a hint
but why is it working with protocol lib
does protocol lib use reflection for that?
protocollib is basically just reflection
you can use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#setPlayerListName(java.lang.String) for the tab list name, and a text display entity riding the player w/ a translation transform for the name tag
ok thats pretty cool so far i used:
player.setPlayerListName(playerName); player.setDisplayName(playerName);
AsyncPlayerChatEvent is called on commands?
but the player has still the false Name above there head and the PlayerjoinMessage is also not correct
if ur tryna detect commands being executed you should use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerCommandPreprocessEvent.html
but, yes i believe it is called on commands. not entirely sure tho
i mean, for the join message you can just change it in the join event
packets wouldn't have helped you there anyway
and there are probably other messages too where that matters, death maybe, idk
yeah thats the smallest problem
how the chat plugins work? for example /g ?get the message without the command?
and cancel the event
They listen to the chat event
how i send for some players?
@EventHandler
private void onAsyncPlayerChat(AsyncPlayerChatEvent event) {
Player player = event.getPlayer();
event.setFormat(plugin.getChat().getString("chat").replace("&", "§").replace("%player%", player.getName()).replace("%message%", event.getMessage().replace("%", "")).replace("&", "§"));
}
you either modify the recipients or cancel and send yourself
recipients returns all playerso nline?
withouit plugins
these days with signed chat its unlikely you can simply modify it like that. You need to cancel teh event and send yourself
wdym signed chat
by default now all chat is cryptographically signed
if you modify it it will error
since 1.19
player.getNearbyEntities returns the player instance too?
is 1.8
then you can just modify the message/recipients
@EventHandler
private void onAsyncPlayerChat(AsyncPlayerChatEvent event) {
Player player = event.getPlayer();
for (Entity entity : player.getNearbyEntities(30, 30, 30)) {
if (entity instanceof Player nearby) {
event.getRecipients().clear();
event.getRecipients().add(nearby);
}
}
event.setFormat(plugin.getChat().getString("chat").replace("&", "§").replace("%player%", player.getName()).replace("%message%", event.getMessage().replace("%", "")).replace("&", "§"));
}
this way?
idk if nearbyentities return the player too
to see the own message
you should not be sending messages to them
to the mobs? yea i verify if instanceof player
you are clearing the recipients every time you find another player
oh yes
clear before the for loop
@EventHandler
private void onAsyncPlayerChat(AsyncPlayerChatEvent event) {
Player player = event.getPlayer();
event.getRecipients().clear();
for (Entity entity : player.getNearbyEntities(30, 30, 30)) {
if (entity instanceof Player nearby) {
event.getRecipients().add(nearby);
}
}
event.setFormat(plugin.getChat().getString("chat").replace("&", "§").replace("%player%", player.getName()).replace("%message%", event.getMessage().replace("%", "")).replace("&", "§"));
}
done
you can't interact with the world async, that includes getNearbyEntities
use the sync PlayerChatEvent for that, since you are mutating the event with what you are doing sync
ok thx
you'd do better by simply looping the recipients and remove them if they are too far away
that can be done in the async chat event
how do i read vector array/list from config?
ok thank you
@tawdry shoal
Hey, I'm making a plugin for a block with a gui, this gui has a certain button that starts the process, but if I exit the gui and come back in, the process will stop. How can I implement this process in the background? so that it works outside the GUI. Here is my code with a thread where I handle this process.
public static void startReworking(Inventory inventory, ItemRecipeManager recipeManager, Map<Inventory, Boolean> reworkingStatus, Player player) {
int itemCount = 0;
for (int i = 10; i < 17; i++) {
ItemStack item = inventory.getItem(i);
if (item != null && !item.getType().isAir()) {
itemCount++;
}
}
if (itemCount > 0) {
RecyclerGUI.createButton(inventory, false); // Устанавливаем красную панель перед началом переработки
reworkNextItem(inventory, recipeManager, itemCount, 0, reworkingStatus, player);
} else {
RecyclerGUI.createButton(inventory, true); // Устанавливаем зеленую панель, если нет предметов для переработки
}
}
private static void reworkNextItem(Inventory inventory, ItemRecipeManager recipeManager, int totalItems, int currentItem, Map<Inventory, Boolean> reworkingStatus, Player player) {
if (currentItem >= totalItems) return;
for (int i = 10; i < 17; i++) {
ItemStack item = inventory.getItem(i);
if (item != null && !item.getType().isAir()) {
ItemRecipe itemRecipe = recipeManager.getRecipe(item);
if (itemRecipe != null) {
int slotIndex = i; // Сохраняем значение i в локальную переменную
RecyclerGUI.createButton(inventory, false); // Устанавливаем красную панель
String group = getPlayerGroup(player);
int time = itemRecipe.getTime().getOrDefault(group, 10); // Default to 10 seconds if group not found
Bukkit.getScheduler().runTaskLater(RustRecycler.getPlugin(RustRecycler.class), () -> {
if (!reworkingStatus.getOrDefault(inventory, false)) {
return; // Если переработка остановлена, выходим из задачи
}
List<ItemStack> items = itemRecipe.getTo().stream()
.map(To::generate)
.collect(Collectors.toList());
// Удаляем переработанный предмет
if (item.getAmount() > 1) {
item.setAmount(item.getAmount() - 1);
} else {
inventory.setItem(slotIndex, null); // Используем локальную переменную
}
addItemsToSlots(inventory, items, 28, 35);
// Проверяем наличие предметов в слотах 10-16 после переработки
boolean itemsPresent = false;
for (int j = 10; j < 17; j++) {
ItemStack checkItem = inventory.getItem(j);
if (checkItem != null && !checkItem.getType().isAir() && recipeManager.getRecipe(checkItem) != null) {
itemsPresent = true;
break;
}
}
if (!itemsPresent) {
reworkingStatus.put(inventory, false);
RecyclerGUI.createButton(inventory, true);
return;
}
if (currentItem + 1 >= totalItems) {
RecyclerGUI.createButton(inventory, true); // Устанавливаем зеленую панель, если это последний предмет
}
reworkNextItem(inventory, recipeManager, totalItems, currentItem + 1, reworkingStatus, player);
}, time * 20L); // time * 20 тиков = time секунд
break;
}
}
}
}
?paste
i see a lot of static
and https://paste.md-5.net/umawuxokeg.cs and here is a piece of code where everything is called
typically you want to have your process as an object and store it somewhere in f.e. a ProcessHandler, which keeps track of them
- Your code interacts a lot with mutable Objects. This means static is completely out of question for this. First step: Dont use any static here.
- It is important to decouple your logic from the actual user input.
Your blocks functionality should have one method to start, and one to pause/stop it.
How those methods are called should be completely irrelevant. (Could be a button click in a GUI or anything else)
So first write the logic of your block, without any GUIs in mind.
After that your GUIs should simply be a way to let the user interact with that logic.
Reduce the amount of dangling Maps, and other collections.
Start with a simple manager class which holds all your recyclers, and implement a Recycler class
public class Recycler {
...
}
public class RecyclerManager {
private final Map<Block, Recycler> recyclerMap;
...
}
If I make an enderchest plugin how do I block that dupe with freecam?
I don't know how to fix this dupe
Explain this dupe and why you would need an enderchest plugin in the first place
It seems they don't even know ig
Otherwise they'd atleast have an idea of where to go for patching it
Im trying to understand what an "enderchest plugin" is in the first place.
Simply a command that calls
player.openInventory(player.getEnderChest());
?