#development

1 messages · Page 37 of 1

mental cypress
#

Procing might create tmp files.

icy shadow
#

uh

#

i think that might just be you

#

it doesnt for me on any OS

hoary scarab
#

Its only on 2 lines which is weird

mental cypress
#

Font loading creates tmp file 🥲

hoary scarab
#

Handshake and StatusPingResponse

mental cypress
#

Lord I still remember that Disk IO leak I had from that.

icy shadow
#

i didnt copy all the code, just replicated the bit you sent

hoary scarab
#

Its caused by that bit for me. But yeah pretty sure glare is right and its just not deleting the temp file

icy shadow
#

that doesnt make sense

minor summit
#

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

icy shadow
#

yeah

#

or anything

hoary scarab
minor summit
#

I never said they were named that

hoary scarab
#

My bad.

wraith trail
#

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

Code: https://paste.helpch.at/nozateqije.js

minor summit
#

You are posting to pastes.dev but trying to use the location on paste.helpch.at, lol

#

@wraith trail

wraith trail
#

omfg

#

why do i do this to myself

minor summit
#

lmao

#

it happens

signal grove
#

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?

river solstice
#

(forgive me for my beautiful JS code)

dusky harness
river solstice
#

forgor 💀 to delete the message

spiral prairie
#

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)`
floral beacon
#

someone?

dense drift
north robin
#

oh shoot wrong channel

old gale
dense drift
#

publish the code

old gale
#

I can do that but what if someone uploads a jar that is different from the source code?

dense drift
#

We are not checking only the source, but also the jar. The source code needs to be public though.

dense drift
#

Yeah

#

You should override persist() and return true, and fyi, the expansion will only work for online players

old gale
#

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

dense drift
#

Hmm, actually I don't know about that. But iirc if you reload papi, the expansion won't be loaded

river solstice
#

Db calls in onRequest 💀

#

Good way to kill the server

old gale
#

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

minor summit
#

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

dense drift
#

I'm trying to understand how this works

tough kraken
#

Hey guys I just added to the server and I got some errors, could I send the picture somewhere?

old gale
tough kraken
#

but from where do I start?

tough kraken
#

Oh I found my error is ''Could not hook into PlaceholderAPI!''

dense drift
tough kraken
#

Yea but is there any tutorial regarding this papi installation?

dense drift
#

it is just a plugin

old gale
#

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

dense drift
#

The offline player support is up to you, I just mentioned that.

old gale
#

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

dense drift
#

I see

old gale
dense drift
#

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

old gale
#

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

dense drift
#

that's weird, I don't recall having problems with getting offlineplayers

old gale
#

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

dense drift
#

that's more than 24h kek , 7th of March is next month

old gale
#

oh

#

30 day then

#

thats a little bit better

dense drift
#

yeah and I guess after that it uses the mojang api or some shit

old gale
#

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

old gale
#

hmm. ehh. im not sure actually

minor summit
#

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

old gale
#

so then OfflinePlayer is still not safe to use?

dense drift
#

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

minor summit
#

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

old gale
#

why... this is such a bad idea on Bukkit's end

minor summit
#

I think there is a getOfflinePlayerIfCached? that doesn't query mojang

dense drift
#

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.

dense drift
minor summit
#

no clue

dense drift
#

d;Bukkit#getofflineplayer

uneven lanternBOT
#
@NotNull
public static OfflinePlayer getOfflinePlayer(@NotNull UUID id)```
Description:

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.

Returns:

an offline player

Parameters:

id - the UUID of the player to retrieve

old gale
#

getOfflinePlayerIfCached is not in spigot-api

dense drift
#

d;paper-1.18 Bukkit#getOfflinePlayerIfCached

uneven lanternBOT
#
@Nullable
public static @Nullable OfflinePlayer getOfflinePlayerIfCached(@NotNull @NotNull String name)```
Description:

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.

Returns:

an offline player if cached, null otherwise

Parameters:

name - the name of the player to retrieve

minor summit
#

you missed the if cached part but ok

dense drift
#

I know, I was hoping it will bring that method as well xD

old gale
#

or maybe it was added? it's not in spigot-api 1.13.2

dense drift
#

it is paper only, as usual

old gale
#

ah

dense drift
#

I would say that using Bukkit#offlinePlayer will be fine

old gale
#

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)

minor summit
#

that's 25% too little for many to care about supporting

dense drift
#

yup

old gale
#

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

dense drift
#

in the end, you or another plugin will use the mojang api, so there's nothing to worry about imho

old gale
#

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

dense drift
#

and the mojang api will be used only for very inactive players once every 30d after the cache expires

old gale
#

yeah fair enough

dense drift
#

once a player has joined the server once, their data will remain in world data though, right? @minor summit

old gale
#

and if you have to query mojang api once it's not so bad, probably wont skip the tick

minor summit
#

yes

old gale
#

but if you do a few at once, RIP tick rate

dense drift
old gale
#

there is also the issue of bungeecord servers

dense drift
#

yeah idk about that, there's maybe some global cache provided by bungee?

old gale
#

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

dense drift
#

tl-dr; you should be fine with offlineplayers

old gale
#

The result of 17-year-old obsessing over annotations and layers of abstractions

dense drift
#

hmm, I see, I was expecting smth. Maybe velocity?

minor summit
#

neither

#

they don't have a reason to store profile data

dense drift
#

alright

old gale
#

this is why I started storing "lastName" with my own playerdata

#

problem is, that data is also not loaded for offline players 🥲

old gale
#

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

dense drift
#

can you try both, name and uuid?

minor summit
#

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

dense drift
#

what happens if you use uuid though?

minor summit
#

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)

dense drift
#

hmm, interesting and annoying at the same time xD

old gale
#

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

old gale
wary spindle
#

Hey

#

I have a question

neat pierBOT
#

There is no time to wait! Ask your question @wary spindle!

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

little summit
#

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

river solstice
#

tell, usually it tells the line number, where the expection occurred

little summit
#

woops wrong case

little summit
#

@river solstice

proud pebble
proud pebble
little summit
#

oh.

proud pebble
#

also instead of doing &x&f&f&7&5&1&2 you can do ChatColor.of("#FF7512")

#

makes it much more readable

little summit
#

when was that added?

#

nvm i can just check

forest jay
#

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

spiral prairie
#

Is ItemStack#getLore() nullable?

broken elbow
spiral prairie
#

alrighty

dense drift
#

Null means no lore (default), and an empty list means an empty lore iirc
There's a comment about this in CraftItemMeta

signal grove
#

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

forest jay
#

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.

nova moth
#

hey i was trying to see can yall help me with gta rp

spiral prairie
#

no

signal grove
forest jay
warm steppe
#

and bungee expansion

#

and then do /papi reload

crimson summit
#

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

warm steppe
#

also wrong channel

little summit
#

atleast in spigot

#

oh it uses bungee

proud pebble
dense drift
#

No you dont

#

But is better to use adventure 🙂

proud pebble
#

i had to consult my own plugin and your right you dont

#

i dont know why i thought you had to

little summit
proud pebble
#

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

runic crown
#

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

proud pebble
#

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

proud pebble
proud pebble
#

like they cant just shade it

dense drift
#

I don't get what you mean

#

We always shade libraries

proud pebble
#

am i missing something?

#

shading is using an api without including it in the actual jar?

runic crown
#

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();`

proud pebble
#

so your plugin isnt 43mb in size

dense drift
#

Thats what shading means

#

Downloading libraries at runtime is different

#

But there's no problem with shading adventure to use a proper component system

proud pebble
#

paper does

dense drift
#

So what

runic crown
proud pebble
#

you will have errors running the plugin if its ran on spigot

dense drift
#

You probably are talking about the native support of paper

proud pebble
#

yes

#

like adventure will work on spigot, as long as its included in the plugin jar

dense drift
#

Ok, you can use adventure-platform-bukkit to send components trough a helper class

proud pebble
runic crown
proud pebble
# runic crown and in what?

the javascript engine that is currently selected isnt compatible with your java version or something like that

#

theres multiple engines

proud pebble
# dense drift Thats perfectly fine

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

runic crown
proud pebble
#

theres some list somewhere

dense drift
proud pebble
#

i wasnt considering it a problem

#

i was just saying what you would have to do to use adventure

proud pebble
proud pebble
proud pebble
#

1.4.1 is an old javascript engine version

#

or maybe its just the config hasnt been updated

#

well

#

you see there

neat pierBOT
#
📋 Your paste: Mrkiller
https://paste.helpch.at/hameqemulu

A member of staff has requested I move your message to a paste,
Most likely because it contains a config/error/code snippet.

proud pebble
#

where it says engine:

#

instead of nashorn, change it to quickjs

broken elbow
#

engine: has not been a thing in the javascript expansion for some time. try updating

proud pebble
#

does it autodetect what engine to use?

#

so you no longer have to figure it out

runic crown
#

серавно
`# 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

proud pebble
#

download new version of javascript here

runic crown
#

where do I put it in plugins?

proud pebble
#

you put it in the expansions folder

runic crown
#

did

runic crown
#

right, I forgot to register the plugin

#

thanks for helping 🙂

runic crown
#

I did it, but now I have to constantly write papi register Javascript-Expansion-2.1.2.jar after restarting the server
@proud pebble

little summit
#

got an error message, any1 got an idea on what it could be? it doesn't seem to be a problem with my plugin.

neat pierBOT
little summit
#

i have never used length() in my plugin, nor had a input variable.

spiral prairie
neat pierBOT
little summit
#

ok wait hold on cause discord when using ./paste

spiral prairie
#

please go to the site directly

little summit
#

is bad

spiral prairie
#

yeap lol

little summit
spiral prairie
#

title is null

little summit
#

title = config.getString("scoreboard.title");

spiral prairie
#

yup

little summit
#

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

spiral prairie
#

¯_(ツ)_/¯

runic crown
#

I did it, but now I have to constantly write papi register Javascript-Expansion-2.1.2.jar after restarting the server

spiral prairie
#

try to print it

little summit
#

sure

#

lemme see now

#

oh i got it, didnt create the scoreboard.yml at all maybe thats why

spiral prairie
#

yeah that could be it

little summit
#

no wait i meant that the plugin doesn't put scoreboard.yml into the data folder

#

no idea why

spiral prairie
#

yeah you gotta do it yourself

little summit
#

commented out the code

#

💀

spiral prairie
#

💀

#

happens

proud pebble
#

./version PlaceholderAPI

runic crown
#

the latest

lyric gyro
#

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.

torpid raft
#

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

torpid raft
#

try that

#

lmk if you can do it

#

because i have not been able to

dense drift
torpid raft
#

so you have to specify Vault-1.2.jar or whatever or else it wont work

dense drift
#

yeah 😦

torpid raft
#

it's still doable though

#

the only major hiccup is the cloudflare

dense drift
#

nah, the name is on the update details

torpid raft
#

you can't get the update details without passing the check first tho

dense drift
#

yeah ik what you mean

torpid raft
#

;-;

#

someone should make spiget but bukket

minor summit
#

modrinth 😌

dense drift
torpid raft
#

oh i saw coreprotect uses modrinth

dense drift
#

yup, is pretty great tbh

grim oasis
#

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() 😭

dense drift
#

welcome to obfuscated code

grim oasis
#

ik lmao

#

lovely stuff

dense drift
#

that's why I use NBT API

grim oasis
#

seems that that's more recent

#

ya, I do too for checkitem

#

lmao

lyric gyro
#

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);

dense drift
#

new BaseBlock(BlockTypes.AIR.getDefaultState()) this is what I use

dense drift
dusky harness
#

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 :/

proud pebble
#

using nbtapi would probably be best

grim oasis
grim oasis
proud pebble
#

using screaming sandels is the best way to figure out wtf half the obfuscated named are

crimson portal
#

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

grim oasis
#

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)

forest jay
proud pebble
lyric gyro
# little summit any1 can find the problem? Just this part is important, that's what is in the e...
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

lyric gyro
#
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?

elder pelican
#

Hey, can i try for myself to make the plugin Guilds to claim chunks instead of radius ? Do i have the permission ?

lyric gyro
dense drift
broken elbow
elder pelican
#

anyways i think i managed to do it

#

not for reselling or sharing

#

just for having some fun

broken elbow
#

if it works open a PR and see what glare thinks. He might end up merging it

#

you never know

lyric gyro
elder pelican
#

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

little summit
dense drift
#

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?

dusty frost
#

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

dense drift
#

yeah I do that and then load the User object for all online players

sterile hinge
fiery pollen
#

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

minor summit
#

how much time does that graph span?

fiery pollen
#

I think about 60s

minor summit
#

and how much memory does that represent?

fiery pollen
#

At the peek: 2.2Gb and at the bottom: 480mb

forest jay
tiny nebula
#

I get that all the time as well

#

There's my RAM Tsunami

fiery pollen
runic crown
#

[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.

shell moon
#

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

hoary scarab
hoary scarab
#

Nope

dusky harness
#

shouldn't it be a loadbefore?

#

not a softdepend

#

because LuckPerms and PlayerPoints would be (soft)depending on PAPI

forest jay
dusty frost
dusky harness
#

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

#

🥲

dusty frost
#

yeah lol

hoary scarab
#

And its also softdepend so the plugins don't have to be loaded. Unless placeholderapi actually depends on their methods lol

supple aurora
#

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)

warm steppe
#

InventoryClickEvent

#

or InventoryInteractEvent

supple aurora
warm steppe
#

what are you trying to achieve?

supple aurora
#

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 ?

warm steppe
#

probably, yeah

signal grove
proud pebble
#

depending on which hand it is

#

or do what heklo suggested since that would always get the item from the correct hand

supple aurora
# signal grove you shouldn't be checking the slot, because the event hasnt happened on the serv...

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 ?

minor summit
#

no

#

I mean eventually if you schedule 3000000000 at once yes that will impact performance

#

but that will never happen

hoary scarab
signal grove
#

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()

proud pebble
#

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

signal grove
#

^

runic crown
hoary scarab
sudden sand
spiral prairie
#

What are you trying to do??!?!?

#

You're trying to write java in a kotlin file, that obviously won't work

icy shadow
#

groovy* not kotlin

#

and groovy* not java

#

lol

sudden sand
#

It's not my project obviously, how did the dude used it with gradle ?

spiral prairie
spiral prairie
sudden sand
spiral prairie
#

Yeah well

#

Think about it

#

You're using Kotlin/Java code in a Groovy gradle file

#

That no worky

icy shadow
#

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

sudden sand
# icy shadow

I deleted this piece of code and it seems to at least give me decent errors

#

Ok the errors are related to something else

icy shadow
#

deleting code is generally not gonna fix it lmao

sudden sand
#

Thanks for your precious help Brister Mitten

icy shadow
#

uh

sudden sand
#

x)

icy shadow
#

okaky

#

if you say so

torpid raft
#

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

dense drift
#

perhaps the messages like the ones sent after you use F3+H? (advanced tooltips enabled/disabled)

torpid raft
#

ooh that could be it i guess

#

maybe messages like those dont require verification in the newer versions?

dense drift
#

I don't see why they would

dusky harness
torpid raft
#

yeah that would make sense

dusty frost
#

also conveniently what all chat messages are if you disable chat reporting 🙂

tired olive
#

Groovy is a suoerset of java

spiral prairie
#

Last time I checked it didn't work

stuck hearth
#

You can't write java code in a different JVM language and expect it to work

runic crown
#

`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!

dense drift
#

ask the developer of univeralmines to update his code

runic crown
#

lando -_-

#

ladno*

dense drift
#

🙂

hoary scarab
robust flower
#

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?

floral beacon
#

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...

minor summit
sly spindle
#

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?

minor summit
#

use tmux?

#

idk lol

torpid raft
#

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

forest jay
#

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?

hoary scarab
forest jay
#

but then how does the player pick it up again?

#

or actually

#

doesnt that send a player pickup item packet?

hoary scarab
#

It will send a pickup packet to the server

forest jay
#

since the client thinks there is a item there

#

yeah

stable sorrel
#

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!!

past ibex
#

pterodactyl or what

stable sorrel
#

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

past ibex
stable sorrel
#

max ram is 24gb and my partner did the recommended that ptero ask for

past ibex
#

so what did you assign

stable sorrel
#

again idk we are using 18gb for our servers

past ibex
#

servers?

#

multiple?

stable sorrel
#

i run 2 server for one machine

past ibex
#

what does each server get

stable sorrel
#

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

past ibex
#

my guess is that xmx is set to close to container limit

stable sorrel
#

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.

warm steppe
#

Try disabling placeholderapi

stable sorrel
warm steppe
#

Stop the cap

stable sorrel
#

when papi is off ram stays very stable at 3.5gb

stable sorrel
stuck hearth
#

Wym, they talked pretty clearly right there

dense drift
dense drift
#

If you use that, nashorn shouldn't cause any problems

#

Do you have spark installed?

stable sorrel
stable sorrel
#

pls tag me on papi channel 🙂

uneven herald
#

can anyone recommend me a good tutorial on how to create custom 3d items

#

for 1.19.3

dense drift
#

No, wrong channel @uneven herald

cinder hare
#

Is there an alternative to thread.sleep? Because that freezes my whole server

dense drift
#

What are you trying to do?

cinder hare
#

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());
}

dense drift
#

use Bukkit#getScheduler

#

and make a custom task that is cancelled after 10 runs

cinder hare
#

is each run 1 second?

#

what

wheat carbon
#

i think docdex is broken

#

it's not under maintenance

#

keeps turning itself off

dense drift
#

yeah is been like that for a while I think

#

or at least every time I've wanted to use it recently xD

cinder hare
#

do i just make a function using the scheduler and run it in my code?

#

I don't understand

dense drift
cinder hare
#

public boolean runTask(@NotNull Plugin plugin) throws IllegalArgumentException,IllegalStateException{
return false;
}

#

so something like this?

dense drift
#

Where is that from?

#

Extend BukkitRunnable not BukkitScheduler

cinder hare
#

i don't know what that means

cinder hare
neat pierBOT
#
FAQ Answer:

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!

dense drift
#

Do this first before jumping into spigot

cinder hare
#

I understand, but i usually just figure out programming through trial and error

warm steppe
#

you still have to know at least some java to start trialing and erroring

#

so go and learn dude

cinder hare
#

Yeah i found out what he meant i understand now

cinder hare
#

new BukkitRunnable(){
@Override
public void run() {
player.sendMessage("Loop ran);
}
}.runTaskTimer((Plugin) this,0L, 20L);

Does anyone know why this doesn't work?

hoary scarab
cinder hare
#

it's from inside a different script

#

it's inside the command handler

cinder hare
# hoary scarab Show the full code. That code alone looks right but we don't know if you're prop...

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;
}

hoary scarab
cinder hare
#

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(){

hoary scarab
#

Whats the error? You just said it didn't work lol

cinder hare
#

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)

hoary scarab
#

Show me your imports

cinder hare
#

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?

river solstice
#

He is passing and casting CommandHandler class for the scheduler to a JavaPlugin

#

💀

cinder hare
#

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

river solstice
#

Why was it tracercumpiss before the edit 💀

cinder hare
#

that's the project name

#

ignore that

sterile hinge
river solstice
#

Ok

#

Me too

#

Lots of them

shell moon
#

you dont use (Plugin) this

cinder hare
#

yeah

shell moon
#

you use the instance of your plugin

cinder hare
#

i was assuming

#

that was the issue

#

it just didn't give me an error

#

so i thought it was okay

shell moon
#

xD

cinder hare
shell moon
hoary scarab
#

thanks for explaining instead of laughing at me
This isn't spigot's discord LMFAO

hard wigeon
#

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

proud pebble
#

id assume yes, it would be something like how packet based signs work

hard wigeon
#

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)

proud pebble
#

id assume its possible

#

tho tbh i can see why people havent used packet based books for input

hard wigeon
#

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

proud pebble
#

probably because it makes little sense to use a book for input

#

most just allow you to click on the book or whatever

hard wigeon
proud pebble
dense drift
hard wigeon
hard wigeon
#

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

proud pebble
#

tbh if you havent seen anything about it other then on 1.8, perhaps the method hasnt changed since then

brittle mortar
#

can anyone help me pls

spiral prairie
#

no

worn jasper
#

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;)

minor summit
#

that's not a lambda

#

but yes

worn jasper
minor summit
#

That is a switch rule

worn jasper
#

k ty

stuck hearth
#

One could say it's lambda-like

shell moon
#

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)

minor summit
#

congratulations on your researching abilities

#

you are correct

shell moon
#

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?

minor summit
#

if you want to support both sets of versions, I suppose?

shell moon
#

Question is how to create the instance of MinecrafTchannelIdentifier

#

static MinecraftChannelIdentifier create​(String namespace, String name)

minor summit
#

you got it

shell moon
#

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

minor summit
#

default namespace is the minecraft namespace, you are not Minecraft

shell moon
#

then how to choose the namespace

minor summit
#

the namespace would be your plugin id/name

shell moon
#

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

minor summit
#

both? check that it's from your plugin (your namespace) and that the id corresponds to whatever you set

shell moon
#

that means i'll need to check instancee of MinecraftChannelIdentifier?

#

since PluginMessageEvent#getIdentifier returns ChannelIdentifier only

minor summit
#

ChannelIdentifier::getId returns the whole string, namespace::key

shell moon
#

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"));```
minor summit
#

I never touched the legacy stuff so go find out

shell moon
forest jay
#

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?

shell moon
#

ArmorEquipLib

forest jay
shell moon
#

yes, kinda

#

you can implement it in your plugin

#

make modifications and listen to it

forest jay
# shell moon yes, kinda

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?

shell moon
#

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

forest jay
#

I shaded it

shell moon
#

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

forest jay
#

I made it its own plugin, and looking through the source code means that everything is registered properly, and still nothing.

shell moon
#

well, time to search for errors or something

#

i used to use it some while ago and worked perfectly

#

(at least in that moment)

forest jay
#

oh wait

shell moon
#

i dont even remember what was the main issue xd

forest jay
#

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

shell moon
shell moon
#

How long can a message be (using plugin message system)?

torpid raft
#

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

tired olive
#

What

sterile hinge
#

That doesn’t make sense at all

torpid raft
#

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

sterile hinge
#

Did you use an unchecked cast somewhere?

torpid raft
#

not really a cast but the only weird line was

Set<UUID> memberSet = Set.copyOf(members);
#

where members was not a collection of UUID

sterile hinge
#

What’s the static type of members?

torpid raft
#

JSONArray

#

it extends ArrayList

#

it has no generics or at least none i can see

torpid raft
#

but they both compiled 🤷‍♂️

sterile hinge
#

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

torpid raft
#

yeah it's a bit more scuffed than i expected

bronze cipher
#

Its detected but the placeholder doesnt work

dusk crypt
#

Is there any way to know the javascript processes? I want to know if this is a potential lag / crashing exploit

shell moon
#

what? all i can say is js is slow

past ibex
#

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

dense drift
#

why do I feel like this is a question about the js expansion xD

past ibex
#

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

bronze cipher
#

its detected by papi

#

but it doesnt work

dusky harness
#

U don't put ur entire placeholder in it

#

That's what the parameter is for

bronze cipher
#

Do you have an example of that pls ?

dusky harness
#

Player expansion

#

I'm on phone

bronze cipher
#

ok np

bronze cipher
# dusky harness I'm on phone
@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 ?

dusky harness
#

U gotta change getIdentifier
Ex %identifier_params%
So for %player_name%, the identifier would be player

broken elbow
#

the identifier should not contain underscores

bronze cipher
#

I dont understand what i need to change ? the String identifier ?

dusky harness
#

Ctrl F "getIdentifier"

bronze cipher
#

oh ok

dusky harness
#

Then the line below

#

U have to change

bronze cipher
#

so i put %factions_member% instead of only factions_membe

#

?

dusky harness
#

No, because identifier would only be the first part (factions)

bronze cipher
#

okk

dusky harness
#

%identifier_params%

bronze cipher
#
@Override
                public String getIdentifier() {
                    return "factions";
                }```
#

like this ?

dusky harness
#

Yep!

bronze cipher
#

And this should work ?

bronze cipher
#

What i need to change ?

signal grove
#

in your onPlaceholderRequest

#

check if the identifier is "members"

#

then return the members

signal grove
#

sure but what is this bit on the bottom here

#
                    int index = 0;
                    try {
                        index = Integer.parseInt(identifier);
                    } catch (NumberFormatException e) {
                        return "";
                    }

bronze cipher
#

Do i need to remove this ?

bronze cipher
#

They said it was to avoid an error.

dense drift
#

are you sure there's not another expansion with the same identifier?

signal grove
#

in that case, the identifier param will be "member_1", not "member"

#

split by underscore

#

or some other delimiter

#

so when you say

bronze cipher
#

i can try to change the identifier

#

but i use factionsuuid and the identiif is %factionsuuid_

signal grove
#

hang on

#

theres two different "identifiers"

bronze cipher
#

if (identifier.equals("members")) {
return String.join(", ", memberList);
}

#

wtf

#

do i change member by the identifier?

signal grove
#
  1. your getIdentifier(), which is "factions"
  2. your onPlaceholderRequest(Player player, String identifier)
#

to make it easier, change the second "identifier" to "params"

#

onPlaceholderRequest(Player player, String params)

bronze cipher
#
 @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 ?

signal grove
#

yeah, now your params will come as a string such as "members_5"

#

so you cannot just say params.equals("members")

bronze cipher
#

so if i build its suppose to work ?

signal grove
#

no

bronze cipher
#

what the difference beetween params and and identifier ?

signal grove
#

identifier is what PlaceholderAPI uses to determine which plugin to request the placeholder from

#

so your plugins identifier is "factions"

bronze cipher
signal grove
#

also no, the "params" are what comes after the identifier

#

%identifier_params%

bronze cipher
#

ohhh

#

okkk

signal grove
#

%factions_members_5%

#

so your method takes in params "members_5"

#

I assume you want to display 5 members of factions then

bronze cipher
#

yep

#

so i should put the _5 as param

#

and the identifier as factionsmember

#

so

#

%factionsmember_5%

#

?

signal grove
#

well... i guess that would work, if the only placeholder of your plugin is gonna be for listing factions members

#

is that right?

bronze cipher
#

yep

signal grove
#

then the params would be "5"

#

and you can use Integer.parseInt

bronze cipher
#

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)

signal grove
#

right, so youd say something like

#

int numMembers = Integer.parseInt(params);

bronze cipher
#

So i remove the if ?

#

or i just change the () by (int numMembers = Integer.parseInt(params);)

signal grove
#

yeah, you won't really need an if if you do it that way

bronze cipher
#

so like this ?

signal grove
#
                @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

bronze cipher
#

okk

signal grove
#

limit the stream to numMembers specified

#

i forgot to return anything

#

inside the try, just return memberList joined by ", "

bronze cipher
#

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 ?

#

working !

grim oasis
late wyvern
#

hey

forest jay
#

hey

minor summit
#

hey

shell moon
#

hey

torpid raft
#

hey

stuck hearth
#

hey

edgy lintel
#

hey

tired olive
#

hey

fiery pollen
#

hey

spiral prairie
#

hey

dense drift
#

yeh

static linden
#

Is there anyone who can help me to work on the Upwork.com?
I will appreciate for it if you help.

river solstice
#

hey

forest jay
#

hey

spiral prairie
#

hey

wary spindle
#

Hey

#

Can you guys help me identify why my code changes made my plugin not work?

spiral prairie
wary spindle
spiral prairie
#

you just ripped the toString out?

#

have you even used an IDE to do this?

signal grove
#

IIRC this is the same guy that doesn’t use an IDE and has syntax errors

river solstice
#

💀

#

Windows Notepad masterrace

signal grove
#

Yeah

wary spindle
stuck hearth
#

That's not really an IDE

wary spindle
stuck hearth
#

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.

wary spindle
#

It does have it

stuck hearth
#

It has some partial completions, yes

#

Oh apparently you can install extensions, now that's interesting

wary spindle
#

@stuck hearth Should I start with plugin forks, to then make my own custom-coded plugins?

wary spindle
stuck hearth
wary spindle
#

I'm focusing on 1.8.8 Practice PvP right now

stuck hearth
#

I don't support or play 1.8 let alone PvP, so if you want context from me you're SOL

wary spindle
#

How do I use toString?

#

I did google it

#

But the results didn't really tell me anything

#

Can I use it like this?

torpid raft
#

no

#

you call toString on objects

#

myCat.toString()

stuck hearth
#

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.

wary spindle
#

How about this?

#

.toString, winningParticipant)

torpid raft
#

🥴

#

what is that

dense drift
#

Looks about fine

#

What if you download an IDE and watch some tutorials or something?

wary spindle
dense drift
#

Uninstall some games

wary spindle
dense drift
#

I refuse to believe you don't have 15GB left on your computer

wary spindle
torpid raft
#

what is the type of winningParticipant

stuck hearth
#

Oh you can't even run and debug in the web editor either?

dense drift
#

Are you using a mobile phone?

wary spindle
wary spindle
stuck hearth
#

Interesting

dense drift
#

Ok..

wary spindle
#

A 200$ TV's CPU is legit faster than my Laptop's CPU

#

My CPU: Intel Celeron n3060

torpid raft
#

sounds like you have an upgrade path

dusky harness
#

Eclipse 🙃

dense drift
#

Yeah

#

Or vsc with the java extension pack

dusky harness
#

O Intel celeron

dusky harness
dense drift
#

It works fine

#

I hate it, but it works

dusky harness
#

It's not an ide tho so keep that in mind

wary spindle
dusky harness
#

Technically text editor iirc

dense drift
#

The java extension pack is enough to turn it into an ide

dusky harness
#

Oh ok

#

That's pretty neat

wary spindle
#

An Intel Core i3 from the generation before, is legit 4x faster than my Intel Celeron n3060

cunning geyser
#

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

wary spindle
#

And my laptop costed 400 bucks

cunning geyser
#

Alright, thank you!

stuck hearth
#

Oh

dense drift
stuck hearth
#

Ayy, ^ They can help with mixin related questions as well since they maintain mixin

wary spindle
#

Hey

torpid raft
#

Hey

wary spindle
#

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?

spiral prairie
#

youre what?

#

you need help with pirating?

wary spindle
stuck hearth
#

💀

wary spindle
#

I just want to change a few things, to use on my private server

spiral prairie
#

piracy, innit?

#

or where did you get it?

wary spindle
#

From a leak LOL

spiral prairie
#

lol

#

well thats no helpy

wary spindle
#

they didn't pay a dev (or atleast that's what I heard), so their full server files got leaked

stuck hearth
#

Yikes

wary spindle
#

And I'm not talking about a small server

#

I'm talking about a big one

jolly kayak
#

anyone know how to make addon bloks that its a new item ? java

spiral prairie
#

doesn't mean you can just steal their shit?

wary spindle
#

@spiral prairie I won't just steal their shit

spiral prairie
#

but you are

stuck hearth
#

You literally said you did

wary spindle
#

I'm just tryna get it compiled

spiral prairie
#

ah you wont just steal their shit, you will try to modify it and take the credit, got it

stuck hearth
#

I don't usually compile things I don't intend to use

minor summit
#

for the love of christ

#

this is unproductive

stuck hearth
#

And that was

spiral prairie
#

what in the actual hole of assassins creed fuck don't you understand about stealing something

wary spindle
spiral prairie
#

do you have their permission

wary spindle
spiral prairie
#

yeah ask now

#

before we help you

leaden sinew
spiral prairie
#

i feel like this is a troll

wary spindle
spiral prairie
#

you are

torpid raft
#

akchually since spigot is gplv3 licensed then any plugins that use it also fall under the license and should be free for public use 🤓

stuck hearth
#

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.

minor summit
#

yeah