#help-development
1 messages · Page 1226 of 1
Kekw
is there a way to make a player 5% faster at breaking blocks
without giving him haste
What version are you on
Depends on what you want to do
i want a player to break blocks faster
ah what olivio is saying is that the attribute controls that
so if you change a given players attribute to +.05 (assuming its base is 1) they mine 5% faster
you can also give items modifiers that change how fast they mine individual bloccks
yeah but i want it to be on every tool not specific
player attribute then
^^
get the attribute and add a modifier
aha aha
okay
player.getAttribute(Attribute.BLOCK_BREAK_SPEED);
thats how i get it
Yes
but how i put it now? XD
player.getAttribute(Attribute.MINING_EFFICIENCY).addModifier(new AttributeModifier(new NamespacedKey(plugin, "mining_speed"),0.05,AttributeModifier.Operation.ADD_NUMBER,EquipmentSlotGroup.ANY));
may have forgotten a parenthesis somewhere
true but compherending the API takes a while to get right
basically, i just looked at the player api page and went from there, doing educated guesses
Yeah that's kind of what I wanted them to do
olivio can u show me the link anyway?
you kinda linked the wrong page to start from then lol
i try to do it without getting spoonfed
That's for the attribute
I did not link to the methods
But I did hint at their name
I doubt that would have helped them
i mean, what else would you use as starting point?
The player class and then a quick search for get attribute
Or just doing it in the IDE like they did
this is calm isnt it?
They did get that part just fine
Now on to add modifier which I was grabbing the link for but I'm on mobile
So you were a bit faster than me
now i am gonna ask the most basic thing
but i need to understand it
player.getAttribute(Attribute.BLOCK_BREAK_SPEED).addModifier(new AttributeModifier(new NamespacedKey(plugin, "mining_speed"), 0.05,AttributeModifier.Operation.ADD_NUMBER, EquipmentSlotGroup.ANY));
why does it say plugin in the code?
Chat GPT 
perfect
Even the spoon feeding has failed
plugin refers to your main class. It tells NamespacedKey what plugin it belongs to.
Permanent feeding tube id imagine.
Hi, I would like to send a message with a hover event that display an item tooltip in 1.21+. According to this issue (https://github.com/SpigotMC/BungeeCord/issues/3688) and my lasts 3 hours of experimentation, I'm doomed. Considering that Bukkit api does not allow us to send json message directly, is there any way I can send my hover event or do I need to go for nms (or any framework that use them like adventure) ?
Spigot has API for sending json messages
Also if you want to Adventure has Spigot/Bukkit support
Sorta*
afaik it does not. I mean you can use the bungeecord chat api and send a component to a player but you can't send a json message as a string. The api only expose this https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.Spigot.html and after looking at the implementation, it just transforms the Component into a json String which is then deserialized by server internals to build nms chat component to give them to the protocol engine and send them. But you have to use the Component api which I can't because the serializer is broken for 1.21+.
declaration: package: org.bukkit.entity, interface: Player, class: Spigot
Maybe there is Player#sendJsonMessage(String) method somewhere, but I did not find it
I assumed by json messages you just meant component messages
Not that you had a json string you wanted to send
Well
Using the component messages would work well but due to mojang inconsistencies (cf issue above) I can't use it
The serializer does not use the correct keys in the generated json object
does anyone have a very simple implementation of a packet listener using NMS for 1.21.4? It seems that networkManager is just gone from the connection class
packetevents, probably
wdym?
like the API
packetevents
by @alpine urchin
u could probably yoink packet listener from that
il have to look into it
is there really no way in maven multi module projects to have all the modules sync their versions up
intellij has a way
idk how tho
Set it to parent.version or smth
that does not work
No idea the actual format
I have tried
Hold on one sec
specifically because a parent reference is done under this format
<parent>
<groupId>com.magmaguy</groupId>
<artifactId>EasyMinecraftGoals-manager</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
it requires a literal for the version string
at least as far as I can tell
Yeah it appears you have to write that manually
You could always use gradle where you don't need to
so you can skip writing the module version, you just have to go into each module and change the parent version instead 🤡
make a task
You can use mvn versions:set or whatever to set it for all modules
Uh
hey md_5 since you're lurking
do you know if there's a way to force the server to recalculate lighting for a chunk
or for a block
it's giving me a hard time
also for whatever reason that command skips over every module and only alters my module manager
wonder if it's because it needs the version plugin thing
Idk, API doesn't have that issue
true
wish api could let me paste a few million blocks with little to no lag
just a small loan of a few million blocks md_5, think about it
one block at a time
in the IDEA application I try to click on the run code button but it says "The file in the editor is not runnable"
Who can help?
Yes you can sync all versions to teh parent
use <version>${revision}</version> not versions
Many questions
Are you creating a plugin ?
How did you setup your project (if at all)
What kind of file is it ?
At what level of programming understanding are you
Pretty sure we already discussed this before but your IDE/Maven was too old <#help-development message>
- Yes, I am creating a plugin
- I am using the Minecraft Development plugin, the Spigot template is selected, the build system is Maven, the Minecraft version is 1.21.4, the JDK version is 17.
- .java
- in Java Newbie
it was and still is maven 4
Ok great response I must say
So, you can't just run your plugin like that
You have to compile it (with some maven task), stop server, replace the plugin .jar file and start the server
On side you should see Maven tab
And 1.21.4 requires java 21
I am learning from one YouTuber's guides. He managed to click the run code button (this needs to be done so that the target folder appears)
Oh, thanks.
That must have been a custom profile which ran maven tasks or something the like
oh I might've managed to get the version thing to work
If you can provide the video I can probably try to answer what that is better
let's see
Okay, he speaks Russian, but I think it's enough to look at his actions.
Yes it runs some maven tasks
Oh, thanks
I need help with creating a command, I notice the API have changed. I got a error on the console[04:10:59 ERROR]: Caught previously unhandled exception : [04:10:59 ERROR]: Paper Async Command Builder Thread Pool - 16 java.util.ConcurrentModificationException: null at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:1024) ~[ ?:?] at java.base/java.util.LinkedHashMap$LinkedValueIterator.next(LinkedHashMap.java:1053) ~[?:? ] at net.minecraft.commands.Commands.fillUsableCommands(Commands.java:531) ~[paper-1.21.1.jar: 1.21.1-115-ba3c29b] at net.minecraft.commands.Commands.sendAsync(Commands.java:496) ~[paper-1.21.1.jar:1.21.1-11 5-ba3c29b] at net.minecraft.commands.Commands.lambda$sendCommands$6(Commands.java:475) ~[paper-1.21.1.j ar:1.21.1-115-ba3c29b] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?] at java.base/java.lang.Thread.run(Thread.java:1575) ~[?:?]
wait, but how he did it
Ask on Paper discord server.
You can create custom configuration
Click the arrow and there should be some way to do it
I believe you create maven profile thing and just type in "build"
ok no it's causing some secondary problems
I can't really take a look right now so I can't tell exactly sadly
You right, its Paper but it supports Spigot plugins
Don't care, you're running Paper, go to paper.
If you want to ask here, run Spigot.
it's working, thanks!
yeah no this multimodule thing is still not working
I trying to avoid having to create my own plugins but this Songoda devs won't fix their broken plugins
They told me to switch to Paper because Spigot is unstable
- not sure what sangoda is
- what, idk what they mean
-# I personally hate Paper, they have stupid vanilla bug fixing policy
They recently hard-forked (1.21.4) so nobody will really give you support with Paper here anymore
not like there is any actual breakage now that wasnt there before
ok well it fails because of the publishing process
so it will compile but it won't resolve when published without using some other plugin
yeah now it works with the flatten maven plugin
its not unstable, its just ill suited for public servers and ofc the paper api offers more stuff than spigot
I ran public Spigot servers just fine
the only noticable difference was more load when loading chunks
somehow the system blew up and no longer works, I really don't like maven
loading/generating chunks is much slower aswell as it doesn't affect the main thread on paper, yes
maven hates you. Did you do something bad to it in the past?
I hope so for all the trouble it's causing me
it really, really doesn't like me using ${revision}
Well, songoda told me to switch to Paper because they think Spigot is unstable. They are the ones that made EpicHoppers and EpicFarming plugins. But if they wrong, I have BuildTools running
oh god songoda
theres no real reason to run spigot now a days so switching isn't a bad idea
I had a issue with some of their plugins and that is what they said when they seen I was running Spigot
and before someone says vanilla fixes... go play fabric not a bukkit fork
Spigot is closer to vanilla than Paper
fabric is closer to vanilla than spigot 
Not only that, paper breaks the game too
in which regard?
Mainly redstone as far as I know
yeah, portals and block teleporting for one
again if your a hardcore redstoner go play fabric, for everyone else redstone mostly will work just fine
it's a free country, you can use whatever branch you want but there's nothing constructive about going to the discord of the branch you're not using to recommend other people to not use it
just pick whatever you want and if you're using that go frequent the discord of that branch
he asked... im not advertising or anything, just recommending what my personal oppinion on his issue is
No one asked
^^
Now you starting to worry me. You telling me Paper can have mods? I don't know about that, I the type that does not like to change the game so having a fabric/forge server, I cannot deal with that. I want people to just connect without having to download anything
He's not asking anything. He's stating why he's using paper
Nobody is saying that
And you can have Fabric/forge servers to which vanilla clients can connect too
he was thinking about switching back as far as i could tell
and that still does not constitute a question
Good as teh reasons he was told to NOT use Spigot were lies
didn't i say that?
You seemed to just be pushing Paper and Fabric
I in the process of switching back, just to get support on this server
Go ask in Mcd's about how to make a Buger King burger
Paper and Fabric is not the same, just remember that people
I said that Spigot isn't "unstable" as well as my own opinion on why that recommendation could be justified... honestly, I don't know what you're on about
I'm simply giving my opinion, defending Spigot as you disparaged it, in the Spigot discord
someone worked with perm ex?
it was probably discontinued before maven became a thing
if I remember it was probably around 2015
seems someone took it over and updated it last in 2023
idk how get group
use a better perms plugin
Groupmanager or LuckPerms
if you are writing a Plugin then go agnostic and just require Vault.
circumstances require a different approach. I will prioritize individual settings without validation in configs
AI is very vehement about this ${revision} thing not being possible for my project
I give up, this isn't even what I need to fix today
I still have made no progress in relighting my blocks
Group manager is older than PEX no????
much older
I was refering more to how long ago it was abandoned not how long ago it was created
Well the only thing that the API is doing that you're not is lighting updates
uh
See the mvn version:set I mentioned above
Seriously trace through the API code and then trace through yours and tell me the difference
Feel free to then PR the difference
ok I'll definitely double check
FastAsyncSpigot coming soon™️
it's weird because wouldn't that mean that the lighting calcs alone are the difference between pasting millions of blocks in a second and the server crashing
surely there's more to this
Nah that's probably it
Lighting is math, setting a block is just setting an array element
(And then sending packets and such)
you're not wrong, I'm just baffled if that's the real reason
I don't need to send packets
it's generating in a world no one sees until it's done
that's what I'm using
I mean I would even take a lazy light update over what currently exists
because right now it crashes a server outright
and yeah I know you can chunk the task into smaller bits
I'm getting hit pretty bad with it
like, really bad
although
I am doing something that used to be infamously bad
in terms of performance
because i'm putting it over the void
I haven't checked lately but it used to be that light updates over void were absolutely horrendous
Yeah I believe the new lighting engine handles that better
hmmmmmmmmmmmmm
you know what would be faster
but really, really stupid
I could uh
do the non-light emission blocks with the palette
then use the spigot api to place all the light emission blocks
rate my jank
There's a flag when placing a block for lighting updates isn't there
Let me check
I think there is but it's not exposed via the API
ngl I think my idea might kinda be cooking
like
the % of light blocks is infinitesimal compared to the bulk of this
and I think there's an api thing to check if a mat would be light emitting no
Huh I don't see one that mentions lighting
like i wouldn't mind doing the palette paste for the whole thing, have it all be dark then task it to gradually fill in the light blocks
public static final int UPDATE_NEIGHBORS = 1;
public static final int UPDATE_CLIENTS = 2;
public static final int UPDATE_INVISIBLE = 4;
public static final int UPDATE_IMMEDIATE = 8;
public static final int UPDATE_KNOWN_SHAPE = 16;
public static final int UPDATE_SUPPRESS_DROPS = 32;
public static final int UPDATE_MOVE_BY_PISTON = 64;
public static final int UPDATE_SKIP_SHAPE_UPDATE_ON_WIRE = 128;
public static final int UPDATE_NONE = 4;
public static final int UPDATE_ALL = 3;
public static final int UPDATE_ALL_IMMEDIATE = 11;
I guess one of these does lighting
ngl
I think my idea is very funny
I think I might go for it
yeah look at that there's a getLightEmission on blockdata
ok let's see how bad this could possibly be
Assuming you have stuff like houses - closed off rooms under roofs
And you paste the schematic under natural skylight, those places would stay lit.
I think, so your solution would work only half-way.
is it possible to extract the nth bit from a integer without having to use & <bitmask> ?
bitshift to right by n bits, check if number is odd or even ?
that sounds even worse lol
well it doesn't need bitmask :D
:V
Why do you not want to use bitmask ?
i dont have anything particularly against it, i was just curious if i can just say 'nth bit of this integer'
actually what happens if you bitmask a double/float
you can't iirc
If you want to do bit manipulation on those types, you have to use helper functions to convert to bit representation (longs)
https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html#doubleToRawLongBits-double-
nah was just idly curious
?
sanity check: doesnt replacing a block with itself trigger a lightning update?
good catch my dude
it does not
hey hey this totally works faster than doing it the "legit" way
like
incomparably faster
this is very funny
I think it's staying like this
You can trigger light updates manually
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Still not a question
Is there a way to obtain the inventory of a crafter in the CrafterCraftEvent? I tried casting the block to crafter or InventoryHolder but both results in a classCastException.
I'm also open to other ways of obtaining the ItemStacks used to fill the recipe. I just wanna check whether custom items were used or "basic" items
Well because a block isn't an inventory holder
Blocks have 0 information
Use a paste
?paste
Also #help-server if you're not a dev
i'm a dev
i'm trying to reinstall buildtools on linux
Do you have a jdk installed?
yes
You must ensure you're running a Java 21 jdk
Okay I had to cast this way
Crafter crafter = (Crafter) e.getBlock().getState(); instead of casting the block. My fault, haven't done that in a while
i have it
Try clearing caches and rerunning making 10,000% sure you're using a jdk
Not using a jdk breaks things
Be careful with inventory holder too that does a beautiful deep copy
Absolutely stunning 😍
omg I love inventory holders
sadly no way around that for now when I have to get the contents used for the craft :x
Unless I use reflection which is trading readability for performance
If you use method handles it can be inlined completely lol, but regardless you should avoid reflecting is there a reason you need the holder and can't just access the inventory during the craft event?
Because that seems like silly event design
?jd-s
declaration: package: org.bukkit.event.block, class: CrafterCraftEvent
It just offers the result sadly
Interesting lol
Would make things easier if Recipes (or CraftingRecipes) would accept ItemStacks as ingredients but that's not a thing either
I know you can get the block state though so why need the holder at all instead of doing Crafter#getInventory
In which case you only need the copy once foe the BlockState
Yeah it is lol
They don't accept item stacks with an amount greater than 1
Oh I thought that's what you were talking about. Yes I will access the inventory of the crafter directly
That's the limitation
declaration: package: org.bukkit.inventory, interface: RecipeChoice, class: ExactChoice
ohhh I just used ShapedRecipe, guess I have to read into it more then
Note it won't work if you need 2 items stacked e.g. 2 dirt in one slot
But this is good for most use cases
Yeah I will still have to handle multiple items over the events if that will be the case. But it saves me some event workarounds so that's already great
I'm not a huge fan of that dumb stacked crafting either just make intermediary steps or something
But yeah that should help
🙌 thanks I'll work with it
Np good luck
Can someone help me? Currently trying to use the PlotsquaredAPI in maven. plotsquared-bukkit-7.4.2-Premium.jar
Could not find artifact org.enginehub:squirrelid:pom:0.3.2 in papermc (https://repo.papermc.io/repository/maven-public/)
Missing enginehub repo?
if a class is for static methods only, should it be abstract or final?
abstract makes no sense for util classes, no?
final with a private constructor
can u tell me how to fix the rank is not showing of the player's in lifesteal server but it is showing in lobby server
of luckperms
add Vault and a chat plugin
???
huh?
im using luckperms
?
you can check permission without luckperms
"group.<<groupname>>" is permission what lp give to player when he get group
The group just holds a set of permissions
ah
even if they were checking the group permission isn't what they want to do
what is a 100% reliable way of checking when a player collides with a block when flying with an elytra?
what in player move event
Check if the player is gliding, get the players current location and then check if they are colliding
Entities, worlds and players on collections / tasks are usually problematic
malloc 10mb every hour
how do I check if they are colliding??
also, doesnt work
when they hit corners
at high speeds
unless im checking for collisions wrong
Get the min and max corners of the bounding box and check all blocks between them
alright that is what im doing
I guess you can inflate the bounding box a bit to compensate
Or shift it forward by the players direction to “look into the future” a bit
doesnt help
and is unreliable
actually, who handles the collision into walls damage for elytra?
the server or the client?
i mean, the client (largely) handles movement, but the server handles damage
and ofc there is server side collision checks too
I have a weird scenario and maybe someone can help. Following situation:
// NOT THE TEST CLASS
public SomeClassConstructor(Data data) {
assert data.someValidation() : "Data must be valid!";
...
}```
How would I test if the assertion in `new SomeData(invalidData)` is triggered?
Because currently in junit, I get an `AssertionError: Data must be valid!` which makes sense. But I kinda want the inverse of that in this specific scenario XD
assertions don't trigger unless some jvm flag is set
just do your own checks and throw an IAE
are there? how do I detect them
idk, i don't think there's any event or anything like that so you'd have to make your own checks in, like, PlayerMoveEvent and such
what kind
why bukkit not can find pex plugin -> Plugin plugin = Bukkit.getPluginManager().getPlugin("PermissionEx"); -> if he exists in server
When are you calling that
in enable in first line
Also isn't it PermissionsEx
uh
The basics are:
take location -> add velocity -> boom you have the new location -> run bounding box checks at this new location
does that not just start seeing collisions where there wouldnt be any
yes
why are you trying to detect a collision while gliding?
Why would that see collisions where there wouldn’t be any
plugin PermissionEx exists when i log his name in console but when i try get him in code he not find him lol
Are you depending on PermissionsEx
cuz of deacceleration and shit no?
softdepend
- wouldn't that break if you would fly say 60 blocks a second and there would be a 1 block thinkk wall in front of u
The game probably does a ray cast to see if there is anything between your current position and your new one
fun fact if i load my plugin with "plugin loader plugins" he find pex
so smth wrong with softdepend ?
softdepend: [LuckPerms, ConfigProtectionAPI, PermissionEx]
💀
corrupt jar probably
This happened when I try write in chat
changes nothing at all yea
Ah, well that’s their issue
Maria db and mysql not same?
show ur sql
Sec
Doesn’t MySQL use ON DUPLICATE KEY
Let the record show I was right
?whereami too
When you remove an item with this call, does it also take into account the amount? dw about those nulls
From the link you sent
It takes into account the amount
The way it's worded confused me... all I give it is the itemstack so I assumed the arguments came from the itemstack itself, was just checking
you're telling me that a plugin that was abandoned a decade ago doesn't work correctly?
impossible
permissionsex is just peak
But but
bone opetit
bone apple tea
that was for the v2 that was never released
why he dont cont. this
the last full release was a decade ago
because luckperms exists
lol
that "paper sex" guy would agree
i'm not kidding btw https://dev.bukkit.org/projects/permissionsex
Checkmate
yeah that's not the original pex
that's some random person that has a private fork
pex was never on spigotmc to begin with
Dangit
I can't even think of an example to visualize this in a business diagram. Maybe apple vs widows?
whar-
It’s like comparing whatever the latest version of mac os is
one is abandoned since 10 years and barely in use, the other is actively maintained and used on most servers
With windows 8
fr
Windows 8 💀
pex is good
for dead inside
Technically windows 8 is 13 years old but close enough
who in windows 11 now?
I remember using pex back then, was fun times
i still use pex
Arch btw
no reason to change
you killing developers
💪 1.8
pex api so unconfortable
no
I still run win7 😉
luckpers better
Ah well then we certainly know you don’t have reasons to change
Speaking of a decade old
?howold 1.8
Minecraft 1.8 is 10 years, 5 months old.
fair enough, everything after sucked
fr
this funny server in 1.8 still alive
yep I'm still wating for a good replacement
linux
I did try linux a few times but I never got comfortable with any distro
1.21? Big content
he was talking about windows
i was try too
You don’t use minecraft as an operating system?
I've been on Arch for like 4-5 years now
ngl, arch just kinda vibes with me
@worthy yarrow still can't code in console
everything I need is in the AUR
yea same
if only gradle was on the aur then it wouldn't be out of date
I just use the wrapper everywhere
sounds like a skill issue
windows one love
i use ant
get out
yes, but you get the wrapper from the system install
maybe but i was noob
Facts
Tho luckperms has a web editor so
yea I hate it being outdated too but it is what it is
fr
I was considering actually
confortable settings
😦
yea luckperms has a habit of making simple things needlessly complicated, and the commands are no exception
Maven wins again 💪💪
no
I still have the lp commands memorized somehow
well they do probably make more sense grammatically or syntactically speaking
lp user <name> parent add <group>
lp modify <group> permission set <perm>
this funny how much time devs waste for just create redactor for lp
tabcomplete makes it a bit less of a problem, but they'd be very girthy to type out
site for free plugin
They probably did it for themselves and then decided to make it public.
sound familiar
I need to get every player on a server as array. How do I do that?
I've tried this and it didn't work:
Player[] players = (Player[]) server.getOnlinePlayers().toArray();
Should be able to do getOnlinePlayers().toArray(Player[]::new);
why do you even need it to be an array
varargs moment
kotlin toTypedArray my beloved
a list also would do it i guess
iterable is enough 👍
Object ftw
what's an object
md is only using Object and always casting it to everything
does it not just return a list
can't ya just cast it
What above primitives
just flip the bits
sets my beloved
Could also be ur mom
wow wtf
only if rads mom is a collection
wtf man
Well if you’re large enough…

So to clearify what I need:
I want to do multiple things with every player on the server where I need them as a Player variable. For example I need to teleport them to different locations at the x axis. What I have now is this but I don't have a good way to get the players yet.
Player[] players = (Player[]) server.getOnlinePlayers().toArray(); // doesn't work
for (int i = 0; i < players.length; i++) {
borders[i] = i * 25;
Block spawn = world.getBlockAt(i * 25 + 13, 0, 0);
spawn.setType(Material.BEDROCK);
players[i].teleport(new Location(world, i * 25 + 13, 0, 0));
}
Just use an enhanced for loop?
if you need the i you can increment a separate variable
yeah but this still doesn't fix my problem that I don't really have a way to get a list/array of the players
you don't need a list/array
Player[] array = Bukkit.getOnlinePlayers().toArray(new Player[0]);
for (Player player : Bukkit.getOnlinePlayers())
but yeah you don't need em
you can just loop the players and ideally associate with a collection instead of relying on array indexes
Boo that’s the old way
Player[]::new >
boo it'll work across all versions and cause less issues when 1.8 kids look it up
plot twist: it doesn't really matter
I won't
plot twist: it literally* doesn't matter
Okay got it now thanks guys
I’m going to change the source version of all my class files to 100 so they only run on future versions of the game
👀 what did you do
Damn time travellers
so basically I suck at asm
does mc ever do random lighting checks to see if something is broken
Don’t think so
Only on block updates
hm
why don't you just relight the block
relight them after pasting everything
👍 skill issue
fully is
Try harder!
for the thing I am working on ultimately it's way faster to place the emission blocks using spigot which automatically prompts an update
and that's 100% fine for those
I was wondering for the other stuff for which it wouldn't be fine because it can be lit by the world
that is what I did
and I paste the emission stuff through the spigot api
it's much faster
Isn’t lighting done for the entire chunk
There’s probably some sort of update lighting method on the chunk
Or maybe the chunk section
ah shit I forgot today is valentine's day
there's no shot I can go eat somewhere
damn it
I forgot to cook the meat too
well
cookies, ice cream and a movie always works
And crying
//PARTIALLY WORKING
// nmsWorld.getChunkSource().getLightEngine().updateSectionStatus(blockPos, false); NOTE: THIS MAKES EVERYTHING FULL BRIGHT
//DOES NOTHING
// nmsWorld.getChunkSource().getLightEngine().checkBlock(new BlockPos(x& 15, y, z & 15));
// nmsWorld.getChunkSource().getLightEngine().initializeLight(nmsChunk, true);
// nmsChunk.setLightCorrect(false);
// nmsWorld.getChunkSource().getLightEngine().initializeLight(nmsChunk, false).complete(nmsChunk);
// nmsChunk.setLightCorrect(false);
// nmsChunk.initializeLightSources();
//ERRORS
// nmsWorld.getChunkSource().getLightEngine().lightChunk(nmsChunk, false);
I tried more than that
couldn't coerce it into relighting anything
prompt skill issue
read through the ancient scrolls of 2013 code
Did you check FAWE
Ask in a modding discord for an NMS way
it's like a horror movie
if someone wrote something about relighting chunks in the last 12 years, I read it
and I probably tried something similar
paper has a fixLight command
looks like paper's fixlight uses starlight
so that's a no go for you too unless you drop spigot compat
I know, I also looked into that
and yes that's a no go
no joke I don't think there are very many solutions I haven't read
what's the problem again
you're pasting a structure and skip light updates to make it faster?
🔥 They're just relighting everything themselves
yep
yes
that's why I said I'm not doing it
this isn't even relighting
if anything this is custom lighting
Yeah the thing is I believe you might have to
yeah the thing is I believe I am not doing that
I mean surely the game can relight a large area
I will sooner write code that calculates which blocks might be exposed to air and place those with the spigot api than recalculate all of mc's lighting system myself
If needed
Isn't there a command line flag to recreate lighting
that's just starlight/moonrise
I hope the next thing is called supernova
oh yeah, says who
this is minecraft
you now have a cave with a hole
it's not like you're going to have light bouncing against surfaces
No but the game can still propagate light
i can't off the top of my head think of anything that'd work on both spigot and paper
like I said
and i only have paper userdev sources open so i can't really help with spigot nms
I would sooner calculate surface blocks myself and place those the slow way than recalculate the entire thing
it's not a hard calculation
that's what he is trying to ask for yes
.
but i can't see a simple entry point for that nms logic
mostly because i'm looking at paper which deleted said logic in favor of starlight 🤡 but that's besides the point
idk md_5, I don't know of one
Use mache if you want clean source code
It's --recreate isn't it
chatgpt couldn't find one for me either for whatever that is worth
Well, minus patches needed for it to compile
why'd you want to get rid of the thing that makes it good lol
erase-cache maybe?
Idk there's not many command line flags just run --help and see
What will be if I cancel async chat event
erase cache is indeed nearly there 
The chat message won’t be sent
no chat message
Mind blowing I know
shocker
Fill every air block with the invisible light blocks and then remove them
Boom light updated!
--eraseCache
(SerializableChunkData has a flag for "lighting correct", maybe there is something there!)
Smth happened in sync chat event?
Lynx is turning this into a scavenger hunt
Yeah he did try setting that to false on the chunk
did nothing so you'd need to find where it's used and trigger that
ok so --eraseCache would blast everything but I am guessing you are recommending instead I look at how that might work right
(if there is anything)
Yes
(maybe the LightEngingThreaded has a method to init light)
"Server refused send message you can enable this.... "
also did not work for them

See this
How sure are we that they also correctly updated the client on those?
given their palette fuckery
Good question
They claim this is before the client even loads the chunks
well
here's a good chance for you to write a custom lighting plugin
i've heard radiance cascades are all the rage now
global illumination plugin, yes?
What about a resonance cascade
I relogged, manually, every single time
I was very thorough
multiple times with each thing, and that's only some of them
Ah, Dr. Freeman!
Thank goodness you're here
hey guys, is there any way i can completely forbid a crafter from crafting a mace?
CrafterCraftEvent
What about the MacerMaceEvent
LynxerLynxEvent
ty idk how i missed that
how do i force a player to reel in their fishing rod in a PlayerFishEvent
event.getPlayer().sendMessage("you have 3 seconds to right click or you get banned");
you're too smart for this universe
how are they not doing research on you yet, they need to know how you're this smart
In which state?
Wisconsin, does it matter
Can't tell if solid joke or genuinely misunderstood
clearly your server is infringing on different local fishing laws
I make sure that the fishing tables are accurate to each user's geographical location and comply with their local fishing laws
Yeah my local fishing laws say you aren’t allowed to catch entire horse saddles
Or books with magical powers
wtf
you need an extended license for it, its not covered by the basic one
hey
is there an alternative to YamlConfiguration.loadConfiguration() where i can catch the exception
wdym
loadConfiguration() doesnt throw an exception
ah yes right
load the file to memory and use the load(String) on an instance of yamlconfiguration iirc
You could also just check if the returned config is empty
the source is a bit fuzzy in my head but yeah
Which would indicate an error
he wants the exception
not to know if there was an error
you can
👌
You could just use SnakeYaml directly
try(var is = Files.newInputStream(Path.of(...))) {
var conf = new YamlConfiguration();
conf.load(is);
} catch (...) {
...
}
is there a difference if i use File class instead of Files
Files is the modern API
Files is almost objectively nicer to use
And is based around the Path API
File is just older nothing wrong with it but I don't think it's anywhere near as nice to use
And if you have a File object, you can convert to a Path object easily with just File#toPath()
Bukkit has a few File objects, namely the data folder, so that comes in handy
But which takes up more of my precious ram
File is used to represent and manage file paths, while Files is used to perform operations on the files and directories themselves.
Hope that helps to distinguish the differences other then one is in the io package the other in nio package
i'd disagree with that, like its usable and often working
but there's some wrong stuff w it
what is fucky with it?
I've never experienced issues, but I don't do anything crazy like async IO or file linking
one thing is listFiles() for example is a normal array, meaning first of all, its limited to the size of signed int, second it can cause a ddos resource wise if invoked on a large directory since it isnt lazy
other things that come to mind is namely renaming works inconsistently iirc, recursively walking a file path to properly handle circular symbolic links didnt really work out - more so symbolic links arent fully supported, many methods failed yet didnt throw exceptions, iirc metadata was slow on access and the lack in metadata as well
some of it is in past tense, tho presently i reckon the behavior remains the same, unless they fixed some of it
but all that used to be issues, ofc for ur average joe java user, u may not at all be concerned since createNewFile and invoking an input and output stream on it is all u gna do
there are some clustered server systems out there that may suffer
Deserved
perhaps we should limit the max array size to a byte
Tbf I’m surprised the OS doesn’t have a fit when you hit 2.1 billion files
ye, tho i think just hitting like 1 mil could hang or even lower
since it loops through the files twice, not once stupidly enough
and then it normalizes every path or something
obv that itself isnt the issue, but its all done eagerly iirc
i havent made minecraft plugins in ages
what does one parse in createInventory as an inventoryholder
(for guis)
since its @NotNull
wait it isnt
im restarted
since when is this deprecated
maybe paper
yeah i saw
they want me to use component
bu
i have no idea why i was on paper anyways
Use menu type
Exists on paper and spigot

why is it
that every time i make a new plugin
i spend ages making a complete gui api inside the plugin
just to have like 2 guis
ever think about reusing one of your 50 old apis
well
yea
but then
i think it sucks
and i wanna make it better
rn im making a plugin with 2 guis
yeah such is life
Menu type be like
okay you convinced me to make a seperate inventory api
or maybe an entire toolkit for plugins
@fossil fiber "my PAPI expansion is returning the placeholder as raw text"
Well you are returning it as raw text so?
I want it to return as yes and no instead
is it normal for intellij to give me type warnings for build.gradle?
or some cannot be applied stuff
Yes and No are raw strings though?
Do you want Booleans?
oh ya
mh
What's a good guide, or video playlist I can send someone who's trying to learn how to make a plugin?
this guy is decent but i think he goes a little fast sometimes and doesnt fully explain some things very well https://www.youtube.com/playlist?list=PLfu_Bpi_zcDNEKmR82hnbv9UxQ16nUBF7
also most of the videos are several years old
Learn java first
https://java-programming.mooc.fi/part-1/1-starting-programming this is a good course
Helsingin yliopiston kaikille avoin ja ilmainen ohjelmoinnin perusteet opettava verkkokurssi. Kurssilla perehdytään nykyaikaisen ohjelmoinnin perusideoihin sekä ohjelmoinnissa käytettävien työvälineiden lisäksi algoritmien laatimiseen. Kurssille osallistuminen ei vaadi ennakkotietoja ohjelmoinnista.
why does this course recommend netbeans
Does someone know a way I can give the new consumable item (minecraft 1.21) through nbt tags?
I know how to give it through a command but I didn't find a viable method for giving it through spigot api and I don't want to use nms (or reflection)
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "minecraft:give " + player.getName() + " " + strings[1] + "[consumable={animation:'block',consume_seconds:72000}]");
I know, but I wanted the plugin dev guide/course thingy
ty
how bad is it 1-10 to have a map that will only grow and never have keys removed unless the server restarts?
need to track instances of my NetworkPlayer thingy
is it possible to somehow map an event to a consumer for that event without actually creating a separate class for each event that you want to handle?
use a cache like caffeine
ooooh cool ty
☕ 🚬 best way to start your morning
Another lazy solution is to use WeakHashMaps
I do that for entities because there is no real unload event
thx. caffeine seems to be super simple :>
so i wanna update a open source plugin
how can i do that exactly? i already imported it but it doesnt recognize the bukkit imports anymore
make sure it is using java 21
WELL WELL WELL
IF IT ISN'T THE CONSEQUENCES OF MY ACTIONS
why am I starting like 5 different tasks for the same thing
Idk why are you
wait what
how is this async
what was I smoking on this day
why did I pick this project to test AI with
this is such a mess
oh that's why
[08:06:10 ERROR]: Error sending packet clientbound/minecraft:set_entity_data (skippable? false)
io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:set_entity_data'
public PacketContainer setCustomName(int entityID, String name) {
PacketContainer entityMetadata = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.ENTITY_METADATA);
entityMetadata.getIntegers().write(0, entityID);
WrappedDataWatcher dataWatcher = new WrappedDataWatcher();
WrappedDataWatcher.WrappedDataWatcherObject customNameField =
new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.getChatComponentSerializer(true));
WrappedDataWatcher.WrappedDataWatcherObject customNameVisible =
new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(Boolean.class));
dataWatcher.setObject(customNameField, Optional.of(WrappedChatComponent.fromText(name).getHandle()));
dataWatcher.setObject(customNameVisible, true);
entityMetadata.getWatchableCollectionModifier().write(0, dataWatcher.getWatchableObjects());
return entityMetadata;
}
public PacketContainer standardMetaData(int entityID) {
PacketContainer entityMetadata = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.ENTITY_METADATA);
entityMetadata.getIntegers().write(0, entityID);
WrappedDataWatcher dataWatcher = new WrappedDataWatcher();
dataWatcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class)), (byte) 0x20);
dataWatcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(15, WrappedDataWatcher.Registry.get(Byte.class)), (byte) 0x01);
entityMetadata.getWatchableCollectionModifier().write(0, dataWatcher.getWatchableObjects());
return entityMetadata;
}```
What version are you on
1.20
Exact version
Yes
I've created something like that for my match class
For my upcoming pvp plugin
You want to use WrappedDataValue
Since most of my match types were abstracted from March class
instead of the data watcher
You can put the wrapped data values in getDataValueCollectionModifier
okay lemme try that
Thanks it works now
Hey, not exactly a spigot problem but I'm still pretty new to Java. What is the best way to wait 1 second before I continue with the code? I've tried to google and found tons of solutions but I don't know what to use.
int currentTime = 0;
int fullTime = 30;
while (currentTime < fullTime) {
/*
my code
*/
//Wait 1 Second
currentTime++
}
https://paste.md-5.net/ozijisiqaf.rb not can find ? hologram plugin loaded in server. here plugin yml -https://paste.md-5.net/ucapuwisuc.makefile
Yeah sadly this isn't an easy problem there are a couple wya to do this imho it really depends what you want. If you want to freeze your entire project you can use Thread.sleep otherwise you'll need to do some multi threading and it gets a lot nastier
I've just realised that I can't just wait 1 second to continue the code because it would cause some problems with my code. So I need something that brings currentTime up to 1 second every second without stopping the rest of my project
show ur code
runnable?
You'll need to multi thread then
Look into either the java thread api or ExectuorService
Both should lead you to something thall be useful to you
Thanks I will take a look at that
Ask dynmap
ok
How do I get all blocks touching the straight line between point A and point B? Or how do I check if the line touches a bounding box?
You have no managed to censor all user paths...
man this code is so overcooked it borders on comical
Hello guys, how can I get item display name translated into client's language?
this is what I get for changing goals like 4x during dev
Go ask dynmap, we don't know
Also, you're in the wrong channel for this
?whereami
anyone know how I can replace say "test" with "debug" in a message?
String#replace
ty!
Yk you should probably learn Java
Just do that in the async chat event thinginator
you got an answer for that the other day
You can't get the actual value but you display it to the client with TranslateComponenent
How can I make it work when setting it to ItemStack display name?
wait I totally did
and forgor
😭
What are ou trying to achieve?
I have a cool optimization... but it's going to take a silly amount of memory to pull off :/
hmm
you can't set components in an item's display name
