#help-development
1 messages · Page 556 of 1
only thing annoying abt paper is they deprecate all legacy things
otherwise the api is fine
kinda forgot to save the paste
tbh i've always wanted to try nms but the buildtools doesnt work for me
The api that never comes upstream
how
😔
wdym how
its fun
oh and that, but mostly cuz its fiun
this is how you do it?>
correct
Do you need it
?paste ur plugin.yml
looks like your command name isn't in your plugin.yml
i need to edit nbt data
Well
use nbt api
Vanilla NBT data is exposed with the api
1.8 needs to touch Nms a ton but newer versions less and less every version
you really dont want to make nms modules for every version with 1.8 to 1.20
Kek
name one
Spigot api is mostly just the chat component stuff
we have components
true but you cna just make a simple function to do chat stuff
o lol
which line is line 25
Quick someone ping choco
mm
thats not the issue
do you have anything to read the inside of a jar file
check the plugin.yml inside the jar
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "com.CTF.src.CTFPlugin.getCommand(String)" is null according to this your command is null
Man bought a winrar license
yeah its free if you just reinstall it
Do people not just use 7zip
winrar is faster
try recompiling it and putting it back in
I tested it unzipping java 8
you may have just not updated it or something
Who unzips a java
That’s what decompilers are for
well you gotta unzip the file
No you don’t
ya
What
You can decompile it
Just shove the jar in the decompiler
What about the other 11 months
I may be stupid
In other news:
I'm trying to figure out a good way to handle database and realtime cache updating.
Currently it's handled via multiple HashMaps (Caching) and loading from an SQLite database (multiple tables, 1 for each HashMap) x amount of hours. This is not ideal for something that should be real-time.
why are you calling "this" if you dont even use it just use new Command();
"This post may contain erotic or adult imagery."
Yeah Imgur is wack
The DB will be updated. I'm not too sure you can update it via third-party means
I made this meme lol
On start - Load database. This is simple
On database update - Get the table & value and then update the correct hashmap
?paste
lul
So unless I can still update the DB via third-party means, it being purely in memory isn't an option
Let me take a look see
I would still need a way to listen for and pull updates w/o just reading the entire DB again. Although I can see if that's possible
Which I'd prefer not doing since it would be costly with a large amount of entries, no?
If it exists it’s a language
@vagrant stratus why are you trying to load the entire thing into memory
No
This is the exact use case of a database pretty much
I can’t imagine it’ll always put the entire db in memory
What if the db is bigger than the heap
By default it does not load the entire database in memory no
You can specify to have SQLite use an exclusively in memory database if you want
But that then has to be written to disk
I would not recommend using M$SQL lol
I did say "currently", never said I was against something better
Use MySQL or MariaDB or PostgreSQL or something
sqlite
so you got a nullpointerexception when registering your command executor, and you also got the "usage" message (by default /<command>) when entering the command
It would most likely be one of those lmao
@vagrant stratus it doesn’t matter if it’s SQLite, that will still be able to handle queries of a large amount of data just fine
microsoft access
Ah yes
@vagrant stratus the main trade off with caching is that you have to accept serving some level of stale data, you can’t really get around that unless you’re going to use a centralized service to handle the caching and the database interaction
Excel, the best database
excel, the best csv viewer
but you did get a NPE although you said you didn't get any errors and refused to send your log
i store all my data in csv
phpmyadmin lol
maybe you did after 20 minutes
damn
That's pretty much what I'm doing. Spring application to handle checking against the database, it would just be checking if a value exists in a table and if so, pull a different value from the same column
adminer >>>
wait what is the top right
when someone asks what languages I speak
lmfao
Lmao, updating my Anti-Malware by making it remote
In that case you can use Redis or something to cache, and then when you update you can expire that cache value
You clearly don't know Spigot's malware scene kek
There’s nothing inherently wrong with caching
just use ch mod
Permanently in cache, so any sort of "recent" cache is not really going to be that useful given what this is for.
Redis can persistently cache
You would just only expire the key when the data is updated
I haven’t seen your error
Send it
You don’t want to put a TTL on it if you want a persistent cache
No you don’t
command isnt in plugin.yml likely
@analog basin optic wants the cache value to stay in the cache until the database gets updated
It should never be changed by an external source
and code?
That would not be a persistent cache, that would be an expiring cache
what is your plugin.yml
dont use onLoad
That’s the exact opposite of what optic wants
use onEnable
lmao imagine not having a proper gui lib that makes you actually enjoy the process of making guis
I n eed one so badly
It’s not a stale cache because whenever the database is updated, the cache values affected are expired
I could yes.
the actual db would be in the format
table_name
hash, caro_string
x however many tables are needed
It would use this to check against a whitelist & blacklist, checking specific tables for specific hashes & pulling the caro string if the hash exists within said table
Yikes it took slimefun 4 months to merge my pull request
for f**** sake my friend has a button class for gui making
What did you pr
In which case it’s no longer a persistent cache lmao
Nothing interesting https://github.com/Slimefun/Slimefun4/pull/3771
The trade off is that if you’re only going to write rarely, it makes sense to leave it in the cache indefinitely
that's the basics
anyone have a gui lib I can steal now that illusion brought up the topic
I have an interface instead
wait really
There’s no need to self refresh because the data will only be written a few times
WTF
just make your own
it would be a waste of time as my guis are already hard coded
Yes, if your reads are substantially more frequent than your writes
Definitely reading more than writing. Any writing would be ocassional
why
bro was using onLoad instead of onEnable
less than 30
🧠:fart:
I forget onLoad exists most of the time
so thats minus 5 secs
Hey do you think there is any improvements I could make to my project structure?
only use onLoad for like mysql
managers in utils?
utils are generally classes with no public constructor that have static methods
damn never even heard of onload
Isn’t it better to have packages names be singular
these names are pretty confusing
Yes
I believe it's just preference
events i would assume they define their own events
Fair enough
i'd rename to like PVPListener, RegionCheckListener, SQLLIstener
Alright
idk if ive seen a lot of plugins have it both ways
they are
Police police police police
i would include to the class names what the class really does
for example
HelpCommand
ToggleArenaCommand
or at least Cmd
also what does GetLB mean?
lb = leaderboard
Lemon balls
💀
@brave sparrow as for rough specifics for DB content
~7 tables, with 821 being the current highest column count in a single table.
The new DB once finished will have 10s of thousands of entries in a single table
dont you think its evident enough that they are under the packages impl and commands?
i mean that kinda specifies what they do
nope
alright
Yes?
Ok I have fixed all the mistakes listed so far here is current structure:
Perhaps this gives you a better idea on how to go about it kek
anything else
looks much better already
i personally add word Util to all my utils
so its easier for ide to find
or Utils
but stick to one naming scheme
np
I put my lib stuff on my utils package
and have like individual folders
so I can copypaste them across projects
Connections themselves will be at most 2. 1 for the webserver and 1 for whatever program I use to update the DB itself.
It's more reading/writing and that slowing down which could be an issue.
The webserver will only read, but it'll do a fuck ton of it most likely.
Write on the other hand could be often, ocassional, or rare w/ small-large updates for each update
be careful using the same package names for utils across packages
good. I got hit by that one in the past
Realistically it should also be setup to allow multiple clients to read from it w/o issues, e.g. if I have to run multiple instances of the webserver due to traffic
forgot this once with nms stuff but realized that it would probably break something before it even became an issue
got lucky though
dev.illusionthe.project.utils when
ask ur boss for a bonus
last time he gave me a bonus it was 7 grand in crypto
that got stolen while I was playing apex
It’s now worth $10.57 anyway
I sent him a goofy figurine a couple months ago and he just sent me a video of him at disneyland pointing at goofy and asking "is your name <my real name>"
2 grand
it started at 400$
went to 7k in like 2 days
and now it's chilling
dude's fine getting us all any kind of subscriptions we want
I asked for a 1 year copy of yourkit and he just paid no questions asked
but a domain name?
Weird man
he just has a ton of cash and wants to leave something for the community to enjoy
and by a ton I mean like
he offered to buy me a kitted out macbook just because
What’s he leaving
nope
I do want to expand into minigames but like
can't bother writing countdown logic
it's just
braindead code
unlike what I do in the day-to-day
my task for this week was to write uhh
Anyone know how I can fix this Cannot invoke "net.minecraft.core.Holder.a()" because "var0" is null error? I'm trying to create a respawn packet using protocolLib, to change a players skin, using it to refresh the player. I've tried various methods but it seems that I always get this issue. Any thoughts? Also im using 1.18, in-case you were wondering.
player housing with furniture
im braindead
Interesting
did it in like an hour
I’m curious what this never before seen tech is
illusion what server is it
something to do with the ability to place images on maps with any block offset
or the ability to play passpartout in minecraft and start painting shit
or maybe the concept of having a spray can and doing grafitti on any wall
I was thinking you would have the web server read and write, and that way you could delete from the cache when a write occurs
oh alex, now that someone bought mineplex do you still work there or are you not in it
I still work there
or how we use subdomains to track players
is the codebase as bad as the leak seems?
Anyone knows how to create placeholder players like in the adventurelib tablist example? MCC Island did the same too, do I need to use Protocollib?
That leak is several years old lol
true
but the code's ass
so did you guys keep the tech debt or did y'all nuke most of it
Most of the code in that leak is no longer used or even present in the repo
because it was quite a big project
set the footer and header in a scheduler with papi
It’s still a rather large project but it’s been pretty substantially redone
I don't want to change footer/header, I want to add placeholder players
bet
I remember applying a few years ago when I was a clown and never getting a response
I wonder if y'all still looking
Well we’re still getting back up and running at the moment
and if y'all pay more than 15$/hr
they are looking for good devs
Gottem

I remember playing bedrock mineplex
Mob arena is really easy when the mobs move at 1 block per miniute
It's alright I'm still in time to become competition
When I was a starter dev several years ago I think our hourly rate for that was around $20/hour
Like, I want to add those empty PfPs with no pseudo to show how many slots are still open
Then why did you circle the header and footer
I didn't, it's the image that came in the adventurelib docs as i said
Is there even docs for that?
lol no
insert a screaming md5 here
tbf I don't think there's proper API for it
Well, I found this, but that's all
https://wiki.vg/Protocol
Wiki.vg is such a great resource for so many things but there's a lot of errors as i recall
that is indeed all
Well, i guess I'll do that one day... When i have time
How hard would it be to add the ability to create empty tab list slots to the API @worldly ingot ?
Also, again if anoyone knows, I'd be really interested to know how to create my own plugin APIs. Like a plugin that manage chat, another one for queuing system, etc... So when I create a new project i just have to add the ones I need and I have already half the work done
I just have a standard library that I shade into everything
I have a bunch of folders I copypaste
It’s not meant for specifics like chat tho
^ most likely what I'll end up doing too
Ew copy and paste is effort
just select the folder
Yea, do a python script you nerd
lmao, I don't know how to do all this
Assembly code 100%
Learn assembly just to copy folders to a specified directory
Not worth it
I feel there are at least 20 better ways to do that Xd
I tried and it took me 3 hours to get 5 colored pixels on the screen
When making a plugin is there any reason to use the Paper API instead of the normal Spigot API as a maven dependency?
Is there a way to retrieve the uuid from the no-player event?
If you use the paper api it won’t run on spigot
What uuid
And a decent-ish sized chunk still used spigot
Does the Paper API have stuff the regular Spigot API doesn't
Yes
Uuid from player..
But they're also stupid and make dumb choices
What event
PlayerNotExistEvent
PlayerThanosSnapEvent
Lol
i mean from events not have getPlayer or getEntity option.
probably the devs making more malware
Why would you need an entity in that context?
Mohist
Fair but at least that is lower
Getting there
Mohist? Isn't that age-old technology?
Same with catserver. Is that even maintained these days?
1426 for catserver
Though I guess bukkit isn't maintained either
The 1.16.5 branch was last updated 2 weeks ago
I save player uuid to Map<UUID, Generator> and from event i get Generator from that uuid.
Still no proper 1.19.4 or 1.20 branch for CatServer
CustomOregen plugin lmao
no idea either lmao
Sponge will support 1.19.4 via SpongeForge though as it seems like
it just.... exists
Idk seems pretty inactive
Afaik you still can’t make bar graphs or remove default graphs
I mean.. it's still up, unless you mean the repo
we still dont have bar graphs
oh
well
get rekt nerds
We need bStats 2
bar graphs would be great be feature lists
cStats
Yea, a lot of stuff is just a fork of paper
you can do it
No thanks I don’t have the money for the servers
Even I'm doing a paper fork kek
There’s like 19484737374 forks of paper and spigot
you have enough to get an free aorcle
*I don't want too, but it's the most popular server software lmao
Ah yes one oracle VM for all that traffic and storage
You see what you do is remove a bunch of vanilla features
Then advertise that it’s faster
Okay tbf I'm not doing that lmao
It'll be free kek
wont download
I have an Anti-Malware: https://www.spigotmc.org/resources/spigot-anti-malware.64982/
Said Anti-Malware has reached limitations in certain situations, hence paper fork to make stuff easier
Paper: 78,602 servers
Spigot: 36,600 servers
If I want the highest chance of it being adopted, forking paper is the way to go lol
We need
with a gun
It goes from Oh fuck, API is missing to Oh hey, extra security AND it's drag & drop?
Third-Party stuff related to running the server, easier to just make a paper fork than fuck around w/ it
@worldly ingot we need ur art skills
The problems I'm having? Yes, for what I'm trying to do specifically. It happens to be that the easiest route is just forking paper instead of figuring out how to do the same thing but third-party
bytebuddy fucking sucks
but why lmao
Yes
It's good up to a point, but it's easier to just fork paper and supply that
Just learn raw asm
That wouldn't help
I have to make changes at arbitrary points within methods... in multiple classes
Easiest to just fork paper
I'd still need a paper fork + mixins, might as well just make a paper patch that others can use
You ain't getting mixins kek
Oh yea, I need to add a bunch of classes too and make that shit work
It's just not worth it lmao
Yea. If Paper wasn't so easy to fork, I'd deal with it buut it's not worth it lmao
Some will use it, I highly doubt it'll be mainstream. It's just meant to give extra protection while still supporting the most common server software
Call it condom
The base software (https://www.spigotmc.org/resources/spigot-anti-malware.64982/) is more likely to be used by the majority kek
https://paste.md-5.net/coyepofuwa.java
anyone know why this return AIR instead the item i holding? if i print itemJson to console it return the json of the item
{"type":"minecraft:diamond_sword","item-meta":{"enchants":["DAMAGE_ALL:5"]}}
What's the best way to connect Minecraft with discord? Want to create a "connect" command which sends a link to the plater and he can click on autorisize on the discord website (oauth I think) but I don't understand it...
And than a mySQL table with the Minecraft uid and the discord id
Or is there a better way?
Anyone know the best way to detect whether a Sign is waxed or not? I can't see any new additions to the API to check whether a sign is waxed or not in 1.20
Should be isEditable
Good evening everybody. I am trying to do a throwable axe or something like that but i do not want any help from the internet, i just want to understand what's going wrong
Ahh thank you, will give it a go
most plugins give a code
so you do /link on mc, it gives you a code, and you dm it to the bot or do a command on the discord bot and then yay
This is the code from the enchantment:
Enchantment TELEPATHY = new EnchantmentWrapper("telepathy", "Telepathy", 1);
Enchantment Table code
@EventHandler
public void onEnchant(PrepareItemEnchantEvent e){
if(e.getItem().getType() == Material.NETHERITE_SHOVEL){
if(Math.random() < 0.2){
e.getOffers()[1] = new EnchantmentOffer(CustomEnchants.TELEPATHY, 10, 1);
}
}
}
How can i make it work that it is shown in the enchanting table?
You can’t
Custom enchantments won’t display properly
Because the client doesn’t understand them
is there any way to save an inventory to sql other than serializing each item and saving it into a row with a slot id? if im not mistaken i remember seeing a serializer that would take a full inventory and convert it to base64 by converting each item to byte array
public static byte[] serialize(ItemStack itemStack) throws IOException {
itemStack = NBTIManager.cleanItemOfGuiTag(itemStack);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
BukkitObjectOutputStream dataOutput = new BukkitObjectOutputStream(outputStream);
dataOutput.writeObject(itemStack);
dataOutput.close();
return outputStream.toByteArray();
}
public static ItemStack deserialize(byte[] data) throws IOException, ClassNotFoundException {
ByteArrayInputStream inputStream = new ByteArrayInputStream(data);
BukkitObjectInputStream dataInput = new BukkitObjectInputStream(inputStream);
ItemStack itemStack = (ItemStack) dataInput.readObject();
dataInput.close();
return itemStack;
}
thats what i have, but im looking for a better option
i need to save the items in a sql database that only accepts primitive types
using sqlite
Just use Inventory#getContents
Then serialize the array
Whats better then that?
pojo is
But my host doesn’t offer free mongodb server
atlas does
:(
idk if any pojo -> sql exists though
Idk why you wanna improve something that already works
sounds complex
I mean you could cheat
shiiit this is gonna make me use mysql again
wtf
Download it from the java website same way you would on windows
JREs got twitter canceled
back in my day we had to install jre and jdk's seperatly 👴
i remember that being a thing when i first launched a pc
couldnt get it working for like 3 hours and i was crying my eyes out
1.7 was a bangar i wish i was old enough to know how to mod back then
Python superior? Lmao
who remembers Flying Squid JS
i think its still in dev too
There are a bunch of those
You're wanting Glowstone
Glowstone is the only other ground-up, no Mojang code server that implements the Bukkit API
hi, i'm just starting out and i'm using the "Creating a blank Spigot plugin in Eclipse" guide. however after step 5, i get the error "The type org.bukkit.plugin.java.JavaPlugin is not accessible"
i've already tried searching online for a fix, and i made sure to include the spigot api shaded file in the project (it's in "Referenced Libraries" if that helps)
Is glowstone still active
I want to say they're still stuck on 1.12
Probably are
Sad
Active, yes, but not up to date
https://github.com/GlowstoneMC/Glowstone I see 1.19 references
Your imports aren’t correct
1.19 is so 4 days ago
They're just super slow lmao
Not even datapacks, just everything in general. e.g. entities, packets, inventory, modding api, etc, etc, etc
Show your proj setup
It'll be multiple version before everything is fully implemented
It's also a very incomplete project. I don't believe everything is done
It's not
There may be some non-functioning blocks, entities, or other features
Glowstone is not finished. Nothing is guaranteed to work, though many things are likely to. If in doubt, file an issue.
sure, but it says i need to link a spigot account which i don't have yet so it'll be a bit
Nah it’s coming in 1.73
(for sharing images)
I mean keeping up with Mojang is very difficult. It's not easy to write a server from the ground up, and not only that, keep up with Bukkit which commits practically daily
?img
Not verified? Upload screenshots here: https://prnt.sc/
Yep
Plugin API i.e. modding the server to impl things
java edition discontinued when
so i forked a discontinued repository and updated the namespace (from ac.grim.grimac to me.alecjensen.grumm) and now im getting this error. org.bukkit.plugin.InvalidPluginException: Cannot find main class 'me.alecjensen.grumm'
i have combed through the code and i cant see anything that would be causing this
all of us out of our side hustles when
need to edit plugin.yml
md_5 server software when
If they cancel java edition I’ll have to learn cpp
Well not really behaviour packs are pretty good
is bedrock on cpp? or c#?
cpp
c++
i think i figured it out
nooo
why not c# fawk
ridiculously fragile as a result
You have to implement the entire protocol for it to be complete 😄
Plugin.yml
look at it wrong and the whole thing crashes
yeah i found it lol
no
but 64 render distance no fps drops11!!!!!!1!
ban
no
Choco, we need another kick
Man everyone is a hoe for rust these days
microsoft not porting java to console/mobile was their biggest mistake
minecraft needs LODs soooo bad
having two versions of the game is ridiculous
Possible? Yeah absolutely. But you're going to be working around the clock for at least a year or two before you even reach parity with 1.20, and by that point they'll have released 1.22
And that's also assuming you're writing perfect code with no bugs
Which I always am
is this what you're looking for? sorry, i'm a bit uncertain
https://prnt.sc/d6B8T5gW4q1Y
I mean, you'd have more luck going commit by commit for bukkit & spigot, and then just better implementing those
but you'd still need to impl base MC stuff kek
You still have to impl a fuck ton of stuff 😄
Looks fine to me
That's the fun part, packets change
In newer versions, yes
Some get dropped, renamed, modified, etc, etc
hell even the world format changes
what are we even arguing
yes it is possible to make a custom server; no it is not possible without huge amount of time and effort
It's not an argument. It's a hypothetical. Glowstone 2.0 lol
Just use the existing server but write a better api
You'd have the most luck going server version to server version and re-implementing everything lmao
We’ll call it faucet
Call it cardboard
That... reminds me of a project actually, I don't think it was ever complete nor do I remember what it's called lmao
You can't
It has to be 1:1 to the client
I still dont understand what we are arguing
Something something crazy idea
pügge here wants to make yet another from the ground up server
That’s taken
Hmmm.... voila?
I need to find it again lmao
Alright now we’re talkin
Don't wanna bring it up again here btw, but if what I've heard is true and u were the one who added snapshot functionality to inventory.getHolder, would you mind if we had a discussion about it as it has fascinated me and I'd love to hear more of the low-level side.
Dns maybe
*dms
BlockStates are always snapshots and the only block that can hold an inventory is a BlockState
there's not really much more to discuss, I didn't design that part of the API, it's at least a decade old
- it was always reccomended not to use it for many years now (but we still do tbf)
because you cant achieve some things without nms
In a perfect world people would PR everything
Although even then not everything would be accepted
No
we have remapped
Huh very odd someone quoted you by name.
Either way is there any sort of sanity check that could be added low level to prevent unnecessary snapshot creation?
Seems like such a waste if its snapshotted every time its clicked in an inventory, as you have the hindsight benefit of knowing the inventory is just the one the player is already in
Api is meant to abstract packets
what are you trying to do, by calling getHolder presumably you are wanting the block that owns the inventory
It's got problems though iirc lmao
Convince MD :p
they are using getHolder() as a means to identify the inventory, not for anything related to the block (i think)
The issue is that plugins such as core protect, and various other sources use it for initial checks.
So every check, regardless of if the check is successful, can and does snapshot the inventory.
So if called from an on click event... yeah.
ProtocolLib sucks
only optionally
Pardon?
by default protocollib makes you read the packet structure yourself
A janky raw packet api is not good api design
will never be added because you cant do that in a version independent way and the point of the API is version independence
it undermines the entire API
That still goes against the point of the API
more in the sense of api upkeep
Just add mixins! Problem solved
NO
||/s||
aka ProtocolLib
so protocol lib?
you arent touching the nms tho
As a minimum, it'd be nice tk have in the documentation a big thumping warning to use it with care.
I say this as on investigating it does legit seem to be a decentlyncommon resource sink that's led to the idea custom items are universally bad for performance.
In reality half the plugins out there make snapshots every single click of an inventory, so if that inventory has lots of lore custom items.
I guess it makes some sense... but I'm not sure how you'd translate every packet received to a generic enough API class 🤔
so what if it does?
the spigot api would use nms either way whats the difference between putting behind a facade
"In reality half the plugins out there make snapshots every single click of an inventory, so if that inventory has lots of lore custom items."
Thought this was only for getHolder calls....
custom items plugins are laggy because of theyre listeners and how much SHIT they handle for every damn event that happens on the server
Generator generator;
@EventHandler
public void onBlockBreak(BlockBreakEvent e) {
if (e.getBlock().getType() != Material.COBBLESTONE && getFromBlock(e.getBlock()) == null
&& getToBlock(e.getBlock()) == null)
return;
if (generator == null)
generator = DATA.get(e.getPlayer().getUniqueId());
}
@EventHandler
public void onBlockForm(BlockFormEvent e) {
if (e.getNewState().getType() == Material.COBBLESTONE) {
e.setCancelled(true);
e.getBlock().setType(generator.next());
}
}
If there is any performance problem when I checks between 2 events like this?.
and it only scales the more players and items the plugin has to handle
I mean ngl I thought the same.
Then brewery plugin went from 12% thread use to 0.7% by removing the get holder checks and replacing with sensible checks...
I was legit shocked it was thst dumb
so then make a spigot post and jira post about it? people are gonna use getHolder either way
?
no
thats fine for the items its innevitable
But for inventories a hashmap of uuid, inventory is likely fine for checking inventories
Legit it is.
Get holder should legit be the utterly final thing done after every check.
I.e. it should only be called if the custom stuff is 100% about to happen
The bottom line is
or getHoldre() should be ditched/ PR'd to be fixed to return the cached holder
Don’t use getHolder to identify inventories
idk why this debate has been going on for so long
Hence why I suggest to md just at the utter least putting that in the docs
someone should just make a spigot post about it
what exactly would a cached holder be?
PRs are welcome
Main reason Is im on phone till Monday my man
the docs already tell you not to implement InventoryHolder
yet guess what plugins devs do all the time?
If they followed that part of the docs then they wouldnt be having this issue in the first place
Put in the method itself, foll are morons sometimes and won't go directly to the source.
just because its an easy to implement interface with 1 method, doesn't mean that it's free real estate
I dunno, i assume the getHolder() method doesnt directly return the stored InventoryHolder from the created inventory hence why theyre experienceing what they are
because thats not at all what the method claims to do?
Because ngl my man I've got devs I'm trying to convince this is even the problem
* Gets the block or entity belonging to the open inventory
*
* @return The holder of the inventory; null if it has no holder.
*/```
nope, i even said this yesterday when it was brought up that everyones always said to not use the getHolder() methods
that hardly looks like "he stored InventoryHolder from the created inventory " to me
Ngl that doesn't tell u the inventory is gonna get reconstructed for the snapshot from how I interpret it. And that's eith the context of me knowing that's what it does.
open a PR with the doc changes you want and they can be discussed there
make a pr for getInventoryHolder 
ok so i mentioned earlier i am continuing a discontinued project, and theres something that i dont understand. basically, the old namespace was ac.grim.grimac, but the new one is me.alecjensen.grumm. what i dont get, is that after changing the namespace, some imports still reference the old one, but the plugin works fine?
No worries.
Just find it mad half the servers out there have fobbed off custom items as they are too bad for tps, when in reality this magic happens by removing one line
tldr: performance issues because of unintended uses
and the referenced classes i cant find anywhere in the code
Hurts my soul it was that big of a jump 😅
still hardly an API issue but a custom item plugin developer issue
ok i see. there is another project for the API and that's what this is
idk tbh nor care too much since I've been using maps to differentiate inventories for a long time now
presumably coreprotect actually wants the holder, because again "Gets the block or entity belonging to the open inventory"
make a PSA then
They should cache it then
or a pr to return cached holder
or if you dont wanna, use reflection 
Anyone with half a brain can make a lag machine with an inventory, coloured text and a n auto clicker
not really any such thing as a cached holder unless you can explain further
Is there a way to sanity check if the inventory about to be snapshottednisnt just the one the player is in
As this is only a problem in legit just player click event
And move etc
when you createInventory() you can supply a InventoryHolder of your choosing, which is how people are differentiating inventories between one another
I would assume that InventoryHolder from createInventory() gets stored in the Inventory class somewhere
Havent checked to be fair
This isnonly ever a problem on scenarios where the inventory is already 100% sure
What's that code rule number 1? Never do the same check twice?
- you're not supposed to do that; but 2) yes that is what is returned for those inventories, but if you call getHolder on an actual chest in the world then it is going to return a snapshot of the actual in the world chest inventory which is the point of the api
So the fact it's callable from inventory move and click events is a bit of an odd one. I know how java works but it just doesn't feel quite right to allow that straight up
you can't cache a snapshot of a chest in the world in the inventory because you don't know when the chest is going to be invalidated
yes, where the inventory is a block in the world
inventory instance*
theyre using the holder to tell what inventory is what when the player clicks on it in InventoryClickEvent
Just think it'd be nice to include some sortnof sanity check or id or something to bypass snapshottijg the items in the inventory somehow.
As said this is a problem due scenario's like this:
Player has chest full of gradient lore lined custom items.
They move all 27 to a shulker...
The inventory get golder was used for some custom check.
Those 27 custom items are reconstructed 27 times due to snapshot creation
I know it's against the grain.
But I genuinely just have a gut feeling a sanity check is in order for the events that already have the items 1000% guaranteed
bruh
.
well, like md_5 said you can always pr the javadoc to warn people not to use it/word it differently
that would only get the players inventory name
if that last method even exists
Aye. I agree. But tbh it is bugging me. It feels like this should be something that is sanitychdckable somehow
You shouldn't even ever need the Inventory Name ever anyways
its more like getView()getDisplayName() iirc
just use the view/inventory and a hashmap
InventoryView#getTitle
and to even make more clear there was a recent pr for
InventoryView#setTitle
Just more proof its not ID at all
you can test your luck and make a getInventoryHolder() pr that directly returns the holder but i 100% doubt it would get added since its not the way its meant to be used as md5 said
setTitle!?!?!?!?!?!!?
not really? What is hard with using th Events API
lol
discord aint telling me its wrong but ik damn well it is
REVOLUTIONARY
hashmap 3x
How u mean with the events api?
lol your a funny guy
PlayerInteractEvent 

because adding 1 if statement was too hard
introducing RightClickEvent
anyways
How sloppy is this for doing 2x block drops (taking the entire list copying it and adding it to itself)
Omfg yeah and store it in a manager to then check in the onClicks.
Fuckijg big brain
Lmao
But yeah it made me realise just how screwed a rep custom items have got from this for non devs
CustomItems?
?
what Custom Items
As due to CP and other plugijs having this problem a lot of servers assume its the norm
why would getHolder make custom items performance bad....
its still an issue with the custom items being badly programmed lol
so they still deserver the reputation
you might not wanna use the CP please expound
thought this was about getHolder...
Ffs
The 2 are very very connected.
@analog basin why do you delete responses so often
I get like .1 seconds to read it
so the call does nothing when normal coloring is used, but gradiest is used?
.
It is bad either way
But more meta data
Worse issue
either way thats not gonna show up on the custom items plugins load
Download CorePortect :s
its gonna come up on the plugin calling getHolder()
PR
No we are ssaying custom items srnt even 1/4 as bad as they currently are if this issue in plugons are resolved
Moment I'm home from holiday chief i gotchu homie
idk i doubt getHolder() magically makes all custom items plugins work like crud
Most are very poorly made or have code bases ranging from 6+ years without any major rewrites/bases
I know it's a bit odd to say but imagine ur not a dev for a min.
Ur Johnny server owner.
Custom items added to ur server caused ur server to shit the bed.
Are u ever ginna think "gosh darn that fuckijg core protect get holder"
The issue isn't the actual problem itself, it's the fact it's such a subtle problem that's missable that it's caused a community stigma for the wrong reasons
you're really dramatic lol
this is gonna sound really mean but
I dont think little johnny should be handling a MC servers without learning how to use basic server tools like a profiler
I'm British
I think little Johnny should also open an issue on coreprotect
and a PSA on spigot about why getHolder() is bad and alternatives to it
shi
i might do it for free spigot clout

Imagine Johnny sees 15 plugins all running at 2-3% with no real red flags.
How is Johnny gonna know they should all be running at 0.3%?
Ladies and gentlemen, the point made manifest 🤣
It's been a while since I've made a cross-version solution for a Minecraft Plugin and I was wondering if the JDK is upwards or downwards compat, e.g. if I wanted to use Java 17 as my JDK and ran it on a 1.8 server would it recognize my record and still run?
Johnny would go into the servers software's #help-server and send his profiler results, and ask why his server is having performance issues
To which, someone experienced could look into the issue further
2% is bad for a single event
2% for an entire plugin is fine (with everything firing)
But a 2% tps increase from simply clicking is the cause for a major lag machine
Depends if u used java 17 features, it won’t work for older java versions
Okay, so if I wanted to support minimum 1.8.8 I should use that jdk and it will work for future versions?
No joke I'd love u forever.
As u can imagine my personality makes me to erm.. u don't wanna listen even if I'm right due to how I approach it.
It'd be amazing for folk to hear it from "not raz"
That's what I thought it's just been a while, thanks 🙂
1.8 doesnt work very well on anything other than java 8
If you compile with java 8 support it’ll run on java 17
Minus janky reflection hacks*
I.e. I've tried telling a big 200+ player community this issue and they don't believe me 😅
Because as I hope you can sympathise after dealing with my ass, it was me saying it 🤣
were the 200 players developers though
Real
Sorta my point.
I love that community to bits and I know several others who have this issue too.
I'd just like something, some source, some quote that I can throw at them and be like "look... its a thing ffs"
point then to the source code method
generally minecraft players arent the brightest
So its to be expected you got those results
It's more the fact it's me saying it, which I hope u all understand considering how pissed I got everyone yesterday
I need someone else to say it 😅
why do they gotta know anyways arent you deving the plugin theyre using?
or patching/fixing
It is one of those where unless admins give the bkg cheff kiss of approval it ain't getting changed.
If they cant approve a performance improvement i would leave in a heartbeat
especially such a simple one
would take maybe 30-60 mins to rewrite a decent sized plugin to use maps instead of holders
It goes back to the rep vs common sense thing
E.g: coreprotect has this problem
You are trying to convince Johnny server owner that there is an issue thst core protect, a plugin almost every other big server uses, has.
make an issue on theyre github
And hasn't fixed even though its a simple issue
I thibk we are privileged as coders sometimes to knownjust how rubber band and glue stick even reputable companies code is
Most folk genuinely can't fathom shit like core protect being the cause of a problem with custom brews yknow?
The world runs on jank
And most folkndont realise it
javas JVM is holding on by a thread at this point (literally)
Lmao
goofy ahh
This is my point.
We forget... most folk don't know this
those are the folk that dont need to run a server
You’ll be happy to know when people ask about gui in here we usually send smiles guide
Which does not use holders
if anyone serious about running a server they need to be able to keep an open mind to a whole plethora of issues
?inventory
whats smiles guide
I sympathise with them as I agreem.im an engineering lecturer and preach this very message every day.
But due to that I know most folk don't see what we see.
E.g before java I didn't even consider things being bugged a lot of the time and figurd I was an idiot.
Now I see em everywhere and realise its cause some pillock pushed something without reviewing lol
ah so he stores Inventory too nice
now thats worth smiling about
I do legit think we forget just how much more we see of the jank than everyone else
our nuclear missiles are ran on pre 80's software btw
floppy discs
worlds fucked
...I'm an aerospace engineer , preaching to the choir haha
i remembe hearing about this nuclear plant that had a computer that it relied on for cooling and when some tech came out to work on it it was just caked in dust
lemme see if i can find the vid
Before we get too off the point from before. I would highly highly appreciate someone writing this all out in a neat format.
Hell I'd be infinitely grateful.if it was md_5 as it'd hold weight.
But I'd understand if not
But worst can be said is no
Because legit all I'd need is someone else to say this, fully.and clearly and I'd hope that'd be enough
I.e. the get holder issue and why it effects custom items hard
just tell your boss to hop in this discord channel and we all call him dumb for not listening to his dev, ez /s
i wouldnt be surprised tbh
Ur my people. Blunt, honest, to the point.
but if they pay they pay
It's more a shit tonne of politics
idk why you couldnt just make the change and push it
like whats reallystopping you
The way they do their releases 🤣
Nice shiny git hub don't mean they gonna grab and release server side
kek
but, if the change is there, next time they want something it will be there 😉
Plus once again its the thing where let's say core protect. I could fix that in an afternoon
you dont need to fix others just make issue requests
U gonna trust me when I say I changed a well known plugon to "fix it"
why not
^ was just gonna say
no one else is talkin bout anything else
man needs to chill
They ripped me apart yesterday for it 🤣
rightfully so might I add
Aye
Md was in chat and he is literally thenmost qualified to discuss it. Got some good stuff out the convo lol
justified
Bro, whats the error here? https://pastes.dev/DYnWIRSxxx
!help
!unverify
!verify
Usage: !verify <forums username>
?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.
A private message has been sent to your SpigotMC.org account for verification!
idk much about IJ but what java version you using
your pom is targetin java 7
Someone that knows Kotlin would like to explain this to me?
companion object {
var config: Configuration? = null
}```
unbreakingPoints.put(3, plugin.getConfig().getInt("enchantments.DURABILITY.3"));
unbreakingPoints.put(4, plugin.getConfig().getInt("enchantments.DURABILITY.4"));
unbreakingPoints.put(5, plugin.getConfig().getInt("enchantments.DURABILITY.5"));
unbreakingPoints.put(6, plugin.getConfig().getInt("enchantments.DURABILITY.6"));
enchantmentPoints.put(Enchantment.DURABILITY, unbreakingPoints);``` i have this code trying to load the points from my enchantment_points.yml but it will not load the values into my gui. everything worked fine when i had just the number value in the points section. it is loading the file into the plugin folder too
getConfig() only returns the config.yml
https://www.spigotmc.org/wiki/config-files/
If you wanna use config files with other names (or more than one config file) use this guide and go down to "Using CustomConfigurations"
thank you!
i need a spawner plugin like donutsmp
you'll need to pay a developer for that
how and where
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/
anyone
Is there a universal method to check for entities on a certain area, like from -4, 0, -4 to 4, 4, 4 or do I have to loop through each location in-between of those to do that?
Hello everyone, just a quick question: Do I have to set the position of the Lode Stone of the compass to create a player tracker compass?
I would like to make it so that only that specific compass points to a specific player
World#getNearbyEntities
yes, can do with itemmeta
If I wanted to program a network based marketplace system, would it be acceptable to use the bungee server as the place each server requests whether or not an item has been purchased? I was thinking each request could be processed within a queue and mark the item as purchased for the first request in the queue to purchase said item. OR is there a better alternative? I'm not sure how standard it is to program a system like this on the bungee server it's self.
Usually you'd just use a database or something?
Rather than try and make bungee a database
I was thinking that, but I was afraid that if Server A requested to purchase an item, it goes through then sends a request to the database to update it's availability, maybe Server B also checked the item's availability at the same time and returned that the item is available before Server A was able to update the availability
That's not how DB's work. If you could do that you'd be able to withdraw money from the bank twice if you clicked the button fast enough
Right, that's my fear with it. Is there a way to check the database and update it simultaniously based on the data?
Yes?
Why not just delete the item from the DB when it's purchased?
You can check the result to see if it actually was deleted and if it wasn't then just send an error message
Okay so:
- player purchases item (can afford)
- delete item on database
- check if item is deleted, if so purchase was successful
correct?

