#help-development
1 messages Β· Page 1023 of 1
slime chunks are determined using the server seed π
bruh
now go off and have fun
like this?
In a Timer
yea that wont work
its most likely complaning because you have no brackets
its as if he was using an older jdk
i dont have the record thing
good news, one out of 10 ten chunks will be a slime chunk though
Show please full code, nobody is interested in asking thousand of questions
have you guys tried invalidating caches
damn, I wish
should i do smth here?
it should be at 17
that is the default math currently lol
Should be of help
every 10 chunks you find, there should be 1 slime chunk
so what do i have to do to get the record
hmm, I was thinking of making a client mod that would determine slime chunks but I didn't it would be this shitty
well, since they're so often I can just go search them ig
Idk check in your project structure the language level?
well I am going based off the wiki for that, never really confirmed if that is true. But what is true is that which chunks specifically are to be slime chunks is pulled and calculated from the server seed every time
well every time a chunk loads
I think I'll just go find a swamp or something
even tho last time I tried finding a swamp I walked 6k blocks on the x axis and 3k on the z axis and found nothing
maybe your seeds are not creative enough
did you by chance be using an int seed and not a long?
som1 knows ? π
otherwise, just make a normal class instead
does about the same
I always forget records exist
records rock
can you send the code
not a pic
public class TPARequest {
private final UUID target;
private final Instant creationTimestamp;
public TPARequest(UUID target, Instant creationTimestamp) {
this.target = target;
this.creationTimestamp = creationTimestamp;
}
public UUID getTarget() {
return target;
}
public Instant getCreationTimestamp() {
return creationTimestamp;
}
}
I always forget some people exist
that a good or bad thing?
Incoming call "Mister you forgot to get your child again, its 10pm"
um, not entirely sure. Its just one of those, hey I forgot you existed here. and then onto some other talk
now i need the requests
lmfao
lol
also sent that above
wdym
dont need to put it back
youre my sun shine yk that?
xD
man, from being inactive in this channel for decades, to being called a sunshine
i fucking made it
whats the error here now π
()
oh
π
forgot 2 () at the end
new HashMap<>();?
try and see
π
HEY
they should add that
EMBRACE THE WARNINGS
theyre the absolute best
if you have 0 warnings in your code, you are a bad developer change my mind
@remote swallow RIGHT?!?
fxck warnings
supress em
who need them
no
you need to see them
so you can tell intellij that you wont care
and make it cry
Im a good developer
3492 lines of SupressWarnings
youre a god
only thing i ever suppressed was "might be null"
cuz it keeps popping off on everything that isnt marked as nonnull
btw whats the differnce beetwenn privtate and public and final and static
private = ...... private ._.
public means public
can be accessed from "everywhere"
static adds the way to access it through classes (eg. Main.SOME_STATIC_FIELD)
and private?
private means it can only be accessed by the class it's in
how can i acces the hashmap form another class then
Now explain for him: Protected im now in bathroom
do you need to?
yep
if youre lazy, make it public
i am
if you wanna do it the right way, make a getter method
and final and static
learning some good practices here i hear
you can finally rest easy now with this
final means unchangable after creation
this is the ultimate accomplishment
as long as it works π
absolutely
why do java devs want getter and setter methods even when not needing side effects
Thats wrong way to think about stuff
i gave them the way to decide
many don't
i just don't get why they every java dev wants that
/ why it's a convention
when i'm lazy, i actually also just make stuff public
especially when having a lot of fields, and i just can't be bothered creating getters for every single one
i just do the experation time with a runnable
basically
how many ticks one sec
iirc, ```java
Bukkit.getScheduler().runTaskLater(() -> {
// remove the request from the list
}, request.getCreationTimestamp());
10?
ideally 20
Normally 20
10 would be like 0.5s if your Server is not lagging
I hear 200 ticks is fun
wouldnt that be enough?
why have a whole constantly checking thing
@Override
public void run() {
}
}.runTaskLater(ZenTP.getPlugin(), 1200);```
i think that will work too
Every mob on server: IM SPEED
yea, but what's the point behind the Instant timestamp when using a fixed number
oh god dont randomly instantiate bukkitrunnables in favor of using the scheduler
I remember my first time modifying the tick rate
I essentially died to some random mobs
with no time to react
lol
fuckin assholes
i did this at my survival words that my farms work faster π
i swear, zombies even on 20 tickrate do be hackin sometimes
zombies should ne nerfed frfr
like reach and smt
fun
Accidently. Nice try
oop
Spiders are worse
existing.remove(ptp.getUniqueId()); requests.put(p.getUniqueId() , existing);
is taht right?
idk if it's just lag or smt
Imagine spider could walking vertically on walls
Never had issues with zombies
basically
creepers are the baddest
Either spiders, creepers or skeletons
looks about right
hot creepers in your area
200ticks and a creeper π
Hell nah
lol
Hot naked creepers π
Skeletons are worse, creepers make one boom and that's it, skeletons will bombard you with 700 arrows until you manage to get near enough
what
i swear
they explode faster than u want
Hot naked, 40 years old mil.... creeper in radius of 500 meters
Had no idea but they still manage to shoot 700 arrows
as long as they're not a gatling gun, its fine
*500 blocks
True true
how can i check now in accept if the players uuid is in the hashmap
contains sounds right?
if map.containsKey(player.getUniqueId())
key?
at least its not as bad as running the kill command and killing everyone on the server
a map is a list of key=value pairs
π³
if map.containsKey(player.getUniqueId())
and if yes i should do the tp?
Youre such a Skibidi rizzler
thank you
never say that again
It's his pronouns
Map<Key,Value> map;
List<Pair<Key, Value>> pairList;
both same technically
yes we have 2024
dont care, never say that again
I thought it was cringe but in the funny way do I said it
i identify as a skibidi rizzler
Actually π€
yea actually it's not
cuz every map key can only contain one value
i am dumb, lemme be
Good one bro π π ππΌ π π πͺ π π ππΌ π π
thank you bro π π ππΌ π π πͺ π π ππΌ π π
children...
πΆ
if (ptp != null){
if (Tpa.requests.containsKey(ptp.getUniqueId())){
}
}
}```
is this right @slate mortar my sun shine
No it's wrong very wrong
those naming conventions are worse than mine holy
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! π
but is it right π₯
where is that code
if (ptp != null){
if (Tpa.requests.containsKey(ptp.getUniqueId())){
}
}
}```
who is "ptp"
the /tpaccept <ptp>
the player who sent the request?
yep
yea, then it's technically not wrong
"technically"
tho you also have to check if there's valid requests that match the accepting player
how can i see if a list contains smth
@slate mortar wanna see smth
idk
Lagu "You Are My Sunshine" mempunyai arti yang cukup dalam untuk Christina Perri. Tentunya lagu ini adalah salah satu lagu yang sering dinyanyikan Christina Perri untuk putrinya Carmella.
Dengarkan album "Songs For Carmella" di sini:
http://bit.ly/songsforcarmella
ugh
was that cringe?
that was
okay i wont to that ever again
if (args.length == 1) {
if (ptp != null) {
List<TPARequest> req = Tpa.requests.get(ptp);
if (req == null || req.isEmpty()) {
return; // No Requests found
}
if (req.getUUID().equals(acceptingPlayer().getUniqueId())) {
// teleport the player
Tpa.requests.remove(req);
}
}
}
taken straight outta my ass
might work, might not
oops
I personally do not check if there is a certain amount of args, if there are too many I just ignore them and do everything as usual
ew public map
i didnt create it
still ew
Kotlin user being kotlin user or what
Well, I mean, in kotlin you access by using the name, not a getter usually, atleast that's what I always got suggeste
that should work instead
if (args.length == 1) {
if (ptp != null) {
List<TPARequest> reqList = Tpa.requests.get(ptp);
if (reqList == null || reqList.isEmpty()) {
return; // No Requests found
}
boolean b;
reqList.forEach((req) -> {
if (req.getUUID().equals(acceptingPlayer().getUniqueId())) {
// teleport the player
reqList.remove(req);
b = true;
}
});
if(b) Tpa.requests.put(ptp, reqList);
}
}
again, i didn't write it.
and i'm not going to rewrite their whole codebase
i just adapted to i
yeye ik
just talking to raydan
req.getUUID()
that dont works
no
id still make a private map and create specific get methods
Well, yes, who wouldn't
req.uuid()?
i dont have getTargetr too
THE FUCK
you should have this
should have the getTarget method
or did you manage to create the record?
i have this
probably shouldn't use static
the way you used it
Just scrolled up and saw this, you have no idea how different they are performance-wise
Very big map took 200ms to do stuff to, very big pair list (same size) took 20000ms to do stuff to
good luck explaining to them why to not use static
i changed it before
lol
especially when static "works" and is way easier to manage
req is a hashmap for me
yeah but it sometimes does funny things with hashmaps
it should be a request
while reqList is a list of requests
or no itzs a list
It's a convention, static shall not be used.
you wanna explain to them?
i don't
Just say it's how it has to be
And that there are only a few rare use cases of static
Like singletons, but they can also often be avoided
so what can i do :))?
i will never start using dependency injection, no thanks bro
What does dogbutter mean
quite literally
also
for (Request req : reqList) {
if (req.getUUID().equals(acceptingPlayer().getUniqueId())) {
// teleport the player
reqList.remove(req);
b = true;
}
}
use this one instead of the "forEach"
i always forget that foreach sucks ass
where should i paste it
replace the "forEach" part with it
i dont have a for each part
?!?
i have this
.
this has a forEach
here's just the whole thing
if (args.length == 1) {
if (ptp != null) {
List<TPARequest> reqList = Tpa.requests.get(ptp);
if (reqList == null || reqList.isEmpty()) {
return; // No Requests found
}
boolean b;
for (Request req : reqList) {
if (req.getUUID().equals(acceptingPlayer().getUniqueId())) {
// teleport the player
reqList.remove(req);
b = true;
}
}
if (b) Tpa.requests.put(ptp, reqList);
}
}
so much effort π₯
have fun with a concurrent modification
removeIf
i know i know
i'm bored
steel is busy with his gang
write a c parser
rough
tf is this code for?
actually true
i'd join the vc but im sitting outside with an industrial fan going and I have nothing to add
idk how removeif works, and i have no autocomplete
Oh holy god
?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! π
List<TPARequest> reqList = Tpa.requests.get(ptp);
if (reqList == null || reqList.isEmpty()) {
return; // No Requests found
}
boolean b;
// teleport the player
reqList.remove((req) -> req.getUUID().equals(acceptingPlayer().getUniqueId()));
b = true;
if (b) Tpa.requests.put(ptp, reqList);
what about that?
I see spoonfeeding
i forgot how big that was
RIGHT?
and i always get hate for not using ?paste
meanwhile spigot mods:
I tried to shorten it but the syntax for hyperlinks makes it too long
define "no"
now i have only 1 error left
which is?
the easiest error to solve
oh
that last put isnt even needed
ptp.getUniqueId()
nvm i fixxed it
List<TpaRequest> requests = Tpa.requests.get(ptp)
if requests == null || requests.isEmpty() return false
requests.removeIf(req -> req.getUUID().equals(p.getUniqueId()))
well, we want to modify the just edited request list?
you cant edit a list from a map directory without re-adding it
why inserting the list back , thus overwriting it with the same instance?
tf is that lang
java with some sauce
? wdym with the same
we literally remove the request from the list, if it results in a teleport
you want the map to keep hundreds of expired requests?
val reqList = Tpa.requests.get(ptp)
reqList.removeIf ...
Tpa.requests.put(ptp, reqList)
what the point of that put
nothing?
@slate mortar i try if it works
what directory
no you don't
so youre saying you cant modify a value in a map?
no?
no
you are mutating the same reference
It would be better, in my opinion, to create a separate class for TPA requests rather than giving command class excessive responsibility.
Map#get does not copy or clone the value, and it isn't being copied or cloned after getting it
i had it not work in the past, and ppl told me exactly that, that you have to re-add it
meh
nonsense
in that case it is indeed useless
so can make it even shorter
feel free to
if we were in kotlin we could use a nullsafe operator
kotlin sucks
we don't need to be safe from null
we need unsafe null
linux vs windows argument all over again
billion dollar mistake, lets rethink that
we love that argument tho
"linux is better everywhere, because it does one thing better, but many things worse"
love it how we're still going in the same direction
I don't agree with that. Its more of an opinion then anything on that
ppl not seeing that both do different things
its not like java created null or something XD
it didn't? WOAH
i invented null
DOUBLE WOAH
it has been a mistake to not have nullable semantics as in nullable types with explicit assertions
anyways
javas old
What's this, I'm new.
Ik java though.
?img seems like an ?img moment
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
hello new
What's happening?
python being older than java is a certified hood classic
python existing is a certified war crime
its better than js
ill not say anything about that
||that nonsense caches half the universe||
maven is the goat
maven has one file
exactly
only thing gradle does better i guess is that you can run code in the buildscript, instead of having to create a whole separate maven plugin
eg. for my fabric template, i use a lot of copy/replace code in the builscript, which is neat
as in, copy something and replace code?
if so, pretty sure maven has a plugin for that
copy some files, and replace some placeholder vars in some
maven replacer or whatever
eg <modid> and stuff
so i can just clone the template repo, change 5 vars at the builscript's bottom, and then run a single task that will replace everything accordingly
without having to manually scroll through lots of files
it sure is messy, but works flawlessly
I am going to blame paper
I wonder why..
java.lang.NullPointerException: Cannot invoke "java.util.List.add(Object)" because "existing" is null
at ZenTP-1.jar/eu.zenaria.zentp.commands.Tpa.onCommand(Tpa.java:103) ~[ZenTP-1.jar:?]

what
yep, just stop existing and it won't be null π

why its null
oh i see
.
map.getOrDefault(player.getUUID(), new ArrayList<>());
use this instead
obviously the map might just not contain a key for a player already
where should i paste it
nerds whats the correct way to convert a duration to xhours yminutes zseconds only showing the text that isnt 0 so like a duration of 19h 12m 0s would be 19 hours 12m 0seconds but just 12m would be 12minutes 0seconds
Copy from stackoverflow or shade yodatime
you are showing the text that is 0
existing.add(new TPARequest(ptp.getUniqueId() , Instant.now()));
requests.put(p.getUniqueId() , existing);```
where in this part
for things after yeah, but things before no
just do manual checking
Apache has a utility for that too
replace the "add"
2nd line
modulo
check remainder for 0
or convert to Duration
i already have a duration, i just need to convert
gosh i want to die
SHUT UP
world's largest spoon
thats what she said
lol
i believe theres Duration::getSecondsPart and such
List<TPARequest> existing = request.getOrDefault(p.getUniqueId(), new ArrayList<>());
I'd have blown a gasket by now
check javadocs
omg u german
DA WIRD DOCH DER HUND IN DER PFANNE VERRΓCKT
ahahahaha
thats even better
seit ihr deutsch
mein sonnen schein
och nΓΆΓΆ
DER KRAN MUSS VERDICHTET SEIN
now it goes into this if
You cant see*
you should just replace the part i sent above, where the error came from
Or he cant see, we dont know
i did
or it might explode
it dont
what doesn't work
π
what are you trying to make @clear elm?
tpa
and the problem is?
i dont fucking know
For bungeecord, is there a way to check if a player is banned?
when i do /tpaccept the player it goes into this if that is empty
i wish i knew
btw did he add any debugging?
oh
oh
oh
what is "reqList"?
(why do you say oh)
well then there's apparently no open requests
hi guys
no! "Oh"
guess who is back
i did one
shady's back
jree fava lesson's back
who's shady?
at this point, idk
slim?
so
π
FAVA? Fucked Java?
oh the rapper
i mean, this should get a list from the map (or create one if there's none), add a new request, and put the list into the map
is there a way to setup Structure Block and make it paste a structure
we live in a society
Wait until you learn about Multimap
using spigot api
anyways can you send the full code pls?
I googled it. its a recipe lmao
Would you be content without the structure block?
in java or?
in spigot server
structure blocks are pain
Technically its possible xD
just use spigot api instead of the normal blocks
Load structure with structure manager, slap it down wherever you want
wdym by "no-java"?
i wrote 0 lines of code
?paste
not even for electrical stuff?
i wrote shit on c#
Im sharp too, im a good knife.
but i missed the entire 1.19 and later
I can slice bread
haven't played minecraft for years
i did it from a easy mc accouint
no i was already using it in liek 1.16 or smth
to be fair
i seperate the errors wait
you might replace that "get" as well with the "getOrDefault" i sent
no idea what that is but it is either that or the part for requesting to teleport is broken
boolean b;
... ...
b = true;
if(b)
Is fucking wild
i assume it's just null, because there's no list by default
wtf
free mc accounts for a couple of hours
Just look in the code, i didnt make it. Its there
I was simply suprised
than i get a error
woah its time to learnjava
took me some time to understand but that was really funny
there were more if checks inbetween, it had it's reasoning
i assume they forgot to remove it
prob xD
getOrDefault(ptp, new ArrayList<>());
you need to add the default return too
nah
its better to use null
its in a command
no it's not
why not?
actually
Cache a Collections.emptyList()!!!1111
this whole code is a mess, after i found out you can just modify map-lists directly
the list is empty anyways and you'll just waste time creating an arraylist
am I missing something here or what?
its not. there is the possibility of sending multiple tpa's to multiple players
Can you send the TPA and TPACCEPT again this time in a good format?
and?
so the map may already contain a list with tpa's, or it may not (like here), so we add one
computeIfAbsent
me when guava Multimap exists
I don't think it adds one
@slate mortar its the empty error
as i said, this is really messy now, because you can apparently (against my belief at that point of writing it) modify map values directly
instead it just return the value but doesn't keep it
Let the record show I said this
i dont even know what that is lol
i guess
apparently not smt java native?
Guava
It's guava
Its like a Map with a key can have multiple values
not that it's difficult to make your own anyway
wait
I haven't used java in a serious manner in a long time now to be honest
like
map.put("A", 1)
map.put("A"), 2)
Collection<Integer> idkNumber = map.get("A");
had to much fun making boats
so THAT is the equivalent of List<Pair<Key,Value>
It's a fancy wrapper for Map<K, Collection<V>> basically
damn
I used to use that a lot
yea i got it
someone pls rewrite that code
i was never here (the IDE produced it itself
)
Btw that was four said is true
what
.
Could someone help? My intelliJ just never quits this screen
GetOrDefault is not setting in map. Its just returning
alt f4
I meant to fix it
didn't think about it, cuz the list was getting re-added later anyway
so it'd have been a double-add with this piece of code-crap
The code confused me too luch btw
Idk what is where set xd
Do you have good internet?
chloe what the fook is that boolean
kill through task manager
IT HAD A REASON
there was code removed
and they forgot to remove it too, and when i copied their part back, i overlooked it
eg. here
I had a reason and im a mistake too. So you can be bothπ
it was to indicate that the list was modified, so it doesnt get re-added when it's the same contents
i'm a piece of shit
hi a mistake too
yes
no fucking shit sherlock
I'm asking for how I'm supposed to fix this
this shows up whenever I want to create a new project
oh
oh
I'm not sure
It's restarting, wait
Clone just with git command and import the projectπ€¨
gotta kill it and it takes it's sweet time restarting
cuz this might be caused by several reasons, pc too whack, too many files, intellij being intellij
you need an ide to write smth simple as that?
it works
i needed autocompletion
so what if you just create new projects from that menu?
Imagine he is using a floppy disk and thats why is loading for hours
I'll try
me few months ago:
i had my dev environment for a mod on my hdd
π
and exiting a world took a solid 2 minutes
I do this all the time, I provide help here while I am at work sometimes XD
bruh I disabled the gradle and maven plugins along with some others and intellij works like 5x faster now
and the project changes work
could probably be waiting on gradle to finish smth
or just a deadlock π€·ββοΈ
Guys I am trying to develop a factions servers, I have developed different types of servers before but none of this matter does anyone know or have any idea where should I start? I have seen some premade setups but I don't really want to spend too much specially if I can do lot of the things myself
sounds like a question for #help-server
This channel is for making plugins
My apologies
If I disable another spigot plugin with this method:
plugin.getServer().getPluginManager().disablePlugin()
Does it delete the data stored in it ( hashMaps, .. ) ?
the whole plugin unloads so everything stored in memory vanishes yes
just do Bukkit.getPluginManager() tbf, another dependency on your plugin avoided
Ok thanks
int kills = main.getConfig().getInt("Niveles." + k.getUniqueId() + "(" + k.getName() + ")" + ".kills");
int level = main.getConfig().getInt("Niveles." + k.getUniqueId() + "(" + k.getName() + ")" + ".nivel");
main.getConfig().set("Niveles." + k.getUniqueId() + "(" + k.getName() + ")" + ".kills", kills + 1);
the integer in the config is not summing
no, the instance is being kept in SimplePluginManager#plugins
why?
what the
calling disablePlugin() only unregisters the listeners etc and then calls the onDisable method
no removing of the plugin instance?
why the integer in the config is not summing?
How does inventory dragging work? I was wanting to handle an single slot drag event as a click, so I created an InventoryClickEvent from that and passed it to my click handler. For the most part it works, but it doesn't detect the cursor as having an item. It seems as though dragging places the item in the inventory before the event is called, unlike with clicks but I'm not sure π€·
save the config?
no, the instance is only removed from the list when clearPlugins() is called
Βͺ
what a
You should save the config async though (and/or on server shutdown)
if i were in kotlin i wouldve done
fun YamlConfiguration.write(block: YamlConfiguration.() -> Unit) = block().apply(save)
config.write {
setInt("x", 1)
setInt("y", 3)
}```
hi, how would i force a player to say a certain message? like a sudo basicaly. i want to make an autogg plugin
isn't there Player#chat(...) ?
yes
is this bc of my java
Ok thanks
Does anyone know about paid addons on Spigot?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
@young knoll I made a PR praise me
I'm no coll, but I'll praise you!
Good job y2!
About paid resources, where the upgrade is purchased
upgrade?
upgrade?
You purchase the plugin and then you're able to get future updates of the plugin free of charge, there is no "upgrade" feature
well most of the time technically a developer could remove you after you've downloaded it once
but 99.99% of premium plugins allow free updates
it's not possible to remove buyers
you can only remove people you manually added as buyer
No, I'm talking about paid resource posts
I thought resources were plugins...
?
I think you don't understand, I'm looking for the tool to be able to publish resources for pay, since the function in Spigot is different, I wanted to know how to access that.
Mate then say that
I don't want to buy, it's for my own resources
It takes a long time to get your plugins approved as paid resources
I lowkey forgot how to publish a paid plugin
Is there some kind of instruction? because I had an account since 2016, but even in that I couldn't
?premium
you must follow and meet these guidelines to post premium plugins
it is likely your account does not meet the following guidelines
account age is not the only requirement
Hello guys i have a question, if i modify minecraft server files and try to rebuild spigot core with changes will it build?
Or will redownload everything
Spigot does not download anything
spigot doesn't download anything
moreover if your spigot server is making web requests to places other than maven central you may have some form of malware
After checking if the "library" has been already extraced, and doing a hash validation
as in modify the source code in the BuildTools folders?
Yes
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
it does if it changes. Really though you should be making clones of the repos from stash tbh. Or just move the folders out of BT dir
Thank you!
mojang authentication in shambles
offline mode ftw
Hello, I have a question about what is the best way to implement this.
Say there is a mine with blocks with regenerate. When it's full (untouched for a long time), it is composed of 80% ores and 20% stone, and players can mine both of those blocks. When blocks are mined, it turns into bedrock, and after some time it turns into stone and then back into ore.
- have all these Locations in a set
- on block break event, check if that block is broken, if it is, replace it with bedrock and schedule a task that will put stone back there after a random amount of ticks, after stone is put, schedule a new task which will put ore there
but when a player mines stone before ore is put there, I'll have to cancel that task and it seems complicated and feels like it could be made better
Anyone know the answer to this?
7smile did something on this
In short use some sort of priority queue and an interface for your task and how many ticks left
public interface RespawnableBlock {
int getTicksUntilRespawn();
void respawn();
}
public class RespawnableBlockTracker {
private final Queue<RespawnableBlock> queue = new PriorityQueue<>(Comparator.comparingInt(RespawnableBlock::getTicksUntilRespawn));
public void schedule(RespawnableBlock block) {
queue.add(block);
}
public void tick() {
// USE 7smile7's CODE REFERENCED ON MY REPLY BELOW
}
}
awesome, can you send a reference for 7smile's work?
also, I'm assuming this tick method is called every tick. does RespawnableBlock in this case refers to a location or the literal block? in my example, if stone "respawns" into bedrock, do you mean it is the same object or different one?
The implementation just represents a location and target state
and maybe a timestamp
?workdistro
this
thank you, seems like it only handles block respawning to just one type (for example bedrock->stone), I'll try to modify it to support multiple, to remove a block stone->ore from priority queue if player mines stone in the meantime, shouldn't be too hard probably
Is PacketPlayOutEntityTeleport generally what people use to animate armor stands?
can you wait in a bukkit task? like this
AtomicInteger delay = new AtomicInteger(0);
AtomicInteger i = new AtomicInteger(0);
Bukkit.getScheduler().runTaskTimer(plugin, () -> {
wait(delay.get()); // how do i do this
if (i.getAndIncrement() >= 15) {
delay.getAndAdd(10);
i.set(0);
}
}, 0, 5L)```
Run task later
you really shouldn't wait/sleep on the main thread
cope
literally cope bro I freeze my server every tick
what you gonna do about it π
I'm gonna tell momd5
go for it bucko. I'm not affraid of momd5
How could you make two different wheat seeds which when planted produced two different wheats which when harvested yield those two different seed types again?
Is there anyway besides like a database
Like can you attach a persistentdatacontainer to wheat
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
Does anyone here have experience removing particles from the END_GATEWAY and END_PORTAL - or are these entirely client-side? I tried using protocol lib to cancel packets but it appears the packets aren't being sent when logged (1.20.6), tbf they arent even logged when things like a potion is thrown either, unless these are also entirely client side?
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Ah the /particle command does trigger this packet though
yeah pretty sure its completely a block effect
just like floating sand's effect
I did π€£ they have unlimited range
For some reason those particles are just, beyond reality XD
i wonder if you can debug stick them
The gateways themselves? If so it says no properties available
just found out you can water log barriers, alright then
huh π€£ walking on water lmfao
are resource packs out of the picture?
Only issue is, when the player first joins is I think they might see some weird block before the pack renders in too, or wasn't there some update that allows the resource pack to render while connecting? I remember something vaguely about this in one of the recent updates
is there such a unicode that's insanely high or stack vertically if alot of them are there?
ask chatgpt
does using Player#getItemInHand have any benefit for backwards compat
you can do Player.getInventory().getItemInMainHand();
if anybody is an expert with protocollib, i cant figure out why my entity metadata packet isnt working correctly for my block display entity
new WrappedDataValue(22, WrappedDataWatcher.Registry.getBlockDataSerializer(false), WrappedBlockData.createData(Material.DIAMOND_BLOCK).getHandle()),
new WrappedDataValue(20, WrappedDataWatcher.Registry.get(Float.class), 2F),
new WrappedDataValue(21, WrappedDataWatcher.Registry.get(Float.class), 2F),
new WrappedDataValue(11, WrappedDataWatcher.Registry.get(Vector3f.class), new Vector3f(2F, 2F, 2F))
));```
heres how im setting the attributes within an entity metadata packet and sending it to the client but the entity is invisible
thats what ive always done but i was wondering the implications of #getItemInHand because it is obviously deprecated. someone recommended it to me for "backwards compatability reasons"
if you use the inventory method it gives you backwards compatability and it isn't depracted iirc
can u use \n in a title by anyway
no
damn
you need shifted fonts
where are they
make them
do i need a texture pack
yes
rip
when i shoot a player with that custom armour the event dont work, it isnt giving the effects
can you add visual durability (like the bar on tools) to any item?
I just need to it be visual
yes
got added recently
so if youre on a newer/newest itβs possible
1.20.4 new enough?
if so big W
how do you use it though
is it just item meta stuff?
like can I add damagable itememeta to any item and it will just work?
not sure
i only know it got added recently
might have to do some research yourself
okay I see
IIRC it was added in 1.20.5/1.20.6
Ye
not available in 1.20.4
declaration: package: org.bukkit.inventory.meta, interface: Damageable
damn
really..
thats kinda dumb
welp, time to ditch support for anything except for latest again
yup
Who/what is responsible for Chat Component API? I can't find their Github.
so any item has damageable item meta now or?
you mean the one from bungeecord?
Likely yes. The one that Spigot uses.
So I should go to the Bungeecord Github then?
yes probably
lmao
you can just backport the function setMaxDamage to your plugin
it shouldn't be too hard since it's a simple function
?jd-bcc
oh interesting, you mean its just something I can do in a few extra steps with the 1.20.4 api?
BungeeCord, the 6th in a generation of server portal suites. Efficiently proxies and maintains connections and transport between multiple Minecraft servers. - SpigotMC/BungeeCord
It was more of a feature suggestion
https://github.com/SpigotMC/BungeeCord/issues/3692
No
the whole itemmeta thing is completely different in 1.20.6 and the client in 1.20.4 wouldnt understand anything
oh so mc vanilla added this feature in 1.20.5
and spigot just made the api for it to actually use it as a dev
The server does know which locale the player uses, but not which respource pack (unless the server provides one btw)
Are you still talking about the damageable items thing?
yeah
Exactly
Then I suppose it would be technically possible to implement, although likely very hard.
You could upload the vanilla resource packs to your server, then get the strings from there
Here's e.g. how I load the names of materials for one language file (that was before Translateable API existed)
https://github.com/mfnalex/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/MaterialUtils.java#L69
it simply loads the lang.json file or however it's called and then you can just map the translation key <> translated string
What's the deal there? In the olden days we used the different damage values define different custom models, which allowed the creation of custom items - but you had to prevent damage or create a custom system for handling it.
But these days you can just create any amount of custom items and give them what ever ID you like.
So what's your interest in the damage values exactly?
you'd just have to have one map per locale, then get the player's locale (Player#getLocale()) and then get that language file and yeah
I want to display the durability bars in my menu for clarity reasons
like an expiry date on the item essentially
so its just the visual part I want
idc about using the item or if it actually has that durability
Right. This is not really something I can implement myself. I'm testing if there's anyone else interested in having this implemented in the Chat Component API itself. The main idea would be that they could be used by third party plugins. Not just for my personal use.
or rather like a timer actually
the issue with custom translations is that you would have to provide translations for all languages?
or am i crazy
Like in the inventory? You could have a model/texture for each damage state and include the bar in the item graphics that way. Certainly possible.