#help-development
1 messages Β· Page 996 of 1
damn
anyway, thats a baboon
Pavian yeah
Thats not working still doing the same thing but not its not saying Itemstack can not be null
Send Error
Caused by: java.lang.IllegalArgumentException: ItemStack cannot be null
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:143) ~[guava-32.1.2-jre.jar:?]
at org.bukkit.craftbukkit.v1_20_R3.inventory.CraftInventory.addItem(CraftInventory.java:299) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4053-Spigot-e9ec548-98b6c1a]
at me.helix.atlasgrave.Listener.Listeners.ChestSpawn(Listeners.java:74) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.20.4-R0.1-SNAPSHOT.jar:?]```
Check in your listeneres for the ChestSpawn one on line 74
Check what that line of code is
it is
getInventory().addItem(new ItemStack[]{p.getInventory().getItem()
You're trying to add an item that is null to the player inventory
Why are you doing it the complicated way though 
What code?
wait
what th ecuck
the fuck**
why are you creating in array
or whatever you call that
just addItem(new ItemStack(Material))
bro, check the player inventorie before the death
then save in a array
What does the death have to do with this?
get this array and put in the inventory
Can i just state my code was working fine till i wanted to make it so if the player had more than 27 items in their invin it would spwan a double chest with all their item in it
Just cus it works doesnt mean its good?
ItemStack[] items = player.getInventory().getContents();
Block chestBlock = // ... the chest block
chestBlock.setType(Material.CHEST);
Chest chest = (Chest) chestBlock.getState();
Collection<ItemStack> remaining = chest.getInventory().addItem(items).values();
if (!remaining.isEmpty()) {
Block secondChestBlock = // ... the second chest block
secondChestBlock.setType(Material.CHEST);
Chest secondChest = (Chest) secondChestBlock.getState();
secondChest.getInventory().addItem(remaining.toArray(ItemStack::new));
}
That should work fine
It doesn't take into account the rotation or names of the chests or anything, whatever, you can probably figure that out just fine. But that's all you need
Not saying its good im not an expert never said that once
Im not saying you're not an expert, but you can here asking for a solution, and we told you about improvements you could add to your code, cus the way they were, might have worked for then, but dont take into account any other cases than the ideal
Does anyone know a good way to parse placeholders to a String? ie. {gamemode} -> Creative
You can either do it the lazy way, or you can do it the fun way
I guess we can throw in a mixed way lol
Either String#replace(), RegEx, or parsing char by char and rebuilding the string
Create a enum with all your placeholders, then have a decode function where you input the placeholder you want to replace, and what to replace it with
Are you using Java 22 or older versions?
Which way is which
Which results in a abominations like this
Lazy, mixed, fun, in that order
Whatβs the fast way
neither
Depends
Become the CPU
Probably char by char reconstruction would be the fastest, especially if you have more than one placeholder in the string
Guess it depends on how fast RegEx is though. I'd imagine if you're precompiling your pattern, it's probably relatively quick
I mean think about it. Every time you're calling replace, it's filtering through the string each time
^^
So in the snippet above, you're filtering through that string 4 times when really you could do it just once
I currently do regex
^^ I would also do a regex
Probably gonna switch to rebuilding char by char tho
Nah I think the RegEx is fine
Probably micro-optimizing at that point
Especially if they're just simple placeholders, it's probably not going to hurt you at all
Well sometimes it happens quite frequently
Something as simple as this would work fine {(?<placeholder>[\w_]+)}
I think RegEx is fast enough. Again, microoptimizing. You'd have to do benchmarking to really tell which one is faster under frequent use
20.0.1 I think, would it be beneficial to update?
Just a bit of a strange version to be sitting on. 21 is LTS so you're better off there I think
1.20.5 requires it anyways
fair point. I haven't touched any of this stuff for a while. I'm trying to get back into it
I'm now on 21.0.3
Me out here on 1.8
That'll do just fine 
Thank ya!
How would I go about creating a Enum with dynamic variables? I havent messed with them much
If you want a fast solution, you should probably use regex, like @worldly ingot recommened
If you still wanna go my route, i made an enum called Placeholder
Then i have a custom String, imma get trashed on, cus it aint pretty or optimized,
The replace, takes a placeholder, and an Object, that the placeholder is replaced with
it also has #translate() for translating color codes
π₯Ά
Alrighty, I'll give this a try! thank you
π
I saw this somewhere would this work?
.forEach(ent -> rawMessage.replace(FORMATTER.apply(ent.getKey()), ent.getValue()))```
Where tags is a Map<String, String>, rawMessage is the message to translate and FORMATTER is `s -> "%" + s + "%"`;
I just dont know how to save the result of the function
That... seems a bit overcomplicated?
it probably is but I'm complicated
Do you have a solid placeholder you want to replace?
wdym by solid?
like %player_name%
well for instance I have %gamemode% and I want it to return the players gamemode but String.replace() just looks ugly to me
although I'll prob just use it tbh
I mean you can use regex if you want to?
regex ez
you need to just sit down and read about them for like 30 minutes and you'll realize
Intellij doesn't recognize any bukkit libraries?
I'm 99% sure it's because of this line in build.gradle.
compileOnly 'org.spigotmc:spigot-api:1.20.4-R0.1-20240222.090456-86'
I don't wanna update to 1.20.6
- Did you update IntelliJ to Version 2024.1.1 ?
- Do you use Java 21 for developing?
You should remove -20240222.090456-86 and use -SNAPSHOT instead.
Never seen someone not just use -SNAPSHOT
ATT is what I like to say
What does that stand for π
Appeal to tradition
I c
I can't remember why I used that specific release
SNAPSHOT or the specific build number?
No, the word he explained ATT
I remember now, I couldn't download the spigot api sources so I moved to this
Just download it in the Gradle view. There is a button present.
Read my issue in this reply
That just didn't work
It works now?
yea
perfect
What is the best way to implement a notification for entering/exiting faction territory?
On a player move event, i'd like to check if they have entered or exited a chunk belongining to a faction but im not sure how to keep track of the "before" and "after"
like going from "Faction A" to "Faction B"
doesnt the player move event have a from and to?
im not quite too sure, was not aware of that if so
first time making a spigot/bukkit plugin, for some reason IntelliJ IDEA is not detecting the bukkit library, how do i add that so my code can run?
did you add it to your maven/gradle script?
is that a requirement?
well generally speaking there is 2 ways of making your IDE acsess the library
either that
i tried to download maven but the tutorials i found didnt explain how to actually get it
i have the maven zip file and stuff
you dont need all that
you can do it all in intellij
what do i need?
ah alright
any videos you know of where i can get help with that?
or if you know how to build the script maybe you could give me an example
sure but i can also just run you through it if you want
alright i closed it
and click plugins in the start menu
one second
yh
1 sec
okay im on plugins
done
make sure to select market place
Restart?
yes
create a new project and choose "minecraft" on the left
alr alr
and when youre done click create
what the compiled jar will be nammed
group id should be something like me.jabstatic btw
yessir
or if you have a domain use that
i got it set
let it load
its done
alright
it shouldve created your main class and a pom.xml
it should if all went well already set the propper maven imports
but just to make sure we can check
show me a screenshot
im making a player-tracking compass plugin but it doesn't work in the nether because the compass just spins aruond randomly, anyone know a way to bypass this happening?
iirc coordinates work differently in the nether so you may have to create an algorithm that converts world space into nether space. I could be wrong
x and z / 8
Anyone know how I would go about canceling/hiding/deleting the sweep particles a sword does when a player attacks with a sword? (I still need the particles so I don't want to do anything that will make them totally invisible, I just want to disable the ones when a player attacks with a sword)
Lodestone compass?
Wher should I purchase my domain from? Top recommedations appreciated
I get mine from porkbun but I'm pretty sure namecheap has better dns
How can I prevent an item from moving when dropped? Or just prevent it from falling into a hopper?
Try hostinger
mine craf
has anyone else done 100% ai support for their plugins before? I just got mine to work, it's actually pretty decent
it can generate valid yml files to create content in my plugins, debug, answer questions, it's pretty good
would actually be pretty fun to have a channel like in spigot, potentially
though setting it up would probably be rather challenging
Tell me more
How did you approach this?
with code and logic
2 hours of nodejs programming, 3 hours of fixing my ide, 5 weeks of writing a wiki in a markdown format I knew the ai would like
also I nailed it it loves markdown
What ai did you train?
Help I have a problem, I want to execute commands on my paper server to my bungee server, I did it but it only works if a player is connected, any solution so that it does not depend on that??
Haha
not right now
would be fun for spigot to have but man the amount of work to get it running would be tremendous
Yes. Looks tasty for a portfolio though haha
eh sure I guess, I hire people I don't get hired
I'm just happy I got free 24/7 support that is honestly fairly serviceable
Is there a way to add a pdc to an inventory? I was thinking about applying that pdc to every item in that inventory but hesitated because I thought it wouldn't be the most optimized way to do it.
ew nodejs
without a player the spigot server simply can not comprehend what bungee is
ull need to create a socket between the two that doesnt depend on a player
you can help me with that? md
naur sorry im a lil stupid
aa
whats the issue
I understand, no one wants to help me and I'm already at around 10 pm
.
I need to run commands on my Paper server and have it send those commands to the Bunge server
for example /bungeecmd <command>
I mean I already have my plugins, my bungee and paper plugin
you have a typo in your discord2fa plugin description
It's just that the command that is sent to bungee only when a player is on that server works in paper.
also it looks really bad with dark mode turned on, you might want to have a custom background
I offer 3 to 4 dollars for help
the Tools button on your homepage leads to a 404 and the Go Back button does not work
the portfolio page's hire/services buttons do not work (hire is not clickable, services do nothing)
projects button on the homepage leads to a 404
my audit is complete
:P
can you help me?
^ Mau
crazy
I know
Well I don't know, I'm going to try the socket thing, but can that be done in a bungee or paper plugin?
It is obvious, in fact I already have the 2 that I mentioned that only the paper command works when a player is online
:^)
i have no idea what you are trying to ssy
Well
well
that is clearly a bukkit
π
is that why it's named spigot
explain paper then
makes no sense
explain rust bitch
but it used to be paperspigot
oo i remember that
cause it only looks better on paper
furry version
did someone say rust?
that's a first
rust goes brrrrr
i enjoy rust
What would be the best way to save List<Location> locations; into config?
config.set("path", list)
just be certain you don;t attempt to access the config until all worlds are loaded (onEnable is good unless using other multi world plugins))
and then when I do config.get("path") i shoudl cast it to List<Location>?
or config.getList
get list should be fine
Does anyone know why these two images aren't next to each other when i paste the other image above them? It works without the other image but i dont know why. In the Spigot Plugin Description
But they work without the image above how do i need to change widht?
List<?> locations = customConfig.getList("path");
if(locations != null){
for(Object object : locations){
Location location = (Location) object;
}
}```
something like that?
Or any easier way to do it
is it a list of objects you dont know?
I know
what type of object are they
Location
his IDE likely offered that as it is what the API would return
mhm
List<Location> locations = (List<Location>) customConfig.getList("beacons");
yep will do something like that
the ide would probably be bitching at you for an unsafe cast
wait, it will actually manage to cast that?
This actually has a lot to do with what Im trying to do
Ye that's why at first I've done it other way around π
Will it automatically return a list if it detects them as locations?
and what format should such a list be in?
yep
I mean it's deserializing it great
what format do you have them in?
Bukkit.Location
right, I mean in the config
List<Location> locations = new ArrayList<>();
config.set("path", locations);```
oh
path:
- ==: org.bukkit.Location
world: world
x: 41.0
y: 68.0
z: 42.0
pitch: 0.0
yaw: 0.0```
ah okay
I guess if I do that itll make my code better
but
Ill have to check to make sure the world they specify is the same as the world specified elsewhere
and in all of the other locations
what does ==: denote in YAML?
ye you could do serialization / deserialization yourself
yeah, my code is just a lot rn xD
nearly 100 lines just to read my locations so far
but in my scenario Bukkit's is great
yeah
==: is an object serialization
ah okay
yeah I want people to be able to understand this is they use it. do you think it would make it less user-friendly if I used that abstraction?
Alright
it just doesn't seem as user-friendly as doing my own serialization
I guess I just need a second opinion on my code, because rn it looks quite sloppy
many Bukkit objects are already serializable
ik they are. im talking about user-friendliness
one key line extra is all
yeah, but I also need to ensure they use the same world as they have listed elsewhere
is it possible to leave out the world property?
to clear section like this i do?
config.set("path", null);
would anyone still know what this does? 1.16_R3 code
leaving out the world and its no longer a Location
hm alright
removes player?
can you remove players from tab?
removes them from Tab list
:D.*
gotta make an assignment for clean code in college and im gonna submit soms nms lol
Is there something similar for Block, as there is ItemMeta#setCustomModelData()?
blocks do not support custom model data iirc
yeah, they don't, atleast yet
well that's the same as not supporting
yeah
ofc i will
what do you use to write code
pastes.dev
do you code in pastes
He does
Anyone got kotlin sql framework recommendations, not exposed ktorm or requery
Why not any of those
XD great. I wish I could submit Spigot plugin code for a college assignment
Just not a fan
i dont
supabase
only seems to work when i copy it from a jetbrains ide though
woah
looking at my old code, damn i have a 250 lines long method that uses reflection to create an npc π
crazy
guess i hadnt heard about varhandles
how are you gonna spawn them
item displays
nahhhh
no more nms for me from now on
probably for the better
The what
Is there a way to add a pdc to an inventory? I was thinking about applying that pdc to every item in that inventory but hesitated because I thought it wouldn't be the most optimized way to do it.
Probably not the inventory itself but its holder
you can add pdc to a player
or a tilestate, which probably is the holder of that inventory, like a chest
declaration: package: org.bukkit.inventory, interface: InventoryHolder
Oh well, it doesn't really have a player; It's a shop menu GUI, not a normal player/chest inventory
i believe itemmeta also has pdc
What do you need the pdc for
.
apply it to the itemmeta of every item id say
to cancel the InventoryClickEvent
if you use it to identify an inventory you can just use a hashmap with the inventory
. Is't it resource consuming?
There is no reason to add pdc to a thing that quite literally does not persist
what do you mean, sorry?
How?
Hmm, what if you tried finding out yourself
bruh
alright
I already had a solution, I was just looking for the most efficient
A hashmap
lol those reactions xD
Do you guys hardcode the items for GUIs for things like shops?
no
i have a data class which represents an item in a gui which has the item stack etc
and then i just pass in a list and draw it to the pane
where does the list come from?
that is hard coded
or enum entries ig
I suppose the only way to not hardcode it is to use a config or something, but that's probably unnecessary
I like your profile picture Xd
XD8
XD**
if it's your server, no need to
yeah
that's probably unnecessary
laughs in Minecraft making everything a json
lol
or if it's going to be persistent regardless of who is using it
DATA DRIVEN MINECRAFT
me when datapacks
(speaking of datapacks, is there currently any way to ship a datapack within the plugin jar?)
If you host a webserver then ig yes?
I was more looking for api way
Guess I gotta wait for that, it is pretty much inevitable would be my guess with how much of the game is data-driven now
that'd be for a resource pack, not a data pack :d
Oh wait
Ig you could just extract it into the world folder from your jar, right?
yeah but by the time the plugin is loaded it's too late for it to take effect
Yee, so you'll likely have to make your plugin restart the server on first run or just warn the server owner
We need early loaded plugins
By early loaded plugins I mean plugins, that are loaded at the earliest possible point allowing them to modify registries, load datapacks into worlds and all that shit
π md_5 π
when blank lines cost extra
If I cancel PlayerPickupItemEvent & InventoryInteractEvent & InventoryClickEvent & InventoryDragEvent will player be able to actually obtain item?
What is elgarl?
look a message above ;)
Oh it's md_5?
Oh, I thought you meant a message above the quoted message
not my message XD
I see
Thank you XD
oh, fair :D
I only want to cancel to Material.POTION and Material.SPLASH_POTION so I think it will do the work...
Interesting that he popped in right after he was mentioned
alright, time for another commit
Always lurking
xD
Actually I could only listen for InventoryInteractEvent as those 2 extends this, couldn't I?
No, thats an abstract event
how can I get the inventory of a double chest and no only 1 side of it
https://paste.md-5.net/uxijaqoxib.bash also it will not work when I try to directly cast to doublechest
check what type is a supertype of DoubleChest
then figure out how to obtain one of those types
found the problem doublechest is an InventoryHolder not an blockstate like chest
So Block
however, you don;t even need the DoubleChest in yoru code as you created left and right yourself
just update teh state for each and get inventory
Hi! How can I open doors using API? I must cancel PlayerInteractEvent and after X time open the doors, I tried using Openable interface and Door#setOpen both of this methods doesn't work.
Openable openable = (Openable) blockState.getBlockData();
openable.setOpen(true);
blockState.setBlockData(openable);
blockState.update();
I had tried this
that should would can we see the entire method
if its inside of the event handler you might ahve to add a 1 tick delay
You don't need a BlockState#update() call
Also, yes, in a PIE, you might want to delay your setBlockData() call by a tick. It depends
If I create ItemStack with Material.ENCHANTED_BOOK without actually enchanting it would it crash?
No it just wouldn't have any enchantments :p
minecraft doesn't crash for no reason
I mean π
But still Enchanted Book?
Great
well
we don't talk about those crashes
still doesn't working
I have add 1 second delay and nothing has changed
oh, sorry It is working - my bad
thanks!
In 1.20.6 the Particle ENCHANTMENT_TABLE was replaced with ENCHANT. I dont get any Error when using the plugin on a 1.20.6 Server. How do i know if an API change is gonna effect my Plugin
old plugins are rewritten when loaded, generally renames like that should not break old stuff
Ok thanks
Stay in #help-server
How would one have dynamic port allocation? Is there a field I can reflect into to modify the port b4 Spigot binds to it?
--port, --server-port or -p
I don't have access to what the port is yet in the startup args
the only other way would be passing incomming connections if you dont know the port
What do you mean by this
someone help pelase
Wrong channel
O
The plugin "links" with its host proxy thru rabbit, and the proxy tells it what it should be in terms of both the actual gamemode on it and the port it should allocate to. The issue I have however, is that it appears the port isn't changeable on plugin onLoad, which is where the plugin gets the response back from the proxy
You can always write a bootstrap jar that detects the port and then runs the server
I could but I really want to keep extra modules to a minimum, it's already a big project
why do you want this in a plugin :harold:
Rather than a bootstrap jar?
You probably can reinitialize the whole nms server setting the port to whatever you need but that's some fucky shit
like, you pretty much want to make a reverse proxy and just forward connections and payloads to the server
I'd think making a whole reverse proxy impl would be moderately overkill no? What I'm describing was possible on older Spigot versions w latebind and a bit of reflection but we're far past that time
i don't see how it's overkill? you're just forwarding connections and not messing with the server state by managing it safely yourself, and it isn't like you care about the actual payloads either
"a whole reverse proxy" of this magnitude you can do in, like, one class with netty anyway
Wouldn't I need to auto-increment the server port for every active server with a reverse proxy? Otherwise they'd all just bind to 25565 and fail, which leads me to a similar issue as before
i mean, what i would do is use containers for basically all of this and keep all this management outside of the minecraft server, i don't know why you'd want to change the port at runtime, sounds like what you want to do is basically spin game servers on demand
sounds like what you want to do is basically spin game servers on demand
Yeah
Containers as you're describing means I'm going to need to do a little more env setup
containers are perfect for this π
yep, devops is pretty cool
imo it's very much worth the time investment
spigotaceans
quick question, is a spawner's spawn range capped? maybe at 5? Since I am incrementing the spawn range by 1 on a click in a menu, but it does not go past 5
I am doing CreatureSpawner # setSpawnRange()
Show your code
this.rangeButton = new Button() {
int spawnRange;
@Override
public void onClickedInMenu(Player player, Menu menu, ClickType clickType) {
CreatureSpawner cs = (CreatureSpawner) player.getTargetBlock(null, 5).getState();
spawnRange = cs.getSpawnRange();
cs.setSpawnRange(spawnRange + 1);
Common.tell(player, langRangeChanged.replace("{range}", String.valueOf(cs.getSpawnRange())));
restartMenu(restartMenuRange);
}
@Override
public ItemStack getItem() {
return ItemCreator.of(CompMaterial.valueOf(materialRange)).name(nameRange).lore(loreRange).glow(glowRange).make();
}
};
nice abstracting
You're never updating the state
oh , cs.update(); right?
yes
no builder with lambdas :(
that was the problem thanks
hey, I saw that ItemMeta#hasLocalizedName is getting removed soon, is there any alternative to it?
What did it even do
you could set a localized name that you could use for different stuff
I use it to know what an item does in my menus
That was what I was gonna go for since localized names are getting removed
can someone help me obfuscate my plugin?
no point to obfuscation, unless you are a Business protecting IP rights.
(or trying to do nono things...)
do you think anyone here could take a look at this code and figure out why im getting an error?
i have need to do it just to protect my code (to prevent reselling by guy i code it for) (i have licence keys)
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
one second
that's right, use paste
Line 170
well that's correct
its supposed to be a cooldown thing
getDelay is not a thing for BukkitTask
declaration: package: org.bukkit.scheduler, interface: BukkitTask
i do not think that BukkitTasks hold any data on their delay/interval
it's probably the scheduler
any ideas on how to fix that? its supposed to have a 10 second cooldown whenever a player uses the custom item
but in fact there doesn't seem to be a way to fetch that data even from the scheduler
well you put in a delay when making the task right?
well instead of Map<UUID, BukkitTask> you could use a Map<UUID, Long>
so just save a reference to that
where the long would be the cooldown
you can save a Long (or Integer) representing the amount of seconds left for a cooldown
and then you need to have a separate task that decreases every entry in the map by 1 every second
so that the value would be factual
np
do you see any other problems or things that could be wrong with this? https://paste.md-5.net/qiwovovoja.java
because it says there are some warnings but they arent errors
line 56: not annotated parameter overrides @NotNull parameter
assert iceMeta != null;
tbh it's been a very very long time since i've seen anybody use assert. for good measure, instead do
if (iceMeta == null) return;
Don't detect items by their name
you can disregard that now
alright
i'd also recommend to split listeners, commands and the main class into separate classes and not one huge monolithic class
line 75?
look up "single responsibility principle"
Huge monolithic classes are life fr fr
i fixed the firework version of assert
would this make the plugin run faster, or is it just for visual or is there another reason?
code maintainability and readability
^
okay
Isn't assertion only useful when unit testing?
alright
private Entity getTargetPlayer(Player player) {
for (Entity entity : player.getNearbyEntities(10, 10, 10)) {
if (entity instanceof Player && player.hasLineOfSight(entity)) {
return entity;
}
}
return null;
}
i don't think this will work as you intend. it might, but there's also a method called World#rayTraceEntities which will probably suit you better
btw im editing the code in IntellJ IDEA
how do i package the code into a .jar for my server?
testing frameworks have their own methods like assertEquals
you need to use a build system, which you probably do already
maven and gradle are the two most prominent ones
maven package
im using maven
I've never seen a sane person use gradle with spigot
look at me
im sane
kotlin code compiles significantly faster with gradle
how do i package with pom.xml maven?
lies
run mvn package
fine, im sane sometimes
where would i run that if im using IntellJ idea
if you're using intellij there should be a maven icon on your right bar
click there and find a console icon on the newly opened tab
i clicked the maven and i see some folders
one sec i'm booting up intellij
lifecycle, plugins, run configs, dependencies, repositories
thx so much for help guys
mhm
its an m for me
Wtf is this theme
click on this console icon and execute mvn package
Or just go to lifecycle and press package
material oceanic
or that yes
allegedly:
i double clicked the package in lifecycle
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
!verify
Usage: !verify <forums username>
forums username?
yes
okay lemme go login
the jar file is in the target folder now
!verify jabtastic
A private message has been sent to your SpigotMC.org account for verification!
i went to target
i went to walmart
the one without original- is what you're looking for
π
spigot community - the only minecraft-related community with no known pedoes as of may 9th 2024
you are always welcome here
:D
spigot has always been the best choice for my server fr
im gonna test to see if my plugin works
would be insane if it does first try
we are developers, we can't have shit working first try
but good luck
i'm gonna go now cyall
register your commands in your plugin.yml (absolutely blind call)
holy shit
Hi, I was wondering if you can silence a dispatchCommand (for example Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "give %player% minecraft:dirt 1");) to not send a message to the console of CONSOLE issued server command: /give %player% minecraft:dirt 1 on 1.20.4 (Note that it would be executing commands from other plugins).
More Understandable Version: Is there a way to make a separate console or something to dispatch the commands so it doesn't fill up the main console log (since multiple commands will be executed and spam the main console).
Any help would be amazing.
heres someone using spigot asking for help in spigot
JabWeapons.java:38
i will check that line
use #replace on %player%
Objects.requireNonNull(getCommand(...)) 
Well IJ suggests it as a fix
yeah π¦
that was not remotely close to what I needed...
just not smart 
IJ is dumbaz then
Objects.requireNonNull(getCommand("giveitems")).setExecutor(this);

^
lets goo, I was right
command is not in your plugin.yml
make sure your modifying the one in src/main/resources
i did, mustve forgot to save it idk
best bet to not show that is giving the item yourself without a command
as I mentioned in the message is that it won't only do /give, it will also do commands from other plugins
what should i replace it with?
nothing
just getCommand("").setExecutor
nothing. Tell your IDE to kick rocks
not much you can do then, could do the same thing console spam fix does and hide it that way
okay once im done patching spigot.yml i will erase that line
so can i just add :
commands:
giveitems:
description: Gives the player all custom items.
usage: /giveitems
permission: giveitems.command
to the bottom of spigot.yml?
no that goes in your plugin.yml
then yea
Yes
yeah
One too many )
too many ))
you can install an intellij plugin Rainbow Brackets to help you better visualize all the brackets you open and close
i will consider it thank you
Objects.requireNonNull has its uses, but not here. You want it to break and give you the proper error
It has uses?!?!
some, not many
you guys are right lol
Like?
for example when you validate stuff in constructors
thats dumb that it was suggesting something bad
alright i will be back sometime later to test it again
it isn't inherently bad
the ide does not know that you want getCommand to fail if something's wrong with the plugin
all it sees is that getCommand can be null and you're calling a method on something that can be null
I use Eclipse and it doesn't care π
getCommand()?.setExecutor()
or you can just turn off the shitty IJ warnings
hiss
dat's kotlin
it has some really stupid ones
or use some command framework
pr getCommand() to be annotated with @UnknownNullability when??
Never πΏ
Javascript
Typescript
just wish IJ wasn't so violent about nullability in an inherently unsafe nullable environment and language lol
unsafe {} π€« π§π»
mye, I mean i changed it to weak inspection in my IJ but yea
I should make a pr to the mc dev ij plugin to remove all nullability warnings from getCommand add a warning when getCommand is called on a command not in the plugin.yml
I just turned it off lo
the amount of times I've run in an NPE from not null checking is around 0
BukkitCommand and Reflection gang
that is very valid except for the fact that we don't use that plugin because it eats memory for breakfast
PluginCommand and Reflection gang
BaseCommand gang
I still use it because gotta make projects somehow and haven't had issue for a while
I mean there are places where knowing that behavior of x field/function yields null on a regular basis is useful
you don't know the spigot dependency and plugin.yml schema by heart? π€£ you plebeian
I do, but I do lots of shit besides spigot
fabric, forge, planning to see how architectury does shit
fair
do we consider brigadier? :>
i use acf
because i still haven't gotten around to writing my own command framework
π
Acf, is too annotationishy
here hoping acf will never turn into malware
lol
annotations make me ejaculate
ah, so you enjoy @JvmStatic?
Lol
CraftBukkitTable
you got it
and how about LoMbOOk + KotlIin?
is that possible?
Lobotomy
Lombok πΏ
yes, but why
@Data in kotlin π
@NotNull in kotlin β οΈ
actually its @NonNull for lombok π€
oh i wasn't talking about lombok in this case
you didn't read my mind successfully
skill issue
or... not enough neurons firing to read? π
Hah yea, and @ExtensionMethod on an extension function maybe?
Valid
oh yes please
Most pointless annotation in java?
in lombok*
not sure but I assume it provides similar semantics to what kotlin has
on compile time at least
probably looks a bit goofy after that
if you use @Data, @ExtensionMethod, @NotNull, @Nullable, @UtilityClass, val, then just move to kotlin, like what are you waiting for
real
i recently found out @SuperBuilder is a thing
:D
What's a SuperBuilder
hey conclube
where is the @NoBugsPlease when you need it
explain @SuperBuilder
builder from krypton
krypton π
hey guys, i ran the server and something good happened
no errors or warnings in console
and the /giveitems coammand works
or at least its a real command
ill have to test if the items actually work
nice
[20:22:47 WARN]: Saving oversized chunk [24, -16] (2112065 bytes} to external file .\world\entities\c.24.-16.mcc uhh
should i be worrying (it lags the server)
mb
thanks to everyone who helped me learn how to build a maven plugin yall are the best
book meta spam or you added a lot of data to the chunk PDC
i didn't
it just started doing it and its lagging badly
whats in the chunk?
just mobs
ok, whats in teh chunk that is not in others?
3 million pufferfish
all chunks r basically the same also spigot spat a big exception and it stopped doing this
can i stop that in the future with coding, maybe limit entities
This is how I feel when the console spits out βcanβt keep up, running 20,000ms behind!)
You or a plugin must be doing something in that chunk for it oversize
i know its not me
2112065 whats that 2mb?
how to enable golden apples on combatlogX
its lagging the heck out of the server (i restarted)
if the chunk is not important, delete it
its the most important chunk in the server
then find which plugin is messing with its entities/PDC
even better just use a profiler like spark
i only got like 2 text displays and afew mobs
I think we've come to the conclusion that it's likely not your plugin
oke
Turn that idk into a positive I know exactly what the problem is with spark :p
It's a profiler, essentially locates issues within the server based on it's process's
so a server doctor
what do i do tho
idk how to use spark, I've never used it before
Spark is gonna help you find what's causing that tps
im profiling rn
Beyond that, I have no clue how to use it lol
ok why the heck does spark use the most cpu
If I had to guess, it takes all that in order to hunt down the issue
still dont understand
make a spark report and send it in #help-server to people who can actually read it
leave it running for 10 or so minutes
ok
or until the server crashes
it prob wont
whatever comes first
the profiler is the spark report?
oh.
im guessing there shouldnt be this much text displays
yeah I think its probably the 167,426 text displays
xd
yeah probably
im respawning it everytime text displays get removed from the world so i think thats why
cuz it gets removed when u unload the chunk
Crazy how I never figured 4x9 was 167,426
can i make text displays invulnerable to stuff like /kill all without that
I guess we're in that universe, huh
yeah... I hate when that happens
did you setPersistent(false) or smth?
I never would have thought
im using the EntityRemoveFromWorldEvent from paper and checking if it's a text display and if it is then it respawns it using snapshots, i think that event is called when the chunk is unloaded
yeah well.... yeah
https://github.com/NukeCaps/NormalSeasons
If anyone would like to help with the performance issues, particularly related to my atrocious use of runnables in the temp / event listener class(s)
is there a better way
more like spark is the nurse & we are the doctors π
I mean doctors literally just give the diagnoses then the nurses deal with it accordingly
Imagine going to school for an extra 10 years just to tell people what is wrong
Basically a therapist for the physical body
what country do you live in π
US
your nurses must get payed like crazy
They do, and so do doctors
wtf in what world is the nurse treating you lo
bro what
lmfao
I've been to the hospital a fair share of times... I... that's not how that works