#help-development
1 messages Β· Page 983 of 1
not familiar either, i know i had a few encouters with classloader for my plugin's addons
bruh I even had to use Unsafe
where do I find that?
Would there be a reason why putting lore on a spawner item would behave differently that on other items?
i think it's called plugin class loader?
It seems like it's putting the lore in the block_entity_data under another components in it
.
package org.bukkit.plugin.java;
doesn't exist
perhaps spigot isn't handling lore properly for spawner item?
oh found it
it's package private
Can't I just invoke getFlag()?
that's what I suggested
Why would I need to get the DataWatcher for that?
guess
it's a magic number
it's not worthy of being an api
plus it's internal, can change how it works at any time
?? Why would I need to get the data watcher if I want to invoke getFlag() was my question
it's probably processed different
name can be obfuscated
you're not using mojmaps, it can be harder to understand the whys
but i'm sure the livingentity get flag trickles down to the datawatcher
ah fuck
is the **perfomance **the same when having
a bukkitrunnable for **each **task
or
a bukkitrunnable for **all **the tasks?
(they all tick the same speed)
Looks like the method got added in 1.9.2 lol
so one for all best?
generally, yes
For sync tasks, by definition the latter will be more performant - unless you "stagger" the tasks (that is one group of task runs on one tick, the next group on the other, the rest on the next, etc. - even if they have all the same tick frequency, they may be out of phase).
However, for that I also assume there is no overhead by bundling the tasks together. If you were to use a list to collect all the ticking tasks and iterate over it (especially via foreach, which allocates an iterator object), then I count that as a overhead that may change the game (although it probably won't).
That being said, the perceived difference is next to 0 unless you are working with a enormous amount of tasks that are ticking very frequently.
My answer was shorter π
I have learned to use a lot of words for simple things. Makes it easy to write seemingly exhaustive documentation
would have been perfect
how would I remove a scoreboard after using player.setScoreboard(scoreboard)
Which is a habit I've been falling into a bit too frequently these days to the point that I'm starting to write a 5 paragraph javadoc for seemingly random internal API
player.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard())
getMainScoreboard
oh neat thanks!
^ @stiff sonnet this works too unless you alr have some objective there
then there will be a sidebar again
Before setting you can keep track of player's last scoreboard
Then bring it back whwn needed
aha hm then ask it to solve this too
Is there way to read incoming server logs?
Hello everyone,
for my plugin ExecutableItems I use since a longtime the method getItemMeta() to check if the itemstack has the a simple tag specified by my plugin.
I'm curious, someone know a better way to check if the item has just a tag ? meta crafting is not a trivial operation when used at high frequency.
if you want to get any information from the itemstack, you have to get its itemmeta, that is where all of the item data is stored; should note that getting the itemmeta should be far cheaper in 1.20.5
either that, or resort to nms to get the info directly from the nbt
How did they make it cheaper
Because itβs already parsed from NBT into components
yes
Spigot uses Log4j to log console output, hence making it easy to listen to incoming console messages, or to block certain console messages from appearing. Prequisities You need to have Log4J on your classpath. We simply add the dependency to our pom.xml using the provided scope, as Spigot already contains those classes on runtime: Create...
^
I that what I thought , thank you
Thanks!
Spigot uses Log4j to log console output
π€ erm, achstkchually, minecraft uses log4j
so I'm right
emily, do not pretend that I'm wrong when I'm technically right :p
so my plugin also uses log4j despite it not being in my classpath?
idk any of your plugins
testplugin-5
if it uses Bukkit.getLogger() or similar, then ofc it uses log4j too
but i am not using log4j, i'm using jdk logger
explain pls
what if mojang decides to stop using log4j? then my usage of log4j depends on the mc version despite not having to recompile my plugin
does my plugin then use log4j?
then you also stop using log4j - obviously ?
but i never used it
obv not
emily, stop trying to troll me. obviously you use whatever Bukkit.getLogger() delegates to. and you know that
trolling me costs 350β¬ per hour
send me an invoice xoxo
gimme your email or RL address
you rich bro. take it or leave it
fake street 123
I did
I'm currently waiting for @slender elbow to send me her email address
give real address or shut up
that's also okay, but in that case you must not complain
Do you know why this happens?
I would not get outta bed for anything less than 350e/hour
you are trying to get a mojang-named class in a reobf environment
No
Cuz the class itself exists
ughm no
The context is below
I'm just trying to pay my rent
why getItemMeta do a copy of the item meta ?
yeah so, your issue is that you are not passing the parent classloader when creating that anonymous classloader
so it can't access mc classes
but I need to define it with my bytecode
because nobody did any better tihng until today
but that cl has no visibility over the server's classpath
ooooh
that makes sense actually
how can I use the parent cl
and still use my bytecode
well, the class is gonna be defined before you could get a hold of it
ok :/
ofc you're free to pull request an improved version :3
you'd need to get the class bytes (getResourceAsStream("/net/minecraft/....class")), process it with asm, and then use methodhandles to define the class from the modified classfile on the server's classloader
hmm it's 1.9+
but i would bet that the class will be already loaded by the time your plugin can do any of that
in which case you're fucked
is there no 1.8 option?
crying
makes sense
I don't need to replace the class
oh wrong video
I just need to change it's bytecode and replace a single instance
Wtf are you doing
I need to
intercept
a single method invocation
in PlayerList
dassit
YO THIS WORKED
wth
yep, my code is a copy of whatever gpt gave me
just gotta ensure everything works
yeah, so you need to modify its bytecode to inject your method
because otherwise minecraft won't see that
I'll just replace the instance
that's enough, isn't it?
just subclass it ?
π
if you try to use the same class, something's gonna break because it's a different class definition
we gonna see
yeah?
gimme a sec to test it out
okay?
you can generate the subclass bytecode at runtime so it matches the package version
uuuuuuh
or have a java template for the package that you then compile at runtime
how
i went over this last week
with asm, you can get the package at runtime because when it runs it's the runtime and it's gonna have the correct versioned package at runtime
getClass getPackageName
not that you need the package anyway
here's the vid
and that's what you get for using nms
regardless of package name, the method names and signatures can still change between versions
you'll have to do some fun introspection
or templates all over the place
I don't get this error
i think the log is showing you do get that error
ye
I also noticed this game of words
oh okay
simple
I don't get
why the every other field
set just fine
(other statics as well)
but not this
static finals the jvm is very protective about
they are constants
they are treated specially
and I thought it was mad at some types not matching
like this?
oh wait no XD
this
what the fuq
I fucked up
I think I even know why
I'm here using the original field
if you aren't subclassing but doing that weird thing you were doing before, you need the offset of your field, not the field in the vanilla class
ye
still doesn't work
still crashes
So, you need to... Mixin?
what
what does that mean
bruh I just debugged all of these
and only 1 field showed up
the logger in the subclass
how do you know so much about this cursed stuff?
When I started to make fabric mods I started becoming dumb
bruh now java doesn't crash the server
but spigot does
xD
like you can't even see it disabling
it just kinda POOFS
yeah to be honest, knowing how to use the unsafe is general knowledge every programmer should have \s
java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "list" is null
at net.minecraft.server.MinecraftServer.bj(MinecraftServer.java:1239) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.MinecraftServer.bi(MinecraftServer.java:1227) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1200) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1014) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:303) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
[16:36:44] [Server thread/WARN]: Failed to get system info for Player Count
java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "this.k" is null
at net.minecraft.server.players.PlayerList.m(PlayerList.java:1106) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.MinecraftServer.lambda$20(MinecraftServer.java:1441) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.SystemReport.a(SourceFile:66) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1440) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1034) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:303) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3871-Spigot-d2eba2c-3f9263b]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Nice π
I get the feeling that the fields haven't been actually changed
I debugged that
and the offsets were the exact same
which field do you want to alter and what are their access modifiers?
I'd say your problem is that you don't work with the staticFieldBase. E.g.: https://github.com/Geolykt/EnchantmentsPlus/blob/4xx/src/main/java/de/geolykt/enchantments_plus/compatibility/hackloader/Hackloader.java#L207-L208
oooh
2 year old codebase coming in to clutch
what Java version are you using?
I wonder why that is
17
what are you trying to do? just tuned in
intercept a singular method in PlayerList
the program is trying to call size method on a list object that is null (has no value assigned to it)
oh use kotlin
https://paste.md-5.net/ufimiyelip.java the code so far
I know
do you know why that happens?
I've never tried it, but you might be able to abuse the new nest host attribute to syphon out the value
yes
so, did you fixed it?
no
okay, what are you trying to do?
.
Naughty stuff beyond your comprehension
Don't ask.
never used it
Do you accidentally try to use putObject for an int/float or other primitive?
the problem lies here
oh yeah
I did
I should use the
fun Collection<Player>.arbitraryFunction() {}
// ...
Bukkit.getPlayers().arbitraryFunction()
primitive equivalents, a?
probably so
MMMMM
Those just compile down to completely unrelated classes, no?
they do, does that matter in this case?
i might be misunderstanding the intentions
why are you trying to intercept a method
Because if it did what @grim hound intended, that'd be a feature deprecated for removal
Hell, the feature would already be removed by now :p
Unless you use the internal jdk unsafe (as opposed to the unsupported jdk unsafe - also known as sun.misc.Unsafe)
ah yes
i've spent 6 hours writing something promising
only to realise that i need to go back to square one
that might be me in a sec
new attempt
this looks sketchy af
I tried
ain't work
do I just give up and use ByteBuddy?
I wanted to avoid that since it'll enlarge my jar file
by 1.5 MB
why no stock ASM?
yeah, but how would ByteBuddy help where ASM doesn't work?
cuz they know how to use this stuff
with bytebuddy it's easy peasy
and I don't
Also, you might try asking this in the recaf discord - they are really savy about this kind of hackery.
the what
send me an invite on dm
is this comparison legit
like does it work
for some reason i feel like it does not
yes
kk
It's just GETFIELD java/lang/Byte.type Ljava/lang/Class; IF_ACMPNE
@grim hound told ya, those people are literal wizards haha
like how did they know
do they just fuckin
code in assembly
that they know what RAX means
They make a lot of highly serious obfuscation, deobfuscation and JVM emulation.
what do you guys use as a server? I have ubuntu on a digitalocean droplet
anyone know which packet is used to spawn players in 1.20.2+
a bunch
depends what you wanna spawn of the player exactly
wdum "what do you use a server"
a server
does anyone know the plugin that shows the stats on screen like name of world, kills/deaths, money ect..? i'm a noob and this is one I cant find...
what do you want me to use my toaster?
many different ones
how about you install placeholderapi
and find plugins that support placeholderapi to display your stuff
like TAB for example
supports placeholderapi
like for example how do i create an npc, i know that in earlier versions it consisted of these two:
add player info
spawn named entity
but in 1.20.2 the named entity spawn got removed, i was wondering what the replacement is
there's spawn entity and player info update packets
ClientboundAddEntityPacket
@valid burrow lol you good bro? Or is this your every day demeaner?
i did a fresh buildtools installation and i find nothing with that name
searched in the EnumProtocol as well
PacketPlayOutSpawnEntity
tried that, does not work with players
did the ClientboundPlayerInfoUpdatePacket change since 1.19.3?
i think so?
might have done something wrong there then
there are add/update/remove actions or smth, and you tell the packet what info to add/update/remove
idk if it was like that before
oop, looks like there is PlayerInfoRemovePacket
yeah always been like that
at least since 1.19.3
the thing is, i tried this code in 1.19.3, now ive changed the spawn named entity with spawn entity, it doesnt work anymore
just look what the game does in PlayerList#placeNewPlayer, you are essentially trying to replicate what it does
Whats the difference between .dat and .nbt files?
No, i am not okay. I am a developer.
I'm a PHP developer, but I'm looking at Java and it doesn't look that difficult to learn.
php and java indeed have similarities
the only differece is the depth
im no PHP dev
but ive never seen OOP on php for example
java is not hard to learn if you have a background in any other programming language
thats kinda the case for every language though lol
to me java is like "the" programming language bc it's super generic and combines like 100 paradigms and princpiles seen across other languages
i started with python but python doesn't feel like "the" programming language to me so i don't think i'm even biased that much
true
unless it's haskell
BTW @DrVoss, TAB was exactly what I was looking for thanks. I just started diving into the minecraft server world this past weekend. The most time consuming part so far is reading through docs for each plugin. I haven't even gotten to mods yet π₯
I was debating if its worth trying to setup a server. Specifically, the cost to run a server vs money earned from server. The specs to run a server with 100 players online cost like 250$ a month based on some things I've read...I could be wrong though....
Whats the method to get the main world?
There is none
Rip
rare opinion from someone who enjoys kotlin that much
I love kotlin more
It's just that like
Java feels like the central language that stuff stems from
Even though that's not true obviously
It just has the vibe
yea fair
go write me a std::tuple implementation and reconsider what you said
if anyone wants to read
https://mcyoung.xyz/2022/07/13/tuples-the-hard-way/
nice i was able to help. Regarding your server 250$ is definitely overkill but that also depends on what you are running what gamemodes etc
Thanks for providing me with another reason to not learn cpp
Where can I download version 1.20.5
?bt
sniped ez
me fingers ded
skill issue
how can you be looking for help, be sarcastic, be annoyed and be casual all over the span of about five messages
seems like epicebic won the duel
we just playing m8
no
its called delay
both of us sent the message almost at the same time
cafebabe didn't have time to process shit
maybe cause cafebabe cant bend space and time
so in-between replying to me and sending a message, epic was able to send his own
why would cafebabe reply to ?Bt but not ?bt lmao
?bt
?Bt
zbll do u do haskell?
tried it?
did you guys know there's no time delay when you shine light on a metal to release electrons.
haskell is actually good
and i've done some reading up and watching about pure functional programming
oh yea
i find that hard to believe
even light need time to travel
it looks like it's very cool but i did not experience any joy while learning about it
only despair
fair
how r u conclube
I mean, monads and that stuff is maybe a bit overly theoretical
what are some actual use cases for haskell
im gucci :)
the release of electrons has no delay
idk, I just know it so I can flex on others
monads didn't seem too hard tbh
lol
welcome to quantum physics
yeah tho monads is like the first more "advanced" concept
but the light needs time to travel to the metal
lol fibonacci was so annoying since there is like so many ways to do it
write one π
that is not the delay i am talking of @valid burrow
write all of them
well then theres still delay xd
did you know playing minecraft with 0 ping is possible if you ignore the time the internet travels
fib :: Int -> Int
fib = (map fib' [0 ..]!!)
where
fib' 0 = 0
fib' 1 = 1
fib' n = fib (n - 1) + fib (n - 2)
altho thisis like a really awful impl
but eh
that is not a good analogy
looks understandable
whatever voss if you wanna be annoyin and difficult
now write a function that outputs N first digits of pi
whys that
π
you got it
you may read more about it here @valid burrow
i never denied that did i
but your statement was just factually wrong. βwhen you shine lightβ indicating we measure from that point in time
i clarified here then
i mean doesnt that also depend what you define as time lag
and you continued
then i clarified again here
stolen
so i hope there's no misunderstanding now
@Override
public void onPacketSending(PacketEvent packetEvent) {
if (packetEvent.getPacketType().equals(PacketType.Play.Server.ENTITY_SOUND)) {
PacketContainer packet = packetEvent.getPacket();
System.out.println("Listener test");
for (Sound sound : packet.getSoundEffects().getValues()){
switch (sound){
case ENTITY_WITHER_AMBIENT:
case ENTITY_WITHER_SPAWN:
case ENTITY_WITHER_BREAK_BLOCK:
case ENTITY_WITHER_DEATH:
case ENTITY_WITHER_HURT:
case ENTITY_WITHER_SHOOT:
if (SuppressorToggleCommand.getInstance().getPlayersToggledWitherSound().contains(packetEvent.getPlayer())){
packetEvent.setCancelled(true);
System.out.println("Wither noise cancelled");
}
break;
default:
System.out.println("Not wither sound");
break;
}
}
}
}```
Sigh I still don't get it D: (none of the debugs are printing nor are the sounds getting cancelled)
?paste
Did it not parse to java?
im on phone
Oh same
doesnt work on phone
it's just that code walls are rly annoying
also true
i dont care about the colors
i could code in text editor if i have to
sorta same
but if its across multiple lines
but tbh it'd be annoying
thats where i draw the line
^^^^^^^
I dunno, i wouldn't dare stop using my beautiful vscode theme
which theme? :o
I have no idea
not vs coooode
me2
mmmyes, the copy pasted ide, goland, webstorm, intellij, pycharm etc
probably
Vscode is easy for me. Started using it in school
fair
I mean its just if u use java in particular u're likely to outgrow vsc
at some point
i suppose kotlin also
but yea
Type checking has run into a recursive problem. Easiest workaround: specify types of your declarations explicitly
heehee kotlin
Do people use kotlin for spigot dev simply because itβs basically free form java?
my only concern with vs code is that its empty by itself
its community carried
which is not necessarily bad
but too much of a hassle for me
I see that as a plus
i use kotlin because i love the extra features it brings to the table eg better null safety, extension functions, more extensive stdlib, some syntax sugar, and then some
java is too verbose
i use kotlin sometimes, the most valuable kotlin feature is just the nullability imho
i can't recall the last time i had an npe
all my homies hate kotlin
I really only see people talking kotlin for the syntax sugar but I suppose thatβs really nice
some people love it some people hate it
i love it
i'm a sucker for kotlin
Idk Iβm a sucker for java
Ive used kotlin for a total of 30mins
Itβs quite fun
also true
Just donβt ever put me on a jfx project again
lol
Someone help with my smooth brained packet canceller please D:
i've got no experience with packets so i'm out
shit
shit x2
All good haha, that's the point of me messing around with it haha
Do you use retrooper's instead? @ivory sleet
Or just don't do packets
Oh gotcha
id rather also inject netty yk
Yeah, I'm just using plib since it's already on the server this noise suppressor is for
I just need to get ahold of packet concepts so I can do cool stuff with the seasons plugin + biome manipulation
So for any packet knowers, please guide me
the listener isnt even called right?
Nope
@Override
public void onEnable() {
protocolManager = ProtocolLibrary.getProtocolManager();
protocolManager.addPacketListener(new SoundSuppressor(this));
getCommand("wm").setExecutor(SuppressorToggleCommand.getInstance());
}```
As per the jdocs, I'm registering the listener correctly... (or at least I think)
probably the funniest meme i've ever done
fun fact: that guy (Juan Joya Borja, "El Risitas") was 45 years old at that time
DISCORD: https://discord.gg/mSVkpKv
PATREON: https://www.patreon.com/spartayoshi
TWITTER: https://www.twitter.com/spartayoshiyt
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ItemFlag.html#HIDE_ADDITIONAL_TOOLTIP I cant use ItemFlag.HIDE_ADDITIONAL_TOOLTIP on 1.20.4. It doenst get Tab Completeted just marked as an Error
show code
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_ADDITIONAL_TOOLTIP);
ItemFlag.HIDE_ADDITIONAL_TOOLTIP is just marked red like it doenst exist
?paste the method
What should i paste?
Uh just do the class actually
It doesnβt exist on 1.20.4
It was changed
It's HIDE_something else
Itβs called HIDE_POTION_EFFECTS instead
Your autocomplete should tell you though
Oh right
1.20.5+ it's ADDITIONAL_TOOLTIP
Below that is POTION_EFFECTS
Ok i see Hide_Potion_effects
Since they got that answer, I'd also suggest you to make that itemstack method private and just have a public getter for it
But i clicked on the 1.20.4 docs why did it show me 1.20.5
What link did you go to
hub.spigotmc.org/javadocs is always newest
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
.
Unless it says otherwise in the URL, it's always newest
spigot api will / should always be most recent
wondering who wrote that
Why ;-;
Fourteen do you know packets? π
Thats the Link i followed
It might be something something google cache
Is there another way to get to 1.20.4
Just remember that hub.spigotmc.org is newest
not in spigot
So no plib experience?
no
Your IDE should have the 1.20.4 docs, maybe there's a way to run them locally
Not sure
Boo, no worries
Ok
Is the HIDE_POTIONS_EFFECTS there to hide Armor Trims stuff under the lore or what would i need?
?tas
declaration: package: org.bukkit.inventory, enum: ItemFlag
Dunno if that's available in 1.20.4 but @quasi gulch
Ahh yeah i see it was just blind
I wonder why it's description is hide trim on leather armor lol
Does anyone know what is the protocol number of 1.20.5 and 1.20.6?
766
player.getInventory().addItem(new ItemStack(Material.TOTEM_OF_UNDYING, 37));
how can i give 37 totems one per slot withh offhand
1.20.5?
1.20
with setItem you can specify a slot if that's what you mean
no i dont want them to stack
?
loop over the slots you want
ty
wait is this even correct?
how can i give item to specific slot?
setitem(slotNum, item)
I think this is the wrong one, hold on
nah idk
you'll figure it out, trust
0-8 is the hotbar, 9+ for inventory
0-8 is hotbar, 9-35 is the inventory
what is offhand?
36-39 is armor slots and 40 is offhand
ty
[BungeeCord] Can I convert the Protocol Version to Version name? Like 766 = 1.20.5/1.20.6
https://paste.md-5.net/isepayukum.java
none of the debugs are printing nor are the sounds getting cancelled, I'm not sure what I'm doing wrong haha (1.20.4)



D:
not to be confused with indated
@young knoll what version do you use
For what
For what
minecraft
you guys heard the new ice spice track
You arenβt good at answering this question
wrong channel
Anyone know why OfflinePlayer.getLastLogin() is returning 0 despite the fact that the player has definitely played before? (notice this only happens if the player hasnt joined after the server reboots)
Nvm its supposed to be getLastSeen
yh i can tell you why
offlinePlayers dont get stored indefinitely
therefore to retrieve data about them you sometime need to do some fancy stuff
u could cache it yourself for example
The Method offlinePlayer.getPlayerProfile().isComplete() doenst return true. But i can see that Playername, uuid and Texture are all there because i got the playerhead with the same OfflinePlayer. When i switched from Paper API to Spigot API that sudenly broke
.completeβ¦.
dont dont do that
you are blocking the main thread
of your server
ah alr
i didnt even know it returns a boolean
what
why would it return a boolean
shouldnt it return well
a profile?
you talk about .complete that complets the PlayerProfile but i mean .complete that shows if the profile is complete
ooooh
isComplete
i thought you meant .complete
big difference xd
well maybe cause it isnβt complete xd
but i know it must be
you need to await the result
no your code runs father than it can retrieve data
Why should it run fourter? It need to wait before the OfflinePlayer is complete?
no it doesnt
it doesnt wait
why would it wait
you didnt tell it to wait
you can tell it to wait with for example a while loop
or .complete not .isComplete
but shouldnt it wait thats the reason it blocks the main thread? What does it wait for when not the rest of the Player Profile?
it doesnt block the main thread
i misread your code
i thought you are using .complete
not .isComplete
.complete is a void that would block the thread and await the data
.isComplete just asks βis it there yet?β
which it obviously isnt cause its literally 1 line above it
I know that getOfflinePlayer(UUID) doenst block because it doenst send a web request but getOfflinePlayer(name) sends a web request
So its like .complete
just because you are sending a web request doesnt mean it blocks the thread
its async
for example yh
yeah its async because its in the scheduler but in the scheduler it need to wait before the OfflinePlayer was recieved? I mean i get the UUID and the only way to get that is to wait that the Web Request send it
It will only do a web request if it isn't cached
It'll be cached after the first call
it will only send a web request if thr player wasnt on your swrver for a long time
Its not i use different names all the time i know that they arent chaced
or that yh
(Or if said player has joined before)
I use random names that never joined
alr well as i already said
you need to await it
just do that
theres a million methods for that
you could use lambda
you could do a while loop
you could block the thread completely
everything works
ok i think that worked
Well it's based on SnakeYAML
which you can use
You can probably use the api from spigot if you shade just that part
bump π
Hey, I have a doubt i cannot figure out for my self...
So i'm trying to make a grid for creating islands something like this:
X X X
X X X
the thing is, I don't know to organize it like this...
could someone give me some advice?
Get off my island!
Still
I can just think on doing it like a row
but not a symetrical grid
its just Math. Space them 10 chunks apart or 100. You decide
hmm
Where are the packet knowers at??
but for making a symetrical grid, i can't figure it out
what do you mean?
Like if i space them 10 chunks
ok it will be something like this
X X X X X
right?
but for making this:
X X
X X
X X X
X X X
X X X
what are these islands for?
just skyblock
then why do you care if its grid or not?
who cares
there's nothing wrong doing this right?
a chunk is a chunk is a chunk
so just make an offset?
It doesn;t matter if they are in a grid or not. Surely the only requirement is they can;t reach eachother
But what if you reach the world border!
30m blocks lmao
don't be ironic
xd
kek
but wont the server overload that way? or just me being silly?
server doesn;t care where a chunk is
Coll do you know packets / plib?
If you don't mind helping? It seems like the listener isn't firing at all
k k thanks
Have you tried sysouting the type of any outgoing packet
See if the sound ones even occur
No, I will try that
nope thats fine
hey i want to use the command /fill by the console but not in the basic world, do you think this is possible
because
facts
Nothing gets printed
private ProtocolManager protocolManager;
@Override
public void onEnable() {
protocolManager = ProtocolLibrary.getProtocolManager();
protocolManager.addPacketListener(new WitherSoundSuppressor(this));
getCommand("wm").setExecutor(SuppressorToggleCommand.getInstance());
}``` is this correct?
Any console errors at startup?
nope
It's so weird everything enables correctly, it's just the listener doesn't fire it seems
Show the listener class
I'd put that in #1100941063058894868 so it'll stick around for people to look at
@tight compass
ah, thank you
no worries
How can you be sure it's not firing if your print statement isn't at the very beginning of the method?
You have an if check before it, move the print statement to the beginning so you can be sure it's not being called
I'm curious, why is your cmd a singleton?
I just added new ones
uh ya know I kinda did that just to get the list I have in there
I changed to di lol
Yeah, sorry to disappoint lol
It's ok, I just don't get why it's not even firing
have you added a sysout at teh very top of your method, above the if statement?
Yeah
public void onPacketSending(PacketEvent packetEvent) {
System.out.println(packetEvent.getPacketType());
System.out.println(packetEvent.getPacket().getSoundEffects());```
onPacketSending, is that when the server sends a packet to the client?
yep
you sure you want packet sending?
Okay so are you sending a sound packet to the client and seeing if you get messages in the console?
-yeah
Would receiving be better?
if you look at the whole paste, it's to cancel wither sounds
It's goofy D:
in console type protocol listeners
[15:48:12] [Server thread/INFO]: Packet listeners:
[15:48:12] [Server thread/INFO]: - nuclearkat.withersoundsuppressor.WitherSoundSuppressor@b9ade00
[15:48:12] [Server thread/INFO]: Asynchronous listeners:
I haven't seen any examples using a PacketListener. They all register a PacketAdapter
Ok I'll try that, thank you!
I accidentally sent my plugin in a free version, and I wanted a paid version, but I accidentally released it and I want it to be deleted urgently!
what do i do?
report it and explain
omg
Does anyone happen to know any good software for reading very large files with (16.4 GB, might not be 100% ascii, so it be nice to be able to see both hex and normal data).
hexdump is ... decent I guess, but not the most optimal of all approaches
Yeah that is what I have been thinking of too
Also I might be the dumbest man alive: I seriously ran hexdump verylargefile -C | more.
I should really look into properly configuring the OOMKiller one of these days, power cycling on OOM isn't the greatest of all things out there
you could use hexdump's -n and -s options to limit how much it reads and from where while working through a large file
i.e. hexdump -n 16384 <file, read first 16 kb. finish up with that, hexdump -s 16384 -n 16384 <file, read next 16kb
whatever you gotta do, ig
?paste
https://paste.md-5.net/suvabewuki.cs
After trying #Server#EntitySound still no prints, so I switched to #Client#EntityAction, now it prints the test A messages but they are not much help:
[17:15:02] [Netty Server IO #1/INFO]: ENTITY_ACTION[class=PacketPlayInEntityAction, id=34]
[17:15:02] [Netty Server IO #1/INFO]: StructureModifier[fieldType=interface net.minecraft.core.Holder, data=[]]```
Nothing past test A fires
packet play in? I thought you were listenign to outgoing?
I was, but nothing had been printing so now I tried incoming
Some sounds are client side
I was going to ask if you are actually playing sounds
No I'm not trying to play any, just cancel any that are of a wither
Listener gets registered, and test a passes but there are no sounds found inside the packet so now I'm not sure how to figure what sounds are being played
Sounds like you can;t They are client side and can only be silenced with a resource pack
are you just trying to stop them being world wide?
You can use packets to send a fake metadata update for the wither
Which sets the silent flag
How would I do this?
As well as figure if the packet is from the wither? is it just that packetPlayerInEntityAction, id=34?
Where/how am I applying this?
Entity metadata packet
PacketType.Play.Server.ENTITY_METADATA
This one yes?
Probably
Yo I need help with a minecraft server
DM me ASAP
$$$!
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
omg @eternal night are you home
After 5 weeks of vaca and visiting my dear parents yes π₯³
Yea I was rather sad to see it drop and I couldn't help much
but hey, paper 1.20.6 is out now π
Yeah okay, whatever you say, double agent
Mom Lynx said the P word
the page facing up team
Hey I didnβt name it
unicode consortium my beloved
gitgud bozo
Okay nitro man
you literally have cat ears
which makes you better than me
Lol
Does anyone know where PlayerCommandPreProcessEvent and ServerCommandProcessEvent (or whatever it's called) is called?
Player would be for any player running a command
Server is for console/command blocks
Can someoen help me I am confused with how to add dependencies
<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>sk89q-repo</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-bukkit</artifactId>
<version>7.0.0</version> <!-- Replace with your WorldGuard version -->
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Trying to get worldguard to work
mfw bukkit version 1
What is your error
I cant get it to find a bukkit version for 1.20.4
I dont really know how to do the APIs and stuff and was trying to use worldguard
Yeah it was cus I typed 1 to see if autofill would show the correct versions I needed
But I cant figure out how to get my plugin to have worldguard as a dependency
Why are you depending on Bukkit
you only need to depend on spigot-api
you shouldn't need bukkit
Im not sure, I assumed I needed the bukkit one too since the worldguard API isnt showing up, but showed up when I had bukkit there even with the version wrong it just wouldnt compile anymore
package org.randomroomgen.ItemAbilities;
import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Display;
import org.bukkit.entity.ItemDisplay;
import org.bukkit.entity.Player;
import org.bukkit.entity.TextDisplay;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Transformation;
import org.randomroomgen.ItemManager.Items;
import org.randomroomgen.RandomRoomGen;
public class Nine implements Listener {
@EventHandler
public void OnNineRightClick(PlayerInteractEvent event) {
Player player= event.getPlayer();
ItemStack ClickedItem = event.getItem();
if (ClickedItem != null) {
ItemMeta ClickedItemMeta = ClickedItem.getItemMeta();
if (ClickedItemMeta.equals(Items.Nine.getItemMeta())) {
if (event.getAction().equals(Action.RIGHT_CLICK_AIR) || event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
player.getInventory().addItem(new ItemStack(Material.STICK, 1));
ItemDisplay item = player.getWorld().spawn(player.getLocation(), ItemDisplay.class);
Transformation tansform = item.getTransformation();
Location loc = player.getLocation();
loc.add(0D, 1D,0D);
tansform.getScale().set(2D);
item.setTransformation(tansform);
item.setItemStack(new ItemStack(Items.Nine.getType()));
item.setViewRange(25F);
item.setBillboard(Display.Billboard.CENTER);
item.setBrightness(new Display.Brightness(15,15));
loc.add(0D, 1D,0D);
TextDisplay text = player.getWorld().spawn(loc, TextDisplay.class);
text.setBillboard(Display.Billboard.CENTER);
text.setText("Β§aCrafting " + Items.Nine.getItemMeta().getDisplayName());
Bukkit.getServer().broadcastMessage(player.getName() + " is crafting " + Items.Nine.getItemMeta().getDisplayName() + " at " + player.getLocation());
for(int i = 0; i > 60; i++) {
int finalI = i;
new BukkitRunnable(){
@Override
public void run() {
Integer time = finalI;
text.setText(time.toString());
player.sendMessage(time.toString());
}
}.runTaskLater(RandomRoomGen.getPlugin(), 20);
}
}
}
}
}
}```
im trying to chance the name of the textDisplay every second why doesnt this work?
loc.add(0D, 1D,0D);
TextDisplay text = player.getWorld().spawn(loc, TextDisplay.class);
text.setBillboard(Display.Billboard.CENTER);
text.setText("Β§aCrafting " + Items.Nine.getItemMeta().getDisplayName());
Bukkit.getServer().broadcastMessage(player.getName() + " is crafting " + Items.Nine.getItemMeta().getDisplayName() + " at " + player.getLocation());
for(int i = 0; i > 60; i++) {
int finalI = i;
new BukkitRunnable(){
@Override
public void run() {
Integer time = finalI;
text.setText(time.toString());
player.sendMessage(time.toString());
}
}.runTaskLater(RandomRoomGen.getPlugin(), 20);
}```
this bit
doesnt send the message either
can you put it in a paste service
do you call the class listener?
As in define it as a listener somewhere outside this class?
yea the event happens
your loop header is wrong
why are you trying to register 60 runnables?
that all run after 1 sec
What are you trying to do
try and change the name of the textdisplay to a number counting down from 60 to 0
or 1 to 60
ty ill try it
Yeah you can use a runTaskTimer to run every second and editting a value of i and then just display that i
and get rid of the loop
it would be much easier to store the starting timestamp and calculate how many seconds has passed since the loop was started
instead of having to deal with atomic integers
i was just gonna have the int set to 60 at the start then subtract 1 each loop
yeah but you'd have to use an AtomicInteger for that
ic
Can someone help me with this? I am trying to download 1.20.5 remapped jars, but its installing 1.20.6
bruh
So I should be able to join a 1.20.6 (vanilla) server with a 1.20.5 (vanilla) client?
so is 1.20.6 a valid API version?
is there an up-to-date guide on using dcevm in the latest version of spigot for hotswapping? i know there are some online but they're relatively dated, just wondering if there's a tutorial or anything on it
what does that mean?
use the jetbrains runtime for hotswapping
the revision is the same
the api-version field in the plugin.yml
isnt the latest version of jetbrains runtime with dcevm bundled this https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr11_0_16b2043.64 though?
which if im understnading correctly is only java 11
I see a jbr for 21 linked on the root README of that repo
I think all releases have dcevm nowadays
maven wont make the jar file anymore with the compile command
if you want a jar you need to use at least package
i recommend install if you want to place it in local repo as well
What's the replacement for ItemFlag.HIDE_POTION_EFFECTS?
?jd-s
HIDE_ADDITIONAL_TOOLTIP
ty
so many flags π
Is anybody able to help me with my issue please?
I have no idea where it is pulling this number from, and IDK how to fix it
female gender mod plugin
nah its this guys project
What is dawg doing
uh huh
but it isnt my plugin