#help-development
1 messages · Page 1062 of 1
so I'm not doing that
the whole point of the plugin is to make the entire thing completely plug and play for custom models
you put it in, you don't even configure it and it immediately just works
xD
going to hope some staff sees this in a bit otherwise I'll mail them I guess
also did you see the ping earlier in #general
So this plugin is going to upload to your server?
yes
maybe you're not aware but there's already plenty of plugins autohosting resource packs
auto hosting remote?
yeah
Very scary
and if it's a problem I'll turn it off, whatever
What plugins do that
hm I think itemsadder is doing it or at least was doing it
there were some others, I have a master list somewhere
Seems like it would be very hard to stop illegal stuff being uploaded
that's what safe harbor provisions are for
Gotta get a hold of discords “mostly accurate robot hamsters”
pretty sure you'd not quallify for safe harbor
because?
you would have to provide reporting systems and methods of takedowns.
not a problem ,can be done by email
Well good luck. Its a risk I'd not take
that's fine, I'm not asking you to take it for me
How do you get a minecraft UUID from a texture url like this? http://textures.minecraft.net/texture/143c79cd9c2d3187ea03245fe2128e0d2abbe7945214bc5834dfa403c134e27
yeah I went and checked in european law, article 12 of directive 2000/21/31/ec describes exactly what this does and is very clearly defined
Article 12
"Mere conduit"
- Where an information society service is provided that consists of the transmission in a communication network of information provided by a recipient of the service, or the provision of access to a communication network, Member States shall ensure that the service provider is not liable for the information transmitted, on condition that the provider:
(a) does not initiate the transmission;
(b) does not select the receiver of the transmission; and
(c) does not select or modify the information contained in the transmission.
as the host, I don't initiate it, I definitely don't select who it is for and I certainly don't modify it in any way
and also article 13
but I don't want to spam chat
basically as long as I allow takedowns and don't modify the data I'm good
both of which are more than fine by me
anyone able to answer my q
I think I'll also add a check such that any individual file in the rsp can't be larger than a certain size on top of the already planned limit of a max size for the zipped file so that basically anything larger than pixel art will be too large for it
What about a zip bomb
presumably that would get caught when checking the contents
How do you get a minecraft UUID from a texture url like this? => specifically im trying to give textures to heads http://textures.minecraft.net/texture/143c79cd9c2d3187ea03245fe2128e0d2abbe7945214bc5834dfa403c134e27
Please let me know if anyone could help! (i dont want to interupt this haha)
ah man my own rsp would definitely be too large lol
Is your limit smaller than Minecraft’s limit
what's mc's limit?
I don't have a set number yet I was looking up what a good size might be
I think it’s 250mb now
oh I was going much lower than that for sure
I have a png of a map I use in an adventure I made that is 800kb and I think it's the largest one
maybe 1MB would be the limit I would go with
but a 1080p jpeg would easily fit in there
png makes these files really big
Now I wonder
Can I inject something very early in the netty pipeline to allow serving resource packs on the same port as the server
it would be real neat if servers could serve their own rsps
without going through hoops
I mean opening an extra port isn’t too bad
But I’ll have to mess with netty to see what I can do
it disqualifies a solid 70% of servers
if not more
I think I'll do a behind the scenes file structure check and not bother with a size check beyond the total rsp size
I don't think this would be an interesting system to try to attack anyway, between keying ips to a single rsp, the fact they get autoremoved if the server doesn't phone in and it generally being very obscure I don't think people will bother
it's not even about being with a host that allows it or not, it's about the inconvenience of having to set it up
Does anyone know how to fix SCOREBOARD'S from not working? I have a bunch of code for scoreboards but it stopped functioning as fixed and added more things!!
Quick question
Does chat color formatting reset when I change colors?
I think my minimsg converter is fucked
I think so
easy fix
Wdym by formatting?
just &r when changing colors
does text go from bold -> not bold if I change the color of it
I think so
Ah yes I believe so
It does in fact do that.
yes, but it isn't going to look pretty (on spigot)
I can’t imagine it’ll be pretty anywhere
I mean
why is your whole plugin in the start game command
i cant see whats wrong right away
idk ;-; im new to plugins stuff
Is there some proper way to get the public ip of the server or do I need to send a request to some external site to do so
well this is intersting, every time I zip my resource pack the sha1 changes
either I don't know as much about sha1 as I thought or I don't know enough about zipping
or I have some weird bug here
eh, you could get the virtual host from a player, but like, that isn't gonna play nicely with proxies lol
Alright then, web request it is
prob file dates?
like timestamps n shi
yep was just checking that
that is it
that uh
complicates things
tomorrow's software, today
yeah this definitely modifies it such that every single file is set to last modified when zipped with the current method
I might have to just extract the zip, compare each individual file to the file that is to be zipped and check if the contents are the same
what a bummer
just remove the metadata from the zip
it's the metadata of the contents of the zip not the zip, not sure if that covers it
it does
im begging for help 
Sorry i just copied and pasted it from earlier haha
what packet makes a villager shake their head
I havent used scoreboards in ages but don't you need to assign a team
also that code should be in a manager class
not all in the command
found it, it's entity metadata
isn't it ClientboundEntityEventPacket?
no
yeah i believe so
read every byte and compare
byte me
I mean this has to work
java thinks it works
the OS does not
hmmmm
this runs after copy so it shouldn't be getting modified further
Care to share?
Hello, one of my plugins is vanished, someone can help me?
this was the plugin
https://www.spigotmc.org/resources/myportalscommands.109345/
lol
innovating in method names as well
just be careful to not intruduce zip vulnerabilities. Shouldn't be an issue if its not for anything public
all public all the time babyy
EnderDragon enderDragon = player.getWorld().getEnderDragonBattle().getEnderDragon();
CraftEnderDragon craftEnderDragon = (CraftEnderDragon) enderDragon;
EnderDragonPhaseManager enderDragonPhaseManager = craftEnderDragon.getHandle().getPhaseManager();
EnderDragonPhase<? extends DragonChargePlayerPhase> chargePhase = new DragonChargePlayerPhase(craftEnderDragon.getHandle()).getPhase();
DragonChargePlayerPhase chargeInstance = (DragonChargePlayerPhase) chargePhase.createInstance(craftEnderDragon.getHandle());
chargeInstance.begin();
chargeInstance.setTarget(new Vec3(swatted.getLocation().getX(), swatted.getLocation().getY(), swatted.getLocation().getZ()));
enderDragonPhaseManager.setPhase(chargeInstance.getPhase());
enderDragonPhaseManager.setPhase(chargePhase);
does anyone know why this code isnt working? my goal is to force the ender dragon to charge at a player, but the console keeps saying "Aborting charge player as no target was set." like a second after the code runs. ive tried googling everywhere but i cant find anything
i feel like im so close to solving it but i just cant figure it out
this is literally re-zipping several resource packs so i'm going to assume they're about as safe as the $100 bill I left outside 3 weeks ago
lol
leaving a 100$ outside may be safer than you think
well the vulernability is only in code really. IE zip slip for example where if the program is going to be made public and you just assume the paths of the zip archive it would be easy for a malicious zip to fool the program on that by using relative paths
I don't really see a reason to care about that, it's a plugin that aggregates resource packs and it's on admins to make sure they don't have stuff running maliciously on their server in the first place, it only scans the directory of their mc plugins
for example, a zip can have the path of /../program this would cause the file to be extracted in the next directory higher lol
if that's compromised then SOL
well up to you really, its your stuff you know it better then me, was just only reminding of such things was all 😛
That's unhealthy
Can we prevent that
well now
that's interesting
sha1 does not care for the metadata of the file being analyzed which... yeah that makes sense considering how I am ingesting it
good to know though
seems like a fun attack vector
so you can have sha1 signed files and mess with the metadata to be a real stinker
meh I'm only using it as a basic checksum
what is this discussion about tho
it's about how I've hacked into your computer and am looking at your homework folder right now
the signature for zips for resource packs. They had issues of their pack giving different sigs I am guessing because the metadata of the files in said zip changed, IE the timestamps on the files
tf
so even though the files are the same, because the timestamps are different, the zip is different. The only thing you can do in this case is either set all the timestamps to the same thing all the time, or remove the metadata before putting the file in the zip archive
except it doesn't matter for the actual zipped file
right which makes sense
so you may have a timestamp saying you modified it 3 seconds ago and it will still report the same sha1 as 3 years ago, but if any of the contents say the were modified with a different timestamp then the sha1 will report a different result even if the contents are identical
yeah not saying it doesn't make sense
just catching them up
ah right ok
U+25B6
that's clearly U+25B6 you can tell at a glance
oh its a different one
yeah
bro knew
you don't?
i know a good ton of unicodes but not that much lmao
that's like 3 pixels
I just have a list for symbols, this used to be a normal thing to have on hand?
U+2620
idk, i just use bitmaps anyway ¯\_(ツ)_/¯
I personally only have a list of jvm args for mc clients
I keep a list of everything everyone knows
conveniently on the cloud
and use google to look it up
it's very efficient
a unicode is a unicode
i keep a list of everyone who has ever lived and their knowledge
U+23F5
Ah ok so one unit of code gotcha
I personally keep a hashmap of objects
👍
what
he's objectifying people
skull
U+2620 you philistine
while I have a list, there is a site I use if I don't have it in my list.
https://www.compart.com/en/unicode/U+23F5
U+23F5 is the unicode hex value of the character Black Medium Right-Pointing Triangle. Char U+23F5, Encodings, HTML Entitys:⏵,⏵, UTF-8 (hex), UTF-16 (hex), UTF-32 (hex)
That's hot
MutableMap<Any, Any>
Any is the ugliest type to ever be invented
I hope whoever made up "Any" burns in hell
how do u know what it's called
did you know there's a dynamic type in kotlin
Generics?
isn't there on in java as well?
nope
var t = "test"
type changing shit
I just looked for black triangle facing right its not an arrow in terms of unicode and arrows are different looking characters
that just makes u fuck up ur code
that's why it only exists when compiling to js
bc only js allows you to fuck up that bad
I bet in the jvm at some point it's just an object
Lmao
doesn't exist in jvm, android, native and common, only in js
(comp targets)
js doesnt even follow its own rules, u can literally forget a ; and js is like "i got your back" and lets it pass
Yk why the any type makes no sense? You can have a list of objects, that makes sense, but how can you have a list of anies? What the fuck does that mean?
makes me wonder if the ; is just to make our life worse
embrace no semicolons, embrace kotlin
yeah it's a debate whether you should put semicolons, should not put semicolons or should put them inconsitently in js
Does any include null kek
no
I love my semicolons, fuck kotlin
I know lol
Any?
yea
that's why I, a centrist, put semicolons exactly 50% of the time
sometimes i put a semicolon cuz of muscle memory, but most of the time i dont
its for convenience, there is many languages that don't require explicit terminations
that's why you do <T : Any> when you want a non nil type
Understandable
well idk how you could map with a null value / key anyway kek
u cant make a one liner program in kotlin
you just need to see things through my enlightened centrist eyes
you can
I should make a gradle plugin that makes semicolons optional in java
u cant
semicolons still exist
you just don't end lines with them
Yeah, I sometimes put them by accident, then IJ complains
so js style
maybe not in kotlin, but you could make one in say PHP and because its a signle line you don't need to terminate
- with kotlin most operations are beautiful functional one liners
you know you did something horribly wrong when ij complains
it just says it's redundant
Nah I just made it complain about everything, like an old man
Sometimes intelliJ yells at me for no reason
everyone acts like js is the worst until they remember python syntax
Configuring IJ was funny
ew
python
I got the ktlint plugin and half my IDE turns yellow if I leave a trailing comma
python is 60% english
like this
Isn't python like business standard language right now?
I only hate where its used and for what. I don't believe JS should be used for anything other then frontend UI
I'm fine with using it with nodejs tbh
skill issue clearly
it's harmless
I remember I was working on a really long class and I accidentally removed a bracket from the class definition and everything slowly grew red from top to bottom
It was beautiful
its not harmless
I wouldn't base anything serious and longterm on it but it's fine
it can be a bridge to my ai support just fine
javascript introduces vulnerabilities on a back end system if you are not aware of it
based
javascript isn't going to report issues either and whether or not you can spot issues in javascript code is dependent on the linter you use
I use java in frontend ui
also javascript doesn't log all errors or issues
yea raydan you're also not normal at all
or if at all
i love go, rust and kotlin for backend
Wdym
they're great
I'm the average person
you are not
Actually, I wanna try kotlin in frontend
I used javafx to make a notepade application.. That was great! 👍
yea do that with htmx
i have a template actually
I'd be fine with using rust if I didn't have to learn it first
alright cool well that was way too long to get the sha1 working, fantastic
fun calculateHash(path: Path): String {
return path.readBytes().inputStream().use {
MessageDigest.getInstance("SHA-1").digest(it.readBytes())
}.joinToString("") { "%02x".format(it) }
}
``` hehehe
not calculating it bud
well damn, now it's consistent between reloads but not between restarts, what is even going on
probs skill issue idk
ok now I changed nothing and I think I fixed it
perfect
love that for me
no wait I broke it again
so im slowly teaching myself how to code with some help with a friend. I asked him if it was possible to create a plugin i had in mind and he gave me a list of things to do to try to make it one of them being "Define a variable for the percent chance" Ive looked it up online and have found many diffrent things and cant seem to choose the right one. could someone give me a hand?
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
This should help
ty
this is a common thing you will run into, the thing is there isn't necessarily a right one
the right one is which ever works for you the way you need it to
more requirements you impose it to meet the smaller that list will be to choose from lol
ok thanks! I was advised to learn some of the basic stuff before trying to do plugins. ima try that first and get back to it
well it is always recommended to learn the basics of course
without the basics you won't understand or be able to do the advanced stuff as they are extensions of the basics
i see that now. thank you
I’m a tutor
Do you charge?
I can't believe he's drunk again
?
dw about it, people who know know
Yes
somewhat weird question, I'm using a nodejs backend to manage resource packs, if I get a request from a client to download the resource pack how can I send that to the player? I should be able to query the nodejs without having to create a permanent link somewhere for download? Or do I need to do that? I've never really messed with this
I can create a permanent link but I'd rather avoid it if I can
can node create a similie of a link that can be used?
why am I unable to understand this
understand what
what do you mean send it without link?
I got nodejs to read requests / uploads / pings from a plugin, I want to know if I can also use it to send dl "links" to the rsp to clients
I feel like it should be possible
I mean I am no nodejs expert but it sounds lile something achievable
I do have a website and I can host it there but eh I wanted to avoid that if possible
you want to upload resource pack?
tf does "links" mean
the ones that let clients download a rsp
but why did you surround it with ""
because it's a nodejs backend and not a website
I don't remember if the client expects there to be a zip extension in the url, if it doesn't then you only need an identifier in the URL so you know what needs to be sent to the requesting connection
isn't there a website where you can host resource pack? idk
or I don't understand something with links
Well if you don't have a website (some http thingy) I doubt you can send a rsp
they don't have a website in the traditional sense, but one isn't needed here
IE, they don't need a webserver
they just have a mechanism to accept the request
This is absolute gibberish to me
yeah I have a sha1 of the server and the plugin can use an identifier to get a pseudolink, just wondering how I would do that
maybe something like this could work?
can I just dump a url using the same format I am doing my pings to nodejs and try to hack together a response that sends the zipped file?
you need to listen for connections on port 80 of course, and then you would use the headers that are sent to know what url they are attempting to access
you will need to look at the http standard in terms of sending responses or files
...or just host a simple http server?
its not needed
buddy it's fine if you don't get it, you don't have to participate
yeah my brain is absolutely deep frying
think I can feed it a request like this ? "http://localhost:3000/rsp" (obviously not using localhost but the nodejs address)
sure, and anything accessing rsp, gets sent the resource pack whether they want it or not
not your fault if some bot decided to browse it >>
oh wait that's a good point
I lost sight of the fact this needs to have an identifier
now how do I fit that in
well you would add it at the end of rsp
and then your backend decides to do something based on the identifier presented
i'd need one per server, this is a public service
not sure I can dynamically register that
probably can though right
or just listen to something more generic
I am not sure why you can't do it dynamically?
yeah I've just never done it, I figure it might be possible
also note you don't actually need the files stored in a directory either, you can store the files in a DB as well and fetch them via query to give to the response
I'm doing stuff like app.post('/still_alive', ... right now so I guess I might need a different kind of listener
only adding this, because typically the easiest route is to store files in a directory that resembles the url
I was considering DBs to be real but I DQ'ed them because they make EU compliance harder
or naming the files in question the same as the identifier 😛
not sure how it would make EU compliance harder?
the request you will be listening for is a GET request
it won't be a post request
you would store the files as the same name as their identifier. It is up to the person who sends a take down accurately describe the file in question
its not like they can be vague about it, or tell you how its being downloaded
it just makes this more annoying to deal with for relatively little gain right now
I'll do it if I'm suddenly mass serving a large audience but right now I just want to worry about getting it off the ground
anyways, the get request is what you need to parse, as it contains the url
you can validate on the first part, being rsp so you know they want a resource pack
and then you can look after rsp for the identifier
so you know which file to send back
or data I should say since you can just create the file on the fly as long as you have the bytes in question 😛
as long as you have whiskey
app.get('/rsp_:sha1', (req, res) => {
const sha1 = req.params.sha1;
console.log(`Received request for sha1: ${sha1}`);
});
something like that right
eh wait that doesn't sound right
is that vue.js
i don't quite understand what you mean "send to the client"
you just send them a file and, ideally, a hash too
the client needs to be able to download the pack itself, the server cannot just send the actual pack over
just a url
you could send headers instead
what
I wish mc implemented some pack sharing protocol
it is a get request, the payload sent back is the data of the file IE the file
yea
but, the link in question doesn't need to be a permanent link or a static link that needs to be defined
backend wise
you are implying the server can't send the actual pack, which is what is done with the url portion. The MC server is the one that provides the hash that is suppose to match the file that is downloaded from said URL
i said that the server can only send a url to the pack
with "the actual pack" i meant the file
ah, that clarifies stuff but that isn't what was being questioned though by magma
yea i didn't quite understand his question
they obviously don't want to setup a standard webserver to provide the file
they already have a backend mechanism that can listen for requests
right, and I was explaining that the request that would be sent to the backend is a get request with the url
and they could use said url to know which file to send back
that is how pack servers work
and the code necessary is what they seemed to come up with, the parameter they need is the identifier in this case the hash works just fine
thus no static linking in the code is necessary
now, they can just drop the files in a central place and their backend should be able to serve it up based on the get request 🙂
you send the client a resource pack request with url, uuid, hash, prompt and whether it is required or not. the client then just sends a get request to that url with some headers related to the actual game (user, uuid, version etc, very useful for stuff like multi-version packs or something), which should just return a zip
my server builds my resource pack for me, handles the zip file and the pack server by itself
no need to do anything :)
exactly 
yeah and soon that will be the case for anyone running my software too
well at least you understand now rad
ig
Raydan is still trying to process and is frozen
they might need to just kill the process for now it seems XD
ok I really need to go to the gym now or I won't go at all
can u change the block limit in negative y
no, it's hardcoded in the client
mojank
im convinced mojang hates us
ask mojang
what about positive y
ah
what
Hello, I have a plugin that is supposed to mark an area and spawn mobs in there. But somehow it doesn't work anymore since I switched to paper. You can find the code for the most important classes here.
Code:
BlockListener: https://pastebin.com/BLFtXnED
Marking Manager: https://pastebin.com/cU3HChGg
Cut from SetupCommand: https://pastebin.com/hNgrL9w5
?whereami
- Never described the issue
?notwork
TF was the command
can you elaborate on this?
do you just want to change the max and min height limit?
yea
arent datapacks just commands
no
they also contain data files
that is functions
ah
^
Yes, unfortunately it no longer works since then as soon as I enter my /setup setdungeon, I mark a block with a left click but that no longer works and the dbug says the mode is activated when I execute the command but then when I click on something it is no longer active
can u do tiwihtout a datapack
no
dam
but it is certainly not hardcoded on the client
(as kinda obvious by the fact that the nether and end dimension have different min and max heights than the overworld)
oh shit I completely forgot about that, I may have been thinking of older versions
Maybe we are all just too old
good old 1.8 didn't have this data driven shit
yep
honestly I see in bukkit stuff, it doesn't have an api that I can see to change the "LogicalHeight", so this would either have to be done via nms or datapacks
I can't tell tho, I'll keep searching
you cannot do that from bukkit
bukkit does its shit way too late to modify the dimension types
yea
why does entityenderdragon have the isbaby method, is it possible to reduce the size of the dragon?
Probably another instance of unfortunate naming
If I had to guess, the isBaby method denotates whether the enderdragon is not the original dragon
mojunk
or probably just extending from entity
to answer your question, you can't resize the dragon
although you can resize a wither :p
hi. im working with npc and i noticed that when player dies npc get despawned is there a way to respawn the npc? i tried using the player death event and player resapwn event and none of them worked
send the packet again
its not that they die, its that they get out of render distance
not working still
where are you sending it
you only have on chunk load
and im assuming NPCManager is your own class
not a lib
there is addViewer method which sends the packet to the player.
yes its mine
just check when a player is in range, then send the packet again
i think ive already done that here
yeah when a player dies it won't reload the chunk
and at the same time if a player moves away from a chunk, it won't necessarily unload
you have to have another listener, like on move to check if they are in distance
wouldn't that reduce server performance? if I remember correctly, PlayerMoveEvent uses a lot of performance
Depends what you're doing
right now, I want to check if the player is in range, then respawn the NPCs. so basically sending packets
if you do it efficiently, no
it's either that or blindly sending the player data packet every so often
I mean you could also define an event to trigger this couldn't you?
what do you mean?
A custom event
to do what?
that custom event has to be invoked by some process still
it won't just start working
or just save yourself the trouble and use Citizens
Citizens does the same checks
how to check if the player is in the range though
can get the squared dist
distance() ?
Yes but you don't need to write them 
if you want an efficient check
Citizens API sorta sucks, and NPCs are very easy to setup
I used to use citizens way back and couldn't achieve what i wanted to with it
idk maybe it's changed since then, but i doubt it
Wdym? Their API is good
how could I do that? would you like to explain it more to me?
declaration: package: org.bukkit, class: Location
its just pythag but doesn't sqrt the final value
so you don't have to calculate sqrt each distance check
so you can just do
distanceSquare(loc) <= threshold^2
then you're only ever calculating multiplication instead of sqrt
what would the threshold be
the distance you're trying to check
the render distance?
yeah, or less if need be
anything between 1 and the render distance, its up to you
so if the render distance is 8, what the number will be?
The kind of cousin that always asks you for money
so will this work then?
@EventHandler
private void onPlayerMove(@NotNull PlayerMoveEvent event) {
val from = event.getFrom();
val to = event.getTo();
val player = event.getPlayer();
if (isSameBlock(to, from)) return;
this.npcManager.getActiveNPCs().stream()
.filter(skyWarsNPC -> skyWarsNPC.getLocation().getWorld().equals(player.getWorld()))
.filter(skyWarsNPC -> skyWarsNPC.getLocation().distanceSquared(to) <= 64)
.forEach(skyWarsNPC -> skyWarsNPC.addViewer(player));
}```
yeah that should work, i wouldn't use a stream though
you can probably get away with using some map to keep track of players in render distasnce and have a timeout before checking again
O(1) check vs distance checkl
if you want to optimise more
thats a good idea
if he knows what O(1) is I will eat my shorts
no i don't lol
dodged eating shorts once again
bort
Should I give a hint?
What version are you using? Could also extend server player and override
@Override
public void startSeenByPlayer(@NotNull ServerPlayer serverPlayer) { }
I'm not sure he's 100% on the whole square root vs power of 2 thing so I wouldn't get my hopes up on having O(1) be lesson 2 of java 101
oh yeah thats a thing
It's far simpler imo
kek fairs
is that for when players initially get the packet from the entity?
You'll still have to send the packet
just whenever in range i think
wait nvm
but yeah removes the need for the distance check
^it's just when the player ever needs to load the entity within range
that's kinda cool
it works lol
all entities have it
im really glad. cause ive been working on this for like 2 hours to figure out why this wasn't working
this sucks, I woke up at 2 pm and ended up going to the gym just earlier, from 9:30 am to 11:30 am
I'm so tired
2pm? what time did you sleep
but one thing, and that is i sometimes see foot particles
bud
I haven't slept
it's getting close to 24h
that's what sucks
it was the only way to keep to my gym schedule
hell I have to have two gym memberships just to be able to do this because my main gym isn't even open today
I'm currently smoking a brisket and I am so excited
should go to a 24/7
I would pay a ridiculous amount of money to go to a 24/7
there are none in my region
ah dang that sucks
programmer and gym 24/7 dont line up, i think u mean 24 times every 7 years
thats still not 24/7
I think you're confused about what a 24/7 gym is
theres barely any gyms in my country
there are still alot
but like
most likely there isnt gonna be one near u
that is true of 99% of locations of any given country
unsurprisingly gyms tend to always be in cities
back to topic
how do i make infinite fireworks
I'm coding right now, just hard on the hands
oh heck yeah my timer works
I wonder how much data retention I want to do
1 hour is probably fine
can u listen for firework boost event
how can I use my own function in message.setClickEvent() ?
u need paper iirc
sure
I tie it with dynamic uuids so they can have a fun time trying to guess what the command is
I want to make a button that accept or refuse somthing
but you do whatever you want to do
?components
For hoverable, clickable, hex colored, or otherwise complex text, use the component API. Documentation can be found here:
https://www.spigotmc.org/wiki/the-chat-component-api/
what if you're so unlucky and someone guesses it out of the quadrillion possibilities or whatever
yeah but I need to use my own function
then they get the privilege of using a function they could've just clicked to use
do as /^.^ said
magmas new name \^.^
hi \^.^
this username is older than this discord server
magma or \^.^
both
ill just call u \^.^
this username is 20 years old, the alt is what i used to use when spigot used IRC
so maybe 5 or something
that's fine I think I can live with that
1.8 is ancient if its not in the docs idk
guys is there any simple example to show if the person is in combat
just listen to EntityDamageBYEntityEvent, check if both are players, and set a timeout
explain better
like you want to add an indicator for when a player is in combat? How long? when does it end?
public class CombatLog extends JavaPlugin implements Listener {
private final HashMap<UUID, Long> combatLog = new HashMap<>();
private static final long COMBAT_COOLDOWN = 10 * 1000; // 10 seconds
@EventHandler
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
if (event.getEntity() instanceof Player) {
Player player = (Player) event.getEntity();
combatLog.put(player.getUniqueId(), System.currentTimeMillis());
player.sendMessage("You are now in combat!");
new BukkitRunnable() {
@Override
public void run() {
combatLog.remove(player.getUniqueId());
player.sendMessage("You are no longer in combat!");
}
}.runTaskLater(this, COMBAT_COOLDOWN / 50); // 20 ticks per second
}
}
}```
that runnable won't work exactly as how you intend it to
a player is in combat if an other player hitted him
you will also start a new runnable every time someone is hit
why not
players will end up with multiple runnables active
it should be like that if zou hit him a second time it should run again
constant time complexity :D
its not running again, its running another
you need to reset the runnable if a player is hit again
orelse it will prematurely put them out of combat
if you have 3 players hit one, twice each, the target now has 6 runnables active
i see but also my problem is it is neverwriting the message
ok understodd
those 6 runnables all end but only the first one actually removes them from teh log
you still get 6 messages though
yeah
this will i add later
you ok yes will
its likely not his main class and he added JavaPlugin to access Plugin for the runnable. Not knowing you can't do that
yeah i am pretty new to java
The logic should be playerHit -> checkIfPlayerInHashmap (if false, set the timer, if true, update the hashmap with new current time) -> check timer every second, compare the time since last, then cancel the timer if true
you should be passing a reference to your core class
I'm really procrastinating ;-;
and your plugin should only ever have one class which extends JavaPlugin, which is the core
ok
maybe i am too stupid for java
whats wrong?
send us through your code and we can help
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
it is never writing this player.sendMessage("You are now in combat!");
.
so you're using the same code
why when I set this (this.bukkitEntity as EnderDragon).phase = EnderDragon.Phase.FLY_TO_PORTALthe dragon will not spawn
youre trying tos pawn the dragon by setting it's phase?
I want to spawn the dragon and make it fly to the portal.
class Dragon(location: Location, eggLocation: Location, portalLocation: Location, world: WorldServer) : EntityEnderDragon(EntityTypes.ENDER_DRAGON, world) {
init {
this.setPosition(location.x, location.y, location.z)
goalSelector.a(0, PathfinderGoalFloat(this))
goalSelector.a(
8, PathfinderGoalLookAtPlayer(
this,
EntityHuman::class.java, 8.0f
)
)
val craftDragon: EntityEnderDragon = this
craftDragon.setPositionRotation(location.x, location.y, location.z, location.yaw, location.pitch)
world.world.getBlockAt(eggLocation).type = Material.DRAGON_EGG
world.world.spawnEntity(
eggLocation.add(0.0, 0.0, 3.0),
EntityType.ENDER_CRYSTAL
)
world.world.spawnEntity(
eggLocation.add(0.0, 0.0, -3.0),
EntityType.ENDER_CRYSTAL
)
world.world.spawnEntity(
eggLocation.add(3.0, 0.0, 0.0),
EntityType.ENDER_CRYSTAL
)
world.world.spawnEntity(
eggLocation.add(-3.0, 0.0, 0.0),
EntityType.ENDER_CRYSTAL
)
val battleNMS = EnderDragonBattle(
world,
world.worldDataServer.generatorSettings.seed,
world.worldDataServer.C()
)
battleNMS.exitPortalLocation = BlockPosition(portalLocation.blockX, portalLocation.blockY, portalLocation.blockZ)
battleNMS.generateExitPortal(false)
battleNMS.dragonUUID = this.uniqueID
val battle: DragonBattle = CraftDragonBattle(battleNMS)
battle.initiateRespawn()
}
fun spawn(red: Boolean): Entity {
val entity: Entity = this.bukkitEntity
getWorld().addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM)
(this.bukkitEntity as EnderDragon).phase = EnderDragon.Phase.FLY_TO_PORTAL
}
}```
why are you extending nms classes
what about my question above?
i am not sure what you mean by that
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
You can NOT have two classes extend JavaPlugin
if I know there is an armor stand on a specific block, how can I use world#getNearbyEntities() to get it?
I just want a reliable way to get all entities within a single block
Can’t u just get its path navigation and set target position
well as you see you CAN have it, will it work? probably not
what makes player#sendMap
public void displayStructureOverlay(Player player, Location targetLocation, int width, int height, int depth) {
Location[] corners = new Location[]{
targetLocation.clone().add(0, 0, 0),
targetLocation.clone().add(width, 0, 0),
targetLocation.clone().add(0, height, 0),
targetLocation.clone().add(0, 0, depth),
targetLocation.clone().add(width, height, 0),
targetLocation.clone().add(width, 0, depth),
targetLocation.clone().add(0, height, depth),
targetLocation.clone().add(width, height, depth)
};
drawLine(player, corners[0], corners[1]);
drawLine(player, corners[0], corners[2]);
drawLine(player, corners[0], corners[3]);
drawLine(player, corners[1], corners[4]);
drawLine(player, corners[1], corners[5]);
drawLine(player, corners[2], corners[4]);
drawLine(player, corners[2], corners[6]);
drawLine(player, corners[3], corners[5]);
drawLine(player, corners[3], corners[6]);
drawLine(player, corners[4], corners[7]);
drawLine(player, corners[5], corners[7]);
drawLine(player, corners[6], corners[7]);
}
private void drawLine(Player player, Location start, Location end) {
double distance = start.distance(end);
Vector vector = end.toVector().subtract(start.toVector()).normalize().multiply(0.1);
Location current = start.clone();
for (double i = 0; i < distance; i += 0.1) {
player.spawnParticle(Particle.HAPPY_VILLAGER, current, 1);
current.add(vector);
}
}```
Location is determined based on the players current view, that being said I'm not sure how to figure when I need to add/subtract x/z based on the current facing direction of the player
is there a pathfindergoal that allows the mob to avoid colliding with objects?
that is, to shift your position as if bypassing the block which prevents you from moving
east/south iirc are the two directions that work, west and north seem to display these particles way closer to the player
[*] Required JVM Arguments not found! Some features may not work as expected.
[*] Please add the following JVM args BEFORE -jar in your startup command:
[*] --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED
[*] --add-opens=java.base/jdk.internal.reflect=ALL-UNNAMED
[*] --add-opens=java.base/java.lang=ALL-UNNAMED
[*] -noverify
------------------------------------------------------------
_____ _ _____ _ _
/ ____| | | / ____| (_) | |
| | __ _ _ __| |__ ___ _ __ | (___ _ __ _ __ _ ___ | |_
| | / _` | '__| '_ \ / _ \| '_ \ \___ \| '_ \| |/ _` |/ _ \| __|
| |___| (_| | | | |_) | (_) | | | |____) | |_) | | (_| | (_) | |_
\_____\__,_|_| |_.__/ \___/|_| |_|_____/| .__/|_|\__, |\___/ \__|
Version 4.2.6 | | __/ |
|_| |___/
------------------------------------------------------------
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.bukkit.craftbukkit.Main.main(Carbon:65)
at tf.leaks.carbon.Loader.main(Unknown Source)
Caused by: java.lang.UnsupportedOperationException: No class provided, and an appropriate one cannot be found.
at org.apache.logging.log4j.LogManager.callerClass(LogManager.java:573)
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:598)
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:585)
at net.minecraft.server.v1_8_R3.SystemUtils.<clinit>(Carbon:31)
... 2 more
can someone please help ?
i keep getting this error
whenever i start lunching the serber
@echo off
java -Xms4G -Xmx4G -XX:+UseG1GC -noverify -jar carbonspigot.jar nogui
pause
my startup command
carbon spigot huh
a paid fork
A paid fork? Aren't paid forks illegal if we believe the mc eula
Imagine paying to get slightly better spigot 💀
i didnt buy it
i got it from a friend
even more illegal then
pirated spigot fork
they list Log4J RCE exploit patched as one of the features ☠️
I call this illegal++
also, my internet is slow af
why would I
-noverify
Beware. This may severely impact stability. Further, this indicates some serious obfuscation, an indicator of stupid or broken software
pirated even
https://pastebin.com/nF3Z8ZA8 for some reason the map is empty
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Hey geol if you're up for it, would you mind helping me? (original msg)
What exactly is the issue here?
Let me get a clip
deleta a msg e vai pa outro canal
isn't this a #help-server type of question?
im new sorry
tas desculpado
you're more likely to get an answer in the plugin's discord either way
https://pastebin.com/nF3Z8ZA8 for some reason the map is empty
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
here we can only realistically give an answer using common sense
which
https://gyazo.com/3e669edde61ab5e72b446f351b617c95
https://gyazo.com/3e669edde61ab5e72b446f351b617c95
east/south are fine, but the inverse directions would require me to subtract from either x/z
And I'm just unsure of how to put this into code
Do you already have quadrant snapping logic?
No I do not, just align with proper block spacing currently
private void startOverlayTask(Player player, Location targetLocation, int width, int height, int depth, String schematicFileName) {
targetLocation.setX(Math.floor(targetLocation.getX()));
targetLocation.setY(Math.floor(targetLocation.getY()));
targetLocation.setZ(Math.floor(targetLocation.getZ()));
Location oppositeCorner = targetLocation.clone().add(width, height, depth);
int taskId = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, () ->
visualOverlay.displayStructureOverlay(player, targetLocation, width, height, depth), 0L, 10L);
overlayTasks.put(player, new OverlayTask(taskId, schematicFileName, targetLocation, oppositeCorner));
player.sendMessage("Use /confirm to place the structure or /cancel to cancel.");
}```
Then what is the difference between east and south there?
Also, FYI you posted the same link twice, so I might be missing some crucial info here
that's the same link a third time now
And could you show the code that depends on the player's rotation?
BlockVector3 dimensions = worldEditHandler.getSchematicDimensions(schematicFileName);
if (dimensions == null) {
player.sendMessage("Failed to get dimensions of schematic file: " + schematicFileName);
return;
}
int width = dimensions.x();
int height = dimensions.y();
int depth = dimensions.z();
Location eyeLocation = player.getEyeLocation();
Vector direction = eyeLocation.getDirection().normalize();
Location targetLocation = eyeLocation.add(direction.multiply(5));
startOverlayTask(player, targetLocation, width, height, depth, schematicFileName);
}
?jd-s hm, yeah
I suppose you could use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/LivingEntity.html#getTargetBlock(java.util.Set,int) instead, but I don't see the actual cause why your code wouldn't work
But shouldn't width/height and depth be adjusted with the player's rotation, too?
The issue lies in the visual overlay class, being I'm always adding to the target location, north/west or x/z (wtv the correlation is) would need to be subtracted right?
I'd use a negative width/height depending on the quadrant the player is looking in
This probably can just be achieved by ensuring that the direction vector has the same signs as the width/height/depth vector
Ok let me try that
does anyone know if the wood variants of logs are added to the LOGS tag?
like OAK_WOOD instead of OAK_LOG
Doesn't F3 show that?
oh does it? time to boot up my game ig
I meant more something like
width = Math.copySign(width, eyeLocation.getX());
height = Math.copySign(height, eyeLocation.getY());
depth = Math.copySign(depth, eyeLocation.getZ());
startOverlayTask(player, targetLocation, width, height, depth, schematicFileName);
@worthy yarrow
What can I do to improve the map design?
is there any simple solution for mixins in spigot?
pretty sure spigot does not do mixins at all
spigot itself probably doesn't, yeah
I assume oil rigs, caves and cities are the map legend. I'd put them underneath each other on the top or bottom left and a bit smaller, or at least next to eachother instead of the purple above it
That's not it, the painting on the map, you know? Above the legend, it's all broken
oh you want the entire map to be filled, not design help?
No
Mixins and spigot could not be more opposite of eachothers ideas
yes
I don't know why the map doesn't fill in
I wish we could get mixins tho
then is there any other way for me to modify/replace MC classes?
no because the idea of plugins is not to be doing such things
that is in the realm of modding
oh sorry then I never created a map before
What can I do to improve the filling of the map above? It doesn't have the colors of the world blocks for some reason.
thanks anyway
I'm glad we don't have them. Its a compatibility nightmare, very few devs actually know how to intelligently write mixins and it'd invalidate the entire existance of the API in the first place
why have an API if you can just mixin everywhere
probably because it's more convenient most of the time?
Mixins should be for the advanced people and plugins
obviously mixins aren't supposed to be used for literally every single thing
beginners aren't knowledgeable enough to make such a distinction. If you want mixins fabric is perfectly capable of making server sided mods
much like spigot, but rather than leveraging spigot API you can leverage mixin and the fapi
And then you can't use plugins so you end up with either a half working server or a half working server
I think the concept of bukkit/spigot is a bit outdated tho
What does spigot do better than fabric
have a stable long lasting API? I mean if you don't like it switch to making fabric mods for the server
I really don't see the issue here
if every developer is affraid to switch because of market share no change is ever made
easy multi-version support
why would you support multi version tho
if you're coding for a private server use this https://github.com/vectrix-space/ignite
Besides the few latest versions
that's quite an interesting statement coming from someone trying to make a cross version NMS library
oh fuck
Why do you know that
ignite mods are completely separate from plugins, right?
yes
They run on different classloaders
I haven't looked at my plugins for a few years now - knowing that they probably still work on the newest version is such a godsend
Lol
so no way of communicating between an ignite mod and a plugin?
There is, but it is non-trivial
You'd want to avoid such communication at the very least - for several reasons even beyond the practical ones
What can I do to improve the filling of the map above? It doesn't have the colors of the world blocks for some reason.
spam alert!
because I've joined that thread before and said the idea was pretty silly
it is silly as fuck innit
if you look at the current code of it you'll notice that it does not look healthy lol
I understand, it's just that I already have pretty much everything done in a plugin, except a small tweak to a MC class to make it all work
@river oracle you should join general 1 and see this cool thing I did
nah I'm good
@river oracle you should join general 1 and see this cool thing nuclear did
considering you aren't in general-1 I'm starting to think you don't actually think its that cool
He never got to see it
bruh

ahahhaa
Neither of you even saw it
(I have 0 idea what it is, I am just memeing)
Come take a look its actually really cool
are you rewriting a remapper from scratch?
no I'm making a gradle plugin
nah you're using tiny kekw
yeah I don't want to reinvent the car
I'm confused how its taking so long to make a simple remapping gradle plugin? Its not done yet right?
It does not only remap, it also generates the needed mappings
And most of the time spent was writing the mapping merger
what is that small tweak in question?
To merge intermediary and spigot mappings because of some stupid classpath shit
why even bother with spigot mappings
because that's what the spigot server jar is in?
confused how merging that and intermediate has any benefit though
The spigot jar is spigot mapped, to remap I need a classpath in the source mapping, so I need the source mapping to be spigot
custom session verification/authentication instead of yggdrasil
@blazing ocean convince y2k to look at my cool thing, tell him it's really cool
And then also pre-mojmap versions being completely and fully spigot mapped
Not just classes like modern versions, but also members
You don't really need to tweak anything for that
What do you think y2k?
But no support for piracy here
problem is that I don't need to replace it completely, just redirect to a custom one in certain cases
Then use a callback system, as iirc the bukkit plugin classloader is still able to access teh classloader to the ignite mod (but not vice-versa)
You could even use bukkit's event handler system if it really needs be
Previusly i was comparing ItemStack#getType with Material what is the way now?
I get cannot resolve symbol Material
update intelliJ
Oh my bad, someone else said that and I thought they were speaking to someone else
Why would I need to update intellij for that out of curiosity
Yeah well I did the same way I had previously, I had just updated the spigot version. Intellij is updating now
IntelliJ likes to randomly stop working with spigot libs or something
they need to update intellij because the API compiles with java 21
and older intellij versions cannot parse that bytecode
So I'm correct in a way less descriptive way
Still getting this idk if this is right?
its 1.20.6 also
I just ran latest buildtools prior to this
import org.spigotmc.event.player.PlayerQuitEvent;
import org.spigotmc.command.Command;
import org.spigotmc.command.CommandExecutor;
import org.spigotmc.command.CommandSender;
import org.spigotmc.configuration.file.FileConfiguration;
import org.spigotmc.plugin.java.JavaPlugin;
```Friends, can you tell me the correct import codes?
Use your IDE?...
?jd-s
Hello! How do I make my resources premium, to be bought with money?
?premium
thanks
question, I wanna add negative spacing to my resource pack for texture reasons, I found a pack online that contains the spacing characters, do people usually just send the space resourcepack alongside their actual resource pack or is it better to just merge the resource packs together?
Hello.
good morning
Say I had one class (item), which contains some variables including a uuid, and a class that extends from it (plant) which includes all the variables from item but also has a few others like seedmaterial, growthspeed, etc
How can I store both of these in one hashmap? Should I?
Like I want to be able to do things like get the class by it’s uuid, and then check if it’s an instanceof plant
Things like that
Idk I’m not great at this Java stuff
But if anyone had tips about these data structure things I would really appreciate it
Looking for feedback on SPIGOT-7829
i get worldmap by worldname?
I have an event listener for block break event that is annotated with ignoreCancelled = true, however someone with some custom plugin preventing the block from being broken, but my listener is still acting upon the block break event. Is there another way I should be checking for the event being canceled?
Ignore cancelled means you are ignoring that is has been cancelled
This is probably the oposite of what you want
oh really?
how i get worldmap by worldname?
wdym
i don't think that is the case because i use that annotation in other places
did you asked for dir or World object
Hm, maybe I am misremembering
how i get WorldMap object by world name
But you can also do event.isCancelled()
im aware. that effectively does the same thing, except the annotation is suppoed to ignore the entire execution
i believe there is no worldmap object but you can try Bukkit#getWorld it should be taking name as a param
is worldmap, no world
Maybe the other plugin is lower priority than yours, so it hasn't been cancellet yet when you observe the event
Or is it higher? I only remember that Bukkit's ordering is backwards, and then I trick myself into thinking it's the other way around from what I remember when I already remember the correct one
I think high prio is last, and low prio is first
Apologies for the mixups. It's been 10 years since I was an active plugin developer
oh fuck kangarko is here
highest prior is last as it gets the final control of the event
Yeah this is how I remember it as well. I just needed a moment to get there 😅
But it is probably unexpected for a lot of people
yeah
How can I disable or replace the default spectator mode inventory?
ik theres BossBar::setColor or smth but not sure if "vanilla" bossbars can be customized with the api
Hello 🙂
I used to be able to download the spigot api from building a url together like this:
https://hub.spigotmc.org/nexus/service/local/artifact/maven/redirect?r=snapshots&g=org.spigotmc&a=spigot-api&v=" + latestVersion + "&e=jar&c=shaded"
nowadays it is not working anymore... did the uri change?
I used the maven-metadata.xml to retrieve latest version
Hello, I want the npc to make me tp a few coordinates from my world and I don't know how to do it, can you give me a solution?
help plz
whats wrong with CookingRecipe
its says thats its abstract and thats have a constructor at the same time
how can i fix it?
Abstract classes can have constructors
It just means that the subclasses are the ones calling them
so what do i do
Looks a bit like this
public abstract class MyAbstractClass {
private final int value;
public MyAbstractClass(int value) {
this.value = value;
}
...
}
public class MySubClass extends MyAbstractClass {
public MySubClass() {
super(1);
}
}
im stupid a bit
you create an instance of a subclass
imillusion the rizzler
is there just a generic block change event that tracks whenever a block changes state? (e.g. a leaf decaying, water breaking crops, creeper exploding, player placing a block, etc.)
im trying to listen for all block changes but i have no idea how to do it
to avoid the xy problem, basically i want to create a "snapshot" of the server that i can rollback to at any time, my idea was to store all entity locations, player health/data, etc. in maps (this has already been done successfully) and use FAWE to copy the world (obviously not the entire thing but all blocks in a 200 block radius at the time of the snapshot) to a clipboard and paste it when rolling back
the issue with using FAWE is that its copying tens of millions of blocks when in reality, maybe only a few hundred blocks would've been changed since the snapshot. hence why im looking for a way to log what blocks have been changed (e.g. a block change event)
Does anyone know a good developer to finish configuring my spigot server?
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/
diference hiring developers, vs offering developers?
if you are a developer, you are offering your developer skills
if im looking i need to go Offering ?
If you want to hire a developer, you go post in hiring.
If you want to offer your services as a developer, then you post in offering.
But im looking a developer cheaper, to pay 10€, i dont wanna pay +15€,
thats only to finish the server are at 90-95%
I'm going to take a wild guess and say the easiest way to do post requests is not with httpurlconnection
thankfully, the jdk has an http client