#help-development
1 messages · Page 644 of 1
If this exists, you can just group all your cfs, and send embed on whenComplete
CompletableFuture.allOf(
mainApi.muteApi.loadMuteByDiscordId(id).thenAccept { mute = it },
mainApi.banApi.loadBanByDiscordId(id).thenAccept { ban = it },
mainApi.muteApi.getExpiredMutesByDiscordId(id).thenAccept { expiredMutes.addAll(it) },
mainApi.banApi.getExpiredBansByDiscordId(id).thenAccept { expiredBans.addAll(it) }
).whenComplete {
}
this is definitely better
yep, thanks for your help a lot đ i'll just finish it like this and then get into coroutines
i believe it'll prove to be beneficial in the future
Gl, if you want I can send example of making CompletableFuture into suspendable await() coroutine
I used it as an extension to pterodactyl api wrapper
What's a CompletableFuture? 
i'll be happy to see that
If I send a packet to a client, setting the living entityâs meta data health to 0, will it appear the entity is killed to the client?
.
A completablefuture is basically a reference of an action that is running
You can then chain actions after using the return values
Like saying "fetch this from the database, once that's done check their name"
It's useful when dealing with paralelization and multithreading
Usually for stuff like database operations
Or processing something async
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
np
that article is way too long
https://blog.jeff-media.com/getting-your-main-classes-instance-in-another-class/ this is much shorter ^
happy reading
that's valid
xD
we need commands for all your articles
i think you just emerge from the ground when someone sends an article that you have a replacement for
This is one way https://youtu.be/SNZkXWDRNL0
Though Kody Simpsonâs other tutorials arenât great
wait static instance is not bad practice?
Some people will fight you over the static getter
Even though your plugin is a forced singleton anyway
and yeah a lot of people will die on the hill that static getter is bad
Whatâs bad about the static instance?
nothing
fair
Something something testability
I believe itâs recommended to set the instance to null in onDisable to prevent memory leaks with /reload
Even if reload is bad
^
plugman disable**
restarting the actual server
Restart the server
That too
restart
A friend of mine says /reload is great đ
dump the friend
a friend of mine used to do crack cocaine and heroin
Yep. It sucks
for testing yes
in production always restart
if you are 100% sure that your plugin is fine with reloading then you can reload, but don't account on other plugins continuing to function
but generally restarting should be the go to
that's what the heroin guys claim at first, too
Memory leaks
the plugin might break if some of its values for example are not emptied in onDisable and then filled in onEnable
that's a very basic example
https://github.com/Goksi/PteroBot/blob/main/src/main/kotlin/tech/goksi/pterobot/util/AwaitAction.kt, it's really cool, you can just call .await() on any cf inside of coroutine or suspending fun and you will get T
thx đ
Often the entire plugin instance itself will leak
well say it has a list
List<SomeData> data = new ArrayList<>();
@Override
public void onEnable() {
data.add(...);
}
now if you reload, the list will have doubled values
Hence why you should set it to null on disable when using a static getter
this is a super basic example
No it wonât
It's fine if you restart, but reloading may cause trouble if the event listener isnât ended
Not to mention, clearing everything onDisable is a pain if you have a large plugin
Just clearing the static instance of the class is all thatâs needed? Shows what I know
Thereâs a reason why /reload prints a red angry warning
Well spigot handles most stuff
Hi, I have a problem. I'm trying to use the "Commands" packet on bungeecord, with MessageToMessageDecoder<PacketWrapper>. The packet works, but the problem is that for some reason it disables the chat and the tab. I've been trying for days but I can't find the cause, does anyone know what caused it?
Itâll unregister your listeners for example
No need to worry about âmemory leaks on disablingâ or anything
Just dont use /reload
Smh if people just designed plugins properly we wouldnât have this issue
People would if /reload would be supported
i feel like that's a highly contestable statement
Why support something that the server itself doesnt support
Well it was supported when it was made smh
But people didnât support it back then
Yknow in the Stone Age
Idk about that
I doubt it was ever supported, eg how would load: STARTUP work if the worlds are still loaded
I doubt /reload had a warning when it was first implemented
Maybe it did idk
Alright new idea
supports-reload in plugin.yml
Anyone know what it could be?
To register the package use
wrapper.getHandle().pipeline().addAfter(PipelineUtils.PACKET_DECODER, "bs-commands-packet", new PacketListener(this.plugin, player));
but I don't know if this is the cause of the problem.
that's actually a really good idea
but what would one do with it
like a plugin supports reload cool
now what?
would /reload just reload the plugins that support it?
or is there another idea
Hello, in my packet-based ItemDisplay code, when I trigger it, I don't get any entity spawned:
https://paste.md-5.net/hosokojufa.java
Pretty much
@tender shard i have one question. How/where your block data container libs store the data ? Use the same system of PDc?
It uses the chunk pdc
Uses coords as key
please tell me if this looks correct to you?
suspend fun requestData(discordId: String) = coroutineScope<TFTPlayerData?> {
val data = // :snip:
return@coroutineScope data
}
using the chunk PDC as explained in the spigot thread, in the javadocs linked there, and also on the github readme
Thanks
because i hate joy
đ«„
Did y'all talk about making it possible to track if the plugin has been reloaded to implement reload themselves to not break shit? 
detecting a /reload is not very hard https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/ServerUtils.java#L118
I had the idea of having overrides in JavaPlugin that would run on reload instead of onEnable() and onDisable() like the usual ones 
there's no point for a plugin to support /reload, unless the vast majority the devs agree to do so
because otherwise /reload will stay a bad practice for server admins
and they just won't run it
only incompetent server admins will indulge
my plugin reloads just fine
in fact my /plugin reload just does ondisable plugin.onenable
we're talking about /reload not /plugincommand reload
I thought /reload calls onDisable and then onEnable again
But it could be such a useful command if plugin devs could implement it themselves properly. Like, some plugins have /plugin reload and it would be cool if those could be ran on /reload 
they are run i think

still quite clunky
just impl on disable propely
i'll continue not explicitly supporting /reload in my plugins unless a psa that "it's now fine and your plugins should do it" will be out by md_5
not sure why /reload is such a bad practice
Agreed, it should be normalized and implemented by plugins 
Yk how painful it is to restart the whole server with a ton of worlds and plugins to change one character in a config file 
that very plugin should have a /plugincomnand reload
idk spigot takes 4 seconds for me to start
if it doesn't, nag the dev
Some don't 
ok good flex
^
Consider the fact that I have a shit ton of mv worlds 
ok i think this is the reload command https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/CraftServer.java#868 let me examine it and feel free to do so yourself
these 3 lines look menacing
ok i do not like this
what if a plugin takes more than 2.5 seconds
quote from a thread
There's more to it than non-persistent data - it's nothing a developer can "adapt" their code to rectify (i.e. by using onDisable), the fault is with the user for running /reload, not with the developer. A plugin that uses any kind of lower level methods (esp. reflection), such as injecting into the command map or injecting new enchantments, is likely to completely break and start spewing weird stacktraces. This isn't anything to do with lazy or sloppy coding, it's just how it is.
Also, you'll get memory leaks when you use /reload
i'll go on coding
cya all
Weird code 
Get yourself a refreshing schnitzel

A single Function 
I never knew that a constructor counts as a method that returns something 
It returns itself 
It is basically just an initializator for an actual instance of the class, right? 

Lets just say, that was alot of documentation

w
o
w

half of my plugin's api is now suspend fun lmao
Well, it's fun. Quite literally 
nice job!!!!
cry
I would make a javadoc for my api, but I have no api to make it for ._. 
i would make a javadoc for my api, but i'm making it in kotlin so i'd struggle with making javadocs a bit
Whats going on with all these emojis
Just look at this beauty 
i have no idea it's a hype train of schnitzels or something
Lol
I want to use your well-documented api now, but I don't even know what it is lmao 
if only all the devs took pride in documenting their api as much
It's a cult, it's a religion 
i'd be a bit happier in life
well... but what if the sausage bursts tomorrow?
I just want to be able to look at my website, and search for, "PlayerData" 
and I can see 
PlayerData 
Heres the constructor 
heres the functions 
I love well-documented shit, and tbh I even kinda like writing documentation 
the sausage will burst if you don't write javadocs
of documentation 
I have noticed lol 
cries 
same stuff
https://github.com/Bedlesssgod/CarryThat/commit/6199216efe81fadc82d057bfcff464b267c4e20e just look at this lovely commit 
Ich werde dich verschnitzeln
. 
Ich schmeiĂ gleich schnitzel mit nem spritzer zitrone auf dich 
i think my pig whistles
what the fuck 
You got a pig? 
I need an explannation to how a you have a pig, and how its whisteling 
no
Then how is it whisteling 
well to be precise they were my bf's
You can image what they became 
They become you
It was a lovely dinner 
became** 
And the pig is that your current bf? Sorry if I offended anybody 
If you're going to try and insult me, please do it correctly. 
đ
I'm not insulting you
Just...
And don't insult a follower of the great and holy schnitzel

Ummm
One of my teachers used to say that a lot
Hm
@tender shard Can i make a sub sub domain? 
Yes
e
Wow
just copy the default vhost config and adjust it and add a ServerName directive
Hi Alex wass up
hi, playing rdr2
and thinking about why the sausage burst
how could it happen
why
But then i have to make a website that redirects you to the diff docs like carrythat, randomthings usw

were there no safety measurements taken place to prevent this
You ignored all of the safety measurehuiashd ibab dhzwbhizu l 
<VirtualHost *:80>
ServerName my.website.com
Redirect 301 / https://otherwebsite.com
My 2 braincells cant handle that word that starts with measur 
cloud.bedlesslocal
im currently only forwarding to lan 
Does anyone know any techniques to interpolate block displays from the center of the block?
Stop putting that emoji in every message, it becomes spammy
@shadow night you as well
I want to make the progress of the bossbar show how far I am from the center of the region (if I am in the middle it will be full) I have absolutely no idea how to calculate it
just get the distance between you and the region center
you need a point from which the bar starts as well
and then the bar progress is just that distance over where you started to count from
there are two ways you can do it
the easiest is just a straight line measurement
use pythagoras to get the distance
but a straight line measurement actually ignores how many blocks if you wanted to measure in actual blocks
why not just use Location.distance(anotherLocation)
true, might be able to closely estimate that though
this is what I was referring to as being the easiest method as this is just a straight line measurement and it ignores everything else in regards to that
like if you are elevated, at an angle etc
I would probably use that just because I am lazy and don't really care about accuracy in terms of blocks
double maxDistance = ...; // whatever is supposed to be the distance cut off
double currentDistance = currentPos.distance(centerLoc);
double distancePercentage = currentDistance / maxDistance;
if(distancePercentage > 1) distancePercentage = 1;
double bossBarValue = 1 - distancePercentage;
sth like that I guess
that doesnt work
distanceSquared and distance are basically equally fast
from a straight line I know how to calculate but I have no idea how to do it along a curved line (corner) because it is obviously longer than the radius from my configuration
curved?
oh u want to pathfind it
https://wiki.vg/Entity_metadata I canât seem to find where maximum health is in the Entity Meta.
That sets the decimal of health from 0 to 1, not the range
it can be higher as well
the range is server side not client. All the client cares about is what it spawned with
I know this is a shitty way to benchmark, but... i just wrote a tiny Location class with distance and distanceSquared, ran both 1 million times and the difference was 2ms vs 3ms (for calculating the differences one million times in total, not per calculation ofc)
Iâm trying to make it appear a mount has less health than it really has using NMS.
doing it 100 million times, distance was even faster than distanceSquared (130 vs 90 ms)
The client does know entity health when the player is a passenger. It also knows the range
so there really isn't any need to worry about the differences between distance and distanceSquared
the jvm doing some magic shit wtf
i figured that whatever I call first is a bit slower. if I move the distanceSquared stuff below the distance stuff, then it's other way around. in both cases, it's always about 130 vs 90 ms
your CPU is
what is my cpu
ah
doing magic stuff
as I said, it's a shitty benchmark. but good enough to show it's really not important whether it's squared or not
It's probably the JVM warming up
oh mb i thought it said the last one is slower
tried again on windows / intel i7 9700K and here it's basically equally fast
the other screenshot was from a mac m2 max
in case someone wants to try it too https://paste.md-5.net/visevajizo.cpp
a whole Milisecond! JESUS CHRIST THE WASTE
lmao
but legit fair cop
a millisecond for 1 million distances, that is
thats a nanosecond
lol
a millisecond per operation would be horrible
and idk if Location has any further improvements, I just used Math.pow and Math.sqrt
Yeah jokes aside square hasnt been a problem for quite a few years now
newer cpus go brt
why math.pow
also funny how my laptop is 7 times faster than the i7 9700K
because that's what copilot wrote when I entered "double distance"
xD
how bad would it be that, to get the materials in MC easily, I depend on spigot JUST for the material enum
But it's religion :(
Sad
so your laptop is running at 35Ghz?
35Ghz
it needs 100ms instead of 700ms
you could copy paste the material enum or just parse a list off a website. You can always parse spigot docs :3
well your test ignores some stuff really
and here i was never having a normal distance
first you need to identify if the JVM is actually making use of any CPU specific instructions for speed gains or not
other then you need to compare with warmed up JVM
I now ran it in a loop over and over again to avoid "warm up" and on the m2 mac, Math.sqrt is basically free
any cpu can do math regardless. However CPU specific instructions do exist to speed up such things
there like shortcuts
while on windows / intel i7 squared is usually a tiny bit faster
Just casually suggesting I pirating lol
i can run it on a ryzen 5 3600
I have a ryzen 9 5900X
its not free, never a such thing
just saying your test is flawed is all and doesn't actually account for anything other then just the JVM. Using the JVM as the test bed for how fast a CPU, is not appropriate
well I only have java installed in a VM on the ryzen and it's running at the limit, so I cannot currently test it on the ryzen (don't wanna install java on the proxmox host)
What is the test tho, is it only a calculation?
but here it is is someone wants to test java -cp ResourceExample-1.0-SNAPSHOT.jar com.jeff_media.test.Test requires java 17
@vast ledge this
oh wait that's the old code
I only got java8 on me rn :(
I think the best way to test it would be for a minute or two warm up the JVM with some garbage data
then run the test afterwards
it's running forever in a while(true)
you can just run it and wait as long as you want
that isn't accurate
it keeps switching between distance and distanceSquared
the JVM optimizes code being ran continuously AKA the JIT, which further skews results depending on what you are actually trying to test
Do I need to compile it?
you can just have javac run the class directly
I know that it's not a "perfect benchmark" lol. the only purpose of that code is to show that it's totally irrelevant whether someone uses distance() or distanceSquared()
the note about the m2 taking only 100ms while the i7 took 700ms was just something I noticed on the side
still kinda amazing
Dayum
the m2 is fast
I mean i still have an old gen from ryzen
but still
100ms like cut my time in half
I wish spamming schnitzels wasn't forbidden lol
đŠ
like, it's our cult, our religion
we need the mods to join our religion
@tender shard Can i change the default dir when i ssh into my server?
like .bashrc?
nah
when i ssh 192.168.0.234
It puts me in the snap dir
its annoying
i have to cd ..
out of it everytime
last time I've set default dir to load into I just put cd whatever in my .bashrc file
or what was it? idk
something like that basically
yeah bashrc will work if you are using bash as the main terminal
I used that shit in termux lmao
Bruh where is the nginx config
why isnt it in
/var/www/nignx
nginx**
Theres a wiki
why is there no "clean" here
mc dev plugin is shit
If the click is in a and isnt an interact it wont get sent
All clicks are categorized
There is the open book packet
which when rightclcking a book opens it
Set camera packet
Chatmessage packet, when you clik on a clickable text
You need to tell me what the click is for
Ex is it ina contianer
then look at the Click Container packet
it detects clicks
Interact packet
Player Action packet
I dont think theres a packet for that
the wiki doesnt contain one
What are you tring to do
why don't you just listen to PlayerInteractEvent
some clicks don't generate events
Dont they?
empty hand clicking air
definitely not entity
iirc it's right-clicking air with an empty hand that's not detected
PlayerInteractEvent
detects
aswell as rightclick
not if your hands are empty
Building my first javafx app đ new stuff is always so hard I forget
Does not detect Empty hand clicking air
can confirm, as I experienced that issue myself
The more you know
there's also a few jira issues about that
Somebody should fix that
why do my worlds save and load so long? restarting server is a pain
and there is only overworld
if the client doesn't send a packet, there's not much to be fixed
idk, mine starts up in 4 seconds including default world + nether + end
last time I used some fancy fork it loaded in a second
What
it gets fired
Im left clicking in air
with empty hand
and its getting fired
So I wasnt that wrong with my assumption that it gets fired when clicking air with empty hand?
for me it didn't
Welp idk it works
try with vanilla maybe? idk
you surely are using a modified version of the game
you can never know if some mod is changing something for any reason
well, schnitzel 
@vast ledge right click air with empty hand is NOT detected
10 seconds is an awful loading time
and it saves about the same amount of time
and I also don't like the amount of 0%
and this has been happening since I installed the server for testing my plugins for 1.19.4+
even in the test run, with no plugins
So they decided, to patch left click but not right?
fuggin stupid
what is this FileConfigurations in bungeecord ?
left click ofc sends a packet because you swing the hand
right click doesnt show any animation and doesnt do anything else and hence doesnt send any packet at all
rightclcik could be attempting to eat an item tho
"empty hand"
it might be possible I forgot the most important part of the schnitzel
lmao
But righclicking air witha furnace triggeres it, im not doing an action?
you have an item in your hand
but the server handles the place, not the client
Minecraft is racist against hands, if its empty and its right they dont trigger an event
well, you reminded me of a joke
"Warum schreiben Frauen mit der linken Hand? Weil sie keine Rechte haben!"
....
well, sorry
Ich habe den witz schon so viele mal gehört, vielleicht haben sie ja bald rechte
MIT License (c)
get licensed

Where do i find the apache2 config?
/etc/apache2
linux is so cool, but way too much of a schnitzel
maybe it's great it is a schnitzel this much
a gift from the great and holy schnitzel
M is your meta key
in nano usually alt
might be useful if you'd mention that you're talking about nano
Ok
Now i gotta restart apache
wait I didn't have that before
what did i import
what the heck is a RecipeChoice
The choice of a recipe
a recipe choice can be an ExactChoice (an itemstack) or a MaterialChoice (a material or a "group" of materials)
FurnaceRecipe furnaceRecipe = new FurnaceRecipe(namespacedKey,
getItemStack(), new RecipeChoice.MaterialChoice(Material.POTION), 0, 20 * 4);
setRecipe(furnaceRecipe);
There iis an example
I have an ItemStack
well okay, I did new RecipeChoice.ExactChoice(myItemStack) and it worked
how can you use mkdir() in your code without knowing what it is?
i changed
You know .mkdir is
make directory
no
why are you using it then
i don't used
You did in the ss
I'm the greatest idiot in the world
like we all said
to create a folder, you create a file object with the path and then call mkdir() on it
welcome to the club
also you are not supposed to hardcode / slashes
well, 
yeah or the nested File constructor
Iâm using the packet ClientboundUpdateAttributePacket. It takes two arguments: entityID, Collection<AttributeInstance> Iâm guessing I should create a list of AttributeInstances, but how should I add an attribute to set max health?
Why do you need a packet for that
Just use the spigot API
It allows you to add attributes to players and entities
I need a mount to appear it has less health than it really has
Yoo I did it, I've made schnitzel in minecraft, now time to make a texturepack and I'm done
A packet sent from the server to the client, wouldnt that update theyre serverside health aswell
The server thinks an armorstandâs health is 20, but I want the player who is a passenger of the armorstand to see no hearts
Iâm creating a plugin that makes the player sit on blocks
So you want them to ride an armourstand?
Does it accutally display hearts like horses?
I just donât want hearts
It sucks
I thought of using a non living entity, but I need to to be invisible
I guess, you could could create a new Attribute Instance for max health
shoulnt you be able to use an invisable boat/minecart instead?
those dont show health
They can be invisible?
im fairly sure they can
Let me check
yea
dont quote me on that though lmao
just add the effect
theyre an entity
thats how most sitting plugins work
Oh no
hypixel does arrows
Thats how they got around that
yea i guess u can even sit on stuff like an arrow
Just checked. Minecarts donât have an invisible method
because you're not assigning the result of the method to a variable
the warning tells you why
Can arrows be invisible?
can't every entity be invisible?
thought so too
Nope. It really sucks
As far as I know, only living entities
Iâve tried entities like snowballs, minecarts, boats, etc
There are no #setInvisible(boolean) methods for them
setInvisible is only for living entities
well just hide it manually then
Yea
@EventHandler
public void onArrow(ProjectileLaunchEvent event) {
for(Player player : Bukkit.getOnlinePlayers()) {
player.hideEntity(this, event.getEntity());
}
}
I guessed since there was no method, invis effects didnât work on the entity. This insnât the case?
What entity are you trying to hide?
Yeah
use Player#hideEntity
he wants to be able to sit
this should work tho
yeah ofc, I sent a video that it works
hideEntity probably wouldn't work if you want to ride the entity
hideEntity like completely hides them by not sending packets iirc
You can spawn an invisible armor stand or smth
Yes
Wouldnât work since I need to have a player sit
You'd need mods for that though đ€
Right, but I need no hearts to show. Armorstands show hearts like horses
Yea
then why does it have to be an arrow?
That was my suggestions
Armorstands classify as living entities. All living entities have a health value
Hypixel uses arrows to allow sitting
Doesnât have to be an arrow. Just something thatâs invis and shows no hearts
Can you see them?
You should be able to just apply invisibility to the arrow, that it still sends packets but its not visible
a display
Yep the arrow is visible
if you look at my crotch
That is one of the worst sentences ive said in a while

player.getWorld().spawn(player.getLocation(), BlockDisplay.class, disp -> disp.addPassenger(player));
displays work just fine
not even needed to make them invisible or anything
perks of 1.19.4 +
im still on 1.19.2
I wanna make my plugin backwards compatible tho
so you can use it even in later versions
Lambda đ„č
nobody complaining about the fact that I used the ChatEvent to do this? lol
it woudl be funny
"i sit" -> sits down
i turn 90°
I'll call it "Minecraft but the controls are overly verbose"
cli minecraft
if anyone steals this idea, I will use this message to prove that it was my idea
"i look which block is in front of me"
Don't forget speech to text
oh yeah the screen is also black and only if you write this, you can see that one block
lmfao
damn taht's gonna be amazing
from google
gnoogle*
There actually was a mod a long time ago that allowed you to player Minecraft through voice commands
that adds voice for the functions
There is still one
oh there is?
too many cases
plus different language can be used
so hard coding will be semi impossible
ai 
"minecraft but the controls are overly verbose"
yikes
new try
failed to record
here it is "minecraft with overly verbose controls"
Is there some limit of chars for YML.set method or why this happening?
Alex out here elevating twitch chat based streams to a whole new level.
the pathfinding is a bit very slow, that's why it didnt start to walk to the first position
show us your yaml set invocation
here: java configFile.set(path, oldConfigFile.get(path));
Im just getting that string from other file
Im just trying to to auto update from .yml files for my plugin

idk why this is happening xD
can you sout oldConfigFile.get(path) along with oldConfigFile.get(path).replace("\n", "--- NL ---");
like I'm just curious
fixed the pathfinding
or this wtf
well what's wrong with this
why is second(s) not in '
because they don't need to be
because it's not needed
the others are because of the & and : special symbols
interesting
if you want it to be in quotes, you can get the YamlConfiguration's "yamlDumperOptions" through reflection and set its ScalarStyle to DOUBLE_QUOTED or SINGLE_QUOTED
either replace the existing ScalarStyle with reflection too, or create a new DumperOptions object and replace the original one
the default is PLAIN which means it only uses quotes when needed
Is possible to get a player pipeline in bungeecord?
umm
this is original
hmm thats new for me, gonna take a look on that
why are you replacing \n with --- NL ---?
if you want the string to contain a literal "\n" then you gotta replace it with \\\n
Just curious if get was returning a string with new line
he would know if his own string had a literal \n
why you trying to find fault
Marek try opening in a new editor, can yours be force word-wrapping?
at the end of the day, file is working fine but is looking like shit đ
this is screen from pterodactyl panel editor and I tried in notepad++ is same
VisualStudioCode too
Check the javadocs for DumperOptions from snake yaml if thereâs a setSplitLines
that should be the problem
Looks like there is limit of chars for line, still gonna need to look at that DumperOptions đ I want all text to be in " " its looking better
What happens if you type "Now I stop the server"?
nothing yet
right now you can only walk to coords (including jumping and trying to avoid obstacles), explode, and get drunk
ofc u can get drunk
It's actually very interesting idea
I like it
You should make it work with NPCs too đ
I did it
I added my site
im very bad at apache2 stuff
but it works đ
The nginx still aint redirecting me tho
Its fine
Yay
Creating my own itnernal dns records is fun
đ
I probably cannot use DumperOptions with YamlConfiguration in spigot api right? I will need use diferent yml mby?
It supouse to be in one line like this:
that would be great to
Looks like Alex already responded to that
Changing dumper options is not exposed by api
yep, that will be lot of work at least for me
I have only basic and jump into spigot API, not best idea probably xD Gonna need to learn some java stuff first
how did you even create this? FileConfiguration#save should not write that as it's not even valid yaml
oh wait, it is valid
yeah then you'll have to use the dumper options
oh there's an easier way I just found
YamlConfigurationOptions#width(Integer)
YamlConfiguration myYaml = new YamlConfiguration();
myYaml.options().width(Integer.MAX_VALUE);
myYaml.set("something", "some long string");
myYaml.save(new File(plugin.getDataFolder(), "test.yml"));
this will only add line breaks after like 2 billion characters @trim lake
What if my string is longer than that :(
if you wanna use it on JavaPlugin#getConfig() you btw also have to cast it to YamlConfiguration (or cast the options() to YamlConfigurationOptions)
strings cannot be longer
compress it - everyone likes compressed unreadable strings in config files
is there an event that gets called when a player picks up an item from ground, but after the item has entered the inventory?
I'm currently facing the following problem: on EntityPickupItemEvent, if the player inventory is full and I modify the ItemStack in any way (lore, displayname, etc) in that event (so it's different than some item in the inventory where that item would get stacked) , the item gets lost
You can cancel the event and add the item yourself
That way you can see if it fails to get added
I couldn't do it
public static void setup() throws IOException {
File file = new File(ProxyServer.getInstance().getPluginsFolder() + "/mana-friends/player_data/test.yml");
File path = new File(ProxyServer.getInstance().getPluginsFolder()+"/mana-friends/player_data");
if (!file.exists()) {
path.mkdir();
file.createNewFile();
}```
i got this warnings still
am i create boolean variable ?
You donât necessarily need to do anything
Warnings are just warnings
But essential those methods will return false if the creation of the file/directory fails
can i ignore this warnings ?
At which point youâre kinda screwed
actually my code works fine
i just wanna remove this warnings
if i can ignore i will do
You can also just throw an IOException if they return false
Since your method already has throws IOException
well i do
Iirc it only returns false of the file or directory already exists
If it fails to create, it should throw an IOException
@vasir.l9
Also I recommend doing mkdirs
Instead of mkdir
god why do people have to use guice to do dependency injection in plugins 
Mfs out here making a full API and setting every method to private and using guice to auto-inject around
yes i did
quick question that i feel like has an easy way i'm missing: how can i make a recipe either
a) craft 2 instead of just 1
b) have an item that stays in the crafting table when crafted
think armor trim wise where you're just duplicating it so it spits out two (the one you duplicated + original) or in crafting table the original stays etc etc
ShapedRecipe esp = new ShapedRecipe(NamespacedKey.minecraft("essspirit"), item); this is what i've currently got, i'm assuming the ItemStack would be where i pass the 2?
Yes
lil amateur ish when it comes to plugin dev, usually just spaghetti something together if i need it, so pardon my ignorance LMAO
thank you thank you
Are you using paper api
Ah wait bungee
i mean i need TextComponent
like this
player.sendMessage(new TextComponent("blabla"));
Look into adventure api / library. There ull find ur answers
well i got this
hello everyone
i want to create a nms plugin
so i install all i need for it (buildtools,maven plugin, etc...)
but nothing work
no issues
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.18.2-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>```
?nms
i already saw this
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.18.2-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc
1.18.2-R0.1-SNAPSHOTđ«remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.18.2-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc
1.18.2-R0.1-SNAPSHOTđ«remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
this is mine maven plugin
its the same
yes
then everything should work
Why is jar in there
i dont think console has color
most consoles don't interpret color let alone Minecraft Color Codes
you'd need to make a console that is able to parse all the color codes minecraft has and redisplay the text
but i think that 1.19.4 was fine
in java this is as easy as just making a process to run the spigot server than redirecting the output stream and parsing the color codes to readable ansi color
I doubt it consoles can only read ANSI color codes minecraft outputs the weird S like symbol not ANSI
Hello. I am currently working on a plugin where I need to send data from a frontend client (The java minecraft plugin) to a backend. I want to verify if a player is realy connected to the minecraft server. I saw https://sessionserver.mojang.com/session/minecraft/hasJoined and thought that may work but I was unable to get the server hash. Does anyone have any ideas or directions they could point me in?
Do yall think it would be better to use nms mappings or protocollib im making an animations lib and npc lib for myself to use. I only have experience with nms mappings but I would like to make this project work on 1.16, 1.17 and up
can you be more specific. Why can't the plugin just check they are on the server>
this doesn't make much sense, there is only two possible scenarios
either they are taking a long time to connect or they disconnected
there is a time out in how long it takes to connect
and disconnecting generally throws the quit event
depending how far along the connection they gotten
I want to make it so custom data for a single player is stored on the backend and can be accessed across multiple different servers. So I dont want a server where the player is not connected to be able to modify the data. So I want to be able on the backend to verify that the player is actually connected to that server.
just check the player list then
any server that doesn't have the player shouldn't do anything, not sure why they would be interested in doing something to begin with if the player isn't on that server lol
I think you are either over thinking this, or thinking it needs to be more complex then it really needs to be
I wanted to add the verification so someone cannot easily modify the plugin and write data to the database on behalf of a different player.
and how would they do that?
if you connected to my server how in the world are you from your MC client going to modify the plugin?
or manipulate the data on the server o.O
you got bigger issues if this is somehow possible
Oh sorry I explained it poorly. I am worried that someone will modify the plugin or try to directly interact with the api.
and how are they going to do that from the client?
The java player client would be unable to do that but without verification the owner of a server even if the player never joined could send incorrect data.
they couldn't but ok
Does anyone have a github project that has nms support with multiple versions
you are obviously worrying about something that is in theory not really possible. Sending incorrect data via packets is possibe, but like it has to be packets the server understands first and if its incorrect in most cases the server will cat ch this
plugins and the data they hold are not directly interactable via the client
so whatever you are worried about is non-existent
the only thing I can imagine you are worried about would have to do with offline mode
and if that is the case we don't support offline mode here đ
I think I explained it poorly so I need to reexplain sorry.
I have the minecraft plugin which could be running on many different servers which each instance of the plugin will connect to my NodeJS server through a custom api.
If I don't have some way for the NodeJS server to verify that the players are acutally connected to that minecraft server A modified plugin could change the custom data of any player saved on the NodeJS server.
this is why end to end encryption exists
how to lookup the start of an event in nms
the NodeJS server doesn't need to know if a player is connected because the server should report that is where they are
only thing you have to concern yourself with, is protecting your endpoints from outside use, which you do by using encryption
this is why certs exist and things like https
If they're your servers this is a non issue
you can authenticate servers with certs as well
Yes and I was planning to use that with ssl. But someone could modify the plugin to falsely report that a player is connected.
If they're not your servers, then this problem can't be solved and a has joined wouldn't help since they could still just send garbage
The NodeJS server is mine but the minecraft servers are not inherently mine.
then you just have to anticipate garbage data, but the question is though, why would someone want to falsely report a player being somewhere they are not?
anyone know
there is plenty of plugins, one I know of is libdisguises if you are just looking to see how they do it
Anyone has working vehicle plugin
That is why I was wondering if I could get something like the serverIdHash so I could externally through mojang's servers verify the connection.
They could modify someone else's data on the NodeJS backend.
you wouldn't be able to use mojang servers to verify connections
..
Yes but the player would have to be connected to the server with a modified plugin.
so why don't you have players verify on your web server first where it asks if they are on a server it detected?
this is the only semi feasible thing I can think of to help ensure accuracy
Thanks that is what I needed.
I have been trying to think of a solution for a week and I did not think of doing external verification through my web page.
What does your plugin actually do anyway
Its one of those things where I have been trying to find a solution for so long I couldn't see the simple solution in front of my face.
Multi server communication and messaging.
So a modified server could still make me say malicious things if I joined it
If you want new items entirely , this isnât the place
Maybe but I want to look into more security options to prevent that.
Does protocollib support 1.20.1? It hasnt been updated since may 6
Yes
whats the github I can only find aadnk's
1.20 anything is compatible with 1.20.1
Lots of links they're
There
If I can access the public key I should be able to check the authenticity of a message.
How should I write the ConfigurationSerializable #serialize method that it makes me implement?
I'm creating a class that I'll use as a custompersistentdatatype
Not sure it's possible you get a random players keys
Look at location for an example, but you just put normal values in a string map
So if I have Location as a class member I'll just create a map under seralize method, put the member with a string in the map and then just return the map?
yes
Gotchu, so I assume that the most logical think would be then to use the serialize method in my Custom PersistentDataType class under the #toPrimitive method right?
The thing is, under the #toPrimitive method in my custompersistentdatatype class, I have to return a byte[]. But my serialization method returns a Map<String, Object>
vault doesnt send messages iirc
how did you add the blanace to the player
thats an essentials command
essentials is sending that message
change the message properties
check the wiki
Does anyone know how to access the users public key and salt for "multiplayer secure chat signing" when they send a message?