#help-development

1 messages ยท Page 1392 of 1

prime nimbus
#

its not for one command, its for all the commands

#

like all the commands of the game

eternal oxide
#

each command should have its own command class

#

but get it working with one first

#

do you have the command in the plugin.yml?

prime nimbus
#

nope

#

its a command from a different plugin

eternal oxide
#

then how do you expect any of this code to run?

#

thats not how commands work

prime nimbus
#

as i said, i have no idea what im doing

#

i wanted to learn it

eternal oxide
#

each plugin handles its own commands and its own tab complete

prime nimbus
#

so im guessing you cant make a plugin the control all of the commands right

rugged topaz
#

getExp returns a float but does that mean that exp could look like 31.121289, or just 31.00?

ivory sleet
#

Yes it could return the former

rugged topaz
#

mkay thanks

flint elk
#

How can I send a player to another server via Spigot?

ivory sleet
#

PluginMessageChannels I think

#

Or no but you need to register an out coming channel then use PluginMessageRecepient I think

flint elk
#

i try it

lunar schooner
#

Hey there, would anyone mind verifying the signature for Bukkit#dispatchCommand for me? I've got (Lorg/bukkit/command/CommandSender;Ljava/lang/String;)Z right now, but it's not liking it

eternal oxide
quaint mantle
#

hey does anybody know the good tutorial about how to hook into vault as new economy plugin as essentials does?

sullen marlin
#

Check the javadocs

#

?jd

lunar schooner
#

The error I'm getting is JavaException, so it's not too helpful there ๐Ÿ˜…

quaint mantle
#

what error you getting

lunar schooner
#

JavaException :"D

sullen marlin
#

That's not an exception I've ever heard of....

quaint mantle
#

but like send the error?

#

that prints in the console

sullen marlin
#

^

lunar schooner
#
>thread '<unnamed>' panicked: JavaException', src/jni/mod.rs:15:123
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
#

Gotta love JNI ๐Ÿ˜„

sullen marlin
#

rust

lunar schooner
#

Yup ๐Ÿ™‚

sullen marlin
#

Well start with a backtrace

lunar schooner
#

So the error seems to not be in the signature, but in my arguments, I'm providing it a org.bukkit.command.ConsoleCommandSender (Aquired from Bukkit#getConsoleSender) and a java.lang.String, so that should be good if Im not mistaken

#

Backtrace would just tell me where the call is coming from, which I already know ๐Ÿ˜„

#

But ill give it a shot ๐Ÿ˜„

sullen marlin
#

Otherwise check line 15?

lunar schooner
#

This would be line 15:

        let command_success = env.call_static_method(bukkit_class, "dispatchCommand", "(Lorg/bukkit/command/CommandSender;Ljava/lang/String;)Z", &[console_sender_object, rec_jstring]).expect("Unable to execute command.");

I already split it out a bit to env.get_static_method_id, that is now succeeding, so the signature should be valid

quiet ice
#

What is bukkit_class?

lunar schooner
#

This would be Bukkit class, so org.bukkit.Bukkit: env.find_class("org/bukkit/Bukkit")

#

Aha, I wrapped the call to Bukkit.dispatchCommand in a try/catch, which I wrapped in my own method, with just a printstacktrace on all Exceptions, java.lang.IllegalStateException: Asynchronous command dispatch!

#

That one explains a lot

solemn shoal
#

is it possible to add a command's permission in plugin.yml so its hidden in /help but not throwing spigot's permission error?

lunar schooner
#

Unfortunate I dont get that kind of exception in the rust stacktrace, just getting JavaException

#

Not sure how to solve that though ๐Ÿค”

quiet ice
#

Obtain the scheduler to call it later?

#

Though that might be a bit complicated to do with JNI

lunar schooner
#

yeah, so I think I'm doing a wrapper method

#
    public static void execCommand(String cmd) {
        try {
            new BukkitRunnable() {
                
                @Override
                public void run() {
                    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), cmd);
                }
            }.runTask(WebServer.plugin);
        } catch(Exception e) {
            e.printStackTrace();
        }
    }
#

Where the catchall for Exception is on purpose, because a catch on exception all is better than a panic in native code, which will crash the JVM

lunar schooner
#

So that works :"D

solemn shoal
#

question

#

does loadbefore accept wildcards?

#

(plugin.yml)

quaint mantle
#

Heyaa
I am making a plugin and I want to read lines and then turn them into cmds (DONE)

public HashMap<String, String> getGifts(String playerName) throws IOException {
        HashMap<String, String> hashMap = new HashMap<>();
        File file = new File(plugin.getDataFolder(), "GiftManager.txt");
        BufferedReader br = new BufferedReader(new FileReader(file));
        String st;
        while ((st = br.readLine()) != null){
            if(st.contains(playerName)){
                String[] line = st.split(",");
                ArrayList<String> list = new ArrayList<>(Arrays.asList(line));
                list.remove(0);
                for (String s : list) {
                    String[] j = s.split(";");
                    hashMap.put(j[0], j[1]);
                }
            }
        }
        return hashMap;
    }

This is my code, I want to like delete the same line after its read, how can i do so

solemn shoal
#

why would you do it like that?

#

wouldnt it be easier to use a YamlConfiguration?

ivory sleet
#

txt file tho

stone sinew
solemn shoal
#

his line starts with playe rnames tho

#

as far as i can read code

quaint mantle
#

yep

solemn shoal
#

so he's trying to delete the specific line

#

@quaint mantle rewrite it to use a YamlConfiguration instead

stone sinew
#

Read it wrong. Yeah my bad

quaint mantle
#
Vinit,/give Vinit diamond 32;Basta
Basta,/give Vinit diamond 32;Vinit

I want to delete all the files with the name i give in the method

#

The first one is the name

quaint mantle
solemn shoal
#

again, YamlConfiguration is a way better solution

quaint mantle
#

ye but i have some other things so yml isnt confortable, but still do u have an example for this structure

earnest junco
solemn shoal
#

whats wrong with yml?

ivory sleet
#

^

solemn shoal
ivory sleet
#

yml is like the pog pog config lang

solemn shoal
#

eh i prefer json

quaint mantle
#
vinit:
  cmd: /give
  refer: Basta
vinit:
  cmd: /give
  refer: Basta
vinit:
  cmd: /give
  refer: Basta
vinit:
  cmd: /give
  refer: Basta

So how would you delete the tthing

ivory sleet
#

all valid json is valid yaml

quaint mantle
#

I tried JSON but i dont really know how would i do the writing part

ivory sleet
#

hence yaml > json

solemn shoal
quaint mantle
#

I would also need to print data in json

ivory sleet
#

yes
```yaml
{
"a": "b"
}
```
try sending that

solemn shoal
#
{
  "a": "b"
}
#

lol

ivory sleet
#

it will give you the right colors because its valid

#

yaml is a superset of json

#

thats an irrefutable fact

solemn shoal
#

huh...

#

did not know

quaint mantle
#

what ide do u use for java?

#

vsc?

#

how would u delete a whole key in yaml??

solemn shoal
#

i use intellij

solemn shoal
quaint mantle
#

that doesnt really look like intelliJ

quaint mantle
solemn shoal
#

well yeah thats vscode

#

coz i use it for config files

#

lol

quaint mantle
#

xDDD why dot u use Material theme

solemn shoal
#

ew

quaint mantle
#

btw can i know what plugin are you making

solemn shoal
#

im currently working on SpigotAV

quaint mantle
#

whats that?

solemn shoal
#

vscode ^

quaint mantle
#

DUDE

#

how did u get that

#

the theme

solemn shoal
#

get what?

quaint mantle
#

vsc theme

solemn shoal
#

its a custom theme

quaint mantle
#

please can i ge a tutorial

lost matrix
solemn shoal
#

anyways

quaint mantle
#

itssss soo cool man

solemn shoal
#

lol

#

its kinda uh

#

not recommended to use

#

since it modifies the core of vscode

quaint mantle
#

idc

#

anything for looks they say xDDD

solemn shoal
#

also requires administrator

quaint mantle
#

got it

solemn shoal
#

and makes you not elegible for support if vscode breaks

quaint mantle
#

ye that aint a prob either

solemn shoal
#

lol

quaint mantle
#

xD

solemn shoal
#

i mean, its on the extension store

#

@quaint mantle if you want a custom one just ask lol

quaint mantle
#

i see

solemn shoal
#

if you have some way of syncing extensions enabled itll even sync

#

coz theyre on the extension store

quaint mantle
#

got it

#

how to edit the things now

#

I installed the extention

solemn shoal
#

ah yeah no

#

its all hardcoded

quaint mantle
#

can you send me your code? like copy paste?

solemn shoal
#

yeah let me upload a folder lol

quaint mantle
#

xD

dusty herald
#

the arcane what now

solemn shoal
#

?

#

@quaint mantle again if you want a custom one just ask

#

coz i have to maintain my plugin anyways

quaint mantle
#

WAIT

#

thats ur plugin?

solemn shoal
#

yeah?

#

lol

quaint mantle
#

i m like speechless

#

u are fricking genius man

solemn shoal
#

i even bypassed the hash checks of vscode

#

otherwise you'd get a "This installation of VSCode is corrupted"

drowsy helm
#

wtf is awoo related content

#

like wolf

#

awoo

solemn shoal
dusty herald
#

oh no

quaint mantle
#

how to install the theme now

dusty herald
#

is vscode any good

lost matrix
solemn shoal
#

restart vscode as administrator @quaint mantle

drowsy helm
#

vscode is great

#

i love it

dusty herald
#

whats it good for

#

no idea what it does

lost matrix
drowsy helm
#

i use it for coding nodejs shit

solemn shoal
#

its a fancy text editor

drowsy helm
#

can be good for anything really

dusty herald
#

is it fancier than Atom?

solemn shoal
#

never used atom

#

tho ive seen people say vscode > atom

drowsy helm
#

neither, couldn't tell ya

dusty herald
#

if it's more practical for quick edits than atom fuck yeah ill start using it

solemn shoal
#

then again

#

gnu nano

quaint mantle
dusty herald
#

nano is my baby ok?

#

i use it for everything

drowsy helm
#

nano

#

for coding?

#

gtfo

dusty herald
#

not coding

#

just for everything

solemn shoal
solemn shoal
dusty herald
lost matrix
#

I honestly cant get away from the jetbrains stack.
JS -> Webstorm
Java -> IntelliJ
C/C++ -> Clion
Python -> PyCharm
C# -> Rider

solemn shoal
#

again i can make you one and upload on extension store

dusty herald
#

should i upgrade my nano

#

or leave it

solemn shoal
#

nano 4.8 lol

dusty herald
#

yes nano 4.8

drowsy helm
#

jetbrains is just a good ide maker

quaint mantle
solemn shoal
#

guessing ubuntu? @dusty herald

dusty herald
#

yes

#

ubuntu all the way

drowsy helm
#

i only like unix systems for server stuff

#

cant stand it for every day use

quaint mantle
#

how do i remove the aniem girl

dusty herald
#

oh yeah, I use manjaro for my desktop

#

but for server related I prefer ubuntu

solemn shoal
#

JS -> vscode
Java -> IntelliJ
C/C++ -> nano
Python -> vscode
C# -> rider

dusty herald
#

Python -> nano

solemn shoal
quaint mantle
#

JS-> Webstorm
Java-> IntellIJ Ultimate
C#-> Rider
Python-> PyCharm Ultimate

drowsy helm
#

only thing i can justify coding with nano is scripts

lost matrix
#

For me its actually
JS -> trashcan
Java -> IntelliJ
C/C++ -> VSCode
Python -> PyCharm
C# -> Rider

Because Clion is kind of bad...

quaint mantle
#

I just got the github pack

solemn shoal
#

C:\Program Files\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-browser\workbench\workbench.html @quaint mantle

quaint mantle
#

got it

dusty herald
#

no idea how to update nano ๐Ÿคท

#

if i have to compile the source fuck that

solemn shoal
#

tho youll have to patch the hash checks manually

drowsy helm
lost matrix
#

...

dusty herald
#

JS is hell to work with

drowsy helm
#

guess its the latter lol

lost matrix
#

TS or bust. I dont touch raw JS

solemn shoal
#

@quaint mantle want your own image there?

#

dm me link

dusty herald
#

though I prefer JS over vbscript

drowsy helm
#

vbs

#

ew

dusty herald
quaint mantle
dusty herald
#

imagine still using vbs

lost matrix
#

Lol isnt that the language thats used for excel scripting or something?

drowsy helm
#

any lang minus C# that microsoft makes is booty

dusty herald
#

internet explorer alternative for javascript iirc

solemn shoal
#

send what?

drowsy helm
#

that is awesome

dusty herald
#

whatever that is

solemn shoal
#

its mpxplay running on ms-dos

dusty herald
#

thanks

#

time to emulate ms-dos

solemn shoal
#

on a pentium 2 w/ sound blaster

drowsy helm
#

lmao

dusty herald
#

god i want that so bad

solemn shoal
#

lol it plays flacs fine

lost matrix
#

Im so glad when WebAssembly gets more mainstream. Writing your frontend in Kotlin feels so nice. And i dont have to use a single line of js then.

dusty herald
#

KOTLIN

solemn shoal
#

there are windows version @dusty herald

dusty herald
#

i dont use windo

#

w

solemn shoal
#

ah yes r/engrish

lost matrix
#

Or C++ or Java or Rust
Many languages compile to WebAssembly

drowsy helm
#

is rust any good?

solemn shoal
#

the windows version works with wine tho

drowsy helm
#

I'm thinking of learning it

solemn shoal
#

oh i just run c# under webassembly

dusty herald
#

i dont trust sourceforge though

solemn shoal
#

the source code is linked on that page

#

the dos/win32 version is written in OpenWatcom C 1.9

#

the MMC (windows GUI) version is written in QT5

#

anyways

#

how can i get the plugin directory?

dense tartan
#

Hi! I just wanted to ask how long it takes for a PR to be reviewed, since I am waiting for over 18 days already.

eternal oxide
#

a PR to what?

dense tartan
eternal oxide
#

It has mistakes

#

you return the same message for command not found and for command cancelled. Yet you have a seperate response string for each

solemn shoal
#

wait

#

how can i run plugin code on load?

#

adding an onLoad throws an exception

eternal oxide
#

override onLoad

distant fern
#

I have a question. So i want to make something like a quest plugin. To make my npcs i use znpcs plugin. Is tahat NPC an entity? Because it doesnt work on it D:

solemn shoal
#

Plugin attempted to register Spigot-AV v1.0 while not enabled

eternal oxide
#

You can't use spigot calls in your onLoad

solemn shoal
#

how would i get plugins dir?

stone sinew
#

Plugin.getDataFolder().getParent()

solemn shoal
#

in onload i meant

eternal oxide
#

same

solemn shoal
dusty herald
#

you could make your plugin run at startup ๐Ÿคท

solemn shoal
#

oh it just doesnt work when plugman reloading it

dusty herald
#

plugman is a sin

solemn shoal
#

its a godsend when testing

eternal oxide
solemn shoal
eternal oxide
#

The method doesn;t exist

solemn shoal
#

then why does it work?

eternal oxide
#

You created your own getPlugin() method

solemn shoal
#

ah wait yeah

#

lol i should update the name

eternal oxide
#

this is your plugin so just use this.

solemn shoal
#

not in a static context

eternal oxide
#

onLoad isn;t a static context

solemn shoal
#

that isnt no

#

my scan function is

eternal oxide
#

then set an instance

#

and you were attempting to call scan in a non static in yrou code

solemn shoal
crude charm
jovial abyss
#

@crude charm You got the code by any chance?
First guess would be that you just use toString on a Future.

dense tartan
jovial abyss
#

And the suffix may no be longer than 32 characters

crude charm
#

scoreboard or the bc method

jovial abyss
#

@crude charm From the JoinEvent

crude charm
jovial abyss
#

@crude charm what does Hub.rankPlaceholder(e.getPlayer());

#

return

crude charm
#
public static String rankPlaceholder(Player player) { return PlaceholderAPI.setPlaceholders(player, "%vault_rank%"); }
eternal oxide
solemn shoal
#

how can i iterate over a stream?

#

nvm u can cast it to an array

crude charm
#

@jovial abyss

jovial abyss
#

@crude charm I am not 100% sure but this bungeeChannelApi.getPlayerCount("ALL") might return a future

#

And you cant just call toString

crude charm
#

1 sec I may have made the dumbest mistake ever

#

I have a question for pro devs

#

what is the difference between #toString and String.valueOf

lost matrix
crude charm
#

aight

#

what should I use?

#

lots of people use toString but intelliJ always says valueOf

lost matrix
#

Depends on your case. Do you have a value that could potentially be null? Then use valueOf

crude charm
#

aight

#

DONT LOOK

#

im dumbn

#

spiofhsdiougshgsjghsikug

#

dsfhghdfs

#

hfsdh

#

dsfhds

#

I cant read

#

why TF did I read my selector clas

#

lmfao

daring sierra
cold field
#

Does anyone know why playerInteractEntity is fired only once and not every time the client send a interact entity packet?

quaint mantle
#

because the server needs to process the packet and see if the player hitting the enitty is valid

cold field
#

what I mean is, if I intercept the packets one normal click = 4 packets, if I use PlayerInteractEntity 1 normal click = event fired once

solemn shoal
crude charm
solemn shoal
#

working fine lol

#

now to come up with detection names lol

rugged topaz
#

what event would handle my cursor being put on an empty slot, then pressing 8 on my hotbar to make it go there

quaint mantle
#
JSONROY:
  VINIT: [/give, /crate]
  BATOP: [/op. /start]

How would I get all the items from the VINIT ARRAY

solemn shoal
#

time to put malware on my server

quaint mantle
#

nvm

#

i got the asnwer

solemn shoal
#

lmao it works

cold field
#

Is it like an antivirus for a server?

solemn shoal
#

yes

quaint mantle
#

xDD

solemn shoal
#

anyways it works

crude charm
#

can someone plz help me

#

bruh im so dumb

cold field
#

XD x2

crude charm
#

I swear I like gloss over the error
post it here
read it while waiting
then solve it

cold field
#

I see

#

;D

quaint mantle
#
JSONROY:
  VINIT: [/give, /crate]
  BATOP: [/op. /start]

This is my yml, how would loop through all the children of JSONROY??

cold field
#

getKeys(false)

quaint mantle
#

and then get the strings in the array

solemn shoal
#

pls rate

quaint mantle
#

I want to like store alllll the string, /give, /crate/ op, /start in a array

quaint mantle
solemn shoal
#

i mean scan is ez

quaint mantle
#

xD

solemn shoal
#

anyways any reason why \r in a string doesnt work?

quaint mantle
#

what do u want to do?

crude charm
#

ive been scammed I was told great thing using spigots scoreboard system and this is the issue ive been dealing with forever

quaint mantle
#
JSONROY:
  VINIT: [/give, /crate]
  BATOP: [/op. /start]

I want to get the contents of both the arrays in one array, how do i do so?
/give, /crate/ op, /start in a array

earnest junco
jovial abyss
#

@crude charm You are still using just toString (or String.valueOf)

solemn shoal
#

anyways

#

craftbukkit 1.8?

quaint mantle
#

got it thanks @earnest junco

crude charm
solemn shoal
#

await it lol

#

assumg futures are anything like asyncs in C#

quaint mantle
#

how to get the number of children in the root obj (Yml)

solemn shoal
#

how do you mean?

jovial abyss
#

@crude charm Do you know what a Future is?

solemn shoal
#

uhh

#

why does java not allow you to return a tuple like this?

quaint mantle
jovial abyss
#

Java doesn't have tuples(at least not inbuild like this)

solemn shoal
crude charm
#
    public CompletableFuture<Integer> getPlayerCount(String serverName) {
        Player player = getFirstPlayer();
        CompletableFuture<Integer> future = new CompletableFuture<>();

        synchronized (callbackMap) {
            callbackMap.compute("PlayerCount-" + serverName, this.computeQueueValue(future));
        }

        ByteArrayDataOutput output = ByteStreams.newDataOutput();
        output.writeUTF("PlayerCount");
        output.writeUTF(serverName);
        player.sendPluginMessage(this.plugin, "BungeeCord", output.toByteArray());
        return fu

this is the method im using to get the player count

solemn shoal
#

lol

earnest junco
solemn shoal
#

im just gonna write a custom class

quaint mantle
#
JSONROY:
  VINIT: []
  BATOP: []

There could be 100 of those children, how to get the total amount and then loop through all of JSONROY's children and get their array

jovial abyss
solemn shoal
#

aaa

solemn shoal
#

come on

solemn shoal
#

wait what, yag is complaining im spamming

#

anyways why doesnt java support that...

jovial abyss
#

@crude charm You can give a Future a Callback-Function, which is executed when the value is obtained

cold field
quaint mantle
#

java is open source, add it ur self xDD

quaint mantle
cold field
#

just call on the object getKeys(boolean)

solemn shoal
#

how can i return an instance of a class with values without a constructor in java?

quaint mantle
#

ye but then it gives a set

quaint mantle
solemn shoal
#

in C# you can just do cs return new ScanResult(){ Suspicous = false, Detection = "none" };

solemn shoal
#

no tuples, no inline value defs

#

come on java

quaint mantle
#
private static ReferalX instance;
public static ReferalX getInstance(){
    return instance;
}

@Override
public void onEnable(){
    instance = this;
}```
solemn shoal
#

?

crude charm
solemn shoal
#

thats not what i was looking for vinit

quaint mantle
#

with values??? uh jsut use a constructor

solemn shoal
#

yeah but im avoiding constructors lol

earnest junco
#

DI > Singleton

solemn shoal
#

fine ill write a constructor

#

i hate how i cant just use C#'s inline syntax

solemn shoal
#

or hell, anonymous classes

drowsy helm
#
        System.out.println(permissionMap.getOrDefault(perm.getName(), perm.getDefaultWeight()));``` is a hashmap of <String,Integer> and getDefaultWeight() returns int but im getting cannot cast double to int ๐Ÿค” ๐Ÿค” ๐Ÿค” ๐Ÿค”
solemn shoal
#

like damn

#
var v = new { Amount = 108, Message = "Hello" };  ```
#

lol

cold field
earnest junco
drowsy helm
#

depenceny injection

cold field
#

ahn

#

ok

drowsy helm
#

i cant spell

solemn shoal
#

why cant we have anonymous classes and tuples

drowsy helm
#

because java hates us

#

tuples are easy to implement by urself tho

quaint mantle
#
JSONROY:
  VINIT: []
  BATOP: []

I want to get JSONROY's child

But

        Set<String> list = plugin.getCustomConfig().getKeys(false);
``` this will return the JSONROY thing right??
drowsy helm
#

theres no event to check where the cursor is

#

it's clientside

solemn shoal
rugged topaz
#

is it not the inventorydragevent with e.getCursor() and e.getOldCursor()/

solemn shoal
#

how would you implement that?

rugged topaz
#

i'm just making sure tho

cold field
drowsy helm
#

that is dragging an itemstack

#

when you split it between slots

jovial abyss
rugged topaz
#

moving an item across ur inventory with the use of hotbar keys isn't client side tho

#

i jus dk what the event is

quaint mantle
cold field
#

vinit and batop

crude charm
#

thats not gonna work

#

:/

earnest junco
quaint mantle
#

aight

zinc violet
#

I've never seen this error in my life

#

PlayerGameModeChangeEvent may only be triggered synchronously.

#

lol

jovial abyss
earnest junco
crude charm
drowsy helm
#

you are calling it async

solemn shoal
#

ehh ill just use a constructor

solemn shoal
zinc violet
drowsy helm
#

the runnable is async

earnest junco
#

so async it is

quaint mantle
#
JSONROY:
  VINIT: []
  BATOP: []
VINIT:
  JSONROY: []
  BALTOP: []

This is my whole config, what will it return when i do

Set<String> list = plugin.getCustomConfig().getKeys(false);
zinc violet
#

ah

#

wait am I?

#

it worked before

jovial abyss
earnest junco
crude charm
quaint mantle
#

and then how will i get the child under JSONROY or VINIT

cold field
#

just change false to true

quaint mantle
#

but then it will also return VINIT

drowsy helm
#

I'm doing it bois, im gonna ask a question on stack overflow

crude charm
quaint mantle
#

i only want one

cold field
#

it is a set

#

so

quaint mantle
#

so?

cold field
#

Hum, wait

#

I think it is case sensitive

#

You will get only once

#

if you use every time upper case letters

jovial abyss
#

@crude charm something like this bungeeChannelApi.getPlayerCount("ALL").whenComplete((integer, throwable) -> /*code to set the suffix*/)

crude charm
#

didnt realise u meant like that

#

im super tired

#

sorry

quaint mantle
#

Can you show me a example to get all the data in the arrays of JSONROY

solemn shoal
#

woops

quaint mantle
#

xD

solemn shoal
#

lets try that again

#

there we go

jovial abyss
#

@crude charm np

crude charm
ivory sleet
#

Presumably setSuffix ?

crude charm
#

no lmfao

#

not like that

quaint mantle
#

like get all the things in the childdren of jsonroy

cold field
#

if you want merge all the arrays, just use config.getKeys(true)

#

then loop through it and merge

jovial abyss
quaint mantle
#

ye but that will get the arrays in VINIT too

crude charm
#

.setSuffix("");

how do I get an instance of #getPlayerCount

do I just re

quaint mantle
#

I only want from a specific object

cold field
#

oh

crude charm
cold field
#

just use config.getConfigurationSection("OBJ_KEY").getKeys(false)

quaint mantle
#

and then how do u get their array things

cold field
#

loop through the hashset and do configurationSection.getStringList(key)

quaint mantle
#

aight

distant fern
#

I have a question. So i want to make something like a quest plugin. To make my npcs i use znpcs plugin. Is tahat NPC an entity? Because it doesnt :d

crisp iron
#

It should be an entity

quaint mantle
#

Use Citizen API, it has a really good api, + yes its an entity

crude charm
crisp iron
#

Could you use

#

?paste

queen dragonBOT
crude charm
#

why

#

you can see it

dusty herald
#

show me your code

crisp iron
#

Much more convenient

dusty herald
#

it appears your suffix is 32 characters, which is more than Bukkit allows

cold field
crude charm
solemn shoal
#

my antivirus is open source now

dusty herald
#

it would appear you're trying to convert a CompletableFuture to a string?

jovial abyss
#
                        e.getPlayer().getScoreboard().getTeam("onlinePlayers").setSuffix((Hub.secondColour + integer));
                    })));``` replace it with
 ```bungeeChannelApi.getPlayerCount("ALL").whenComplete((integer, throwable) -> {
                        onlinePlayers.setSuffix((Hub.secondColour + integer);
                    }));```
solemn shoal
#

why set a suffix?

crude charm
distant fern
dusty herald
#

question

crude charm
#

yes?

jovial abyss
dusty herald
#

why not just.. Bukkit.getOnlinePlayers().length

crude charm
cold field
#

If the plugin that you are using doesn't have a prebaked interface to manage the events (Which I doubt) you can intercept the packets the client send

woeful crescent
#

How can I create abstract methods in an enum with default values? Is it possible?

crude charm
dusty herald
#

ah

#

the parameter integer is not an integer

eternal oxide
#

You are not going to be able to delay the PlayerJoin while you do a bungee query

crude charm
dusty herald
#

the parameter integer in integer, throwable is not an integer

eternal oxide
#

I'm assuming bungeeChannelApi.getPlayerCount("ALL").whenComplete is doing a plugin messaging query to teh bungee proxy

cold field
crude charm
wet breach
eternal oxide
#

You are going to lag, if not crash the server if you try to wait for that to query in the PlayerJoinEvent

wet breach
#

Odds are, they will lag out the player before the server lags out

cold field
wet breach
#

or lag out all the players XD

dusty herald
#

that fact might change with more players

crude charm
#
 Events.subscribe(PlayerJoinEvent.class)
                .handler(e -> {
                    Bukkit.getScheduler().scheduleSyncRepeatingTask(hub, new Runnable() {
                        @Override
                        public void run() {
                            e.getPlayer().getScoreboard().getTeam("rank").setSuffix(Hub.rankPlaceholder(e.getPlayer()));
                            bungeeChannelApi.getPlayerCount("ALL").whenComplete((integer, throwable) -> {
                                e.getPlayer().getScoreboard().getTeam("onlinePlayers").setSuffix((Hub.secondColour + integer));
                            });
                        }
                    }, 50L, 50L);
                });

    }
#

I start a loop

dusty herald
#

woah yeah of course that's gonna fuck shit up

wet breach
#

I have seen servers lag out players because of attempting to delay the joining of a player

#

fun when that happens ๐Ÿ˜›

woeful crescent
eternal oxide
#

In yoru scoreboard handler you don;t

crude charm
#

delaying the update

dusty herald
#

Zoi can you make sure that the integer variable is actually an integer?

woeful crescent
dusty herald
#

nah

wet breach
jovial abyss
cold field
woeful crescent
#

I know that. I meant that I want to make an enum where you don't have to implement every single method saying return false for the one you aren't using, and instead just overriding one and returning true.

#

@wet breach

crude charm
#

player.sendMessage(mainColour + "Welcome to " + serverName + " there are currently " + integer + " players online!");

I print it here and it returns what @jovial abyss said

dusty herald
#

it's still a CompletableFuture<Integer> in whenComplete apparently because from what I can see with the error, it returns a function and not an actual integer

#

as you can see there

crude charm
#

its returning an error because something is wrong

dusty herald
#

that is not an error

jovial abyss
#

whenComplete returns a CompletableFuture yes @dusty herald

dusty herald
#

the error is caused by the suffix being too long

crude charm
#

issue

#

not working as intended

jovial abyss
#

Can you send the code from this? @crude charm

wet breach
#

you delay the joining and you can very well end up just causing everyone to DC because of it lol

crude charm
#
                    bc.getPlayerCount("ALL").whenComplete((integer, throwable) -> {
                    player.sendMessage(ambientColour + CC.STRIKETHROUGH + "-----------------------------------");
                    player.sendMessage(mainColour + "Welcome to " + serverName + " there are currently " + integer + " players online!");
                    player.sendMessage(mainColour + "Discord: " + secondColour + discordLink);
                    player.sendMessage(mainColour + "Teamspeak: " + secondColour + teamspeakLink);
                    player.sendMessage(mainColour + "Twitter: " + secondColour + twitterLink);
                    player.sendMessage(mainColour + "Store: " + secondColour + storeLink);
                    player.sendMessage(ambientColour + CC.STRIKETHROUGH + "-----------------------------------");
    );

@jovial abyss

dusty herald
#

can i see your code arch

wet breach
crude charm
#

the bungee class

#

main class

dusty herald
#

are you arch?

#

๐Ÿ‘€

crude charm
dusty herald
#

i was asking arch a question

crude charm
#

oh

#

lmfao

#

I thought you meant code architecture

wet breach
#

lol

dusty herald
#

have you got your vaccine frost

woeful crescent
crude charm
dusty herald
#

oh jesus

woeful crescent
#

obviously, right now the @Override has an errror

dusty herald
#

why is all of this in an enum class

crude charm
#

^

jovial abyss
woeful crescent
#

I know, I know, it used to be an interface. But I switched the methods over to the enum itself because I would have access to all the enum entry data, and I didn't want to pass all of the enum entry data through the interface. Maybe I should switch the methods back to an interface implemented by an enum?

crude charm
jovial abyss
crude charm
#

ye same

woeful crescent
#

Also, there was a lot more in the enum that I didn't post because it wasn't relevant

#

oh wait

#

You know what

crude charm
#

doesent print

#

WTF

woeful crescent
#

I'm switching it back to the interface

crude charm
#
                    player.sendMessage(String.valueOf(integer.getClass()));
                    printConsole(String.valueOf(integer.getClass()));
woeful crescent
#

Whatever, the only thing I'll be missing is better error messages

crude charm
#

neither print

jovial abyss
#

You use an old version of the plugin

crude charm
#

im not

#

1 sec ill get proof

wet breach
dusty herald
#

bukkit could be intercepting sending that

#

๐Ÿคท

quaint mantle
#

Does anyone know what packet contains sign data/text?

crude charm
#

it wont let me upload

#

but I am

crude charm
#

but this should defo work

#

public static void printConsole(String message){ Bukkit.getServer().getConsoleSender().sendMessage(message); }

quaint mantle
#

tile entity data doesn't even get triggered for me

#

and sign update is deprecated

solemn shoal
#

isnt that part of block data tho?

quaint mantle
#

maybe

crude charm
solemn shoal
#

afaik it sends a block update

crude charm
#

still not printing

solemn shoal
#

System.out.println() works fine for me

dusty herald
#

well duh

#

there is something wrong with their code Sadge

solemn shoal
cold field
#

guys why Do I receive 4 packets "Interact Entity" with one click (2 two main hand and two off hand)

#

?

crude charm
#

and its not :?

solemn shoal
#

mouse down and mouse up? @cold field

dusty herald
crude charm
#

ofc

solemn shoal
#

nah @dusty herald

crude charm
#

WTF

cold field
#

oh

#

wait

#

nvm

solemn shoal
#

im using actual malware to test it lol

crude charm
#

oh

wet breach
# quaint mantle and sign update is deprecated

sign update might be deprecated but it doesn't mean it is unusable. You are limited what you can do with signs in regards to packets but it depends what you are trying to accomplish as well

dusty herald
#

DogKek all the same worm

crude charm
#

I thought it was the real thing

solemn shoal
#

well yeah @dusty herald

crude charm
#

lmfao

solemn shoal
crude charm
dusty herald
#

maybe change " + integer + " to integer.getClass() and roll with it

quaint mantle
dusty herald
#

๐Ÿคท maybe Saith was right and you aren't properly updating the plugin file

crude charm
#

m8

#

I decompiled it

#

and it was updated

earnest junco
crude charm
#

so I am

cold field
#

ahahah

crude charm
wet breach
#

Then you are better off then just checking the sign after that packet is sent @quaint mantle far easier doing it this way

jovial abyss
crude charm
#

sure

quaint mantle
wet breach
#

and then for checking already placed signs is just a matter of checking when a chunk loads for tile entities and then checking if they are signs

solemn shoal
#

damn one of the plugins is spamming me with ads

quaint mantle
#

its not very efficient when lots of chunks get loaded

solemn shoal
wet breach
dusty herald
#

I wish you could modify chunks async

#

that would be awesome

quaint mantle
wet breach
#

you don't need it to be sync for this until you need to actually do something with the sign IE, change its words

crude charm
#

yup

#

it did it

#

it printed

#

it

quaint mantle
#

that event is async?

dusty herald
#

what did it print Zoi?

crude charm
#

TEST

quaint mantle
#

i thought it didn't specify it was async

wet breach
#

Which event?

dusty herald
#

ok so print integer.getClass()

solemn shoal
dusty herald
quaint mantle
crude charm
#

I cant

#

I did it outside the method

#

to prove im updating it

dusty herald
jovial abyss
wet breach
# quaint mantle chunloadevent

the event is sync, but that doesn't mean you can't spin up async methods however and take a copy of the chunk to look over it

quaint mantle
crude charm
jovial abyss
#

nono thats not what I meant

wet breach
#

update sign packet is something you should use to know when someone edited a sign to check it afterwards, you can't modify the contents of that packet

#

you either can deny the packet or allow it but not change it

#

that was why I suggested checking the sign after, because once the player is done editing it, they can't edit it again but you are then free to manipulate how you see fit

jovial abyss
crude charm
#

ig

#

oh

cold field
#

does anyone know how to implements command suggestion (not auto-completion) just a string that shows up and tell you what you should type like as <args> or <int>

wet breach
#

don't think that is possible but you could make use of the help pages

cold field
#

vanilla commands can ๐Ÿ˜ฆ

hybrid spoke
wet breach
#

if vanilla commands can, then it could be something that brigadier provides

#

and would need to hook into that

hybrid spoke
#

just the higher versions show it like that

cold field
#

Oh

#

see?

crude charm
#

when I join

eternal oxide
#

Yes, you can;t delay the join that long while you do your plugin message query

crude charm
#

im not

#

I never delay the join

#

I just delay updating the scoreboard

cold field
#

I was suggesting not to delay the join just delay when the player is able to see

wet breach
#

you have a maximum of like 15-30 seconds before timeout occurs

crude charm
#

it was fine before this

jovial abyss
#

@crude charm get blocks the thread and prevents the player from joining

eternal oxide
cold field
#

ops..

hybrid spoke
eternal oxide
#

Store teh number locally so your PlayerJoinEvent just uses teh local value

eternal oxide
#

screenshot shows me nothing

crude charm
#

it does

#

it shows you that I cant get #getPlayer

eternal oxide
#

of course you can;t

hybrid spoke
#

let your method pass a Player argument

eternal oxide
#

the player doesn;t exist yet

crude charm
#

I'm aware of that

#

but that why I cant use it

#

because I need to get it

#

to update

#

the stuff

#

oh im dumb

#

uhdfrgiodhguidj

#

nvm

#

forgot I said that

eternal oxide
#

In the pre login event call the query to get the total players. Store that to a Field that your PlayerJoinEvent can read from

crude charm
#

ik

wet breach
#

you could just cache that number instead of querying it every single time and just update it over time. Easy to factor in a player to update the integer to show appropriate numbers lol

crude charm
#

this should not be this big of a pain

hybrid spoke
#

its totally not

eternal oxide
#

The pre login can be delayed without lagging the server or disconnecting players, and the connecting player will sit at the connecting screen until you are ready

crude charm
wet breach
#

Because you are trying to do something that is taking too much time

crude charm
#

if its been broken for the last 2 hours

wet breach
#

and you insist on it working because you don't want to change anything

crude charm
wet breach
#

obviously it isn't working....

crude charm
#

or shouldn't

eternal oxide
#

Its not difficult, you just have to use the right events

crude charm
#

ik

#

but I feel like

#

I should be able to

#

get the method

#

and be done

#

thats what its made for

#

not being annoying

eternal oxide
#

Thats not what its made for

crude charm
#

I get the method

cold field
#

sadly I need to stick with mine

crude charm
#

and it works

keen pivot
eternal oxide
#

when the PlayerJoinEvent fires you should have all the data you need to process that event ready and waiting.

wet breach
#

the playerjoin event was never meant to be used in ways most people use it. Hence why most of the time you want to do something with a player that joins you need to wait like a tick or two after they have fully joined to do things.

#

because even when that event fires off, they are sometimes technically still not fully joined

solemn shoal
keen pivot
wet breach
#

pre-login event gives you some information that a player is about to connect and you can get the players name from that event. Thus you can grab an offline player object from it if you need player information. This lets you have that information already on hand for when the player does fully connect

solemn shoal
#

it isnt, i know what they are

crude charm
#

ok

#

good to note

solemn shoal
#

anyways

#

why does getConfig().getString("Welcome Message.Text"); return that?

wet breach
#

because you are using spaces maybe? Yaml doesn't like spaces in certain areas. One of those being the path

keen pivot
#

in your plugin source have a javasisst package ? or comflex directory ?

eternal oxide
#

because Text is a MemorySection node under Welcome Message

solemn shoal
eternal oxide
#

Yeah spaces are bad

solemn shoal
eternal oxide
#

change space to _

solemn shoal
#

huh its not in quotes

#

also ive never had issues with spaces

eternal oxide
#

change to _ or wrap it

crude charm
#

thats it I give up

#

ima just do it different

hybrid spoke
#

ugh

wet breach
#

when it comes to path's, yaml dislikes spaces @solemn shoal in your pic, change Welcome Message to Welcome_Message

solemn shoal
#

its weird how ive never had issues with that

earnest junco
#

the path is not an issue lol

crude charm
solemn shoal
#

anyways most likely its coz my string wasnt in quotes

dusty herald
#

I use spaces in yaml paths all the time

solemn shoal
#

still the same

crude charm
#

what spigot u forking?

solemn shoal
#

who me?

crude charm
#

yes

solemn shoal
#

im running yatopia

crude charm
#

looks good

#

does it support 1.8?

dusty herald
#

isn't yatopia built with 1.8 in mind?

crude charm
#

no clue

solemn shoal
#

no?

#

yatopia is 1.16+

dusty herald
#

just asking ๐Ÿคท

#

i can't wrap my head around all these forks lmao

solemn shoal
#

you can run ViaBackwards etc tho

idle tulip
#

anyone can teach me some basics to make plugin?

solemn shoal
#

or protocolsupport

dusty herald
#

it is a fork of spigot

#

those are spigot plugins

crude charm
#

is it good? like good good?

zinc violet
#

quick question, efficient way to check if player is bellow set y level without an onMove event

crude charm
#

I wanna make an rpg system, might have to fork it

solemn shoal
#

yatopia is a fork of paper, which is a fork of spigot yeah

solemn shoal
#

lmao

eternal oxide
crude charm
#

is this new species good? like good good? I wanna make an rpg system and gonna make a custom spigot for stuff

zinc violet
#

bruh just when u fall down bellow given y level

eternal oxide
#

then move event is your best bet

solemn shoal
#

i mean

#

yatopia is pretty good yeah

#

this is on my plugin dev server

#

running some random dev build of yatopia

crude charm
#

can forking a spigot change what spigot allows? I want to make very detailed mobs without a texture pack, would I custom spigot allow for this?

#

*detailed custom mobs

solemn shoal
#

no

crude charm
#

like wynncraft

eternal oxide
#

If you want more features contribute to spigot rather than fork

solemn shoal
#

wait how do you mean "what spigot allows"

crude charm
#

like what spigot allows you to do

#

like with armour stands

#

its pretty hard to make really detailed things

dusty herald
#

spigot doesn't restrain you from anything tbf

solemn shoal
#

just request features

dusty herald
#

maybe you're not trying hard enough?

solemn shoal
crude charm
#

^

solemn shoal
#

compared to some forks at least

dusty herald
#

whip open NMS and ask them kindly

solemn shoal
#

like, get mspt?
spigot: you have to use NMS
paper and its forks: getServer().getMspt()

eternal oxide
#

Nothing stopping you making PR's to Spigot to add functionality

solemn shoal
#

true

crude charm
#

so I cant upload it

eternal oxide
#

Don't copy others code though. Clean room it

quaint mantle
#

is this a new term

solemn shoal
#

LOL

crude charm
#

mean like

#

is it worth forking

#

this new spgiot @solemn shoal has informed me about

#

to add this stuff

solemn shoal
#

i dont see why you'd fork it tho

crude charm
#

or should I just do it in the plugin

solemn shoal
#

just ask md_5 nicely to add new apis

#

all the downstreams will get it eventually

crude charm
#

thats not my point

solemn shoal
#

i mean, he added Creeper.getFuseTime() for me

crude charm
#

I have a request

#

where do I send it

solemn shoal
#

spigot bug tracker

crude charm
#

is this a thing?

TNT.setFuseTime();

solemn shoal
#

no idea

#

?jd

crude charm
#

and

#

tnt.setradius

solemn shoal
#

TNTPrimed.setFuseTicks(int)

crude charm
#

does it say what version it was introduced?

solemn shoal
#

no

crude charm
#

ok

solemn shoal
#

ah yeah

#

for radius

crude charm
#

yeah

solemn shoal
#

Explosive#setYield(float)

crude charm
#

aight

solemn shoal
#

TNTPrimed extends Explosive

crude charm
#

ok

solemn shoal
#

?bt

queen dragonBOT
solemn shoal
#

nvm bt is buildtools

#

anyways that jira link is the bug tracker

#

just mark it as a feature req

lean bone
#

I'm trying to send a packet to teleport an armorstand to a player, but I don't really see any effects. Does anybody know what's going on here? (The code is in Kotlin and the packet can be found over here: https://wiki.vg/Protocol#Entity_Teleport)

        val packet = pm.createPacket(PacketType.Play.Server.ENTITY_TELEPORT)
        packet.integers.write(0, armorStand!!.entityId)
        packet.doubles.write(0, location.x)
        packet.doubles.write(1, location.y)
        packet.doubles.write(2, location.z)

        pm.sendServerPacket(player, packet)```
solemn shoal
#

why use packets?

#

i guess the armor stand only exists clientside?

lean bone
#

No I just don't want to show it to some players

solemn shoal
#

ah

lean bone
#

It's an armorstand that follows the player, but the player itself doesn't need to see it and when it's spawned the player cannot interact with items properly because the armorstand''s hitbox is in the way

solemn shoal
#

that shouldny block it