#help-development
1 messages ยท Page 390 of 1
but like
ik this is minor
anyone know of a nice abstraction for SQLite or H2 with java I kinda don't like writing SQL xD, and rather not make one myself tbh
this wouldnt benefit much
tje JVM has pre allocated wrapper instances
for ints
which is what I was talking about
the IntegerCache
fix: avoid SQL ๐
iirc, eeeh byte sized ? so -128 to 127
contains Integer instances for the ints
so those are reused
do you know how to do it?
lol please provide local DBs like SQLite that aren't relational
idk
in that case wouldnt accessing the static field be slower than just jvm using the cache
๐ค
I till ask exactly that, why they didnt already create a Mongo local driver, mainly the counter for SQLite
well Mongo has local files they just aren't for production
I guess json ๐คท๐ฝโโ๏ธ lol but I'd prefer a DB for this
No no i mean, something exactly the same as Mongo driver, but not using the remote db
Does MultiBlockChangePacket not exist in 1.16 or 1.7?
depends on a vm property
(VM.getSavedProperty("java.lang.Integer.IntegerCache.high"))
Packets are named diff on newer versions
by skidding hcteams
I mean i do it, because i get lot of usd from less projects
exactly so shush
I mean it happen the next
english?
On newer versions you need to make lot of projects to get the equipvalent from 1.8 plugins
Native lang is spanish, i mean if you talk haha
misclick
this is the reason of why i will not stop coding on 1.8 but also code on newer versions
Thats happen because good 1.8 devs are few, while on newer versions everyone is a dev
basically at 1.19 the gains are on volume, while not for 1.8
So trying to help you with the Packet thing, i would suggest looking it in the new versions protocols
oh you were the guy asking about multi modules
I just remember
are you spanish? Because we have commons spanish friends
wasnt alex german?
Me?
if you mean @tender shard , yes
Well i live on Uruguay
ah
you meaning me or him?
its probably easier to just remember people off their nick instead of username
agree
If 1.7 wasn't a typo, it exists, as net.minecraft.server.v1_7_R4.PacketPlayOutMultiBlockChange. The name never changed and the packet always has been there, for as far back as I can remember developing plugins.
no soy taco
ah thanks
[22:40:04 WARN]: [Casino] Task #8947 for Casino v1.0 generated an exception
java.lang.NoClassDefFoundError: xyz/xenondevs/particle/ParticleBuilder
at dk.banannus.tasks.crateAnimation.lambda$Animation$3(crateAnimation.java:110) ~[?:?]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59) ~[patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:352) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:783) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [patched_1.8.8.jar:git-PaperSpigot-445]
at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.ClassNotFoundException: xyz.xenondevs.particle.ParticleBuilder
at java.net.URLClassLoader.findClass(URLClassLoader.java:445) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:102) ~[patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:87) ~[patched_1.8.8.jar:git-PaperSpigot-445]
at java.lang.ClassLoader.loadClass(ClassLoader.java:587) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
... 8 more
This Warning/Error pops up when i use particleLib, anyone know why?
It worked earlier
And yes it is getting imported
relocate it
How tho?
maven or gradle
?relocations
no command
there never was
are sure?
mhm
Are you on a maven project?
I bought the plug in for async world edit but I just can't seem to find any mention of where to install the other two files they mention
specifically the injector
Yep
Send your pom please, in a paste
Alright give me one sec
?paste if needed
There isnt anything i should hide in it right?
shouldnt be
Don't think so, depends, actually, xD
the scope provided on the particle lib should be compile
I get a overlapping resource doing that
Yeah, the shade plugin isn't shading the dependency because of it's scope. I'd not use the scope to shade tho but rather have an explicit include list, as that can save a lot of headaches with shading unwanted jars.
relocate it then
How does relocations work tho
it changes the path from being something like old.package.name to your.package.whatever
except you dont you need to change imports for it to work
https://paste.md-5.net/jucalomiko.xml
Something like this I guess (I hate build-systems myself, xD)
smh
the package on that would be beter as something like your.package.libs.particle
Lol
or just your.package.particle
This was an example. If the person cares, they can change it.
I like to preserve the original package, just to at least give some credit.
This doesn't seem to work either.
me working with varhandles cuz my code setup is weird :/
oh wait
just to set a field that gson cant set
1 sec
Have you checked the resulting jar? The lib should be in there now.
A missing/malformed exit condition, I guess.
Can you give me a hand?
Uhm, what's the concrete issue?
Its related to my custom file section
I think the issue makes sense i realize, but im not sure the best fix
Im so confused where to find it
That why i dont like depending on 3rd parties libs, this wouldnt happen
By default, there should be a jar containing the -shaded classifier in it's name within the target folder of your project.
For custom enemy NPCS i made an invisible zombie with an NPC that copies it moves etc. for pathfinding and attacking.
Now the thing is that the hitbox of the NPC is overlapping with the zombie's hitbox, which means sometimes i cannot hit the zombie. any way how i could fix this?
video if u dont know what i mean:
Is there a reason to show the zombie to the client at all? You could not even send the spawn packet (I guess some kind of API-level entity hiding should exist), as you only need the entity for tracking purposes.
why tf cant u just copy paste the zombie ai
Is there a possibility to fill only these slots?
The zombie AI is done on NMS
also there should be a 'remove hitbox' function somewhere
ehh wanna edit it maybe, also npcs dont have pathfinding
Yes, you can see how does it the next lib
And how?
What do you mean by "fill"?
With items
Just iterate it's slots?
well can the client even hit the zombie if the packet isnt sent?
im trying to get rid of the npc hit box or smt like that
You could also just patch hit packets with the entity ID of the zombie, lol
You can check how they do i, so u dont lost time asking how haha
Are you using a real entity or packet based?
packet based serverplayer entity
The scope has to be compile right?
u mean if the play hits the npc it registers as a hit for the zombie?
hmm does anyone knows whether its possible to cache a VarHandle for a field that only subclasses of a certain parent have, but the parent doesnt have that field, so i thought id have to call findVarHandle every time on the new class object but id rather cache the handle?
Oh, it was just about how to compress the information of these slots and probably even make it size-independent. Yeah, for leaving a border like that, I'd just skip the first and last row (0-9, n-9 to n-1) and then, for each remaining rows, skip the first (i % 9 == 0) or the last (i % (18 - 1) == 0), I guess
With the includes, it shouldn't matter. I don't use the scope myself.
Is the lib not contained in the final jar?
Oh wait i cant send pictures -.-
:(
1 sec ill download gyazo
!verify
Usage: !verify <forums username>
those shity uris are blocked on many countries
Please send the native picture
?img
Not verified? Upload screenshots here: https://prnt.sc/
whatever
if this is the solution how would i do it?
thats uri are blocked
Make him sent the native capture
๐ฌ
What weird ass provider would block prnt.sc, lol
All weird uris are filtered via our ISP
I tell them to block because i dont like having to open a new page/tab to seing a simple capture
๐คก
dont check by name
Using custom metadata (PDC on newer versions) or isSimilar() in legacy versions
Because items without names have an empty string as their name, which every config value will contain. Contains is the issue here.
Yeah what i have said, dont check by name
๐
You didn't provide a reason. You can check by name, nothing at all wrong with that.
no, thats a bad practice
!verify Banannus
A private message has been sent to your SpigotMC.org account for verification!
There you go
You must use PDC or NbtAPI on legacy versions
Love the way you reason, xDD
rude, i dont like your lautching at me
What do I need to import in order to manipulate packets?
It's rude that you think you're in a position to judge what's bad practise.
Yes ofc, if not i would talk
The spigot-jar or remapped NMS, depends what version you are using
Decompile the jar, I guess it'll be Casino-1.0.jar in this case, as original will be the backup before the shading process (I assume). You can also just unzip it and check if the package is to be found in there. Hard to tell otherwise.
Yes
they dont contain anymore the shad prefix
They called as artifact name, atleast the shaded one
So the one which said original, its the one with doesnt contain the shading
Depends on whether you use the shadedClassifierName property of the plugin's configuration. But yes, in this case, it wasn't used.
Well this is what i can see
Nothing named shades inside any of the folders
I need your recommendations, im generating an infinity recursion with my section config
How would I send the brewing animation then
Oh dang, you actually need to remove <scope>provided</scope> from the dependency you're looking to shade. I thought the inclusions would override that, but it doesn't seem like that's the case. Please try that.
the shaded dependency are not put by default inside a shade folder?
Unless you specify them via relocations marker
The plugin only accepts dependencies which aren't provided already, no matter the inclusions list.
what inclusions?
what weird shade
That worked, its in the jar file now imma try to see if i still get the warining
Something like this. I don't like just having it decide automatically based on the scopes, as all transitive dependencies could screw me over if they use that scope.
Yep that fixed it Thanks alot!
mines look like:
<build>
<plugin>
// Stuff here
<configuration>
<relocations>
<relocation>
<pattern> </pattern>
<shadedPattern></shadedPattern>
</plugin>
</build>
What's the stacktrace? There's no invocation of newSection inside of itself, if I didn't miss it.
An infinity loop exception
It's basically an allowlist vs a "everything's free to be shaded, if it so desires". I like to have full control.
Yeah, but on what method...
Oh, nice! :) Please make sure to alter the your.package part of your relocation to your actual root package.
Yep already did! Thanks, a lot.
Oh, and i can ignore this right?
Warnings can usually be ignored, but we should fix them if possible. Could you provide a bit more context? Are there any specific names which cause trouble?
Like, if you highlight the first expandable thingie there and then copy the full text on the right... could you paste that in a paste?
[WARNING] Casino-1.0.jar, particle-1.8.3.jar define 1 overlapping resource:
[WARNING] - META-INF/MANIFEST.MF
[WARNING] maven-shade-plugin has detected that some class files are
[WARNING] present in two or more JARs. When this happens, only one
[WARNING] single version of the class is copied to the uber jar.
[WARNING] Usually this is not harmful and you can skip these warnings,
[WARNING] otherwise try to manually exclude artifacts based on
[WARNING] mvn dependency:tree -Ddetail=true and the above output.
[WARNING] See http://maven.apache.org/plugins/maven-shade-plugin/
This is the warning in it, idk if you want the rest
I sent the cap?
Riiiight, one second please
Wait maybe i forget to sent it
https://paste.md-5.net/wufogavohe.js
Could you add that tag as a direct sibling to </relocations>? Just paste it in afterwards. This filters out useless files which could cause collisions which could cause warnings.
You've sent the method, without telling me which method caused the infinite recursion. What are you getting, a stack overflow?
Have you check my issue?
Yes a stack overflow
i can open a thread if you want
On what method. I have no way of understanding your code, so I need a name
because the channel is currently a mess
It's fine, just post the whole exception in a paste
On the one for creating the section
I sent a cap some minutes a go
It's not calling itself, right?
wait let me paste
I couldn't spot an invocation
Yep, exactly
Arh perfect thanks again ๐
Happy to help! :) Build systems can be a huge pain...
Yep, I can see, I cant understand any of this haha, I kind of get what it's doing, but would never find a way to do it myself.
Wanna know how I actually found out? I read the source of maven-shade-plugin, lmao. Their docs are pretty much useless.
Damn, I see the docs are really weird to navigate in..
That's why I know that it supports regex and thus came up with this beauty, xDDD. It really helps if like 90% of your libraries are your own.
Oh so you don't have to add them manually?
Pretty much, yes! Set the previous amount minus one, there's not really another solution. You could save a method call by storing event.getItem() in a separate variable, but that's about it.
I add them to the allowlist (includes) manually, but after that, I don't have to specify any other relocations if they start with my package name. It searches all starting with me.blvckbytes. and then shifts them into my root package, xD.
Oh that kinda cool, and useful.
Another question, have you ever tried working with armor stand animations?
Uhm, what do you want to animate exactly? I guess there are many possibilities... xD. I kinda did everything once, but I'm sure I don't have it in the front of my mind right now. I might still be able to help tho.
can someone explain why shulkers on armor stands retain their collision
nevermind im an idiot
Well i just think my method of doing it is abit wonky, maybe you could take a look at it?
Oh, are you talking about that teleport animation?
But sure, just share the routine in question.
Ill send it in dm's if thats okay?
Sure thing
have you seen mycode?
I cant understand the why
Im till debugging it
This excerpt doesn't involve any directly visible recursion. The information you provided is not sufficient to identify the problem. As I've told you, I need the head of the stack overflow exception.
I dont have the exception
I realized my self its that exception
Because the config is getting created like this but infinite times
Section:
test-1:
name:
Section:
test-1:
name:
Section:
test-1:
name:
And that continues to inf
I explain there whats happening
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: dev.alex.net.file.memory.MemorySection["parent"]->dev.alex.net.file.files
Thats the stracktrace
There is nothing else rather that
I can upload it to github
If u want
Lol, is this some sort of self referencing structure that screws up the mapper?
So its easier to checkthe code
You can, sure, that would make things easier.
yes, its pretty weird whats ahppening
And im not sure why
thats the most stupid thing, im feeling useless ๐ฌ
Also i discover a bug too
The whole issue is caused directly to sections code itself
Because the keys are not getting correctly
Block
Thats how looks, the yaml file
@dry yacht https://github.com/Alexito2060/FileHandler
looks like you did something wrong
probably made an assumption somewhere, where you shouldn't have
something like a guess, just that youre 80% confident instead of 50
how do I make a wait? like if I wanted to wait 3 seconds and then make something happen?
ty
Yes
Mc runs only on 1 thread
So when you call the Thread.sleep() you are making your server to wait, so mainly gets freazed until its finish
so?
๐ค
i dont like jokes sorry man
not wondering to be rude haha
Im just stressed trying to fix the section thing
Look how my yaml is creating the sections
I have a message sent after a countdown finishes through the action bar, but when the countdown ends, the message still appears, how do I get rid of the message?
I need help implementing the section part of my config FileHandler
For some reason im getting an overflow exception caused by a recursive call, but i cant find where
can you send your recursive function
you probably have wrong exit condition
or recursion is just too big
i have git repo
Want to check there?
can you tell me where is that recursive function
Yes between PathUtil and ConfigSection
ConfigSection contains the method for creating the section
can you just send me link pls
Why do you have your own version of MemorySection?
of method that throws stackoverflow
Multi platform reason
All my plugins depends on bungee and spigot
So i dont want to code diff files
Just an implement one single way
https://github.com/Alexito2060/FileHandler/blob/main/src/main/java/dev/alex/net/file/memory/MemorySection.java - Method causing the recurisve exceptions is newSection()
well, this isn't recursive function
can you send stacktrace
I cant look for it
Yes its pretty weird but i can send it
wait
1m
๐
Anyone know how to put a animated rainbow bold text moving to the left on a snowball?
i have problem i can't fix in php so i would rather wait for your code then break my monitor
?paste
I'm trying to understand this code block but I'm getting errors where element.getValue#() is used
Gson?
I used to have issues related to that
Anyone know how to put a animated rainbow bold text moving to the left on a snowball?
Anyone know how to put a animated rainbow bold text moving to the left on a snowball?
This is the search funtion too
Dont spam your question, you can be banned
Sorry
You are not paying anyone
So you mustnt expect instant support
This is how community works
I'm going to be honest by asking your question multiple times it makes people want to help you much less than just waiting
@remote swallow
that is me
its okay
no idea
hi bro, how are u? Are too much busy?=
lmao what are you trying to do here
this function is also not recursive
I mainly try to recreate spigot file api
also why do you have public ConfigSection newSection(String path, Map<?, ?> def) if you dont even use "def"
can you send stacktrace
its has millons of lines
?paste
Caused the overflow exception
Also
I find another bug
The file is not created with the content from default file, hehe i will look them that issue
And has 100.000 lines more
But they are the same message
Yaml look like
Its must be a recursive call somewhere
through reference chain: dev.alex.net.file.memory.MemorySection["parent"]->dev.alex.net.file.files.YamlConfiguration["values"]->dev.alex.net.file.utilities.DataMap["Test"]->
jackson ๐คข
ik, but it was the best option
Because if not i need 2 diff libs
why dont you just use snakeyaml or spigots built in stuff
Multi platform ๐
what multi platform
Dont want to recode everytime the same thing for bungee and spigot
dont they both use snakeyaml?
i mean implementation is diferent
that makes you lost time as dev
simple yaml is basically same api as bukkit one
is there a way to check if a block is any type of sign without checking for every material sign
Yes but has too much classes
๐
that why i didnt even fork it
if (Block.getType().toString().contains("SIGN")) {
do something
}
ty
So its possible to fix it or not
Because i need to finish this lib
I have been coding it whole day and i can lost more time
you could also do
if (Tag.ALL_SIGNS.contains(Block.getType()) {
do something
}
idk, all i know is that you don't have any recursive function ยฏ_(ใ)_/ยฏ
I have a message sent after a countdown finishes through the action bar, but when the countdown ends, the message still appears, how do I get rid of the message?
Doesnt make sense tho
its must be a recursive
because if not overflow ex is not thrown
its this, its the plugin using the lib erroring
well, i will just recode with what ChatGPT recommend me
Im using Jackson with yaml-databind
yes
its a normal maven module project
when i said it was a plugin?
Just for debugging it
Then i wiill add the FileAPI to my plugins library
So far the library will be meant for bungee and spigot, so it must have commong things for coding
something is calling that class im pretty sure, which causes the class to be called again
Im thiking the recursion is between the PathUtil#section() and MemorySection#newSection()
the thing i picked from the stack over flow says, MemorySection.parent is calling YamlConfiguration.values which calls DataMap.Test which calls that sequence again
oh i think the issue is specifc caused inside the PathUtil#section()
This method here is PathUtil
what is the best way to check if a block is "powered" like if there is a redstone signal/lever going to it
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args ) {
if (label.equalsIgnoreCase("h")) {
if (sender instanceof Player) {
Player player = (Player) sender;
Bukkit.broadcastMessage(ChatColor.BOLD + "" + ChatColor.GOLD + player.getDisplayName() + ChatColor.BOLD + ChatColor.AQUA + " Has called HIKE!");
this.getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() {
public void run() {
if(Number != -1) {
if(Number != 0) {
for (Player p1 : Bukkit.getOnlinePlayers()){
p1.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(ChatColor.GOLD + "Blitz in " + Number));
}
Number--;
} else {
for (Player p : Bukkit.getOnlinePlayers()){
p.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(ChatColor.GOLD + "" + ChatColor.BOLD + "BLITZ NOW"));
return;
}
}
}
}
}, 0l, 20l);
}
else {
sender.sendMessage("Hey Console! You already know this information!");
return true;
}
Number = 7;
}
return false;
}
}
check if the block data is instance of Powerable and then check if thats powered
the block can be a dirt block though doesnt need to be a block like a redstone lamp
this has a weird glitch where when you run it twice, the countdown goes twice as fast
its because you never check if its already running, you just start the code
add a var that checks?
that wouldnt be classed as powered
map
wdym im confused
add their uuid and true/false if its running
map? I gotta learn that
HashMaps
how would I use in this case
could you teach me, or show me where to learn this?
at the top of the class after the public class stuff.... add private Set<UUID> playersRunning = newnew HashSet<>(); then before you call the scheduler call playersRunning.add(player.getUniqueId())
learnjava momment ๐
would look something like
public class MyClass implements CommandExecutor {
private Set<UUID> playersRunning = new HashSet<>();
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
//code
playersRunning.add(player.getUniqueId());
//scheduler
``` then when it finishes call `playersRunning.remove(player.getUniqueId())` and check if that player is in the set to tell if its running already
ok ty
is there a different way? bc I just don't want anyone to be able to run it while it is running
and when I do it, the timer still runs really fast sometimes
is there a way to end the code after it gets to 0?
Call your listener the following way
new BukkitRunnable() {
public void run() {
cancel(); // cancels the scheduler
System.out.println("beans"); // ! still gets called, doesn't cancel it immediately
}
}.runTaskTimer(plugin, 0, 20);
Note that you might have occasional concurrency exceptions if you use scheduleAsync instead of regular scheduler without really knowing what the dangers are
hmm ok
- Check whether the player is already in the set when he runs. He is inside? Cancel further execution and send him a warning
- He is not inside, so add him and start the scheduler
- Once the scheduler ends, remove him
the scheduler*
because you are either not properly checking whether he is inside or you are not removing him at the correct time
Check the nearby blocks whether they are powerable
How would look a simple example class for creating a Config Section ?
I want to see a simple example if its posible so then i can base on it my FileHandler config section system
ConfigurationSection section = new MemorySection();
section.set("boo", 123);
config.set("abc", section);
If that's what you mean
i mean internal code
Im confused about creating the section code, the keys mapping
Not using spigot api ust to clarify
If you are lost you can check on my github what i mean with FileHandler
Im currently playing around with note blocks and using them for custom textures and im stopping the left click event on them but its also causing them not to be mineable is it possible to correct that or is there another way to go about it?
declaration: package: org.bukkit.event.block, class: NotePlayEvent
Oh shoot thanks
Could understand me?
I am confused, are you asking how you use the library that you wrote yourself?
It looks quite similar to Spigot's, so I guess that you just took it from them. In that case this should still work
No no, trying to fix a recurisve issue
I having a section issue
Which is creating the section recursivly, so when you call the MemorySection#newSection() it create the section until an overflow exception is throw, so im trying to see if there is any simple example about a config section implementation where i can base, to find my issue
Does it work if you create a new section without the def parameter (config.newSection("test"))
If yes, get rid of values.forEach((key, value) -> section.set(path, key));
or replace it with
section.getValues().addAll(values)
The issue happen with both of the methods*
sorry i typed what ever
Look at the exception it throws
It should tell you exactly where it is at
Go from bottom to top and imagine what it is doing
you should find the issue pretty quick
no
It doesnt really tell much
Exception in thread "main" dev.alex.net.file.exception.ConfigException: [FileHandler] File config.yml couldn't be saved
at dev.alex.net.file.files.YamlConfiguration.save(YamlConfiguration.java:45)
at dev.alex.net.file.test.Test.main(Test.java:19)
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: dev.alex.net.file.memory.MemorySection["parent"]->dev.alex.net.file.files.YamlConfiguration["values"]->dev.alex.net.file.utilities.DataMap["Test"]->dev.alex.net.file.memory.MemorySection["parent"]->dev.alex.net.file.files.YamlConfiguration["values"]->dev.alex.net.file.utilities.DataMap["Test"]->dev.alex.net.file.memory.MemorySection["parent"]->dev.alex.net.file.files.YamlConfiguration["values"]->dev.alex.net.file.utilities.DataMap["Test"]->dev.alex.net.file.memory.MemorySection["parent"]->dev.alex.net.file.files.YamlConfiguration["values"]->dev.alex.net.file.utilities.DataMap["Test"]->dev.alex.net.file.memory.MemorySection["parent"]->dev.alex.net.file.files
And then it has like 100k lines more saying exaclty thr same
I have asked other devs here, and they told there is not recursive function
Thats why im really confused trying to look in the code
is voice chat achievable with plugins?
No i dont think
Plugins are only server side
For doing something like that you must use a custom mod (which represents the client side) and also you will need a backend for it (a plugin or smth else)
haha i see you
I have said what u were trying to say haha
Actually, I was going to say the opposite.
It's possible if you use Fabric or Forge, but the plugins that already exist use a middle man and have integration with discord.
Because the client doesnt already implement something like that, if he is refering to voice chat, not only texting
Is there any way for a vanilla client to connect and utilize voice chat in-game?
he can help you, he has more xp, sorry tho
I don't believe so. Voice isn't something that's included with the vanilla client. Hence why the plugins that do exist depend on fabric or forge.
Mainly client side
What i was saying
๐ค
He must use a custom mod and a backend, i said it from the start
I mean, if you look that the listings for the available voice chats, they all say that you need forge or fabric.
https://www.spigotmc.org/resources/simple-voice-chat.93738/
https://www.spigotmc.org/resources/skoice-proximity-voice-chat.82861/
Client side!!!
๐คฃ
Actually i say 4 times now
hahaha
Voice chat is achievable with plugins but you'd need a mod (fabric would probably be best) for the client to utilize it.
What i have said 4 times
๐คฃ
We can have a 5th round if you want
or just make custom mod and plugin
What i said actually 6 times
๐ก
And then people tell im trolling, haha
bruh that is stupid people saying that
Another one please mention the same, so its 7th i say the same
there ain't no legit way to do it
Yeah
You could make a web application and let people have the website in the background.
Because its client side.
That why you need a mod and a plugin
Yeah right
i specfied that
too
But
that too other applications
For doing something like that you must use a custom mod (which represents the client side) and also you will need a backend for it (a plugin or smth else)
Did you know its client side only?
there isn't Minecraft clients
Well you dont need a mod percรฉ
How?
config sections get keys helps thb
You could make a web application and let people have the website open in the background
Oh right
Well thats another option
Yeah but then you might as well use discord lol
No, why?
You can use opus lib
And own audio handling
๐
there is also Minecraft Server Sync with Discord plugins
moves you to channels etc
Because if you're making a web app then what's the point in having to host your own. So much work
No, that will host it the network?
Same if you use a plugin instead of a web
๐ค
But discord doesnt allow amplification, or pitch, or reverbs or anything else thats cool.
All you can do is move people into conversations. And thats fking lame.
โ๏ธ
Then make it lol
I was told from my family that if you will make something you have to it in the best way
๐
LMAOO fucking overflow excpetion
๐ก
I already made it. It even detects if you are in caves and adds reverbs.
It also uses the stereo channels and relative locations to add a direction to your sound.
I actually dserving it
Sockets?
What audio codec are you using? Opus?
Just a website. It uses the IP of the user for identification with the mc client.
And how about audio??
๐คค now I want Arma 3's tfar mod to have more depth
You must be using a an audio codec
Because if not audio quality goes br, or its good?
I mean i never worked with audio before on sites
Its cool as it is. The radio makes it cool
Also i suppouse you must be using WS rather plain sockets?
But you havent answered to me tho
Im really interested
Would you sell something like it in a future future? Yes / No Price?
lol neither. I did not touch any low level components...
What you used so
๐ค
You breaking my brains
Dont tell you use native JavaScript audio components
๐
But i dont judge the system looks pretty well
Nice, you can also make then to sign with they mc account via oAuth, its another option
Just asked, i cant disclose. Just one buzzword: *streaming protocol
So you are using a codec too
Streaming protocol doesnt work allone internally use codecs for audio
sign in with their mc account? on your own site? sounds like a pain
No, why?
Its really easier with oAuth
oAuth was best thing they could developed
you a) have to register with microsoft to even allow it b) you have a lot to do to make sure that you dont store any of their data
Im planning to make a custom authorization and authentification protcol, based on oAuth protocol but with extra things and not dependable on Google limited backend
Hee?
It takes more work yes, but depends what you doing
all minecraft accounts are now tied to a microsoft account
yes pretty bad
to me it sounds like you might be better using uuids and timestamps or just asking people to put their name in is better
I would even make forwarding from https://mojang.microsoft.com/ to the mojang apis
But idk, i prefer all life micro services pattern while making this type of things
I have no clue. I'm trying to figure out how it was made
A plugin placed a armorstand like this
Alright. Can you destroy the armorstand with your hand?
He was able to load a custom texture onto the head of it
Ah ok. Then its probably packet based.
Do you know of any plugins that allow for that?
Non-custom
Cause like
If I can understand where this data is saved I can edit it
Oh wait
Yeah this is possible. You just need a resourcepack.
They created a custom model in probably BlockBench or something else
and then set it as the head of an ArmorStand.
You gave me the answer with packet pased
It's actually
DecentHolograms
It's literally just a hologram. that's so sick
Yeah DecentHolograms will work.
- content: '#HEAD: BLACK_STAINED_GLASS{CustomModelData:3}'
So I assume I make my resource pack interact with that directly
Sure. Just set the CustomModelData and you are good to go
if i need a gson instance, in my type adapter, how would i actually pass an instance in if i initalize the type adapater in the gson instance
?
Iโll pay 90โฝ for the plugin
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/
- Not here 1. Nobody will make you a plugin for 1$ lol
I'd make one for $1. It wont do anything other than load
How to make a player in a 100hp hot bar?
Isnt this the sign for russian rubels?
Yes
oof
xd
Wait is this the spam banana guy who wants everyone to program his rust server?
Oh idk I just know he was told to go to services like 30 times and he kept insisting on paying someone here 1 euro
static final Gson GSON;
static {
GSON = ...
.addTypeAdapter((...) -> { /* use GSON */ }
.build();
}
i think this might work
There should never be a need of a Gson instance inside a type adapter unless you are writing
a general type adapter for interfaces or abstract classes.
public class OnEvent implements Listener
{
Player player;
CustomGUI instance;
ActionPerformedGUI handler;
public OnEvent(Player player, CustomGUI instance, ActionPerformedGUI handler)
{
this.player = player;
this.instance = instance;
this.handler = handler;
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onInventoryClick(InventoryClickEvent event) {
if(event.getWhoClicked().getUniqueId() == player.getUniqueId()&&event.getCurrentItem()!=null)
{
if(event.isLeftClick())
{
handler.actionPerformed(instance, ActionPerformedGUI.ActionPerformedGUIType.LeftClick, event.getCurrentItem());
}
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onInventoryClose(InventoryCloseEvent event) {
if(event.getPlayer().getUniqueId() == player.getUniqueId())
{
if(instance.getState() == 0)
{
MCMania3.getInstance().getServer().getScheduler().scheduleSyncDelayedTask(MCMania3.getInstance(), () -> {
HandlerList.unregisterAll(this);
}, 10);
}
else
{
MCMania3.getInstance().getServer().getScheduler().scheduleSyncDelayedTask(MCMania3.getInstance(), () -> player.openInventory(instance.inventory), 0);
}
handler.actionPerformed(instance, ActionPerformedGUI.ActionPerformedGUIType.Close, null);
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onInventoryClick(InventoryDragEvent event) {
if(event.getWhoClicked().getUniqueId() == player.getUniqueId())
{
event.setCancelled(true);
}
}
}
I dont know how to fix the Bug which appears when you close the GUI (ESC) and press on a item inside the GUI (Hover over a itm and press a number)
First of all: Dont compare UUIDs using ==. Compare them by calling .equals()
Next: Make all your fields private (player, instance, handler)
that is not the problem
We will get there after im done pointing out everything that will lead to failure sooner or later.
Like referencing a Player in your class. Dont do that. Use a UUID instead.
Now to your problem: If you closed a GUI then you can not press a button in your GUI. What do you mean by that?
public class OnEvent implements Listener
{
private UUID player;
private CustomGUI instance;
private ActionPerformedGUI handler;
public OnEvent(UUID player, CustomGUI instance, ActionPerformedGUI handler)
{
this.player = player;
this.instance = instance;
this.handler = handler;
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onInventoryClick(InventoryClickEvent event) {
if(event.getWhoClicked().getUniqueId().equals(player)&&event.getCurrentItem()!=null)
{
if(event.isLeftClick())
{
handler.actionPerformed(instance, ActionPerformedGUI.ActionPerformedGUIType.LeftClick, event.getCurrentItem());
}
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onInventoryClose(InventoryCloseEvent event) {
if(event.getPlayer().getUniqueId().equals(player))
{
if(instance.getState() == 0)
{
MCMania3.getInstance().getServer().getScheduler().scheduleSyncDelayedTask(MCMania3.getInstance(), () -> {
HandlerList.unregisterAll(this);
}, 10);
}
else
{
MCMania3.getInstance().getServer().getScheduler().scheduleSyncDelayedTask(MCMania3.getInstance(), () -> Bukkit.getPlayer(player).openInventory(instance.inventory), 0);
}
handler.actionPerformed(instance, ActionPerformedGUI.ActionPerformedGUIType.Close, null);
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onInventoryClick(InventoryDragEvent event) {
if(event.getWhoClicked().getUniqueId().equals(player))
{
event.setCancelled(true);
}
}
}
Better. Now try to explain the problem a bit better because i dont see how you would ever click an item in a closed GUI
that would cancel it for all players
oh my god dont tell me you create a listener for every GUI...
Anyways try this
if(event.getWhoClicked().getUniqueId().equals(player))
{
event.setCancelled(true);
if(event.getCurrentItem() == null)
{
return;
}
if(event.isLeftClick())
{
handler.actionPerformed(instance, ActionPerformedGUI.ActionPerformedGUIType.LeftClick, event.getCurrentItem());
}
}
*I hope you dont plan on having many players on your server if you register listeners like that.
Bug still there
wtf is this bug. I have never seen this.
Ok cancel all click events (by moving the cancellation out of you if clause) and tell me the result.
Im suspecting something really bad here.
still there
public class CustomGUI
{
Player player;
Inventory inventory;
ActionPerformedGUI handler;
int state;
public CustomGUI(int slots, String title, Player player, ActionPerformedGUI handler, Plugin plugin)
{
state = 0;
inventory = Bukkit.createInventory(null, slots, title);
this.player = player;
this.handler = handler;
Bukkit.getPluginManager().registerEvents(new OnEvent(player.getUniqueId(), this, handler), plugin);
player.openInventory(inventory);
handler.actionPerformed(this, ActionPerformedGUI.ActionPerformedGUIType.Init, null);
}
Alright then this problem stems from your handler being unregistered.
You unregister your listener and therefor prevent the cancellation of the click event.
i have already mad it so it unregisters after 10 ticks
Here thats how a listener for GUIs is supposed to look like:
Register it once when the server starts and use it for all guis.
Never un/register listeners constantly. Its expensive and breaks many edge cases.
Alright thats it... i need to write an article for writing proper GUIs...
Can I make a library for my own plugins and include a dependency in that library itself that will then shade automatically onto a plugin I make using that library?
Yes
Like if I wanna straight up include
AnvilAPI
In my library will then just having maven shade my library also include AnvilAPI
@lost matrix not unregistering fixes it
If you shade it in your lib and then shade the lib in your plugin.
You can also make your lib a standalone plugin and not shade it in every of your plugins
I guess i will have to rewrite the eventhandler then
How would I decide which one I want to do?
Does it really matter if I shade my lib into every one of my plugins?
Yeah and try only registering a single listener for all GUIs then
One moment ill give you a kick start:
public interface InventoryHandler {
void onClick(InventoryClickEvent event);
void onOpen(InventoryOpenEvent event);
void onClose(InventoryCloseEvent event);
}
public class GUIManager {
private final Map<Inventory, InventoryHandler> activeInventories = new HashMap<>();
public void handleClick(InventoryClickEvent event) {
InventoryHandler handler = activeInventories.get(event.getInventory());
if (handler != null) {
handler.onClick(event);
}
}
public void handleOpen(InventoryOpenEvent event) {
InventoryHandler handler = activeInventories.get(event.getInventory());
if (handler != null) {
handler.onOpen(event);
}
}
public void handleClose(InventoryCloseEvent event) {
InventoryHandler handler = activeInventories.get(event.getInventory());
if (handler != null) {
handler.onClose(event);
}
}
}
public class GUIListener implements Listener {
private final GUIManager guiManager;
public GUIListener(GUIManager guiManager) {
this.guiManager = guiManager;
}
@EventHandler
public void onClick(InventoryClickEvent event) {
guiManager.handleClick(event);
}
@EventHandler
public void onOpen(InventoryOpenEvent event) {
guiManager.handleOpen(event);
}
@EventHandler
public void onClose(InventoryCloseEvent event) {
guiManager.handleClose(event);
}
}
and my gui would have to implement InventoryHandler then right?
Yes
Then you put the Inventory and the handler of that Inventory in your map and open it for a player.
Smile answer mah question bby
When he closes it you just remove it from the map again.
Unless the inventory is for all players and doesnt change.
Then you can just create it once and leave it in the map.
Yes this matters because if you shade your lib in every of your plugins then every plugin might be 2mb for no reason.
You will also have to relocate on every of your plugins then.
Standard procedure is to create a standalone plugin library.
Yes but my public lib is pretty bad and my private lib is... private ๐
Is there no chance I can peak at the priv one?
I wanna start making my own but don't have much of a base on it. Jefflib confuses me a bit too
There is your peak
Ok I see. I kinda get an idea
Yes write your own. ๐
Show me some class file names in a picture if you can too
Like for example Actionbar and data. no code just names
Start by adding 1 feature. Either GUIs or Holograms or something else you could need in every plugin.
Rome wasn't built in a day. right
Like a custom config handler thats reusable
Gui implementations are always so damn annoyinhg
If you have written some plugins then you should think about everything you have
to write twice or more often. Thats what a lib is supposed to prevent. Your lib should
provide reusable code so you dont have to repeat yourself in every plugin.
Eg. translations. Or GUIs. Or Holograms. You dont want to re-write those in every plugin.
For GUIs im writing a tutorial at this moment
I need that cause GUI's are painful
And probably GUI needs to be my first module for lib
They have some util classes... But thats it
Wait so it is just full of static methods then?
Man besides stuff like creating holograms easier and stuff like that I find it hard to wrap my head around how much they would help
I meant that the use of static is limited to the few util classes within your lib.
And most classes are not pure util classes.
And like the typical Utils.HEX()
Oh!
Ok that helps a lot
1.20 would allows this to do in vanilla ๐
Yes 1.20 will be cool. I already got some ideas ๐
they should add alpha channel for the entities
imagine semi transparent entities
or blocks
You will actually be able to tint the screen of a player by just displaying a huge colored block in front of their face
that's actually a normal behaviour that only works with creative mode inventories
Does anyone have a link to how to upload stuff to github using IntelliJ Idea?
First google search
On the top bar
Damn i was looking for a option called Git -.-
VCS = Version Control System
VCS = Version Control System
1-0
sniped...
literally create git repository is above the github selection ๐
Alright smile I have another question'
Both those resources have a bunch of packages for each minecraft version. Now I know this has to do with nms
Wait nvm I don't remember my question now
f
I have a different one tho
Does alex write these clases per version manually?
For each damn version?
Yes
bRuH
They usually dont change that much so its fine
So what, you make a base one then go making the changes needed as you go?
Would you look at that. Just talking about @tender shard and he updated his repo 10 seconds ago while I was browsing it lol
What your thoughts on IF smile
When your tutorial on GUI coming? ๐
gui is easy
Is hikariCP best practice atm/
hikari is nice. It takes a lot of teh work off you
So i'm trying to figure out how to structure a lib on intelliJ.
Lets say I want to include my library to have Hologram functionality
Should I make a separate module for it and use maven to combine them? Is that better organization wise?
why dont i need a default here?
Man I'm looking at other peoples libraries and it's so different from eachother... 10000000 ways of doing the same thing...
Some of that looks so bad but idk if it's the best way or not
How would i register a hit on an NPC on another mob? or do this in any other way?
if it helps heres the npc class:
https://paste.md-5.net/bamegasame.java
You have created a packet NPC. It doesn;t exist anywhere but on the client so no event will be triggered on the server
then is there a way i can get rid of the hitbox?
or a way to create a non packet npc
wait u linked me one?
didnt get it holdup
around when did u send it?
ah was another person I gave it to <#help-development message>
just had the same requests
alright thanks
the guy i followed this tutorial of said he hated the way he did it too
I liked it. He made a few mistakes but it's clean
and its entity based so you have all event triggered
also which packet gets rid of the npc on the tablist
info packet remove
I don;t know the exact one for 1.19.3 as it changed from 1.19.2
ofc they did
do i still need my old npc class in any way?
for the tutorial
I'd read all the tutorial and decide for yourself
alright
heh var not working for static constants
Because java switches suck
because that's a switch expression, not a switch case
what will it return when none of the cases matches then
null probs
:/
mojangs files probably arent broken so that shouldnt happen
deserializing this goes kinda brr
It's still funny how switch case statements on enumerations don't seem to be satisfied if all constants are accounted for, and they still force the stupid default case on you, which then kills the aid of the compiler when the enum is extended later on. At least I couldn't get it to work as expected.
Can you add a default case? I'd just throw a descriptive illegal state exception. That's better than letting a null value bubble up, I'd say.
btw, is it possible to add pathfinding/behaviour to this tutorial? cus thats why i used the zombie thing
yah
mojang also keeps it interesting to sometimes include the "group" key in the json and sometimes not ๐คก
Would be too easy otherwise, :)
abandon all hope, gib up
the only thing i could do was writing typeadapyters
cuz the reflection didnt help in any way
getting this error:
Caused by: java.lang.IllegalAccessError: class quac.funnystuff.Entity.Custom.New.NPC (in unnamed module @0x74a18be0) cannot access class com.sun.tools.javac.util.List (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.util to unnamed module @0x74a18be0
this is the line:
ClientboundRotateHeadPacket headRotation = new ClientboundRotateHeadPacket(entityPlayer, (byte) ((location.getYaw() * 256f) / 360f));
Looks like you imported the wrong List
fixed it all
- not all, the head rotation is weird,
it changes the pitch to the yaw of location but doesnt change the yaw at all
This might help as some inspiration.
this is what I use for my NPC
i think the head mostly
ClientboundRotateHeadPacket(npc, (byte) Math.floor(npc.getYHeadRot() * 256f / 360f))
that with the above method works for me for head rotation
alright
i also saw some1 in the comments post about AI and pathfinding, ill look into that
except if u got smt better
also changed my stuff from static to normal methods, idk why they used static if u need a reference anyways
also, when i reload my plugin and an npc existed before the reload, when i hit it my server crashes. any way to fix?
like i could delete all npcs before reload but idk if thats a good idea
works, thanks
@eternal oxide can you help me dude
yes remove and respawn. Its the connection which is killing your server. If you don;t prevent packets being sent to the fake Player the server will crsh
Its really a Player so the server expects a client to be on the other end
do i just make a public list of all npcs and on disable i just remove them?
i cant think of other ways rn
I want reverb on my local chat :(
it works, kinda. anyways, do u have any good way to add pathfinding/ai?
I'v not done PF
oh alr
for now ill put this on the side and work on smt else
whats the best way to create a scoreboard? an external api or just the spigot api?
spigot
bukkit api is the best, since using raw packets could lead to some plugin conflicts
since there could be only one scoreboard per player
in the minecraft client
If you still need inspiration for your inventory GUI approach:
https://www.spigotmc.org/threads/a-modern-approach-to-inventory-guis.594005/
What will be the best option, to check if myPlaceBlock is in range of water, cause water destroy PlayerHeads and i need to block it

cool
That looks like JavaScript parsing 
this seems unsafe
noice
You can listen for the BlockFromToEvent and cancel liquid flowing on your head
I'd love to know what you mean by that. How is it unsafe?
Oh no, we don't do that here, xDD.

Can someone help me?
if (!config.exists()){
getLogger().warning("[Void-Core] Config file not found!");
return;
}
config = YamlConfiguration.loadConfiguration(configFile);```
So im getting this error at the last line in config = YamlConfiguration.loadConfiguration(configFile);
"Cannot resolve method 'loadConfiguration(File)'
your not creating the config file.
at the first line isnt i?
Also why all that extra work for the default config?
nope, that's declaring path and what file to create
check this out: https://www.spigotmc.org/wiki/creating-a-config-file/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Show your imports pls
Because this should work
You could expand even further with the system
My menu system works in a similar way, but instead of just calling setItem(slot, button), you can create a selection which returns a List<Integer> slots
You can then make classes for geometrical selections (like rectangles or hollow rectangles, etc) or masks
I'd use an interface instead of a Button class
and make the button class impl the interface
Other elements can be for example, cyclic switches
Yes true, true. At the end i had to make it short because i was reaching the image limit 
But yeah you can go crazy from there on
One Java question
if I have a Class for a command named Event
and I would like to have another class named Event for having the properties like event location, event name, etc
how could I do so
should I rename the Event commadn class to EventCommand?
is there a way to save data in a block
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
thx
TileStates are natively supported but for the rest you need something like this
well the only thing i need to save is an id or smt so i can use tilestates ig
Is storing data in the PDC of a player safe?
Can an exploiter modify modify it?
No its server side only
Please dont store your whole playerdata in the players pdc
There are better solutions for bigger data, not talking about some small values here
Well, I just need to store a few items
can plugins spigot or bukkit working on software NuckitX ?
if nuckitx is built on top of spigot yes
Cast to Object
thats interesting, whatever i was just trying if it would work
im using gson to not use the reflection ๐ค
Which it isn't
So the answer is no
Nukkit runs nukkit plugins
ugh im bad at regex, whould would be a pattern to match both @NotNull and @Nullable? @[NotNull,Nullable] i thought
huh why are you regexing annotations?
ugh i gotta remove annotations from a bunch of files and id rather not do that manually in ij
can always do replace twice but that still takes twice as long
it takes like 2 seconds
Isn't it | instead of a comma?
you can also just do a direct string replace instead of using regex if you arent sure
or use some site to check the regex
while you were trying to come up with a regex you could've done it already ๐
but you do you xd
bruh
(@NotNull|@Nullable)(\(.*\))?
Smth like this ig for params?
.+ would assume there is something in the braces, but they can be empty, right?
used to have some regex knowledge but its all gone
And then {x|y} for anything between x and y
how do i make a database to store player data in
that's a VERY broad question
fair
first choose the database you want to work with
i normally do mysql/mongodb
then just find any guide to create a database and connect there
and i guess you gotta learn how to make requests to those databases
ill do mysql since im going to have to work with that in my course for a java certificate
alrighty then, mysql is very popular so you'll find a ton of guides
if you use linux you can create your database from the terminal
if you want it to be hosted somewhere else, well, find a hosting duh
where can i find the latest craftbukkit source?
?stash
sniped
thank you
can i create a database on my pc on windows?
Yes
yeah but it's a bit more scuffed imho
eh not really
well it's not but i find it a more awkward approach
for some reason my intellij crashes while opening CraftItemStack
Just grab the installer
for my preference
mysql aint free?
It is
ohh community download
wasnt on the main download page for some reason
the msi installers are only x86, 32bit is that fine?
Yes
also the database function in intellij, can i use that to create a database or only access it?