#development
1 messages · Page 27 of 1
how would u know
I think I know what I consider my own time worth
u maek no sense
it's my own time
it makes total sense
I am the one to decide if I find my own time I myself spent on doing something worth it or not
why are you even testing code, if your not 1 shot writing ur code with perfection, then you shouldn't be a programmer
alr so what do i do?
what ur doing is fine
but it doesnt work :/
why not
shadowJar doesnt generate javadoc or test file
move the test plugin out of the src/tests directory
thats usually for automated tests
make a test plugin module
ok i made test-plugin
put the plugin in there
done
good job
now what :/
code it like a normal plugin
what, it already is tho :/
this is what i have rn https://max-is.very-stinky.com/idea64_psEQlyZAf8.png
still need help 
did you configure it
it won't automatically add the stuff in test-plugin to the jar
why not just add like a test command instead?
idk how your test-plugin works
but if it was using mockbukkit it'd be in tests
its just a plugin thats compiled
but why not combine it all into one?
wdym?
and have like a config option or constant for test
what do you have in test-plugin?
a plugin that uses (tests) the api thats in main
tbh I'd just make a command that tests the api
I mean like why not combine it into the main module
cause then the api would include the test plugin which is unnecessary, cause no ones ever gonna use it
isnt that what i did?
ok how do i make another module
ok i figured everything out
but i still need to find a way to have gradle shadowJar also generate javadocs jar (doesnt have to be uber)
here
Task 'javadocJar' not found in project ':AnnoyingAPI'. Some candidates are: 'javadoc'.
i think u need the java-library plugin
nope, still doesnt work
try
java {
withJavadocJar()
}
ye thats what i had before, but i dont think it runs with gradle shadowJar
o wait that made the gradle shadowJar javadocJar command work nice
ok last issue i think
so rn in the main build.gradle.kts, i have this:
plugins {
java
id("com.github.johnrengelman.shadow") version "7.1.2" apply false
}```however, since `java` is there, when i run `gradle build` in the root directory of the entire project, it generates an empty jar file in `build/libs` (as well as the `build` folder in general). how can i prevent it from generating the `build` folder when running `gradle build`?
uh the proper solution is to not have the java plugin there
idk about the whole build folder but you can stop it from creating a jar with tasks { jar { isEnabled = false } } or something similar, i don't remember the exact field name
but i need it for dependencies and stuff
if i remove it, it errors and doesnt build
well yeah it's not "just remove it"
it's a tad more "complex" if you have a simple setup
alright ill go the lazy route per usual
you could just run the nvmtest task
its the exact same as build but doesnt run the jar task
ended up doing this btw, to prevent everything from running:
// Prevent java tasks for root project from running
tasks {
jar { enabled = false }
classes { enabled = false }
assemble { enabled = false }
testClasses { enabled = false }
check { enabled = false }
build { enabled = false }
}```
can someone help me to build a jar file for my plugin?
i think my issue is with the pom.xml file
?paste
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
Paste the build file then
Huh? I said build file, since you said that's the one with the issue
you mean the .xml file?
im new to this whole thing how do i get the build file?
because build artifacts button is greyed out which i think i need to do that to have it build the jar file
i tried building project and i think it does that succesfully
Executing pre-compile tasks...
Running 'before' tasks
Checking sources
Copying resources... [ChatPoll]
Running 'after' tasks
Finished, saving caches…
Executing post-compile tasks...
Finished, saving caches…
the second file i pasted is the pom.xml
hmm now i am getting this error "Unresolved dependency: 'net.md-5:bungeecord-chat🫙1.16-R0.4-deprecated+build.6'"
hmm i got it to compile and it loads my plugin in game but the command /poll doesnt work
Someone that has experience with Laravel?
public function storeCSV(Request $request){
$request->validate(rules: [
'file' => 'required|mimes:csv'
]);```
Because why doesn't this validation work? The mimes dont work
Please @ me
what kind of api?
im capping nvm
is there a better way to communicate between bungeecord/waterfall and paper except plugin messaging? just wondering
Hi, I'm trying to work with configs, but when I restart the server the config resets. Does anyone know how to solve this issue?
and the config setup func:
redis
I have a layout setup, with a number of plots, and they are assorted sizes. In between the plots, I want paths. I only want paths when the plots are occupied, so they need to be custom. I can get a schematic, but I dont want a hundred different schematics for each use case. Is there anyway to take a long path schematic and crop/cut off the part that I dont need?
there is a WalkyTalkie system that I might be able to find the github for
nevermind, I might have lost it.
ivan's?
RadioScanner
iirc
Yeah, sockets are nice
It depends, is it a complicated path with lots of different types of blocks, or just a solid path?
It's complicated
hi, for some reason gradle is adding an old classpath to my jar file
xyz.srnyx.testplugin, i renamed it to xyz.srnyx.annoyingexample, the testplugin one doesnt even exist anywhere
ok i fixed by removing build/classes/java/main/xyz/srnyx/testplugin
hi
one question about deluxe menus
it's possible i create a item and when click say to put a value
when i put return to menu with the args provided
?
sure
#dev-general message
@icy shadow i unfortunately took ur advice... but what would relocating do exactly, and exactly how would i go about doing it if i did do it?
also, how can i make it so that when checking for dependencies, i can prevent stuff like this:
PluginA has dependencies DiscordSRV and ViaVersion
PluginB has dependencies DiscordSRV and EssentialsX
since PluginA and PluginB both depend on DiscordSRV, it'll be downloaded twice, how do i prevent that?
i unfortunately took ur advice
lol
since PluginA and PluginB both depend on DiscordSRV, it'll be downloaded twice, how do i prevent that?
No need
but what would relocating do exactly, and exactly how would i go about doing it if i did do it?
idk what u mean
wdym no need there is need, i dont wanna spam (well just unnecessary calls) the modrinth/spgiot/bukkit/external servers
idk he said something about relocating
I mean ppl host maven central mirrors but I don't think one for spigot/modrinth/etc are needed since you're not downloading it each time (I'd assume it'd be cached, no?)
do you know what relocating is?
sry i shouldve been more clear. my api downloads plugin dependencies specified by the plugin using the api
so in the example i gave, the api would download DiscordSRV onto the server
downloads, enables them if specified
note that they likely have ratelimits (modrinth and spiget have ratelimits iirc) to prevent excessive traffic already
yea but i'd rather not hit those ratelimits, could lead to getting blocked too
also uhh i personally have a plugin which calls spiget like 20 times every time i start the server
lol
it was difficult to find a pastebin service with non-strict ratelimits that could allow editing
it doesn't allow editing though ☹️
ok so how would i fix issue if i only wanna download duplicate dependencies once
only download it if it's not already in the server plugins folder
problem is that it checks dependencies at the same time (on load)
so all the plugins using api checks dependencies before any of them even start downloading
you can either:
- you can make it check first thing in onEnable
- open each JAR file and check the plugin.yml
i do the second one
2nd one doesnt make sense
what jar file would be opened
every file in plugins/
but when dependencies r checked (on load), none of the dependency files exist yet, cause none of them have been downloaded
but then they'd already be downloaded...
so that PluginA and PluginB dont both download DiscordSRV, only 1 of them should download it
it would be downloaded it plugins/
so check if it already exists
if it doesn't, download it
if it does, do nothing
but they're checked before any of the plugins start dependency downloads
block the main thread
it's in onLoad anyways and it shouldn't take a while so it doesn't matter
unless onLoad is async
ig u can check that but i dont think it is
wait sry they're checked onEnable
probably shouldn't be but now you're sure it's sync
im 99.99999% sure onEnable runs sync
is there any other way? blocking main thread sounds dangerous and a bit excessive
wait are you loading the plugin manually?
which one? the dependency or mine?
spigot does it themselves
with its library loading feature
iirc
are you loading the dependency manually?
like
for example luckperms
are you downloading it and enabling it on the same server run?
since if so, you'd have to use onLoad probably
if the dependency has enableAfterDownload set to true
yeah I'd use onLoad then
since then you're going to be calling onLoad and onEnable in onEnable
which may cause issues
alr then there is new issue
i want the plugin to load after the dependencies are installed
hmmmmmmmmmmmmmmmmmmmmm
what if i just loaded the dependencies?
spigot might try loading it twice
the dependency of the dependency I mean
no they don't
well they don't load at the same time
they load in a for loop
so pretty close
ok i checked spigot code
and it looks like it wont
link?
spigot first gets a map of all the files, and then runs a for loop to load each of them
im using intellij
yes, and those can include the dependencies of the dependencies
it cant
the dependencies wont have been downloaded yet
- Spigot gets plugin files (
plugins) - Spigot loads plugins from
plugins
a. Plugin using API is loaded
b. Plugin downloads dependencies
c. Plugin loads dependencies - Spigot enables plugins
This isn't true but let's say LuckPerms depends on PlaceholderAPI
Your plugin depends on LuckPerms
Your plugin downloads and enables LuckPerms BUT PlaceholderAPI hasn't enabled yet because that file has not been reached yet in spigot's for loop
LuckPerms fails to enable due to the missing dependency
Later, PlaceholderAPI downloads the files
if luckperms depends on placeholderapi, then my plugin would also declare placeholderapi as a dependency
alr then it should work
wait would it
you can look at plugwoman's code for the plugin loading/enabling
you'll have to call onLoad and onEnable at the correct times though
if (enable && dependency.enableAfterDownload && manager.getPlugin(dependency.name) == null) {
try {
// Load and enable plugin
final Plugin dependencyPlugin = manager.loadPlugin(dependency.getFile());
dependencyPlugin.onLoad();
manager.enablePlugin(dependencyPlugin);
// Register commands
PluginCommandYamlParser.parse(dependencyPlugin).forEach(command -> plugin.commandRegister.register(command, dependencyPlugin));
plugin.commandRegister.sync();
} catch (final InvalidPluginException | InvalidDescriptionException e) {
plugin.log(Level.SEVERE, "&4" + dependency.name + " &8|&c Failed to load plugin!");
}
}```
maybe i should just live with multi-download
ok im going to sleep
Hi
Help me pls
I have luckyperms installed on the bungeecord
How to make placeholders work
Plugin placeholder himself is on the other bedwars server
For some reason, it does not work on the bungeecord
u should keep count
where BM? :(
smoking crack
Does anyone have experience with this shit https://advancedplugins.net/item/Tokens.3 ? I try to make an enchantment for someone using v2.15 and it doesn't want to proc LOL
Code: https://paste.helpch.at/siyapeqipi.java
High-speed enchant system - Must-Have for Prisons - Free Enchantments & Addons | AdvancedPlugins.net
what? keep count of how many times ive had to redirect people to the correct channel?
ive already lost count
You should find them
What
Any ideas? 
I already did that 😦
have u tried googling for examples or asking the author of tokens?
here's some examples, but the source codes arent available so you could try decompiling (if ur using intellij u could use that): https://advancedplugins.net/category/addons (ones starting with T-)
if u do decompile, just make sure to not use any of it's code, else it'd be against whatever license they have
One-stop location for all Advanced Plugins. Find Minecraft Plugins, Addons and Configurations for our plugins and more.
with which part? dying or making a plugin?
Ah. Well then, I present you:
What are you trying to do, and what do you have so far?
Thanks hahahahahaha
Always here to help!
I'm trying to set specific coordinates or warps and then make all the players in a team randomly teleport to one of them
Now time to wait for both Discord and Minecraft to ban me because talking about this kind of stuff is against their TOS.
😭
for each player
Alright so it sounds like you want a list of location objects.
nooooo, sorryyyyy
And then you would loop over all over the players in that team and for each one pick a random entry from the list of locations
I don't think Java has a random method on their lists, does it? I'm still in Kotlin mode.
I feel you 😭
I have to learn python
it sucks
I copied another plugin, i dont want to create a public plugin because I'm a twitch streamer and i just want to use it in my server
so i will show you what i have give me a sec
Okay!
List<Integer> list = Arrays.asList(firstElement, secondElement, thirdElement, etc);
Random random = new Random();
int randomElement = list.get(random.nextInt(givenList.size()));
This is a simple way to get a random element from a list in Java. It indeed does not have a method provided like Kotlin.
A thing to note is that you can get duplicates as it doesn't remove the elements from the list. Also you should probably not create the Random object every time you get an element
That is correct. You can make a one-off function that just calls a class initialized random object.
if (cmd.name.equals("randomwarp", ignoreCase = true)) {
if (args.size == 0) {
sender.sendMessage(ChatColor.RED.toString() + "You have not specified a spawn arena name!")
return true
}
if (args[0].isEmpty()) {
sender.sendMessage(ChatColor.RED.toString() + "You have to specify a warp channel!")
return false
}
// Here i want to set the myPlayerTarget var to each players of the args[1] team
}
// these 3 lines work perfectly, it teleports my players to the random warps, but only to specific players
val locList = locationMap[args[0]]!!
val `in` = randInt(0, locList.size - 1)
if (myPlayerTarget != null) {
myPlayerTarget.teleport(locList[`in`])
}
return true
}
this is the part i need to correct
the only thing i need is the team part, make every player tp
public class MyClass {
private final Random random = new Random();
private final List<Location> locations = new ArrayList();
// Stuff here, maybe add locations to the list.
public Location getRandomLocation() {
return locations.get(random.nextInt(locations.size()));
}
}
That might be the class setup that would have the random and the list of locations and then there's the function to pull a random location from that list.
You need to have your list of members in the group somewhere, so you need to iterate over all those members and then player.teleport() them.
fyi, unrelated to ur problem, but u should be using CommnadExecutor instead of listening to the command event (i assume thats what ur currently doing), here's a wiki on how to use CommandExecutor: https://spigotmc.org/wiki/create-a-simple-command (i didnt fully read over it so im just hoping its sufficient 💀)
and for the teams is there any Team.members or else?
I mean Team is not a thing in Minecraft. You have to make that yourself.
Actually Scoreboard Team might be a thing but yeah.
yes it is
Thankyou! i will take a look
In terms of what he is wanting, I doubt it's that.
if ur using minecraft's scoreboard teams it'd be Team#getEntries, which returns a list of player names im pretty sure (so you'd use Bukkit#getPlayer to turn the name into a Player)
if ur not using scoreboard teams it'd be something different, depending on what ur using
the command 7/team join,and etc doesn't exist in minecraft? maybe i was using a plugin and didn't know
alright yea ur using scoreboard teams, so use Team
hhmmmm okey okeyyyyy, thankyouu
if u need help with getting the Team lmk
unfortunately here in my country it's super late, i entered the server as a last resource hahaha, tomorrow i will try again and probably come back here to cry a little bit more, thank you so much @dark garnet @mental cypress and @broken elbow 😁
in case you guys haven't noticed
this is kotlin
btw
so you can use the random function
so this probably wont work for u @dusty prawn (but go sleep and do it tmr bc late night developing is not fun 😭)
there's a bunch of stuff that can be changed but since they're new I'll just leave it how it is
ye its better to just solve the original issue they have than to start telling them everything they did wrong
only good to do that with devs that have a bit of experience and will actually understand everything ur telling them
yeah
i basically only said the above message just because I wanted to show that it's not kotlin in its full potential
🤩
kotlin = best
lucky u did say something else we'd be continuing to help in java 💀
not used to seeing new devs (or at least new mc devs) start in kotlin
thing is, i literally saw the ignoreCase = true and my brain just processed "ok so its basically doing equalsIgnoreCase"
To give you credit, it can be a bit hard without it being on a codeblock
dude where is he this is a hugeeeeeee emergency
im going to literally actually irl start crying
smoking crack
how much does he have to last him this long?!?!?!
Wrong gif but you get the idea
Java > kotlin
Java + kotlin < all
Is there a way to create new servers from a plugin in velocity?
I have little experience with velocity, but I would have to guess you wouldn't be able to. You'd need to manually make them
You can change the config and use the reload command in order to do it, this is why I would guess it would be possible via the API
Changing an already existing file and running a command is one thing, but Creating an actual server...
Yeah I mean adding the server onto the config file programatically
Not actually creating the minecraft instance
I found this in the velocity 3.0.0 javadocs https://jd.papermc.io/velocity/3.0.0/com/velocitypowered/api/proxy/ProxyServer.html#registerServer(com.velocitypowered.api.proxy.server.ServerInfo)
Seems like something to look into, thanks
Ghost ping?
Hello, It's me again
after this message I am today trying again hahaha, What i understood is that i need to use Kotlin, does anybody know how to acces the memebers of a scoreboard team in kotlin coded plugin?
(I deleted this message 😛)
var board = Bukkit.getScoreboardManager()!!.newScoreboard
var myBoard = board.getTeam(args[1])
for (player in myBoard. <HERE> )
{
val locList = locationMap[args[0]]!!
val `in` = randInt(0, locList.size - 1)
player.teleport(locList[`in`])
}
Okey i think i have something, i just need how to get players from the team
d;team#getentities
@NotNull
Set<String> getEntries()
throws IllegalStateException```
Gets the Set of entries on the team
entries on the team
IllegalStateException - if this entries has been unregistered\
@dusty prawn
Thankyou Gaby
I did it!! i achieved my first goal!! yeeeeeyyyy (Spoiler i did not)
var board = Bukkit.getScoreboardManager()!!.mainScoreboard
var myBoard = board.getTeam(args[1])
for (player in myBoard!!.entries )
{
val locList = locationMap[args[0]]!!
val `in` = randInt(0, locList.size - 1)
Bukkit.getPlayer(player)!!.teleport(locList[`in`])
}
It now works, but only for 1 player
Okey, Its because geyser renames them with .(name) any clue?
now i did it
Help please.
I have the code
` @EventHandler
public void test1 (PlayerInteractAtEntityEvent click) {
Player player = click.getPlayer();
ArmorStand stand = (ArmorStand) click.getRightClicked();
if (stand.getScoreboardTags().contains("VehicleMP")) {
stand.addPassenger(player);
}
}`
And it causes this exception
Internal Exception: java.lang.IllegalStateException: EntityDismountEvent cannot be triggered asynchronously from another thread.
i see no reference to the EntityDismountEvent, are you sure its this chunk of code thats causing the issue?
I want check if a player is somewhat looking at an entity. I dont need their crosshair on the entity, I just need it with -45 yaw and +45 yaw of the entity. How can I get the direction of the entity from the players perspective? Or is there a simpler way to accomplish what I want done?
I get this error, I have done like the guides I find when google to set up modules and dependencies. But of some reason can't it find the class when compile.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] H:\idea\Cheststorage\Core\src\main\java\org\brokenarrow\storage\CCH.java:[17,34] error: cannot find symbol
symbol: class DatabaseAPI
location: package org.brokenarrow.storage.api
[ERROR] H:\idea\Cheststorage\Core\src\main\java\org\brokenarrow\storage\database\Database.java:[4,34] error: cannot find symbol
symbol: class DatabaseAPI
location: package org.brokenarrow.storage.api
[ERROR] H:\idea\Cheststorage\Core\src\main\java\org\brokenarrow\storage\database\Database.java:[40,42] error: cannot find symbol
symbol: class DatabaseAPI
[ERROR] H:\idea\Cheststorage\Core\src\main\java\org\brokenarrow\storage\CCH.java:[285,8] error: cannot find symbol
symbol: class DatabaseAPI
location: class CCH
[INFO] 4 errors
[INFO] -------------------------------------------------------------
btw u should be declaring locList outside of the for loop
and remember that locations will be reused (as in 2 players can be teleported to the same spot), but i assume thats what u want
all i know is that it'll involve ray tracing, maybe that'll help u (or someone else) figure it out
wait why do u need the direction the entity is looking?
For a chat plugin. I only want the chat to trigger when the player is semi looking at the npc
So I need the players yaw
And then I still have yet to figure out the yaw that will hit the entity
have u tried using ray tracing with a bigger raySize (i think default is 0.1 or something)?
d;world#raytraceentities
@Nullable
RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize)```
Performs a ray trace that checks for entity collisions.
This may not consider entities in currently unloaded chunks. Some implementations may impose artificial restrictions on the maximum distance.
the closest ray trace hit result, or null if there is no hit
start - the start position
direction - the ray direction
maxDistance - the maximum distance
raySize - entity bounding boxes will be uniformly expanded (or shrinked) by this value before doing collision checks
I think I can use this with the players look direction and then using a raysize of 3 to expand the hitbox by 3 times.
ye that should work
wait will the result return a list of entities? or just one? if it just returns 1, it might not work if other players r nearby (unless u add a predicate)
its just one
here is how I did it
Entity entity = newPlayer.getWorld().rayTraceEntities(newPlayer.getLocation(),
newPlayer.getLocation().getDirection(),
3,
3,
entity1 -> entity1 instanceof Player && !Bukkit.getOnlinePlayers().contains(entity1)).getHitEntity();
if (entity == null) {
continue;
}```
u can remove the !Bukkit.getOnlinePlayers().contains(entity1) part, entity1 instanceof Player already does the equivalent of it (since a Player can only represent an online player)
wait
I already tried the first part alone
its weird, an NPC is like a fake player
it isnt considered an online player, but is still a "player"
r u using java 16+?
also if u have other npcs in ur world, u should add another check to make sure its the right one, unless it doesnt matter what npc it is
I am using Java 17
yeah I have something for that too
I was having issues of the npcs being triggered by other npcs as well
that is where the check for if it was an online player came in
u should do this then: entity1 instanceof Player player1 && !Bukkit.getOnlinePlayers().contains(player1)
just for consistency and readability
yeah I have the pattern variable in my current code
o ok, i dont get such privileges in java 8 
yeah, that is one of the big reasons I am coding for 1.19
just the straight up java features are worth it
ye im only doing 1.11+ cause its an api
ah
I am building my own network, and I just going to make a backwards compatible system to allow previous versions
have u already tried viaversion + viabackwards (+ viarewind)?
yeah. and then I am modifying the server jar to make it as bare bones as physically possible for my server
sry i cant choose 😭
I am not too worried about performance, but it is still good to consider
you probably won't care about this but I found https://github.com/Bloom-host/Petal which is a fork of pufferfish which is already fast which might have patches that you want 🤷
it's still new though and might not be stable
yeah, it is fun being the only one who gives a f*ck about anything related to the server, and being able to make all the choices.
yeah, I have heard of Petal, but havent tested it out yet
oh i was talking about me choosing which big brain emoji to use but yea that too
wasnt there controversy with bloom host? or was that a different one
ah, applies anyways
no idea i haven't heard of any controversy of any hosting company
from everyone I know they love Bloom
probs a different host then
I know OVH has some controversy
I am not really sure what their issues were, but I have heard from a lot of people to stay away from them
it was a while ago, it was just a host doing sketchy stuff or something idk
ah

anyone else know what BM meant cause he is no where to be seen 😭
Wdym by "it'll be downloaded twice"?
Need more context and too lazy to go up and read all
I tried this and it still triggers if they are anywhere around me, not just if I am facing them
ignore that, just need this answered:
but what would relocating do exactly, and exactly how would i go about doing it if i did do it?
try using newPlayer.getEyeLocation().getDirection()
I am currently using that
this is what i have:
final Location eye = tagger.getEyeLocation();
tagger.getWorld().rayTrace(eye, eye.getDirection(), range, FluidCollisionMode.NEVER, true, size, check);```
RayTraceResult result = newPlayer.getWorld().rayTraceEntities(newPlayer.getLocation(), newPlayer.getEyeLocation().getDirection(), 3, 2, entity1 -> entity1 instanceof Player player1 && !Bukkit.getOnlinePlayers().contains(player1));
if (result == null || result.getHitEntity() == null) {
continue;
}
if (result.getHitEntity().equals(getEntity().getEntity()))
inDialogue.add(openPlayerDialogue(newPlayer));
im not using rayTraceEntities because i also needed to check for blocks
i think 2 is too big
mine uses 0.2 and it just barely goes off of the entity
i dont think so idk
cause 0.1 is if u want them to be looking directly at them
I don't know about your case specifically but here is an example
Plugin A shades lib A v1
Plugin B shades lib A v2
If A loads first, it'll load v1 therefore breaking B
If B relocates A to be B.A, now plugin A shades lib A, and plugin B shades B.A, now when they load it'll be loaded like a different lib therefore not causing any issues
raySize- entity bounding boxes will be uniformly expanded (or shrinked) by this value before doing collision checks
ye but ive tested it a lot
cause im making a laser tag plugin
is it expanded by blocks?
i have no idea, i just continuously tested until i got what i wanted 💀 (which is 0.2, gives the player a little bit of aim assist, but not too much)
ah
i was using 1 at first and every time we tested the game ppl would be able to shoot players way too easily (basically not actually hitting them)
ohhhhh, so if:
Plugin A shades lib A v1
Plugin B shades nothing
Plugin B will still be able to use lib A v1 from Plugin A's shading of it?
not what i want to do, but this will help me understand it
I tried 0.8 and it works perfectly 🙂
yay!
I will send video in a few minutes
alr
btw u should probably make it check if the npc is nearby the player (maxDistance) so that it doesnt fire unnecessary ray traces (unless Entity#getNearbyEntities uses ray tracing, but idk)
d;entity#getnearbyentities
@NotNull
List<Entity> getNearbyEntities(double x, double y, double z)```
Returns a list of entities within a bounding box centered around this entity
List<Entity> List of entities nearby
x - 1/2 the size of the box along x axis
y - 1/2 the size of the box along y axis
z - 1/2 the size of the box along z axis
I check that first actually
and then it loops through those and then does the raycasts
and it only raycasts every 5 ticks, which means it has a little lag, but doesnt slow down the server
Yeah
ok so i should definitely relocate
how is the real api
i need the api
the plugin is not working
bro what
Are their any sources to see api changes from 1.19.2 to 1.19.3?
exactly smh
Bro
Is not working
This
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
Is not working
okay
Bro I need the right api to program my coin system because the plugin doesn't work
At the end, the real api was the friends we made along the way
the real api, they need the api for their plugin
hope that helps
this is the closest thing i could find: https://hub.spigotmc.org/changelog/
View the Bukkit, CraftBukkit and Spigot changelog.
i forgot to ask how to relocate or if u have a recommended guide
oh its literally just that ok
Yeah it's very simple
now could it be possible for my api to be relocated without requiring anything in the project using the api?
so like something i could put into the api to make that happen?
if not, how do ppl usually make an api, ensuring versioning isnt an issue and without requiring relocation?
What do you mean "doesn't work"
is this the correct way to relocate? or should the destination be in a different format?
relocate("xyz.srnyx.annoyingapi", "xyz.srnyx.annoyingexample.annoyingapi")```*`xyz.srnyx.annoyingexample` is the plugin*
sure
yes
hey. I've a question with dependencies.
currently I have a quite big dependency (is not a plugin) that I shadow inside the plugin.
is there a way to just place it in the plugins subdirectory 'libs' or something like that and load it from there?
or since it's an implementation it wont work?
I can't import me.clip.placeholderapi.PlaceholderAPI;
import it says does not exist I need the api for my coin system to display it in the scoreboard
Show me your pom.xml or build.gradle
You are most likely importing it wrong
I don't have I have ecplise
@forest jay
add the papi jar there and I guess it will work
it is highly recommended to use a build tool
A build tool would make it way easier
curious, did a youtube tutorial make you use eclipse?
I don't know eclipse, I am a JetBrains guy, you might want to Google it.
just curious how people stumble onto eclipse in 2022
i'm guessing it's ancient youtube tutorials
Java build path?
exactly piggy
idk, however you added spigot api @dark crag
tbf I found it more difficult at the beginning to build a jar using the built in thing than with maven
maven is easy
slap some plugins and dependencies and mvn package does the heavy lifting for you :)
I can't send a screenshot here, but I have the 1.16.5 spigot jar in it, yes
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload or similar service to upload images/screenshots.
don't use eclipse
I already have
after you figure this out, help yourself and change the tutorial you are watching
reading the docs is not for everyone
upgrading from eclipse to intellij is like upgrading from a toyota to a bugatti
he has to learn to read the docs, because there aren't tutorials for everything
it's the same in the hardware parts
The problem is I have no idea how to import plugins like Vault LuckPerms or something
if I want to drive an IC I don't go on youtube and watch what to connect where
I open the datasheet of the specific IC and read how to make it work
Starting by reading docs and reading docs later on to learn about a functionality are two different things
Just tell me how the shit goes
Max, nobody uses the default build tool of eclipse
sorry, we're not your parents to spoonfeed you. first, you are not a baby, you can eat by your own. we can only cook you the food.
Go there
Once you download it, install the Minecraft Development plugin. Then create a new spigot project, and it will set everything up for you.
Then it is literally pasting one line of code to add papi
minecraft development plugin kinda sucks tbh
It's easy for beginners tho
added with an a-hole developer and my bullshit meter skyrockets
Boy are you betrayed YOU CAN ONLY IMPORT OTHER PLUGINS AT SHIT ECPLISE YOU HUSO fefefsfwwge
The what
What
I didn't understand this one too
Please dont use eclipse's build system
English please
HUSO = Son Of a bitch
Why not?
which word's the H in the abbreviation?
@dense drift please make a rule so that everyone who uses eclipse and asks questions about eclipse here shall be banned. Thanks <3
Outdated, cumbersome, lacks in any sort of customizations to the build flow, requires local jar files for all dependencies,
little to no support for maven and gradle to add *
read the topic of the channel
the problem wasn't eclipse, but its build system
How is it outdated? Its still getting updates.
You can use maven or gradle if you don't like its build path.
oh eclipse works fine with maven, havent tried with gradle, but the problem I mentioned is its inbuilt build system (in reply to ivan)
getting updates != not outdated
Outdated in the sense it doesnt have any value in the current system
I prefer the build path rather than maven or gradle
No one wants to sit down and do all dependency resolutions by hand
Only reason I use maven is for later minecraft versions because I make use of the spigot maven plugin
Sure, you do you ig
well then. what if you had 20+ dependencies? you're still gonna do the "build path"
I do 😉
Ok?
Yeap and I do xD
well what about if it is a open source plugin and I want to contribute? I'd directly be pushed back from contributing if it doesn't use maven or gradle.
that's too one of the many downsides of using this method
37 dependencies currently in my minions plugin
oh. hi Yugi.
Oh well. Figure it out. I only open source resources for readability.
I was wondering why it even exists, but looks like maven was released only 3 years after eclipse and ij were made
hey Yugi
haha. not funny.
Oh shit
bruh
Oh. That gif. 😍
Generally my plugins only depend on spigot anyways cause I don't like depending on other api's
The api's I do depend on are because I allow support for them which of course can be toggled anyways.
Orange Tan Man!
scary and boring at the same time.
so no advanced plugins? like for example making your commands cooler via brigadier and the cloud command library?
on similar boats lol
I would make my own
you know, I was just like you. naive, didn't want to use any libraries, etc. etc. but you have to discover libraries. they make our lives much easier.
Absolute Chad.
Also, on an unrelated note, cant afford a Tesla, going to build one on my own.
I don't care about "easier" lol
"BUT THAT'S NOT A PLUGIN! THAT IS A TESLA! IT DOESN'T MAKE SENSE 😱"
nor smarter
whatever you do please don't go full nerd mode
gentoo users im looking at you rn 👀
Seems like you're there already
I see you've upped your gif game lately

thanks for sharing your baby pictures in the form of text. appreciated
that reminds me
I think we won the war Yugi. It's been there for a long time now and it was not taken down yet
@broken elbow @brittle thunder go change the channel please.
Ah yes, the classic : relieved :
😌
No problem. 😉
@brittle thunder let's talk here. We don't want to bother the people in #development
Ah yes!
uno reverse
oh. that's a smart play. MrIvanPlays hits for a total of 13 damage.
do you know any bhop csgo servers btw? im listening to that legendary bhop music and I'm in need of bhopping
62.122.213.93:7777
appreciated
MrIvanPlays, almost every message I read from you seems to be missing
'☝️🤓'
lol
at least my parents are my real ones
Hello, is there a way to hide splash potion effect when we throw it for specific players only ?
I sincerely doubt that, but you do you
from my knowledge potion effects are client side, although I bet there is a way to hide it. I think I have seen some people do it.
@warm spear https://www.spigotmc.org/threads/hiding-and-creating-splash-potion-particles.157470/ here is a forum post on how to do it
although that's particles
by potion effect he probably means like the potion effect status shown
which im not sure can be hidden
he mentioned splash effect
yes
which I would think would refer to actual splash effect / particles, not the gui, but idk
¯_(ツ)_/¯
I can send baby photos. I don't think you can though
why are you so cringe lmao
oh my god shut up
what if I don't?
exactly what i need ty
np
You can iirc
Heya! Looking for a hand with something that is probably very simple!
d;potioneffect#potioneffect
public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon)```
Creates a potion effect.
type - effect type
duration - measured in ticks, see getDuration()
amplifier - the amplifier, see getAmplifier()
ambient - the ambient status, see isAmbient()
particles - the particle status, see hasParticles()
icon - the icon status, see hasIcon()
Here @dusky harness
I'm enquiring about a spigot plugin I'm writing, its a collection of "microplugins" which can be enabled and disabled on the fly, there is one class I need the entire plugin to be able to use and see updates on unanimously, how would I do this in Java?
(Because this class is how the features can tell whether they are enabled or disabled, and also communicate about their status
Essentially a "global" initialisation of this class, in the really stupid way of saying it
I was passing this class to each of the commands and features, but it seems to have fallen out of sync
I've been fiddling with static, but I'm not sure how to do it properly
Because I dont want to hand the controller itself to the individual features for the sake of "dont let things have more power than they need" each feature has a "meta" class which is able to control its specific status within the controller, preventing the feature from fiddling with things outside of its intended scope
I think thats where this is going wrong, when initialising the meta class I pass the controller into it, but when I update the controller elsewhere, the meta classes do not receive that update
public void enableItemEco() {
featureMeta meta = new featureMeta(featurecontroller, featurecontroller.ITEM_ECO, null);
Material currencyItemType = Material.matchMaterial(getConfig().getString("ItemEco.currency-item"));
commandSkeleton depositCommand = new commandSkeleton("deposit", new depositCommand(econ,this, helper,meta));
commandSkeleton withdrawCommand = new commandSkeleton("withdraw", new withdrawCommand(econ,this, helper,meta));
featurecontroller.setCommands(featurecontroller.ITEM_ECO, new commandSkeleton[]{depositCommand,withdrawCommand});
if(getConfig().getBoolean("ItemEco.enabled")) {
if(featurecontroller.getFeatureStatus(featurecontroller.VAULT_API) == featurecontroller.FAILED) {
getLogger().warning("ItemEco has been disabled due to Vault API status FAILED. Please install > https://www.spigotmc.org/resources/vault.34315/");
featurecontroller.disableFeature(featurecontroller.ITEM_ECO);
} else if(currencyItemType == null) {
getLogger().warning("Disabling ItemEco as item specified in config cannot be found");
featurecontroller.disableFeature(featurecontroller.ITEM_ECO);
} else {
featurecontroller.enableFeature(featurecontroller.ITEM_ECO);
getLogger().info("ItemEco is now enabled");
}
} else {
getLogger().info("ItemEco disabled by config");
featurecontroller.disableFeature(featurecontroller.ITEM_ECO);
}
}
Example of one of the actual parts which enables the features
the meta class, which is given to each of the commands and events
package life.ferret.ferretPlugin.FerretCoreTools;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
public class featureMeta {
private featureController controller;
private String featureName;
private String disabledMessage = ChatColor.RED + "Feature is currently disabled";
public featureMeta(featureController featureController, String featureName, String disabledMessage) {
this.controller = featureController;
this.featureName = featureName;
if(disabledMessage != null) {
this.disabledMessage = disabledMessage;
}
}
public boolean iAmDisabled() {
if(controller.getFeatureStatus(featureName) != controller.DISABLED) {
return true;
} else {
return false;
}
}
public void selfDisable() {
controller.disableFeature(featureName);
}
public boolean continuePermitted(CommandSender sender) {
if(iAmDisabled()) {
sender.sendMessage(disabledMessage);
return false;
} else {
return true;
}
}
}
I know this has funny sounding method names, but when the features use it, it sounds more appropriate, meta.iAmDisabled() is easy to understand in an if statement and the like for human readability
Sorry for the giant wall!
Any support is appreciated <33333
(This is after I have been fiddling with static methods btw, which is why it doesnt look like its an instance like it was before, Just realised those changes are in the copypaste)
originally the featurecontroller was an instanced object made in the main class of the plugin and passed around
(Edited so they are now back to the original instanced versions I was talking about
private featureController controller; is it this specifically which I want to make static? And nothing else? I feel that might be it
just where the classes are actually taking in the variable
I'm going to give that a try for learning purposes
Didn't seem to change anything
(Happy to open a branch of my repo to commit my current work to look at with someone!
what exactly is featurecontroller used for
you have a disable function within each feature
you can store the boolean within that class, and leave the featurecontroller out of it
then you can also use it in your iAmDisabled() method
this way, you won't need static featurecontroller, nor do you need to inject it into each feature
something like this
package life.ferret.ferretPlugin.FerretCoreTools;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
public class featureMeta {
private String featureName;
private boolean enabled;
private String disabledMessage = ChatColor.RED + "Feature is currently disabled";
public featureMeta(String featureName, String disabledMessage) {
this.featureName = featureName;
this.enabled = true;
if(disabledMessage != null) {
this.disabledMessage = disabledMessage;
}
}
public boolean iAmDisabled() {
return !enabled;
}
public void selfDisable() {
enabled = false;
}
public boolean continuePermitted(CommandSender sender) {
if(iAmDisabled()) {
sender.sendMessage(disabledMessage);
return false;
} else {
return true;
}
}
}
Feature controller is for the core command which allows it to monitor the status of the plugin, and control the operatiion of the features, it also manages a bunch of other useful stuff!
ok, what i would do is have featurecontroller store a list or map of featureMeta objects
And then feed those meta objects to the induvidual features?
which can call back to it?
im not sure what you mean yet, i meant featurecontroller would store something like HashMap<String, featureMeta> allFeatures
then you could make calls such as
featureMeta feature1 = allFeatures.get('feature1');
feature1.disable()
something like that, is just pseudocode though
I am raycasting from the player eyes in the direction of their eyes. I am running into issues of things colliding with the player from behind and triggering the raycast. I was thinking, I could just move the ray forward in the direction of the player's eye, but I cant figure out how to do that. Is there something built in for what? What would be the best approach? Thanks! 🙂
there's a ray trace method that takes a Predicate, you can pass one that returns false when the entity is the player
well, I need to check for players
but it should only trigger when facing a NPC (which is technically a player), but when the collide, their hitbox cross into the raycast
but how do I know that it isnt a player I want?
the NPCs move around
that is why they collide
you don't want the ray to collide with the player you're raycasting from, right?
thats not the issue
it doesnt collide with the player it is raycasting from.
An NPC has the chance of walking into the player, at that moment, the NPC's hitbox collides with the raycast and the server thinks the player is look at it, even though it is behind/to the side of them.
does that make sense?
start the raycast forward so it’s coming from in front of the players eyes and not center of head. If that still produces that behavior in a way you don’t want I think you’d begin sacrificing accuracy to make it any better.
or idk if one of the ray trace methods has like a minimum distance thing.
so you can get the players eye location, and add an offset of the players radius to it, in their eye direction
float radius = Math.sqrt(2*0.4*0.4); // Get a "rounded" radius circumscribing the hitbox.
Vector dir = player.getEyeLocation().getDirection().normalize();
Vector offset = dir.multiply(radius);
Location startingLocation = player.getEyeLocation().add(offset);
you may need some more casting, this is just a guess
it is already coming from the eyes
this looks promising, I wasnt sure how to execute this. Thanks, I will try it in a sec. 🙂
How do I when a block is place send a message in chat?
Would be nice if you kept the questions to a single channel. Thank you. Here is the same answer I gave you in #dev-general: https://www.spigotmc.org/wiki/using-the-event-api/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Okay ty for that but how do i make it so it just has to be like right clicked like it doesnt have to be placed
You use the PlayerInteractEvent
tysm
the event has a method called getAction which will tell you what type of interaction was made
d;spigot PlayerInteractEvent#getAction
@NotNull
public Action getAction()```
Returns the action type
Action returns the type of interaction
Could you write an example?
im still kinda confused
i get the jistr
but im confused on how i would write that out
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
public class RightClickBlockListener implements Listener {
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
event.getPlayer().sendMessage("You right clicked a block!");
}
}
}
tysm man
is it possible to brodcast that message like instead of event get player it would be event broadcast send message "blah blah blah
import org.bukkit.Bukkit;
import org.bukkit.event.Listener;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
public class RightClickBlockListener implements Listener {
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
Bukkit.broadcastMessage(event.getPlayer().getName() + " right clicked a block!");
}
}
}
i know i have already asked for alot but im guessing for a specific block i would do get clicked block and then if its my block that i want to be clicked it executes and that is alll i need
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
public class RightClickBlockListener implements Listener {
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getType() == Material.DIAMOND_BLOCK) {
Bukkit.broadcastMessage(event.getPlayer().getName() + " right clicked a diamond block!");
}
}
}
do u want me to pay u?
tysm
No
TimerCommand.createTimer(); if i dont put any time in the parthensasies it will allow for the command sender to choose correct?
my own
can you not help me in that case
Well then you'll have to show me the class to know that.
Since your question makes no sense without context
Put the code in a paste bin like https://paste.helpch.at and send the paste here
lemme try to figure it out and if icant ill come back to u
Alright 👍
Hello what is the most efficient way for item events, checking item displayName or adding a custom nbt tag and checking for it ?
NBT tag
And even better, if it's 1.14+ you can just use the built in PersistentDataContainer instead of having to work with NMS or to use a library/plugin like NBT API
Itemstacks don't have PDC yet do they?
Yes
so, yes
Not asking about nbt. Talking about PDC which is usually limited to entities, certain blocks (tile entities) etc...
pdc basically is nbt
Yes but it's a different object in minecraft
If I rember right, Item has PDC but ItemStack has nbt. 2 different accessible objects
So it does have it now
get the item meta and then the pdc
Just say that xD
You were implying nbt and pdc were the same which wasn't my question.
2 different objects
?
i answered your question
my point was pdc being nbt but with a bukkit wrapper
PDC is how you store things in the NBT within the API
NBT does not exist in API
Of course they are two different objects, they exist in two entirely separate realms
Since 1.14
I am having an issue using Paper 1.18.2, I put the API version as 1.12, as that is the lowest it is supposed to go down. But, it says invalid api version 1.12, is there a reason to this?
Here is the error if anyone needed it for references: ```
[20:51:52 ERROR]: Could not load 'plugins\LightLobbySystem-A.04-all.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.12
at org.bukkit.craftbukkit.v1_18_R2.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:375) ~[paper-1.18.2.jar:git-Paper-388]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:149) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:415) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:323) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:418) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1164) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.18.2.jar:git-Paper-388]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
api version was introduced in 1.13, so the lowest value is 1.13
if you want to support lower than 1.13, just don't set that version at all. At least I believe that's what you have to do
No you shouldn't include it or else spigot won't apply backwards compatibility
It'd be nice if it had Sound compat too though
just don't set that version at all.
i was refering to this
check settings > build tools
Wait are you saying blitz is right or nk
No
Is the setting right below also Java 17?
yes
Yeah then this ig
maven and then version
Maven 
Something something, it could be the Maven compiler plugin being outdated
Actually prolly not
Open the project structure menu thingy, and click on the modules portion and click on each module and see if they are using the correct sdk

github workflow/actions question
hi ive already hit my google limit for this issue, so im asking here now
i have 2 jar files generated in api/build/libs and 1 jar file generated in example-plugin/build/libs
i want to have all 3 of those jar files put into the root directory of the Artifact ZIP file when using actions/upload-artifact@v3.1.1
this is what i currently have:
- name: Upload artifacts
uses: "actions/upload-artifact@v3.1.1"
with:
name: AnnoyingAPI
path: |
api/build/libs
example-plugin/build/libs```however, the structure in the artifact zip file is like this:```
api/build/libs:
1.jar
2.jar
example-plugin/build/libs:
3.jar```when it needs to be this:```
1.jar
2.jar
3.jar```
try setting the absolute path not the parent directory.
so
- name: Upload artifacts
uses: "actions/upload-artifact@v3.1.1"
with:
name: AnnoyingAPI
path: |
api/build/libs/1.jar
api/build/libs/2.jar
example-plugin/build/libs/3.jar
*.jar if you don't care about the name
still happening, maybe cause of *.jar?
L
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.
RIP
u just use 1 path
indeed
Did
path: |
api/build/libs/*.jar
example-plugin/build/libs/*.jar
Not work?
That should work
- uses: actions/upload-artifact@v2
with:
name: Package
path: build/libs```
This is what I use
v2 
no
yeah I disabled that workflow long time ago xD
yea i used to use that but now i have multiple locations where jars will be
try to remove the jar part
this?
Can you link me the repo?
why the name lol
Yeah tried, couldn't get it to work, gl 
Your pointing to Emily's message which proves my point lol
👍
and mine?
🤦
your point was there were two different objects in the api
my point was pdc is nbt
i have no idea why youre having a tough time understanding it
and i dont know why youre trying to continue this beef
If I continue with the convo I'll just have to keep using the face palm emoji at this point.
I didn't say it was dumb. I said they were 2 different objects
PDC just saves the tags as NBT tags under the BukkitValues tag
yeah, pdc is just bukkit's nbt implementation, nothing more
and i said that both are in fact NBT (storage wise)
but yes they are different objects. one is a wrapper for the other one however
i was making the point that anything that has NBT has PDC
what the two objects in the shitty bukkit api have to do with my point or your question is still a mystery to me. please elaborate
most productive #development conversation
second most productive. pretty sure the most productive conversation was the one betwen mrivanplays and modi yesterday
oh yeah that was pretty good
PDC is a NBT compound, NBT represents anything about an item (display, durability, enchantments, etc.)
cause its annoying to use (at least for other ppl lmao, i understand it completely 😈)
and?
anything that has NBT has PDC
is the other way around, if something has PDC it has NBT
is there a way to "move compiled jars in the workflow/job" or something?
sorry, let me rephrase: Anything that has NBT has the possibility to have a PDC added through the Bukkit API
nah, most productive was in #dev-general 2 days ago trying to compile a project
I have no idea tbh, I'd say your best bet is to open an issue on the action's github and ask if it's possible
sounds like work, its christmas so ill let future me deal with it :D (thanks future me, ur always there for me
)
Question: I use WE to create a custom enchantment that will destroy blocks in an area. What would be a good way to remove only blocks that are inside the mine region (a rectangle)? I was thinking about using EditSession#replace (since I need to access each block to create drops anyways) and check if its location is within mine's region
lol
the power of friendship
i mean, if the area isnt too large, you could just go with bukkit
eeeh
loop through all coords and just break naturally
god no
you can create a CuboidRegion
oh god
this works
this is so terrible
/fill x1 y1 z1 x2 y2 z2 minecraft:air destroy
i don't know if WE API lets you easily generate drops tho
like when "destroying" blocks
oh no, my question is what would be a good way to check if block x is within the mine region
Something like this, the black rectangle is the mine and the red one is the region where blocks will be broken
I need to loop trough each block to generate the drops, if I can access the location via EditSession#replace(Region, Pattern) (I think it is pattern), that's fine I guess
I feel like you're doing this the wrong way around
I would first generate the collection of blocks to destroy, and as you generate it check that it's within bounds (also let's you "fail-fast" and stop going forward once you "hit a wall"), and then batch-destroy them
when implementing enchantments inside of a mine i just checked if block isAABB and changing the drop if it was
Because destroying them one by one and generating drops as you go is going to be slower, there are a bunch of special cases that make batch replacement faster
couldnt you just count how many of those blocks in a region is inside and outside of the black box and do some bs to generate the drops for all of them instead of doing it one by one
tho that would be less accurate afaik
i think when i attempted to do mass generation of drops i just forlooped from 0 to total blocks
My idea was to use EditSession#replace which in theory loops trough each block, and if it is inside the mine I then add the drops to a list and set the block to air
after than call EditSession#flush or whatever the method is
i think every tool ive seen for calculating drops just generated the drops X times for how many times its supposed to do it
Is it a question of efficiently splitting the regioms or a question of how to break only certain blocks with drops
I think something like this will do
session.replaceBlocks(
region,
Mask (vector) -> // check if the location is within the mine location and generate the drops according to its material
Pattern () -> // set all blocks to air
);```
Is fill destroy inefficient
I’m wondering if you can first delete the blocks outside the regions
Then just fill destroy the overlap to get the drops handled
wdym?
the question is about efficiently generating drops right
Well, I was wondering how I can check if the block is within the mine region, but that is easy to solve because Mask providers a BlockVector3
About drops, in theory I think I need to check only certain materials that have different drops regarding if the pickaxe has silktouch or not
Maybe a map of materials to their silk touch counterparts
And if it doesn’t exist as a key, it’s normal
yeah yeah
what?! https://srnyx.sucks-at.life/7zFM_kdx3GmX0Gi.png
java.lang.NoClassDefFoundError: xyz/srnyx/annoyingexample/annoyingapi/command/DisabledCommand
java.lang.ClassNotFoundException: xyz.srnyx.annoyingexample.annoyingapi.command.DisabledCommand
full error: https://paste.srnyx.xyz/uporopewab.properties
blatant cap
any startup error?
also make sure that class has package me.srnyx.annoyingexample.annoyingapi.command
¯_(ツ)_/¯
idk what that's happening lol
well it has package xyz.srnyx.annoyingapi.command; but its relocated by shadowjar
o what
ohhh
decompiling it from example jar it has package xyz.srnyx.annoyingexample.annoyingapi.command;
The following velocity code doesnt receive any plugin messages: https://paste.skyslycer.de/WsOFo
even though im sending them correctly: https://paste.skyslycer.de/fJdpu
as far as it's pretty serious issue with general engine of all dmenu users, could someone resolve it? https://github.com/PlaceholderAPI/Javascript-Expansion/issues/73 (Memory leaks)
this doesn't look right
why are you trusting a computer to do your job
yeah
btw, why just do not simply use groovy for scripting? It's much more comfortable.
i think it was because JS was included below java 16 (like 70% sure)
and now it's already got the popularity
and because no server owner knows about groovy
kotlin >
previously yes, rn, no. I guess, there is should be replacement in face groovy.
Kotlin script >>
kotlin >>>
java > kotlin, kotlin > groovy
sorry 💀
WOW
i am talking about simple scripting, kotlin much more strict in this case
i use kotlin for gradle, its simple scripting
yeah the kotlin part was mostly a joke for scripting
groovy is better for people who wanna move from js
groovy is a dynamic language
and is very lenient
although what's so bad with JS?
since it's already so popular with tons of examples and pre-made scripts
also, memory leak is still here
my code also has the memory leak - fortunately it's in a command, not every placeholder call, but I can't believe no one thought of this
lol
personal experience and recommendations
ah
I've never used JS myself so I can't say much
I do know that nashorn isn't exactly JS though
but is still as similar as possible
you can simply run this code and dump after few minutes
yes you linked above
on this few lines, it'll produce leak
I will look into this, thank you Max
same as each request
According to some SO posts, looks like we can use a single ScriptEngine and just create new bindings for each execution
Though they say the nashorn engine is not thread safe, so I guess we can create a separate engine for each thread that is not the main thread (maybe a cache?)?
ThreadLocal exists
I don't have much experience with threads, I need to look into that.
Baeldung ftw
also no startup error
anyone else know how to fix? 
A very interesting take
i opened issue for it: https://github.com/johnrengelman/shadow/issues/813
Shadow Version 7.1.2 Gradle Version 7.6 Expected Behavior Relocated class should be found Actual Behavior I get NoClassDefFoundError and ClassNotFoundException: https://paste.srnyx.xyz/uporopewab.p...
now im going to get bullied for being stupid and making silly mistake or something 😭
probably
Can someone help me with this? For some reason it's always return false, I'm trying to make If the message starts with '#' it will send it to the team chat.
Code:
@EventHandler(priority = EventPriority.HIGHEST)
public void onChat(AsyncPlayerChatEvent event) {
Player player = event.getPlayer();
String message = event.getMessage();
Bukkit.broadcastMessage("message: (" + message + ")");
Bukkit.broadcastMessage("message.startsWith(\"#\") = " + message.startsWith("#"));
if (message.startsWith("#")) {
event.setCancelled(true);
}
}
my guess is it starts with a color code
So you're suggesting to use ChatColor#stripColor?
yea
Alright thanks! I'll try it out.
Damn, you're 100% correct what the hell
thank you so much
i tried asking ChatGPT but it keeps telling me the same things over and over and over and over again, basically just telling me to make sure its relocated correctly (which it is)
now its telling me to make sure the classes dont have any syntax errors... of course they dont... or else they wouldnt be able to be compiled...
send full logs
ok now its working :DDDDDDDDDDDDDD i love when things randomly starting working :DDDDDDDDDDDDDDDDDDDDDDD
i love when i change absolutely nothing and it just magically fixes itself, soooooo amazing
It’s been fantastic from personal experience, I use it a lot at work
I'm not saying it's bad but probably around half of the things I've tried have given subtly wrong responses, especially if you're asking it for code
It'll just make functions and things up a lot of the time
Ahhh, yeah - I’ve only asked it questions like naming tests, and Amazon AWS stuff
Not really code so much
Yup, generates senseless modifiers for compose, almost always
it's good as more of a google alternative but for actual code questions it's really not great
Mhm
I think that’s how I’d describe it too
It does work with code if the question is very general
Amazing for asking questions that saved hunting google
yeah and also it's decent at stuff like generating text
Specific to any libraries is well yea, expectly not too well
mm
I've had a decent experience with it so far.
BM where were u for the past week or so


