#help-development
1 messages · Page 1291 of 1
I mean, fair enough. Not really going to tell anyone how to operate their servers 😛
I was mostly speaking from an architectural point
but maybe you are right, and it wouldn't work for servers that constantly update
I haven't really tested it that way
honestly even scanning the entire world in-server through the bukkit api or nms wouldn't be that bad performance wise if someone optimized the nbt parser/object model a bit
also, I did run custom implementations too where I only needed to update the protocol not everything else
I don't think it can be optimized further to a point it isn't a problem at that scale
unless you mean changing the algorithm altogether, which bears its own set of troubles
most of the performance impact comes from the nbt impl allocating gigabytes of trash that nukes the garbage collector
the way mojang implements loading of chunks is actually not that optimal
just recycling the nbt objects would already make a huge difference
or using a stream based reader that doesn't allocate
but that's quite a bit more difficult
for example remember how books could crash a server because the chunk became too large? yeah the reason that was even an issue was because mojang never bothered to check the size of the region file before loading it
I mean, that's just shifting the issue to IO which is often not ideal if you're not planning to scale vertically
thus it sucked up all the ram and OOM'ed
i have plenty of threads on my machine and i'm not going to run out of io on a nvme; io is fine as long as it's async
if they properly did memory mapping, loading a region file shouldn't cause OOM and only in rare circumstances
but that is mojang for you though
can't really blame them, their implementation is good enough for what the vanilla server is supposed to be
bugs aside, of course lol
right, can't expect enterprise level software for free 😛
muh fucking realms shitting themselves to 11tps because 3 concurrent players at a village
I always wonder if people actually use realms for more than a friend group
they have no discoverability so probably hard to market it at all
they're only really used by kids and super-normies
like
nevermind
that would be offensive
I once remember a youtuber trying to setup a realm to play with their viewers
it lagged so bad someone in the community just setup a paper server that worked better lol
How can i make my own Strucutre loot plugin, that refills a marked structure's random marked spots with loot crates
yeah the max concurrent players you can reliably get is like 10 for fresh servers, drops down to 4 after you have villagers and hoppers and shit
in this sense zero discoverability is more like a feature
Hello guys .. i need some advice
so my system right now is like this :
redis cache -> local cache -> mysql
this is for loading users data like uuid , kills , etc ...
what do you think of alternative?
(large scale project must be really really fast on pulling data) .
mysql is really fast in pulling data
if you don't think it is, then that is because you have not set it up properly
mysql is capable of handling million + queries a second
having a redis cache and a local cache is really not necessary and you are using up more resources in doing this
well, local cache is necessary if your database isn't hosted on the same machine, just because of network latency
but if you do have the database hosted in the same cluster, then yeah, databases are often fast enough for most use-cases
it just being in the same datacenter the latency should be near instant still lol
but yeah if we talking about a db server not even in the same center then yes you should have a local cache, but I was just pointing out that a redis cache and local cache is completely unnecessary
its redundant in other words
couldn't you google this
It’s literally just build
Looks like the build failed
it doesn't say, i don't know
You tell us what the error is
There you go
It tells you what the issue is
Not on your desktop
Either you move the project there or you run the build command in the project folder
maybe you should watch that 16 minute video, it probably covers these basics like the concept of "working directory"
Yeah but how much did you give the instance
thread 4400
yep
memory leak from a mod
i think it was duplicate fabric api mod that caused this it seems
not sure how did it end up here
bad autoupdate i guess
hey guys, i'm having trouble with the EntityDamageByEntityEvent
when a player hits a player and are both in creative mode
the event doesn't trigger at all
and the interact events doesn't catch it either
I mean they’re not damaging each other in creative
And creative is sorta a rip for anything
the real question is what the hell are you trying to do with a damage event in creative
question here, not sure if this has any performance impacts
but how should these precondition checks be ordered in terms of performance ?
if (!(event.getEntity() instanceof final Item item)) {
return;
}
if (event.getBlock().getType() != Material.WATER_CAULDRON) {
return;
}
if (MaterialTags.CONCRETE_POWDER.isTagged(item.getItemStack())) {
return;
}
would the materialtags check be the least costly or the ordering is negligable here
imo the ordering is negligible, it looks more like a micro-optimization if anything
unrelated to your question but why instanceof final
didn't even know you could put a modifier there
as for the question itself, none of these are particularly slow operations so that you would need to worry about that. checking the MaterialTags is probably the most expensive one there
not to say it doesn't ever matter, getting a block's BlockState for example can often be expensive enough for one to worry about it. Just in this particular case, it doesn't
I guess im going to learn about packets tomorrow... wish me luck
it shows that the given parameter will be final and not modified anywhere in the method 
I am aware of what the final modifier does, I was wondering why they made that variable final
people don't usually mark local variables as final since java will treat them as such if no assignment is made to them anyway, the so-called "effectively final" variables
I rarely have a case where I need to use it
It either doesn't understand what I want, or does and gives me the really easy solution that is very very inefficient
Any slightly more advanced implementations destroy it and it tries to loop back to basics
yeah, honestly I think about 90% of the time I used AI are times when I should've just gone to bed
where I'm too tired to really think about a problem but still really want a solution before calling it a day
💊 🕵️♂️ 💊
Spend time describing goal and waiting for response and tweaking generated code
Spend the same time writing it yourself for a better solution
if the problems I wanted to solve were easy I wouldn't be too tired to just implement the solution
Oddly, even generating documenting sucks. Youd think a large language model could write good docs but no
stating the painfully obvious and also not noting any impl details or quirks
tbf that's a lot of what documentation tends to be
The study on how using chatgpt rots your brain is also not a good motion of confidence
I'm always skeptical on those kinds of studies
https://theconversation.com/mit-researchers-say-using-chatgpt-can-rot-your-brain-the-truth-is-a-little-more-complicated-259450 that is true but given its lack of true benefits to me, I'm not exactly champing at the bit to use it
I did try it for a little while to say I did it and I've since just completely removed it from IJ
any boilerplate I need done, I can get done for much cheaper with templates
when I use ai appropriately I don't use it to think on my behalf, I either use it to go do some preliminary research for me, as a more advanced search engine or to do some thing stupid repetitive on my behalf after setting the first example
more than once it has been pretty great at finding stuff that I can describe how I remember them being but would take a while to try to dig up
also pretty good when I know a better solution must exist but I have no reference point on where to start looking for it
I can see that. It is better when you dont know the name of something so you can just describe it. Google's not good for 'thing that looks like and acts like'
it's like how for the longest time I halfway thought something like a slip ring device must exist for electronics but I had no clue on how to even start looking for what such a thing might be called so I just described it and immediately found it
basically just a little device that conducts electricity for stuff that spins
without requiring cables
of course it had to exist but it would be far more time consuming to try to find such a thing using conventional methods
Honestly I probably use AI more than searching now cus it's just better
thatnks 🙂
hi
using com.github.ben-manes.caffeine ? good for caching?
should be
depends on the type of caching you are seeking
UUID , SkyUser ?
its for a big project kind of ..
expiring cache is usually sufficient for most things
this looks about right, though as others have said the impact on ordering is going to be fairly negligible; instanceof is the cheapest and will most likely prune the most calls, but for Block::getType vs MaterialTag::isTagged, you'd probably have to benchmark to know which one is cheaper, and both will prune about the same factor of calls, so it's difficult to say which should come first
Block::getType has to go through several levels of abstraction and indirection to get the actual block type, so it's much more expensive than instanceof
similarly MaterialTag::isTagged queries i think a fastutil open hash set, which is also much more expensive than instanceof, but probably cheaper than Block::getType
Hey, I'm wondering if Inventory.getContents() is guaranteed atomic?
I'm making chestshops and I'm using it to determine stock. So I'm wondering if it's possible for two players to check the inventory stock at the same time and be able to duplicate items basically
depends a bit on how you define atomic here
if it's being accessed and read asynchronously from multiple threads, no; the retrieval of the itemstack list is not atomic; if another thread modifies multiple slots in the container, only some changes may be reflected in the getContents() result
if it's only being accessed from a single thread, "yes" in the sense that no other operation (unless called by you) may be interleaved between your own operations on it
that said just because listing the contents is or is not atomic doesn't guarantee that you can't dupe with it; that depends entirely on how your chestshop plugin works
repetitive use is great, like i typed out
"duplicateUsername": {
"value": {
"code": 1000,
"message": "Username is already in use",
"field": "username",
"details": {
"username": "john_doe"
}
}
},
```And it made the same structure for the email part while adding 1 to the code number
huge time saver imho
Block::getType has to be more expensive
at least on spigot, it ends up on a map lookup
for some reason it doesn't use CraftBlockType#minecraftToBukkitNew (registry lookup) and uses the old one which goes through CraftMagicNumbers
it also has to find the chunk through the chunk map, the section from the chunk's sections array, then compute the index for the palettedcontainer nibble, then mask the nibble and query the palette (usually a hashmap) to get the nms block type
so for sure more expensive than a hashset query with a material
yeah, it is an unusually expensive method that is used all the time
well, "expensive", it probably doesn't matter but I would've expected to just have CraftBlock save the type on its impl instead of doing the lookup every time
I guess that is just asking for desyncs with minecraft internal data but still
for that to work we'd have to canonize blocks so there can only be one instance per block location, or yeah, desync town
now that's sort of feasible except we'd be relying on the gc to determine when those instances become obsolete (or make Block implement AutoCloseable lmao)
I mean, block instances are never created by users so they could easily be pooled if it were an issue
I find the idea of closing a block very funny though, so if I ever need to do that I'll go with that implementation
i do that for my own custom block data storage and it is kind of annoying
but it's iDioMaTiC
What did you call me!?
I called you DoGmAtic
Yeah makes sense
It's single-threaded and my code is safe from those kinds of exploits I believe
Thanks
just make the shop transaction-based. Then you'll be fine.
Hi, do you know why my code doesn't show custom model data?
ItemStack sword = new ItemStack(Material.NETHERITE_SWORD);
sword.getItemMeta().getCustomModelDataComponent().setStrings(Arrays.asList("default"));
inv.setItem(0, sword);
Not sure, but getItemMeta might return a clone of item meta and not the origin object, so you need to .setItemMeta() the updated meta
I try
yes, it always returns a clone
yeah
ItemStack sword = new ItemStack(Material.NETHERITE_SWORD);
ItemMeta metaSword = sword.getItemMeta();
CustomModelDataComponent componentSword = metaSword.getCustomModelDataComponent();
componentSword.setStrings(Arrays.asList("default"));
metaSword.setCustomModelDataComponent(componentSword);
sword.setItemMeta(metaSword);
inv.setItem(0, sword);
My code got bigger
Yea, happens
if you use paper, you can use ItemStack::editMeta
or maybe that also exists on spigot
I'll create a function I think xD
And do you know how to add canBreak or canPlace to the latest version of spigot?
On itemStack
How would I go about cloning a player's inventory? I want to check if the player has enough space in their inventory.
Inventory clone = Bukkit.createInventory(null, 54);
clone.setContents(player_inventory.getContents());
HashMap<Integer, ItemStack> map = clone.addItem(item);
if(!map.isEmpty()){
Log.playerMessage(player,"You don't have enough space in your inventory!");
return;
}
I currently have this, but being forced to have the inventory size at 54 isn't making this logic work. player_inventory.getStorage() returns 41, but that isn't a multiple of 9 as required by Bukkit.createInventory
that includes the armor/offhand slots
you could i guess bandaid it by trimming the last 5 array indices from getStorage() to get to 36
it'll mean that stuff won't get inserted into the armor and offhand slots, but that's kind of acceptable
alternatively just loop through the inventory manually and see if there's enough space
Are the last 5 elements guaranteed to by the armor and offhand slot?
i don't remember, but they're always in the same order
i know offhand is slot 41 for sure
but armor might be 0-4
either way one Arrays.copyOfRange should do it
or List.subList if it's a list
why clone? just add it and if the returned map is not empty the add failed and there is no room
he most likely wants to do it atomically, as in if some items don't fit, don't add any at all
by the time you get the map, some of the stuff is already added in the inventory
ah
Yes
so add all or nothing
personally i'd probably just drop the excess on the ground with the can be picked up uuid set to the player, and call it a day, but i guess that's not super ideal
Hi, do you know how to add canBreak or canPlace to an itemStack in the latest version with spigot?
?jd-s
This seems like a better option to be honest
I didn't know you could do that, so that only a certain player can pick it up
I didn't find this function in the Javadoc however
World.dropItem() doesn't accept any UUID parameter
Found it
Looks like there isn't a direct api to do that atm. But you can use nms or the unsafe api to make an item directly from nbt
I found
ItemStack kit = Bukkit.getItemFactory().createItemStack("wooden_pickaxe[minecraft:can_break={blocks:["minecraft:waxed_weathered_copper_grate"]}]");
Yeah that'd probably work as well
can anyone help me with item model?
i want to create a custom item which appears when i kill a custom mob, the problem is that the item appears but without the custom texture
private ItemStack createCuernoDemoniaco() {
ItemStack cuerno = new ItemStack(Material.GOAT_HORN);
ItemMeta itemMeta = cuerno.getItemMeta();
if (itemMeta != null) {
CustomModelDataComponent customModelData = itemMeta.getCustomModelDataComponent();
List<String> strings = Arrays.asList("permadeath:cuerno_demoniaco");
customModelData.setStrings(strings);
itemMeta.setCustomModelDataComponent(customModelData);
itemMeta.setDisplayName(ChatColor.LIGHT_PURPLE + "Cuerno demoníaco");
itemMeta.setLore(Arrays.asList(
ChatColor.GRAY + "Un cuerno místico que emana",
ChatColor.GRAY + "energía demoníaca..."
));
cuerno.setItemMeta(itemMeta);
}
return cuerno;
}

whys it an array
a guy here told me to do that
an item only takes on single custom model data
also make sure ur resourcepack even works
my resourcepack works
idk how that is represented in the api; i think the old int method translates it into a single-element float array
so my code is correct?
that sets the custom model data as a list of strings
i use item model in newer versions
cute
yeah thast fine
presumably it should probably maybe work
do /paper dumpitem while holding the item created through your code
i didnt know it took arrays though?
to see what the data actually ends up being
or whatever analog spigot may or may not have
i think it's arrays now to support overlays
that looks about the same as this so i guess it does work?
the problem is that the item appears when i kill the custom mob
but without his custom texture
what plugin manages the custom mob
im thinking that the problem maybe is the word "permadeath:"
what do you mean
wait
im trying to add it as recipe too
to see if i can see the texture
but its the same
Hello
U have texture pack made for it?
Eh i cant really help with that , i was here to ask if someone is willin to teach me how to develop mc plugins
are you adding the recipe through the bukkit api or through some other plugin
and when you take that untextured horn from the result slot, what does /paper dumpitem show for it
custom model data is the problem?
looks like somewhere along the way bukkit/nms converts the single string into an array of strings
and ditches the namespace from your string
it was permadeath:cuerno_whatever originally
now it's just cureno whatever
smells like an api/impl error i think, but you can probably bandaid it by not using a namespace
i can't use "permadeath:" in namedspacedkey because it don't supports the :
Can 1 of u teach me or atleast guide me with the roadmap to develop plugins?
you know how to use item model?
isnt it supposed to be item_model ?
it is
how do i use item model in paper?
seach their javadocs for data component or whatever
ItemStack::get/setData and DataComponentTypes
thanks guys
this worked
ItemStack cuernoDemoniaco = Bukkit.getItemFactory().createItemStack("goat_horn[minecraft:item_model="permadeath:cuerno_demoniaco"]");
hello is ther anybody thnow , with ei editor can i make fishing rod which after shot enemy giving him effect slownes and blidness?
yeah u can make that with ai
can you give me tutorial pleas bro
no ask ai
its really easy
its like
1 event
and then 2 apply affects
thats it
i'm sure if someone put a bit of effort into it, one could create a pretty decent tutor/guide bot for picking up the bukkit api
but effects for enemy
When the armor stand is passanger of an zombie for ex. can I make it it will not remove zombie name (if set ofc)? Bcs rn, its removing zombie name and displaying armor stand instead. Probably I will have to move armor stand with zombie than?
just use that
kaperton
or something
its pretty good
is that specifically for bukkit?
how i can make this but effects for enemy and give cooldawn for this
is it possible?
yes, just only apply it to enemies and enforce a cooldown on it
what
its a chat bot
it detects keywords in images and texts
is in abilityies blidnes and slowness?
yes, i mean someone should go and create a chat bot specifically for learning the bukkit api
I'm sure you know, so many tuts on yt that go over bukkit/spigot, Stephen King (not the famous writer kek) has a udemy course that goes through literally the entirety of the api +- a couple things... I don't see the benefit in a bot guiding you through courses and tuts such as this though
I feel like the underlying concepts of what you're writing is where a bot might be able to asist so you actually know what you're doing and why
It'd also be nice for it to analyze side effects of some api snippets and how they correlate to your impl, etc
a bot is probably objectively worse than a well structured and edited video or text tutorial, but the issue is that most people have maybe like 500ms worth of attention span
which is something that a bot works better with
Yeah I suppose that's true
Different learning models exist for that exact reason so yeah
Sucks you can't find someone who'll just sit down and read though
Imagine getting a tut on bukkit api in the form of a bedtime story kek
"bukkit api 101 part 31 out of 75" youtube short
31 out 75 more like 31 out of 1092
1 minute shorts over X methods in the bukkit api lol
nah just show useful stuff
particles
custom item data and such
fuck packets aint nobody gonna learn that
on ytbe shorts
real ytbe short users
Idk I particularly enjoy reading books
I mean
bro my attention spam is so small
i finish a round
then alt tab
its like a 15 sec intermission 🙏
Books are good for information when you're actually able to sit down and read it. I understand the appeal for that short attention span but it'll never be a good trait in the future
in my experience, the towny guys have been using chatpdf with pretty good results
What is chatpdf? essentially ai printed jdoc descriptions?
"can u apply an effect to the player on the fishing rod event"
it's like uh
"chat with a pdf"
i.e. chatgpt but with file search that can read and search the pdf
Like a real time response q&a kinda thing?
myeah
basically javadocs on steroids
they have a free plan up to 10 page pdfs and n messages that anyone can use
Oh that's actually really cool
so they have a discord command that just links to it that they throw at anyone asking newbie questions
or it looks like they've upped it to 120 pages or something
That's a cool system, feels like it's the same as designing your own bot or perhaps worse... It's only context is what's given from the pdf I assume
I'd have to try it and see
that's what 99% of "bots" made using ai are
I prefer notebooklm, it generates podcasts about the PDFs I send to it
very few people actually train their own models for things like these
it's always just some basic function calls and files to search through
Uh can we make players glow for specific player only in vanilla bukkit?
Yeah kinda what I guessed
That sounds like a packets deal
yeah thast what packets are for
use packetevents
even then file search and function calling can be very powerful when done right
Protocollib right? I searched on this and got to know u need to have custom servers jar
Who ever trusted these kinds of things to be done "right" It's alwyas just been "if it works it works" and even then that saying is so vague, you could return almost any result of it "working"
protocllib is for old people who cant break their habits
also are u using paper? if not, why arent u
lmao
I used maven architect to setup plugin files , and paper for server
yeah thast fine
you're going to end up muted like that fase lol
now u can use packetevents which is another plugin that makes it easy to interact with packets
why
i thought we supported paper 🙏
Don't let md see you
Alr appriciate ur response
Spigot doesn't endorse any of its forks
sorry papa md 😭
issue with it is that people will come here for issues which might be inherent to Paper and its APIs, which leads to all sort of issues
I'm not an expert on spigot nor paper api, yet I'll still yell at you for using paper in a spigot server
well, use whatever you want, just choose the right discord to ask for help about it
?whereami
Perfect
How can I prevent a villager from shaking its head after interacting, especially when it has no trades? I'm already cancelling the PlayerInteractAtEntityEvent
They redirect you to it if you're not a supporter, even for like API questions (since Towny API is very poorly documented). It's good for basic questions, but for anything that actually isn't a feature it usually just hallucinates
It's probably a packet or two you have to intercept and cancel if I had to guess
Hey, I have a bunch of items stored in a database from a legacy version (1.20.2) and I want to update to 1.21.3 (another legacy version, but one with the updated Item Component system). How should I go about updating the items? Is there a legacy deserializer I could use that includes NBT data? (resent since I sent in the wrong channel)
yeah that's pretty good results in my book
as in it can give answers to the questions it's been prepared to answer
can't really expect more out of it
How is it serialised
Hopefully as NBT
The game should still be able to deserialize old NBT values
Even better if they have a data version so you can run it though DFU
if you know the version they're from you can determine the data version as well
pretty sure paper at least runs all items through the dfu to the current data version under the hood
stopping at 1.21.3 specifically might be difficult though, or at least require a direct call to the dfu
or well unless the server is at 1.21.3 but since they described it as a legacy version i'm guessing it isn't
is there a way to "spawn" a beacon beam at a location using nms?
ah, i think i just realized how wynncraft does their in-game waypoints with this
I was a happier man before i learned to use maven and gradle properly
why is it
ah man
it's one of those again isn't it
1.21.6 and 1.21.7 are both R5 internally?
i was a happier person before i learned how to use a computer
crazy, I was a happier person before you learned how to use a computer as well
D:
good evening, I'm looking for a developer to start a Factions server project. If you're interested, send me a DM.
?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/
thanks
and then it was all down hill from there
Hmm
is there a way to prevent player from putting their item to a chests? i want them to have the item all the time in their inventory.. i dont know how to detect when they put it to chest because they can use number key etc
thats still InventoryClickEvent Im pretty sure
you'll need to listen to click and drag events and account for shift clicks and a few other things
yeah but how to check if the item was moved to chest?
thats the problem
Check if the clicked inventory is the top inventory and the cursor isn’t empty
Or if it’s the bottom inventory and a shift click
listen to the click event and have an exhaustive switch statement on the InventoryAction and use getCurrent and getCursor to determine whether to cancel it or not
there are lots of ways of inserting items into an inventory and taking them out, so the switch is useful as a checklist so you don't miss any
but the cursor is empty after number clicking
for HOTBAR_SWAP you'll want to check both the target slot and the hotbar slot
how
I would just cancel that one if the clicked slot is the upper inv
depends on how strict you want to be, if some false positives are acceptable that's fine
but how do you check if its the item
they can put other items just not that one
I see
correction, getHotbarButton
Then yeah check the item in the hotbar slot
getCurrentItem() ?
its the item which is clicked
how does this help with checking if the special item was uhmm put into the chest
because the click event fires for that item and that item is the item that was clicked
check the item in the hotbar slot with getHotbarButton() and get the item in the other slot with getSlot() or getCurrent(); the items in those two slots will swap places
if the one in the hotbar slot is your item, and the getSlot() is in the chest, cancel
what am i doing wrong here
o:
why do i need the 'getCurrent" ?
i dont thing you used this
the jar gets created, just not remapped
i mean the getSlot to check if the top inventory was clicked and not the bottom one right
it's just a shorthand for getting the item in the clicked slot; for hotbar_swap you won't need to check it, but you might for some other inventory actions
if you wanted to for example prevent an item from being taken from a chest you'd need to check it as well
thanks
Not sure, presumably mappings.csrg is wrong. Also if you're a plugin you don't need excludes or access transforms
OH i think i didnt add --reverse
idk this is the one i got from the BuildData repo history
of 1.17.1*
If you're going from Mojang you need two steps, Mojang to Obf then Obf to Spigot
pk at the bottom and atg at the top would be Obf. The rest isnt
ye but the thing is that why did they not change
Because you reversed the spigot maps not the Mojang maps?
yeah i dont seem to find the srg mappings of mojang available online
they seem to provide json files
which is assume is yarn format or whatever
i think mojangs mappings are just a dinky text file in the version json
it has a format but idr what it is
specialsource can handle .txt
Alex has a nice tutorial to convert nms spigot maps to mojmaps
I THINK I GOT IT WORKING
i wrote this util
which downloads the necessary mappings (if needed) 😄
then i updated the old gradle task
now the class looks like this 😄
how can i use a placeholder like luckperms prefix in my p.sendMessage?
you'd need to use something like placeholderapi in order to parse the placeholders
thats literally what he asked 🙏
unless you specifically want just the luckperms prefix, in which case you can just depend on LuckPerms API and obtain the prefix from it
ig Vault API would work for that purpose too
vault is preferable
the luckperms api for "just get the thing" is really overkill because you can have multiple of "the thing" and there are context sets and weights and all manner of nonsense
good old vault just has a get and it gets you the thing you want to get
lp metas are nice if u know how to use them properly
vault api is better then the papi api?
Is there a way to check if a player closes a book gui or is if he has one opened?
you can check if a player has opened one by listening to the packet however I don't think you can check whether they have closed it
i think it might fire an interact event but i'm not 100%
I'd just skip books altogether and use dialogs
no API for it yet I believe so it is all the more fun kek
I thought that was just for bungeecord
but muh 1.8 players
I'm trying to make a book opening plugin and it has a feature that checks priority for books
and i want it that if the console tries to open a book for a player and the player has an open book already, with a higher priority it just cancels the book opening. or else it opens the new book to the player
check if it triggers an interact event first
if it does not, then you might just be out of luck
im trying to do that rn
I'm thinking of doing it that if a player interacts or moves, then i take that as he doesn't have an open book rn, and can open a new book.
but that's a pretty cheap way to do something like that
not reliable aswell
not reliable but realistically not like you have any other way to detect it
true 😭
you can make it more reliable by checking more interactions types, i.e. if they scrolled their hotbar or opened a different inventory, etc
use the player input packet
i mean event
that should be more reliable than just checking for movement, because of e.g. water pushing and soft collisions
wait i got an idea
what if u made a specific client launcher for ur server
then added a custom event to that client and server
so than u can listen to the book closing event
Exactly!
man your a genius
that might work not 100% sure though
luckperms has a metadata system that actually synchronizes over the network
let's get rid of husksync / its alternatives and just use luckperms
💪
what about when player clicks on the item in the inventory, and while having it on the curosr they pick up some item and dont have any space in inventory and then they close the invenotry... any way to prevent that? i want players to be able to change possition of the item in their inventory but not get rid of it in any way
you could listen to inventory close, check if the cursor is holding your item, try put it in the inventory, and if there's no room for it, toss/delete something from the inventory to make room for it
maybe
if you want to ensure an item stays in the inventory lock it to a specific slot. prevent it being moved at all
What if I don’t want to lock it to a specific slot
what plugins usually do with items like these is shove them into a "quest backpack" gui where it can't be interacted with
just looked at
and maybe clicked to do some quest thing
I don’t see what terraria has to do with this
Hey, this is a pretty simple problem but i am not getting it.
How do i make it that if I want to have an item in the 8th slot (hotbar on the far right) to have an item there and the player shouldnt be able to move it, how do i do that? I already got it to be non dropable, but InventoryClickEvent is really weird its firing multiple times..
This is my code:
if (!player.getWorld().getName().equals("plotworld") && !player.getWorld().getName().startsWith("farmworld_"))
return;
if (event.getCurrentItem().isSimilar(getCbCyberMenu())) {
event.setCancelled(true);
Bukkit.getScheduler().runTaskLater(getInstance(), () -> {
if (player.getInventory().contains(getCbCyberMenu())) {
player.getInventory().remove(getCbCyberMenu());
}
player.getInventory().setItem(8, getCbCyberMenu());
player.setItemOnCursor(null); //
}, 1L);
}
Inventory interact event
what? thats just the event that InventoryClickEvent extends ?
how do i even check if he clicked the item from InventoryInteractEvent?
@EventHandler
public void onInteract(PlayerInteractEvent e){
Player player = e.getPlayer();
if(e.getItem().getItemMeta()...){
e.setCancelled(true);
if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK) || e.getAction().equals(Action.RIGHT_CLICK_AIR)){
player.openInventory(...);
}
}
}
PlayerInteractEvent ??
i don't think that has anything to do with what he's asking for
wait i selected the wrong event
wait
@EventHandler
public void onInteract(InventoryInteractEvent e){
Player player = e.getPlayer();
if(e.getItem().getItemMeta()...){
e.setCancelled(true);
if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK) || e.getAction().equals(Action.RIGHT_CLICK_AIR)){
player.openInventory(...);
}
}
}
this should work
What
is this chatgpt
what he wants to do is to stop the item from being moved around in the inventory
Inv Click or Drag event i think
just cancel the click event.
int slot = event.getSlot()
if slot = ...
setCancelled
this might sound weird but i wonder why dont we do plugins that rely on other plugins functionality just by dispatching plugin's commands like datapacks so that the code you write could be substituted easily without ABI breakage and less code overall, sure dispatching takes time, but does it really matter if some actions would dispatch slower than usual for an integration implementation, also it allows for access control like permission levels etc
you can treat commands as some kind of "RESTFUL api" where you input commands to do some things, suite of commands acts a set of service actions that could be done on the plugin
if you dont care about performance in certain contexts dispatching commands can be a lazy way to achieve very good backwards compatibility, access control and less depedencies on your plugin's codebase
most devs stick to APIs because they're just easier to work with i think
idk commands feel messier & slower a pain to debug maybe?
you dont need to debug command part because its not your plugin's responsibility
you can isolate plugins codebase from external dependencies
minecraft could for example expose /command add command which would register commands at certain privilege level
and plugins or datapacks would use that to register specific commands at minecraft level instead of tying your code with bukkit api wrapper on brigadier in backwards compat way
just like they did with /dialog command
one small change or typo can break things silently, right?
unlike APIs which catch issues early
well dispatching commands can return error results, they already do
JSON Restful API's essentially work like that, they send actions to a resource using HTTPS protocol via the URL
why not just do that with minecraft by dispatching commands for the sake of less hassle to maintain codebase in the future by loosely coupling your plugin's inner workings with another codebase
REST works because it returns clean JSON you can safely parse
you can return clean results too from a command if you wish to do so
for example if the command sender is plugin or mod type, you send message back to sender in JSON or other format
that still needs every dev to agree on the format and handle all the edge cases themselves
APIs just give you that structure and safety out of the box
i feel like this is the direction is currently going with the commands stuff they've been working for they want to expose as much functionality in commands as possible so that they could expose minecraft's functionality in a way that its content can manipulated as much version independent as possible
As a dev I’d still take APIs any day for serious plugin logic they're just way more stable and easier to work with long term
Exposing more via commands makes sense for vanilla stuff ig
You lose strong typing and add the complexity of string parsing and all of that
I've always had an internal debate about when a config system becomes a programming language
and IMO it's when you add strong typing
JavaScript is a config language, got it
and maybe when you also add functions
either-or
it's why pkl or whatever didn't get wide adoption
ppl cba setting up a big ass editor
Oh wait
This is spigot
Ignore me
Upgrade
Nuhuh 😤
are my shaders a tad large?
Nah
Good
they do not compile
Skill issue
Comment it out
it's being a bit dramatic here
no-
What on earth are you doing
I can tell by the 1.5 million vec4s
#general message
I did this
But well
Mc textures are up to 256x256
So if you wanna have more than 16 frames
Of 64x64 textures
Gotta put them bytes directly
(I am artistic)
I feel like it would be easier to just send multiple titles
No no
Look at the input
The command typing
Its rendered everywhere, and that's the point
I see
So uhhh
Hey, I need a mob to only target one specific player and ignore everyone else. how do i do this
Wtf do I do
"Oh nooo, a 1.5 million vector4d array, if only I weren't a fuckin rendering languge"
Wdym?
I mean, kind of
EntityTargetLivingEntityEvent iirc
Not sure, lemme look it up
Mob#setTarget(player) and then listen for EntityTargetEvent and cancel it
Since they're colors and all
Not a ton but yknow
Yeah, not sure about the C9999
Like this is some overflow for sure
Oh god you pass each one manually
Typed them by hand, yes yes
How else?
Just see damage modifiers bruh
what do you mean?
Apparently there’s an old shader that just used the textures in a file
Can’t seem to find it though
Yeah, but aren't you limited by what the Sampler(s) fetch you?
So only textures that are being loaded rn
Calculate with damage modifiers including and excluding armor, this will be the damage negated by armor, multiply by 0.3 and set the final damage as the one excluding armor plus this
At this point just give the player an attribute modifier to reduce armor
Granted idk if it can go below 0 and what will happen if it does
that sounds like the absoluite worst way to do this ngl
Why
I would have to redo it every time a player dies?
Do attributes get lost on death? Either way that’s not a big deal
pretty sure they also get lost when you log
They don’t
Pretty sure the damage modifier api is deprecated
No idea if it still works properly
Just try the original code with some print statements, see if the values match what you expect
Wait, is there one?
I cannot check the impl of this event rn
If there is an attr, it's way easier to use it
it works and it fucks with item damage
I forgot to mention I only want to reduce armor protection when players get hit by my custom projectiles
so is this the best option?```java
double originalDamage = event.getDamage();
double finalDamage = event.getFinalDamage();
double reduction = originalDamage - finalDamage;
double newReduction = reduction * 0.3;
event.setDamage(originalDamage - newReduction);
If it works it works
bruh wish there was a way to pause gradle tasks
was pulling a project mid-game ts lagging my pc like hell
Why are you playing games? Get back to work.
@echo basalt hey, do you know of any way to batch packets
I haven't done enough packet work
basically a way to take a bunch of packets you were going to send and group them
You can just use a bundle packet
where should i look for that
I was actually looking for some docs but I don’t see much on the internet lol, here’s an example of it being used:
Hi guys,
I'm trying to get the 1.8.8 jar with buildtools, but it gives me this classic error.
Please don't ask why I'm trying to compile the old version. Does anyone have any ideas for a solution to this issue?
Exception in thread "main" java.lang.RuntimeException: Error patching Block.java
at org.spigotmc.builder.Builder.lambda$startBuilder$2(Builder.java:617)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485)
at org.spigotmc.builder.Builder.startBuilder(Builder.java:568)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)
Caused by: difflib.PatchFailedException: Incorrect Chunk: the chunk content doesn't match the target
at difflib.Chunk.verify(Chunk.java:86)
at difflib.ChangeDelta.verify(ChangeDelta.java:78)
at difflib.ChangeDelta.applyTo(ChangeDelta.java:44)
at difflib.Patch.applyTo(Patch.java:43)
at difflib.DiffUtils.patch(DiffUtils.java:70)
at org.spigotmc.builder.Builder.lambda$startBuilder$2(Builder.java:605)
... 13 more```
openjdk version "1.8.0_442"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_442-b06)
OpenJDK 64-Bit Server VM (Temurin)(build 25.442-b06, mixed mode)
You essentially just pass it a list of packets
Well, you did when the constructor was public
Mojaaaaaaaaang
You’re confusing it with the subclass of that one, ClientboundBundlePacket which does have a public constructor
1.8.8 kinda old and that error isn't reproducible on my end. Likely the decompilation no longer matches the patches. You can start by running ./applyPatches.sh manually
openjdk version "1.8.0_452"
OpenJDK Runtime Environment (build 1.8.0_452-8u452-ga~us1-0ubuntu1~24.04-b09)
OpenJDK 64-Bit Server VM (build 25.452-b09, mixed mode)
Ah
i wish bundle packets were compressed as one contiguous packet instead of individually
would really help with those "spawn 1500 particle effects" situations
or honestly even chunk packets
right now all i think bundles do is make sure the packets get received within the same tick and probably not interleaved with any other packets
they’re already compressed when they’re sent through the wire, compressing them again would be redundant at best and mess up the entropy at worst
It’d be more meaningful if bundles only contained packets of the same type, so that one could actually take advantage of that locality but they don’t necessarily have that restriction on their design
It wouldn't be redundant because small packets, like particles, don't get compressed
Also, compressing larger things in bulk is usually more efficient
@sullen marlin Should I run the './applyPatches.sh' file created in the spigot folder after the error?
No, much more complicated
You'd need to run in craftbukkit, then commit to patched branch, pull spigot, run in spigot, then compile
?howold 1.8.8
Minecraft 1.8.8 is 9 years, 11 months old.
Idk what the issue is but I assume your block.java didn't decompile in the expected way
Worked fine for me though
idek why u wouldnt use a fork for 1.8.8
using spigot / paper for 1.8 is just crazy 🙏
I also tried to compile 1.8 a month ago, didnt work
in bungee you could just send the packet bundle packet, than all packets you wanna batch, and than again the bundle packet
flamepaper 😭
runs pretty good 🤷♂️
any server running 1.8 either uses a fork or maintains their own fork
i cant the dev of that shi seriously
maybe good marketing but no real improvements in his stuff idk
w flamepaper?
its deff improvement and at least maintained
imanity3 is good if u have the budget
or if ur tryna make a actual big server then either use 1.21 or maintain ur own fork
but again
flamepaper provides more than enough functionality
are u accepting folia level threadding lmao
dont even understand who actually buys stuff like this if there are like better free stuff
that is fully open source
like pandaspigot? 💀
its like 10 bucks bro
if u cant invest 10 bucks in a server u shouldnt be running 1.8
for example
anyways you shouldnt use 1.8 in the first place
i mean flamepaper does its job
it doesnt need to provide anything else apart from patching bugs and providing basic pvp funcitions like pearl fixings and kb
this ^^
u can fully replicate 1.8 pvp with the new components and such
1 to 1
it is
client side it is still very different
yes
i guess you dont have much experience
not with the new components
lol
components are a part of the client
again if u cant replicate it skill issue
still very different movement
You can't change the way player camera moves with the components
googo gaga
keep crying
skill issue
i had 10% of my players complain about the pvp not being like 1.8
just in case you want to know here is a good list of things which have to be changed client side to make it feel like 1.8
sword blocking LMAO
see clearly just shows ur stupidity
Sneaking Height & Interpolation u can change with resourcepacks
yes for example sword blocking
Removes the blocking delay caused by high latency.
can be fixed
💀
sword blockiung
is a literal component
yeah its a component in 1.21.4/5 or sum
its totatly different than in latest
clearly ur knoledge extends to 1.16
sure it is
Hides offhand hotbar slot and disable the swap hand hotkey.
easy to disable
these are all litearlly for a vanilla server
it does not behave the same clientside
u can litearlly change all of these with plugins and resourcepacks
clearly 0 experience
Hides held shields. server sided change
Disables the enderpearl cooldown.
server side change
Disables automatic sneaking when in low height areas.
packets can be used for this
even if you do all that it does not feel like 1.8 pvp
so everything u sent is changable?
so ur a 10% of my playerbase
who cares about u 🙏
bro has big player base 😂
but good for you that you generally dont care about 10% of your players
Why everyone so toxic today
yeah why would i
thats not how the world works
when 30% of people vote for a different president
that doesnt mean we dont care about them
its called opinion
if 90% of people have the same opinion
than that 10% is different
actually we talked about that you can 100% replicate 1.8 pvp in latest
thats no opinion if i say you cant
well its not a fact
you switched my statement into an opinion when its not one
it is though
if 90% of my playerbase
thinks its 1.8
then its 1.8
when u say u cant
then thats an opinion
bc 90% of my playerbase thinks otherwise
and they arent devs
they are players
bro just because 90% of humanity say that you are a snail, that does not make you a snail
I mean they start MC on 1.20 I don't know how they'd think it's 1.8
almost 100%
because you are slow
only reason I can think of calling someone a snail
it feels like im reading some convo if 2 rage baiters met
than skill issue
why are you calling me stupid now`?
guys guys
but if you believe you are, does that mean you are a snail though?
these are the questions that need answers
PENGUINNNN
aight lets not go down the personal route, keep it civil
okay, now, does anyone here know even a little bit about glsl?
aren't you supposed to punish people, that are calling other people stupid?
you are litrally the rage baiter
I think ur site is bork

well, I mean, it depends you see, usually Ill advice blocking or ignoring people as a first hand counter measure to de-escalate
at least i didnt put my elemantary school project on my site 🙏
he is punishing the rage baiter
actually i didnt make that
I just noticed I ain't insulting u, just wanted to see what you got on ur site
just cut the conversation
What’s the question? I touched glsl slightly in rust and java (bindings)
he would never do so
it was i philosophical question
well basically, I'm dabbling with core shaders and wish to render animated unicodes (gifs)
it kinda works
come dm
but the current system is limited by minecraft's 256x256 texture size limit
so a max of 16 frames of 64x64 pixels
not a lot
got to make them frames count
Nah bro wants to take the beef to dms
well, I think its good they want to share
so I tried to mechanically generate the shader with the exact pixels
sharing is caring you know 😉
yeah u come as well
True
linker error
which, you know, makes sense for 1.5 million vectors
https://youtu.be/BESVGrtdT5Q?si=QkFM9m2qYCqC7aAA&t=82 @azure zealot ? 💀
Bischen was im bytecode gefixed un bischen was von meinem neuen Server geleaked lol
Like zurm gefixten version datei: https://workupload.com/file/ZATLaFhrZeu
Passwort: einLikePls
I've got better shit to do than fight with kids over combat in a block game
Its a trap anyways. They just want to gang up on you because they know they can't take you alone
Facts
Cus my website actually works?
dont ask i was just mokking a friend
??
or maybe
i can swear at him in dms
yeah, super jealous it works and theirs don't
what gang up
so easy to say go kill ur self over text
but when it comes to dms
oo shiver me thimbers
if ur scared of ur squeaky voice dont bullshit over text
Dayum didn't know it was an achievement to use traefik with a nginx container
Yeah well, when I entered DM's over seas they were scared too
but that is entirely different I think
dont even gotta add me friend just join the call @vast ledge
so anyone got a better idea on how to store a series of images?
Definitely screams trap
Anyways, node or go for a webserver
I am not a fan of node unfortunately and biased on that
😂 nice ragebait as if i can add him to a group without adding me friend
go to like #verified
@grand flint why are you harassing people now
this guy took an hour to write a simple html header
What u use, I wrote a docker image for static content and just use that
I am an apache fan
Thanks for the watch time
yeah proud to be ur 20th viewer
Is that also a reverse proxy like nginx or just static content?
lol
😂
You can use it as a reverse proxy if you want. Apache was first then nginx. Nginx excells at static content but apache beats it when it come to dynamic
the ai agents are having strong hallucinations with this one
Good question, maybe something like .ico, afaik it can store more than one image
what are the limits?
well currently
.
ok, so no other limits?
this whole is render and the shader chooses one frame and stretches it to the original size
what you can do then is just record the changes between the first and last frames. And all you store for in between is only what changes
yeah, okay, but still will be way more data in a constant than GLSL allows
so essentially you just have a list of offsets and those offsets contain the changes
depends a bit, in that example like 95% of pixels don't change between frames
yeah I know-
Flexibility:
ICO files are designed to hold multiple images, making them versatile for different display needs.
Resolution and Color Depth:
You can include images of different sizes (e.g., 16x16, 32x32, 48x48, 256x256) and color depths within a single ICO file.
I'm speaking of a general system
According to gemini
okay, but how do I fetch the raster from within the shader
Can you load an ICO file with GLSL
I have no idea ;-;
My guess is no
i mean a texture is a texture
Since afaik GLSL runs on the graphics card
yes but not directly
you will have to pass the image data to a shader as a texture
yes, and I need to reference it directly in the code
Good luck with that
file format doesn't really matter, it all ends up in whatever format you use to upload the data to the gpu
It’s already on the GPU
then the file format hasn't mattered for a while
Afaik the gpu can’t upload something to itself