#development
1 messages · Page 37 of 1
Its only on 2 lines which is weird
Font loading creates tmp file 🥲
Handshake and StatusPingResponse
Lord I still remember that Disk IO leak I had from that.
well presumably that's due to a completely different reason, not because of the printing
i didnt copy all the code, just replicated the bit you sent
Its caused by that bit for me. But yeah pretty sure glare is right and its just not deleting the temp file
that doesnt make sense
I mean, spawning an echo process won't make a file that says "Handshake" or "StatusPingResponse" lol
that's something more specific to your setup
It doesn't name it that. Thats the content
I never said they were named that
My bad.
Im not sure if this is the correct channel to ask this but I dont see one labeled for this type of question so ima ask anyways. I'm having some trouble using the pastes.dev API and I am pretty sure I have followed the steps on the github page correctly. So far I have made an HTTP POST request to https://api.pastes.dev/post, included the text in the response body, and done the headers so I'm not sure why it's not working. When the application is run, it creates a link but when I follow the link it just redirects me to the "home page" to create a new paste which is making me think its not posting the text properly. Any assistance would be greatly appreciated
You are posting to pastes.dev but trying to use the location on paste.helpch.at, lol
@wraith trail
so im trying to summon fallingsand entities inside blocks, with the same material as the block. however, it only renders if the block data of the entity is different from the physical block. I looked it up and found a bug (https://bugs.mojang.com/browse/MC-243092) marked as resolved in 1.18, but I am running 1.19.3 and it still occurs. Does anyone have any ideas?
(forgive me for my beautiful JS code)
I forgive you
forgor 💀 to delete the message
my gradle catalog bundles aren't working, does anybody know why?
https://paste.skyslycer.de/nKnDA
library("adventure-api", "net.kyori:adventure-api:4.12.0")
library("minimessage", "net.kyori:adventure-text-minimessage:4.12.0")
library("adventure-bukkit", "net.kyori:adventure-platform-bukkit:4.2.0")
bundle("adventure", listOf("adventure-api", "minimessage", "adventure-bukkit"))```
`implementation(libs.adventure)`
someone?
oh shoot wrong channel
Could anyone verify the expansion update I just released?
https://api.extendedclip.com/expansions/marriage/
publish the code
I can do that but what if someone uploads a jar that is different from the source code?
We are not checking only the source, but also the jar. The source code needs to be public though.
that rule didn't exist 6 years ago haha
Yeah
You should override persist() and return true, and fyi, the expansion will only work for online players
yes
but I figured that you are not supposed to do DB calls in the onRequest
online players are in the cache but offline players are not
And why should I override persist? it states that it should be used when ecloud is not used.
the expansion can be safely reloaded with no side-effect.
if i override persist then doing /papi ecloud update marriage followed by a reload, will not work right?
That seems undesirable
Hmm, actually I don't know about that. But iirc if you reload papi, the expansion won't be loaded
when what does According to the javadoc it's "if this expansion should persist through placeholder reloads"
so I assume that if the default false is used, it reloads the JAR when papi ecloud reloads
which is why you cannot use it for plugins I think
but this is just my interpretation from the javadoc
yeah I'm not sure how the thing is lifecycled when it's set to true from inside an expansion jar, keeping it as false seems sensible
I'm trying to understand how this works
Hey guys I just added to the server and I got some errors, could I send the picture somewhere?
Yeah I thought so. perhaps if it is as I think "reloadable" or something would have been a better name
but from where do I start?
ok, looks like persist is used only on LocalExpansionManager https://github.com/PlaceholderAPI/PlaceholderAPI/blob/46d9a695346e989c768cc8a2fb9c58e1a7d6a025/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java#L380
Oh I found my error is ''Could not hook into PlaceholderAPI!''
#general-plugins if it is about deluxemenus, you need to download papi
Yea but is there any tutorial regarding this papi installation?
it is just a plugin
Yeah. I don't think it ever actually reloads the jar
from the code in there
Anyway, is it good then as it is?
I can't support offline players without blocking the thread while querying from the db. and the persist at default should be fine
The offline player support is up to you, I just mentioned that.
I see.
I just updated the expansion to use the API instead of accessing internals from the plugin instance, because I am going to relocate that in the next update.
I also changed the partner placeholder to use the offlineplayer cache instead of querying the database, but that could be improved..
the old system was using the Mojang API as a fallback I think which is a bad idea on many different levels
I see
I was using this method before https://github.com/lenis0012/Marriage/blob/master/src/main/java/com/lenis0012/bukkit/marriage2/misc/ListQuery.java#L99
This uses the OfflinePlayer cache if available, otherwise it queries the DB.
If it still can't find the name even in the DB it queries Mojang's API.
This is... a bad idea
You don't need to use the mojang api by yourself, Bukkit#getOfflinePlayer does that if no cached value is found iirc
Plus, you should be able to get the player name from your server, since these players joined the server at one point or another
getOfflinePlayer().getName() is nullable
so I doubt they query mojang's API
In fact, I am sure of it, because when I tested my new jar my partner name is empty
I originally did it this way because I was under the impression tha the usercache has no expiry, but it does
that's weird, I don't recall having problems with getting offlineplayers
example
[
{
"expiresOn" : "2023-03-07 08:44:38 +0100",
"name" : "lenis",
"uuid" : "16b355fb-4d12-4bbf-865b-ca8bb7e4fd8d"
},
{
"expiresOn" : "2023-02-18 21:04:52 +0100",
"name" : "Ytec",
"uuid" : "ac4696f9-72b7-4188-bd38-179aa901d187"
}
]
it seems that the OfflinePlayer cache has a 24h expiry
that's more than 24h
, 7th of March is next month
yeah and I guess after that it uses the mojang api or some shit
but still going to fall through in all likelihood, in which case I dont want to query the DB, and especially not the mojang API
No. it does nothing
hmm. ehh. im not sure actually
if the player is online, it'll return the online player
else, if it's in world playerdata, it'll return from there
else, if it's in usercache, it'll return from there
else it'll query mojang api
so then OfflinePlayer is still not safe to use?
I guess getName() is null because you can use an invalid uuid that doesn't exist (e.g. new UUID(0, 0)) or for other similar cases
oh yeah, and if the player doesn't exist entirely it'll still return a "valid" offlineplayer, just that it's for a player info that doesn't exist
but that's after querying mojang
why... this is such a bad idea on Bukkit's end
I think there is a getOfflinePlayerIfCached? that doesn't query mojang
The user cache is shared between plugins, so if another plugin will query for a player that's not cached before you do, it will be added to the cache and then you will get it from there.
that's paper only, isn't it?
no clue
d;Bukkit#getofflineplayer
@NotNull
public static OfflinePlayer getOfflinePlayer(@NotNull UUID id)```
Gets the player by the given UUID, regardless if they are offline or online.
This will return an object even if the player does not exist. To this method, all players will exist.
an offline player
id - the UUID of the player to retrieve
getOfflinePlayerIfCached is not in spigot-api
d;paper-1.18 Bukkit#getOfflinePlayerIfCached
@Nullable
public static @Nullable OfflinePlayer getOfflinePlayerIfCached(@NotNull @NotNull String name)```
Gets the player by the given name, regardless if they are offline or online.
This will not make a web request to get the UUID for the given name, thus this method will not block. However this method will return null if the player is not cached.
an offline player if cached, null otherwise
name - the name of the player to retrieve
you missed the if cached part but ok
I know, I was hoping it will bring that method as well xD
or maybe it was added? it's not in spigot-api 1.13.2
it is paper only, as usual
ah
I would say that using Bukkit#offlinePlayer will be fine
it is such a shame that md5 doesn't add in a bunch of these useful API patches
some 25% of players use spigot (non-fork)
that's 25% too little for many to care about supporting
yup
Well there is also the fact that spigotmc.org is the biggest plugin marketplace by far
it seems odd to upload a plugin on there that doesnt even work with spigot
in the end, you or another plugin will use the mojang api, so there's nothing to worry about imho
fair enough
it is still better not to use ListQuery.java though because I will in all likelihood remove that class too in the near future
and the mojang api will be used only for very inactive players once every 30d after the cache expires
yeah fair enough
once a player has joined the server once, their data will remain in world data though, right? @minor summit
and if you have to query mojang api once it's not so bad, probably wont skip the tick
yes
but if you do a few at once, RIP tick rate
the mojang api might be used even less often due to this
there is also the issue of bungeecord servers
yeah idk about that, there's maybe some global cache provided by bungee?
I doubt it
Well I digress. my changes should remain compatible at least even when I restructure my plugin
marriage is a bit of an abomination
tl-dr; you should be fine with offlineplayers
no
The result of 17-year-old obsessing over annotations and layers of abstractions
hmm, I see, I was expecting smth. Maybe velocity?
alright
this is why I started storing "lastName" with my own playerdata
problem is, that data is also not loaded for offline players 🥲
Hmm
I think the usercache is only used when you get by name, not uuid
otherwise it uses the world data
which is why it doesnt work for my, I recreated my world
mystery solved
I dont think it uses mojang API though, in 1.19.3 at least. it's null when I try to use it for an existing player
can you try both, name and uuid?
oh yeah that whole if else process I mentioned above only happens if you use getOfflinePlayer(String)
when getting from a UUID it doesn't query mojang api
what happens if you use uuid though?
when getting by name, that whole process, and if the web request yields nothing it will create a v3 UUID as if by online-mode: false (so still a valid OfflinePlayer)
when getting by UUID it's the same process minus the web request, so if usercache fails it'll just return an OfflinePlayer for that UUID with no name (null)
hmm, interesting and annoying at the same time xD
I think it makes sense. if you do /whitelist <name> it has to succeed even if the player has never logged in. it needs the UUID to whitelist or op someone. getting the name for a uuid is not a real use-case in vanilla
more importantly, can you verify my version?
There is no time to wait! Ask your question @wary spindle!
Why do I get this error?
Error: Execution failed for task ':pandaspigot-server:compileJava'.
Compilation failed; see the compiler error output for details.
Error: [Task :pandaspigot-server:compileJava] org.bukkit.craftbukkit.CraftWorld is not abstract and does not override abstract method <T>spawn(org.bukkit.Location,java.lang.Class<T>,java.util.function.Consumer<T>) in org.bukkit.World
Error: [Task :pandaspigot-server:compileJava] org.bukkit.craftbukkit.CraftServer is not abstract and does not override abstract method getPluginsFolder() in org.bukkit.Server
Error: [Task :pandaspigot-server:compileJava] org.bukkit.craftbukkit.entity.CraftPlayer is not abstract and does not override abstract method sendEquipmentChange(org.bukkit.entity.LivingEntity,org.bukkit.inventory.EquipmentSlot,org.bukkit.inventory.ItemStack) in org.bukkit.entity.Player
Error: [Task :pandaspigot-server:compileJava] org.bukkit.craftbukkit.block.CraftSkull is not abstract and does not override abstract method getPlayerProfile() in org.bukkit.block.Skull
Error: [Task :pandaspigot-server:compileJava] org.bukkit.craftbukkit.util.CraftMagicNumbers is not abstract and does not override abstract method deserializeItem(byte[]) in org.bukkit.UnsafeValues
Error: [Task :pandaspigot-server:compileJava] org.bukkit.craftbukkit.inventory.CraftMetaSkull is not abstract and does not override abstract method getPlayerProfile() in org.bukkit.inventory.meta.SkullMeta
I'm making a pr
any1 can find the problem?
Just this part is important, that's what is in the error log (ArrayIndexOutOfBoundsException)
case "link":
String arenaName = args[2];
if (args.length != 4) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&x&f&f&7&5&1&2⚠ &x&b&8&1&6&1&bIncorrect Usage!"));
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&x&f&f&3&6&5&a/&x&a&6&8&b&8&cffaarena &x&f&f&3&6&5&alink &x&a&6&8&b&8&c<arena_name> <kit_name>"));
return true;
}
// Check if the arena exists
if (!arenaConfig.contains(arenaName)) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&x&f&f&7&5&1&2⚠ &x&b&8&1&6&1&bArena &x&f&f&7&5&1&2" + arenaName + " &x&b&8&1&6&1&bdoes not exist."));
return true;
}
// Check if the kit exists
String kitName = args[3];
if (!kitConfig.contains(kitName)) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&x&f&f&7&5&1&2⚠ &x&b&8&1&6&1&bKit &x&f&f&7&5&1&2" + kitName + " &x&b&8&1&6&1&bdoes not exist!"));
return true;
}
// Link the kit to the arena
arenaConfig.set(arenaName + ".kit", kitName);
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&x&3&4&e&b&4&0✔ &x&2&2&a&3&2&bKit &x&3&4&e&b&4&0" + kitName + " &x&2&2&a&3&2&blinked to arena &x&3&4&e&b&4&0" + arenaName + "&x&2&2&a&3&2&b."));
break;```
if you do, please make sure to tell me
tell, usually it tells the line number, where the expection occurred
woops wrong case
on line String arenaName = args[2];
@river solstice
before the switch case did you check if args.length >= 3?
no
that will be why then
oh.
also instead of doing &x&f&f&7&5&1&2 you can do ChatColor.of("#FF7512")
makes it much more readable
oh never heard of that
when was that added?
nvm i can just check
I have a plugin that makes barrels the size of a double chest by just opening another GUI when they click on a barrel. How should I allow hoppers to take items from the barrels?
I am not sure if there is an event or anything for it, or if I should do it manually
Is ItemStack#getLore() nullable?
Paper? Yes. According to the JavaDocs. https://jd.papermc.io/paper/1.19/org/bukkit/inventory/ItemStack.html#getLore()
alrighty
Null means no lore (default), and an empty list means an empty lore iirc
There's a comment about this in CraftItemMeta
seems like InventoryMoveItem. However - it wont actually be invoked unless a real item is transferring. What you could do is either:
- update every redstone tick (is that a thing?) around a stored set of barrels to manually check for hopper transfers.
- just put dummy items in the vanilla barrel, and cancel every event that comes across them
ex: if an InventoryMoveItem event is invoked between a barrel and a hopper with a dummy item, cancel it and then determine a real item that should be sent
I think I will just do a runnable that checks every time for if the hopper/barrel still exists, and if so, then remove a item from the barrel, and add one to the hopper.
hey i was trying to see can yall help me with gta rp
no
yeah thats good too, make sure to remember minecart hoppers
ope, forgot that one
install placeholder api
and bungee expansion
and then do /papi reload
All already installed
org.bukkit.command.CommandException: Unhandled exception executing 'e' in net.advancedplugins.ae.handlers.commands.EnchanterCommand(enchanter)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:182) ~[patched_1.16.5.jar:git-Purpur-1171]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:826) ~[patched_1.16.5.jar:git-Purpur-1171]
at net.minecraft.server.v1_16_R3.PlayerConnection.handleCommand(PlayerConnection.java:2315) ~[?:git-Purpur-1171]
at net.minecraft.server.v1_16_R3.PlayerConnection.c(PlayerConnection.java:2130) ~[?:git-Purpur-1171]
at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:2083) ~[?:git-Purpur-1171]
at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:49) ~[patched_1.16.5.jar:git-Purpur-1171]
at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:7) ~[patched_1.16.5.jar:git-Purpur-1171]
at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:55) ~[patched_1.16.5.jar:git-Purpur-1171]
I have this error
that error is not related to placeholders not showing...
also wrong channel
doesn't exist actually
atleast in spigot
oh it uses bungee
it exists in bungee chatcolor, tho afaik you have to use textcomponents when sending it like that instead of a string
i had to consult my own plugin and your right you dont
i dont know why i thought you had to
yeah but I don't use bungee nor bungee chatcolor sooo
are there any alternatives btw?
some bungee classes are included in the spigot jar
tho just the chat classes
i dont hook into bungee
these are what are available for spigot 1.19.2, im sure they are the same for 1.19.3
ah the text component is used when wanting to use hover chat
i got that mixed up lol
Adventure
I have a problem, scripts do not run, kernel version is 1.16.5, I use java 16
[17:24:34 WARN]: [PlaceholderAPI] Failed to set ScriptEngine for javascript placeholder: example [17:24:34 WARN]: [PlaceholderAPI] Failed to set ScriptEngine for javascript placeholder: region [17:24:34 WARN]: [PlaceholderAPI] Failed to set ScriptEngine for javascript placeholder: flags [17:24:34 WARN]: [PlaceholderAPI] Failed to set ScriptEngine for javascript placeholder: owners [17:24:34 WARN]: [PlaceholderAPI] Failed to set ScriptEngine for javascript placeholder: members [17:24:34 WARN]: [PlaceholderAPI] Failed to set ScriptEngine for javascript placeholder: prefix [17:24:34 WARN]: [PlaceholderAPI] Failed to set ScriptEngine for javascript placeholder: group [17:24:34 WARN]: [PlaceholderAPI] Failed to set ScriptEngine for javascript placeholder: suffix [17:24:34 WARN]: [PlaceholderAPI] Failed to set ScriptEngine for javascript placeholder: clan
only problem with adventure is that its not included by default in spigot, so you have to either manually include it in your plugin or just force the plugin to disable on spigot servers
id assume the javascript engine thats been specified isnt compatible with your java version
What exactly is the problem?
if its a plugin ment for the public they will have to always include adventure in their plugin
like they cant just shade it
am i missing something?
shading is using an api without including it in the actual jar?
for example, here is the group.js file, what did I do wrong?
`var faction = "%vault_rankprefix%";
function check() {
if (faction === "§7§l") {
return "&c&lНет";
}
else {
return "%vault_rankprefix%";
}
}
check();`
so your plugin isnt 43mb in size
Thats what shading means
Downloading libraries at runtime is different
But there's no problem with shading adventure to use a proper component system
spigot doesnt include adventure
paper does
So what
Will you help me?
you will have errors running the plugin if its ran on spigot
You probably are talking about the native support of paper
Ok, you can use adventure-platform-bukkit to send components trough a helper class
the problem isnt with the scripts
Thats perfectly fine
and in what?
the javascript engine that is currently selected isnt compatible with your java version or something like that
theres multiple engines
i was just saying that if you want to use adventure you will have to include it in your plugin jar or force the plugin to only work while running on paper servers
When will Java 16 be supported?
go to your javascript_placeholders.yml and change the engine
theres some list somewhere
Yeah but shading it is not a problem, idk why you are considering this one
i wasnt considering it a problem
i was just saying what you would have to do to use adventure
try using quickjs
ig i worded it wrong?
Where exactly?
1.4.1 is an old javascript engine version
or maybe its just the config hasnt been updated
well
you see there
A member of staff has requested I move your message to a paste,
Most likely because it contains a config/error/code snippet.
engine: has not been a thing in the javascript expansion for some time. try updating
серавно
`# Javascript Expansion: 1.4.1
This is the main configuration file for the Javascript Expansion.
You will define your javascript placeholders in this file.
Javascript files must be located in the:
/plugins/placeholderapi/javascripts/ folder
A detailed guide on how to create your own javascript placeholders
can be found here:
https://github.com/PlaceholderAPI-Expansions/Javascript-Expansion/wiki
Your javascript placeholders will be identified by: %javascript_<identifier>%
Configuration format:
<identifier>:
file: <name of file>.<file extension>
engine: (name of script engine)
Example:
'my_placeholder':
file: 'my_placeholder.js'
engine: 'nashorn'
example:
file: example.js
engine: nashorn`
seravno
download new version of javascript here
where do I put it in plugins?
did
as it was and remains -_-
right, I forgot to register the plugin
thanks for helping 🙂
I did it, but now I have to constantly write papi register Javascript-Expansion-2.1.2.jar after restarting the server
@proud pebble
got an error message, any1 got an idea on what it could be? it doesn't seem to be a problem with my plugin.
i have never used length() in my plugin, nor had a input variable.
ever thought about sharing code? Send your ScoreboardManager
sure
ok wait hold on cause discord when using ./paste
please go to the site directly
is bad
yeap lol
title is null
title = config.getString("scoreboard.title");
yup
scoreboard:
show-in-worlds:
- "ffalobby"
- "freeforall"
enabled: true
title: "&#ff365a&lDefuse &#c7b7b9(EU) &#a68b8c| &#c7b7b9FFA"
lines:
- "&#a68b8c&m "
- "&#b8161b&l| &#ff365aPing &#c7b7b9→ &#ff7512%ping% &#a68b8cms"
- "&#b8161b&l| &#ff365aTPS &#c7b7b9→ &#ff7512%tps% &#a68b8ctps"
- ""
- "&#b8161b&l| &#ff365aKills &#c7b7b9→ &#ff7512<kills>"
- "&#b8161b&l| &#ff365aDeaths &#c7b7b9→ &#ff7512<deaths>"
- ""
- "&#a68b8ceu.defuse.live"
- "&#a68b8c&m "
i doubt it somehow
¯_(ツ)_/¯
I did it, but now I have to constantly write papi register Javascript-Expansion-2.1.2.jar after restarting the server
try to print it
sure
lemme see now
oh i got it, didnt create the scoreboard.yml at all maybe thats why
no wait i meant that the plugin doesn't put scoreboard.yml into the data folder
no idea why
yeah you gotta do it yourself
@icy shadow help
https://github.com/PlaceholderAPI/Javascript-Expansion/issues/43
here is my exact error
what version of placeholderapi do you have?
./version PlaceholderAPI
the latest
how would i delete all the blocks within a worldguard region? i have the two points but don't know how to iterate through every block between the two points.
anyone have good ideas on how to download resources from dev.bukkit.org via shell script
the main avenue i see is using a headless browser but that's a last resort
you copy the download link
all I could find is this https://mediafilez.forgecdn.net/files/<first 4 digits of update id>/<last 3 digits>/<file name>
https://dev.bukkit.org/projects/vault/files/3007470 becomes https://mediafilez.forgecdn.net/files/3007/470/Vault.jar
you'll also need the version number of the resource
so you have to specify Vault-1.2.jar or whatever or else it wont work
yeah 😦
nah, the name is on the update details
you can't get the update details without passing the check first tho
yeah ik what you mean
modrinth 😌
maybe this also works on bukkit? https://docs.curseforge.com/?shell#getting-started
oh i saw coreprotect uses modrinth
yup, is pretty great tbh
oo this sounds promising
Is there any documentation on how to use NMS for different versions? I wanted to add further nbt support for deluxemenus but no idea how this shit works
net.minecraft.world.item.ItemStack s = CraftItemStack.asNMSCopy(i);
NBTTagCompound tag = s.t() ? (s.u() == null ? new NBTTagCompound() : s.u())
: new NBTTagCompound();
tag.a(key, NBTTagByte.a((byte) 1));
s.b(tag);
return CraftItemStack.asBukkitCopy(s);
tf is t() and u() and a() 😭
welcome to obfuscated code
that's why I use NBT API
im probably dumb but in the worldedit api, how would i make a pattern? in my code, air is supposed to be the pattern but is not working and im not sure why it is not a pattern. editSession.setBlocks(region, air);
new BaseBlock(BlockTypes.AIR.getDefaultState()) this is what I use
what version is this?
theres screamingsandals
screamingsandals also has gradle plugin
which is nice
doesn't work like paperweight though
where it remaps
iirc it generates some classes which, depending on the version, will call the right method
but you also have to manually write down each class and method you want it to generate :/
using nbtapi would probably be best
1.19 R2
nice
thanks
using screaming sandels is the best way to figure out wtf half the obfuscated named are
I have one question how do i can make a invsee command that also shows the armor and offhand? bcs i don't get it how to do that
make the inventory 45 in size and manually retrieve the items from those specific slots, put them in the bottom row
you can use PlayerInventory#getItem(EquipmentSlot)
there should be methods attached to the PlayerInventory for getting equipment and armor (like PlayerInventory#getArmorContents()), or you could use the method CJ provided.
Player#getInventory()#getArmorContents and #getItemInOffHand()
Something is off
case "link":
String arenaName = args[2];
if (args.length != 4) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&x&f&f&7&5&1&2⚠ &x&b&8&1&6&1&bIncorrect Usage!"));
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&x&f&f&3&6&5&a/&x&a&6&8&b&8&cffaarena &x&f&f&3&6&5&alink &x&a&6&8&b&8&c<arena_name> <kit_name>"));
return true;
}
// Check if the arena exists
if (!arenaConfig.contains(arenaName)) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&x&f&f&7&5&1&2⚠ &x&b&8&1&6&1&bArena &x&f&f&7&5&1&2" + arenaName + " &x&b&8&1&6&1&bdoes not exist."));
return true;
}
// Check if the kit exists
String kitName = args[3];
if (!kitConfig.contains(kitName)) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&x&f&f&7&5&1&2⚠ &x&b&8&1&6&1&bKit &x&f&f&7&5&1&2" + kitName + " &x&b&8&1&6&1&bdoes not exist!"));
return true;
}
// Link the kit to the arena
arenaConfig.set(arenaName + ".kit", kitName);
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&x&3&4&e&b&4&0✔ &x&2&2&a&3&2&bKit &x&3&4&e&b&4&0" + kitName + " &x&2&2&a&3&2&blinked to arena &x&3&4&e&b&4&0" + arenaName + "&x&2&2&a&3&2&b."));
break;
It looks like there is a missing declaration of the variable "String". Java requires that variables be declared with a specific data type before they can be used.
case "link":
if (args.length < 4) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&x&f&f&7&5&1&2⚠ &x&b&8&1&6&1&bIncorrect Usage!"));
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&x&f&f&3&6&5&a/&x&a&6&8&b&8&cffaarena &x&f&f&3&6&5&alink &x&a&6&8&b&8&c<arena_name> <kit_name>"));
return true;
}
String arenaName = args[2];
String kitName = args[3];
// Check if the arena exists
if (!arenaConfig.contains(arenaName)) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&x&f&f&7&5&1&2⚠ &x&b&8&1&6&1&bArena &x&f&f&7&5&1&2" + arenaName + " &x&b&8&1&6&1&bdoes not exist."));
return true;
}
// Check if the kit exists
if (!kitConfig.contains(kitName)) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&x&f&f&7&5&1&2⚠ &x&b&8&1&6&1&bKit &x&f&f&7&5&1&2" + kitName + " &x&b&8&1&6&1&bdoes not exist!"));
return true;
}
// Link the kit to the arena
arenaConfig.set(arenaName + ".kit", kitName);
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&x&3&4&e&b&4&0✔ &x&2&2&a&3&2&bKit &x&3&4&e&b&4&0" + kitName + " &x&2&2&a&3&2&blinked to arena &x&3&4&e&b&4&0" + arenaName + "&x&2&2&a&3&2&b."));
break;
Better
class LevelSystem {
var levels = 100
var currentLevel = 1
val skills = arrayListOf("Speed Boost", "Fire Control", "Flight", "Enhanced Mining", "Improved Combat")
var currentSkills = arrayListOf<String>()
fun unlockSkill(skill: String) {
currentSkills.add(skill)
}
fun levelUp() {
currentLevel++
if (currentLevel <= levels) {
unlockSkill(skills[currentLevel - 1])
}
}
}
@grim oasis help, is there something off?
Hey, can i try for myself to make the plugin Guilds to claim chunks instead of radius ? Do i have the permission ?
It isn't.
Heh?
dont tag support team members
The plugin is "freemium". As long as you don't start sharing or selling it, sure. Now, if you want this functionality to be merged into the plugin, I can't confirm that will happen. That's something only Glare can decide.
anyways i think i managed to do it
not for reselling or sharing
just for having some fun
if it works open a PR and see what glare thinks. He might end up merging it
you never know
Ok.
Claim.kt: This file contains the Claim class, which is used to represent a claimed area of land.
ClaimHandler.kt: This file contains the ClaimHandler class, which is responsible for managing claims, such as creating, deleting, and checking them.
ClaimSettings.java: This file contains the configuration for claiming-related settings, such as the maximum number of claims a guild can have.
ClaimUtils.kt: This file contains utility functions for working with claims, such as checking if a location is inside a claim, or calculating the distance between two claims.
Guilds.kt: This file contains the main plugin class, and may contain references to claims and the functions for claiming land.
GuiHandler.kt: This file contains the GuiHandler class, which is responsible for managing graphical user interfaces in the plugin. This file may contain code related to displaying information about claims or allowing players to initiate the claiming process.
if he wanna have fun for himself
i fixed it anyways
What would be a proper way to work with an "User" object that's stored in a database and is loaded for each player on join, unloaded on leave and on an interval (every day at midnight) certain data from all users is reset?
Clear the list when you reset it
It sounds like it's just an in memory cache of the database, so if you make a lot of changes just clear the cache and rebuild it
yeah I do that and then load the User object for all online players
About caches
https://twitter.com/secretGeek/status/7269997868
There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors.
1764
1387
Would anyone know what could be causing this? The server is just running with a paper 1.19.3 jar. (No plugins), with just one player online
how much time does that graph span?
I think about 60s
and how much memory does that represent?
At the peek: 2.2Gb and at the bottom: 480mb
that is normal for a minecraft server, I do agree the peaks are weird, but might just be loading or chunk generating. Not sure, but it doesnt seem out of the ordinary.
Oh okay, thanks for letting me know.
[22:35:48 WARN]: [PlaceholderAPI] universalmines is attempting to register placeholders via deprecated PlaceholderHook class. This class is no longer supported and will be removed in v2.13.0!
how to fix?
[22:36:34 WARN]: [PlaceholderAPI] Loaded class net.luckperms.api.LuckPerms from LuckPerms v5.4.58 which is not a depend, softdepend or loadbefore of this plugin.
[22:36:34 WARN]: [PlaceholderAPI] Loaded class org.black_ixx.playerpoints.PlayerPoints from PlayerPoints v3.2.5 which is not a depend, softdepend or loadbefore of this plugin.
1st one, no, you cant fix it, ask the developer to fix it, he's using old placeholderapi api
2nd and 3rd just ignore, no way to remove it since it's spigot thing, nothing bad tho
Add LuckPerms and PlayerPoints to softdepend of PlaceholderAPI plugin.yml
ur joking, right?
Nope
shouldn't it be a loadbefore?
not a softdepend
because LuckPerms and PlayerPoints would be (soft)depending on PAPI
but PAPI still takes methods and stuff from LuckPerms and PlayerPoints, meaning it should softdepend them
it'd be actually the complete opposite, PAPI needs to load after those plugins so that it can load their classes
right yeah I was thinking for internal expansions
whoops
but now that I think about it
those warnings wouldn't show up for internal expansions
🥲
yeah lol
And its also softdepend so the plugins don't have to be loaded. Unless placeholderapi actually depends on their methods lol
Hello when the event PlayerInteractEvent is triggered with an armor item and i try to retrieve the armor, it retrieve the armor contents before the click. So i tried to run a runTaskLater() of 1 tick to get the armor contents after the click (is it efficient if i have alot of players). I also tried to create a temp List that replace the armor contents with the new clicked armor to check it. Which one is the most efficient ? (im using 1.8 spigot api)
yeah thats why i did but if u retrieve the player armor when its triggered it retrieve the armor just before the event
what are you trying to achieve?
imagine the player trigger "PlayerInteractEvent" to equip a chestplate, if i try to get armor content i will get only null ItemStack (bcz he has no armors) so i ran a runTaskLater() to get the armor contents after the event triggered and it works but is it really efficient if i have alot of players ?
probably, yeah
you shouldn't be checking the slot, because the event hasnt happened on the server yet. use event.getItem()
you could just use e.getPlayer.getInventory.getItemin<Main/Off>Hand()
depending on which hand it is
or do what heklo suggested since that would always get the item from the correct hand
Is it what im doing but im talking about player current armor. When the event trigger with a right click on a chestplate (it will equip it) but when i use e.getPlayer().getInventory().getArmorContents() it return the armor contents just before the event so the chestplate equipped is ignored in the list received. To avoid i ran a runTaskLater() of 1 tick and inside this runnable i retrieve the good armor contents. But i was wondering if alot of players trigger the same event (so create new runnable) is it gong to create loss of performance ?
no
I mean eventually if you schedule 3000000000 at once yes that will impact performance
but that will never happen
Why not check the interacted item?
so dont use the armor content of the slot you just equipped
say you right click a chestplate
get boots, leggings, and helmet from armor slots, and then chestplate from getItem()
getItem() returns the item in hand that your equipping tho so theres no need to run a task on the next tick to get the equipped piece since itll be equipped
^
how can i take a sample?
in the plugin.yml add
softdepend: [PlayerPoints, LuckPerms]
```or if softdepend is there already add those to it.
Why gradle gives me error like those ? https://prnt.sc/25eTe4ZoBeal (Gradle 7.4)
What are you trying to do??!?!?
You're trying to write java in a kotlin file, that obviously won't work
wtf ?
Do you know about it ?
It's not my project obviously, how did the dude used it with gradle ?
Sorry, I haven't used groovy gradle for ages
Is the whole file copied or that part only?
that part only
Yeah well
Think about it
You're using Kotlin/Java code in a Groovy gradle file
That no worky
it's not java code
@sudden sand it could just be ur IDE messing up, try building with the command line
and/or show the error
I deleted this piece of code and it seems to at least give me decent errors
Ok the errors are related to something else
deleting code is generally not gonna fix it lmao
Thanks for your precious help Brister Mitten
uh
You're right but it did
x)
what exactly does ChatMessageType.SYSTEM represent
ChatMessageType.CHAT represents a chat message and ChatMessageType.ACTION_BAR is an action bar message, but i have no idea what system could mean
perhaps the messages like the ones sent after you use F3+H? (advanced tooltips enabled/disabled)
ooh that could be it i guess
maybe messages like those dont require verification in the newer versions?
I don't see why they would
aren't they messages not sent by a player? Player#sendMessage for example
yeah that would make sense
also conveniently what all chat messages are if you disable chat reporting 🙂
Why wont java code work in groovy
Groovy is a suoerset of java
Last time I checked it didn't work
You can't write java code in a different JVM language and expect it to work
like this?
`name: "PlaceholderAPI"
main: "me.clip.placeholderapi.PlaceholderAPIPlugin"
version: "2.11.2"
author: HelpChat
api-version: "1.13"
softdepend: [PlayerPoints, LuckPerms]
description: "An awesome placeholder provider!"`
thanks, now no, but how to remove it?
[10:35:45 WARN]: [PlaceholderAPI] universalmines is attempting to register placeholders via deprecated PlaceholderHook class. This class is no longer supported and will be removed in v2.13.0!
ask the developer of univeralmines to update his code
🙂
Yeah what Gaby said. The plugin is using methods from placeholderapi that are deprecated (marked for removal).
I am setting up Github Actions on my repository, but I'm struggling to make it work. The workflow is failing on this step:
- name: Create release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: v${{ inputs.VERSION_TAG }}
tag_name: ${{ inputs.VERSION_TAG }}
draft: false
prerelease: false
fail_on_unmatched_files: true
files: |
dist/binary-file.zip
This is the error message.
Run softprops/action-gh-release@v1
🤔 Pattern 'dist/binary-file.zip' does not match any files.
Error: ⚠️ There were unmatched files
I suspected that I was screwing something up, so I had the workflow print for me some informations just before running the Create release to facilitate the debug.
pwd
/home/runner/work/test-rust-workflow/test-rust-workflow
ls
dist
ls dist
binary-file.zip
So, the file dist/binary-file.zip clearly exists, hence why I am so intrigued, does anyone have any clue about what is going on here?
Hello
i cannot find at docs exact description
What is the responsible file that indicated that Player#hasPlayedBefore() is true or not?
Found somewhere in world's folder? stats subdirectory maybe?
Thanks in advance.
Also, any ideas how to send title constantly (repeatedly) but without title "pulsating" when you send title another after another...
either the player being online or, if offline, <world>/playerdata/<uuid>.dat existing and being valid (the nbt has to be valid, not just the file existing)
Hey, I need some help regarding the colors of my console, I use linux and screen for the server consoles, what I have discovered is the newer versions don't have any colors and instead of green or red they are plain gray. Any way to fix this?
tmux > screen
i know shell colors are determined in the ~/.bashrc or whatever config file for bash, maybe that's where the issue is?
but if not then yea try tmux
if anything because screen is no longer being worked on
I want to make dropped items only visible to the players who dropped them. I know I can send a entity destroyed packet to every player except the one who dropped it, but that seems like a lot to track especially with players joining and leaving. Is there a better way that I am missing, or is this the best way?
Send entity creation packet instead? Then you only have to track 1 player
but then how does the player pick it up again?
or actually
doesnt that send a player pickup item packet?
It will send a pickup packet to the server
Hey guys, i think i have found a problem but i don't know where the problem exactly is,
i was using papi dev version 2.11.3 and i have 35 javascripts and something somewhere
it leaked ram, i had usage 12gb with only 1 player online and i run out of memory in 15 min
i replace the papi with the version 2.11.2 and everything got away after 2 days searching for the problem 😛
if developers are interested to see the problem i will provide the server files to run some test!!
where was the error when you ran out of memory?
pterodactyl or what
yeap ptero
but same happens to multicraft too
or maybe my javascripts are made very badly
when i do /lagg gc it helps a lot with garbage
how much space do you have and how much did you assign to heap
max ram is 24gb and my partner did the recommended that ptero ask for
so what did you assign
again idk we are using 18gb for our servers
i run 2 server for one machine
what does each server get
The panel is not the problem i have check it
now survival 6 because it uses nothing
and skyblock (who has the problem) 10
the panel is not a problem i have teste the same server on multicraft too
and on very stong machine too
5960x on 5.2ghz
still same problem
and on bisect too
same problem everywhere
my guess is that xmx is set to close to container limit
my flags are default for both servers
both servers are test server not actually for playing,
but still the skyblock with 35 javascripts behaves very badly
my survival barley uses 4gb in 5 days up time without restart,
so for sure after a lot of time debugging papi or javascripts are the problem.
Try disabling placeholderapi
already did us i have explained here:
Stop the cap
when papi is off ram stays very stable at 3.5gb
if you don't know how to talk please leave me alone 🙂
Wym, they talked pretty clearly right there
@stable sorrel if you use nashorn, try this jar instead <#placeholder-api message>
i have it
If you use that, nashorn shouldn't cause any problems
Do you have spark installed?
And lets move to #placeholder-api if you are 100% sure this is related to papi, otherwise to #general-plugins
when i remove the plugin from the server the ram stays at 3.5gb for 40-50 min, if the papi is on the server it stays up for 10 maybe 15 xD
and yes i have spark
pls tag me on papi channel 🙂
can anyone recommend me a good tutorial on how to create custom 3d items
for 1.19.3
No, wrong channel @uneven herald
Is there an alternative to thread.sleep? Because that freezes my whole server
What are you trying to do?
I'm trying to make a time loop
here's my code
while (Time != 10){
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
Time += 1;
player.setCompassTarget(tplayer.getLocation());
}
yeah is been like that for a while I think
or at least every time I've wanted to use it recently xD
do i just make a function using the scheduler and run it in my code?
I don't understand
For a self cancelling task you can create a class thats extends BukkitRunnable and inside run() you check if the amount of runs is 10 and then cancel it.
To start the task you create an instance of the class and call this method on it
public boolean runTask(@NotNull Plugin plugin) throws IllegalArgumentException,IllegalStateException{
return false;
}
so something like this?
i don't know what that means
in my main class?
Online Courses:
Online courses are also great for learning java. Some websites that offer them are:
- Coursera - Free unless you want a certificate
- PluralSight - Great courses from what I've seen. Mostly Paid
- Udemy - Never used them myself but they seem to all or at least most be paid.
My first ever course was one from Coursera. - I can say it was pretty good at introducing me to the programming world as a whole not just java.
Oracle Docs:
Oracle docs can help a lot at learning and understanding java:
- Start with this,
- Breeze through this (skipping stuff that doesn't seem relevant like bitwise operators),
- Hit this.
They're the first three from this larger thing which you should definitely go through overall. But those three should be enough for slightly better understanding of what is happening here without feeling like a huge time sink.
That one is a small part of this larger site wherein "Essential Java Classes" and "Collections" also have good useful stuff
Other services:
Some other cool services that will help you learn java are:
As you can see there are plenty of good ways to learn as long as you're willing to invest the time. Have fun learning!
Do this first before jumping into spigot
I understand, but i usually just figure out programming through trial and error
you still have to know at least some java to start trialing and erroring
so go and learn dude
Yeah i found out what he meant i understand now
new BukkitRunnable(){
@Override
public void run() {
player.sendMessage("Loop ran);
}
}.runTaskTimer((Plugin) this,0L, 20L);
Does anyone know why this doesn't work?
Show the full code. That code alone looks right but we don't know if you're properly running it.
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (sender instanceof Player){
switch(label){
case "track":
Player player = (Player) sender;
if (player.getInventory().getItemInMainHand().getType() == Material.BLUE_DYE){
if (args.length != 0){
Player tplayer = Bukkit.getServer().getPlayer(args[0]);
if (tplayer == null){sender.sendMessage(ChatColor.RED + "That's not a valid player!"); return false;}
if (tplayer == player){sender.sendMessage(ChatColor.RED + "You can't track yourself!"); return false;}
player.getInventory().getItemInMainHand().setType(Material.COMPASS);
player.setCompassTarget(tplayer.getLocation());
new BukkitRunnable(){
@Override
public void run() {
player.sendMessage("Looped");
}
}.runTaskTimer((Plugin) this,0L, 20L);
}else{
sender.sendMessage(ChatColor.RED + "You must specify a player to track!");
}
}else{
sender.sendMessage(ChatColor.RED + "You need a player tracking key to run this command!");
}
}
}else{
sender.sendMessage(ChatColor.RED + "Command must be run by a player!");
}
return false;
}
Is the command registered? If it is add some debug to find what part of the code isn't running.
The command is registered and it works when i remove the loop
it's the loop itself that causes the issue
the error is on line 29 aka new BukkitRunnable(){
Whats the error? You just said it didn't work lol
CommandHandler cannot be cast to class org.bukkit.plugin.Plugin (me.predatolian.trackingcompass.handlers.CommandHandler is in unnamed module of loader 'TrackingCompass.jar') @44d8603; org.bukkit.plugin.Plugin is in an unnamed module of loader java.net.URLClassloader @48cf768c)
Show me your imports
package me.predatolian.trackingcompass.handlers;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull;
am i giving it the plugin instance in an incorrect way or smth?
He is passing and casting CommandHandler class for the scheduler to a JavaPlugin
💀
Caused by: java.lang.ClassCastException: class me.predatolian.trackingcompass.handlers.CommandHandler cannot be cast to class org.bukkit.plugin.Plugin (me.predatolian.trackingcompass.handlers.CommandHandler is in unnamed module of loader 'TrackingCompass.jar' @44d8603; org.bukkit.plugin.Plugin is in unnamed module of loader java.net.URLClassLoader @48cf768c)
at me.predatolian.trackingcompass.handlers.CommandHandler.onCommand(CommandHandler.java:29) ~[TrackingCompass.jar:?]
i forgot to copy the whole thing
Why was it tracercumpiss before the edit 💀
basically this, you're missing basic understandings of the java type system
you dont use (Plugin) this
yeah
you use the instance of your plugin
i was assuming
that was the issue
it just didn't give me an error
so i thought it was okay
xD
thanks for explaining instead of laughing at me

thanks for explaining instead of laughing at me
This isn't spigot's discord LMFAO
Anyone know if it's possible to open a partially-written book via packets, and let the player finish writing it?
Everything I've found for any version past like 1.8 is for pre-written books
but I'd like to get input from the user via a book
and the best I've seen is someone making a book that you have to click on to open
Even hypixel, from what I can tell, makes the user open the book themselves
id assume yes, it would be something like how packet based signs work
I realize I could spend hours looking into it, but I'm more wondering if anyone's seen it done... ever?
Since I want to know if I'd be wasting my time considering I've never seen anyone do it
(The issue is that it seems like the packet for opening a book must be initiated client-side?- I don't know this though, it is my question)
id assume its possible
tho tbh i can see why people havent used packet based books for input
well even non-packet based books
don't seem to be a thing
I can't find any documentation of someone getting a book opened as an input
since 1.8
probably because it makes little sense to use a book for input
most just allow you to click on the book or whatever
Why do you say this? It allows for multiline typing, which is very different from chat or anvil input
afaik you cannot go backwards in a book which means formatting the way the book looks will be nonexistant, also its very unlikely theres a usecase for such long amounts of strings
You can go back pages, just not on the same page
yeah, that's what I ran into a few times
which is why I asked
since I also saw other times that it might be possible
(And I'm way too lazy to open fabric and check on 1.19- that would take forever to decompile)
I guess it probably hasn't changed
tbh if you havent seen anything about it other then on 1.8, perhaps the method hasnt changed since then
can anyone help me pls
no
Uhm if I use a switch() and use lambda with it, aka case "smt" -> {}, after executing the code, does it automatically break the switch? (like in a normal switch where you can use break;)
I always got told it was, what is it then? 👀
That is a switch rule
k ty
One could say it's lambda-like
Someone used velocity api?
(Is it possible to run a command as console?)
similar to Bungeecord and spigot
nvm, i guess its CommandManager#executeAsync (i hope)

New question:
how to register a channel in Velocity?
(Similar to the one used in bungee)
ProxyServer#registerChannel("MyChannel");
Found something but not sure
ProxyServer#getChannelRegistrar().register(ChannelIdentifier)
not sure how to create the ChannelIdentifier
LegacyChannelIdentifier and MinecraftChannelIdentifier implements ChannelIdentifier
for legacy i can create LegacyChannelIdentifier(String name)
but it says:
Represents a legacy channel identifier (for Minecraft 1.12 and below). For modern 1.13 plugin messages, please see MinecraftChannelIdentifier. This class is immutable and safe for multi-threaded use.
So I guess i need to register both? One with Legacy and other with MinecraftChannelIdentifier?
if you want to support both sets of versions, I suppose?
Question is how to create the instance of MinecrafTchannelIdentifier
static MinecraftChannelIdentifier create(String namespace, String name)
you got it
static MinecraftChannelIdentifier forDefaultNamespace(String name)
not sure tbh what whould i use for namespace
i mean, "name" i guess its what getId() returns when listening to plugin message event
default namespace is the minecraft namespace, you are not Minecraft
then how to choose the namespace
the namespace would be your plugin id/name
in PluginMessageEvent i'm checking e.getIdentifier().getId()
not sure which one (namespace or name) should i use for the specific one
in spigot it used to be: bungeeaddon:main
both? check that it's from your plugin (your namespace) and that the id corresponds to whatever you set
that means i'll need to check instancee of MinecraftChannelIdentifier?
since PluginMessageEvent#getIdentifier returns ChannelIdentifier only
ChannelIdentifier::getId returns the whole string, namespace::key
mmmm
that means if my channel (in bungeecord) used to be
bungeeaddon:main
i need to do it like this
plugin.getProxy().getChannelRegistrar().register(new LegacyChannelIdentifier("bungeeaddon:main"));
plugin.getProxy().getChannelRegistrar().register(MinecraftChannelIdentifier.create("bungeeaddon","main"));```

I never touched the legacy stuff so go find out

I am tracking when a player equips armor, and if I pick up and place the item slowly, it registers as an event and I can track it, but if I do it as quick as I can it doesnt register and it doesnt trigger the event, yet the player is wearing the armor. Is there something I can do to fix this?
ArmorEquipLib
all I am seeing is an outdated version of a ArmorEquipEvent, is that what you are talking about?
it doesnt appear to work on 1.19, I gave it a run and nothing happened. Is there a reason to why my method above wouldnt work?
what did you do?
use it as plugin? shade it? copy it?
it worked in old versions, i dont see why it wouldn't work now
I shaded it
you need to use it
register events, etc
afaik this is not a "shade it" and works thing
you must initiate the class and make sure events are registered
I made it its own plugin, and looking through the source code means that everything is registered properly, and still nothing.
well, time to search for errors or something
i used to use it some while ago and worked perfectly
(at least in that moment)
oh wait
i dont even remember what was the main issue xd
lol
I miskicked the last 4 times in a row I updated the jar in the plugins folder, and instead updated the one in the maps folder (cause I miss click a lot)
it now works

How long can a message be (using plugin message system)?
so apparently Set.copyOf can magically disguise objects as other objects
which you won't realize until you actually try to use a method or something which doesnt exist
although maybe the real blame falls on the silly json-simple json parser i'm using
What
That doesn’t make sense at all
i think it's probably the thing i was copying that provided that opportunity, which was a JSONArray from JSON.simple
which in theory is just an extended arrayList of objects
it saved to my Set<UUID> perfectly fine but if i looped through and called getClass on the members they each returned String
Did you use an unchecked cast somewhere?
not really a cast but the only weird line was
Set<UUID> memberSet = Set.copyOf(members);
where members was not a collection of UUID
What’s the static type of members?
after i replaced this line for
Set<UUID> memberSet = new HashSet<>();
for(Object member : members) {
memberSet.add(UUID.fromString((String)member));
}
my problems were solved
but they both compiled 🤷♂️
Oh yeah if it extends ArrayList as a raw type, the type inference might misbehave
Best to throw that lib away then I guess lol
yeah it's a bit more scuffed than i expected
https://paste.md-5.net/isililolip.java
Som1 know how i can made it work ?
I want to display 5 member of the player faction (in different placeholder)
Its detected but the placeholder doesnt work
Is there any way to know the javascript processes? I want to know if this is a potential lag / crashing exploit
what? all i can say is js is slow
javascript somehow has become fast with the right engine
because google has a lot of motivation to make javascript as fast as possible for chrome
but I doubt you are using the right engine on java to run javascript fast
why do I feel like this is a question about the js expansion xD
You should be able to see javascript code execution with spark though
if there's a performance issue it will be shown on the regular graphs
https://paste.md-5.net/erixipimip.java
som1 know why the placeholder doesnt work ?
its detected by papi
but it doesnt work
getIdentifier example: player
U don't put ur entire placeholder in it
That's what the parameter is for
Do you have an example of that pls ?
ok np
@Override
public String onPlaceholderRequest(Player player, String identifier) {
FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player);
if (fPlayer == null) {
return "";
}
List<String> memberList = fPlayer.getFaction().getFPlayers().stream().map(FPlayer::getName).limit(5).collect(Collectors.toList());
int index;
try {
index = Integer.parseInt(identifier);
} catch (NumberFormatException e) {
return "";
}
return index > 0 && index <= memberList.size() ? memberList.get(index - 1) : "";
}
Is this good ?
U gotta change getIdentifier
Ex %identifier_params%
So for %player_name%, the identifier would be player
the identifier should not contain underscores
I dont understand what i need to change ? the String identifier ?
Ctrl F "getIdentifier"
oh ok
No, because identifier would only be the first part (factions)
okk
%identifier_params%
Yep!
And this should work ?
Not yet
in your onPlaceholderRequest
check if the identifier is "members"
then return the members
https://paste.md-5.net/wohalapisu.java
Like this ?
sure but what is this bit on the bottom here
int index = 0;
try {
index = Integer.parseInt(identifier);
} catch (NumberFormatException e) {
return "";
}
Do i need to remove this ?
https://media.discordapp.net/attachments/736631083185078302/1074752396074438778/image.png
cuz its still not working
its for view the integer can be convert in int
They said it was to avoid an error.
are you sure there's not another expansion with the same identifier?
in that case, the identifier param will be "member_1", not "member"
split by underscore
or some other delimiter
so when you say
i can try to change the identifier
but i use factionsuuid and the identiif is %factionsuuid_
if (identifier.equals("members")) {
return String.join(", ", memberList);
}
wtf
do i change member by the identifier?
- your getIdentifier(), which is "factions"
- your onPlaceholderRequest(Player player, String identifier)
to make it easier, change the second "identifier" to "params"
onPlaceholderRequest(Player player, String params)
@Override
public String onPlaceholderRequest(Player player, String params) {
FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player);
if (fPlayer == null) {
return "";
}
List<String> memberList = fPlayer.getFaction().getFPlayers().stream().map(FPlayer::getName).limit(5).collect(Collectors.toList());
if (params.equals("members")) {
return String.join(", ", memberList);
}
int index = 0;
try {
index = Integer.parseInt(params);
} catch (NumberFormatException e) {
return "";
}```
Like this ?
yeah, now your params will come as a string such as "members_5"
so you cannot just say params.equals("members")
so if i build its suppose to work ?
no
oh ok
what the difference beetween params and and identifier ?
identifier is what PlaceholderAPI uses to determine which plugin to request the placeholder from
so your plugins identifier is "factions"
so what should i put ? factions_members ?
%factions_members_5%
so your method takes in params "members_5"
I assume you want to display 5 members of factions then
yep
so i should put the _5 as param
and the identifier as factionsmember
so
%factionsmember_5%
?
well... i guess that would work, if the only placeholder of your plugin is gonna be for listing factions members
is that right?
yep
But now what i put in the if ? cause the params cant just be 5 it can be 1 2 3 4 or 5
if (params.equals("members")) {
return String.join(", ", memberList);
} (here)
So i remove the if ?
or i just change the () by (int numMembers = Integer.parseInt(params);)
yeah, you won't really need an if if you do it that way
@Override
public String onPlaceholderRequest(Player player, String params) {
FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player);
if (fPlayer == null) {
return "";
}
try {
int numMembers = Integer.parseInt(params);
List<String> memberList = fPlayer.getFaction().getFPlayers().stream().map(FPlayer::getName).limit(numMembers).collect(Collectors.toList());
} catch (NumberFormatException e) {
return "";
}
}
something like that
okk
limit the stream to numMembers specified
i forgot to return anything
inside the try, just return memberList joined by ", "
okk
try {
int numMembers = Integer.parseInt(params);
List<String> memberList = fPlayer.getFaction().getFPlayers().stream().map(FPlayer::getName).limit(numMembers).collect(Collectors.toList());
return String.join(", ", memberList);
} catch (NumberFormatException e) {
return "";
}
}````
like this ?
i try this rn https://paste.md-5.net/apidizeqem.java
working !
nice!
hey
hey
hey
hey
hey
hey
hey
hey
hey
hey
yeh
Is there anyone who can help me to work on the Upwork.com?
I will appreciate for it if you help.
hey
hey
hey
what does not work mean
Not compiling
IIRC this is the same guy that doesn’t use an IDE and has syntax errors
I use github.dev sometimes, as I'm currently using it right now
That's not really an IDE
It's basically online visual studio
Yeah I'm aware of what it is, but it doesn't have all the features a modern IDE has.
Code completion for one is lost and that's a rather big feature.
It does have it
It has some partial completions, yes
Oh apparently you can install extensions, now that's interesting
@stuck hearth Should I start with plugin forks, to then make my own custom-coded plugins?
A few, like code beautifier
If you understand basic (I'm assuming java) principles then I would start with a small plugin that reinforces some of those concepts.
Maybe make a spawn-protection plugin?
Should include a timer, permission checks, and maybe a command or two. It wouldn't be a bad start I don't think.
I'm focusing on 1.8.8 Practice PvP right now
I don't support or play 1.8 let alone PvP, so if you want context from me you're SOL
How do I use toString?
I did google it
But the results didn't really tell me anything
Can I use it like this?
That's part of what I'm talking about in reference to the IDE helping you.
Also it would be worth watching a few java videos before diving into plugins directly.
I use github.dev, and I don't have alot of storage.
Uninstall some games
I refuse to believe you don't have 15GB left on your computer
I only have Minecraft, and I have 64GB storage in total
what is the type of winningParticipant
Oh you can't even run and debug in the web editor either?
Are you using a mobile phone?
I use Github Actions
No, a really bad Laptop.
Interesting
Ok..
sounds like you have an upgrade path
Eclipse 🙃
O Intel celeron
Maybe
I've never used vsc so idk
It's not an ide tho so keep that in mind
One of the worst
Technically text editor iirc
The java extension pack is enough to turn it into an ide
An Intel Core i3 from the generation before, is legit 4x faster than my Intel Celeron n3060
I keep getting the
Could not execute entrypoint stage 'main' due to errors, provided by 'more-mushrooms'! error when I try to start mc with my fabric mod, i have no clue why and cant really find much online
And my laptop costed 400 bucks
Alright, thank you!
Oh
https://discord.gg/sponge invite sent by @stuck hearth
Ayy, ^ They can help with mixin related questions as well since they maintain mixin
Hey
Hey
I'm decompiling a plugin of a popular server, and I managed to get it compiled
But the plugin files don't show up in the jar file
Can someone help me?
Doesn't have auth
💀
I just want to change a few things, to use on my private server
From a leak LOL
they didn't pay a dev (or atleast that's what I heard), so their full server files got leaked
Yikes
anyone know how to make addon bloks that its a new item ? java
doesn't mean you can just steal their shit?
@spiral prairie I won't just steal their shit
but you are
You literally said you did
I'm just tryna get it compiled
ah you wont just steal their shit, you will try to modify it and take the credit, got it
I don't usually compile things I don't intend to use
And that was
Nop
what in the actual hole of assassins creed fuck don't you understand about stealing something
I'll use it privately, and WILL give credit
do you have their permission
No, but I'll ask before actually using it
I'm going to steal a car, but don't worry, I'll give credit to the owner and say it was theirs originally
It actually is
you are
akchually since spigot is gplv3 licensed then any plugins that use it also fall under the license and should be free for public use 🤓
What I'm really thankful for is when Emily said this was unproductive.
It really shifted the mindset of the chat from talking into a full production environment.
yeah
