#help-development
1 messages · Page 1988 of 1
Help-me fast please, what is the second argument?
Constructor<?> packetConstructor = Class.forName("net.minecraft.network.protocol.game.PacketPlayOutEntityEquipment")
.getDeclaredConstructor(int.class, List.class);
``` I'm trying to get this Class on 1.18.1 but I get a ClassNotFoundException. Any Idea how to fix that
or am i bullshitting
2Hex not concurrently
Perhaps the name just changed, refactors happen every so once in a while
Does the spigot mapping still apply?
well, at runtime yes
he can use Iterator
Ah okay
what site is that?
class names are spigot but everything else is obfuscated
Which is exactly what enhanced for loops compile down to
well that's useful
oo
Yeah I love it, less cluttered than the viewer made by someone that shall not be named ^^
no u dont get it
instead of using like
arraylist.remove
Idr exactly but it’s definitely possible to brick an ArrayList instance by nesting some iterations and operations
you use the iterator .remove
yes you literally do
and it still does the same thing?
enhanced for loops compile down to an iterator usage
That’s partly why any Iterable derivative can be used in an enhanced for loop semantic
Concurrently counting stuff is also a fun excercise
That can very quickly fuck you up, the index will increment and skip a value if you’re not careful
If you remove at index you’ll have to decrement your index prior to continuing
No body? Pleaseeeeeee
@ivory sleet wait so theres no misunderstanding? even with iterator.remove() you still cant do it?
im confused
No what I’m saying is that an enhanced for loop of an ArrayList is essentially just an iterator
(With next and hasnext)
Im talking about the iterator.remove()
Yeah that one
You can use it ofc
But like, internally iterations usually keep track of indices
but will it produce a CME?
thats what i thought
When you’re nesting it, then it might occur I believe
i got seriously confused
and if he's accessing it with multiple threads
you use
CopyOnWriteArrayList
right?
yea
CopyOnWriteArrayList has some colossal time complexities iirc
CopyOnWriteArrayList doesn't lock the list tho
I mean, you’re copying the whole list every time you write
Lol
Yeah 
Is there a documentation/tutorial on how to set custom nbt tags with nms for 1.18? I only found it for older versions 😐
I’d strongly advocate to not use the nbt implementation mojang uses
Instead stick with pdc api
Which allows you to interact with nbt but at high level
how do i send a message in the action bar to a player?
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, message);
whats ChatMessageType.SYSTEM btw
error
That’s a thing?
What error
error
Cannot resolve method 'sendMessage(net.minecraft.network.chat.ChatMessageType, java.lang.String)'
how can i control another player??
nmn :o
nmn??
wdym
@ivory sleet ?
You can help me to lol
You imported the wrong class Barry
i get error when i import net.md_5.bungee.api.ChatMessageType or net.md_5.bungee.api.chat.TextComponent
What error?
just doesn t exist
What ide are you using
intellij
How are you building your jar?
Build artifacts
Someone know?
Define control
spigot-1.18.1-R0.1-SNAPSHOT and spigot-api-1.18.1-R0.1-SNAPSHOT
Barry
You’re using the wrong spigot jar
And also
You probably want to use maven or gradle
Like really
whats the name of the correct jar?
Believe it’s suffixed with -shaded
oh
If that’s still a thing
tried every jar but not that one
Lmao
should i use the shaded api too?
how can I detect piston movement
power it goes to fight, etc.
Ye
Go to the top right corner
Search BlockEvent
And go through those
(You can click on BlockEvent and then check all of the subclasses)
Idk
Like what you want to do involves a lot of tricky stuff
can you be more specific pls
?jd
^
omg thanks
hm, i can t find the shaded one
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
works now thnx
?paste
Your jar does not contain that file of yours
Might be the case that you are exporting your source wrongly
Your code requires it
So yes
I mean alternatively you could generate the yaml file on the spot in the directory
But like
Then you’d have to change some code to make that work
bc I was doing
public static HashMap<String, Object> getDefaultConfig() {
HashMap<String, Object> parameters = new HashMap<>();
parameters.put("spawn-location", new Location(Bukkit.getServer().getWorld("world"), 0, 100, 0, 0, 0));
return parameters;
}
The issue isn’t coming from that code tho
yiu dont even need that
just put a yml file in src with the defaults
// Startup
Config config = new Config("benks.yml", this, Default.getDefaultConfig());
then onEnable saveDeafaultConfig
It copies the file from your jar to your plugin folder
okay thanks
If the file (within the jar) does not exist you’ll get an error just like the one you got
it's working with config.yml name?
how do i show the usage like tab complete, but not actually tab complete
okay thanks
what do you mean?
just add [<count>] to the tab completer
That’s actually tab completion
But it’s the name of an optional argument @silent hound
Spigot api does not offer a way to provide tab completion with those sadly
ah :'(
However I will send you an example
yeah ik ty
no i've got it
ik how to do tab complete, i was just wondering if there was a way to show something, but not let the player actually complete it
the argument("players", … would be shown as <players> in your chat when writing the command
No
Or well
Arguments can still suggest completions
But not mandatory

(If you don’t want to use nms directly it’s possible to use command api, acf or even cloud as they all include this in their respective apis)
@silent hound
it's not worth the effort
Yeah I agree
Don’t prioritize it, tho if you ever find yourself some spare time, why not add it (:
zacken in game I believe all human entities are players
But like
whats the best way of looping through something while having a delay like a bukkitrunnable
In some Minecraft versions, there existed human entity alike mobs which were necessarily not players
like a for loop
Use a bukkit runnable and cancel when loop is done
but what if its looping through a list or collection or smth
I mean you can decide when to interrupt the flow
cancel when you reach the end of the list
oh so just like have it iterate to the next part of the list each time?
do you know how can I get all .yml in the ressource folder in a list pls?
yes
k
Twiz yeah
Files::newDirectoryStream is one way
But it requires some decent java and oop knowledge
File class is a bit broken
And obsolete sadly
This Java tutorial describes exceptions, basic input/output, concurrency, regular expressions, and the platform environment
Yes but it’s still legacy
Getting all the files from a directory with a lot of files can result in hang thus also dos
Yeah the link I sent you basically summarizes the drawbacks of File (:
I mean, prefix it with your plugin name or something
Yeah EventEndEvent is too generic
The typical nomenclature (at least per Bukkit's standards) is to prefix with the type of event
e.g. if it's a player event, prefix with Player. If a block event, prefix with Block, etc.
what is the path of the ressource folder?
i.e. player-run events/minigame type thing?
PlayerEventEndEvent is probably fine then
Just kind of an unfortunate situation where you happen to have "event" twice in the name
An abstract type would have to be an EventEvent lol
https://github.com/2Hex/EntitySerializer Any code reviews?
Is it a minigame event ending?
final File jarFile = new File(getClass().getProtectionDomain().getCodeSource().getLocation().getPath());
final JarFile jar = new JarFile(jarFile);
final Enumeration<JarEntry> entries = jar.entries(); //gives ALL entries in jar
while(entries.hasMoreElements()) {
final String name = entries.nextElement().getName();
if (name.endsWith(".yml") && !name.equals("plugin.yml")) {
Bukkit.broadcastMessage(name);
}
}
jar.close();```
it's working
it broadcast all .yml files in the ressources folder of my jar
lmfao
uh
hey im having a semi brain block, im trying to create a player file like uuid.yml and put a config inside of it, which ive done.
im jus struggling on how to access that file and then get the value from it (yamlconfiguration)
When the player joins -> get his UUID, create a File object then load the File using YamlConfiguration.loadConfiguration(File)
should not be noticeable at all.
plus if you cache correctly it should be fine
Even then.
o pog
Just never do IO on the main thread.
yeah but how would i get the value with the path
this:?
public Boolean getCooldownToggle(UUID uuid) {
if(config.getBoolean("cooldowntoggle")) {
return true;
} else {
return false;
}
}```
sorry for the bad code i wrote it without an ide
Dont read from configs on runtime. Use properly named classes and names and store the data when the player joins.
Then later save it again when the player quits.
And always do IO async
public boolean getCooldownToggle(UUID uuid){
return getStorage(uuid).getCoolToggle();
}
getStorage?
Yes. Thats why you use classes and variables. They can easily be changed while a player is online. And then later saved again when he quits.
and an autosave every like 5-10 minutes might be usefull
^
thats what i usually do for stuff like database saving
cuz server might crash or weird stuff
indeed
can u elaborate bc i still dont fully get it
make a class for storing the config values
PlayerDataManager.getData(uuid).getCooldownToggle() for example
if in plugin.yml there is a permission to a command, does I need to check if player has the permission in the command class?
no
irc
documentation sais, its used to determine if a user can see the command, but it does not specify executing it.
so you might just wanna try and see
okay ty
Hey, I'm trying to do this in 1.18.1:
Bukkit.getUnsafe().modifyItemStack(itemStack, "Enchantments: [{}]");
My IDE tells me it's deprecated so I searched for an alternative... I only found "should still work", but it prints me this error in console while passing:
[org.bukkit.craftbukkit.v1_18_R1.util.CraftMagicNumbers] null
com.mojang.brigadier.exceptions.CommandSyntaxException: Expected '{' at position 0: <--[HERE]
is it possible somehow to modify what blockfaces of a block that is rendered to a certain player?
that method is deprecated because it is unsafe to use and may break in the future
pretty sure that isn't even the correct format
spigot does not offer an API alternative
And you will need to supply the full nbt tag
not just an additions that is to be inserted
okay... I'll take a closer look at it 🙈
you mean the blocks that the player can see but are actually different in reality
@drowsy harness
Oke
How you do that?
Right here I'm in a block with spectator, and Minecraft renders all the visible blockfaces, so there aren't actually visible.
It is imposible on spigot without speactor
thought so aswell haha
what is it you're trying to do with that?
Only possible on mods
basically non-euclidean rooms, on a SkyBlock world. So you could cover a room on the outside with this block that has it's faces hidden, and it would be like the harry potter tent.
But I'll instead only load blocks that should be visible on the inside.
interesting
Non-euclidean is so good 😅
love it haha
How I can check if player is on ground?
there is no reliable way. you could use Player#isOnGround(), but that returns a value controlled by the client & could be spoofed
i mean, you could get the players location, get the highest block at that location and compare
would yield the same result
yeah
What if the player is underground
And I can't use it
yeaa, checking if the player is on ground is just a very difficult question
how would i get like a custom textured skull
i want to add some lore to it and stuff but i just dont know how to get it
anyone know whats going on?
if i do
return (plugin.Hearts.get(player.getUniqueId())).toString();``` it works just fine
but if i do
return (plugin.Hearts.get(player.getUniqueId()) / 2).toString();```
.tostring doesnt work anymore
i usually just suffix an int with "" to convert it to a string
what do you mean?
return (plugin.Hearts.get(player.getUniqueId()) / 2) + "";
tostring didnt work in this case
it works without the division
but with division it doesnt
yh but i mean like Integer.toString((plugin.Hearts.get(player.getUniqueId()) / 2))
hmm
i don't actually know why it doesnt work in your case though
maybe someone else very smart might answer that for us
String.valueof();
how do I access methods in my plugin within another plugin?
rather how would I make an api for my plugin?
There are a lot of ways to do it
ServiceManager, A static API class, or just getting the other plugin with Bukkit.getPluginManager.getPlugin("name")
how would i get like a skull of a person in an itemstack?
if I got the plugin using PluginManager, how would I even cast it to the correct main instance though
edit the SkullMeta
Well you'd have to depend on it via maven or whatnot
oh .-.
how would i get the texture from a person though
still with skullmeta?
setOwningPlayer
yes indeed
how would i get the playerprofile of a user from like uuid
getOfflinePlayer(uuid).getPlayerProfile
thanks
Getting what
i want to get something like worldedit or other plugin commands where it suggests arguments
Implement TabCompleter or TabExecutor
thank you
theres a method it will want to add, that will let you set the arguments
UUID uuid = UUID.fromString("a working uuid");
headmeta.setOwningPlayer(Bukkit.getOfflinePlayer(uuid));
when i use my own uuid, not with text but with e.getEntity().getKiller().getUniqueId() it works but when i put a string uuid in there it breaks. anyone know why?
figured it out incase anyone else has this issue but the player needs to have joined your server
How do I set armor slots to nothing because this isn't working
version? you can try https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/inventory/EntityEquipment.html#setHelmet(org.bukkit.inventory.ItemStack)
declaration: package: org.bukkit.inventory, interface: EntityEquipment
1.17
Its nullable so idk why its not working.
yeah many time not using directly the inventory for armor contents... for this i use the EntityEquipment
I found this post,
Its for mobs but I assume it would also apply to players
Which is a bit annoying because I dont really want to wipe invs
is it possible to override structure generation? i couldn't find anything on google
like disabling certain structures if a variable is false
hmm strange i use equipment and never get a issue like this... try with EntityEquipment if not maybe you can open a ticket in JIRA for check
get like this?
p.getEquipment().setHelmet(null);
What if you do new ItemStack(Material.AIR)
Thats whats in the video actually
I tried both
both with .getInventory and .getEquipment
Could you send the full class
Looks like you're re-setting the costume again
Am I?
Wouldn't be surprised with my ignorance
You are. You have in the disable condition setting it to air, but you never return so it continues on to set the equipment again
If you added return true after your "Disabled costume" message, it would probably work fine
🤦, Thank you.
(you can use null by the way - it does work ;p)
I bet it does 😭
It does 
you sure its correctly?
i test (1.18) and cant replicate this... with null the helmet is gone
❤️

would anyone know what the [...s] does in js?
I remember looking it up a while ago and have suddenly forgot :)))
It's one of its newer features
Ah, it's the spread operator. Spreads the contents of the array to possible args
Yes
Which in this case is spreading out the string into each of its individual characters
It's a very confusing syntax to read
it's like .split("") but more straightforward ig
wow that is absolutely disgusting to look at
It will spread out the contents of an array into the arguments of a function where possible. Good example I saw was this:
function example(a, b, c) {
// whatever
}
const values = [ "first", "second", "third" ]
example(...values)
and I suppose strings override the spread operator to spread a string into a string array because example(..."sup") would result in example("s", "u", "p")
how to make it so when someone dies they go back to the ./setworldspawn
Oh it's just any iterable
sinec it aint working for me
you asking how to write a plugin to do that, or how to do that with already written plugins
this is #help-development which is intended for the former
ok then nvm no1 is responding on hel-server 😠
¯_(ツ)_/¯
how would i make it so a wither skeleton skull with lore can be used in a recipe
and multiple of them
ive searched around but i dont understand it + it uses one item
declaration: package: org.bukkit.inventory, interface: RecipeChoice, class: ExactChoice
I am currently trying to convert java.time classes to ticks so I can specify times of day in the scheduler, is this correct...?
public static long timeToTicks(LocalTime thenTime) {
final var now = LocalDateTime.now();
final var nowTime = now.toLocalTime();
if (thenTime.isBefore(nowTime)) {
final var then = now.toLocalDate().plusDays(1);
return now.until(thenTime.atDate(then), ChronoUnit.SECONDS) * 20;
}
return nowTime.until(thenTime, ChronoUnit.SECONDS) * 20;
}
I need to explicitly check that the "then" time isn't before "now" because that would produce a negative value, which the scheduler cannot take. I also can't abs it as it would be invalid.
With my situation, I have two LocalTimes which represent times where daily tasks will occur. I don't want these values to rely on date as they are repeating.
(Also it would make configuration harder)
I mean I've already tried it out but the result is odd to me.
I'm not sure if it's correct.
i cant find out really how to use this
Since, when converting ticks back to a Duration with the following situation:
- now =
21:37 - then =
21:36
The "hours" field is 23 and not 24 like I would assume it should be, since the hours are the same.
The hours are the same, but it doesn't sum up to a difference of 24 hours
The time between them is 23 hours and 59 minutes
Yes
Because honestly I'm not gonna wait a full day to test that it works lmao
Thank you
when I'm testing time I just hope it works
Same
and when it doesn't work, well unfortunate, because I'll just hardcode some values in tbh
I can't really cheese shit here, this is a plugin I'm being paid to make lol
That's the perfect time to cheese things!
nobody can hate cheese, not even lactose intolerant people
Btw I spent 3 hours coming up with this solution
In the process, I managed to finally learn java.time
Honestly, one of the cleanest APIs in the JDK, but like, the most confusing
clean API but its time, and time is confusing
Takes some getting used to but it's very nice
Yeah, that's ultimately what it boils down to. Time is a bitch lol
time makes me wanna cry all the time
time zones hurt, calculating time hurts, all the jazz hurts
and I like jazz..
is there a good way to make it so multiple items are required for a custom recipe?
I'm using exact choice with an item with lore
No, but you can listen in the prepare item craft event to manually set the result
Or you can restrict the amount of items such that it fits into crafting matrix
Or you can use villager trading interface to request for multiple items, but limited to 2 distinct ingredient choices
I made a multiblock for this instead and scan the contents of a dispenser if it matches the item recipe array assigned to the item it gets crafted and dropped
Actually I'm very not sure about this limitation
😔 sounds really annoying, but thansk
I've done that sorta thing before, it's a lot of fun
What do you craft at the multiblock?
custom items actually, its fun to do when you make sure every check is right and no dupes or some things come out xD
Can easily make shapeless recipes with it too with huge slots
Hi i have question about one command that idk how to really make. Its /up 1 in WorlEdit. If you don't know, its a command that place block under the player the amount he write in the first argument.
Hello
get the current y location of the player, you can use the argument to increment the value of the current y and add a block from there and teleport the player. There might be other better ways but thats what came up to my mind
Get the location of the player and remove however many y values you need
Or add ig
What is the method to place block under the player
Basically you would get the players location and clone it then place a glass block however many blocks above the player and then place the player one block above the glass block
😔
Look up on google “Spigot api how to place block”
I’m saying that cause you need to google stuff, but also k forgot the method off the top@lf@my head
I did search up on google but didn't find that much about placing block
You get the location
: /
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Then use location.getBlock().setType()
I spelled type wrong here
i gtg : (
🛁
hi, how can i change color for particle (dust) in 1.12?
Did you look ot@up or check the docs
yep
Lemme check the docs rq
all i sew is offsetY/X/Z
I need tk@sleep but idc
declaration: package: org.bukkit, enum: Particle, class: DustOptions
i need in 1.12 not 1.18.2
Same thing probably
nop
World#spawnParticle(Particle, x, y, z, 0, red, green, blue);
First google result
Divide the egg by 255 or smthng
Idk
Rgb *
in PlayerDeathEvent, how do you get who killed the e.getEntity()
ok thanks
different topic where is the jar i need to use to not see this?
i wonder why it is in living entity by default, instead of in the playerdeathevent
i did do the --remapped but im unsure where the jar is im searching
the get killer
one function if one hooks into eneity death
i presume its to handle stuff like deaths of named tamed animals for example
oh that could be the reason
you can set backgrounds in intellij
and i just used the image i used for my story
im going to presume you found the button then
settings -> Appearance & behaviour -> Appearance if anyone else's interested
on a completely different note
and i know im asking this again
but nobody is answering
how do i get the spigot -> mojang mapping, so that nms functions aint just letters
seriously why the fuck is this server dead once i open my mouth, it happens like clockwork
?1.18
You can build 1.18.1 using BuildTools https://www.spigotmc.org/wiki/buildtools/
java -jar BuildTools.jar --rev 1.18.1
oh thats changed
use --remapped and specialsource plugin as it tells you on the forums
im not too sure what you mean by that tbh
read the three posts by md5
ah so
the remapped-mojang is the source (?) I'm looking for, and the plugin is to map it back onto what's considered to be allowed to be distributed
am i correct in assuming the remapped-mojang.jar also contains the javadoc, then?
look and see?
alex
its alex!
do you know what plugins might have their source code public?
preferably ones that are not old and don't use deprecated code
There's this great thing called Google
gnoogle*
goggle
Many plugins on the spigot forums have links to their Github
i'll try with EssentialsX
one guy said i should start making plugins but im having difficulty cuz i dont know how use List and generics
And a guild plugin written by gepron1x and manya
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
generics is well interesting
Needless to say it makes it all more confusing due to the type inference and type erasure
yeah but the api utilizes generics
Which api?
paper and pretty sure spigot too
Yeah tho not a lot?
still because i dont know generics and List I cant use the method i wanted to use
Well
In simple terms
List<T> is the class declaration
It takes a generic type parameter
Similar to how you have normal constructors which take objects as arguments
"I gotta learn generics"
Only difference is that List<T> has a type constructor which takes a type rather than an object
dude this thing isnt working
I gotta actually try development
dude you told me to make plugins but i cant make plugins
how do you expect me to make a plugin if i don't know how to use generics
yeah but he said i should stop studying java and start making plugins
yea
Nice
Learn them concurrently
im salty rn
But you have to really put some grand effort into learning Java and OOP
they’re the two things you use for everything else in regards to spigot, paper and modding
yeah i should've stayed focused on that
The reason why I believe doing both concurrently is insightful is because you can apply the theory to some concrete ground such as a plugin which makes you exercise actual practice
i just wanna study my java
making a plugin hasn't helped
all my plugin does is give items to a player and send messages to the console
big whoop
Start at the basics of a plugin
Then start at creating larger functions
Great example:
Collecting mobs, hooking into holographicdisplays handling wildstacker
https://cdn.discordapp.com/attachments/429569702344392726/948885907812016148/unknown.png
https://cdn.discordapp.com/attachments/429569702344392726/948885658351599646/unknown.png
dude stop giving this advice to newbies to start making a plugin when are still trying to learn java
Torchun
What plugin you make makes no difference as of now
You just wanna get something to work
And then try to understand every little thing you wrote
it does not work
Fiddle with it
Ask questions
Google issues you encounter
By “get something to work” it doesn’t mean you just take an easy step and then it’s suddenly done
Getting something to work can take time, but let it take some time
now i firmly believe that people should not make plugins until they feel familiar enough with the language
A great example is my website xd
I've got hardly any knowledge on webdevelopment because I didn't invest my time into looking into it
I "LEARN" by trying to make it work while it doesn't always have the prettiest result the functionality will be there
Anyhow, regardless learning Java on your own before plugins is totally fine
i learned java with plugins lol
This channel isn’t made for spigot dev questions merely
haven't other devs advised you to learn java before doing plugins?
However people might pull the ?learnjava on you if you ask stupid questions
i'll do the same
Myeah
Some questions I find acceptable is for instance
So generics works as following …, am I right? Or do I miss something?
Don't get me wrong, I think you can indeed learn java with plugins, but don't ask questions that are basic java
But questions that are less acceptable would be
So what is generics? How do I use generics?
Yea, basically asking for a tutorial
That's not a Spigot question. It's just basic java (unfortunately, one that I am not familiar with). Those people can get the ?learnjava
i ask things more of the like 'do i need net.minecraft.world.WorldType.a() or net.minecraft.world.WorldType.b()' bc there's no documentation avaliable for me atm
No
You can get the information from those websites
But let’s say you still didn’t understand a concept fully
Or want to revise on your knowledge
Then asking a question would be okay imho
oh okay then that works i guess
reminds me of how i wasn't able to understand recursion. And I don't want to understand it either.
fuck recursion
Lol yeah
recursion is the very first thing I learn in college
so I would naturally say you need to appreciate that
Want a joke?
Normal loops such as for and while can always replace recursion
To understand recursion, one must first understand recursion.
may i suggest: Fractal clock
Lol
yes, but not the intuition
i got the recursion joke from a spigoter on the forums
that thing eats up 70% of a GM960 Nvidea graphics card btw
Indeed, but if you just want to do something iteratively a finite amount of times
horrendous
Both can achieve the equivalent
in that case recursion is not intuitive haha
🥲
but who will reject a recursive binary search 🙂
Ye
how to melt a computer:
\alpha (m,n)=\min{i\geq 1:A(i,\lfloor m/n\rfloor )\geq \log _{2}n}.
guys i just got my hands on something real sweet
note to self discord cant use regex
tbh nms is most of the time tapping into unknown territories, so unknown that no one bothered to write an api
fair
the one time i had to use nms was when i had to fill in a few hundred thousand blocks every few seconds once
xd
the one time I had to use nms is because minecraft's raid class actually sucks
well luckily i could guess which function i had to use
but im not banking on having that luck next time
you can always use remapped jar nowadays
I don't miss those days where I compare 1.17 remapped and 1.16 obfuscated method in terms of their order
to support both
havent gotten around to importing it yet
do i just import the remapped-mojang in the place of the normal spigot jar?
maven?
ye
you just need to include additional classifier
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
nvmind
"In the case where you decide to develop your plugins with the remapped version"
or sth like that
plugins are included as part of the build process
<build> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> <includes> <include>plugin.yml</include> </includes> </resource> </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>2.4.1</version> <configuration> <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml </dependencyReducedPomLocation> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
its inside <build> > </build>
inside build
theres no <build> in my pom.xml
imma assume that goes on the same level as <dependencies>
ok last question then
the remapped-mojang and remapped-ofc
to which categories (classes, sources, javaDoc) do i add them?
huh
like i still need to import those files after all
you are expected to have installed the remapped jar locally
So maven stores certain files locally in your computer
.m2
yes
hit enter?
yes
k thanks
it works now
perfect
question tho
if i leave the .m2 folder as-is, i dont need to import the remapped jars
does this apply to the normal api and javadoc as well?
you never had to import any jars from the beginning
wellllll
im just dumb then
good to know
oh right
any way to move .m2 to a separate drive?
I think many people just have that practice of import jars because of some youtube videos
yes, but I don't know
that'll be beyond helpful
because im really starting to run outta space
that 100GB are almost exclusively program files
and my steam library is already on D:
symbolic links can solve most of these cases, but won't recommend if you ever need the files without your harddisk connected
I had chrome files saved in my hard disk for my previous laptop, and whenever I forget to bring my disk around I can't use chrome
well i know for a fact I'll not remove D: until this computer dies
so
not really a problem
xd
now my 8TB drive is a completely different story
its time to replace your what I think is a 120gb ssd
dont you think i tried?
idk
i cant get at it without breaking the board its screwed on
interesting
buy new comp
Is it just the screw thats stuck ?
it's stuck HARD
you mean Software Engineer?
my stepsister again?
ye
as in 'abso-fucking-lutely unmovable even with lube'
Maybe get some clamps on the M.2 standoff and then try to unscrew it
huh, lemme clap her rq
help*
eh
autocorrection
there was a typo?
no
no
if you were to work as an se for an online shopping platform, backend or frontend
I can do both but in actuality I can't do either
so
i dont care
whatever gets less tickets from customers i guess
backend >>>
ok then
agreed
imma ask a friend of mine if the job she has is still hiring
Hello 
just send in your resume, write in it your spigot total downloads
0
oof
reson being that i have developed plugins
but not actually put any of them up for download
oh btw
is there a showcase channel or something like that? I could have sworn this server had one once
Nope
if you are good
you are already in it
everywhere is showcase
it's not possible to tell a client to have 'slight' dark vision without abusing the new light block, correct?
if i teleport someone during an event, is their location where i teleported them, or where they were when the event wwas called
a flex is stronger when the ones you flex to are strong
after
Then it should be the new one
is it possible to somehow insert the compile time of the plugin into a variable?
ok ty
I feel like it’s probably possible with some maven or gradle shenanigans
You could definitely insert it into a yaml file and then read that, idk about into code directly
wait
can i just dump the current time into the config.yml as a value before compiling?
u recon this would work?
https://maven.apache.org/plugin-developers/cookbook/add-build-time-to-manifest.html
return new Date().format('yyyyMMddHHmmss')
}```
im using maven
lemme check
can spigot remove curse of binding?
yes
You will need to use Brigadier for your commands
Use a command library that interfaces with brigadier
ohh okay, so mojang does give a wait for you to use them?
What
okok thanks
I can confirm that you cannot do this with TabCompletionEvent. It just provides possible autocompletes, but does not make the red text pop up if its one that you shouldnt use
are you talking to me?
Brigadier is open source
yes
Idk if it has any docs
how?
But cloud and ACF do
just do regular remove?
you should be able to get a list of enchantments from an item and remove curse of binding from it
then reapply that to the item
oh ok
wait a sec
ItemStack#removeEnchantment(Enchantment.BINDING_CURSE);
LOL
its as simple as that
is there an event for when someone removes a piece of armor
inventoryClickEvent
you need to run some checks tho
also there's more than one option
for example left click and shift left click
it absolutely melted my mind when i was trying to sort it out once
https://github.com/JEFF-Media-GbR/ArmorEquipEvent is another option
I'd like to stick to nms and spigot thank you very much
(Just Use Paper)
no
(Which also handles dispensers and such)
(So does the lib)
I want you to use the lib?
my issue wasnt even connected to armor
54% of servers run Paper
does that worko
how do i use it
ill just use curse of binding
how long will it take to install
ok
you must be experienced in gradle then
lol i was joking
i salute you
idk what gradle is
i only use maven because that's how i learned
what is plugin.yml gradle or maven
cos i have pom.xml
neither
its for spigot to get info on your plugin
but the video i started watching had plugin.yml
oh ok
hmm thats what i thought
if you use maven you'll need a pom and a plugin.yml
in gradle the build file is build.gradle
oh ok
like put armor on a player?
wait i got it
how do i only make an event handler happen when i do a command, and make it stop when i do another command
Yea, you can exclude it
how?
that's what i don't fully know
can i just scope it as provided and will the plugin work just fine on runtime without the lib?
yes
one more question, can i make my own placeholders in the pom file?
sure
you can define them in <properties>
you can also do stuff like regex placeholders
that's really cool
I always use a property for the "Main: class.name" in plugin.yml that automatically uses
${project.groupId}.${project.artifactId.lowercase}.${project.artifactId}
but that lowercase part is a part bit more complicated and requires a plugin iirc
hello, does anybody know how i controll an entity with wasd? (im a passenger from the entity)
nms
look at a pet plugin for the exact methods you got to override
or at the pig class and the create something like that for your ridable entities
wait how do you grab the movement keys pressed while you're a passenger?
does that send a packet?
@lilac dagger
hm
do you by chance know if packets get send while being a passenger in spectrator mode and tryign to move?
apart ffrom shift
ok i try 🙂
that i don't know
ah well
try equiping a pig with a saddle and then put yourself passenger
code it
can you trick the client into displaying the warped filters from spectator mode using packets?
warped filters?
go spectrator
posess creeper
hit /kill
wait thats not a thing anymore
why
uuuuuuuurg
why did that get fixed
Fyi - my question
Just have a Boolean in your config, code in event only fires if Boolean is true
Wouldn’t even need to save it to config if you don’t want it being persistent
How to get displayname of offline player?
`OfflinePlayer target;
InventoryMaker inventoryMaker = new InventoryMaker(profile.getTheme().getPrimaryColor() + target.getName() + ''' + (target.getName().endsWith("s") ? "" : "s") + " Stats", 3);`
UUID of the player, Bukkit.getOfflinePlayer
Stops it from echoing (printing) the startup command to the console
oh
Yeah like that. Do note that it will only work if the server has the information cached
Thx I fixed it
Noone answered my question :(