#help-development
1 messages · Page 706 of 1
first released the AV on Feb 25, 2019
now I'm at 26.7K downloads, 194 updates, and 919 commits
and like $10 in donations lmao
Well apparently Col-E (the person behind Recaf) wants to write a better AV - or at least one that is based on code behaviour
meh
and I can't break blocks 
although based on code behavior how exactly? like.. running the code and see what it does?
actually that was a side effect of my minigame lib
Yeah, it runs the code in a virtual machine (SSVM) or something like that.
cause like... I'm pretty sure I have that on my list of things to get around too
That's on my TODO list lmao
It'll actually be feasible on my remote scanner lmao
When i am adding the compass to the player the compass dosent have a name does anyone know why?
ItemStack 1 = new ItemStack(Material.COMPASS, 1);
1.getItemMeta().setDisplayName("COMPASS");
inv.setItem(0, 1);
I wonder if I should impl a whole block system or just let each platform do its own event handling
Concoction: https://github.com/Minecraft-Malware-Prevention-Alliance/concoction
LL-Java-Zip video: https://www.youtube.com/watch?v=soBpPnHM7u8
00:00 - Basic overview
00:21 - What we have now (static, wip dynamic)
02:28 - Example: Why dynamic is necessary
04:15 - Sandbox explanation, internals and security
06:03 - Recap of what we have and what'...
I've got a bunch of different things planned in terms of detection methods
oh yea. I'm not too worried about that actually
Is it normal that using interfaces and abstract classes is a bit difficult for me?
does anyone know why my HTML is fucked up after saving it with jsoup? D:
I didnt even do any changes - I loaded the file and instantly saved it again
if anything, I can just rework my AV to use that stuff lmao
Yeah pretty much given that it is intended as a library
the likelyhood of it being any real competition is low (atm) though.
I can just pull certain functionality from it and be ahead in that regard
.
really, as long as I stay on top of spigot detections & like.. push updates, I'm fine
also ya know, look at the AV scene in general kek
Kinda annoying that there's like 20 different things within the MC scene though. Really should be focusing on a single project
Gotta love concurrency issues
I'm glad they are all converging on a single decompiler though
oh? Which one?
Vineflower, which used to be under the QuiltMC umbrella
although in my defense, I'm too late to the game to really work on a single AV lmao
?nms
you dont set the meta back
link?
What do you mean? arent i setting the meta?
I'll have to test it. I have like 5 other ones lol
gimme a bit
you either need an item builder or have to do ```java
ItemMeta meta = 1.getItemMeta();
meta.setDispalyName("COMPASS");
stack.setItemMeta(meta);
It used by Paper for https://github.com/PaperMC/mache
basically useless for my purposes lmao
is that like mcdeob but designed for paper
Probably as they are definetly working towards a hard-fork
gonna hard-fork them ong frfr
is vineflower just quilt flower, bc the ide plugin links to quilt
who knows a good api for npc
citizens 2
thenks
These are my current decompilers
I don't really use the cfr jar, I'll probably remove it
I use jd-gui a lot
i use recaf and bytecode viewer
omg this names my eyes
I use whatever works with the jar I have lmao
are they even useful?
i opened paper the other day to copy some code but all i got was a list of patches
Recaf 3X uses Quiltflower which is an old Vineflower release
I have 5 specifically because not every jar works with every decompiler kek
and by the way, what needs to be studied so that I can create a connection between the plugin and another server (for protection)
oh yea. I've been meaning to update recaf lmao
does vineflower actually have a gui
No and I doubt they will
Given that in theory Recaf should support it
Problem is Recaf is stuck in refractor hell
lol
As they are now working towards supporting Multi-release jars and Android
I'll probably update all my tools later today
that reminds me @worldly ingot do u know if there's a non-virus-filled way to convert .mp3 to midi 😅
?
I've opened NBS but it's only taking 'new song' and 'midi'
idk. Some online coverter or something
Cloud convert I think is usually fine
Midi probably won't allow executable code to be run
So as long as you don't run any executables it should be fine I think?
i mean the websites, theyre all kinds of terrible
oh F
honestly only problem I run into @quiet ice is obfuscaiton lmao
that's a skill issue though
I just need to get better at making custom deobfuscators via java-deobfuscator
I have only written metadata regeneration tools in the past. It's strange how there is a big market for decompilers but no market for metadata regeneration tools
Well the legacy minecraft and OSRS communities seem to be vaguely interested in my tooling but that is just about it heh
recaf 3 looks great
Excuse me if I am a big dum-dum but how do I get a VarHandle?
it can also open multiple jars at once
Ah via VarHandleDesc#resolveConstantDesc apparently
metadata regeneration?
Detecting and fixing switchmaps or other inner/anonymous classes as well as regenerating generic signatures.
The small things in life
Ah. I don't think I've ran into the need for that myself actually
Any thing I do need is more or less possible with either the decompilers in the image above, or my own tooling https://github.com/OpticFusion1/Kitsune/
I've only needed it because I'm linking into a jar that has none of this metadata
What do people do in regards to custom player heads, I know PlayerProfile is available now but am looking for a non-nms option for before 1.18 versions preferably
Still need to work on this though lol
Gotta throw in tokenization, to support other langs besides java kek
is there a new playeritempickup event for 1.20.1?
eawww
?
Nah
It already has VBS & Batch support, but severely limited due to the way I went about it originally kekw
probably hard fork java-deobfuscator and a decompiler or two
Going back to this though. I do need some way to verify if an account is actually used for malicious purposes, or is just there to get someone else in trouble
probably gonna have to setup a honeypot server or some shit
Are you sure? Because the List<String> return suddenly disappeared lol
Now you get a String>
:D
yeah I already found it, I just got a \s too many in the regex
I'll fix that tomorrow lol
The better fix would be to transform the jetbrains-annotations dependency
But whatever
yeah i think that is what paper would like as well
What approach did you take?
Alex transformed the javadoc HTML via jsoup
Which imo isn't the right way to fix the issue as you are only fixing a symptom and not the root issue
the better solution is to fix javadoc
jsoup is not going to work
javadoc generates some really scuffed html, specifically regarding intendation, which gets lost when parsed via jsoup
You should see the questionable CSS
i swear the issue was fixed on a newer or maybe didn’t exist on an older version that spigot uses
spigot downgraded jetbrains lib to pre type_use
Downgrade? For what reason?
that’s the ticket
to remove the duped annotations
the type_use, as lynx mentioned, is what causes the issue iirc
yes, both the type and the parameter get an annotation omitted by javac
javadoc does not care
and displays both
you don’t
but ™️
it's been an issue for years in reality
it's working fine though
interesting
What should i use, interfaces or abstract classes?
the only issue I still have is the return type of e.g. List<@NotNull String> - but I'll fix that tomorrow. besides than that, it works totally fine
hmm like in simple chat plugin for differents chats? local, global etc.
what would be better to use?
Well it isn't broken behaviour for javadoc since in reality the annotation really is applied twice.
yes
Generally you use annotations-java5
its just useless
to "fix" it you just wouldn't use type_use annotations altogether
I mean... Like classes for different chats like with radius, chat color, etc...
but, like, y'know
One could say it is a problem with javac but even there it is working as intended
well it isn't an issue with javac because the spec explicitly says it gets applied to both
So the only thing that is not working as intended is jetbrains-annotations
that seems like an unecessary wrapper, you could just use a config option for that and read it. if you have different options for each player rather than a Chat class you'd be looking at a ChatOptions class to apply once the player messages. Than Apply the options to the message
- Method use + Field use + Param use + whatever
either you annotate the param or the type of the parm
yes, not specific to jb annotations
Yes because apparently noone knows how to work with annotations
Same thing with shading module-info.class
hmmm ok thx
PR @Target({ElementType.LOCAL_VARIABLE, ElementType.TYPE_USE}) instead of @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.TYPE_USE}) and fix it
dew it

I wonder how much that would break xD
Even LV should be improper
Absolutely nothing
Except perhaps IJ but at that point it is their own fault
Is there any way to prevent the execution of a maven execution when using certain java versions?
maven enforcer plugin?
there are hacked clients that shows other player potions. is it possible to hide it?
i think you can hide some of that stuff with paper, wrong channel tho you need #help-server
can you explain more? I think server sends it to every client so its impossible
when you say potions you mean the current effects
yes
It shows like guy has strength II and 2 minute left(not sure if it shows minute left)
hmmm, there might be a plugin otherwise ask paper in the paper discord. this channel is the wrong place to ask
Alternative for cancelling events thru a for loop?
hi , still getting errors when more than 4 player's join
each player will join will load 8 data from 8 diffrent tables at once
can i use some sort of Queue to load the data?
are you not returning your connections ?
idk what your database is up to, but 8 SELECT calls should not exhaust your 30s timeout
SQL 🤨 😬 🔫 😵
Yea, not running them on the main thread is a good idea.
Again, are you properly returning the connections
how would i know if iam doing it correctly?
are you closing the connection you take from the pool
there are tons of way's to do it
Always when working with connections, any type Database or Http, always thru async
iam using auto close
not inside right ?
like, you are reusing the one connection
otherwise you are gonna be holding the outer connections hostage
okay, yea das fine
where exactly are the 8 different tables you talked about prior ?
different things ?
i have this which implement in 8 diffrent profiles
all have its own tables to load data from
ah
yea, hmm should be fine then
but its not ..
yea, I mean, grab yourself a debugger and step through it
do you have free one xD?
intellij ?
oh that ok
also, obviouls check the other 7 implementations
to use try-resource with the connections
checked all of them all use try-resource
my spaghetti works! 😂
too bad that test my plugin used like 60% of a tick
its optimize time :()
60% wtf lol
that's so cool
Could a for loop make event cancellation not work?
hi , any ideas xD?
no?
if you set cancel in a for loop make sure to break;
if you want it to stop there
I have an odd problem. I have this code in the on move event and for some reason when I teleport the armor stand, it doesnt move. The location its supposed to be teleporting is correct though I have tested that but for some reason it wont teleport. (ArmorStand was created through protocollib not through traditional way)
Location loc = event.getTo().clone();
loc.setY(loc.getY()+2.2);
vantageStaff.getModManager().getSession(event.getPlayer()).getArmorStand().teleport(loc);
you might have to resend packets
or whatever name protocollib has
Resend creation packets every time a player moves lmao?
Thats not done through packets
Its still a valid entity but I had to create it through protocollib because I needed to hide the entity from certain players
plus teleporting has worked from my testing but just not now
why not create a real one and just prevent showing to the other players?
Wym? You cant do that
you can 😄
theres no #hideEntity method
send destroy packet to some players
or just cancel packets from being received by the hidden players
i dont think thats the problem the method of sending destroy packet is used often and ive used it plugins before
anyone expert with sql , threads ?
im going to test if the server is for some reason not sending the move packets
Im not an expert, but you can ask
I just worked a bit with jdbc and queries
read my message and you will understand .
i hope you're not using paper
CAn you send your hikari data source config?
Alright so I tested if for some reason a client issue. Its not when I run this its supposed to teleport to the players new location but it doesnt and the same spot the armor stand spawned is the only spot getting set to bedrock
@EventHandler
public void onMove(PlayerMoveEvent event) {
if(vantageStaff.getModManager().isInModMode(event.getPlayer())) {
Location loc = event.getTo().clone();
loc.setY(loc.getY()+2.2);
vantageStaff.getModManager().getSession(event.getPlayer()).getArmorStand().teleport(loc);
vantageStaff.getModManager().getSession(event.getPlayer()).getArmorStand().getLocation().getBlock().setType(Material.BEDROCK);
}
}```
are you using hikari? @twin venture
yes iam
im not using paper but i want this to support paper
why
paper has an option to prevent armorstands from ticking
indeed, as it is normally a waste of cpu
i see
Good lord that hurts
except when you're making cool armorstand stuff that do need ticking
What about this though? This should say something if the teleport is not working server and client side
hence the config
Check my github for epic spigot lib and look at my conn pool in core/src.main.java.me.epic.spigotlib.storage
The teleport normally works but when I added some bungee support using plugin message channels that will enable put the player in the "ModMode" when they join the bungee server it stopped working.
yeah but people also share optimized configs so it's a problem that surfaces sometimes
did you understand my problem sir? the problem is , i have 8 loading methods and each load a diffrent profile and each profile have its own table to load data from / save .
I use this and it never gone wrong (unless the database hosting is broken or firewall preventing connections), i wonder why pool size is 100? its just too much, but here you go, try this:
HikariConfig hikariConfig = new HikariConfig();
hikariConfig.setPoolName("BedWarsPool");
hikariConfig.setMaximumPoolSize(10);
hikariConfig.setMaxLifetime(1800000);
hikariConfig.setJdbcUrl("jdbc:mysql://" + host + ":" + port + "/" + database);
hikariConfig.setDriverClassName(driverClass);
hikariConfig.setUsername(username);
hikariConfig.setPassword(password);
hikariConfig.addDataSourceProperty("characterEncoding", "utf8");
hikariConfig.addDataSourceProperty("encoding", "UTF-8");
hikariConfig.addDataSourceProperty("useSSL", "false");
hikariConfig.addDataSourceProperty("useUnicode", "true");
hikariConfig.addDataSourceProperty("rewriteBatchedStatements", "true");
hikariConfig.addDataSourceProperty("jdbcCompliantTruncation", "false");
hikariConfig.addDataSourceProperty("cachePrepStmts", "true");
hikariConfig.addDataSourceProperty("prepStmtCacheSize", "300");
hikariConfig.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
hikariConfig.addDataSourceProperty("socketTimeout", "30000");
dataSource = new HikariDataSource(hikariConfig);
Yep and first you fix ur connection pool
you mean the connect method i have?
Use the code kalix just sent to setup Hikari
Seems on brand for you
still have the same issuse .
after a new player join , if we are 3 or 4 on the server and new player join , or already exist in the sql database ,
..
Is MySQL installed locally?
on the dedicated yes
Something is seriously wrong here
hj
ik , i wana fix that...
should i change the maximum sql connection on the dedicated itself?
like make it 6000 or smth?
first check how many connections are established on mysql:
show status where variable_name = 'threads_connected';
this shouldn't be the solution
either it might be a firewall miss-configuration or something else
but just too weird
alright what else i can do?
uhh
i dont mean i fixed it .. i just got what variable_name mean its pretty late for me , and i was awake from 7am .. till now and its 2AM next day :p
So what was the number?
variable_name is the column within the show status result
i can't enter the putty cuz of .. the owner don't remmber the pass for it so i am waiting for him , might take a while
ok whatever
gonna send you fr , i will message you once i can run it .
Anyone have an idea abt this?
I wanna make a Login plugin, with mojang api so premium players can bypass login, my question is, i know i need to make a Bungeecord and a Spigot plugin, but how do i indicate, from bungee to the spigot that x player is premium?
or how should i do exactly
plugin messages
Specifically this channel: https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/#forward
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
hey guys, I'm looking to make an addon for my plugin I made before, but I can't seem to find some good tutorials to add the dependency
so like I'm trying to compile but it says that the .jar is not found
like for example I'm using a class from the main plugin in the addon plugin, when I compile, it says that those are not recongnized
because the ,jar is not added properly i'm guessing
Are you using maven?
yes
Is your other project also a maven project?
Usually you would call mvn install so you can use your applications as a dependency for other maven
project.
When using maven you should never manually add jars to your project.
Not the spigot jar and not other jars.
well the thing is that I only have the .jar compiled file from my other project
not the actual project
and I'm looking to, when I add both plugins to the server, it works
ykwim
you don’t have access to the other project ?
no I erased my pc data and could only find the .jar file of the project on onedrive
What you want to do is manually install this jar into your local maven repository
mvn install:install-file \
-Dfile=<path-to-file> \
-DgroupId=<group-id> \
-DartifactId=<artifact-id> \
-Dversion=<version> \
-Dpackaging=jar \
-DgeneratePom=true
For DgroupId, DartifactId and Dversion you can just invent anything you want.
Just make sure to use those values in your pom later:
<dependency>
<groupId>com.sample</groupId>
<artifactId>sample</artifactId>
<version>1.0</version>
</dependency>
use github for future projects
yes I will thank you very much 😄
so the command is in console ?
and thats all I have to do and I'll just be able to add the dependency ?
Yes this will install a jar of your choice into your local maven repository.
From there it can be accessed by any maven project via the pom.
okay and the group id and artifact are the ones that I put in the command ?
and also It will just work when I put both projects in the plugins folder ?
This has nothing to do with spigot or minecraft... I dont know which plugin folder you mean.
I mean. If they are both spigot plugins and you compiled them correctly, then they should work...
yes but I mean with the dependency will it need to be on my pc to find the file or will it figure out that it is in the plugins folder with the other one
and in what command prompt do I use this command ? : ```mvn install:install-file
-Dfile=<path-to-file>
-DgroupId=<group-id>
-DartifactId=<artifact-id>
-Dversion=<version>
-Dpackaging=jar
-DgeneratePom=true
You need to strictly separate your idea of the development and game environment.
The spigot server knows nothing and also searches for nothing.
If you want a plugin to run on your server then you need to put it in the plugins folder.
In any terminal on your pc
when i paste it it just executes by it self
maven is general purpose and has nothing to do with spigot or minecraft
Ah, windows.
that's not what I meant
I mean will the addon be able to run if it's not on my pc is basically what I'm saying
mvn install:install-file -Dfile="./some.jar" -DgroupId="com.example" -DartifactId="Example" -Dversion="1.0.0" -Dpackaging=jar -DgeneratePom=true
Which addon?
the one I'm making of my main plugin
that's why i need the dependency so I can use my classes from my main project in my addon
Again: If you want a plugin to load on any server, then you need to put the jar in the plugins folder
Spigot doesnt look for plugins itself
I know, I will
but
will the addon work if I put them both in the plugins folder on another pc
also mvn : The term 'mvn' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
try maven
Did you install maven on your system properly?
but i so believer you have to have maven set in your system env
I dont see a reason why a plugin would run on your pc but not on anyone elses...
Ok.
Maven is a dependency manager for java projects.
It has nothing to do with spigot, minecraft or any other game or application.
Its a pure development tool which lets you manage dependencies when compiling code.
Almost nobody will have maven repositories unless they actively develop java applications.
Spigot will not search anywhere for plugins.
It has only what is in your plugin folder nothing else.
Do you mean if you can use your local maven repository, which has your jar manually installed,
for projects on other PCs?
Then the answer is no, its local. So it woll only ba available for this PC
no I don't really know how to formulate it
So it said build succesful
but i go in intellij and the dependency still doesnt recognize the id
HOLD ON
WAIT A MINUTE
it might have worked
Dont forget to add
<scope>provided</scope>
to your dependency. Otherwise you shade it
and this is the moment the great frenzy had a sparkle of a brain cell that emerged to be more intelligent then the others and might just have gotten it to work
it could be the IDE that is not working properly
😳
yes I just restarted it
so if I don't add that It just means that both plugins are combined in one ?
Yes. But you dont want that for spigot plugins because one wont work.
You only do that for non-spigot dependencies like MongoDB or Redis etc
and if i add a random other dependency to my plugin I can shade it ?
If its not a plugin, yes
if the plugin is setup properly you can shade a plugin into another plugin. Just typically plugins are setup to work off their main class which can't be instatiated when you shade it in. But if the plugin sets up a secondary class that can be instatiated by another plugin, it could still work
not shaded
Think about it this way:
You need the classes when the server starts.
If you have another plugin already installed, then the classes of that plugin are there.
But if you dont shade for example MongoDB then the classes of this dependency are not there, so you need to bring it with your plugin.
Relocating dependencies when shading is why it is recommended to do to avoid potential conflicts if another plugin also has the same dependency
however more difficult to handle when its drivers like MySQL and MariaDB though
I was gonna make a organized system for subcommands by interating through a certain folder with all the files and code for the subcommands how i do it for discord bots but im guessing that isnt possible as you can only interate through files / folders in the datafile on the server and not the java files as its compacted into a jar?
In theory you can traverse files inside a jar.
But why?
just is more organized for creating tons of subcommands, cause then i can just create a new java file and wouldnt have to hard code every subcommand i add
isnt needed but 🤷♂️
I dont understand how you would use data driven commands?
They need to be hardcoded...
lemme show how im doing it
cant attach imgs rip
basically i have a folder called commands, inside that folder i have a baseCommand and an interface for subcommands and a folder called subcommands which has all the subcommands and their codes in them
the base command will loop through all the files in subcommands and load them into a map where then i can use for when the base command is called and call the code from there
idk if you have ever made a discord bot but its exactly how discord bots manage their command system
or atleast mine and most do
Ive written a few discord bots in different languages and have no idea what you mean
ClassGraph and reflections
that would allow me to go through the folders and files in the jar?
ig but just wanted to see if it was even possible too xd
Yes. And do not forget to set your package to whitelist.
Its possible for any java application
ah kk, didnt know how it worked with jars or if it was just the same as running it reg
all a jar is, is an over glorified zip file
jar uses everything from the zip standard except for compression if I recall.
yeah isn't that where it belongs?
it's where it'd also appear if one'd use annotations-java5 instead of annotations
What happened to removing the icons?
I haven't taken a look at that yet
but actually they belong there, as it's external links
if anyone is bored, feel free to find any bugs in the fixed javadocs of a popular spigot fork lol https://hub.jeff-media.com/javadocs/paper-api-fixed
I mean the original ones are really annoying to look at
hm, i wonder why this specific eyesore happens https://imgur.com/a/XdAxyoD
javadoc is one weird tool
i guess it's because that annotation is not applicable to primitives?
i can only assume it's something to do with the primitive array
shouldn't it be byte @NotNull [] instead of @NotNull byte [] ?
well, it "is", but it's not like it really means anything
it's not illegal to have void blah(@Nullable int hehe)
hmmm
so yeha my fix-javadoc-plugin won't deduplicate the wrong annotation but I guess that's not my problem
lol
hm I feel like my plugin should add newlines between annotation and parameter name
spigotmc
paper bad
paper fixed
Hey guys, does anyone have a download link for the LibsDiscipline plugin
does this look better or worse than annotations on the same line?
I mean it's at least consistent now
I'll probably just make the task configurable
I don't find anything about that when googling it
ok thx
how comlicated is it to send webhooks in a plugin
Depends entirely on your skill level
so complicated that it is easy
On a skill level from banana to pineapple id say its green
how do i do it
Lol what now?
Idk how to rate my skill level ive been coding in java for 1,5 years now
Years dont matter
well what else do you want me to say x)
But lets say you have the experience of a “1 yearer”
Then it ought to be reasonably straightforward how to do it
okay
It is easy enough that most if not all available malware does it
I added a .jar file to the maven repo on my pc
with a prompt command
but when i send my friend the plugin that uses the .jar file as dependency it doesnt work
it doesnt detect the dependency even tho its in the plugin folder with the plugin
Few spigot malware do this actually lol
How can i edit the mob inside the spawner to be a custom one (like a zombie with an armor)
Does Chunk.getPersistentDataContainer() actually load the chunk or just the persistent data?
probably not load it and then get it
I want it not to load.
load it and then unload it
Well at least most Skyblock malware has a discord webhook.
So I have been told
That is why I prefer to use file:// repositories
Skyblock malware?
Well all those fake Skyblock "utility" mods
Ah, I haven't touched mods much
its possible to put / merge nbt data from an entity to a mobspawner?
I do want to figure out basic stuff in forge & fabric though
A good portion of recaf's help requests are caused by people that want to modify a webhook URL
I doubt anyone in the respective communities would make me example malware I can base my work off of though lolol
It's probably around twice as large as those who want to remove license checks in bukkit plugins
lmao
Perhaps MMPA (Minecraft malware prevention alliance) and Recaf (although those hoarded by the recaf people are more likely to crash ASM or java's ZipFile API) could fork over some samples.
Eh. I doubt MMPA would, given they're doing their own thing
and really, I don't need anything super complex just starting out.
just working examples for
Player#setOp(true)
Player#getUUID#equals()
Player#getName#equals()
etc
The issue w/ both is the mods get obfuscated 😐
With fabric we are in luck I believe as they use intermediary
I'd have to check one of their jars, but I know forge is obf'd
At least I know multi-version jars are possible out-of-the-box
I'd still need jars for each version though, I'd need the bytecode
Yea, both forge & fabric jars are obfuscated
Huh
that's intermediary
Which means I'd need fabric & forge devs to make some basic sample malware, for each supported MC version
.
Hi 👋 I want to save a specific region as a .schem file with WorldEditAPI. When I enter the location where I will create the file, it gives an error in the console and the error content is "access denied". Also how can I set the name and extension of the file?
My file code:
File file = new File(plugin.getDataFolder().getPath() + "/schemdatabase/");```
continuing: modpack
I wonder what modrinth's modpack files look like 🤔
Caused by: java.io.FileNotFoundException: plugins\EventsAetheria\schemdatabase (Access blocked)
at java.io.FileOutputStream.open0(Native Method) ~[?:?]
at java.io.FileOutputStream.open(FileOutputStream.java:293) ~[?:?]
at java.io.FileOutputStream.<init>(FileOutputStream.java:235) ~[?:?]
at java.io.FileOutputStream.<init>(FileOutputStream.java:184) ~[?:?]
at tr.enes.eventsaetheria.cmds.EventCommand.onCommand(EventCommand.java:183) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
... 23 more```
Is there a snippet code to throw an axe with an armor stand?
probally somewhere x) but its probally easier to search for it urself
I've been searching on Google for 1 day.
then just so it urself ig
You are very clever. Thanks for help ❤️
Actually getting stuck in the block is pretty hard
just check if the block the armorstand is touching is not air
at the height of the hand if thats not self explanatory
and if you want to be really precise and different parameeters for fence/trapdoors etx
That would be a lag machine. I tried with RayTrace but still nothing.
why would it
no
just every time you teleport the armorstand check a single block
I'm not teleporting the armor stand. I use velocity and gravity
how can i establish a pub/sub system with jedis to sync cached data
oh well in that case maybe try to calculate the path it will hit
and predicted it
then just let it stop at that block/position
Yes, that's the part I wanted help with. ``` stand.setVelocity(e.getPlayer().getLocation().getDirection().normalize().multiply(2));
RayTraceResult result = stand.getWorld().rayTraceBlocks(stand.getLocation(), stand.getLocation().getDirection(), 500);```
When I look up into the air and throw it, raytrace doesn't work.
ive never used raytrace but ill look into it rq
gibe me a sec
what does it return
for you
exception when I look up into the air and throw it
because there is no block to hit ig
what do you want to happen when theres no block
just make a catch funtion for the case someone trows it there and do what ever you want to happen in that case
But because of gravity, it will fall to the ground.
catch the exeption, and make a new raytrace in the direction it will land
raytrace doesnt have gravity
so it will always go in a straight line
well but
if you use gravity
ray trace wont work in the first place
cause raytrace is straight
with gravity you need a curve
So is it ok to loop until it hits a block?
loop what
you could of course do some math and recreate the formular for how gravity and velocity effect the armor stand
and then loop through every block that is in that way
it would be rather complicated
but
work very well
just make sure to only calculate it roughly
otherwise it might take too long
Just set a velocity and let physics do the rest
he wants the armor stand to be stuck in the block it hits
so we need to know what block that will be
Yeah you can calculate that in runtime
thats the plan but the more complicated thing is how to calculate it
Launch the armorstand with a constant velocity and track it
but wont it hit blocks that arent in the way of the axe too like at the armorstands feet
What the hell
I do not
understand that sentence
That is not default mc texture there
also why r u using smth like 1.8
can jedis block the main server thread
If you call a sync method then yes
wait so pub/sub?
Well anything that returns a result will block while it gets the results
Not sure but probably
Recommend a good API for a custom rank system and cases (with beautiful animation)
Probably doesn't exist
demm
Most servers use luckperms, more or less covers the rank system part.
And cases, there are dedicated plugins for those, if they are what I think they are. No API only thing though
If you only use pub/sub why not use Apache Kafka?
Because redis is more popular in the field
¯_(ツ)_/¯
I make sure to support all of them
😄
for who? Minecraft developer?
Ye
By the way, how can I make the color of the rank - smoothly iridescent
@kind hatch how's the javadoc PR going?
@sullen marlin you're using annotations-java5 because of the javadoc issues, is that right?
I wrote a tool to fix the generated double annotations javadocs, it's currently a gradle plugin but I could also turn it into a maven-plugin - then we could also have type parameters, e.g. List<@NotNull Block> or stuff like that
Its nice to have a cache and message broker all in one for smaller systems
Absolutely I agree
Hi there , is there something wrong with this?
looks fine
though generally using an IntFunction is preferred ober new Array[0] if that's possible in your java version
futures.toArray(CompletableFuture[]::new)
guys how to detect if a specify arrow is moving
check the velocity
like theres no any event for arrow movement/
no
there's ProjectileHitEvent, or you can check the velocity of the arrow, or you can check its location every tick and compare it to last tick's location
Is it possible to get function from other class, and don't use new class()...?
pass an instance of that class to the other class
Hm
You often need a reference to your main instance (the instance of your class that extends JavaPlugin) in some of your other classes. There’s two basic concepts for this. Choose whichever you like more. Method #1: Static Getter First way is to create a static method called getInstance() or similar in your main class. You...
method #2
Guys, me need java-developer, who can write plugins?
?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/
Yes
comment
.._..
?jd
declaration: package: org.bukkit.configuration, interface: ConfigurationSection
Thanks, and another question, is there any way to get every ConfigurationSection in another ConfigurationSection? Like..
a:
b:
c: "A"
d:
c: "B"
e:
c: "C"
And i need to get every section in section a, (b,d,e)
what is better to do 1 big plugin or split it into several api
i think several api
Get all keys of the 'a' section and iterate
Depends on what you are doing
auto mine + ranking system + cases + bosses
Is it for a private project?
this is an order
you are doing submissions?
wdym
Anyways, this then depends on what the client wants.
Im always using a multi module maven setup for my server projects.
Resulting in 1 or 2 jars. 1 common library and 1 content implementation.
hm
I just don't know how it will affect the future
and what is easier as a programmer?
this not full structure
For me having one project is much more manageable than having multiple smaller projects
I hope you use the sparsely as using a lot of tile entities can lag out the server
Biome information is not block-wise. Its in 4x4x4 chunk sections iirc
well, with api it will be more difficult
i use region
there, despite such a structure, the simple plugin logic
demm translate
Hey!
I'm horrible at this.
This is my current code:
public void summonDeathCircle(float playerYaw, Location centerLocationLocation, int size) {
for (int d = 0; d <= 90; d += 4) {
Location attackLocation = new Location(centerLocationLocation.getWorld(), centerLocationLocation.getX(), centerLocationLocation.getY(), centerLocationLocation.getZ());
attackLocation.setX(centerLocationLocation.getX() + Math.cos(d) * size);
attackLocation.setZ(centerLocationLocation.getZ() + Math.sin(d) * size);
Vector direction = attackLocation.subtract(centerLocationLocation).toVector();
this.drawDeathLine(centerLocationLocation, centerLocationLocation.clone().add(direction.multiply(2)), .9);
}
}
It draws a nice pattern, but I want this pattern to rotate depending on the player's rotation.
Currently, the pattern is always facing North/South
Ok so first:
Location attackLocation = new Location(centerLocationLocation.getWorld(), centerLocationLocation.getX(), centerLocationLocation.getY(), centerLocationLocation.getZ());
Can be shortened to just
Location attackLocation = centerLocationLocation.clone();
After that i would def rename centerLocationLocation to centerLocation
Next:
Vector direction = attackLocation.subtract(centerLocationLocation).toVector();
This makes no sense. attackLocation and centerLocationLocation are the exact same location.
Subtracting them from another is very weird.
Ah nvm this is after modification
I wonder about the Math.cos(d)
These normally take in radians so passing, what seems to be a degree seems weird to me
So this draws a circle on the ground if i interpret it correctly. What is there to rotate?
That as well
He would draw like 14 rounds of a circle with 90 rads
What are you trying to do?
Draw a cone? Draw a circle on the ground? Draw a circle in the direction the player is looking?
It is supposed to draw this:
https://imgur.com/a/Tse6UfD
One of the changes I made seems to have made this into a perfect circle though 🤔
I dont understand how the players rotation changes anything in this circle
It doesn't change anything. It is always facing North/South
So is your plan to draw a perfect circle?
My plan is not to draw a perfect circle, but to keep the shape shown in the imgur post
well in your case, get the players Yaw rotation, do Math.toDegree(yaw) and add it to the "d" every time
I think
Eh
We first need to find out what he is trying to do. Because a perfect circle has no orientation.
So you want the circle to be more densely defined in one direction?
This is how i would probably calculate a circle around a center location
public List<Location> calculateCirclePoints(Location center, double radius, int points) {
List<Location> circlePoints = new ArrayList<>();
double increment = (2 * Math.PI) / points;
for (int i = 0; i < points; i++) {
double angle = i * increment;
double x = center.getX() + (radius * Math.cos(angle));
double z = center.getZ() + (radius * Math.sin(angle));
Location point = new Location(center.getWorld(), x, center.getY(), z);
circlePoints.add(point);
}
return circlePoints;
}
I don't think he wants a perfect circle
Ok but what does he want?
A circle thats more dense in a direction?
Or a cone in a direction?
This is my original code, without any changes:
public void summonDeathCircle(Location location, int size) {
Location originalLocation = location.clone();
for (int d = 0; d <= 90; d += 4) {
Location attackLoc = new Location(location.getWorld(), location.getX(), location.getY(), location.getZ());
attackLoc.setX(location.getX() + Math.cos(d) * size);
attackLoc.setZ(location.getZ() + Math.sin(d) * size);
Vector direction = attackLoc.subtract(originalLocation).toVector();
//TODO: Check if .9 space is better than .7
this.drawDeathLine(location, originalLocation.add(direction.multiply(2)), .9);
}
}
It basically looks like it draws half circles around the player.
They get smaller the further away they are.
Currently, this is locked to the North/South direction
I guess you can just add the players yaw to the angle like steve suggested then
PS: You need to translate the yaw from degrees to radians!
Thanks, let's try to do that
e
Its possible to change biome only to the block like a block of leaves for another biome and not the other block around
Biome data is stored in 4x4x4 chunk sections
Then how it does worldedit even modifying only into a block
How can I get BuildTools into my minecraft plugin?
I installed it from spigotmc
and ran the jar file
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
scroll down there
Thank you
What exactly am I looking for?
One of these
it does not, at least not on newer versions
(I think 1.15+ was when they changed the biome format)
anyone know why mosaic-internals from build src isnt found? https://github.com/MosaicMC/MosaicAPI
A few things
- Why is the folder called
buildSrcif its artifact is going to be called "mosaic-internals"? - You have two build files, one at the root (the correct one) and one under
src/main/kotlin(which probably isn't what you want and is named incorrectly)
Also not entirely sure why you're declaring plugin('mosaic-internals'). It's definitely not a Gradle plugin. It's a dependency, no?
Ideally your projects are as follows:
mosaic-internals/build.gradle.kts:
plugins {
id("org.jetbrains.kotlin.jvm") version "1.9.0"
id("java-gradle-plugin")
}
repositories {
mavenCentral()
}
group = "your.group.id"
version = "1.0.0"```
`mosaic-config/build.gradle.kts`:
```kotlin
dependencies {
compileOnly(project(":mosaic-internals"))
}```
`mosaic-core/build.gradle.kts`:
```kotlin
dependencies {
implementation(project(":mosaic-config"))
implementation(project(":mosaic-internals"))
}```
Or something to that effect
And maybe setting up the kotlin and gradle plugins somewhere in the base build script or something because you'll probably need them in all your projects
buildsrc stuff is weird
i dont like it
alex used it once https://github.com/mfnalex/PAPI-Replace
its just weird
and for some reason its defined as plugins
they told me to use buildSrc lol
I’d avoid buildSrc partly because it fucks up incremental builds
includeBuild >>>
(:
what is normally?
This was a while ago, perhaps it was solved
it goes in each build,gradle
Ew, yeah, that looks fucked. I guess buildSrc was a thing?
the gradle docs says to use build src
ignore them
"preferred" by who bruh
Yeah that looks awful
Its not a zero cost abstraction
i hate buildSrc tbh
I would avoid it unless you have some explicit reason to use it
Very epic stuff
Typically you only write/change buildSrc just so often so the incremental build benefits ought not to affect you by much
But yeah
How to check if config file exists?
In your jar file or plugin folder?
i mean, i want tehn add way more shit on top of it and i will also be using include lol (and also changing the name of the artifact)
if (Files.exists(plugin.getDataFolder().toPath().resolve("config.yml")) {
…}
or just new File(plugin.getDataFolder(),"config.yml").exists()
thanks!
Why lol
I have yml config
a:
b:
c:"d"
to get access to "a" I can do like ConfigurationSection a = config.getConfigurationSection("a")
but if i'm trying to get "b" from a like this, i'm getting "null"
ConfigurationSection chatSection = plugin.getConfig().getConfigurationSection("a");
System.out.println(chatSection.getConfigurationSection("b"))
- null
did you load it correctly?
it just seems like more effort than its worth
depends on the size of the project
I'm not sure
but if i'm trying to do chatSection.get("b")
it's working
saveDefaultConfig is a thing my g
oh
I usually just have a class that I extend and load the config values tho
best config solution into pojo?
writing your own
yeah makes sense
hibernateyeah maybe just write ur own ORM or use configurate perhaps?
annotation daddy here i come 
i made my own annotation based config system
i never been so happy
i can subclass it
i can make per different modes
I hate annotations
myeah its not particularly object oriented
but it may at least reduce boilerplate arguably
it does help with type safety
unless you forget to register custom types
then it'll scream at runtime
idk I mean regular java helps just as much with type safety
dont think annots have any benefits there
Well no
compared to getting values from configurationsection
I mean most stuff would be loaded eagerly anyway (hopefully)
Why i cant sort java list?
List<String> chats = chatSection.getKeys(false).stream().toList();
Collections.sort(chats, (o1, o2) -> 0);
- Caused by: java.lang.UnsupportedOperationException
Objects from config is quite performant as they are decoded the first time the config is touched (usually at startup)
everything is loaded early
no computation required after
unless i wanna save it
it's all tidy in record like objects
toList returns an unmodifiable list i believe
use .collect
collect(Collectors.toList()) yeah
?learnjava for someone
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
thx
Hello, I have a question, how do I create and use a file that does not exist within my plugin?
Easiest way is probably the old file api
ur old
File file = new File(plugin.getDataFolder(), "myfile.txt");
if (!file.exists()) {
file.createNewFile();
}```
ok but how do I use it in a .yml file with the spigot api that it has?
now use dfu
YamlConfiguration.loadConfiguration(file)
ah ok is that I needed to know because I plan to make a command that created a file and that the plugin takes care of reading it and using it if it exists.
nerds what does this mean
Looks like string compare lol
__main__ is the name of the environment where top-level code is run.
man
python smells
For most practical purposes, you can think of the conditional block that you open with if __name__ == "__main__" as a way to store code that should only run when your file is executed as a script.
/chatgpt what is if __name__ == '__main__' in python
and enjoy
then say something like "that is wrong, your reasoning is flawed"
or just google it and get an answer instantly
Tis what I did
no no i prefer entertainment
like when you tell it that 2+2 is 8 or whatever and it will be like, ah yes i apologise
the only joy I get from chatgpt is making it write movie scripts for my friends to read
I think they made it more resistant to gaslighting
python sucks
i hate java sometimes
real
that'll only run if you execute the script directly
If you run it through another script or use it as an import statement or whatever it won't run
Yes
or you just don't know what to use the language for :P
hands down one of the best scripting languages
bash replacement?
I'm using python rn to migrate a SQLite DB to MySQL, for example
so just script
bash is just cursed as fuck idk how anyone uses that
You can do games and what not w/ python
if my scripts are small I'll write bash otherwise doing python
AI is a huge thing
if your braindead you do games with python
otherwise yu stick to data science, AI, and scripting
I don't like python but I use it to do the small things that there's no point in making it using java
Hello, would you please sort out these errors? https://cdn.discordapp.com/attachments/395339753375137820/1148278642607128687/image.png
AI isnt games
you can write games in bash and C and assembly too, people did it, but you would be insnae to do it.
just because it exists doesn't mean it is nice
AI, games, etc, etc are all possible in python
python is also great for writing quick mockups
you can make games in css too
https://en.wikipedia.org/wiki/Doki_Doki_Literature_Club! uses python, for example.
Runs quite well, even though it's a VN
or a good indie game that's more than pngs
AAA games suck ass now adays
with a few exceptions nothing good has been released in a while
who uses mcedit in 2023???
i'd be concerned if it wasn't possible
aaa games dont use cuz there are better alternatives
Nobody because it died 6 years ago
you have unity whoch uses c#
you have unreal engine using C++
just go out and fucking learn something else than python
But it was the most popular world save editing tool for a long while
it is not anymore so it is completely irrelevent so
python is a good lang its okay if you dont like the syntax but you can't deny its uses
(which then are completely unmaintable)
all my homies use amulet now
i hate gradle
Is amulet anywhere close to the og mcedit
then use maven
maven is even worse
idk I haven't used amulet in a while
you just love to hate things don't you :P
then use java's compilation commands kekw
aint n oway im gonna use html to configure shit
html?
hell no
xml
xml is awesome
Now that's an idea
xml is just html with custom tags
html based java buildtool
@young knoll hi chollco
hi
i dont see difference
both suck and are not made for configuration
I am chocos replacement while he is away from home
no I'm pretty sure xml is purely used for configuration
not sure what you're on about
c# shit is also on xml drugs
I stay away from web development I don't have a death wish
brainfuck based configuration
that'd be awesome
then why the hell would you use xml which looks like html on drugs
no, xml is used to store data and also it is just a markup language, it cant do everything that an actual language can
for example xml files in .de are good but then using them to actual configuration sucks
xml data storage is yikes
store data with xml?
YES?
I program in machine language
the only good use for maven is not to use it
maven is great
basically just use project settings in intellij
and dont touch maven at all
do you like anything?
i love kotlin
you're just bad at navigating them
no, i actually can navigate however they cant answer questions i have nor help with gradle at all
comparatively to maven I've found the gradle docs less than helpful in many cases 🤷♂️ just my experience though
and are mostly outdated with stuff that are no longer relevent
so then you need to search on google about gradle
which is also painful, becuz usually your use case of gradle is very narrow, like me making multiproject in gradle
I only use maven kekw
I switched back to maven recently
and actually spent time learning how it works
able to actually just write up a biuld file now only have to look up plugin versions
also maven docs are even more outdated than gradle docs lmao
The kotlin docs used to be lacking
?paste
But now that they use kotlin by default it's probably better
all I need in life are spigot javadocs
whatever code examples they have now there is a little toggle to show groovy or kotlin
kotlin docs are one of the best places i have ever been imo
gradle kotlin docs*
no they aren't? the ones for plugins themselves are up to date on the latest plugin versions
mmm that's the quickstart guide
Does someone have an idea why this part of the plugin msg is getting included? If I print the msg everything else gets sent except the last part of it
every maven project has that
thats the problem
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
no its not, why update it every year if nothing has changed
i mean why use shit that wasnt touched for 22 years
because.. it works?
be aware that Server#sendPluginMessage will broadcast the message to every client connection
that’s the point of a standard..
git commit -m "updated year to 2023, nothing else changed because it still works the same way it did last year, and the year before, and the year before, and 2001"
just because something is new doesn't mean its automatically better. the standard has been in place so why change it just because new good?
oh wait until you hear about TCP/IP
it is not good, thats the problem, the old standard isnt good
what makes you say it isn't good exactly? "it's old"?
its xml is probably the only reason
yes
move to #general or #verified so ppl can get help, someone has asked a question so it's time to move
that's not even a good reason

