#help-development
1 messages · Page 1011 of 1
i have a pl on me verry old
like 1.12
can anyone teach me to edit it
im new to these stuff i joined it last week only
so im very confused and im overcomplicating stuffs
so the teacher would be having patience to teach me
Are you willing to learn or are you just trying to get it done for free
No
Do you know the basics of Java
nop
?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! 🎉
Then start there
So you have no interesst in learning
i have
You just want it done free
Its not like: Load -> Change a number to 1.20 -> back to jar
Thats not how Plugin development works when Mojang changes a high amount of stuff every update xd
Start by following some guides above
As Olivo said, getting started with basic of java and intellij would be the best
;-;
You can always ask question but its not like everyone wants to code your entire project for free. xd
ahhhhhhhhhhh
Don't skip the learn Java part
If you're in a hurry you should comission someone instead
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
;=-;
if i create plugin with java 21 will it support java 8 or something?
You may need some changes to source code to make it compile to Java 8
how
I'm pretty sure Java 21 can run Java 8 bytecode.
No
It’s backwards compatible, not forwards
Can i add a BBB link to my resource as download link, even though on BBB the resource is paid, and on spigot page is not a premium one?
I think that might be treated as advertising and wouldn't be allowed
People have complained about such pedantics in the past, so I'd be weary of this
No that's a good way to get banned
At minimum resource removal
That's even removed from the fact it's scummy
even linking to a premium spigot resource is an offence from what I have heard so far, so it isn't something that is unique to BBB
why crosspost
not really. If you post in 4 different channels that just mixes up the topics the channels are designated to
they probably misunderstood with what you meant with crosspost - I would've also misunderstood it at first
And yeah, crossposting is le big bad (although I still do it rather frequently if I expect the chances of someone knowing something in one discord being small)
can i add the player to the passengers of an entity and make them stand up
while still being a passenger
no
Nope
what are you trying to do
Bruh stop copying what im gonna type :((
i got a cannon and i want people to stand up while shooting (without them bugging out when trying to move by cancelling event)
Just apply velocity
?
Why does it matter if they stand up or not
basically get the effect of riding (cancels all WASD) movement
my "builder" says its "better"
spoiler alert: it isnt
you can make the player look like it's standing up for other players
Bit hacky, but you can make them spectator inside an armour stand
if the server crashes it makes people spectator
But yeah why do they need to stand
also that makes the player invisible for themself
^
That's not hard to prevent
Ah
also makes him invisible for himself and would look AWFUL to shoot
plus it's block displays not armorstand
Lol
Ask him why its better, than argue just with no, thats how people interact with stupid ideas kekw
I think a sitting pose would look funnier
there'll be alot of cannons
How about you make it a cannon ball and they are sitting ON the cannong ball
and ALOT of people dismounting and remounting
i believe i can flyyyyyyyyy
I believe I can touch the sky
Genuine suggestion lol
why do they need to be mounted o.O
i mean alot of npcs will spawn and despawn if that happens
that didn't really answer what I asked
How about
Question: You want that people can interact with the canon:
Just fire or moving/rotating the cannon as well?
Launch them with velocity then give slowness 9999
rotating and shootign only
and they need to be mounted to do that?
I am still failing to see why mounting is necessary to accomplish that
Idk too
they are launching players?
HAHAHHAHA xd
Im so confused
ok, well they don't need the player to mount anything to not have the player move and still control a cannon
since mounting makes them sit, and sitting is the pose not being wanted, it makes sense then to not mount them
and instead use the other methods to make this feature of their's
Are there any resources how to make my plugin reload safe. Like a list of things a reload does so my plugin can be safe?
Reload is intrinsically unsafe. Make your own reload command
E.g. /myplugin reload
yeah i know but to much players still reload. Is there something i can do?
Just don't do anything, if the plugin breaks it's their fault
Ok
Tell them to use your reload command or expect things to break
reload isn't even supported by spigot it is still existing for backwards compatibility (we don't want people complaining)
what is the new name of this packet?
?switchmappings
it is no different then handling your own reload command
ok
(and cleanup data)
declaration: package: org.bukkit.event.server, class: ServerLoadEvent, enum: LoadType
you can use that event and check which load type it is, and if its reload, treat it like a reload command
then your plugin is reload safe
oh thats a thing? i used the old way of checking if !Bukkit.getWorlds().isEmpty() in onLoad
it also doesn't hurt to create a reload command specific to your plugin as well, as this will allow reloading your plugin specifically and not the entire server lol
ok nice thanks
I dobut you have a good reason
I wanna know the reason
When i reload i get the error that my database H2 isnt closed but is should autoclose because of the try catch. How can it still be open after a reload
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
ok 1sec
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.
Thats my Database class
Why did I read polish spam detected
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.
stupid site
Yeah i needed to anwer some catcha
use pastes.dev or smth next time, pastebin sucks
?paste
ok
Fr fr
now where on earth is the code that closes the connection
i dont see no try catch autoclosing
only in a try with resources I believe
its a try with resources, ye google that
bit scary how sql exceptions propagate into runtime exceptions but uhh ye..
ahh ok
but i close the database with Connection.close(); everytime should take close the connection everythime?
line 53 connectToDatabase().close();
youre doing connectToDatabase().close(); which opens a new connection and immediately closes it
dunno if thats really want you want, closing your conneection after every statement
when should i close it then?
you shoudl not with h2
teh driver will close the connection when teh VM terminates
okay so i should open a connection at start up and close that connection on Server stop? And only use that one connection?
Hey, I've just moved my dependencies from shaded jar to the spigot plugin.yml libraries system. All of my dependencies work, except for kord. Any clue why? I get NoClassDefFoundError. Its important to note that I include dev.kord:kord-core in the libraries, and that dependency will include:
dev.kord:kord-commondev.kord:kord-restdev.kord:kord-gateway
And I also see these dependencies get downloaded and loaded by my plugin. However only thekord-coreclasses are loaded. TheNoClassDefFoundErrorare only coming from classes ofkord-common,kord-restorkord-gateway. Is there something special about this dependency that causes problems with the spigot library system? I've also tried specifying those in thelibrariesarray, but same problem. Here is my libraries array with all the other functioning libraries for reference:
libraries:
# kotlin
- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.24
- org.jetbrains.kotlin:kotlin-reflect:1.9.24
- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0
# exposed
- org.jetbrains.exposed:exposed-core:0.49.0
- org.jetbrains.exposed:exposed-crypt:0.49.0
- org.jetbrains.exposed:exposed-dao:0.49.0
- org.jetbrains.exposed:exposed-jdbc:0.49.0
- org.jetbrains.exposed:exposed-kotlin-datetime:0.49.0
# other
- com.github.ben-manes.caffeine:caffeine:3.1.8
- org.anarres:parallelgzip:1.0.5
- com.cronutils:cron-utils:9.2.1
# kord
- dev.kord:kord-core:0.13.1
# normally should not need to include these, but still does not work:
- dev.kord:kord-common:0.13.1
- dev.kord:kord-rest:0.13.1
- dev.kord:kord-gateway:0.13.1
- https://mvnrepository.com/artifact/dev.kord
- https://github.com/kordlib/kord
I use Spigot1.20.6withJava21
Thanks alot 🙏
get a connection in onEnable, close in onDisable
ignore everything else as the driver will handle it
okay so on a reload it doenst close automaticly right and thats the reason i get the locked file error?
Ahh ok finaly understood what i wrote a year ago xd
noclassdef for what?
a reload doesn;t exit the VM so no shutdown hook is called
Like for instance dev.kord.common.Color
i have no clue what that libraries section even does internally
talks to maven central and downloads to /libraries and then loads it all onto classpath
Anything from the dev.kord.common, dev.kord.gateway or dev.kord.rest packages
is that stuff on maven central?
you might need the jvm specific versions
What do you mean by jvm specific versions?
kord is multiplatform so has multiple different versions, add -jvm to all the group ids
Ohh that just might be it!
is there a good method of like
idk how to explain this but
for all players in a world_A
make "ghost" of player
place ghost inworld_B
set ghost position to mimic player position and yaw and pitch etc and inworld_Binstead ofworld_A
abuse static much?
just fyi, static doesn't get GC'ed
Also I was curious is there any way to add additional maven repositories somewhere in the configs?
unfortunately no
would be fun but could open up to all sorts of downloaded malware
ok, not a problem for me. Ah I see
you can do magic and just write your own library loader or something
So did the blind man as he grabbed his hammer and saw
Right, like what LuckPerms does (its the only plugin I know that does this, I don't use that many plugins thought) https://www.spigotmc.org/threads/loading-dependencies-from-external-sources-in-spigot.491014/
But I hear it probably won't work for Java 21. Is there a nice existing library for this I could use by any chance?
just google, the code is not hard
I do it in GroupManger for versions prior to the libraries in plugin.yml
What do you mean?
library loading
What should I google? Like <100 lines type of hard?
What is 'GroupManager'?
called DependencyManager.checkDependencies(this)
reads the plugin.yml libraries entroes and downloads them
Seems your plugin is now too old @eternal oxide for it to be remembered 😦
Still good software for library loading though it seems. Thanks for sharing 😄
yeah, takign a 7 year break kinds let people forget
i mean i still remember it
well, I still use it
in fact its probably the only permission plugin that I do use
lmao
infinity recursive :D?
infinite recursion can't happen
a stack exception would be thrown before the JVM would allow infinite recursion to happen
well it was initially a boring joke :L
disable the verifier and have fun
the stack would run out of memory if you managed to get past the jvm
I suppose if you were careful to limit the recursion
i mean then you could laugh at a segfault or something
you could technically in a way have infinite recursion
or some internal jvm assertion
That was it! Thank you so much 🙌
Anyone else get:
Tried to load invalid item: 'Item must not be minecraft:air'
In 1.20.6, is the cause known?
Looks like it's trying to load an item that's air
since no other context is provided that's all we can say
That's all I've found about this: https://bugs.mojang.com/browse/MC-270867?attachmentOrder=desc
who tf create a list like this
what is the issue?
Are you asking about who makes a list without initializing it?
well first of all it create some of issue and I have to trace back to find what is its type
and yes
The difference between initializing a list at the beginning of class and declaring it only
is that if you declare and only initialize in a method, then when the class is loaded the list isn't loaded until you need the method. This saves on resources
conversely if the list is needed for the entire class it makes sense to initialize the moment the class loads
Is there a setting for disabling Downloading ... and Loaded library ... logs by any chance?
hmm
Hello, how can I use reflection to access CraftBukkit/NMS classes, and then access their properties/fields, like with an interface (but in interfaces, I can't make fields)
why do it with an interface then?
because I get some errors when casting the returned value to an interface
??
with this, if I remember correctly:```java
Class<NmsEnumParticle> clasz = (Class<NmsEnumParticle>) getEnumParticleClass();
@Nullable
public NmsEnumParticle getEnumParticle(NmsEnumParticle particle) throws ClassNotFoundException {
Class<NmsEnumParticle> clasz = (Class<NmsEnumParticle>) getEnumParticleClass();
return Arrays.stream(clasz.getEnumConstants()).filter(enu -> enu.b().equals(particle.b())).findFirst().orElse(null);
}```
it returns a casting error
what type is NmsEnumParticle
an enum containing the same values as in the nms enum
yeah...
That's not how casting works ;/
how can I do that then?
You can use a switch or if statement
yeah
generic raw type 💀
Hey, a user reported that plugin's libraries have an issue
Basically i am using the library loader in plugin.yml and one library isn't being downloaded properly
transitive dependencies are not downloaded
1.20.4 i think
I remember i tested on 1.20.6 before it was fine
I guess, but I mean not overly difficult to handle
well something everyone should avoid
glad you havent touched the mindustry codebase
bump bc the forums for making them don't seem to work
the yt video i found seems to be outdated
Just use type adapter
probably not without nms
thou the idea is to make it work across servers, not worlds
oh this is a lot
i thought i could just like
spawn an entity with that person's skin
and just place it where the person is
cuz i dont really need nametags or anything i literally just need the skin lol
well yea you could do it with nms
Hello, does anyone has created a nms reflection lib?
@cinder abyss what u tryna do
create a sort of nms mapping, but much more global
that works with multiple version, basically not having an import for every single version, but a system that adapt for each version using reflection
Something like intermediary mappings in fabric?
yeah, maybe
Thought of that before
Like a custom class new NmsPlayer(Location location); that creates a fake player at this location, and in the system, it adapts for each minecraft version
I thought of having a custom classloader that will let you access nms classes by their intermediary names on all versions
yeah, like that
hello, how can i remove the raises of the villagers trades, is there any plugin?they`re demand is too high sometimes
Wrong channel
Or are you making a plugin
I would make something like that, but I got too much other stuff to work on
that's what I want to make
so, does anyone has created a nms reflection lib?
Probably only for specific things
^^
I can expand this to more general things
I just need a solid structure to begin
Intermidary class loader is probably the best approach if you want to cover a lot of nms
yeah
Yep, I think you could have some maven/gradle plugin that would also help you with that
yeah you'd want a plugin to convert to intermediary
to convert to intermediary ?
so I should see how fabric handle nms?
Intermediary approach: convert nms from mojmapped to intermediary, implement classloader to make intermediary load nms classes
hummm
I would like : Plugin call my lib -> Lib's Nms Handler -> Redirect to nms' good version class
I'll do my research then, thanks
whats the best way to let users link actions from my plugins to various other plugins for example NPC's
i want to allow them to trigger certain functionalities in any ways they please
Feel free to help with some code you made/you found !
Make it open source and post the repo link in the thread
yeah for sure
it's at a very untested and uncomplete phase, but I'll post it when I'll have the first results
actually starting with particles in legacy versions
If you do the intermediary mapped thing then your tasks would be to write some plugin to remap when compiling and the classloader that will map the intermediary names to their obfuscated names
I'm pretty sure intermediary mappings exist for all or most versions, dunno how they are generated tbh
hmm I see
https://github.com/FabricMC/intermediary
https://github.com/FabricMC/fabric-loader somewhere in those two repos is all the info you want
perfect thanks, I'll add that to the "pinned url" in my thread
hi
is it possible to turn similar to latin unicode chars to the latin unicode char?
or do i have to make a bigass list
i made one but it doesn't cover even 10% and it took me like an hour
for example
ᵗ ₜ ⓣ 🅣 🅃 🆃 🇹 ʇ t ᴛ ⒯ 𝗍 𝘁 𝘵 𝙩 𝓉 𝓽 𝕥 𝖙 𝚝 ᖶ ㄒ are all t
which can be used to bypass chat filter
i tried making a simple program that maps all unicode chars and turns them into an image and compares them to latin and saves them in cache but it isn't that accurate
you could do it simpler. Convert to ASCII, strip all non printable and display
i want to allow non ascii as well
you are better off specifying the ranges you will accept as unicode then
dump everything outside it
at what range do emojis end
1F600 Emoticons 1F64F
Use this table to select what you are going to allow https://www.unicode.org/charts/nameslist/
you could go upto 1FAFF for enojis
public class ChatListener implements Listener {
@EventHandler
public void onChat(AsyncPlayerChatEvent event) {
String prefix = PrefixManager.getChatPrefix(event.getPlayer());
event.setFormat(prefix + " &8» &7%1$s &8» &7%2$s");
}
}
Can someone tell me whats wrong? It doesnt override my chat format.
(no err in console)
did you register the listener?
You know what, thats probably a good idea.
Might help 🙂
new to java n stuff, do i need to register the util thing anywhere too?
no but you havea couple of issues
You are mapping Player objects to a String. Player objects are only valid for the one session. If they relog it's a new Player Object
best to just use their UUID
Player#getUniqueId()
can someone explain this to me?
val player = Bukkit.getOfflinePlayer(purchaser)
val name = player.name
if (name != null) {
val z = name
// ^? z is String?, should be String
} else {
val z = name
// ^? z is String?, should be null
}
why does type narrowing sometimes work and sometimes doesnt? i never experienced this in another language. at first i assumed it was bc of getters and setters, but it still doesnt work even when extracting the value to a new variable
name will always be null or a String
looks like Kotlin is casting null to a String
which it can do
you can cast null to anything
You check name isn't null, but the type of name is still String?. Performing the if check does not change that
You can make it String by asserting the type as non-nullable. val z = name!
name can be a nullable type while not having the value null
why does kotlin look like javascript
i believe that's valid js code
it doesn't really
can i check if player object already exists?
it really isn't
wait nvm
it would be if it was var
not val
val isn't a js keyword
1 character away from being js
ok putting aside the dumbfuckery for a moment, did that answer your question
java has var too
i guess you mean !!? but if i add that, then the ide says its not necessary
so it seems like it is indeed narrowing the type
oh is it double bang
kotlin is technically java but with different syntax so that isn't surprising
yea
just implicitly
uhhhh, i mean. i dunno then tbh
which is weird
hello
and what does Type! mean? i saw that a few times
external type
do i count
the equivalent to @NotNull in java?
type from java
that's just T
yes
and not a kotlin String
although strings are the same
then i guess String! doesnt have the kotlin specific methods
primitives are special here because they exist in both langs and can interop iirc
String! doesn't exist as it's a primitive
mmm
Hello, should I destroy my pc? Or how can I solve that?```java
public NmsCraftPlayer getCraftPlayer(Player player) throws ClassNotFoundException {
return (NmsCraftPlayer) Class.forName(craftBukkit + ".entity.CraftPlayer").cast(player);
}
public interface NmsCraftPlayer {
Object getHandle();
}```
java.lang.ClassCastException: org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer cannot be cast to io.github.paulem.reflection.interfaces.NmsCraftPlayer```
how should I do it?
I just want some type completion instead of Object
create modules for it then
modules?
Hi there! Today I’m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show th...
I'm using reflection
if you want type completion, dont use reflection and create modules
you wont get type completion easily with reflection
okay
so I'll use an handler for every single class of nms
its a lot easier to just make modules
as soon as theres loads of breaking nms changes you have to version handle your reflection anyway
making modules from 1.8 to 1.20.6?
I prefer using reflection
do you really want to support all of them?
yeah
it's a lib
not a plugin
None of your reflection based code will work from 1.8 to 1.20.6
^^
You'll be doing modules but now with reflection, the worst of both worlds
hm
having modules will make updating to future versions a lot easier because theres a hell of a lot of breaking nms changes soon
I'll use modules then
how do i turn text to an image
what kind of image?
just an image
always mfnalex the goat
https://paste.md-5.net/ewabibexip.bash
How can i solve this?
I'm trying to delete a world but when restarting or every 5 min when trying to save the world (the server itself)
that error is happening
you didn;t unload the world first
yeah
theres a BigInt constructor to go from a string
yh ik
is the best way to filter out fake whitespaces is rendering the unicode then checking if the image is empty?
(i have a dataset of all unicodes in images ranging from 0 to 60k so it'll be fast)
if there is an async task running, will spigot wait for it to end before disabling the plugin on server shutdown?
basically a scheduler.runTaskAsynchronously on onDisable
all your tasks get cancelled when the plugin gets disabled
i believe if you use a Thread it doesn't
^
well i mean you gotta block it
yeah
a la joining it
then runTaskAsynchronously is not the best option for database insertions?
why would you want to access a database if the plugin gets disabled
bc im starting the task on the insert method
and i would have to refactor all insertions
to use a task every time, except onDisable
Refactor time
you can opt for a normal java thread or just refractor
i guess ill use a java thread
should i start a new one on each insertion? should i reuse the same with a queue?
depends
im not a java developer outside of minecraft
please use a completable future or smth then (if you intend to use it async too), if youre only planning to block the thread use an executor service
and im using kotlin btw, not java
no please dont start a new thread every time
look into coroutines
those are lightweight tasks that run in parallel or smth
uhhh
i dont know enough of them
goksi probably does
@hazy parrot help me here mate
i did
that's my method to delete the world
public static void delete(File file) {
if (file.isDirectory()) {
File[] files = file.listFiles();
if (files == null)
return;
for (File child : files) {
delete(child);
}
}
file.delete();
}```
cant u just delete the directory directly
yeah
yea probably
you love your C# huh
however i don't think that would solve the problem
still do it, also whats ur problem
.
i believe bukkit has a list of worlds during runtime
one sec
look in RestartCommand.class
and look at how it's saving, there might be something that you missed
RestartCommand?
Just join coroutine on disable
Literally same as with java thread(if daemon thread )
You program will not wait for coroutine to finish
in your exception it says the problem is from RestartCommand
that's a spigot class
then its not the best option for database connections
let me chekc
what should i use instead?
You generally shouldn't call async operations on disable
No reason for it to be async
^^
As program will shutdown anyway
Run the database query sync in on disable
I'm sorry, how can i look into that class? 😅
ok, but then you could create a race condition in case the db operation takes too long
uuuh
even if it wasnt called from onDisable, the server could shutdown before the operation is completely done, right?
I don't have buildtools installed
No, your program will not finish unless the operation is done (or an exception is thrown)
oh
then it will always wait for coroutines, except when calling onDisable?
i dont get it
MinecraftServer*
do i need to use nms for removing it from levels?
no
yes
At least I believe so
I mean, i think that using unloadWorld should work but not sure now
then, how can i make sure no db operations will be cancelled
you got 2 options, first one is to remove it when the server isn't running (safest) and the second one is to remove it using reflection
this is the field with the levels (worlds) private Map<ResourceKey<Level>, ServerLevel> levels; in Server.class
but they said the server wont wait, idk why
but it makes sense, ill do that
wait i fucked up
ok cool ill do that
As I said, call join() on Job
Do you mean removing the world in the onDIsable method?
ok
is MinecraftServer in the Server tree
I mean, i guess?
I believe the file lock can still remain after unload
ooh that's true
you can't delete session.lock if the server is running right?
and uid.dat
delete the world
why
it's directory
do you NEED to do it while the server is online
because i'm creating a tempworld for a game
not really
just delete the world so it doesn't create 100 worlds yk
then delete it when the server stops
yea yea
or create one world
or like 10 worlds
and change the loaded chunks to change the current minigame
I was deleting the world when the match ended
hmmm
you can create a new world for each minigame
i'll have to look into it
I'm doing that
and making an array list of the placed block it's not the best way i believe
i'm looking how to do that wait a second
do that
no
dawg
what do u think happens internally when u reput a chunk
???
uh yea
because i'll be saving those changes in a hashmap
make it reload all maps in onEnable
Just disable the map saving?
u can do that?
but there can be more than one map every time the server is on
but if I just have one world i'll need to change the blocks so it doesn't break
its that posible to do if the server is crashing
how big is the map
or that
i'm doing that already
Then if it crashes the blocks will be gone
but if I unload the chunks and then load the chunks again will it restore?
that's a great point actually
no, autosave saves to disk
the computer memory of the world is not the thing that needs to be saved its updated in real time
there is some level of chunks being cached before the IO barrier iirc
Sounds like a #help-server issue
mb thanks
Please give me some ideas for plugin? I'm begginer and want something hard but not too hard
I want to make a system or so
Backpack
Ok, cool, what it does?
It is item in hand that gives you more space? or?
Try to do a toggle inventory on right click or something
I did diabetes plugin, for my gf whos suffer from diabetes type2, did it nice 🙂 with insulin injectors, sugar falls, sickness
Not that begginer.. I'm coding for some months, can do hard things
You asked what does it do
Oh, I missunderstood you
No worries haha
Give me something harder pleasee
Ask gpt or something haha
How about a bot which generates ideas so we dont have to
how could i basically check if a player threw a snowball and give that ball back to them
He gives me bad ideas
Tbh I have some ideas in hand
i got java.lang.NoClassDefFoundError: kotlin/coroutines/jvm/internal/SuspendLambda while disabling the plugin
this is basically the db code
object Database {
val job = Job()
val coroutineScope = CoroutineScope(Dispatchers.IO + job)
fun insert(stuff) {
coroutineScope.launch {
// db insertion
}
}
fun waitToComplete() {
runBlocking {
job.complete()
job.join()
}
}
}
then i call waitToComplete from onDisable
i have this but if i do event.getEntity().getShooter() idk what to do with that
Projectile launchevent
are you all coding in kotlin?
How tf to use projectile, I searched the whole internet
No
Some here do, most that I’ve seen do not
how do i check if everyone is a spectator in a world except for one person
i assume 2 for loops
i got it dw sorry lol
Make sure to provide all the kotlin classes at runtime
yea but it seems like it was trying to cancel the coroutine? instead of waiting for it
and idk what else do i have to do besides adding implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1") to the dependencies section
what dou you mean loading it
this is the entire build.gradle.kts
plugins {
kotlin("jvm") version "2.0.0-RC3"
kotlin("plugin.serialization") version "2.0.0-RC3"
id("com.github.johnrengelman.shadow") version "8.1.1"
}
version = "0.1.0-SNAPSHOT"
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
tasks.jar {
from()
}
tasks.shadowJar {
exec {
commandLine("./scripts/pre.sh")
}
archiveFileName.set("${project.name}-${project.version}.jar")
doLast {
exec {
commandLine("./scripts/post.sh")
}
}
}
repositories {
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots")
maven("https://jitpack.io")
maven("https://maven.enginehub.org/repo")
maven("https://repo.codemc.io/repository/maven-public/")
maven("https://repo.onarandombox.com/content/groups/public")
}
dependencies {
implementation(kotlin("stdlib"))
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.0-RC")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.0-RC")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
implementation("org.jetbrains.exposed:exposed-core:0.50.1")
implementation("org.jetbrains.exposed:exposed-jdbc:0.50.1")
implementation("org.jetbrains.exposed:exposed-java-time:0.50.1")
compileOnly("org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT")
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1")
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT")
compileOnly("org.maxgamer:QuickShop:5.1.2.5-SNAPSHOT")
compileOnly("com.github.Zrips:Jobs:5.2.2.3")
}
Code that doesn't exist cannot run
So it needs to be provided
Looking at that build file you're most likely shading
yea, and the shadow plugin handles that, right?
You aren't relocating though
Which is recommended to prevent conflicts with other plugins
what is that, why do i need to do that, and how do i do that
mmm so if i make two plugins like that, without realocating
they will conflict with each other
?
When a class is loaded twice from two different jars the jvm won't know what to do
To prevent this you relocate the dependency (change the package) to be inside of your plugins package
Making it unique
It can happen
Maven the best
Also you should look in to switching to a shadowjar fork
ok, ill check that, that error happened just once tho
seems like a race condition
i guess i can do jar tf plugin.jar to check if there is that class?
Since the original shadow isn't going to be maintained anymore
SuspendLambda
Yes
ill look into it, didint know that, thanks
But still do relocate
kotlin/coroutines/jvm/internal/RestrictedSuspendLambda.class
kotlin/coroutines/jvm/internal/SuspendLambda.class
the class is being added so
idk
Relocate and try again
seems like some builds just fail for some reason, it already happened before i think
If it doesn't help send the entire stacktrace
this is completely irrelevant but I highly reccomend using bukkit's library loader for kotlin
it'll reduce your jar size and will just make life easier with not needing to relocate and all
if you use bukkit's library loader ensure you switch implementation to compileOnly
how do I fix this
name: SkyblockPlugin
version: 1.0
main: com.EdwardNewgate.skyblock.SkyblockPlugin
api-version: 1.16
description: A plugin version made by Edward_Newgate2 for AsteriaX skyblock.
author: EdwardNewgate
commands:
frobot:
description: FarmRobot commands
usage: /<command> <give|reload>
aliases: [farmrobot]
from?
Supposed to be, yea.
what do I do to fix
src should have all the folders?
Yes, the project structure should follow this
/src/main/java
/src/main/resources
properly init project with gradle/maven
damn fr, ily guys
C:\Users\Anamol_Gamer\Documents\skyblockplugin\src\main\java\com\EdwardNewgate\skyblock\SkyblockPlugin.java:9:55
java: constructor CropReplantListener in class com.EdwardNewgate.skyblock.CropReplantListener cannot be applied to given types;
required: com.EdwardNewgate.skyblock.SkyblockPlugin
found: no arguments
reason: actual and formal argument lists differ in length
how I fix this
Sounds like you forgot to pass in your arguments.
how can I fix, please help
Show code
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.
Yea, there it is.
what do I put/fix there
You put what the constructor wants. 🤔
he know what to put in FarmRobotCommand but not that listener
Lmao check his bio
💀
oh no 💀
is proguard easily deobfuscatable ?
don't have much experience obfuscating my code
I have a bukkitrunnable that is teleporting a fallingblock 0.5 blocks in the x direction every 0.5 seconds, however even though the runnable is running exactly every 0.5 seconds (10 ticks), the block moves in chunks at a time (EX: it waits 1 second and moves twice or waits 1.5 seconds and moves 3 times all at once). This isn't due to lag, as there are consistent results every single time and when sending messages to the player they get sent exactly every 10 ticks. When I tried spawning a new fallingblock at the target location every 0.5 seconds, it works perfectly, however, when teleporting, it doesn't work. Here is the code to teleport it:
Location loc = fallingBlock.getLocation().clone();
...and every 10 ticks (BukkitRunnable)...
{
fallingblock.teleport(loc.add(0.5, 0, 0));
}
does anyone know why this happens?
EDIT: A much nicer laid out version can be found here:
https://www.spigotmc.org/threads/teleportation-of-entities-is-inconsistent.648550/
any help is appreciated
Start by not using an external variable for loc. get the location from the ent modify it and teleport. No need to clone.
do it all in your runnable so you know you are not messing with it elsewhere
Hey elgarl!
Hi
Question
public interface Transaction {
void abstractTransaction(Player player, int amount);
void serializeTransaction();
void saveTransaction();
}
exp / other currency conversion, I'm not sure what else to handle with transactions, got ideas?
Wot
why is abstractTransaction a method
Diamond block to cat spawn egg conversion rate
just figuring it out
There are also like 4 different conversions
Haha I'm cooked idk why I'm trying to api it, literally just need 3 functions
you don't need to suffix every method with Transaction, you're already in an appropriately named interface
no idea what the abstract means
I don't even need the interface, I was just being dumb
abstract was literally because I thought I was going to handle different kinds of transactions
(in the interface kek)
Bro Transaction should have only data. Follow https://en.wikipedia.org/wiki/Single-responsibility_principle
Thank you sir
idk what exactly you're going to do, but it appears like your transaction is a service, you could have it serialize the transactions using your method in the interface to the database layer
Question;
Let's say I want to send a plugin message from the proxy, let's say
"%rank% %player% >> Some Message"
I want to wait for the server to respond with the parsed placeholder API messages. Is this possible?
i.e. Pseudocode:
Bungee
requestFromServers(someText).whenReady((parsedText) -> {
// doStuff
});
dang, alright 😭
I mean you could with some sort of handshake but it would be a pain in the ass
you would need to store the request and in teh incoming channel check for the response
use an identifier to indicate request/response matching
Reactive programming in this case is the best option
once you get a response throw in a consumer you stored
Another question; how do I determine which server the plugin emssage was sent from?
You need to encode that in your byte[]
whats the end goal withi this?
I can't use event.getSocketAddress()?
I mean
If you're already sending byte arrays I figured you might have a packet system
I want to like... send a string over to a specified server for parsing so that it can be parsed with vault/placeholder api.
I'm making a cross-server chat sync plugin and need stuff for ranks and stuff. SO I need to differentiate joins/leaves/server switches/chat messages etc
why not listen from the server's side then send it to the proxy
then the proxy propagates it
instead of pingponging it back and forth
Because I want the plugin to work without plugin messaging as well. SO that chat sync works without ranks too
Plugin is already fully complete for the latter option
Alright I get the gist of what i need to do
Idk how it’s setup or if bungee can tell one time if subserver stuff is installed but you could add config option “use-subserver-listener: false” by default so it knows whether to look for that.

Asked this yesterday but didnt get a response
How would yall allow users to link your plugins funtionalities to other plugins like citizens so they could for example open a specific GUI through an NPC
like bukkit does probably
elaborate
so like an intermediary api?
other way around
i just want to allow users to use other plugins to open funtionalities in my plugin
i know some of them use commands for that
and just open their GUIs on commands
thats what an api is for
but i dont want users to be able to open the GUIs by themselfss
u want me to add 200 apis to my plugin?
you could still use commands
and how would i check if the user executed the command themselves or if it was through an NPC?
why would i make an api. I doubt plugins like citizens are gonna hook into my plugin
let me rephrase the issue
I have a plugin that has guis that need to be opend for some tasks
currently i have chests admins could place to open these guis
but i want to allow the to link the GUI to what ever they please
most versatile option is just a command impl that takes a player arg
alr
Hi everyone, I wanted to know if you know a system to show a player a high resolution image, I managed to do everything with the inventories but it's not high resolution. I saw that somehow it is possible to do it without inserting it into the RP, perhaps with an image URL or in the plugin folder
You mean with a Resource Pack?
"without inserting it into the RP"
what you can do is use Maps
could use an Armorstand or display entities
how?
that would still involve Texture Packs
well, I don't know about display entities as I haven't messed with them yet
Its done by using item displays and then the same method like armorstands give the item display a custom Modeldata and then the custom modeldata a custom texture just like items
would be hard to do high texture with that method
and super laggy
what do you consider "high res" for mc anyway?
1000*1000
should be able to do that with an inventory
You would need like 15 maps for 1920px in witdh so not really much
do you want a screen overlay or world location
doable
Back again with this error, could this be a 1.8.x thing?
I mean the first thing you would test is with a vanilla client
I'm pretty certain it's an issue with the plugin itself
Well, not the entire plugin, just a specific part of the plugin
oh well it's trying to read a packet with too little data in it
You'll have to figure out what exactly is happening
?1.8
Too old! (Click the link to get the exact time)
ok thanks, so should I put the player in spectator mode, lock them inside an armor stand and show the maps?
Yeah, but you'd need to do some picky stuff
Itemframes are locked to the nearest block. You can't put one in the middle of the air
Sadly maps also have limited colors
You can estimate the player's FOV a little bit and wrap the image around the player's field of view, at a certain distance so it looks high res
I don't think the one I saw is a map, because if I go to 3rd person the image remains, perhaps with the titles, but I can't find the image inside the RP
With skin data or how do you mean projection, sounds interesting
Skin data
Perspective not projection but whatever
You know how people make 2d heads?
They're less laggy
Nope i dont know, is there a video or something, that i can look up?
I'm pretty sure what they saw is just a hardcoded imagine in the rp and then font magic
But I don't remember how to open the RP -_-
How to grant permission to player?
Using permissions plugin or pure minecraft?
Pure minecraft
Not even using reflection?
I mean
Yea i have groups etc. defined in the backend. When player join playable server like lobby, prison etc backend provide permission set for this player that match this server
I need to set this permission set to play so if i invoke .hasPermission it will return coresponding output
Oh you mean with code, bro asked "pure minecraft" like without plugins im sorry xd
I can not
Oh yea there is method addAtachment thx
One more question how does this boolean value that is set to PermissionAtachment work?
What is the diffrence if set to true or false?
Yes but if checking hasPermission it is firstly checking if player has this permission and then if it's true or false?
yes
So i can grant player every permission available on the server and then modify this boolean value?
Do your server use luckperms?
No and i will not use it
I wonder if you can save the debug screenshot which saves all textures if you can't open the RP
noxesium and per-pixel rendering. the last one is shitty on the client as it has to render lots of bitmaps at once, which, at a large scale gets really laggy. i'd recommend to stick to noxesium tho
Forge users are crying rn
allows you to render player heads with translatables
:p
i guess one could make a forge port but you'll have to just keep it synced with upstream
nobody really uses forge for 1.20+ anymore tho
Is it a bigger pain in the ass than finding the implementation of something in (craft)bukkits source code
idk
Neoforge
noxcrew writes good code sooo
never heard of that
Forge fork that literally replaced forge
sounds like fabric but worse
It was basically like: forge owner was bad guy, people didn't like him, people took over discord server, forked forge, continued living
i have probably just offended so many people with that statement lmao
Well the idea of fabric is the exact opposite from forge
Fabric: make everything yourself, you only get a few small APIs and everything else needs you to mixin
Forge: We give you an extremely big API so you don't have to change any of the games code, for better mod compat (back in the jar modding days shit basically)
but forge is horrible with a lot of mods, because there is a lot of incompatiblities, imo
what
The only incompatibility in forge I see is optifine
fuck optifine
if the core mod of any forge modpack before 1.16.5 is the incompatibility...
Who the fuck uses core mods
when talking about core mod, I say that optifine is THE mod for any forge modpack before 1.16.5
not after mixins were formally added to forge
Nobody in their mind uses optifine after 1.12.2, and on 1.12.2 and before it was fine
Optifine won't be alive for too long on older versions; people have started to replace it with other mods
yeah
Angelica being one of these replacements
does the InventoryClickEvent not tell me anything about who that player is who clicked
tbh, noone in their right mind would port their mod to 1.20.5
true x) but seems logical to update for 1.20.6
getWhoClicked()
getWhoLetTheDogsOut()
How do I change the title of an inventory while it's open?
doesn't work either. It's really odd whats happening, I have never had something like this happen before.
why are you cloning the location?
o.O
also your issue is most likely due to chunks needing to load
It was just to test, I'm not anymore. also its teleporting them 0.5 blocks in the x direction, in the same chunk as it started in
also nothing else modifies its location
ok well you didn't really give information
thread has a lot more information
https://www.spigotmc.org/threads/teleportation-of-entities-is-inconsistent.648550/
I can also attach a vid to the thread to show whats happening if that helps
teleporting and spawning are two different things and have different priorities
same is even true when a player teleports
not everything that happens in the server happens exactly on time every time
I'm aware, however teleportation should still happen every 10 ticks, no?
occasionally the server will skip ticks
according to what reasoning?
yep, but its consistent results every single time
because they are in a bukkitrunnable happening every 10 ticks? also Ik there is lag, but this is consistent and happens the same way every time, I will attach video
seems you believe you have a problem when there is none
bukkit runnables dictate nothing
they are merely suggestions to the server when they want to run