#help-development
1 messages · Page 1217 of 1
You are right. I probably switched up downloaded jars somehow.
Are you using some old version?
Is there a reason youre doing this
Technically that is an old version
True 👀
Okay, sorry.
But woop mixed up paper and spigot
1.8 👍 /s
Exactly.
I know Paper has the function.
Should be fine^
truth
Thanks.
Worst case just use a proper command framework
doesnt bukkit api expose command map though ?
That's the PaperAPI I think.
Bukkit.getCommandMap exists in paper.
Yeah spigot doesn’t expose it
Go pester md5
I mean, generally defining things in plugin.yml is kinda more the vibe
If you enjoy doing extra work psh
doesnt mean that you should not support programatic approach though
Just make a gradle plugin 💪🏻
Sure but, just wasn't done
Could always make the pr yourself
or maybe CommandMap is more impl detail
like a "simple" type
there is a good amount of those in the API
I could check stash for that but uh am too lazy
Inputing command isn't working because I'm trying to input the class.
What should I change the type too?
so just new VanishCommand ?
And I can do that with each command.
VanishCommand has to extend Command
It extends CommandExecutor 🤦♂️
Sounds ass, how are you gonna do tab completion
I don't know.
Or abstractCommand like I had in my impl, then you just do new VanishCommand(); -> Command created, registered, etc
public abstract class AbstractCommand extends BukkitCommand {
public AbstractCommand(String command, String[] aliases, String description, String permission) {
super(command);
this.setAliases(Arrays.asList(aliases));
this.setDescription(description);
this.setPermission(permission);
try {
Field field = Bukkit.getServer().getClass().getDeclaredField("commandMap");
field.setAccessible(true);
CommandMap map = (CommandMap) field.get(Bukkit.getServer());
map.register(command, this);
} catch (NoSuchFieldException | IllegalAccessException e){
e.printStackTrace();
}
}
@Override
public boolean execute(CommandSender commandSender, String s, String[] strings) {
execute(commandSender, strings);
return false;
}
public abstract void execute(CommandSender sender, String[] args);
@Override
public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException {
return onTabComplete(sender, args);
}
public abstract List<String> onTabComplete(CommandSender sender, String[] args);
}```
Couldn't tell you how old this is but I think it should still work
that is very fucked
So extend AbstractCommand?
Ok.
thats a custom class
Yes.
you shouldnt reflect to that every single command, use some class to store an instance of it
I'm normal... I use command frameworks now lol
Thanks.
It’s old they prolly doesn’t care
pineapple >>
CommandFrameworks > Bukkit Commands
Code in constructor!!!!1111
👀
If you expect like more than 5 commands, use a command framework for sure
I am going to have like 50 or more.
Cloud or ACF 
Yeah don't do reflection this way then kek
I can't find any information on it at all. 🤷
So I decided to ask here.
Yea ^ just go with one of the many fleshed out command frameworks ^
I don't want to use dependencies for everything.
It's better than 50 goofy command classes
Command framework basically takes all that work and puts it into a one liner
Lets see how goofy it looks.
Cough
Is the tabComplete function required?
In some-cases I don't want tab completion.
Pretty sure it's nullable
You can return null which usually gets auto filled to player names
Or you can return an empty collection
Mfw no merge to main in almost a year
its not stable yet
import codes.settlement.core.constant.Permission;
import codes.settlement.core.model.AbstractCommand;
import org.bukkit.command.CommandSender;
import java.util.List;
public class GoofyCommand extends AbstractCommand {
public GoofyCommand(String command, String[] aliases, String description, String permission) {
super("goofy", "angry", "A very goofy command.", Permission.DEVELOPER);
}
@Override
public void execute(CommandSender sender, String[] args) {
}
@Override
public List<String> onTabComplete(CommandSender sender, String[] args) {
return null;
}
}```
and we (miles) has been too busy making prs and shit
It doesn't look so bad.
Yeah but for 50 commands
Ur not stable yet
It's better than Bukkit Command classes.
And registering it in the config.
But it's not better than just using a framework
Fair.
It does all that work for you and you only have to do something like Framework.createCommand(params)
how do i get the contents of a yamlconfiguration?
t:
- "test"
- "test2"
- whatever:
- "idk"
- tt:
- "idk what else to put"
- "blah"
would return
[
"test",
"test2",
{
"whatever": [
"idk",
{
"tt": [
"idk what else to put"
]
}
]
},
"blah"
]```
but as a List<Object> if thta makes sense
just to be clear, i dont want a json, i want a List<Object> which could be storing a String or a Map
huh why
i want to get everything in a yamlconfiguration
strings and nested configurations but then i also want configurations in the nested cofngiurations and so on
I still don't understand why you'd want to do that
You should be able to use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/configuration/ConfigurationSection.html#getValues(boolean)
declaration: package: org.bukkit.configuration, interface: ConfigurationSection
yaml based programming language
💀
oh yeah configurationsection not yamlconfiguration
what
it's already made multiple times in stuff like advancedenchants
I wouldn't call that a programming language
You could just add some js support or Skript
You can challenge yourself by doing a node based web editor for it
Something more useful than a yaml language
like skript?
web dev suggested in spigot? Wild
markup language is the term
k
?paste
https://paste.md-5.net/temifuhoki.cs
https://paste.md-5.net/afoluwupoy.java
Any thoughts about this error?
Is double rightclicking in spectator mode a bug or a feature? Every time I right click an entity in spectator mode, PlayerInteractEntityEvent fires twice.
I meann prolly does in survival too
Events tend to just do what the client does
If you print a stack trace and the hand and click type you might get a better idea of if its a bug or feature (idk off the top of my head)
I'll try that out, it's just weird because right clicking the entity once in survival/creative/adventure mode only fires the event once, but when right clicking once in spectator it fires twice.
Yeah, it appears to be a bug
my server's the latest version of spigot and the plugin's "1.21.4-R0.1-SNAPSHOT"
wait actually turns out /version says i'm behind let me update
For suspicious blocks, PlayerInteractEvent fires when the player actually clicks on a block whereas BlockDropItemEvent fires when the brushing is complete, assuming there is an item held within the BrushableBlock.
There is a scenario where no event fires and I'm wondering if this is a bug or if this is something that should be addressed via a suggestion.
If you right-click on a BrushableBlock and hold the click down as the mouse moves from one BrushableBlock to another, if the second block instance has no held items...neither the PlayerInteractEvent nor the BlockDropItemEvent fires. None of the related BlockFromTo or likewise "block changing" events fires for suspicious blocks changing into normal blocks, and thus there is no event or way to detect this behaviour. Intentional? Bug? Overlooked and requires a suggestion?
yeah updating did nothing, oh well, bug report time
I'd be quite surprised if there was no interact event tbh
Clicking on the first BrushableBlock and starting the brush animation fires the interact event, but using the same continuous animation as you move across different blocks doesn't seem to register any additional interact events. At least in my test environment
hey guys, i've recently upgraded from a 1.16 server to a 1.21 server, and my itemflags no longer work. As in, hide_attributes doesn't hide the damage attributes on swords for instance. I've noticed that attributes are deprecated and to be removed, but haven't found any alternatives. Any tips? ❤️
I saw a (potential) solution on the forums to add a dummy attribute to the item, but like I said, attributemodifier constructor is deprecated so idk
Yes add dummy attribute
Usually I do Material.DIAMOND_SWORD.getDefaultAttributes()
this.meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier("dummy", 0, AttributeModifier.Operation.MULTIPLY_SCALAR_1));
This work ye?
just an attribute that doesnt do anything
There is a way to get when a day in minecraft is finished?
Sounds like you're running Paper
You get the time and subtract it from the total time of a day
Same issue on both.
That issue should be Paper specific
Paper and Spigot handle hide attributes differently
In what way?
On Paper you need to add your own attributes for it to do anything
On Spigot it will clear all attributes which causes it to hide
Oh hm, maybe this would be paper related then 😂
and this is why I don't trust users when they tell me what they're running
how can i line up characters cause unicodes dont work it just does a box
im using emojis on a score board

what do i do
how do i get a small space
unicode
is there a way to apply a velocity vector to particles
i am trying to make particles that appear behind an arrow appear almost like an engine plume
and also is there a way to set a lifetime for a spawned particle
You can't set the lifetime
However setting the particle offset will make the particles move to where you want
for an arrow, which way do the X,Y and Z offset axes face?
not a huge fan of trig
But the getTime() return a long, what is that long, the ticks of the world?
yes
I've only recently came back to java server developing so I am a bit rusty - Does anyone know why the permissions message isn't working? I'm not sure if I am doing it wrong or something however it works but it just says unknown command instead of sending the actual permission message that was set
permission messages are no longer sent
You have to code it
if the client does not have the command in its command map it just says unknown command
Ahhhh I see
so if I do a task to get the time and compare to 24000 ticks im watching if a day is completed in the game
yeah
so something like if (p.hasPermission("permission")) and then if they dont then send a messaghe?
yes
Alrighty :D Thank you!
Is that account your alt?
note that if you have a permission assigned to teh command your code will never be called
no
what happens if i do this
public class MyClass<T extends Event> {
public void method(T t) {
...
}
}
public class YourClass extends MyClass<PlayerDeathEvent> {}
somewhereInTheCode() {
new YourClass().method(instance of PlayerInteractEvent)
}```
whatever's in the method?
yes
yes indeed
basically supply it with something other than what its generic is
probably wont work
?tas
too much work
too bad, so sad
?
have you tried reading java docs
idk what to look for
?
just search it up
no idea what youre even talking about
same here
it'll throw whatever's thrown?
Applying CraftBukkit Patches
Backing up NMS dir
Patching net/minecraft/server/DispenserRegistry.java
Exception in thread "main" java.lang.RuntimeException: Error patching net/minecraft/server/DispenserRegistry.java
at org.spigotmc.builder.Builder.lambda$startBuilder$2(Builder.java:617)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at org.spigotmc.builder.Builder.startBuilder(Builder.java:568)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)
Caused by: java.io.FileNotFoundException: work/decompile-3600f5e0/net/minecraft/server/DispenserRegistry.java (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:213)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:152)
at com.google.common.io.Files$FileByteSource.openStream(Files.java:134)
at com.google.common.io.Files$FileByteSource.openStream(Files.java:122)
at com.google.common.io.ByteSource$AsCharSource.openStream(ByteSource.java:474)
at com.google.common.io.CharSource.readLines(CharSource.java:371)
at com.google.common.io.Files.readLines(Files.java:552)
at org.spigotmc.builder.Builder.lambda$startBuilder$2(Builder.java:605)
... 13 more
i get this error when i do: java -jar BuildTools.jar --rev 1.20.6 --remapped
anyone knows why?
i am using linux btw
?paste
probably a good idea
well the error message quite clearly states whats wrong
i mean, it'll throw a Throwable
i added a try except block but it still gives me the warning, do i tell it to shutup or should i be concered
other versions compiled perfectly just 2 version has errors
from 1.19 to 1.21.4 everything was perfect other than 2 versions
well what warning?
Unchecked call to 'x' as a member of raw type 'y'
so there is only one packed up jar file thats why error message doesnt understandable for me
have you tried just... not supplying it with something other than what its generic is
idk what the generic is
are you building a library
java -jar BuildTools.jar --rev 1.20.6 --remapped
well then just tell the user what generic they are supposed to give it and then let it scream at them when they dont
try reinstalling buildtools
ok
or you could do smth like
im not sure if this will work but
check the type of the entered generic and if it doesnt match then throw an error yourself
nop didnt work, this time i downloaded it from directly jenkins but still...
exact same errors
no clue
Did you run it in an empty folder?
you probably need to clean out your BT folder
old files in work can cause issues
what is bt folder?
The folder that BuildTools is in
does someone know why when i right click on a block my PlayerInteractEvent event counts 2 clicks? how do i fix this
?interactevent
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
ty
if I have a base64 encoded skull texture url
can I somehow make the skull show a different part of the skin, so besides the head?
How can I make a config that lets the player make a configureable prefix?
When the world time ticks reach 24000, resets to 0?
With a resourcepack and a core shader that might be possible
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
Thank you! :D
If you use getTime yes
player.showParticle() only renders the particle on client side right
yes
so lets say hypothetically i have 10 million particles spawned at one player, it wont lag the server, only the player will have to handle the load
will the process of spawning 10 million particles for the player lag the server? or is it all just in one command to tell the client to spawn x particles
That would be one packet per spawnParticle
this is completely hypothetical, i am not spawning 10 million particles for anyone
alright cool, nice
so if im sending one spawnParticle packet on average every 1 tick that wont affect the server in the slightest
Yeah that's fine
and times that by a couple hundred players?
Fine
n o i c e
disclaimer: I am not spawning 10 million particles for hundreds of players once every tick, i am not stupid, i was just testing the limits
i really really want to make a cape effect out of those cherry blossom particles but since i cant set particle lifetime the cape would be more of a block of cherry blossom extending down to the ground
Is reloadConfig() correct for a plugin reload command or?
yes
Amazing tysm
unless your plugin has something other than a config that needs to be reloaded aswell, yes
Yeah no it's just a basic config.yml
mhm
Guys, this error keeps appearing when I try to execute a command, what could it be?
"An internal error occurred while attempting to perform this command"
is there an easy way to check if the player is currently standing completely still (or in fly mode, completely still)
can someone help me with item stakcs?
I dont know how to make a potion that is a healing potion
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionType.html#HEALING
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/PotionMeta.html#setBasePotionType(org.bukkit.potion.PotionType)
declaration: package: org.bukkit.potion, enum: PotionType
declaration: package: org.bukkit.inventory.meta, interface: PotionMeta
hello, how can i make the nametag non visible for the other players?
Does anyone know how I can make a plugin reload its config? I'm using a default config and I've tried using reloadConfig(), so many more things it just doesnt reload or it just undos changes in the config
You need to use teams
reloadConfig does reload the config
Show your code
?paste
uhh entire code or just the code for reloading?
I linked the method you want to use it with
all of it
you are gonna insult me
That wasn't for you
You're keeping a reference to the old config
update your config variable with the new config
How I can like lock a event?. I explain, I made a DayCycleFinishEvent checking the world time with a runTaskTimer but if I check it each 2 sec or whatever it gets fired sometimes. How could I "lock" the event and unlock it when needed
how can i put a custom display name>
I'm not sure what you mean by that sorry
config = getConfig()
^^
would that be onEnable or the reload command?
after you've reloaded the config
You probably want to do it in the onEnable as well instead of having it run on init
how can i set a custom nametag?
Nameable#setCustomName
and maybe u want Entity#setCustomNameVisible
it's a player not an entity
a player is an entity
You don't need to check every 2 seconds. You can just schedule a task to run when the day changes by calculating the amount of ticks. You can then listen to TimeSkipEvent to handle any sleeping or other time skips
I don't understand what you mean by locking your event though
then if i do something like this p.setCustomNameVisible(false); it will work fine for my player (remove the nametag from the top of his head)
I mean it sort of works... just after two uses of the command? 😭
Ill do that
thanks olivo
for players you need Teams afaik
or im not sure
ty
Could you show your updated code
Are you refering to the reload prefix not updating?
Yeah
That's because you're getting it before the reload
is there any way to turn this
ItemStack healpot = new ItemStack(Material.POTION);
into health potion?
Yes
get the item meta and cast it in to potion meta then use the method I linked you
Don't forget to set the item meta back otherwise it won't apply
I know that
its so random tho there is just everything
I dont know where is the thing Im looking for
I sent two links
one for the enum entry and one for the method you want to use it in
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
Basically if I give you the answer you'll just copy paste it and not learn
"Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before." 🤓
I do learn
I learnt everything I know about java so far from watching my friends screenshare
and he was explaining random lines to me
but ok
You need to get the ItemMeta of the ItemStack you just created, cast it to a PotionMeta, use setBasePotionType(), then set the item meta back onto the item stack
This is something you should be able to do without a copy/pastable snippet
fine
so basically this?
meta.setBasePotionType(PotionType.STRONG_HEALING);
ok
Yes
thank you
is setting player time and weather reset on disconnect? or do I need to track it on disconnect?
Question about making public plugins - If I wanted to have it for multiple versions, say 1.20, 1.21, ect would I have to make it for each version or would the jar usually sort of cover them and I would just have to test the versions it works on
If you're just using the API you'd write for the oldest version you want to support
Testing on a couple different versions is of course still recommended
Ahhh okay thank you! :D
an issue doing it that way can be the you won't directly support newer verions and materials for example if the api is older if I recall correct.
yea, you can use <Enum>.valueOf after a version check
or like try catch idk if one can easily check version
there's commodore for porting your stuff
i am sure this is a stupid question but is this the correct way to set the model of a item in 1.21.4+? ``` @EventHandler
public void onPrepareAnvilEvent(PlayerInputEvent event){
if (event.getPlayer().getCurrentInput().isSneak()){
ItemStack itemStack = new ItemStack(Material.STICK);
NamespacedKey modelKey = new NamespacedKey("test", "katana");
itemStack.getItemMeta().setItemModel(modelKey);
event.getPlayer().getInventory().setItem(0, itemStack);
}
}```
nvm
oh lol
are methods from Enchantment class also work with custom enchantments added by datapacks? i'm on 1.21.1
(i mean these: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/enchantments/Enchantment.html)
If i were to try and make a mutechat plugin, would I be correct to assume that a variable would need to be set and when people chat if that variable is set I would need to cancel it if they are not op/have a permission
Yes, alongside an error message to the user so they know why they can't speak
Or be a troll and shadowmute them
i dont care
Should work
to save selected cosmetics/perks in my lobby plugin, should i make a PersistentData class with a field in my LobbyPlayer class, or do it seperately from LobbyPlayer?
like
public class LobbyPlayer {
PersistentData persistentData;
...
}
or make some PerkRegistry
also no pdc wont do the job as the world is discarded on each shutdown
hm or maybe registry with a getter that retrieves the value from the registry
yea that sounds smart ig :)
how can i set in a gui a Player_Head with an owner for give it the skin of the owner
That will be done automatically
so that when u click it you will get the skin of the heads owner?
i want to put the material.Player_head but i dk how to put the skin of Olivo
ah
ty
Does anyone know why this isn't working?
if (chatMute == true) {
Player p = event.getPlayer();
if (p.hasPermission("staffessentials.bypassmutechat")) {
event.setCancelled(false);
} else {
String plprefix = (config.getString("prefix"));
event.setCancelled(true);
p.sendMessage(plprefix + " §cThe chat is currently muted.");}
}```
The toggle for it works so the variable in the command is being set and unset
You don't want a boolean variable for the mute
oh?
Well a single one at least*
Wait nvm you want to mute the entire chat not a single player 💀
== true is reduntant btw
so remove true and just if (chatMute)?
yeah
you will want to add for the method to ignore cancelled as well
otherwise it may get bypassed if it is indeed cancelled and never run again lol
and don't undo the cancelled state
Some other plugin might want to block a message
honestly i dont know.. i just sort of put it there because its the opposite of true 😭
Yeah just early return with a guard clause
well first check if chat ISNT muted, then return
now you know that chat IS muted
check if player has permission, if yes, return
now you know player doesnt have bypass perm either
now send message, and set event cancelled
using guard clauses like this avoids unnecessary indentation and if-else towers
its good practice
also since you are adding a plugin prefix before every message you send to the player you probably wanna make a method for it somewhere which takes the message, adds prefix before it and sends that to the player and just call that method everywhere
and make sure you are ignoring if event is cancelled for the method as well
so that it isn't accidentally bypassed/skipped
You mean so the message isn't sent and then the result is bypassed?
Have anyone tried worked with custom font json in order to change a GUI's looking, based on the title of the container and a resourcepack?
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!
?vampire
Just reacting with a wave emoji seems to stop people from DMing you
so that's what I do when someone writes hello
i always react with a wave emoji and then say "how may i help you"
but im getting tired of the person not telling me how i may help them
I just ignore my DM's
in fact, I routinely forget they are there
currently have 25 message requests
ive had several cases where ive been reminded by my conscience about that one dm i had with that one potential client that i havent replied to for a week
i always check dms if i have a notification but replying to them on time or ever is not guaranteed
oldest request is from September 1, 2022
shame, they been waiting 2.25 years for a response
well i freelance so i gotta check mine
I have all dms blocked. Unless you are a friend. I don't have friends 🙂
so in short, you have all dms blocked
that is what they said
I know, I've been member before. I've seen it be used within a spigot plugin and I'm trying to make my own, so I don't have to rely on other plugin.
I've made the custom front
"providers": [
{
"type": "bitmap",
"file": "minecraft:textures/gui/dead_mans_trail.png",
"ascent": 8,
"height": 256,
"chars": ["\uF801"]
}
]
}
Something like that. Using Unicode and matching the gui to the override with custom font
woulda hit harder if he didnt mention the no friends part
wait this is #help-development ? i thought i was in #general this whole time
i need a discord mod that shows me the channel name in huge white bold text in the top middle of my screen
prolly still wont look at it but it'll be there in spirit
how can i convert like the player name to small text font in a message
wdym by map the characters?
have a map of the regular upper/lowercase to the smallcaps char
can u make me a small example like with abc and how i will use it in the message?
ᴀ
ty ty
im still a bit confused on this - im not sure how to do that
Don't use setCancelled false
if (!chatMute)
return;
else {
event.setCancelled(true);
Player p = event.getPlayer();
String plprefix = (config.getString("prefix"));
p.sendMessage(plprefix + " §cThe chat is currently muted.");}
}```
Ive done thism not sure if this is any better but it still doesnt work so im not sure
You can skip the else
Since there is a return statement the method will exit before any lines below are run
soo like ``` public void onChat(AsyncPlayerChatEvent event) {
if (chatMute)
event.setCancelled(true);
Player p = event.getPlayer();
String plprefix = (config.getString("prefix"));
p.sendMessage(plprefix + " §cThe chat is currently muted.");}
}````?
Keep the return statement
Just skip the else
As for it not working are you missing the EventHandler annotation or did you just forget to copy it?
oh i am very dumb
public void onChat(AsyncPlayerChatEvent event) {
if (chatMute){
event.setCancelled(true);
Player p = event.getPlayer();
String plprefix = (config.getString("prefix"));
p.sendMessage(plprefix + " §cThe chat is currently muted.");}
}````
.
Ooh okay
public void onChat(AsyncPlayerChatEvent event) {
if (!chatMute)
return;
{
event.setCancelled(true);
Player p = event.getPlayer();
String plprefix = (config.getString("prefix"));
p.sendMessage(plprefix + " §cThe chat is currently muted.");}
}```so like this?
using guard clauses means guardening the actual logic using ifs and returns
so youd want to check if its muted, and if not return. Then just write the logic below as the code will stop executing at return, so an else is redundant
Now you have an extra pair of {}
i'm using AsyncPlayerChatEvent to edit some stuff like the proximity message etc but if i want to use like the placeholder for luckperms pex in the chat, do i need to import something or can i put %x% and the placeholer api will do his job?
yeah, there needs to be some way for PAPI to know what words to replace and what to put in its place
and how can i do it?
Read the PlaceholderAPI docs
if you don't need to add any placeholders yourself you can just pass your strings into the function to just convert existing ones
but yeah
its all on the docs
Gonna have to ask an ugly question here, but does paper even have NMS? And if so, how does one even use it / set it up
when should i save the Map<UUID, Class<Perk>> selectedPerks; to my database?
I need it to work when switching lobby servers but thatd be kinda expensive performance-wise i assume. Should i use an in-memory database like redis and only store periodically/if many changes made?
Yes
Paper is not a rewrite of the entire server
public void onChat(AsyncPlayerChatEvent event) {
if (!chatMute)
return;
event.setCancelled(true);
String plprefix = (config.getString("prefix"));
event.getPlayer().sendMessage(plprefix + " §cThe chat is currently muted.");}```?
yes like that
also\
?whereami
i fucking know this command so well
😭
😭
i did this to myself once
paper has its own discord server that wants to explain all about its paperweight and userdev for nms
IM BANNED THERE
HAHA YOU FOOL
skill issue?
sob?
i would've asked there if wasnt banned :|
looks like youll have to do some googling instead
aww fucking damn it
How would I have a directory that contains other directories and/or yaml files in the same directory that has stuff like the config
its still allowing people to talk when the mute variable is set
Did you register the listener?
yeah
just make the directory in the resources folder?
you can set it up however you want
or do you mean the server config
in which case you cant
or shouldnt rather
I'm not sure I understand
nono I meant hte plugins
hate the mod team there, it's mentaly degraded. Im chill with yall, the paper people are, well and ugly word here but the only fitting one there, mentally brainded.
Looks like you did not register the listener
intellij
well in there there should be 2 folders, java and resources
doesnt that register it?
do I just put a directory in the resources/
I need that to be availabe & modifiable to the user
you can put into resources folder whatever structure you want
ah
you can make it available by using saveResource()
which copies the file from the jar to the plugin folder on disk
?eventapi
There we go I always forget the api part of the command
Plugin loader doesn't register event. You need to register it manually in onEnable method.
oh, ic, thank you
so I would just add the getServer().getPluginManager().registerEvents(new name(), this); to the onEnable?
You don't want to make a new instance of your main class
So just pass the one you already have/are in
and by want I mean you can't
I suspect this is a bug, but should PlayerFishEvent's .getHand() method be returning null during the CAUGHT_FISH state?
its probably just not set because I guess the data isnt important at that point?
im guessing
Get javadoc'd
I just looked at the docs and missed it, this is why I double checked here :p thanks
anyone any idea?
Wait you're storing the perks by their class rather than their instance
That's an odd choice
how would i register it then since on the docs thats what it says to do
now that i think about it, true
but all instances would completely act the same way then
yea i might change that
as for using Redis you can do so if you want to
It's not required really, does it matter if the perks aren't loaded for a second or two
oh true
The message after the one you replied to tells you what to do
.
ill write it in the todo list for later optimization. ty!
Just don't run your SQL query on the main thread
and handle the case that the perks aren't loaded, then you'll be good to go
getServer().getPluginManager().registerEvents(this, this);?
yes
It works - tysm omg
I would honestly be so confused without you 😭
i recommend splitting your project into multiple classes
so for each command an own class using CommandExecutor, and for each listener the same
lmao I was joking i didnt know you actually had everything in the main class xD
lmao
does command tabcompletion even work using Listeners?
hm ig the label works, but js setting tabcompleter wont
TabCompleters are different from Listeners
is there any way to set the server texturepack to a folder
You need a web server to host it with
@blazing ocean has a neat lib that can help with that inside your plugin
my host is the github repo xD
https://github.com/mcbrawls/inject shameless promo end
anyone know this symbols? https://imgur.com/a/ICEa278
-# combine it with https://github.com/radstevee/packed for maximum coolness
self promo is going wild
Looks like some random unicode symbols
Why do you want those specifically
because there is a texture that in some ways i can't edit because it says that some file is damaged and i want to know where i can get this symblos
Are you trying to rip someones resourcepack 💀
sounds like it
You shouldn't do that
This is such a small image
wdym?
What am I looking at
Nobody will know who’s going to know /s
Some random unicode characters they want to copy
Okay
probably so they can steal another servers resourcepack since it's been protected a bit from just opening
It's unifont
i love sqrt7
i'm just curious i don't want to remake this texture
Its in unifont
this is unifont
oh ok thx
why do you want these characters specifically
because they use it in a scoreboard and i want to see if it's something that work specifically on the scoreboard or i can use it in the chat too
all characters work in chat
and can i get this specific one in some ways or no?
You can but there's no point in doing so
oh okay sad
nice save dude
because they need to be chained
for floatArg
this adds a lot of different commands to /skullcmd <..>
ah okayyy
i.e. ```java
.then(floatArg().then(floatArg().then()))
or sth like that
masterpiece
are any special characters disallowed in the name?
or are pretty much all characters allowed?
What a mess of a syntax
that's just brig for you
no matter how bad your command is, remember that /execute is worse
how the fuc
this has to be like generated
i think reading this just took 2 years off my lifespan
side note wouldnt it make more sense if you put the scale before left rot
whow can i change the skin of a player?
well usually yes, but in this case, no
cuz someone didn't know how to fucking name things
it first applies the leftRotation and then rightRotation after scaling
someone at mojang decided "hmmm, rotation... rotBeforeScale, rotAfterScale? Nahhh. Left & Right"
okay but still
@blazing ocean you know anything about this?
dunno, never used commodore
but in general, if you have a suggestion provider applied, the client will not render the name but rather the dispatched suggestions
hi rad
Callback hell
at this point, just use a for
translation
leftrot
scale
rightrot
can all be unique elements then you can just append xyz where necessary and the angle too
still, why the hell is there no argument name
?javadoc
i dont see any documentation on how to get that
oh yeah you're the guy in helpchat offering 5 bucks
I have a rough idea of what's going on
Down to hop on a call?
Sure
not that i need it but how would you get something like this?
using brig or a commandlib that supports brig
Brigadier, Mojangs command library
o
Can anyone build this grade plugin for me? Not working when I try https://github.com/tsblock/blockhunt
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
does anyone have a color -> block map I could use?
basically just mapping the given color to the closest block of that color
Is there not an API for one
Its a gradle error not the plugin and I can't fix
wait, is there?
If so, sad - pull request one
yo, any recommendations on rollback plugins, coreprotect wont work
since which version is this, again?
It's certainly in 1.20.2
are there 2 block data classes?
You're talking about 2 opposite things lol
Shadow wants a way to map a colour to a block whose texture closest matches that colour, md is suggesting a method to get the map colour of a block
I could map it in reverse, don't worry
More recent than I thought
we need more physics api
the MapPallette class is useful for that
kek
What kind of physics? What are you missing? JOML is literally shaded into Bukkit, you can do all the math your heart desires
Cmon now who wants to go through the trouble of mimicking disc golf flight physics in minecraft
you got a calculator, why you need a game engine
It'd make my project a lot easier :p
Think of the disk golf tho
I can contribute 1/16th of the pr
the "good luck" message?
Can anyone compile a gradle plugin for me?
Just use jbullet or something
no
me?
- What went wrong:
An exception occurred applying plugin request [id: 'io.freefair.lombok', version: '8.6']
Failed to apply plugin [class 'io.freefair.gradle.plugins.lombok.LombokBasePlugin']
Could not create an instance of type io.freefair.gradle.plugins.lombok.LombokExtension.
Receiver class io.freefair.gradle.plugins.lombok.LombokExtension_Decorated does not define or inherit an implementation of the resolved method 'abstract org.gradle.api.provider.Property getVersion()' of abstract class io.freefair.gradle.plugins.lombok.LombokExtension.
Probably your version of gradle is too new for that plugin
Gradle breaks all the time, try using a gradle released around the same time as the plugin
https://paste.md-5.net/yirivihuxo.java
Surely this is worthy to be apart of the api :p
now add wind
I have 8.6 which is around the same time as the updated plugin
Should I try older?
maybe
See this my point where the hell is wind factors in the api smhhh
Alrighty, I need some help with the following things.
I want to split up my plugins into different .jar files in order to prevent the whole server going down if something goes wrong and the code is just slammed into 1 file.
With that being said, I want to make a project or socalled library which I can later use it in many other projects but I don't know the exact approach, so can someone please guide me through and help me out on how to set it up, and how do I add my library later on in the plugins I want to use down the line ?
Modify your display entity in the spawn methods consumer
splitting a plugin into multiple jars wont stop the server going down. also a plugin should never make the server go down
Not the server sorry, I said it in a wrong way.
I meant to say stop the plugin's functionality.
elaborate on modify
you just add the library as a dependency same way as spigot-api
The spawn method lets you pass in a Consumer in which you can mutate the entity before it spawns
world.spawn(location, ItemDisplay.class, display -> {
// edit the display in here
});
Really glad Discord's syntax highlighting is so in-depth and detailed
truly
But yeah, that consumer is nice so you don't get a one tick flicker of the default entity. It changes it first, then adds it to the world
(oh and that spawn method still does return the entity if you need it elsewhere)
The fun part is that it's not just wind, it's wind against a disc
Looks like you're going to learn some more about aerodynamics
Enjoy that hell hole of math equations
Idek why I am doing this with spigot
I've been considering using an actual engine and just making a game
md's JBullet suggestion wasn't a bad idea tbf
fyi doing course gen completely custom; wfc + pathing systems
Not using chunk generators cuz yk
why would I make it easier on myself?
Almost have the a* impl where I want tho so that's cool
Oh, JBullet hasn't been updated in 11 years lol. Maybe not great
anyone recommend a good rollback system
hmm
really glad discords syntax highlighting even works
Idk if bullet physics are what I even want
name is misleading
fair
Bullet is just the name, yeah
It's a really common physics engine, especially for modeling software
It's funny because I am already doing this but with spigot for the most part
you can steal thinky's plugin
An oldie
aw he removed the videos
He also used Kotlin before it was cool I guess lol
is he still working on hytale @worldly ingot
No clue. Lemme see if he's in the channels
he's on the website
Still says Hypixel Studios, so I take that as a yes
hytale release when
paintently waiting for hytale
public void applyPhysics(DiscImpl discImpl, Vector discVelocity, int tick, int maxTicks, BlockFace direction) {
final double flightPhase = (double) tick / (double) maxTicks;
// Diminishing factor of the turn phase
final double turnFactor = (Constants.TURN_PHASE_END - flightPhase) / Constants.TURN_PHASE_END;
// Exponential increase of the fade phase - scale the last number for increase / decrease of the exponential effect
final double fadeFactor = Math.pow((flightPhase - Constants.FADE_PHASE_START) / (1 - Constants.FADE_PHASE_START), 3);
// Drag factor
discVelocity.multiply(Constants.DRAG_FACTOR);
this.applyTechniquePhysics(discImpl, discVelocity, tick, new TechniquePhysicsData(flightPhase, turnFactor, fadeFactor), direction);
}```
This is the only bit where I comment what the math does lol
"The game, originally intended to be playable in 2021, was delayed due to an increase of the game's scope."
I think I have like 3 layers of physics when it comes to throwing a disc
Can't wait to rewrite this
"In July 2024, Hytale's developers reported that the game was being migrated to a new engine, a process that was expected to be complete by the end of the year."
mmmm
the night lighting on the legacy engine is shocking lol
I think I like legacy better other than the stairs
that's from december lol
kinda looks like mc dungeons but they tried to make it look "realer" I guess?
Hypixel Studios is owned by Riot which is owned by Tencent
So they do have the funding if they wanted to
Doesn’t the new engine kind of limit the modding abilities they promised long ago
Yeah
Oh no
Oh and let’s not forget Hytopia
Not to be confused with hytale, they are 2 different things
💀
For the record, I was not confused
I have a problem with another plugin where the items that are suppost to do somthing when you right click them not nothing and nothing shows in logs
yeah so uh
it's a bit
inaccurate
by a very large margin
I'm decently sure a random guess would be closer
(for comparison)
(pretend there's no mask)
How are you matching colours?
Is that what bukkit does or does it do something more complicated
Iirc euclidean distance isn't great
for what, exactly?
MapPalette.matchColor
double rmean = (c1.getRed() + c2.getRed()) / 2.0;
double r = c1.getRed() - c2.getRed();
double g = c1.getGreen() - c2.getGreen();
int b = c1.getBlue() - c2.getBlue();
double weightR = 2 + rmean / 256.0;
double weightG = 4.0;
double weightB = 2 + (255 - rmean) / 256.0;
return weightR * r * r + weightG * g * g + weightB * b * b;
}```
I guess I could try this one
try that
I think if you rendered it flat and on a map it would look right
but map palette not as good up close
Yeah, map colours are not perfect. You should probably average the colour of the textures and go based on that instead. Though that involves going through the vanilla resource pack and actually calculating the average colour
Idk if an average is best
You could (and should) precompute and cache that so it's easy to access without having to do it all the time on startup
Oh almost certainly not, but it's better than nothing
Better than map colours lol
Because some blocks have two drastically different primary colors
Yeah I want bedrock map colors :(
<insert gneiss video on colour theory here>
My release of the 1.21 color world. Now with Oklab, noise filters, median averaging and more.
1.21 Color World Download
https://drive.google.com/file/d/1eVXjSoCqHQ8wm0zFyLlHc7-QrARpgn3X/view?usp=sharing
1,21 Color Data Spreadsheet
https://docs.google.com/spreadsheets/d/1tXxCUyVLe4Jw-rcFTAhd0VdR0hk_fN28SgLnNpDquas/edit?usp=drive_link
Texture N...
He actually also takes into account the "noisiness" of block textures
Resize the texture to 1x1 pixel with nearest neighbour and use the resulting colour
yeah, fuck it, ill watch a 21 minute video on minecraft block colors
Honestly his whole channel is binge watchable, highly recommend
nice name
Very gneiss indeed
I believe he has a spreadsheet of the colour values he uses. I'm not sure if it's public though
Oh, tell you what, it's in the description lol https://docs.google.com/spreadsheets/d/1tXxCUyVLe4Jw-rcFTAhd0VdR0hk_fN28SgLnNpDquas
2slow
Unsure if those are accurate to its transformation
sad
I would say get its location, add 0.5 on all axis (you know how to get a corner), then apply the transformation matrix to that point?
You would have to do it to all 6 corners, obviously, but it would work I think
I thought their position was relative to the center?
So the default corners are at 0,0 1,0 1,1, etc
Oh, is its position bottom left?
Nope only item displays are cantered
Ah
Makes it very annoying to rotate them
just transform to centre and right rotate 😄
I assume this changes something
Just getting your points is all that changes. Instead of 0.5, add 1 to the axis you need
so one corner would be in its location and the other will be in the rest of its "normal, unchanged" block corners?
Are you lot being nerds again
You'll have to apply the transformation manually as vanilla does it though. I wonder if we should add a Transformation#apply(Location/Vector/xyz)
And Vector#apply(Transformation) for funsies
Yknow I never thought about using the right rotation…
lol
"apply the transformation manually" oh yeah, how do I do that?
great info from src
You need to get the position as a Vector3f first (it's just a simple data class, you can construct it from x/y/z coordinates), then apply in order:
- Multiply the vector by the right rotation quaternion
- Multiply the vector by the scale vector
- Multiply the vector by the left rotation quaternion
- Add the translation vector to the resulting vector
You could also just use the matrix
Can you get it as a Matrix4f?
Joml should have methods to apply it to a vector
I don't see anything to get it as a M4F. I guess you could make one but that would be the same as doing what I did above
Aww lame there’s only a setter for the matrix
Something else that could be PR'd I guess
Vector3f position = new Vector3f(1, 2, 3); // Your x/y/z coordinate
Transformation transformation = displayEntity.getTransformation();
position.rotate(transformation.getRightRotation())
.mul(transformation.getScale())
.rotate(transformation.getLeftRotation())
.add(transformation.getTranslation());
I think this would work?
Maybe
Ignore the fact it won't compile because I forgot a ;
Idk vector math is wack and sometimes things go crazy
I guess the reassignment also isn't necessary because that vector3f is mutable
If left and right rotation are both applied before translation would using right rotation to rotate a block around the center even work
I dunno. I'm just doing what Mojang does
What is this? Kotlin?
If you're doing the transformation on 6 points, joining that into a matrix would be smarter so you're doing less operations
aren't there 8 corners?

