#help-development
1 messages · Page 407 of 1
using paper xd?
paperweight?
"l" could be anything
no i mean paper.jar xd 1.8.8 ,-,
decompile the class, then check which type "l" has
ok
Yes, it’s still obfuscated
What are the terms of use for including the remapped JARs from BuildTools inside a GitHub repo?
the terms are "not allowed"
^
Figured
no matter whether it's remapped or not
it contains mojang's code and hence you must not publish it
idk why you would even add that to a repo
that's the whole point of why buildtools exists
yeah I also wonder
its probably like the one plugin i found that used maven full of system scopes
and they were just distributing paid forks
Presumably to avoid having to run buildtools on the machine of any contributor
Exactly, local maven repos
I usually include a run-buildtools.sh file that builds all the needed versions, or for some people, I give them access to my nexus repo which has all the versions
distributing mojang code :!!??!?! uh oh
https://github.com/JEFF-Media-GbR/JeffLib/blob/master/run-buildtools.sh this e.g. compiles all versions this project needs, but only if it's not in the local repo yet
well not to the public lol
would that still get classed as distributing
probably
Technically yes but the actual damages are minimal
well the damages are zero
Lol
even uploading spigot.jar, there wouldn't be any damage mojang could claim
Fair
they upload the server .jar themselves to the public, I doubt they could claim ANY damage if I'd now upload a spigot.jar that everyone could produce themselves
they could still tell me not to do it, ofc
I mean, running over a red light also doesn't cause damages if there's no accident 😄
Gonna cause damage to your wallet when I write you that ticket though 😂
yeah D: red light violations are very expensive here
Technically that’s an arrestable offense here
here it's just an infraction, 228,50 € plus 1 month prohibited to drive + 2 penalty points (8 points = license gone)
In my state all traffic violations are classed as criminal offenses
damn that's harsh
So anything not explicitly stated to be non-arrestable is arrestable
I ALWAYS drive 20kmh too fast lol
or 30kmh outta town
because 21/31kmh is the limit where you get penalty points
and it's where the fine jumps from like 30€ to over 100
Most times I see people get the actual ticket dismissed as long as they pay the court and do a driving class or whatever
That way it gets off their record and their insurance doesn’t go up
insurance can see which tickets you get? o0
Yeah
yikes
It’s a conviction, it’s public record
If you get a final conviction on a ticket your insurance looks for and sees it
that's quite funny
to me
insurance here can't see anything, all they can see is the damages you report to them
Morefor github actions to compile a plugin
use sprax dev spigot thing
This Action allows you to easily compile Minecraft Spigot or Paper and install it in your runners local maven repository. - GitHub - SpraxDev/Action-SpigotMC: This Action allows you to easily compi...
@dry yacht weren't you the one constantly asking about how to optimize maps & itemframes?
I remember there was a guy constantly making threads about this
Looks like exactly what I need
that's the only useful action I've ever seen
asking if there was a way to precache frames to render gifs at 60fps
Or you can just do it yourself, however you like https://github.com/GoksiOrg/TabbyControl/blob/main/.github/workflows/publish_release.yml
But how would that work if you need different java versions?
Eg 17 for 1.19 and 8 for 1.12
Also doesnt it rebuild it everytime even when it was already built?
Thats gonna take a long time if you need 12 spigot versions
Anyone can technically find out who gets a conviction, not just insurance. It’s not private
It does, as workflows is basically a container
But you can cache stuff somehow
No idea how but its possible
I did, it's maven cache
Ah ok
But it's persistent for like an week
hi , where i can find the wiki for protocollib 1.8.8?
hey
string: Dave jumps.over the detroit
i want to check if string matches (contains) "jumps." (the jumps word with the dot):
i used the following regex but however, if i type jump and then type anything after that, it would match the string when shouldn't (false math), what should i do?:
^.*(play.)*$
i want this to be matched along with the dot only, not any other characters
to render gifs at 60fps you need like double the amount of images minimum lol
Nope, I already got that all figured out, xD
Cannot remember that I've ever asked about them
maybe it was someone else
but I remember going back n forth for like an hour
and I saw you do stuff with maps n itemframes
Yeah, I was working on bringing browsers into minecraft, but that project has been put on the back burner for now, as my attention gravitated towards something else again, xD
There were multiple people interested in this topic, btw
but the main problem with gifs though, is the fact they don't typically contain 60 frames in a second, let alone double the amount for backup
30fps is kind of the threshold of where this makes sense anyways, pushing 60fps is pretty adventurous
well, while you might not notice a difference and there are some people who can, it lets your display devices select the best images if you can stuff more in there
not only that, if a single image is rendered weird for whatever reason the odds of you noticing it is far less likely
You just cannot compress the image data at all, especially not across multiple frames. You're gonna kill people's internet connection with that
anybody pls help, its late here, i should update this on server, and sleep now
Yes you can, this is the whole reason why we have various formats and codecs, because you can precisely do this.
Okay, I'm just going to explain this and get opinions on whether or not loading the extensions as plugins would be a better idea. I'm basically trying to do what Bedwsrs1058 does, but make it so that one core has an API to make multiple minigames easily but also make extensions for minigames that exist. Right now I'm loading jars from the plugin's folder, would it be better to make it to Bedwars1058 does and have them be plugins? Part of the loading them from the plugin's folder was to combine everything into one or two master command(s), but I think I could do that either way now that I think about it.
u can just use compile("play\.")
i did
Uhm, how?
exact same thing happens
but I wasn't talking about compression anyways
Just making sure: We're talking about item frames, right?
it doesn't even match it
Illusion talked about displaying gifs on item frames, I thought
Of course you can compress images, that's nothing new, xD
ali use Matcher::find
he stated someone wanted to render gifs at 60fps which you can, but to display a gif at such speeds fluidly you need minimum double the images
.
My bad then.
and then not only that gifs typically don't have 60 frames a second anyways
let alone they only last for a few seconds as well
So, to be more specific: 30fps seems to be the absolute limit on item frames. I don't think the internet connection of people would take more either.
Displaying gifs somewhere else is a whole different story, of course.
I mean
each 128x128 area is 16kb
what I did at work was a weird hashing system that re-uses duplicate frames across a player's session
you'd only need to send the frames once and then just send packets re-setting the ID to the following frame
oh nevermind, chatgpt does it 🧠
So being honest you can actually achieve high frame rates, as long as the client isn't the one queuing up packets
^
minecraft also uses a very limited palette which makes things easier
as there's less data
My bad... I was so caught up in the mindspace of browser streaming still, that I totally forgot that you can just assign a map ID to each frame of the gif and just send map ids. Yeah, gifs can probably be pushed fast as hell.
when the interesting conversation come up i have to sleep 💀
You'd need a shit ton of IDs if there are many concurrent users
So only after short map id, xD
The hashes are global
and generating an ID should be fast enough
in my case I just serialize the color array into a base64 and add it to a palette / list
the id is based on the position of the hash in the list
can reuse id's if they are not long lasting as well
I do recycle ids
Right, map ids are scoped to a single client anyways.
Oh yeah, hopefully, haha :D.
but it's not that complex
Only reason why I made such system is because my target audience is much more likely to be on a shitty internet connection
Yeah, it should be pretty manageable, now that I think about it. Great idea tho, I'm just really inexperienced with hashing algorithms.
I was thinking of some extra fancy way
to make the hash based on the player id + board position or something
and then I was just like "why don't we just have a global hash list"
and it took about 10 minutes of playing with code to get it working
a 1000x1000 (mostly single-colored) image went from 1.08mb to about 70kb
Do you know - round about - how many map IDs you use for a gif of a certain length? I kinda have a hard time imagining anything, because 128*128*256 are a lot of combinations.
gotcha
each id for a unique 128x128 section / frame
honestly Map IDs are not that limited and the amount of ids used is not really a concern
It works just like entities
it's the same with entities
sure you're creating a ton of entity Ids for stuff like projectiles, arrows n all
Well, depends on the version. The signed shorts are quite tight.
hm
I guess a per-person palette would be more applicable in such cases
I expect you're not an idiot and run a minimally recent version
I think >= 1.13 was the version where they finally migrated to integer map IDs.
more recycling
you could still use a short but have it backed by an integer
or just use the old system in the old versions
well
65k frames / player is more than enough imo
with the global system maybe not
but even then you'd need like 100 players with 650 unique frames each
and pray that none of them relogs so that half the ids get recycled
lol
Does the client render map ids with the sign bit set? I actually never tried that...
pretty sure it does
but certain plugins trip
like InventiveTalent's MapManager or whatever
trips balls when you toss negative ids
yeah because everyone assumes no negatives 😛
Never heard of that, xD. I guess you're also rolling your own libs for maps.
Imagine people still using MapPalette#matchColor, xDD. I saw that a lot when I first researched the topic.
WAIT THAT'S A THING?
yeah I had one of the new devs make it manually
and then I just copypasted code from the wiki and made the caching thing
Oh, right, I forgot... you're on a whole other level, :)
gotcha
Well, I'm happy to know that at least my map color lookup is optimal, now that I found out that I completely missed hashing and reusing map-ids, xDD. I really, really gotta get into hashing algorithms more to develop a feel for this kinda stuff.
I mean
it was something that was always in my mind honestly
but it's not a necessity
I can see the likes of hypixel using it
because they send so much data
and network traffic actually costs money
For what I have in mind, it most definitely is, haha. And it's a great learning experience too.
don't need to get into hashing algos specifically for this
a lot of this comes up when you are just hitting limits
I've only had to implement such culling systems when I Was actually facing problems
server I worked for was sending so many particles that people started dropping connections
and by so many I mean like 50k/tick
lmao
was doing about 20mbps constant for every player
death by particles
implemented a culler and it went real quiet
and looked just as good :)
packet-based culler, made a hash by splitting a block into 16x16x16 sections (particle pos values are decimal), and assigning each session a hash
not even sure why you need 50k particles
not like someone is going to really see that many
the guy responsible for particles set the numbers way too high
he was rendering the whole thing every frame instead of just the changes
I wouldn't blame him, he does VFX for his day job
well to be fair that is an easy mistake
a lot of people don't think about you could just only render changes
and not the the whole thing and including changes every single time
yeah
tbh those 50 lines for the culler system won't hurt anyone
and it's much easier to manage than rewriting the whole particle engine
to only display diffs
reminds me I have particles to mess with too >>
o.O
Well, I was just noticing for a while now that I have difficulties with hashing and that I should really up my knowledge on that topic. I'm having a hard time thinking about how I would hash a ~65k sized byte array into something that corresponds to a map ID quickly. Like, there can be hash collisions, and if you then find a bucket, you'd still need to check on equality, so you're kinda iterating the whole thing twice, once for computing the hash and once for comparison. I don't know if that's ideal, I'm sure Illusion is doing something better.
My solution is literally encoding it to base64
and storing it in a list
literally
you don't need to make perfect mathemathical hashes
you just need to convert a 65k array into a numerical ID, and if it exists already, just return the existing one
Making a mathemathical solution to always calculate the same one will cause collisions
Just caching results will not
So you're hashing the string? I mean, you gotta have some sort of Map<byte[], Integer>. How does base64 help you there?
TBH I could store the array directly but that's a lot more data
base64 kind of compresses
I don't hash the string, I just use the string as a UUID type deal
I just don't see how you're ending up with an integer if you never hash it. You said you keep it in a list, I'm sure you won't do O(n) search through that list...
O(n) searches are faster then you think
tbh looping through 60k elements isn't THAT slow
a CPU operates on GIGA hertzz
we're talking about KILO iterations here
:)
shitty analogy but my code is the equivalent of like
Instead of determining someone's riches by their net worth, I just see if they own a lambo
or if their name is frostalf
But yeah unless you had something like millions of elements in a list or something, then yeah I would recommend using better methods but just a few thousand you are not going to notice how slow it really is
No, but you gotta iterate 65k items and then check a lot of characters (if base64 compresses, bytes otherwise), so it's not just that. Maybe I'm just really lacking a feel for this kind of estimations, but it sounds horrible to me. Like, there's gotta be a better solution. Sounds like you're making it work out great tho.
it's an equals check
like sure it can get slow but when it does, you just go out there and make a better solution ??
just start storing map ids in SQLite??
Yeah, sure thing, again, I'm just trying to understand it. I'm not talking bad about the solution in any way.
we're not really storing colors individually, we're just putting them all in a big line and seeing if that line is in a list
Is it possible to prevent an armorstand (passenger) from dismounting a player when the player is swimming?
use packets and half the stupid nms logic is gone :)
the other half is client-sided predictions
you could always simulate the armorstand riding the player while they are swimming
not sure why this would need to be a thing
Earlier I had found a post of somebody using a "buffer entity" to fix this, but the answer seemed so vague to me :(
Maybe it rings a bell for you?
I am attempting to display another nameline above the username and BELOWNAME lines with a passenger armorstand, but I think the water thing kinda makes it not worth it?
What I could do is spam teleport the armorstand on the player
@dry yacht in case you're curious,
you could probably optimize that contains -> add -> indexOf
by doing
indexOf -> if -1 -> add -> indexOf = size() -1
and then if you want more elaborate mechanisms you can use 2 or 3 dimensional arrays
the last part is basically what I meant with the simulating
As in
If player is swimming
Then teleport armorstand ontop of player
If player not swimming
Set that armorstand as passenger again of the player?
yep, just don't be surprised if you have to mess with the teleporting stuff to where you are not lagging the server out
its not optimal, but I mean not really much else you can really do
Hmmm I will only need it for staffmembers which means it will only affect a few players, yet it ain't optimal no hmm
it shouldn't be an issue with a few players, but if for some reason 50 or more players decide they are all going to go swim, then might best to implement a system to handle that, it doesn't need to be perfect just good enough
oh in that case you should be fine then
Would the teleport just be in a runnable and then per tick?
I think I'll go for that approach
doesn't need to be per-tick. There is 20 ticks per second, I would probably teleport it every 10 ticks or every 5th
players are not going to be moving super fast in water every second 😛
That is a fair point I'll look into that tomorrow. Thank you 🫡
hmm I don't feel like coding this week
I might just type javadocs for 10 hours and get paid
yeah, that is like me right now with tires
team's a bit scattered atm
I am like at 60 tires now for this week -.-
Thank you a lot for sharing! :).
one guy's travelling, the other is fixing a project that has been stalled for 6 months
and I'm here, just commenting stuff and optimizing some parts
like for some reason, dithering an image makes the performance go boom
takes like 40ms to dither
might be because I'm reading and calculating pixels manually
instead of using some graphics api
is there a reason for dithering?
and also I'm not caching colors 
makes some images look prettier
ah
Btw, I don't want to beat the topic to death, but now that I think of it... how can base64 compress anything? It limits the character space and thus requires more characters per byte than if you had just one byte. It's still one compare instruction per value, no matter if char or byte. Shouldn't it actually make the situation worse? A 16384 sized byte array gets turned into a 21848 length string.
well I don't know what exactly you have for dithering or your images per-say but look into nearest neighbor algo
floyd steinberg
base64 makes most things bigger
it's not a form of compression
that should also work
I don't use it to compress, I use it to convert to debuggable text
Yeah, that's what I was getting at, because I totally took that up the first time I read it
if you really want to, wrap it in a new String(colors) and see what yo uend up with
Didn't even question it
probably faster too
While it isn't inherently compression in itself, it does use less to represent more. In other words I can take 20k characters and base64 it and it won't use 20k characters to represent it
No matter what you do, it's not gonna make anything more efficient than just straight bytes. How's that gonna be faster?
this in itself is compression
its encoding not compression
that is true
but it can be used to compress
since it does do what the definition of compression is
depending how you use it
oft times it will expand rather than compress, but you could utilize it for compression if it happens
I have never seen a base64 grow larger then the thing you are base64'ing unless the data was already binary
For any third-parties lurking btw, dithering is the concept of mixing colors in small amounts to end up with an "average" color patch. If you only have Black & White to work with, you can achieve gray if you put black and white pixels together, in large patches
More data found here - https://en.wikipedia.org/wiki/Floyd–Steinberg_dithering
most base64 encoded ItemStacks are expanded
You can? What would the data have to look like then? If there's just 6 bits per character, isn't that worse than just using straight up bytes, if the character itself takes up a byte anyways?
over just serializing
uhh no?
base256 would achieve a string that's the same size as the input
characters are not guaranteed to take up a single byte
and in most systems and in programming its automatically assumed 2 bytes minimum
by shortening the base you're expanding the amount of characters required to represent the same amount
Yeah, so base64 has to be bigger every time, doesn't it?
not every time
no, not necessarily
so unless your original object is all bytes in the lower 64 bits it will be larger encoded as base64
into a single character
Yeah, sure, but that's a case that's totally negligible. It's of next to no use... xD. On average, it makes everything bigger, where average means 90%
eh
it's like midnight
I got some workshop to attend in 8 hours
why tf are we arguing about base64
idk, I have to get ready for work anyways 😛
Well, we can switch to base96 if you want to
no clue 🙂
You can still read it, but it'll be shorter, lol
well you can use whatever base you want really
Those are printable, tho
some bases are more ideal then others
just work with a ternary base 😛
you should have fun then
base 2 
ternary is base 3
Btw, how's that shortening anything? 49 is still one byte, and it'll make one character. You're not gonna encode the string "49" as an interpreted number, if you meant it as a string value.
lol
49 is a string with 2 letters
or a single base64 letter
we're talking about string representation
if we represent any base in binary, it's the same shit
"49"="NDk="
strings always take up more space
Well, you're always encoding binary data, no matter what
encode the full name of each color
like my comments
so if it's fulyl blank
it'd be transparenttransparenttransparent...
16k times
:)
I see someone went through the pain to hand write this
not sure why but I mean they were dedicated to it lmao
I'd love to just have a pre-setup buffer for each combination. Gotta buy more ram tho.
you would only need to have half the combinations
me omw to make a base anagram algo
so we can just reverse strings and save ram

haha string pool go boom
Why can't i get past the deleted/null config at the beginning?
Code: https://pastebin.com/8mytXHt4
yml config file: https://pastebin.com/EjRvMDqN
error: https://pastebin.com/pZuqwzye
Fair tho, as it takes quite the adventure to find out that the minecraft server already has these base colors from 1.8-present, and that you can generate the shades yourself on the fly, then blow the approximations out into an O(1) lookup array once, where you access using bitshifting, which you then compress to disk using gzip. It's a bit more than you could ask a junior developer to do, haha
that array would get quite heavy
String saves = npcConfig.getServerPlayer("de.server." + uuid + ".player.list");;
this is null
my code just does it like
and probably don't need a double ;
yea bcs of the config
npcConfig is most likely null
16MB, who cares? Nothing in nowadays terms.
nvm I'm blind
uh
16 million colors ??
RGB scope
that's 16mb
So that at least map colors are instant lookup
well
it does't match what you are iterating
you aren't gonna use most of those colors anyways
so just save those 2mb ram
and make a lil lazy cache
:)
it's good practice to be mindful of your resources
and encode everything into base64 after micro-optimizing your color cache
I actually have no idea how many are actually used
yea it is the first null but why can't i get past that null?
for(String uuid : npcConfig.getConfig().getConfigurationSection("de.server").getKeys(false))
de.server should be de.npc.server
and this String saves = npcConfig.getServerPlayer("de.server." + uuid + ".player.list"); should be de.npc.server.
as I said, your config path isn't the same in the code
predicate
You're right about that, it's actually a micro-optimization I should get rid of, so that I can waste 33% more memory on my base64 encoded strings while still saving memory over all.
while true, doubt you are going to run collisions in the short term
unless you are just that unlucky
hmm
sha256 and convert it to a string?
sure it's slow as hell and probably will hinder performance
but you'll have a constant size string
that's hella small
Oh, really? How is it that trivial that it's still going to be unique after that? The 33% is just what I experienced the size blowup to be on average, btw.
33% is actually the amount it will grow on average mathmatically
which you obviously experienced yourself
Hello. Currently, I'm developing a plugin and I've encountered a small issue. Basically, my plugin has a "wanted level" for players and I want to display all wanted players in a GUI, but the problem is that players are cached as needed, so most of them may not be present there. What do you think is the best way to approach this?
is it possible to remove the blue name from an enchanted item
meta.setDisplayName(ChatColor.RESET + "...") doesn't remove the blue
The getCustomSign method returns null
even tho when i do the broadcasts they are the exact same
how do i check if a player has right clicked a liquid
from a PlayerInteractEvent more specifically
when a player right clicks water, it sends an event with type RIGHT_CLICK_AIR
youll have to raycast
is player#getinventory#remove not meant to remove items from the armor slots?
pretty sure armor contents is counted as a separate thing
that's... fun
man there isn't even a good way to access these globally
I have to do it individually
sounds annoyng lol
damnit ok thanks
Ty
anyone know
how do i get dependency & repository urls like this?
for example i want to import bungee as dependency
how do i?
(gradle)
compileOnly 'net.md-5:bungeecord-api:1.15.5-R0.1-SNAPSHOT'
this should be it
dont forget
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } // This lets gradle find the BungeeCord files online
Is it possible to extend from the NMS LivingEntity?
The super method requires an EntityType and I don't know how to create a new one
Trying to do this so I can have an entity agnostic positional/health/movement/AI etc. interface for my NMS models which are visual only and merely get replicated to the client
Then I can have player entities, zombies, skeletons, whatever
And then just send the movement packets
a custom entitytype
prob doesnt work well with the client
as it doesnt know that type
Of course, I'll try to intercept the packet and make sure it's never sent out
how do i get urls like that?
thats 1.15.5
I only want to do this just so that I can have an entity on the server for movement, raycasting, everything you'd need, but then replicate the real entitytype but with associated positional data
So how do I create this?
well than change it to 1.16.5
EntityType builder gave me some registry frozen error
that is because the onEnable is too late
yes
Yea it is but I didn't see any way around that
Is there a pre-registry event to subscribe to?
Isn't the frozen field just a simple boolean?
load on STARTUP, not POSTWORLD
Is that an annotation
how do i get values like this? (it isnt tab completing)
every registry has it if i remember correctly, so you can unfreze it
Ye looked into sourcecode recently
Thank you so much
but with STARTUP prob not needed
Oh it's just a spigot.yml thing?
ye
Thank you brother
ha?
i suppose so
well also override that methodnin your main class
i just searched bungeecord maven
as far as i remember i need to tabcomplete Plugin in bungee api right?
where is it
u reloaded gradle
yea
and you prob dont want the jUnit trst stuff
yeah
What method?
onEnable?
ye
Oh yea ofc
still
isnt this reload
does it throw an error?
how do i check
hm
then
whats wrong?
compileOnly 'net.md-5:bungeecord-api:1.19.2-R0.1-SNAPSHOT'
i think
this url
does not exists
(i know its not url)
that is your dependency
this is ur repository
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } // This lets gradle find the BungeeCord files online
ill try change it to net.md-5:bungeecord-api:1.19-R0.1-SNAPSHOT
instead of 1.19.2 one
yeah its working now
but how do i get access on latest versions?
isnt 1.19.2 better than 1.19's api?
why
ah
Hey,
I have a small problem with casting....
I save a custom object in a map to the yml config and when getting it I of course what to cast it into the original map with the custom object.
But I get this error already in IntelliJ:
Inconvertible types; cannot cast 'java.util.Map<java.lang.String,java.lang.Object>' to 'java.util.LinkedHashMap<java.lang.String,at.kessaft.getdown.utils.JumpMap>'
Has anyone any Idea on how to cast this properly?
for (JumpMap jumpmap : mc.getConfigurationSection("jumpMaps").getValues(false)) {
maps.put(jumpmap)
}
i guess
(maybe)
In case anybody conflicts with Bukkit deserializing objects whenever doing JavaPlugin#getConfig
This is caused because this method calls JavaPlugin#reloadConfig in case of the cache FileConfiguration found null. Reloading it has this behavior of copying defaults. This specific action deserializes ConfigurationSerializables.
In case you are upset because of this, I already provided a robust solution around this. It loads objects from YAML files asynchronously if you are looking for this as well. Besides that, I hope fellow programmers could be a little more respectful towards us who spend time trying to help you...
does this code saves loaded config in data file or does the opposite?ConfigurationProvider.getProvider(YamlConfiguration.class).save(config, data);
?xy
Asking about your attempted solution rather than your actual problem
im trying to save memory loaded config into a file
YamlConfiguration
yeah
is this doing that?
ConfigurationProvider.getProvider(YamlConfiguration.class).save(config, data);
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
ok, seems legit
Read below that
reloading one?
As for saving, for custom configurations, you need to call FileConfiguration#save(File) (which saveConfig() does under the hood for config.yml) to write the data to the disk.
Bottom of the page
???
that is for spigot
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
there is no FileConfiguration in bungee
(last time i "checked")
nvm i think i get it now
Ah you were using Bungee
yeah
Didn't see that
I also have the problem that, when reloading the config file, the map is null when trying to get it using getConfigurationSection(). In the YML File everything is right but in the memory not. It is also working before saving, when I wrote used createSection() to save the map and it is saved into the memory.
Anyone any idea why this happenes after reloading or restarting the server?
File directory = getDataFolder();
String fileName = "config";
Configuration configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(new File(directory, fileName+".yml"));
ConfigurationProvider.getProvider(YamlConfiguration.class).save(configuration, new File(directory, fileName+".yml"));```
whats difference in that two?
doesnt it do same thing?
The first line will provide an instance of Configuration
Which is required in ConfigurationProvider
ah
I have no idea how it works, I have not worked with this in bungee yet
right
I just understood that the second/last depends on the first
Are you using the bultin config or are you loading the file yourself? Also send the code you're using
?paste
this is my Config manager: https://paste.md-5.net/kozaliqosa.cpp
how do i check vanished players in bungee? i was doing it in spigot like this. but there is not MetadataValue in bungee
Before I used FileConfiguration. For testing I just switched to YamlConfiguration
Always when I try to getConfigurationSection() it is null
Where are you calling the reload method
at the moment never. I restart the server
Which means you're never loading the config
onEnable I load it and afterwards I am not relaoding it
I just saw that I removed the laoding code line from the constructor before pasting it 😄
This is my Config in the yml file and when trying to access it, logged it to the console and it looks like this:
Sorry, 😄 Here is all the Code on Github...
https://github.com/KesSaft/GetDown
Bit of a weird question here.
Please keep in mind that this is NOT an anti-xray but is in fact an xray.
I have written a server side xray that when used turns all of the blocks inside of a chunk into barriers except for ores. I use _https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Player.html#sendBlockChange(org.bukkit.Location,org.bukkit.block.data.BlockData)_ to de-render the blocks. I am wondering if there is a way (without caching the blocks, or teleporting the player away and back.) to re-render the effected blocks back to their original material
I can send the class in a pastebin if needed
declaration: package: org.bukkit.entity, interface: Player
?paste
Hey,
I had some issues with my config but just figured out that the config doesn't get loaded correctly.
I call the constructor of my Conf manager in onEnable before anything else but when printing the read config on the constructor to the console, it is empty although it shouldn't be.
The Path to the File is also correct because saving the config works fine.
https://paste.md-5.net/sucikukeyo.java
Anyone any idea why it doesn't get loaded?
I am the dumpest person in the world. First I always resetted the config in the onEnable and not I used YamlConfiguration and not FileConfiguration.#
how do i register command aliases in bungeecord api?
How does ur config class look like
How do I integrate Metrics into a Plugin?
maybe refreshChunk ?
i can’t remember if that resends the blocks
Yea I ended up using that even though it says Deprecated.
I got it.
If you have a plugin on bungee and spigot then you can just make them communicate and let the
bungee plugin do everything you want on the server. But dont clutter your proxy with logic like that. It has one purpose
and it should not have any game related logic in it.
you read their docs and do what they say
bStats collects data for plugin authors. Get started now!
So possible but not advisable
Commands on bungee should only affect bungee. For example /server /lobby and maybe /mute because its
ok to manage packets on a proxy level.
public static <T> T writeAll(Collection<T> coll, Sink<? super T> snk) {
T last = null;
for (T t : coll) {
last = t;
snk.flush(last);
}
return last;
}
public static void main(String[] args) {
Sink<Object> s = new Sink<>();
Collection<String> cs = Arrays.asList("A", "B");
String str = writeAll(cs, s); //
}
Can someone explain why I can pass s to writeAll?
First of all: Arrays.asList creates an Immutable list. So this wont work on runtime.
What's next..
This Java tutorial describes generics, full screen mode API, and Java certification related resources
alright IJ, I'll rename myself to "finale"
no
because "i am getting error" is not very useful to us
Well this works in theory
public static <T> T writeAll(Collection<T> coll, Sink<? super T> snk) {
T last = null;
for (T t : coll) {
last = t;
snk.flush(last);
}
return last;
}
public static void main(String[] args) {
Sink<Object> s = new Sink<>();
Collection<String> cs = Arrays.asList("A", "B");
String str = writeAll(cs, s); //
}
As in: It will compile.
But it will lead to problems on runtime
eventually
i am getting error unable to intercept a read client packet and another some messages also
No. The fly command should be on your servers. Not on the proxy.
On your server you can store information on players in a DB so its
accessible on all servers. For example if your fly command should
transfer to other servers. But keep your bungee away from that.
It should be light weight and not worry about if and where players
can fly.
If you want to grant fly for a player on another server then you can
use the proxy as a relay to message other servers. I personally prefer
Redis for this but bungee can do that as well. The proxy doesnt understand
what is being relayed. It just receives a message from Server A and sends
it to Server B.
pls help me with this
We need ore information for that
can i send u ss in dm ?
Nope
so how i can
?img
Not verified? Upload screenshots here: https://prnt.sc/
not able to send
no one can help you with no information
is this with your own plugin?
Stack trace from your console pls
no
One question guys
in my config.yml I have different types of rewards, money, claim blocks or playerpoints
how could I make so you're only required to have the necessary plugin installed
for exampel, if you set it to money, you need to have Vault installed (but no need for griefprevention), if you have it for griefprevention no need for vault
idk if I explaine dcorrectly
By adding conditional checks first starting with the plugin second checking config for boolean of they want it on.
so I remove the depends on in the polugin.yml and check it on enable?
Plugin hooks. You just need to be careful which classes are loaded by checking
which plugins are enabled and not creating instances of your plugin hooks if they are not.
Correct and if the plugin is not there or the config says not to use it. Then your check would essentially skip the code for those things
ok tysm I will give it a try
what are plugin hooks?
Using methods that would cause something to load from the plugin you depend on. You dont want to try loading anything from a plugin that isnt there otherwise null pointers everywhere
Easiest way to implement the check is from the onenable check for those things and then set a global boolean.
Can someone tell me an idea to create a plugin?
thanks, I will try to do it!
Create a new innovative combat system for the latest version which is fast paced and
can satisfy 1.8 kids
Upgradable backpacks
Fruit trees with textured heads as fruits
Bot net
Make a plugin that generates an upside down world
I tried "AQUA" and it did not work
Just any string and it will return the used color of it
I'am actually stealing this idea for my plugin now lmao
?jd-s chatcolor
Seems i failed at the command to give specific link
I made a mistake in my code forget about it
Wrong import?
I first asigned the ChatColor via ChatColor.of(String value) and a few lines after I asigned the same color cause i was working on documentation for what values u can use)
make sence that color always stayed the same
Then store the fly state in a DB. But the server connects to the DB. Not the proxy.
It's not really Minecraft plugin specific
Not sure if you should tinker with databases then. Here are old barebones examples from Spigot:
https://www.spigotmc.org/wiki/connecting-to-databases-mysql/
https://www.spigotmc.org/wiki/mysql-database-integration-with-your-plugin/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Did you register the listener? Add some debug messages and see what's failing
This cancells all damage on the server if pvp is disabled.
- Is the listener registered
- Is
plugin.gameWorldnot null? - You should def check for instanceof Player
curious how would someone get the players have joined before
Before what?
does spigot have something for that?
You want to check if they been on the server previously?
declaration: package: org.bukkit, interface: OfflinePlayer
You mean get all players that ever joined the server?
yes
declaration: package: org.bukkit, interface: Server
@EventHandler
public void onShulkerCaseInventoryClick(InventoryClickEvent event) {
Player player = (Player) event.getWhoClicked();
if (event.getCurrentItem() == null) return;
if (!(event.getClickedInventory().getHolder() instanceof CaseInventoryHolder)) return;
event.setCancelled(true);
}
I have this event, how can i get TileState to get PDC from the block. I heard that is somehow possible?
You can get a block by using its location
for (String key : config.getConfig().getConfigurationSection("stops").getKeys(false)) {
sender.sendMessage(key);
String worldb = config.getConfig().getString("stops." + key + ".Location.world");
if (worldb.equalsIgnoreCase(world)) {
if(compareLocation(key, sender)){
matches = true;
}
}
}``` This errors out saying worldb value is null. Anyone that can tell me what is wrong here? ```stops:
bus:
ReportedBy: Ray1974
Location:
==: org.bukkit.Location
world: world
x: 49.64787901236507
y: 65.0
z: -159.30000001192093
pitch: 49.34998
yaw: 58.949966``` This is my config. What am I doing wrong here?
show me how you are doing it with a screenshot or something
You Cant create a static outer class
well it's produces NullPointerException, any other solutions?
well u dont need to make the class static
make the methods static
only inner classer can be static
well thats more of a general java concept but aight
but you wont need an inner class for your application
u want to do stuff like this with util methods
great
Help my code is abusing me
That’s a static nested class, inner classes are non static nested classes
tbh i was just showing the difference between outer and inner. didnt rlly think about the static
but i did not know that fact
Yeah, sorry I was just picking on your words, but apart from that good explanation
thats fine. thanks for the correction.
Why Im getting null?
String path = "jobs.miller.cleaning";
RoleJob.console.sendMessage("test: " + RoleJob.inst.getConfig().get(path + ".triggers"));
YML:
jobs:
miller:
cleaning:
lastTriggerID: 1
triggers:
'0':
==: org.bukkit.Location
world: world
x: 7.0
y: 72.0
z: -9.0
pitch: 0.0
yaw: 0.0
not enough information. my guess is inst is null
?paste
CleaningTrigger.java:34
If you look in yml there is something under that path so, idk why Im getting null. That dosent make sanse.
if (RoleJob.inst.getConfig().getConfigurationSection(path + ".triggers").getKeys(false).isEmpty()) return locs;
exact code on that line
@trim lake sk?
yep
I even try this in main class and still getting null:
@Override
public void onEnable() {
inst = this;
this.saveDefaultConfig();
console = Bukkit.getServer().getConsoleSender();
console.sendMessage("jobs: " + this.getConfig().get("jobs"));
either the path you are passing is not what you are expecting or your config does not contain what you think it does
it contains I can see that in yml 😄
How you can send triggers?
you are looking at teh config as saved on your server?
what is the name of that yml?
?paste your full yml
config.yml https://paste.md-5.net/agewiculey.bash
the yaml from your server, not from your project
that is from server from plugin folder
try
RojeJob plugin = Bukkit.getServer().getPluginManager().getPlugin("RoleJob")
is not, is in yml file
maybe paste the error
console.sendMessage("jobs: " + inst.getConfig().isConfigurationSection("jobs")); returns false
he already has
oh sorry
"org.bukkit.configuration.file.FileConfiguration.getConfigurationSection(String)" is null
your yaml is valid
is that file actually called config.yml and is in the plugins folder?
yup
@Override
public void onEnable() {
inst = this;
this.saveDefaultConfig();
console = Bukkit.getServer().getConsoleSender();
console.sendMessage("jobs: " + inst.getConfig().isConfigurationSection("jobs"));
}```
show us the files, like how they are in the folder
oh 💀
the specific issue is that the method getLocations in the CleaningTrigger class is trying to invoke the method getKeys(boolean) on a ConfigurationSection object that is null
your error makes no sense. It doesn;t match what you have shown us
hmmm, I remove the folder and server didn't generate that folder again
impossible
idk how but there is no that folder anymore 😄
is your servers RoleJob.jar actually updated or are you running an old jar
Did you reload winscp
nwm... Im stupid.... I have bad plugin name in plugin.yml ... Oh god.. How this happend
I didnt expect that I forget to change that 😄 sorry
ChatColor[] colors = {ChatColor.RED, ChatColor.GOLD, ChatColor.YELLOW, ChatColor.GREEN, ChatColor.BLUE, ChatColor.LIGHT_PURPLE};
final int[] tick = {text.length() - 1};
final int[] colorIndex = {0};
Bukkit.getScheduler().runTaskTimer(AnimateText.getPlugin(AnimateText.class), () -> {
tick[0]--;
if (tick[0] < 0) {
tick[0] = text.length() - 1;
colorIndex[0] = (colorIndex[0] + 1) % colors.length;
}
StringBuilder newName = new StringBuilder();
for (int i = 0; i < text.length(); i++) {
if (i == tick[0]) {
newName.append(colors[colorIndex[0]]);
}
newName.append(text.charAt(i));
}
armorStand.setCustomName(newName.toString());
}, 0, 1);
}```
This method works fine but I want it to save the previous color and sets the new one
this method btw changes the color of text from left to right
save old color?
yes
what do you mean
like it changes color every tick and text variable its white
when it changes colors it becomes white then changes the colot
so you mean it's alwasy startign from white?
yes
if I remember ChatColor has a method to get teh last color
nooo
look the text variable is white
wait
I will show you
Sorry my obs is broken
I still have no idea what you are having an issue with
how do i make custom commands?
is there a plugin for it?
as you can it becomes white then change color
something about white, but I see no white
what is white? I see blue/purple, changing to orange then yellow
its white but it shows as blue becuase of screen glare
what is white?
Ok but whats wrong with it being white?
blue is white?
&f
I want it to keep the previous color and sets the new one
I want it to keep the previous color and sets the new one
learn Java then SpigotAPI
Honestly, you should create a concrete class implementation for this.
When your lambda looks like this then its time to create a class.
Wait what is this scuffed logic
Honestly this method should be a class with at least 4 or 5 methods
FEllas, anyone know how I could change the block a item places?
PlayerInteractEvent if its not a Block and BlockPlaceEvent if its a Block
about that, it is a block, but when I replace the block with a spawner, the spawners entity that is supposed to show up doesn't update till I relog
What?
What version are you on?
1.19.3
my reaction exactly
When I SET the block through a command, it works just fine, but when I go through the blockbreak event, even with a delay, the spawner doesnt update
I am, I even do it with a 20 tick delay and nothing
Does anyone know how PDC works? From what I know it should use in-memory data, so when the holder is loaded it's data are put in memory and when the holder get unloaded it's data are saved.
apparently just gotta live with placing the spawner 2 ticks with delay, flickers but it'll work for now
yes
just a map
and then gets saved/loaded at appropriate times like unload/load/command /entity data thingy
k ty
@EventHandler
public void onPlace(BlockPlaceEvent event) {
Block placed = event.getBlockPlaced();
Bukkit.getScheduler().runTask(this, () -> {
placed.setType(Material.SPAWNER);
CreatureSpawner spawner = (CreatureSpawner) placed.getState();
spawner.setSpawnedType(EntityType.BEE);
spawner.update(true);
});
}
guess spawners are just broken if u change the block type too quickly. This is what im doing though, just set the block to spawner as quick as I can, then set the entity inside 2 ticks later, and it works. THank ya mate!
Write. A. Concrete. Class. Implementation.
And stop sending us this mess
can you help or no
Sure. Step one:
- Write a class which implements Runnable
lol, yeah, that's uh... a little bit awkward
At the very least you would use Atomic objects rather than abusing (I guess it's abusing?) arrays
But I'd better opt for a proper class
public class ArmorstandAnimationTask implements Runnable {
private final ArmorStand armorStand;
private int ticksAlive = 0;
public ArmorstandAnimationTask(ArmorStand armorStand) {
this.armorStand = armorStand;
}
@Override
public void run() {
ticksAlive++;
nextAnimationStep(this.armorStand);
}
private void nextAnimationStep(ArmorStand armorStand) {
}
}
Here is a template you can get started with.
Hello guys, please, I’m asking you, make me a very easy plugin, please
Pleasseeeeee
Guys
?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/
is it tho?
this ok!?!?!?
like idk if there's a definite answer
but using volatile (atomic) in these situations feels unnecessary
man dropped his access modifiers
yea
Yeah it's a misuse of arrays imo
dont abuse arrays, get abused by them instead
hmm, I mean I remember reading bout it, but cant remember the convention
nobody can complain that I don't write proper javadocs lol https://hub.jeff-media.com/javadocs/morepersistentdatatypes/index.html
package index
tldr
tldr: Javadocs exist
How can I get the total harvested crop count?
A player
loop over all things you consider crops, then add it up
over time? for a single plant?
Statistic blockBreaks = Statistic.MINE_BLOCK;
Player player = null;
Material[] crops = new Material[] { Material.WHEAT, Material.POTATOES};
int cropsBroken = 0;
for (Material crop : crops) {
cropsBroken += player.getStatistic(blockBreaks, crop);
}
sth like this
Ah alright. Thanks.
Does MINE_BLOCK include harvesting?
as often the block is not actually broken
could also use Tags to automatically get all crop types
private static final Set<Material> CROPS = new HashSet<>();
static {
for(Material material : Material.values()) {
if(Tag.CROPS.isTagged(material)) {
CROPS.add(material);
}
}
}
public static int getCropsHarvested(Player player) {
int harvested = 0;
for(Material crop : CROPS) {
harvested += player.getStatistic(Statistic.MINE_BLOCK, crop);
}
return harvested;
}
it just checks whether a block is broken I guess
do you mean harvesting stuff like berry bushes?
muh performance
that itself loops over all materials everytime
does it?
oh wait no, it doesn't
I thought it was a baked enum
but it streams / maps every tagged vanilla material to its bukkit material everytime and creates a new set out of that
Can I become the java garbage collector
so best would be this:
private static final Set<Material> CROPS = Tag.CROPS.getValues();
public static int getCropsHarvested(Player player) {
int harvested = 0;
for(Material crop : CROPS) {
harvested += player.getStatistic(Statistic.MINE_BLOCK, crop);
}
return harvested;
}
yep
I love tags
yeah unfortunately they often are one version behind
what does material.isBlock() return if its air
As an aside, Tags are Iterable so you can do for (Material crop : Tag.CROPS)
Also, not sure what you meant by them being one version behind?
sometimes, new stuff gets added, and it's only tagged in the version released after that
We're missing a lot of tags atm. Like... a lot. We don't even have biome tags
That's why I have this PR https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/pull-requests/733/overview
I need to serialize an itemstack.
The simplier approach would be serializing it as a map, converting it to a string and then encoding it to base64.
I don't know if this approach is reliable when using different spigot versions so I thought of saving it as nbt (by using nms) and converting it to a base 64 string, what do you suggest me?
ItemStacks are already ConfigurationSerializable, why not just use that?
you can get it as Map<String,Object> or as byte[]
Alternatively, depending on where you're serializing it, you can use the output and input streams
Spigots ItemStack serialisation is rubbish. It breaks every now and then. Try serializing a head with textures for example.
that always worked fine for me
items serialized in older versions will deserialize fine in newer versions, but not the other way around
I had so many problems with Map<String, Object> -> Gson -> String -> Base64 encode
you can use the output and input streams

Why do people not know about these my goodness
I already said to use byte[]
You mean the BukkitObject streams?
Yeah but they need CraftBukkit on the classpath
No they don't?
Hi! is there anyone good with packets/nms who knows how to register a new biome, willing to help me with an error i'm getting?
Those are Bukkit API classes
Since when? Let me check that.
1.16.5 is the oldest craftbukkit version i got open
If you intend on registering a new biome, you're better off doing it with data packs. It's the officially supported way to do it in vanilla
Well i remember them being only accessible with CraftBukkit on the classpath for a long time. Never knew they where exposed
i'm doing it to change the fog color around the player
SO.... is it safe to assume that things gonna work even for items with PDC etc?
Hey there, just a quick question.
I don't know if this is the right place, if not, I'm sorry.
I have a few custom items in my 1.19.3 plugin and wanted to cancel the event when a player tries to remove enchantments with a grindstone, I found the org.bukkit.event.inventory.PrepareGrindstoneEvent but the server seems to give me the warning:
[16:44:34 WARN]: [Project] "Project v1.0.0" has registered a listener for com.destroystokyo.paper.event.inventory.PrepareGrindstoneEvent on method "public final void dev.dasischbims.project.listener.GrindstoneListener.onPrepareGrindstone(org.bukkit.event.inventory.PrepareGrindstoneEvent)", but the event is Deprecated. "Server performance will be affected"; please notify the authors []..
However when I look into the Javadocs it clearly doesn't say deprecated anywhere on the page. Is this intended or is this an issue with paper?
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
Thanks, I'll go there instead
wdym
I remember that spigot serialization system isn't the best system it easily breaks, most people says that it is unreliable.

