#help-development
1 messages · Page 514 of 1
alright, then i am using it
try using version 1.3.1 of the ts3 api
alright, ill try
if that doesnt help, send your pom.xml file
same error
?paste your pom
Hi!
Guys, I need a plugin that prohibits taking more than one type of item in the inventory. Let's say I want to take a stone sword and I put it in my inventory. However, when I want to take exactly the same stone sword into my inventory, I fail to do so and the inventory does not accept the item of the same type. Is there such a plugin for version 1.19.2?
sorry for my bad English, but if somebody knows about that, send me that plugin plss.
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
oh sorry!
dd this to your maven-shade-plugin's config
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/**</exclude>
</excludes>
</filter>
</filters>
it goes into the <configuration> of your maven-shade-plugin
(the proper way would be to only exclude the SF, DSA and RSA files, but whatever - for a spigot plugin, everything in META-INF is useless anyway)
"Element filters is not allowed here"
then you put it into the wrong place
I'm pretty sure that it should work now
haha
your the best man
thank your very much
np
i need help with the PlayerInteractEvent, i am detecting if the player is pressing right click on block or air, but the Event gets through a lot less when i am holding right click on a block. I tried giving the player haste, but i still want the normal speed attack indicator cooldown so that wont work. is there a way to speed up the frequency of the PlayerInteractEvent when holding right click on a block?
I'm pretty sure that delay is client sided, as you can make it faster by manually right-clicking
instead of holding it down
yeah... then how about is there a way to keep the attack indicator cooldown unaffected by haste? (i am guessing no but im new)
you could compensate by changing the cooldown attack attribute but I guess it would compensate the haste effect so doing like if you changed nothing
it's indeed client sided. while holding down, it's always 200ms (plus/minus). when I manually click, I can go down to roughly 100ms
yeah thats a good solution ty
That’s basically how I detect holding right click
200ms +- a bit
Not perfect but it works
like my bf
except that he only rarely works, he calls in sick on most days and gets paid for nothing
dream life
after 6 weeks, pay goes down to 80% or so
but in theory you can always be sick for 5 weeks, work 1 week, be 5 weeks sick again
but ofc you gotta find a doctor who also attests that you're sick
Wow
bruh
So all you need is a quack doc
and then insurance pays it, not the employer
kinda, yeah
but this sucks because now my bf cannot finish his apprenticeship on time because of too many "sick days" lol
so shots fired back
who couldve seen that coming
¯_(ツ)_/¯
did you try this & did it work?
Fuck around and find out I guess
yeah except i have to give myself haste 1001 to have the almost same speed when clicking on blocks and in air
so the attack cooldowns are gonna be super high
yeah dirty hack but I also wouldnt know a better way
is it event.getClickedInventory.getName()
oh no it doesnt work, if the attack speed is too low then the attack indicator doesnt fill at all
inventories do not have names
only views have names. but why would you ever need it?
obviously to compare the name of the inventory instead of the instance for top tier amazing 100% punjab 😎 👍 gui programming
In Croatia you can find that type of doctor on every corner 🙂
here you got a 50/50 chance. some will only write you sick for a day, others are like "oh you're not feeling so well mentally? yeah well, maybe you just need 2 months off" -> ICD Z73
He said use Inventory Name
Fr how do normal people know how their mental state is?
Depends on mercury being in retrograde
I have a trouble to prevent players from interacting Item Frame. Cancel PlayerInteractEvent doesn't work.
ItemFrame is an entity
Ohh, so do we use PlayerInteractEntityEvent instead?
try and see
ok
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
if (main.getConfig().getLocation("spawn-location") != null) {
p.teleport(main.getConfig().getLocation("spawn-location"));
}
}
@EventHandler
public void onBreak(BlockBreakEvent e) {
Player p = e.getPlayer();
World world = Bukkit.getWorld("spawn");
if (world != null) {
if (p.getWorld() == world) {
if (p.getGameMode() != GameMode.CREATIVE && !p.hasPermission("brinkysa.admin")) {
e.setCancelled(true);
}
}
}
}
@EventHandler
public void onPlace(BlockPlaceEvent e) {
Player p = e.getPlayer();
World world = Bukkit.getWorld("spawn");
if (world != null) {
if (p.getWorld() == world) {
if (p.getGameMode() != GameMode.CREATIVE && !p.hasPermission("brinkysa.admin")) {
e.setCancelled(true);
}
}
}
}
@EventHandler
public void onDamage(EntityDamageByEntityEvent e) {
Player p = (Player) e.getEntity();
if (!(e.getEntity() instanceof Player)) return;
World world = Bukkit.getWorld("spawn");
if (world != null) {
if (p.getWorld() == world) {
if (p.getGameMode() != GameMode.CREATIVE && !p.hasPermission("brinkysa.admin")) {
e.setCancelled(true);
}
}
}
}
@EventHandler
public void onHungerDeplete(FoodLevelChangeEvent e) {
Player p = (Player) e.getEntity();
if (!(e.getEntity() instanceof Player)) return;
World world = Bukkit.getWorld("spawn");
if (world != null) {
if (p.getWorld() == world) {
e.setCancelled(true);
e.setFoodLevel(20);
}
}
}
}
Trying to disable these events in "spawn" world but for some reason it doesnt work.
Error: null
gui-upgrades-slot-tier-config:
1:
price: 1000
permission-node: upgrades.slot.tier.1
value: 1.0
Isn't this path gui-upgrades-slot-tier-config.1
And then
gui-upgrades-slot-tier-config.1.price
gui-upgrades-slot-tier-config.1.permission-node
gui-upgrades-slot-tier-config.1.value
?
is the config on the sever actually there and have those keys
Yes
This is from config.yml on server
sout YamlConfig.values()
All of them have the same error, something is null and i cant seem to figure it out
paste the error on the site and i can help
Here
what is SpawnEvents.java:31 & SpawnEvents.java:44
the error isnt matching the code if its that
[21:15:00 INFO]: [UltraStorage] [STDOUT] gui-upgrades-slot-tier-config
[21:15:00 INFO]: [UltraStorage] [STDOUT] gui-upgrades-storage-tier-config
[21:15:00 INFO]: [UltraStorage] [STDOUT] gui-upgrades-speed-tier-config
[21:15:00 INFO]: [UltraStorage] [STDOUT] gui-upgrades-multiplier-tier-config
[21:15:00 INFO]: [UltraStorage] [STDOUT] gui-upgrades-members-tier-config
[21:15:00 INFO]: [UltraStorage] [STDOUT] gui-upgrades-sell-quantity-tier-config
so the section exists, do the same (#values()) on the gui-upgrades-slot-tier-config
[21:16:21 INFO]: [UltraStorage] [STDOUT] 1
[21:16:21 INFO]: [UltraStorage] [STDOUT] 2
[21:16:21 INFO]: [UltraStorage] [STDOUT] 3
And so on
The events arent working and there are no errors now
i added returns
okay so the null check is doing what its meant to
remove the null checks or comment them out run it and send the errors
It actually seems like
try putting the numbers in apostrophes
it probably doesnt like the int key, wants a string instead
is that an apostrophe, number then a backtick
Is there a way i can continue the development of my plugin easily in my laptop?
like when i save it it exports it and imports it into my pc automaticcly
if you can put the plugin on github yeah
yeah but is there a way like an extension to automaticly save and import?
all thats needed is just to commit and push everything before you close, there might be an option in settings to do something on exit but no idea
Oh okay thanks
whats SpawnEvents.java:33 & SpawnEvents.java:50
@EventHandler
public void onBreak(BlockBreakEvent e) {
Player p = e.getPlayer();
if (main.getConfig().getString("spawn-world") != null) {
World world = Bukkit.getWorld(main.getConfig().getString("spawn-world"));
if (p.getWorld() == world) {
if (p.getGameMode() != GameMode.CREATIVE && !p.hasPermission("brinkysa.admin")) {
e.setCancelled(true);
}
}
}
}
@EventHandler
public void onPlace(BlockPlaceEvent e) {
Player p = e.getPlayer();
World world = Bukkit.getWorld("spawn");
if (main.getConfig().getString("spawn-world") != null) {
if (p.getWorld() == world) {
if (p.getGameMode() != GameMode.CREATIVE && !p.hasPermission("brinkysa.admin")) {
e.setCancelled(true);
}
}
}
}
@EventHandler
public void onDamage(EntityDamageByEntityEvent e) {
Player p = (Player) e.getEntity();
if (!(e.getEntity() instanceof Player)) return;
if (main.getConfig().getString("spawn-world") != null) {
World world = Bukkit.getWorld("spawn");
if (p.getWorld() == world) {
if (p.getGameMode() != GameMode.CREATIVE && !p.hasPermission("brinkysa.admin")) {
e.setCancelled(true);
}
}
}
}
@EventHandler
public void onHungerDeplete(FoodLevelChangeEvent e) {
Player p = (Player) e.getEntity();
if (!(e.getEntity() instanceof Player)) return;
if (main.getConfig().getString("spawn-world") != null) {
World world = Bukkit.getWorld(main.getConfig().getString("spawn-world"));
if (p.getWorld() == world) {
e.setCancelled(true);
e.setFoodLevel(20);
}
}
}
}
New code
?paste the entire class, including imports and package
do you save a config on onEnable, eg saveDefaultConfig and include a config with the jar
Yes
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
follow that
you dont ever set the main var, you a need to make it private final, and you need a constructor to set it
Should I do MainClass.getMain().getConfig().getString("spawn-world")
i would advise not doing the static getInstance way unless its absolutely nescessary
so private final static BrinkySALobby main;?
public class SpawnEvents implements Listener {
private final BrinkySALobby main;
public SpawnEvents(BringSALobby main) {
this.main = main;
}
}```
There are no errors but the events arent working
Does anyone know why when I try to set the last location a player either teleported from it gets set to the location that the player actually teleported to instead of from?
add debug statements
aight
I added some debug and it looks like the event is being called twice, is there a way to solve this?
which event?
PlayerTeleportEvent sorry for not clarifying
?paste your event handler
I am not getting any errors, but when I teleport the server terminal says I moved too quickly
nothing there looks like its calling the event twice itself
does that happen every tp?
if not its just you accidentally moving quicker than you should
It seems to work once then as soon as I see moved too quickly it messes up
So, im coding HCTeams plugin vanilla in 1.8.8 and i dont know how to do the claiming part, i cant think what to do or how and im stuck with this, someone can help me?
What do you mean by very quickly? I just use player.teleport(location);, should I be doing it a different way?
the moving too quickly, it instantly teleports them back im guessing
Oh no it lets me teleport to the desired location but the /back just teleports me to the same spot instead of the previous location.
What is the formula which determines how an entity decelerates in the air, given a speed?
I just need the code in moveEntityWithHeading, basically...
Is there a way to stop the server from thinking a player is moving too quickly? At least until I can find a fix for it calling the PlayerTeleportEvent twice.
Someone help me, my holographic displays api is not working, I already put it in the pom.xml and dragged the .jar from spigot and holographic to intellij and still nothing
import com.gmail.filoghost.holographicdisplays.api.HolographicDisplaysAPI;
package com.gmail.filoghost.holographicdisplays.api does not exist
If you're using maven, then you shouldn't be dragging jar files into your project. What's your dependency for holographic displays look like?
<dependency>
<groupId>me.filoghost.holographicdisplays</groupId>
<artifactId>holographicdisplays-api</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.io/repository/maven-public/</url>
</repository>
why do you have com.gmail on the start of the import
import com.gmail.filoghost.holographicdisplays.api.Hologram;
import com.gmail.filoghost.holographicdisplays.api.HologramsAPI;
you shouldnt be adding imports manually, let your ide add th em and that package is wrong
it would be import me.flioghost.holographicdisplays.api.Hologram
now it go, but "create hologram" and "add line of text" be red, why?
Location blockLocation = event.getClickedBlock().getLocation().add(0.5, 1.5,0.5);
Hologram hologram = HolographicDisplaysAPI.createHologram(this, blockLocation);
hologram.appendTextLine("Olá mundo!");
hover over it and click import class
tried it but it just says to rename
did you make sure to reload maven?
If I want to create an enchantment that does something when the player kills a mob would I just have to listen to entity death event and check if the player has the enchantment?
yes
?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/
Is there any known bugs with PlayerTeleportEvent in 1.19.4? I can't seem to figure it out.
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
@rotund ravine sorry I was previously talking about it and went to try figure out my issue, currently it seems like the PlayerTeleportEvent is being called twice, I am not getting an error but I am working on making a /back command and I am setting the last location in the PlayerTeleportEvent, it seems to work unless the server thinks the player moved too quickly in which case it seems to fire the event again and sets the from location to the original to location of the PlayerTeleportEvent.
If I pre-generate a world as a void world for like 100,000 block diameter, will that take up a lot of space, even if it's void?
uhh
somewhat
Let's see
100k diameter is uhh
100 000 ^ 2
divide that by 512 and that's the number of mca region files you have
okay
Each file is at least 8kb
which is its header
so yeah your 100kx100k world is at least 192gb
so no, not a good idea to pregen regions
There's also no point
just make a void generator
if you're doing a grid thing then like
either just use small disposable worlds or load stuff up on the fly
So my server uses 'microworlds', which is just what I call these 5x5 chunk areas. And in the background, it's copying microworlds from a reference world file into a void world. And the void world is where people play the game. Theres some lag when it starts a new microworld in a new spot, and I think its because its generating the chunks there
Generating void chunks wouldn't solve your lag
your lag basically comes from making the microworld itself
and copying it over
its work distributed
and?
Doesn't mean it's unstoppable, just means that it doesn't create all the lag at once
generating void chunks is nearly instant
I do it on my lil side project Cosmos all the time
Okay. So is the lag from just loading the chunks? Is it unavoidable if Im doing this?
Some of the older versions (like 1.8)'s material enums isn't compatible with the newer materials from the newer versions, is there any public api/class that fix this?
XMaterial
Thanks!!
Anyone know what mix of packets that BetterPortals plug-in uses to basically load the nether before you walk through the portal
So that the dimension changes almost instantly
When you walk through
I tried looking at the source code but it was confusing
It would be the teleport packet
And preventing the client from thinking it switched world
Ah
But it still says loading terrain for just a moment
And do you have to somehow prevent the server from sending the regular dimension change packet
It is a part of the respawn packet
Replace it with its regular packets and you are good
But don't mix it up with regular respawn due to death, as that will send two packets
Interesting
How can I put my custom item into already existing loot tables.
Do you mean lag in terms of it takes some time to generate or actually lagging out the server?
Is there a difference?
tbf something can take time in async to generate without slowing down tps
but you can't do that to blocks
also maybe this is a bit of a hack but I am pretty sure that if you are just copying the same chunks over and over you could probably cheat by not generating the chunks and just trying to duplicate chunk files to match the dimensions, not sure how much reverse engineering of the save chunk file structure that would require
but it should be a damned sight faster than doing it from in-game considering you can parallelize that as much as you want and your only cap is i/o speed
ehh
it's a bit picky
it depends on your grid
if you have enough of a distance you can ideally just copy over the .mca contents
if you have a smaller distance, if it's odd or a weird multiple you can run into issues where part of the contents may be segmented across multiple region files
ur an odd multiple
or you can just use something like FAWE and make a clipboard
and not bother
just how I don't bother reading your 5th grader roasts
I can tell by the way you know that's a 5th grader roast and the fact you took the time to respond to it that you truly are unaffected by it and not at all shaking and shitting yourself right now
are you happy, I removed the hardcoded metas with the new first line
what the fuck is wrong with you
I'm too sexy and too much of a gamer
also you don't return
on your if statement
which means
you're building shit twice
just a casual little side note
I was in the middle of removing it, I just wanted to get a before and after screenshot in one go, it's called being efficient
not that you've ever heard of it
meanwhile I'm trying to figure out how to make those 2 map lines a bit cleaner
Because RandomMapPicker is one of many MapPicker implementations
you heard me
u-g-l-y you ain't got no aliby
I am adding static keys to every tower I make just so I don't have to call them by string
I could rewrite the map logic entirely, it's a bit scattered
true
but I gotta think this through
because like
you aren't limited to a single game impl per server
you shouldn't because this is an easy thing I can keep making fun of you for not doing
with some basic pasting logic
it always starts enterprise, ends up dog shit
xcuses, I'm refactoring rn
especially because magma's bringing everyone's iq down with his stupidity aura
and I'm close enough to you that I cold put you in a chokehold
I've put more thoughts into my lunch choice than you've put in your entire coding history
that sounds like a mental illness bud
I didn't know you were a 14 year old depressed tik-tok addicted girl to be prescribing people like that
if you're young then I'm a fucking toddler mate
I tag the true love of my life xi jinping on every tiktok I make
you're just jealous of how young and hip I am
bet you've never seen such a beard on a 14yo girl
I have but it wasn't facial hair

welp I wiped the map code
gonna draw a diagram or something, can't think of anything at the moment
but I'd probably merge the registry and manager class
how is that any different from any other time then?
are you mentally deranged?
Wtf is going on here
I've seen seaweed more coherent than you
illusion is trying to romance me again
2 friends going at each other
he can't resist the beard
I have a beard myself
Who could
That's not the issue
special service just for md5
I usually charge for these quality pics
but I just got myself a new forum signature with that quote
smiling with a black & white filter lmao
show the gun pointed at your face next time
envy is a sin illusion
I'm so glad I'm not religious
that's blasphemy
a beard is never too long nor too short, it is always just right for the occasion
mans preparing for his downfall
can't wait for the day you end up on the streets and make a blanket out of it
keep going fam
don't worry illusion I'm sure one day you'll be able to afford carpet of high enough quality to make something that resembles a fake beard
we're all going to make it brah
my city couldn't pay me to retain me, it's not exactly an accomplishment
maybe you should've gotten a van and some speakers. That's how circuses usually advertise, surprising you don't
I've seen AI I can run locally that can keep better cohesion in a discussion than you
if you can't think of a good burn that continues the flow of the conversation you should ask gpt 1, it will do a better job
You've got 404 brain cells trying to figure out my very intricate reasoning that your circus business is running low on local customers and requires more advertising you pokemon
maybe you should get your gpt-1 algorithm to upscale your thoughts into something with a little more resolution
ah I understand now, your brain is working on pokemon world logic. I'm surprised you've managed to stop yourself from saying your own name twice at the end of every reply
you did always strike me as a bit of a psyduck
ah, thought it was because resolution silently rhymes with illusion
md_5 can I go back to having my cool username and then you can also change illusion's to delusion
just like cutifly rhymes with magmaguy, iq matching a literal butterfly, I'm rhyming with no particular reason why
it doesn't matter how many different ways you try to sneak into the discussion that you think I am cute, you should already know I am too good for you
I can literally squish you between my fingers and you think life's all about being cute?
that reminds me, I finally started dealifting
where did you stick the missing d?
probably going to start clean and jerk in a few weeks
how much do you weight and how aerodynamic would you say you are?
I'm aiming for the 500m mark single handed delusional person throw off a cliff
how stab resistant is your lower abdominals?
practically steel, I recommend you show up with a vibrating blade and an army
I wish we were on 2017 so I could monetize your death with a video titled "1000C hot knife vs hobo"
is this one of those videos where it then shows up on the news how the person filming managed to stab themselves in their own confusion, sort of like a psyduck?
what's that shit you've been smoking and how much does it cost? cause I need some of it
Anyone know how to convert BUkkit.location to CMILocation?
CMI 💀
I hate having to support these ass plugins
But whatever
it's called gigachadium, it's a new controlled substance the man is trying to keep away from the plebs
You're kidding me
It's in his lib
Not in his API
you also need to depend on cmi lib
Lovely
exacty
I love this
this is why we hate cmi lib
CMI's a fucking disgrace
I despise it
admins still use it
and it's marketed as the "properly written" version of essentials
I gotta step in eventually
CMILocation is just a regular bukkit location with extra steps 💀
its awful, support is dog shite, docs are dog shite, api is dog shite
Well guess what
Can't use location bukkit
Cause the idiot
Decided to not support it at all
Just to be a pain
they do say that the fastest way of getting the right answer on the internet is to say the wrong answer but you really take that to an extreme
You can convert bukkit to cmi with the constructor
I really don't like plugins that implement custom location classes
So I gotta add both lmao
Yeah
they don't even really do anything custom with it
sometimes they need to if they're supporting multiple platforms though
I do have my own 3d vector classes but those actually provide utility
and by utility I mean
I don't use them in a minecraft context
Essentials is much better written from what I've seen
and I can store them in a db and all
they're all awful
I still don't have to like it, and if you do that I would still like to have a very easy to access conversion tool that takes normal locations in for the conversion
essentials is better than cmi though
well yea, none of those things are exclusive from each other. obviously the latter is preferable where possible too
isn't cmi a premium plugin anyway? so you have to buy his premium plugin to be able to do stuff that the api doesn't cover? lmao
if you want to make an api the priority should be on the ease of use of the api not the ease of programming everything else
if you want a multi platform thing then you wouldn't slap a bukkit location constructor and allow all kinds of classloading issues
this looks wrong
no caching either yikes
this is used every time you send a command
is that the essentials 2.0 crap?
more like essentials 32.0
everyone and their grandma has made an essentials alternative
it took over my elytra speed lol
??
dafuq, lol
Is that Essentials or CMI?
well when flying with an elytra it basically modifies your flying speed
i believe that was cmi
do you not have eyes?
I'll take that as CMI
eternaltd is the definition of a prototype with ambitions of feature creep
It literally has the word CMI on half the lines of code
if... you can call that code
because it looks like someone just spat on my screen
oh damn seems like I need to pay the cmi dev for a second copy then
That screenshot doesn't contain the word CMI?
ahh
yeah it's cmi, same class I mentioned on the screenshot above
it also uses data from the screenshot above
not trivial overall
well I think I'll figure out how I want to do elemental damage in this tower defense game tomorrow
ngl designing and tweaking waves for this is more of a pain than I ever suspected
every time I add a feature I have to replay the whole thing several times
Hey
I just finished making a system so that any of 3 hologram plugins can be chosen
Using a abstract class
Is it possible to listen to plugin specific interact method using this system too?
is it 1 event u wanna listen to or multiple
one moment
I'm thinking I can register the listener from within the implementation
i have code just for it lol
That way it'll be different
https://github.com/The-Epic/SimpleChatGames/blob/master/src/main/java/me/epic/chatgames/games/ChatGame.java here i have an abstract void with the params, https://github.com/The-Epic/SimpleChatGames/blob/master/src/main/java/me/epic/chatgames/games/GameManager.java here i register an event and call the method
why does everyone hate essentials lol
It has some poor and old code
but I don't hate the plugin since it works just fine and I haven't found any bugs with it
How can I catch all the errors in one section and do the same thing for all the errors like a universal catch
expect many gradle questions from me today, I try to create a basic multi module project in gradle
wrap your stuff into a try/catch and catch Exception
Groovy or kotlin?
idk
You can catch Throwable, but like that should be avoided unless very specific things where u risk dead locks or other severe states
Ok thanks for the help
ok I'm already confused, I used gradle init and now it created a subfolder called "lib" where my build.gradle is inside?
is "lib" supposed to be my "parent pom"?
the reason we dont use gradle init
okay so in settings.gradle I got the "rootProject.name" declared, is this also where I define the group id and version?
This is so weird
you do that in parent pom
and what is my "parent pom"?
this is my settings.gradle for my multi module project
rootProject.name = 'epicspigotlib'
include 'epicspigotlib-core'
include 'spigot-1_17_R1'
include 'spigot-1_18_R1'
include 'spigot-1_18_R2'
include 'spigot-1_19_R1'
include 'spigot-1_19_R2'
include 'spigot-1_19_R3'
parent build.gradle not pom
according to the docs, there is no "parent build.gradle" but only a settings.gradle, while only each submodule has a build file https://docs.gradle.org/current/userguide/multi_project_builds.html
there is a parent build.gradle it wouldnt work otherwise
this is their example and it does work without a "parent build.gradle"
this is how a working mutli module gradle project should function and look like https://github.com/The-Epic/EpicSpigotLib
I want to do it the official way though
kotlin yuck
offical way gets you no help from me, i dont use kotlin or have it setup like that
Love how CMIHologramClickEvent
Just doesn't work
Maybe I'll get a response in 3-5 business days
Probably not
I waited for more than a year and still did not get any response from zrips
I moved to groovy and created a "normal" gradle project, then created a subproject. I want to apply "java" plugin to all submodules, so added this to parent build, but I don't understand this error message
the plugins section is at the top, then in the all projects you do apply plugin: 'id'
ok thx
another thing, I declared mavenLocal() in paret repositories:
still, the sub projects can't find spigot-api
is the maven local on allprojects or just in the parent
ah, it's in the normal repositories. can I just move that whole block into allProjects?
yeah
thx, that worked
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
can I also move this into allProjects?
instead of declaring it in every submodule?
yeah, thats only there bc paper want java 16/17 for stuff
tbh now I don't understand how to compile
when I run gradle build i only get a javadocs jar
if its a plugin only you can remove all the javadoc and publishing stuff
hm my javadocs jar seems to be empty
does the allprojects{} have the java { withJavadocJar() }
@remote swallow I currently got this: https://github.com/mfnalex/lunatic
gradlew shadowJar properly creates a .jar with both my modules (core and data-structures). but the javadocs jar is empty
Contribute to mfnalex/lunatic development by creating an account on GitHub.
yes, I copied it from you. GitHub link is above, it's probably easier if I just always keep that up 2 date if I got any questions to you lmao
wait, withJavadocJar is inside subprojects, not allprojects - but that's how you did it too
thats fine
is it possible to include non spigot plugin apies into a plugin?
sure
does the javadoc jar get contents on gradlew build
lemme see
i mean just normal jar apies
yes, no problem
aslong as you shade them year
no
ok
so what about start up?
where i put the jar api file?
Why dont you shade it
one sec, im gonna clone it rq
how have you gotten this far and not know what shading is :skull
you include the jar inside yours, so eg i shade my lib into stuff so all its classes are in my project
lost confusion
thx
are you using maven or gradle?
https://blog.jeff-media.com/manually-installing-jar-files-to-your-local-maven-repository/ then you add the dep with the same info
I were thinking about taking any jar api I wanted and just extend it to my spigot plugin
maven is the way?
idk gradle
you don't know?
yeah i havn't learned it
which library do you want to use?
ok then ask again when you know. almost everything is on maven central, which means you can just add it to your pom or build.gradle file
if it's for some magic reason not in any repository, you can do this ^
btw, all my submodules also only get a "module.jar" but no "module-javadoc.jar"
i dont get aggregate java doc, but add ```
build {
dependsOn(shadowJar, aggregateJavadoc)
}
when running build
you can also remove the ```
java {
withJavadocJar()
}
still empty :/ but as said, the submodules itselves don't even get a javadoc jar
yeah there it is, but the actual javadoc .jar is empty
isnt empty for me
idfk why they dont copy the aggregated jar to build/libs but it works
The jar in build/libs/lunatic-javadoc is NOT empty for you?
Bc iirc i need that to be there so that publishing works properly i guess?
publishing doesnt care about that
Hm ok thx then i‘ll try later whether publishing works, gotta go in 20 minutes. Thanks very much so far
in my publishing block i specify publication.artifact(jarTask) and it then adds said jar to the publish
where do I declare the SECRET?
windows or mac
win
open the search bar and type env then open the first otion, then press the Environment Variables near the bottom, then just create a new user variable called whatever you like which has the key, then you just add the System.getenv("whatyoucalledit")
oh the general system vars? oh I'd rather not do that, in that case literally every process could read the secret
I mean it's only for the repo, but still
only other option is adding it to the global gradle.properties and using $name but that errors if anyone clones the project and the key doesnt exist
hmm for testing I'll just insert it directly, then check out later how I can improve it
okay how do I run publish? first shadowJar, then publish?
or only publish?
just publish
great, it works! thanks
oh also on the group, dont include the artifact id, thats added as the rootporoject.name
wdym?
oh ok I wanted to do that because in maven, I used to have
com.jeff_media.jefflib.jefflib-core
com.jeff_media.jefflib.jefflib-spigot1.19
etc
I just see, gradle ONLY publishes the whole thing, not each module - can I make it publish both? the "aggregated" total project, and each single module?
yeah gradle doesnt require that lol, we can directly depend on the jars built
you can publish each module yeah, just need to add a publishing block to subprojects too and have the aggregateJavadocJar to javadocJar isntead iirc
I'd like my repo to look like this:
com/jeff_media/lunatic
| lunatic (the whole thing)
| data-structures
| core
| etc
hm or could I move it to allprojects?
Why are you gradle
he does it every few weeks
to learn things. and because one of my projects takes 3 minutes to build
this is the furthest we've gotten
I'll try publishing the modules separately when I'm back from uncle doctor
boyfriend needs a new "sick leave notice" lol
Sus
I'm really uncomfortable using gradle, e.g. this, the syntax is so weird
but maybe, someday I'll understand lol
my goal for today is to just get it working, then I'll spend time on understanding why it looks like it looks. e.g. why are some things project.shadow.component(publications), others are { } blocks, sometimes there's a -> sign, sometimes it's just a normal like "url = ..." and sometimes it's just apply plugin: 'java'
that's like 50 different syntaxes lol
ok gotta go now, bb
Yeah idk why there's a shadow specific to publication? That seems weird. How do you replicate it without publishing
what
Also isn't there a config file for the password? Rather than your project lol
yes, you usually want them in your ~/.gradle/gradle.properties
that makes it error if someone else doesnt have the key too
this does too ?
system.getenv doesnt error for others
I mean, it still errors on upload ?
well that will, the gradle.properties thing i mean it errors if you try to do anything
Well, you don't directly ref them
I want to make a plugin for drawing on map (canvas) that hang in a itemframe, but I don’t understand how to get a pixel on this map in a itemframe that the player clicks on with, say.. orange dye.
if (block.getBlockData() instanceof Bed bed) {
bed.setPart(Bed.Part.FOOT);
block.setBlockData(bed);
}
if (block.getBlockData() instanceof Directional directional) {
directional.setFacing(BlockFace.EAST);
block.setBlockData(directional);
}
if (block.getBlockData() instanceof Waterlogged waterlogged) {
waterlogged.setWaterlogged(true);
block.setBlockData(waterlogged);
}
I change the block data of a block based on its type, however, I don't want to update the block data multiple times if it fits into multiple if statements, any ideas on how I could set the block data once?
How can I check if a player successfully blocked an entity attack w/ a shield?
store block data as a variable, edit it in the if statements, and set it at the end
I mean
final BlockData blockData = block.getBlockData();
final BlockData currentState = blockData().clone()
if (blockData instanceOf final Bed bed) {
bed.setPart(...);
}
if(!Objects.equals(currentState, blockData)) block.setBlockData(blockData);
I need to handle a cracked server login with two bungee servers
Ia there's a way to make the login server outside the bungee or smth like this?
okay so i just tested to make sure what i said would work and it didnt so i had to just specify some of the stuff in the publishing block, the fully working parent build.gradle should look like this https://paste.epicebic.xyz/xokekikabu.properties
great, thanks, I'mma check it out
I'm on the laptop now, waiting in the car lol.
Thing is, setWaterlogged method for example, doesn't exist in BlockData because Waterlogged extends BlockData, so I cannot just store the blockdata as a variable and edit the if statements like that
final :kekw:
where are you setting blockData to have a bed part?
Hello, Im trying to load in a plugin i made. however when i do /plugman load it doesn't show up and if i type it in it says invalid plugin.
a) dont use plug man b) check console
nothing is in console it wont even load when server restarts
i got it working, I added "lunatic" again to the groupid so it's all located at com.jeff_media.lunatic.<module>. unfortunately, now it's just called "core", can I somehow make the module called "lunatic-core" while still having the folder name called "core"?
it's the plugin in general, on server restart it will not load in either.
give me a few min to just test some stuff
says invalid plugin.yml
sure. my current stuff is on github
name: Combine
version: '${project.version}'
main: com.combine.Combine
api-version: 1.18
prefix: [Combine]
softdepend: [PlaceholderAPI]
authors: [_Name_12_]
description: The best of both worlds, Combine!
commands:
setlink:
permission: backlink.admin.setlink
discord:
link:
ban:
permission: portal.ban
mute:
permission: portal.mute
kick:
permission: portal.kick
warn:
permission: portal.warn
mutechat:
permission: portal.mutechat
clearchat:
permission: portal.clearchat
aliases: [ clearc, cc ]
autoperm:
permission: portal.autoperm
vanish:
permission: portal.vanish
staffchat:
permission: portal.staffchat
aliases: sc
vanished:
permission: portal.vanish
unban:
permission: portal.unban
unmute:
permission: portal.unmute
report:
cooldown: 1 minute
cooldown-message: you can't do this that fast!
autogroup:
permission: portal.autogroup
freeze:
permission: portal.freeze
permissions:
staff:
portal:
portal.ban:
portal.mute:
portal.kick:
portal.warn:
portal.mutechat:
portal.clearchat:
portal.autoperm:
portal.fly:
portal.unban:
portal.unmute:
portal.vanish:
portal.mutechat.bypass:
portal.staffchat:
portal.*:
portal.autogroup:
portal.freeze:```
edited ^
that permission sectionis currently pointless, same with the discord + link in commands
I thought changing the "moduleName" var in the publishing section to "lunatic-" + moduleName, but I guess that would break dependencies, because if someone would clone the original repo, it'd look for "core" but can only find "lunatic-core"
basically, all I wanna do is change the module names to "lunatic-modulename" without actually renaming the folder
ah, that isnt too hard
don't the commands not register if it's not in plugin yml? that's what i was taught
i removed permission section
add a description to them atleast so it isnt an empty section, doubt its happy about that
shouldn't portal.* have all the other perms as children?
it should work fine but it's ugly
yeah i fixed that
?paste
how are you building
Does minecraft monsters marked as persistent take up CPU resources even when no player is near?
just the run package button on intellij
@tender shard https://paste.md-5.net/kutozotupu.cs this should do that for you
the hammer or package lifecycle
upload the jar here
the pom is correct, press controll twice and type mvn clean package
then try with that jar
which jar do you take out of /target/
Combine-1.1
im confused how that doesnt have a plugin.yml, send a ss of your filetree
this in ij
the resources folder is in src/main/ right, in that ss it looks like its in your package
yeah thats in the java package, it needs to be in src/main, so its path is src/main/resources
that's really weird i don't think that's ever happened before,
it's in the server now thanks, but when i enable it i get this
https://paste.md-5.net/enikoroyaz.bash
the shardManager in ur main class is null
do you create a jda instance onenable
onenable?
onEnable
im gonna say its the new Object[] for the listeners
i fixed it
i believe everything is fixed now, thank you so much for helping me i wouldn't have caught that.
iirc that accepts varargs so you can do builder.addEventListeners(new chatEvent(), new readyEvent(), new slashCommands())
Is "LootTables.ABANDONED_MINESHAFT" a proper loot table. I'm using an arraylist
yes
thanks, lemme try!
Is there a way to check if a player is blocking when they get attacked?
(Like if there should be damage applied or not because of a shield)
player#isBlocking
great, that seems to work, thx
That only checks if they have the shield up even if they are turned around, there is DamageModifier.BLOCKING but that's deprecated for some reason
All damage modifiers are deprecated since they were planned to be removed
that never happened though so you can use them
gradle is confusing. I moved the maven-publish plugin from "subprojects" to "allprojects". then it complained about "what is groupId" in publishing section of subprojects. then I moved subprojects BELOW all projects, and now it seems to work again lol
@remote swallow Sorry to bother again, but ALL the published artifacts (lunatic-core and lunatic-data-structures) are the fully shaded jar with all modules included
Yeee the order is important
oh tf?
current code: https://github.com/mfnalex/lunatic
goal: I want it to publish "lunatic" with all modules shaded, and all modules separately (lunatic-core, lunatic-data-structures) with only that one module in the .jar
issue: all published .jars are the "fat jar"
Contribute to mfnalex/lunatic development by creating an account on GitHub.
im so confused why its the all shaded jar for all of them
oh
i realise what i did
I also don't understand why it complains about this, while it does work fine (except the above mentioned issue)
Groovy always complains
hm ok lol
so its not what i thought it was
but you maybe got an idea why it publishes the fat jar for all the modules?
Idk not home to look at it for 4-5 hours, just responded on my phone.
me dealing with a 500 lines build.gradle 🥲
https://pastebin.com/ih0TrcW4
Trying to add a custom item to structures loot-tables.
Ok?
not for me. root/build/libs only has a file called data-structures
it however is the correct jar, but why does it have this name
i noticed that and im confused why tf its always the fully shadedjar
I think I fixed it
lemme try
first, I switched the subprojects publishing setting to use "maven" instead of "shadowJar" and "javadocJar" instead of "aggregateJavadocJar"
and sth else, lets check first whether it works lmao
my current version seems to be working fine @remote swallow
except for the fact that core/build/libs is still only called "core.jar" instead of "lunatic-core-1.2-SNAPSHOT.jar"
ok lemme try publishing to maven local
thats onlyever needed for running gradlew build
if that works fine, I'm all good :3
i think it should
yeah junit isnt hard to add
yeah but I was confused about whether to add it to subprojects or allprojects
you can move everything in all projects to subprojects because its all in modules
I am also still confused why I have to declare "plugin: java" at the top of root build.gradle but then still apply it to allprojects
true
this is the furthest we've gotten with you and gradle
you have to admit, it took hours and was much more complicated than in maven though 😛
but yeah I'm learning and managed to fix the last thing myself, I am very proud of myself lol
now I'm at 1% gradle skill, instead of 0.5% that I had before lmao
so, thanks again
it did take hours but we did fix it
this is weird
it doesnt compact test packages or add formatting to test classes
It does for me
Maybe you gotta right click -> mark as test sources root
On the java folder
this test is weird
Why is it weird
looks like an off-by-one situation and assertions should only be made at the end of the test
Wdym with off by one
it could fail in the next step
you tested for 6, but what if it fails at 7
you shouldnt have fixed numbers in your tests
It cant, the turnaround is at 5 already
Why, what should i use instead?
ah i didnt saw the init cap. but whats with that testing between the adds
isnt one enough?
Cant hurt to test it anyway
this is the class it's testing https://github.com/mfnalex/lunatic/blob/master/data-structures/src/main/java/com/jeff_media/lunatic/data/BufferQueue.java
What is lunatic XD
my testing project to learn gradle
i couldnt decide whether to call it "Lunatic" or "Crackpot"
i dont see that
very bottom
You gotta mark it in intellij? Shouldn't it just recognize src/test
In theory it should just pick it up from your build tool yh
Under 'Mark directory as'
i found it
Nice
Hi Mr epic
hi mr 2k
is it possible to make this not send to console?
[12:12:14 INFO]: Named entity EntityEndermite['sadcece's Endermite'/161927, uuid='a837dc10-1edb-4ae3-9bc2-fc158290e11d', l='ServerLevel[plots]', x=617.80, y=-13.00, z=581.18, cpos=[38, 36], tl=128, v=true] died: sadcece's Endermite fell from a high place it spams console for different mobs it there a way to disable all that
thx
i want to make a bungeecord plugin with an api, will the api be available on all servers connected to the proxy?
if you have a way to message between th servers yes
redis would be the better option
if its global eco you can load it from a db when they join a sub server, then save it when they leave
thank
Can I exclude generating javadocs for all modules inside nms/ folder epic?
somehow generating javadocs takes AGES once I add paperweight userdev
and that module only has one method lmao
map it 💀
why the heck does gradle take 7 minutes to aggregateJavadocs
maybe the issue is that I moved my nms module sinto a subfolder
I had it inside nms/1.19.4, then declared it like this
include '1.19.4'
project(':1.19.4').projectDir = new File('nms/1.19.4')
I did that, and since 1.19 I'm thinking of suicide
nope, still happens when it's in the root folder
my builds take like 3 seconds, including publishing
can you check my repo again pls?
I only added a nms-1.19.4 module with paper usershit, and now it's completely broken
oh huh mb wait
now
yep just waiting for intellij to cooperate
1 issue is userdev 1.5.4, doesnt support gradle 7
in /gradle/wrapper/gradle-wrapper.properties change the gradle-7.3.3 to gradle-8.1.1
ok I'll try
I wonder why it used 7.3.3 in the first place on a fresh project
but it's weird because it did decompile etc just fine
ok paper wants to set itself up again
did it work for you though?
or is it also stuck at aggregateJavadocJar?
im just waiting for paper to download its dev bundle
bc gradle made me clear caches
still stuck at aggregateJavadocJar on 8.1.1
so i just ran javadoc by itself and thats erroring
looks like i fucked up
a cough @worldly ingot would you happen to know why this javadoc stuff is dying ```groovy
def javadocConfig = {
options {
links(
'https://docs.oracle.com/en/java/javase/16/docs/api/',
'https://hub.spigotmc.org/javadocs/spigot/',
'https://javadoc.io/doc/org.jetbrains/annotations/19.0.0'
)
addStringOption('Xdoclint:none', '-quiet')
}
}
gets better and better
https://paste.md-5.net/ozicivecuq.cs
how do i fix?
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
dont replace the plugin jar while the servers still running
Avoid plugman if possible
hi choco
Unsure. Looks like it's just failing to create an options file for your Javadocs? Possible file system permission issue?

I dunno man. I hate Gradle lol
you literally use it on veinminer
https://paste.md-5.net/ozicivecuq.cs
When i reload my plugin it gives this error and disables the plugin.
yeah, jda doesnt like you replacing the jar or using plugman to reload it
this is the issue I'm getting with the current version from github epic:
Only because I have to. Fabric
I still hate using it
thats just screaming that paper dont use gradle 8.1 or whatever to make their userdevs
I set the toolchain to 1.8 for the parent, and 17 for the NMS thing. I could easily fix this by just telling gradle to ignore javadocs for nms modules, but... how?
will i have to restart server to fix?
yes
just looked online, add exclude 'com/jeff_media/lunatic/nms/** to the def javadocConfig
what do i do for the future, as i have players online and can't restart the server everytime
test locally
inside options?
thx, that worked. now it complains about mockbukkit requiring java 17. can I set a toolchain specifically for the test task?
omg I think I got it to work
uh idk, im just debbuging the agg javadocjar thing and it looks constantly locking a registry
hes banned there
because they banned me
also it's general gradle questions, nothing specific about paper
also paper people tend to just reply "just use java 17"
my current gh version seems to be working fine :3
is the aggregate javadoc working now
yep, I had to ignore the NMS classes, set the general toolchain to 1.8, set the toolchain for compileTestJava to 17, and the paper one to 17 too
you failed at ban evading!!?? 
wdym?
oh my aggregate javadoc jar
you
it just worked
your alt got banned
my spigot alt got unbanned
cause you leaked your actual username in an image
wdym
I have many accounts that could join paper but I don't see any reason to, first of all almost everyone there's quite unfriendly, and second whenever I would send any of my code, people could already see from the groupid it's me
people here are like, way more helpful lol
I could easily join there again rn if I wanted to
why event.getBlock() #BlockBreakEvent return not exact block what was broken?
i checked it and for unknown reason it return not this block
how did you "check" it?
placed and broken blocks for somewhy not same
I ask how you checked it because they are correct
event.getBlock() is the block which was broken
ik, but mine blocks won't be similar
im so confused what aggregate javadoc is stuck on
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
me too, but I got it working now, and that's the most important thing lol
it breaks whenever it needs to access any of the NMS classes
is there a gradle scope for "compileOnly and testImplementation"?
so I don't have to declare everything twice?
compileOnly project(':data-structures')
testImplementation project(':data-structures')
compileOnly project(':nms-generic')
testImplementation project(':nms-generic')
compileOnly project(':nms-1.19.4')
testImplementation project(':nms-1.19.4')
Is there sth like compileOnlyAndTestImplementation lol
compileOnlyAndTestImplementationAndDebugAndFixMyCodePlease
yes
well
not a configuration
but you can configure the testImplementation configuration to extend from the compileOnly configuration
chatgpt spat this out
no idea if it'll work
yeah well this won't work
because gradle toolchains don't allow to specify a target level, and paperweight requires toolchains
is there any workaround for this?
I mean, use a multi release jar I guess ?
this is a library I wanna shade into all my plugins, would be extremely annoying if I wouldnt be able to simply tell gradle "use jdk 17 but don't use the --release option, but just --target and --source"
I already tried printing out the compilerArgs but it's empty, however when I add "-target 8" to the list, it complains that can't be used together with --release
so the --release arg somehow gets added later, and now I'm trying to remove it
then I'd have 2 versions of my lib, which means I would also would have to create 2 versions of each of my plugins, that means if there'D actually be any updates needed for 1.20, I#d have to upload 40 versions to spigotmc
but I think I did the job by getting rid of any toolchain / source/target declarations in the parent build.gradle, instead set the toolchain manually to 8 for all modules, except the NMS modules that require 17 (where I set the toolchain to 17), and in the actual core module that depends on all other modules, I have set the source/target level to 8, without a toolchain, and run gradle using jdk 17
and that seems to work
holy shit it actually worked
just make sure to depend on the reobfuscated sub modules then
yep, sure
seems correct
I'll just test it in 1.19.4 and 1.16.5 and if it actually works, I will be very happy
it works :3
Since you the creator of these plugins @tender shard , how did you obfuscate the code to where its hard to read?
hm would you people rather throw NMSNOtSupportedException, or just return false if NMS is not supported for this version?
Thanks
Also, was that you that have a plugin/api that I can have more data types in this? https://paste.md-5.net/suhiyaqiga.cs
Thorw an exception, you'll notice that quicker than having to check every time if it's either null or false.
Well in my opinion
Although, if you are planning on having only a few "features" be dependent on this, you could probably return null and then just deactivate those features.
Idk what you are planning on using this
true
how do i check if my plugin's optional dependency is installed on the server?
^
I guess no one in #help-server
this one sounds better
how do i register dependency as optional one?
(in plugin.yml)
soft-depend: x
Plugin's original name right?
uh ig
ok
?paste
