#help-development
1 messages Ā· Page 707 of 1
ik it doesnt matter too much
Useless boilerplate nobody will ever remember
but still confused on why that part doesnt send
How to make clicking animation when you click at block
declaration: package: org.bukkit.entity, interface: LivingEntity
Is there an easy way to test backwards compatibility other than testing every single version
Test the min version
If it works there it probably works on others
I would test min, max, and maybe like 1.13 or 14
^
alr thx
ngl most of my plugins work on any version above 1.13, and the only change I'd need to make is to change the api-version in the plugin.yml
and your pom xml
I mean there's a flag you can run to allow unsupported java versions for your server Kappa
oh
It's kinda just sittin there right now needing review. I've already pushed the scope of the PR once, not trying to make it extremely massive by redoing everything.
Hey there, I am trying open a sign to the player which is used as a way for them to input information. This code worked in lower versions but now the sign instantly closes due to Player IGN just tried to change non-editable sign(unless the player is really close to the sign). Is there another way to do this that works in newer versions?
Location location1 = location.clone();
location1.setY(base.getHeight() - 3);
Block block = location1.getBlock();
block.setType(Material.OAK_SIGN);
Sign sign = (Sign) block.getState();
sign.line(1, Component.text("Type ^^^^^ Type"));
sign.line(2, Component.text("Set the maximum"));
sign.line(3, Component.text("Delete value"));
sign.setEditable(true);
sign.update();
Bukkit.getScheduler().runTaskLater(Main.plugin, () -> plr.openSign(sign), 5);
Mojang changed how signs work
this is now intended vanilla behavior
yes... but is there a way for it to not do that? Or another alternative to have editable signs that dont close?
uhh okay....
I want to kill myself now
kotling
it's so weird that in forEach I can give the "element" a name, e.g.
something.forEach { element ->
but with all { I cannot & have to use this@all instead
and many things are hidden in some extension methods that are lying around at random places instead of inside the class where they should belong to
kotlin moment
you also never really know what type something has unless explicitly specified - who knew that e.g. tasks.register<MyTask> returns a TaskProvider<MyTask> instead of a MyTask, while tasks.withType<MyTask> does return a MyTask and not a TaskProvider<MyTask>
i mean kotlin is cool and all, and it has its use cases but some features like extension methods are a design nightmare
yeah extension methods are horrible
they make sense for foreign classes, but why the hell is org.gradle.kotlin.dsl.register an extension method and not directly added to TaskContainer? I mean, both were written by the gradle guys
why do they add extension methods to their own classes instead of adding them directly to the class?
Hey I am making a plugin backwards compatible how do I get around this error?
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError
What does even happen if I have an extension method with the same signature as a method declared in that class
compile with java 1.8
Compile it with/for java 8
-source and -target
alright but wouldnt this prevent it being used for newer versions?
hello daddy smile
i know a woman who became a grandmother with 36
where do you get your java versions? I'm trying to get java 17 and then some, but every "legacy" download from the oracle website requires witchcraft and logging into something
(windows)
OpenJDK
can I have the link?
ty š
brew
How to make a player's compass spin as if he was in the nether?
i think thats a client side effect from being in the nether
that would make sense
Just set the compass target to a dummy world
oo someone's doing hacky business
yeah it might be client side
shitty fix: make a scheduler that constantly switches the target
compass behavior is 9/10 times just a client-sided mess
which is probably why compasses work on menus and other player's hands
TaskContainer is written in Java isn't it, register adds dsl based on the reified type; you can't do that in java
thats specified in docs of kotlin
it is simply good to make extensions functions instead of adding another methods to your class
and intellij will just help you lol
no it isn't
no reason to make something an extension method if it can be in the class
no reason to make something an extension method if it can be in the class
yes and?
and this doesn't apply to your class
well second link does lol
This will help you clearly show to the reader what is the core functionality and what isn't.
That's so ass-backwards, wat
That completely breaks OOP principles
So they use extension methods because they miss proper access modifers. Great.
who cares of OOP
Preferably an OOP language would
yeah but android apps tho
but OOP language can handle functional programming
It's still an OOP language
no, it just removes complexity from your class itself
and what, clojure is OOP language too
I should be able to see what a class can do by looking at it
so you look at it
I'm tired of all these kotlin supremacists saying kotlin is better because it does something slightly different to java
Not if the extension methods are defined elsewhere I can't
extension functions are made to interact with the class easier
even though java does it because it's specifically engineered to be boilerplate and all strict about oop
java isnt strict OOP
sure static is a thing
As far as I'm concerned, this is an extension function:
public static R extension(T input, ...)```
If you're accessing a class' internal data from an extension function, you're doing it wrong. Breaking encapsulation principles, single responsibility principles, etc.
This is no better than C++'s friendship concept
no, thats a method
thats not a function
Kotlin will compile it down to that because extension functions don't exist in the JVM
thats a functional interface which implements type for lambda
They compile to static utility methods
i thought extension methods just compiled from "cool guy".print(); to ExtensionClass.print("cool guy");
That's correct
Therefore this applies ^
however, you can say that none languages is OOP becuz they all just end up as assembly
Kotlin just makes it look pretty (which I sort of refute tbh, it's more confusing than anything), but if you're going to argue something at least know what you're talking about
what if we use kotlin/native then, no java
and it was like 11% smaller or somn
kotlin isnt jvm only language
Then it's not compiled to bytecode but my same point remains. I compared it to C++'s friendship
Which is also pretty ass
Does anyone have any samples of Multi-release jars that are built via gradle?
Despite already having two samples (one even being from another project of mine) Javac really doesn't want to compile correctly
C++ only friendship is C tho
what
multi version?
what you strugglin with
C doesn't even have classes
multi release as submodules each get their own jar or its compiled to fat jar with all submodules
choco are you a java developer
prob multi jdk version
no, he has a girlfriend
shit
lol
Basically my Java 9 source set doesn't have the dependencies.
I was able to hack it in (although I usually shouldn't) but then javac will fail to resolve classes from the Java 8 source set
When can OfflinePlayer#getName return null?
So basically dependencies are all fucked up
when player isnt cached
Multi-release jars. I'm doing what is written on the tin
MRJs as multi-module makes no sense at all
so a weird multi project gradle, like architectury but for versions? thats gonna be painful asf
Could you be more specific?
Cached by the server, as in the server hasn't loaded them into one or as in, the player.dat file doesn't exist?
I won't explain MRJs to you, it isn't what you think
Mac OS Runtime for Java?
when name is unknown to server
eg. player haven't joined before if its offline
thats what i could find
Ah ok, thanks. :D
Multi-release jars are those fancy META-INF/versions/<X>/ directories you can find in some jars from time to time
eh???
Under maven it is dead easy. Under gradle it should generally only need a plugin (or you can do it yourself). But this time it seems to not like me
oh you mean you want multiple versions of your app/library inside the app/library, but... why?
No, I want to target multiple versions of java
But as I said, you don't understand the idea behind MRJ
why?
i thought multi version stuff is by just being like function -> version switch -> correct nms call
module-info mostly.
And someone else wants me to support Java 5
ah, a company moment lmao
grr 3d math fucks with my head
Right now I am "only" at Java 6 though, but using Maven
however have fun rewritting your app for java versions lol
To support Java 5 I need to use Gradle though, but it seems to not like my MRJ setup
I don't need to rewrite anything
Java 5?!?!
Since it was written for Java 8 originally. The Java 6 port came very early in the lifecycle.
The only worrying change is that I'd need to get rid of a lot of @Override
Modded minecraft or something.
I don't understand either
i dont understand why would you use anything below java 11 or even java 17 but here we go
Well Java 8 is a hard maximum for me since I cannot really expect the average joe to be able to install Java 17+
thats just an .exe file
Plus that means I need to cross-compile C/C++/whatever executables
if you cant install java you cant install any apps, how the hell can you even use computer???
Or a simple apt install openjdk-17-jdk
not even that
If people were to only use linux there would be no problem
I'd be able to use a bash script (hashbang ā„ļø ) to write the bootstrap in that case
However for Windows I cannot use hashbangs and thus not replace a .exe with a bash script. Thus I'd need to cross-compile
i can download a .deb file of jdk 17 and just install it like .exe
wsl:
git bash:
I'm talking about consumer software, not server software. I wish it'd be that easy lmao
who knows how to create your own api and how to do it right? I know that interfaces are needed there, but I donāt know where they should be used in api. And also how to make api online access for other plugins
interfaces arent required in an api
but bukkit api have
yes because bukkit doesnt contain the impl
basic java knowledge required here
i wouldn't call designing api basic knowledge
I just haven't done api yet
In fact, designing APIs is one of the hardest tasks out there
oh demm
Well if you want to do it correctly that is
it is not like i sit hours on end designing apis
https://github.com/The-Epic/BetterItemConfig/tree/master/src/main/java/me/epic/betteritemconfig/handlers heres an example of an api, it uses interfaces so it can have custom impl by end user, but also directly has implementation
i should update that lib
well, this is how it serves as an interface for CraftBukkit api
i mean api is made for outside user of app to interact with the app by libraries
thf
thats how plugins and mods works, they all are just libraries interacting with api
the point is to make the api usuable to end user of it
wat
Was trying to decipher this as well. I think he means the end user needs a user interface to interact with an api.
*SHE
That is still not how it works
api is user interface to interact with app
Don't be hard on him, they are german. We don't have something like that here
Which imo is a shame
Yeah but UI is the purest of frontend stuff. And API is the purest of backend stuff
women dont exist in germany
tru
is there any other video. It's just that when I tried to find a tutorial on creating an api, I constantly came up in the search engine "how create Rast API with spring etc
yeah
rest api with spring lmao classic one
api is something tht you need to look at other apis implementation and just find the best way to make it for your own app lol
Using a neutral 'he' is grammatically correct for neutral references
and Rast API is great way to make your first api
i think
they is grammatically correct for neutral references in english (for people)
I mean an api can be on many different levels, for instance every class u write with its set of functions is an api of how that class wants it data managed to some degree
Ok i need to look that up...
Yeah they/them
There are important corrections to this video. Visit here: https://www.tomscott.com/gender-neutral-pronouns/ or pull down the description to read them. Original description: Grammatical gender is a silly concept. So I'm about to go against my vow of descriptivism, and risk being run over by the Linguistic Mafia's bus, and say this: it's a silly ...
love a good tom scott video
But in general, api is like a full-fledged plugin or will it not start without using it by other plugins?
no ilmir
first you need to know what is API... https://en.wikipedia.org/wiki/API
An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build or use such a connection or interface is called an API specification. A computer system that m...
The api is the set of functionalities your plugin provides to some api consumer
how those functionalities work and are implemented is implementation
what they do, thats the api
and it is purely interfaces means or an abstract class yes?
no
aaaaaaaa
But usually in java we use interfaces to design apis since they are the right tool to avoid writing implementation code/concrete code
This... doesnt explain it enogh for me
I think a good api or well just interface is a keyboard
You know what it does, for example when you press Enter
But you donāt know how it works under the hood
he is male, she is female
they is someone
I imagined api in this way: There is a plugin with its implementation (Realization) as well as interfaces to it and abstract classes (API)
they is neutral, both singular and plural
in the context of spigot plugins yes
hah?
Realization is probably a misleading term though
now imagine api as interface that other app and library can use to access your app/library
interface not as data type in a language
as I was told before, the remote is an api, and the TV with all the logic is the implementation
You dont say. But i was under the impression that there is also a neutral he. For example in the sentence
"Each student should save his questions until the end."
Wouldnt that mean the word 'student' is male while the actual persons gender is unknown?
Youāre just circle referencing the word interface, try to phrase it w/o using the word interface
Thats correct
Although its not really an api
that sentence is incorrect
Each student should save their questions until the end
his isnt neutral gender
Words in english don't really have a gender
germans when they realize that words can have no gender
Ah makes sense. Ugh thats my germanic roots. Here a chair is male, the glass is neutral and a clock is female.
looks at polish
so I need to first write the implementation of the plugin and then shove everything into the interfaces?
im gonna circle around it becuz i want them to understand what API actually is
to hide the logicš
make interfaces of how you'd like the logic to flow
Its a pretty bad way of explaining something, to circle the definition that is
So you don't fall into too much tech debt
And once you actually understand how it'll flow, you're free to write impls
api = application programming interface
An interface for an application which can be accessed through programming
Try to phrase it w/o using the word interface tho
an interface is just a class template let's be honest
not in this context
More or less yes
An API is like a gateway that allows programs to interact with and utilize the functionality of an application. /j
This sounds correct
(chatgpt wrote it btw)
then api is just a class with get and set
hahaa
Ilmir you can think of a java interface as a type/class/structure that just specifies/promises a functionality/behavior, when we write code against a java interface we donāt know how it will work, just what it does
if you introduce
the interface as with something already ready, then it already looks like an api
Myeah
I mean to some degree its not wrong to say normal classes are apis as well against their own instance variables and such
But thatās a very low level api perspective
public methods of a class are interfaces to the logic of the class
Myea
Okay I think it's just that the multi-release-plugin I've been using simply does not support module-infos.
PAIN

very informative video about this, you can only watch it in Russian https://www.youtube.com/watch?v=qYJX_1uMKb0
ŠŠ“Š°ŃŠ¾Š²Š° ŠæŠ°ŃŠ°Š½Ń. Š ŃŃŃ Ń Š½Š°Ń Š½Š¾Š²ŃŠ¹ Š²ŠøŠ“Š¾ŃŠøŠŗ по ŠøŠ½ŃеŃŃŠµŠ¹Ńам ŠæŠ¾Š“ŃŠµŃ ал.
Š”ŃŃŠ»ŠŗŠ° на гŃŃŠæŠæŃ: https://vk.com/extremecodetv
Š”ŠæŠ¾Š½ŃŠ¾Ń: http://deadline.name/
P.S. ŠŃли Ń Š³Š¾Š²Š¾ŃŃ ŃŠ»ŠøŃком бŃŃŃŃŠ¾ ŠæŃŠ¾ŃŃŠ¾ поŃŃŠ°Š²ŃŃŠµ ŃŠŗŠ¾ŃоŃŃŃ Š²Š¾ŃŠæŃŠ¾ŠøŠ·Š²ŠµŠ“ŠµŠ½ŠøŃ ŠæŠ¾Š½ŠøŠ¶Šµ.
use subtrits
Or well I mean I could probably hack the system because this is gradle babyyyyy
I always watch my vids in russian
rus?
i am making api because of this problem
this is not a complete structure
if I open it does not fit in the screen
in larger projects you will usually end up coding layers of api
module apis, system apis, and so on
really
Im 28 yo and on discord... Pretty sure that answers it
I already felt it myself
what would be the better-ish way to store pdc in yaml thats human editable
lol
Docagi shto viuchil
what is the worse/current way?
what the best way for doing a chat filtering system? Is better to do it via regex - Thanks
i think its fine if u just compile the regex
phonetic filtering
raight. thanks for both of you
currently janking it to strings im pretty sure
i cant understand half of what i wrote for it
thats whats currently in it
i know its so fuckin bad
okay, I think to write my own api ranks, I'm too lazy to advise which realties on 1.20.1š
i cant decide if i go with a spigots serialization or i write an snbt impl which i really dont want to do
yeah
how can I see from what name sound X has changed from version Y to version Z? For example, the sound NOTE_PLING changed to BLOCK_NOTE_PLING in one version, and then to BLOCK_NOTE_BLOCK_PLING. But for some sounds, the change isn't as obvious to manually assign. What I want to do is to support sounds across multiple versions
current V snbt
bruh pls no
u're trolling if u dont wna use luckperms I would say
I need a simple
unless u're doing some very specific stuff
i think i have to go with current format to make this do its job
luckperms casually being a 120k line menace
luckperms is simple, it even has an api if you want to do it all from ur plugin
true
its not
so idk true or not
that someone is trolling you
lol
can i access a package private class through reflection
or does anyone have a file already made with all the changes? :)
XSeries
well, I escaped the ranks, but I will have to write the cases myself
thank you, I think I found it ;D
bruh what the
lol maybe viruc check
oh its git bash terminal
will see normal pc terminal, maybe its bug the git one
yeah, its git bash terminal bug
why does Bukkit.broadcast(msg, permission) not log in theconsole
How do I only shade de.tr7zw.nbtapi and nothing else? With this current pom it shades protocolib and that causes an error
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>shade</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<outputDirectory>I:\Test server 1.8\plugins</outputDirectory>
<relocations>
<relocation>
<pattern>de.tr7zw.nbtapi</pattern>
<shadedPattern>dev.blackgate.NBTApi</shadedPattern>
</relocation>
</relocations>
<minimizeJar>false</minimizeJar>
</configuration>
</plugin>
</plugins>
</build>
use scope provided in the dependencies you don't wanna shade in
the default is compile
pretty sure that nbt api package is the wrong one too
the dev.blackgate?
no the pattern
well arent you supposed to change it?
relocation changes that
ic
why does Bukkit.broadcast(msg, permission) not log in theconsole
it probably only loops players
Broadcast is for sending to players not console. Use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Bukkit.html#getLogger()
declaration: package: org.bukkit, class: Bukkit
Alternatively if you want to log every time a broadcast happens listen to https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/server/BroadcastMessageEvent.html
declaration: package: org.bukkit.event.server, class: BroadcastMessageEvent
F
Ultra battery saving is my savior rn
How to create custom block?
yeah but
Bukkit.broadcast(msg)
sends to console
am i correct in saying calling a Class.forName on "org.bukkit.craftbukkit.inventory.CraftItemMeta$SerializableMeta" would give me the SerializableMeta class
or is there a specific way to get a declared sub class from a Class<?>
what does it mean
Corrupted jar
You replaced the jar while the server was running
Something is closing the classloader then
change this will actually work https://paste.epicebic.xyz/esezuhafim.typescript, im giving it like a 1
If the plugin tries to update itself that could cause it - otherwise you may try to load classes on a plugin that is already disabled but that is rather unlikely
i do that all the time why doesnt it err out on me then
If you don't do Windows that would be the obvious cause
im on windows so eh
Otherwise it may also be possible that you are not loading additional classes after replacing the jar
legacy versions š
nbt api is for something entirely different
oh right
i could use it for pdc, but i use it for base potion effects
nice, can be used for particles?
no clue
i mean, not sure right?
yhea
Yep. These are created by inner classes
In general, then I have no idea what is wrong, I do everything as before.
other plugins work fine, but why this one does not work now is not clear.
At worst fork me over that jar and I can take a quick look for any obvious explainations
?whereami
Jesus
It gets more complicated the more you think about it
Is here fine to ask about vector math?
Considering the types of questions I personally ask here, yes.
lright, so I have a set of three vectors - pivot, start, end - and i need some way to get the shortest path between those points. The problem is that i dont need a straight line, but the shortest path along a sphere (with the pivot being the center of the sphere and the start/end on it's surface)
Additionally, I have a double representing the distance i want to set the vector points to mark that path, so that it appears continuous when represented with particles.
I know that i can figure out the plane in which that radial path moves can be determined by just taking the cross of the start-pivot and end-pivot vector, but I do not know how to do that rotation or determine the value for it
a*?
probably there's a math way to get it done true
You drawing arcs or what?
yes
You want a bezier curve or what
its just cos/sin and rotation
wouldn't it be so bad to store player data in 2 files? 1)player-RankName 2)player-blockCount
Or is it a database?
i mean, the option would be nice, but what I'm going for here is drawing circlce segments in 3d space
Canāt you do just player uuid
No
uuid - int
it infact did not work
Yeah bezier works in 3d
I have 2 different plugins
Do like blahblah.yml or .json depending on how you are managing stuff
Then you could add a sufix or just put them in dif folders
Man doesn't know how to communicate between 2 ploogin
i want save player: rank / player: blockCount
Canāt you do that in the same file
Or a database
i do rank api
reflection confuses me
Why
just does
so i need save and not depend entirely on 2 plugins
Reflection is ezpz
I donāt know what you are trying to do
how do i access a package private class with it then
But it sounds like you could use files or database
š¤Æ
Canāt you access the class and set it accessable
Then do like .createInstance
readable
i have an instance of it from ItemMeta but i need to access its Craft class to do pdc jank
class also doesnt have a setAccessable
Oh
shit
did that earlier
Then yeah just work with it directly
calling Class.forName on it throws a ClassNotFoundEx
Heck yeah. Finally fixed my multi-release-jar build.
It's inefficent beyond belief but it's gradle so who cares about performance anyways?
conclube you lied, i cannot access a package private class through Class.forname
this one yours?
you're probably looking at setting the constructor accessible
i dont need to use a constructor though
i have an instance i just need the class to cast it and access a field
then why not meta.getClass?
would what actually give me CraftItemMeta
it'll give you the top
but you can go lower if you need to
by using getSuperClass
or something similar
i don't know the exact name
getItemMeta().getClass().getSuperclass()
yes
java.io.IOException: An established connection was aborted by the software in your host machine
at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[?:?]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:46) ~[?:?]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:330) ~[?:?]
at sun.nio.ch.IOUtil.read(IOUtil.java:284) ~[?:?]
at sun.nio.ch.IOUtil.read(IOUtil.java:259) ~[?:?]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:417) ~[?:?]
at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:258) ~[netty-buffer-4.1.82.Final.jar:4.1.82.Final]
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132) ~[netty-buffer-4.1.82.Final.jar:4.1.82.Final]
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:357) ~[netty-transport-4.1.82.Final.jar:4.1.82.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151) ~[netty-transport-4.1.82.Final.jar:4.1.82.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[netty-transport-4.1.82.Final.jar:4.1.82.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[netty-transport-4.1.82.Final.jar:4.1.82.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[netty-transport-4.1.82.Final.jar:4.1.82.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[netty-transport-4.1.82.Final.jar:4.1.82.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.82.Final.jar:4.1.82.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.82.Final.jar:4.1.82.Final]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
I swear i didnt do anything
is there a reflection way to get a sub class
hmm
i see this
but it will confuse you more
i just recommend using class for name
can you tell me the path of the class you're trying?
maybe i get a better picture of what you're trying to do
version specific org.bukkit.craftbukkit.v1_20_R1.inventory.CraftItemMeta$SerializableMeta
i need to access the persistentDataContainer field in craft item meta to use it to serialize and i need to access the subclass to deserialize
it's CraftMetaItem
im fucking dumb
well, let's hope this is it
really?
i did lie then, sowwy
turns out i was doing a dumb
oh
i had ItemMeta not MetaItem
ah
well i would have trusted u if u told me i lied since i havent touched reflection for ages
i can tell you you lied to me if that makes you feel any better
i feel better now, thanks emily :3

can anyone explain this netty error?
seemed to be connected to players leaving the server
When transferring servers anyone know what causes the loading terrain screen to appear
can someone use there eyes for me, is my spelling right
dark purple
looks fine
i mean in reality you don't need to separate the getServerVersion
just
Bukkit.getServer().getClass().getPackageName()
then concat the rest
oh true
ill do that once ive got it working to start with
i dont get how it cant find it
the spelling is right
peristence
it did before
^
loving the fact my jar refuses to update now
Anyone know how to send fake chunk packets to players using ProtocolLib, with 1.20.1?
Chunk packets are pain
or without protocollib
you probably wanna get a chunk while it's being sent and edit it
but i never worked with them so i can't help you further
how to track custom block in chunk?
i need to send the packet, not edit it
what in the frook
then same thing, only you need to send the whole thing yourself
the jar on the server has perisistence in the decompile but its still peristence
wtf
but i'm sure there are other things to account for
did you switch versions in your modules?
i had the same issue myself once
i forgot to switch it in 1 place
the shaded thing uses persistence, but the end code is still trying peris
i did but protocollib is broken
xd
you need sleep that's for sure
// ....
chunkPacket.getLevelChunkData().write(0, WrappedLevelChunkData.ChunkData.fromValues(nbt, buffer, new ArrayList<>()));
protocolManager.sendServerPacket(player, chunkPacket);
this should send an empty chunk, the IDE shows no errors, and it also compiles.
but when i run the function i get:
java.lang.IllegalArgumentException: handle (com.comphenix.protocol.wrappers.WrappedLevelChunkData$ChunkData[handle=net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData@52daa9b3]) is not a class net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData, but class com.comphenix.protocol.wrappers.WrappedLevelChunkData$ChunkData
at com.comphenix.protocol.wrappers.AbstractWrapper.setHandle(AbstractWrapper.java:31) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.wrappers.WrappedLevelChunkData$ChunkData.<init>(WrappedLevelChunkData.java:62) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.wrappers.WrappedLevelChunkData$ChunkData.fromValues(WrappedLevelChunkData.java:142) ~[ProtocolLib.jar:?]
at "chunkPacket.getLevelChunkData().write(0, WrappedLevelChunkData.ChunkData."
thats a job for future me
How to save that certain block in chunk is custom block, using pdc?
i don't know exactly how protocollib works
?
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
When you change servers the client thinks you are changing worlds
So the screen appears
But i need to use chunk pdc
but chunks hold their data in blocks
use custom block data
No
Chunks hold their data in themselves
Block pdc makes use of the chunk to attach data to a block
i don't like to use independent libraries..
why
So would there be any way to bypass that
i would much rather use a premade lib that has probably accounted for edge cases rather than making my own impl that misses 24 edge cases and doesnt work properly
hmm because i'm doing every task like "workout for the brain" and i would like to do everything by myself...
check the internals of it then
Iām not sure if intercepting the world change packet and changing the id would cause weird client side stufff
oh ok thx!
but yeah, you're right it's the most logical option
I assume there is a reason bungee forces a world change
Maybe on join for a server sends a world change
And itās not even bungeeās doing
Iām gonna dig through spigot and client code when Iām home
I mean the alternative is changing everything while the player can still see
Which would look⦠interesting
wait tho, the chunk holds the blocks and the block holds the block data, or am i wrong?
Or unloading the chunks
i haven't looked into what chunks do
ohh
Like loading all chunks as air
Or maybe that would be a mess with player list and stuff
it made sense to me for blocks to manage their own data
i see
?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/
oh, it makes sense now, like the flyweight pattern, where you don't really wanna create a huge structure
What you know as block data is just a whole new block in the pallet
to save on space
chest[facing=north] and chest[facing=south] are two different blocks
so the data is stored in chunk
The chunk stores which blocks are in it, as well as a bit of extra chunk-specific data
It also stores the data of tile entities as NBT separately from the blocks in the chunk
Here's the chunk format: https://minecraft.fandom.com/wiki/Chunk_format#NBT_structure
Bukkit's Chunk PDC just adds an extra entry into the NBT to store any arbitrary plugin data and Alex's block PDC library takes advantage of that to store an x, y, and z coordinate of a block alongside the associated data
i see
Im trying to do GET Request to MojangAPI to verify if player has a cracked account or not.
If the player payed minecraft returns the ID and the Name, but if not returns this:
{
"path": "/users/profiles/minecraft/DrSimi12381",
"errorMessage": "Couldn't find any profile with name DrSimi12381"
}```
My problem is, when i try to read the response from API, it goes ok when is premium acc but when its not crashes with FileNotFoundException and the link, now my problem is i want to handle this, what can i do?
dont want to crash,
I mean you could catch the exception
Why would request to rest endpoint throw filenotfound lol
Shity Mojang api, whixh doesn't follow Api conventioms and normatives
oh thats covered
when you try to join
even if online mode is false
will kick you out with
"Restart your session"
or smth like that
lemme try now i got the doubt
fun fact, you can differate online and offline accounts by uuid (atleast u could before, not sure if something changed in recent versions)
but just dont support offline š
i thought it was
you need to handle it with headers
the header will give an appropriate response
enable follow redirects in your request
Āæ?
so i tried using BukkitRunnable but you arent allowed to, so i turned it to just a regular Runnable but how do you stop it / cancel it?
You can use bukkit runnable just not how you were
ah how do you use it now
new BukkitRunnable(){}.runTaskX(plugin, etc)
ah ok
I dont remember if anonymous classes have start brackets
ah i see it now
make the runnable like before with the code etc then do .runtask at end
ty
anonymous classes are the ones like
Runtask( task -> {
(Code) }
just to know
that is lambda, not anonymous class
^^
think bukkit runnable takes care of that for you, otherwise if they want to continue with their own they would need to call the start method
this is cause it took too much time?
I mean in the new BukkitRunnable, i dont remember if it has brackets then braces or just braces
You are blocking the PreLoginEvent. Dont do that.
should be PostLogin?
prelogin is fine to block, its the login event that isn't
you can block t he prelogin for like up to a minute
login at most like 20 seconds
this has to do with that prelogin isn't the mc protocol just yet, and is the TCP timeout that applies
Are we on bungeecord?
once you hit the login portion you are now in the MC protocol and it dictates like 20 seconds max with no response
Yes
however generally you shouldn't block if you can help it and instead passively load the data you need
that is maybe put them in a holding area or something
cause, what i want to do in Bungee
is cache the player
verify with MojangAPI
and with the pl db
and then let them into the fallback server
not sure why you need to do that if you are in online mode
if you are trying to do this with offline you are going to have issues with chat and some other things in trying combine online and offline
also, if the player is online you are going to have to track the UUID and change accordingly on the player
but you shouldn't be supporting offline mode at all
the only advantage I can there would be to using such a mixed system is if you have such a large player base that you need to allow players on and wait to be verified because of the API limit from Mojang
but you would need to be a network near as large as hypixel for needing something like that
how do I run methods from a another class in the main class, im used to C# and thought this would work.
I don't know why it doesn't work, I can paste the custom items class
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Look at java naming conventions
please
its not capitlized
it would be customitems.enableDylanItems();
and the "it works" ?
that prints
make sure its the latest version and that you didnt add an old version to the server
(in my case when i compile and the file already exists it doesnt override the old one)
could this big error be the problem
yes
just did that and it spat this out
you can't make new instance of class that extends JavaPlugin
remove extends JavaPlugin
?? well i didn't look at the class
in the customitems class
Yeah he's right
It just needs to be removed from that class
onEnable isn't even in the class he sent
I have zero experience with Java and plugins and so far I've made a weather plugin (with sleet, and tornados), a block logging plugin, a thirst and climate plugin, a rpg plugin, it was all done with chatgpt he also can scan Minecraft 1.20.1 paper api but you need to talk in circles until you trick him a little bit, then he has access to the Internet. You need to be detailed as long as you understand what you want and how to get there (example to walk you put one leg in front of the other) you have to explain in that level of detail in English, and it translates it to Java
Speaking of onenable what's the point of on disable when all it does is cause an error when the server shuts off
But the server says it's illegal to do because the server is already off, it literally denies anything put into the method I've tried
Stuff like saving files is what I've mainly tried
I've never had an issue with it, as long as the server closes normally onDisable should be part of the normal shutdown cycle.
Yeah saving files should be fine
the only thing that won't work is runnables and tasks
Pretty sure one thing I have is a catch exceptions and it throws the errors
Bukkit.getPlayer(uuid)
Does anyone know if the spigot 1.8.8 is source code? If yes, if I modify it and try to use it, will the members enter my game normally as if it were the default spigot?
you can edit the default spigot 1.8.8 code to change behaviour yes
So let's say I want to add support for multiplying action bar in spigot 1.8.8, would I modify the spigot src get the results for everyone?
yes, the server is what everyone is connected to. iām not sure what you are talking about is possible but idrk
Thank you, I think concrete answers would have to come from md_5
spigot is just whatever runs on your server
you can change code all you want but the client needs to be able to still interact with the server correctly
Who knows the player has his own nickname and the visual display of his nickname can be different?
or not
what do you use a nickname for if not to display it
I need to change the rank of a player without affecting his nickname
change the visual but so that when getting player.getName - I didn't get the rank name as well
team and prefix
so I wanted to know is it possible or is his nickname and the visual part of the nickname the same?
getDisplayName is what you are looking for
right, I guess you just mean the username by nickname here
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String label, String[] args) {
if (!sender.hasPermission("serversystem.coords")) {
sender.sendMessage(Errors.getPermissionError());
return true;
}
if (args.length > 1) {
sender.sendMessage(Errors.getSyntaxError(label + " [Player]"));
return true;
}
Player target = Bukkit.getPlayer(args[0]);
if (target == null) {
sender.sendMessage(Errors.getOfflineError());
return true;
}
if (!(sender instanceof Player player)) {
if (args.length == 0) {
sender.sendMessage(Errors.getConsolePlayerError(label + " [Player]"));
return true;
}
handleBroadcastForTarget(sender, target);
return true;
}
if (args.length == 0) {
Bukkit.broadcastMessage(formatColors(ServerSystem.getPluginPrefix() + "&b" + player.getName() + "'s &7coordinates are: &f"
+ "&6X: &f" + (int) player.getLocation().getX() + ", "
+ "&6Y: &f" + (int) player.getLocation().getY() + ", "
+ "&6Z: &f" + (int) player.getLocation().getZ()
));
return true;
}
handleBroadcastForTarget(player, target);
target.sendMessage(formatColors(ServerSystem.getPluginPrefix() + "Your position has been &4broadcasted"
+ (!GlobalHashSetUtils.getVanishedSet().contains(player) ? " &7by &b" + player.getName() : "")
+ "&7."));
return true;
}
private void handleBroadcastForTarget(CommandSender sender, Player target) {
Bukkit.broadcastMessage(formatColors(ServerSystem.getPluginPrefix() + "&b" + target.getName() + "'s &7coordinates are: &f"
+ "&6X: &f" + (int) target.getLocation().getX() + ", "
+ "&6Y: &f" + (int) target.getLocation().getY() + ", "
+ "&6Z: &f" + (int) target.getLocation().getZ()
));
target.sendMessage(ServerSystem.getPluginPrefix() + "Your position has been &4broadcasted &7by an &4administrator&7.");
}
Can someone tell my why in the !(sender instanceofPlayer)-block the args.length checks say that they're always false?
I'm currently in the proccess of refactoring everything to early returns and sometimes it's harder than expected
I'm confused bc I check for args.length > 1. But if that applies it's supposed to return so for the rest of the code args.length should only be able to be <= 1, right???
because with args[0] (at the target check) you are always expecting an argument
so it cant be 0
oh, right
and if it is it will error
Damn okay, different structure it is then. Thank you.
I might be hella late
yeah I figured it out
I have problems with changing relocation, did i do this right?
What problems?
i'm not sure that i did this right because idk what should happen after changing relocation
your output jar should have the shaded library relocated into your package
I'm not sure that this is working
i relocated it to org. ... but it's in com. ...
try newer version of the plugin ?
nothing changed
Which jar are you looking in
Oh wait you're missing a relocation tag
what tag..?
Relocation
is this one right?
?tas
Which jar are you opening?
That was builded by artifact
So you're not even using maven š¤¦āāļø
._.
i closed
Now right side
If you use the jar in the target folder it should work
and how to make it work with artifacts?
You don't
do you mean that i can't do it?
If youāre using maven for your Spigot plugins (which you should do), itās easy to make maven automatically save your pluginās .jar in your plugins folder. Thereās two ways of doing this: 1. The lazy way (not recommended) If you only work alone on one computer, you can just directly declare the output location in...
Many people who are using the maven-shade-plugin commonly set to false for reasons beyond my grasp. This is generally a bad idea, as it can lead to problems if youāre writing a library, and has absolutely no advantages. Hereās a rule of thumbs: If your project shades dependencies, it should create a dependency-reduced-pom.xml. The...
Thanks!
Pretty much
Artifacts isn't maven
And maven isn't artifacts
They are two different build systems
oh
Maven is much better so stick with it
IJ artifacts is Intellij only and requires the IDE
Maven can work is most IDEs or without one
oooh
ok i understand, thanks!
I just started working using tutorials, and did not go into jar file generation much... But now i got it, thanks
If I change a Title for a Inventory with a ClientboundOpenScreenPacket the contents of the Inventory are not rendered only after a InvenoryClickEvent - What must I change in order for it to render the Items
public void updateView(MyObject myObject, int state, boolean isAsync) {
for (HumanEntity viewer : myObject.getInventory().getViewers()) {
try {
Player player = (Player) viewer;
CraftPlayer craftPlayer = (CraftPlayer) player;
AbstractContainerMenu container = craftPlayer.getHandle().containerMenu;
//TODO: Content is not rendered
ClientboundOpenScreenPacket clientboundOpenScreenPacket = new ClientboundOpenScreenPacket(container.containerId, MenuType.GENERIC_3x3, Component.nullToEmpty("§6§l State: " + state));
craftPlayer.getHandle().connection.send(clientboundOpenScreenPacket);
} catch (Exception e) {
DA.log.logException(e, isAsync);
}
}
}
Why not use the api method
Are you using older version of spigot ?
There is an API method for this.
Assuming you are on a modern version
would it be possible to limit a crossbow to a certain custom ammo type?
like if i made special arrows you have to buy from a villager, then certain crossbows can only use that ammo?
Idk if there is some kind of event for crossbow loading
You can cancel the loading using the player interact event tho
i'll check it out
Waht is the name of this method ?
InventoryView#setTitle iirc
THX š§”
Do you guys think 10MB of ram would be enough for a mysql database? There isnt gonna be a lot of querying and the data is simple (<2KB).
And also, can mysql store uuids?
Anyone there?
hi, i want to download spigot to create a pllugin but i dont find any downlaod button for the API file
help me plzzz š
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
If you are a beginner, use the minecraft dev intellij extension for setting up a spigot plugin project
beginner in what ?
whats that ?
Plugin developmnet
ah okay
My advice is the opposite. If you are a beginner DONT use the MC plugin. Learn how to create a plugin from scratch
The MC plugin for InteliJ is ment to remove the mundane tasks in creating plugins once you already know how to do it
You dont need that
?maven
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
BUT WHATS MAVEN
read a tutorial on creating a spigot plugin using maven
maven is a dependency management system
Why all none native english devs, code scoreboards and tablists updsting with shity threads. Instead of using spigot schedule taskings
yeah im doing this but the tutorial is a few old so their link dont work
all none
im confused
what IDE are you using?
visual studio code
what
oh my
Wtf
Visual studio code is more like a text editor to me
Good luck with that
download community edition
scroll down past the one that costs money and download the free one
ah ok but this is the only one free
Use eclipse or intellij idea
They are more optimized for java development
they are ugly
That all spanish speakers devs all code using what i mention using threads rather bukkit scheduler
why tf?
Eclipse is ugly but intellij idea is great
And there are a lot of customization features so you can make them look the way you want
where can i send some screens ?
wha
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
fym screens
!verify
Usage: !verify <forums username>
ohhh
!verify
Usage: !verify <forums username>
!verify Bavouille
Could not find your SpigotMC.org account!
I font know, they just use threads with this:
new Thread(() -> {
while (plugin.isEnabled()) {
getBoards().forEach(Board::update);
Thread.sleep(300L);
}
}).start();```
All spanish dev use that weird thing for updating
Must use tasks, rather threads
š
!verify Bavouille
A private message has been sent to your SpigotMC.org account for verification!
Please stop spamming
he's not
how can i do that ?
You receiced a message yo spigot accou t
Oh you finally do it
now you can paste SS in here
what must i choose ? all the otions are paying
Bump
pretty sure you can just grab the communnity edition and be fine
where is it ?
scroll down lol
Download the community edition
Do you guys think 10MB of ram would be enough for a mysql database? There isnt gonna be a lot of querying and the data is simple (<2KB).
And also, can mysql store uuids?
on the site ?
Yes
ah ok i hadnt understand befor
Someone PLEASE help me with this
u can store uuid as string
yes i think
no idea about the ram requirement
i have 12 and i use mysql
Weird, I'm not sure about SQL. I just use Mongo**
i think its sufficient
Must he trolling
why its impossible ?
Not even Raspberry, they hace 1gb and up
mb?

sorry
GB
its was a mystake haha
I've seen keyboards with more ram
12gb != 12mb
bro got some 1950 nasa computers
i didnt know that it exists some pc which only have 12 mo
yeah yeah i ve understand
have some 4.5 MB
Yeah
I hardly managed to fit a bungee server, skyblock server with 45 plugins, redirecting express.js server, player stats discord webhook and win server 2012 in 4GB of ram and i want to migrate my PDC storage type skills plugin to MySQL so i can create an api for my server so i can have a discord bot so players can view their skills without joining the server
The change in storage over the past several decades is crazy

