#help-development

1 messages ยท Page 323 of 1

tender shard
#

otherwise it doesnt do anything lol

#

it works like this

remote swallow
#

does it have an auto latest version thing

tender shard
#

no, maven itself doesnt have that feature. maven always requires you to specify a version

#

otherwise the build wouldnt be reproducable

#

and that's basically the idea of maven ๐Ÿ˜„

#

that's also why maven central doesnt allow redeployment of versions not ending in -SNAPSHOT

remote swallow
#

ah

tender shard
#

there's a workaround by just using -SNAPSHOT as <version>

#

but that's a shitty idea

rotund ravine
tender shard
final monolith
#

hey @tender shard

#

i've looked into your frame using java and get some inspirations

tender shard
#

my frame? wdym?

final monolith
#

that

tender shard
#

ah

glossy venture
#

this better fucking work

final monolith
#

i've created my own java frame with a automatically resizing, what do you think about that?

#

i called it ResponsibleLayout

#

its for my GameEngine

tall dragon
glossy venture
tender shard
#

yeah

final monolith
#

i will change rn

glossy venture
#

but cool

chrome beacon
#

@tender shard Could you add these ^^

#

and adventure too

eternal night
#

configurate ๐Ÿฅฐ

remote swallow
#

make it make gradle projectws

chrome beacon
tender shard
#

but first I'll add kotlin support

#

after that I'll add the libraries

remote swallow
#

record builder looks cool tbh

tardy flame
#

How do you access the gui?

tall dragon
#

would love to take a peek

tender shard
tardy flame
#

๐Ÿ‘

tender shard
#

I'll finish it after adding kotlin and the new libs

#

but you can already use IntelliJ to use the archetype

tardy flame
tender shard
final monolith
tardy flame
#

Okay, thanks

tender shard
tall dragon
river oracle
tall dragon
#

i always like trying small game engines and seeing how they do stuff

sterile token
#

Is posible to create plugins diretly over IJ instead of using Maven plugins?

#

LIke allows Vscode

river oracle
#

IJ prob has an api somewhere

#

Just look it up

eternal night
tender shard
sterile token
#

oh i was told that their api was not free and you have to paid for getting access to it

#

๐Ÿ’€

river oracle
river oracle
#

If you want open source solutions just use vscode or vscodium

glossy venture
quiet ice
glossy venture
#

oh i forgot RETURN

tender shard
glossy venture
#

if i can load a class with a unrestricted protection domain

#

and then have it call AccessController#doPrivileged

#

it might do something?

quiet ice
#

Just use the sun Unsafe to yeet all reflection safeguards and you're in it

final monolith
frank kettle
#

what is the difference between material.toString() and material.name()?

glossy venture
#

wait

#

bruh

#

i forgot

#

but how do i call the mthods

tall dragon
quiet ice
#

Regular reflection?

glossy venture
tender shard
quiet ice
#

Well you need to set them to be accessible

glossy venture
#

yes

frank kettle
glossy venture
tender shard
quiet ice
#

JPMS priviliges or something else entirely?

glossy venture
#

idk

#

access to jdk.internal.loader

#

i guess

quiet ice
#

Does it talk anything about not opened to module X

glossy venture
#

yeah

quiet ice
#

Yeah, then you can add the opens stuff through the sun unsafe

glossy venture
#

but if i can load a class with this, maybe it will not cry?

tender shard
#

@rotund ravine you are the only person I know who uses kotlin for plugins. Is the stdlib basically always required, or do people only sometimes need it in spigot? basically - when someone sets "useKotlin" to true in my archetype, would I rather automatically also add STDLib, or should that be a normal option in the dependencies thingy?

eternal night
#

you basically always want the stdlib

tender shard
#

oki

#

thxyz

eternal night
#

most of their extensions on everything is in the stdlib

tender shard
#

i see

#

thankXX

eternal night
glossy venture
#

tf do you mean

#

its not empty

tender shard
#
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <version>1.8.0</version>
            <scope>compile</scope>
        </dependency>

is this the correct dependency? and it's gotta be shaded and relocated, right?

glossy venture
#

oh nvm its a field

#

so i need instance

rotund ravine
#

idk what it is in maevn

tender shard
#

yeah but the groupid and artifactid

#

they are correct right?
because it says jetbrains

rotund ravine
#

idk

#

oh yeah jetbrains is the ones making it

tender shard
#

alrighty thx

glossy venture
#

ah yes

#

java.lang.List

wet breach
#

maven will always pull the latest version

#

@remote swallow

wheat compass
#

Is there a way to just remove the visual of the multilpayer tab list?

#

I tried a plugin for that but it may be negatively interfering with other aspects of the server

#

Thanks for the help on the chat earlier btw, that worked well

humble tulip
#

Do you have an example pic?

wheat compass
#

When a player hits tab, all players online are shown. I just want to remove this feature so players don't know who is online

#

I can't post images, but I'd have an example if I could

humble tulip
#

Verify your acc

#

!verify

undone axleBOT
#

Usage: !verify <forums username>

humble tulip
#

Or use imgur

wheat compass
#

time to find my forums username, lol

naive bolt
#

just ur spigot name

#

you will have to use nps to do this

#

mess with packets

wheat compass
wheat compass
naive bolt
#

I think i mean nms

sterile token
#

Please im fkg exausted with the output its giving me

humble tulip
#

So u just want plauer names?

wheat compass
naive bolt
tender shard
#

does kotlin java init blocks?
E.g.

public class MyClass {
  {
    System.out.println("Init block");
  }
}
quiet ice
quiet ice
humble tulip
sterile token
humble tulip
#

Also what mc version

wheat compass
#

one sec, pulling up screenshot

sterile token
quiet ice
tender shard
#

how wuld I do a public getter in kotlin?

tender shard
wheat compass
quiet ice
#

oh wait, that's not adventure...

naive bolt
#

I wondered why u were giving adventure lol

quiet ice
#

?jd

naive bolt
#

I mean using adventure is a good idea for new plugins

sterile token
#

So, what do you recommed me?

quiet ice
#

Also could md PLEASE update bungee-chat to use something that's not an outdated java for javadocs

wheat compass
sterile token
tender shard
#
class MyPlugin: JavaPlugin() {

    companion object {
        lateinit val instance: MyPlugin
    }

    init {
        instance = this
    }
}

Can I use "val" here, or do I have to make the instance field "var"?

wheat compass
quiet ice
#

@sterile token Just use the builder then

new ComponentBuilder("Hello ").color(ChatColor.RED).
 append("World").color(ChatColor.BLUE). append("!").bold(true).create();
sterile token
#

I wasnt using Component or yes? Im confused now

#

๐Ÿคฃ

quiet ice
#

Component builder, not component

sterile token
#

Wait let me check my code

#

Oh LMAO Component from Java

#

No? Wait you broken my brains

quiet ice
#

how ze fuck did you not realize that

#

stop taking so much alcohol, you'll be dead in a few years if you continue like that

sterile token
#

I was using StrinBuilder because i thought it was more efficient rather components

#

oh i cannot use components, cuz of sender thing, where they dont support it

quiet ice
#

(\u00A7 is also known as ยง)

sterile token
#

๐Ÿค”

#

Please dont tell nothing about my one-liners i know what you think

quiet ice
#

and here we have someone overcomplicating a non-problem again

quiet ice
sterile token
quiet ice
#

And I have no clue what you are doing with your stream

#

Never used .reduce myself, probably that's the reason of my confusion

#

I prefer my recursive approach to placeholders

    private String applyPlaceholders(String string, int startIndex, Map<String, String> placeholders) {
        int indexStart = string.indexOf("${", startIndex);
        if (indexStart == -1) {
            return string;
        }
        int indexEnd = string.indexOf('}', indexStart);
        String property = string.substring(indexStart + 2, indexEnd);
        String replacement = placeholders.get(property);
        if (replacement == null) {
            return applyPlaceholders(string, indexEnd, placeholders);
        }
        return string.substring(0, indexStart) + replacement + string.substring(indexEnd + 1);
    }

    private String applyPlaceholders(String string, Map<String, String> placeholders) {
        if (string == null) {
            return null;
        }
        return applyPlaceholders(string, 0, placeholders);
    }

Much nicer than streams and will defo no break

wet breach
#

it reduces things to a single string

#

so it can take arrays, and collapse them down for instance

quiet ice
#

I would call that collect, but whatever

sterile token
wet breach
#

well that is a form of it, but it doesn't do it the same way

quiet ice
#

Anyways, I'd double check the Chat.style and your reduce functions

wet breach
#

yeah should double check the reduce functions

#

because it can produce results you were probably not expecting

#

also reduce can be done in parrallel too

quiet ice
#

not something particularly useful for strings

#

at least not in that magnitude

rotund ravine
#

oh

#

yeah need var with lateinit

#

@tender shard You can just do this i guess.

    companion object {
        val INSTANCE: EnderStorage by lazy { getPlugin(EnderStorage::class.java) }
    }
    override fun onEnable() {
        server.pluginManager.registerEvents(this, this)
    }
rotund ravine
#

We don't really do the whole singleton thing a lot in kotlin, atleast i don't.

tender shard
rotund ravine
#

It wants java class object

#

kotlin has it's own kotlin class object

#

Surprised u didn't ask what the lazy was

tender shard
rotund ravine
#

TasChain

#

nub

tender shard
#

gotta change that

#

i thought lazy means this

public static MyPlugin getInstance() {
  if(instance == null) {
    instance = (MyPlugin) JavaPlugin.getPlugin(MyPlugin.class);
  }
  return instance;
}
rotund ravine
#

It does

hazy parrot
tender shard
#

TaskChain is fixed

hazy parrot
#

dk if its good pratcice, but it works

rotund ravine
#

I never used a singleton.

#

DI all the way bitches

tender shard
#

DI is just annoying when it's a singleton anyway

rotund ravine
#

not really that hard

vale ember
#

?di

tender shard
#

ofc it's not hard

undone axleBOT
tender shard
#

it's just annoying

rotund ravine
rotund ravine
#

I have used both.

rotund ravine
#

yeah

sterile token
#

I was thinking what sub type to learn

rotund ravine
#

kotlin

sterile token
#

Cuz java can be deof really easy

rotund ravine
#

kotlin allows you to not use their weird build tool

#

sbt is annoying

sterile token
rotund ravine
sterile token
#

Its compiled directly to binary right?

tall dragon
#

probably the same as java

rotund ravine
#

I mean basically the same as java

tall dragon
#

its still compiled to bytecode

#

for the jvm

sterile token
#

Okay, because i have read that Java derivated are more diff to deobf cuz they didnt create much deobfuscation tools

#

And im really considering moving to a java derivaated

sterile token
#

Is md5 github account down?

remote swallow
#

configurate isnt on md's github

sterile token
#

oh

sterile token
#

that why

quiet ice
#

I'd use sponge's ver

sterile token
#

Lol

#

with seeing that huge ammount of classes i dont wanna use it

quiet ice
#

it actually is fairly okay

#

It just is typical enterprise code

sterile token
#

Like it has many classes for doing something, which can be put together ๐Ÿ˜‚

tall dragon
#

have you ever looked at EssentialsX

quiet ice
#

they have plenty of backends, you can't really merge them

tall dragon
#

i feel like thats been over engineered hard as hell too

#

but thats my opinion

quiet ice
#

Then they also have custom buildscript logic because ... gradle, you know

sterile token
quiet ice
#

then half of the other root-directory folders are just metadata for other shit

wet breach
#

also, small classes are more optimal then large ones due to the stack and objects etc

quiet ice
#

The rest that remains is abstraction logic that is required once you want to support a wide array of languages

#

Half of those classes are kinda useless of the general user

sterile token
quiet ice
#

Well useless for the consumer, useful (or even necessary) for the lib

sterile token
#

That problem is that im looking for a lib for files, to based on it and create my custom one

#

Because i dont like depending on 3rd parties

quiet ice
#

Good luck parsing anything without 3rd party libs

#

I guess you can use XML?

#

Yeah, you'd be pretty much locked into XML

#

Or java properties if you fancy that

tall dragon
#

or a .properties file

#

๐Ÿ˜„

sterile token
#

No no with that mean creating a library similar to Spigot ones, but prpeared for supporting many formats Yaml, Json, Xml, Tomson

quiet ice
#

Yeah, then suddenly all those classes are required internally

wet breach
quiet ice
#

You'd have to write your own parser for that, no?

wet breach
#

not really, basic princpal of ini files is key value

sterile token
#

That is over engeering from my view making many classes for somethign which can be done in less

wet breach
#

everything can be done with less

#

again doesn't make it better lol

#

not sure why you have this idea that more classes means unoptimal

sterile token
wet breach
#

less != simple

tardy delta
#

that a config library?

sterile token
#

We are arguing about coding less and more, the same thing

tardy delta
#

๐Ÿค”

quiet ice
sterile token
# tardy delta ๐Ÿค”

Basically I am arguing that it is too annoying to look at other libraries that perform exactly the same function, but one has a lot of programming that makes it more difficult to understand and on the other hand, there are those that make it simpler

tardy delta
#

what

sterile token
#

Yeah that is really shity looking for libraries, because they code the exactly the same logic, but with more things when can be reduced a lot

#

But idk maybe they are programming preferences, that devs like overcomplicating other people to understand they code

quiet ice
#

As long as the lib does what it is supposed to do I can never complain

sterile token
quiet ice
#

That also extends to plugins, but usually the assumption is "it doesn't work, and if it does it will break soon" there

#

Bukkit plugin devs are strange people when it comes to maintainability

sterile token
wet breach
#

do you remember all the relevant stuff in Java at all times? some things are required to be optimal, other times they are not. If it doesn't need to be optimal use the simplest code for it

sterile token
#

Yes obviously I know, but it's annoying because they really know and have the experience to make it simpler, but they still do it the way they want to do it.

wet breach
#

but all these libs exist because of varying requirements

wet breach
#

therefore it makes sense they are going to do it the way they want it

sterile token
tall dragon
#

generally its also just a good idea to have each class only do one thing for Decoupling reasons

wet breach
#

its like you complaining that I want to put a V8 into my car when a V6 is simpler

#

sure, V6 is simpler but in the end it is my car and it is my choice

sterile token
#

So devs are bipolar thats the conclusion

ancient plank
#

Bigger is better

wet breach
#

or you are and just complaining about stuff that don't warrant a complaint because you arn't going to do anything about it anyways

sterile token
#

Because then they complain when you write your own logic for doing something which is already created

tall dragon
#

technically i could make an entire plugin in 1 line

#

thats not very usefull either

sterile token
tardy delta
#

what are you making?

sterile token
quiet ice
tardy delta
#

uhh

wet breach
quiet ice
#

You'll see what I mean with that once you use it for something other than the intended purpose

sterile token
quaint mantle
#

Any idea why I get this error?

#

I'm using remapped mojang mappings on my plugin

sterile token
quaint mantle
#

It's an NMS class

quiet ice
#

The starloader-launcher (a mod launcher of mine) was meant to be usable for everything and be pretty maintainable.
As it turns out that statement held true for one game, but not for others

quiet ice
quaint mantle
#

Wdym?

quiet ice
#

Oh, you're probably using maven

quaint mantle
#

Yep

quiet ice
#

Why did I read gradle...

sterile token
quiet ice
#

I'd still check whether the specialsource plugin is configured properly, but I cannot help you much further than that I am afraid

quaint mantle
#

specialsource plugin?

#

Ohh

quiet ice
#

You're not using a remapper?

quaint mantle
#

Lmao I forgot that yeah

ancient plank
#

Java++

sterile token
#

Why the heck my code wasnt doing the associated componets jump a line:

// Using this code
TextComponent component = new TextComponent("\n     &f&l" + command.getName() + " &7Help\n");

// But works with
TextComponent component = new TextComponent("\n     &f&l" + command.getName() + " &7Help \n \n");
#

It doesnt make sense

tardy delta
#

cuz minecraft doesnt translate \n afaik

quiet ice
#

library?

sterile token
tardy delta
#

\n in itemlore doesnt work either, would be nice tho

quiet ice
#

Yeah in lore it doesn't work at all

#

In chat it does

#

At worst just send empty components I guess

rough drift
quiet ice
#

nothing can go wrong with that, especially since we do not live in UDP world

rough drift
#

Streams my beloved

tardy delta
#

the only fun thing about them is that they look fancy

#

in rust streams and normal loops compile to the same thing ๐Ÿฅฒ

quiet ice
#

with enough JIT that may be the same case in java world

tardy delta
#

the streams impl code looks terrible

wet breach
quiet ice
#

UDP chat would be the bane of plugin devs

wet breach
#

lol

#

but I guess its fortunate that mc doesn't use UDP otherwise we would get a whole lot more people complaining about their firewalls

quiet ice
#

huh, firewalls work differently?

#

Is that the reason the lookup of local servers always does not work?

wet breach
#

between udp and tcp yes

wet breach
sterile token
tender shard
#

what have I done lol

ancient plank
topaz cape
#

@alpine urchin is the packet handler not called packet_handler in netty anymore?

alpine urchin
#

it is

quaint mantle
#

I'm getting the same error...

alpine urchin
#

how do you two

#

get the same error

#

does this have to do

#

with me

#

or my projects

topaz cape
#

no

#

not you

quaint mantle
#

I'm not the one who pinged you

alpine urchin
#

ok, its probaby a thread issue

topaz cape
#

i was just injecting into netty

alpine urchin
#

you might be adding a handler on the wrong thread

topaz cape
#

im on the main thread

quaint mantle
topaz cape
#

wdym

alpine urchin
#

have you tried channel.pipeline().execute i think its called

#

then put a runnable

#

qhere u add the handler

#

it might fix ot

#

but the error isnโ€™t consistent rigjt

#

not every time

topaz cape
#

ye

quaint mantle
#

Hmm

alpine urchin
#

try as i advised

topaz cape
#

sure

#

tysm

alpine urchin
#

np

quaint mantle
#

There isn't anything called channel.pipeline().execute

#

Could it be channel.eventLoop().submit you're talking about?

alpine urchin
#

yes

ocean hollow
#

When the gui is closed, the player is given the items that he put there, but when the menu is recreated, they are also given out. Can you recommend something?

#

I mean that when the menu is reopened, the closing event is triggered.

rotund ravine
#

Huh?

#

Well just donโ€™t give out till heโ€™s absolutely finished with the menu

ocean hollow
#

I mean, when closing on ESC, it gives me an item that is in the menu (from slot 1). But when choosing a color, I recreate the menu (2) to change the title to replace the texture. And as a result, the closing event is triggered.

rotund ravine
#

Donโ€™t reopen the menu and just edit the contents

regal scaffold
#

Is there an easy way to copy a jar file into a project to be able to do modifications instead of manually having to copy each file over?

ocean hollow
#

only nms

rotund ravine
#

Well then deal with it

#

Donโ€™t give item if you are still in an active โ€œconversationโ€ with the player

regal scaffold
#

I want to modify an existing jar without having the source code in a download

#

And yes I have permission to do it

tardy delta
#

git clone?

rotund ravine
#

Decompile it

restive abyss
#

any tutorial on how to set up coding with intellij IDE?

regal scaffold
#

Yes but decompiling it then to rebuild it I have to copy every single file over

humble tulip
#

No?

#

Decompile

#

Then import existing

regal scaffold
#

I use jdgui I'm guessing gotta use something different

humble tulip
#

Use luyten

regal scaffold
#

Thanks

humble tulip
#

That's what i use

regal scaffold
#

I'll give that a try

#

What is lombok

#

wtf is this

#

How can it be so messy

rotund ravine
#

Haha

#

What is that?

remote swallow
#

cough lombok probably

#

maybe jefflib

#

happens in most stuff with lombok though

regal scaffold
#

Someone had a dev do a job for them

#

But why is this so desorganized

rotund ravine
#

Doesnโ€™t look that messy

regal scaffold
#

No?

#

oh maybe I'm just dumb

remote swallow
#

those files do nothing on the server

#

other than plugin.yml and config.yml

regal scaffold
#

Do I then do new project from existing sources?

remote swallow
#

what for

rotund ravine
#

Well

remote swallow
#

if your trying to edit that you are gonna need more than winrar

regal scaffold
#

Nono

#

I already decompiled with

#

luyten I have a zip

#

I assume unzip and new project from existing

rotund ravine
regal scaffold
#

What would you do?

#

Open folder?

remote swallow
#

ask them for the source

rotund ravine
#

^

regal scaffold
#

It was a while ago

rotund ravine
#

Else find their classes and copy those

remote swallow
#

because looking at that, all luyten does is just convert the .jar to .zip

rotund ravine
#

Then make a new maven project, copy paste it in and start solving lib errors

regal scaffold
#

I have .java

#

It has too many classes

rotund ravine
#

@regal scaffold Some of the are probably shaded in

regal scaffold
#

But I feel if I import

rotund ravine
#

Open plugin.yml

regal scaffold
#

It'll be a shitshow

remote swallow
regal scaffold
#

They are shaded

#

So if I import to intelliJ

rotund ravine
#

Open plugin.yml

regal scaffold
#

It's gonna be a mess no?

remote swallow
#

open plugin.yml

regal scaffold
#

Going going

#
name: BRBarriers
version: '1.0-SNAPSHOT'
main: com.unclecole.brbarriers.BRBarriers
api-version: 1.19
prefix: BR-Barriers
authors: [ Cole ]
description: Barriers plugin
commands:
  barriers:
rotund ravine
#

com.unclecole.brbarriers. Copy this folder

regal scaffold
rotund ravine
#

Well slightly, but yes that's a start.

regal scaffold
#

No

#

Cause then all the maven stuff

#

and shades

remote swallow
#

you have to re-create

#

or change to work without

regal scaffold
#

Damn

rotund ravine
#

Obviously you need to recreate it from what you gather it needs.

#

Can you link me to the plugin page?

regal scaffold
#

Doesn't have a page

#

Was custom

remote swallow
#

wouldnt surprise me if they still have source

regal scaffold
#

I'll ask

#

But now that I think of it

#

I could just get the folder

#

and insert it into another plugin

#

And build both inside 1 jar

#

Since I have the rights to it

#

Would have to change some stuff to make it work in 1 only

humble tulip
#

@regal scaffold what ya wamma change?

regal scaffold
#

Error in it

#

Stupid NPE on playerteleportevent

restive abyss
#

exactly what file should i put in the dependencies? i put the spigot file that i downloaded to run the server but it doesnt seem to be working, or perhaps i should put another "extension"?

regal scaffold
#

It's legit a 1 line fix

humble tulip
#

Ah I'll nned more context

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

humble tulip
#

Lemme see the file that has to change?

#

I've done alot of this

regal scaffold
remote swallow
#

check what the barrer listener class line 80 is

regal scaffold
#

if (itemStack != null && BarrierData.barrierKeys.get(s).isKey(itemStack)) {

remote swallow
#

doesnt help

tardy delta
#

oh god

regal scaffold
#

lol

#

It's a 1 line fix

#

but I'm not doing all the work for 1 line

remote swallow
#

please tell me you didnt pay more than like 20$ for that

regal scaffold
#

Wasn't me

#

Why would I pay when I make mine lol

tardy delta
#

dont expose collections

regal scaffold
#

nono

#

The problem is

#

When a player teleports anywhere on the server with any command

#

It just gives error

#

Functionality works when intended

#

But if anyone teleports it doesn't return

#

So thinks it met a block

tardy delta
#

your get returns null

regal scaffold
#

like just check if event is in right world or anything and do nothing

#

Yes because it shouldn't be getting called

#

On random teleports

#

Just the plugins teleports

#

He never added a check

#

So his teleport event for specific plugin runs when I type /spawn completely unrelated

spring pike
#

if I have a enum .valueOf() and the valueOf doesn't exist because of a typo in chat, how can I prevent the No enum constant error?

compact haven
#

I mean you can catch it

tardy delta
#

try catch

compact haven
#

or you can not use valueOf, either works

tardy delta
#

or write your own valueOf which returns null

#

makes sense

#

how are you gonna add custom materials to an enum

#

what methods

compact haven
#

:?

tardy delta
#

i have no clue what you're sayin

compact haven
#

You can't add to an enum at runtime

tardy delta
#

but either way doesnt work

spring pike
#

try and catch is enough for now

#

ty

compact haven
#

anyways the constant is fine for what spigot does

tardy delta
#

they do?

humble tulip
#

Import the plugin to ur project as a dependency

compact haven
#

what class are you talking about specifically

#

because, for example, PotionEffectType has the get methods necessary

#

AND has a values() static accessor for the array of types

#

it's basically an enum, just as constants

tardy delta
#

it would make more sense to let class T implement Iterable<T>

humble tulip
#

Shade the entire plugin

regal scaffold
#

Wait

#

That's actually not a bad idea wait a second

humble tulip
#

And let the plugin.yml load ur main class

regal scaffold
#

Let me get back to you

#

I gotta fix 1 other thing rq

humble tulip
#

Other option is to write empty classess / methods for everything in the class u wamna change to make it compilable

regal scaffold
#

I wanna try

compact haven
#

sounds like a PR u can make

humble tulip
compact haven
#

but you can

#

I mean you can check those that extend Keyed, perhaps

#

but other than that, I dont believe so

#

Tag does extend Keyed

tardy delta
#

search for enum in code kekw

#

stash

compact haven
#

but he aint looking for the enums xd

tardy delta
#

ah enum alike

pseudo hazel
#

whats the best/easiest way for me to serialize a class that is on its own abstract but I have like 3 implementations of it that all need serialization to a file like yaml or json or whatever

rotund ravine
#

You can just use bukkits serilizable

pseudo hazel
#

how can I read a list of my serialized objects then

#

just using getList and casting?

torn shuttle
#

no

ivory sleet
ivory sleet
#

Might be worth checking instanceof on individual items

pseudo hazel
#

okay and how do I know if I deserialize the base class which subclass i get

humble tulip
#

Hm if a list is empty, how do you check its type?

humble tulip
#

Kinda

#

So

pseudo hazel
#

oh well I guess I have a problem before that

#

which is that the deserialization method needs to be static

humble tulip
#

ConfigurationSerialization.registerClass(Class2.class, "SecondClass");

#

You have to register them

#

Or a constructor

ivory sleet
#

Either you delegate the deserialization

#

Or just do it individually per subtype

humble tulip
#

Or you serialize and deserialize frm a configuration section

pseudo hazel
#

or atleast I think so xD

#

its in a yaml configuration file so I assume those are configuration sections if I get them that way

ivory sleet
#

Yes

#

YamlConfiguration derives ConfigurationSection

pseudo hazel
#

is there like a secret trick

ivory sleet
#

Isnt that just when the block model takes up more than a normal block space

pseudo hazel
#

doors iirc

ivory sleet
#

Dont think it contains any special property apart from that

pseudo hazel
#

nvm im just gonna let itemstack do the serialization for me lmao

#

I am already converting my classes to itemstacks with pdc which is also serialization

summer agate
#

Slightly related to development, Does the spigot website offer a way to post a resource update through an API or something? Ideally I'd like a resource update to be posted when a new GitHub version is released

tall dragon
#

thats not what hes asking right?

#

they want to actually post the update

#

but i dont think spigot has that kind of support

summer agate
#

I'm not looking for an update checker, I am specifically looking for a POST api or whether there is one

tall dragon
#

you can only get information i believe

summer agate
#

Yeah I figured, just wanted to be sure

#

It's kind of bothersome to have to release a release in two places every time since I'd like the spigot page where the plugin is actually findable to be up to date, but have a semi automated release build pipeline on github

tall dragon
#

well, some people for example only release a bit bigger updates on spigot

#

and beta releases / small changes are available on github

#

or something like jenkins

summer agate
#

The way I do it is I have an external URL pointed to that specific release. Only posting large updates would mean that people would still be getting versions with (patched) bugs. Right now we only release with significant bugpatches anyways

rotund ravine
#

I mean the stinky way would just be using reflection and using it either way

summer agate
#

No problem though, it takes 3 minutes since I can literally copy the content of the github release and have it work with all urls functional

sterile token
#

I need some hand, im confuse why i need to use it duplicated, when it should be: platform.getProvider().getSomeSpigotMethod()

#

This is my implementation

eternal night
#

its cooler

sterile token
#

Agree, i find nms really gross because its force to make things over the which you shouldnt be making

eternal night
#

lol

#

a platform of a platform

sterile token
eternal night
#

yes

eternal night
#

think of it as free obfuscation

tall dragon
#

BucketEmptyEvent or something ?

sterile token
#

Nop, its called Fluid something?

rotund ravine
tender shard
#

very useful

torn shuttle
#

the fuck?

remote swallow
#

i think some people are a bit slow

rotund ravine
pseudo hazel
#

i think so, since he isnt dead

torn shuttle
torn shuttle
regal scaffold
#

Hey

#

If I'm making a world generator is there any way to not have to change the bukkit.yml to add the generator

bold crane
delicate lynx
#

would be cool to know the problem

#

actually why do you have 2 else statements for the same if statement

bold crane
#

That's my point how would I initiate another else or do I need to?

delicate lynx
#

you would use another if statement

pseudo hazel
#

wdym another else

#

there is no other else

#

you can do something... or do something else

#

meaning whatever you didnt do at first

remote swallow
#

if {} else if {} else {}

pseudo hazel
#

you probably want to add an else if yeah

sterile token
#

How would you designed a translate method for bungee and spigot colors?

compact haven
#

Aren't bungee colors the same as spigot colors?

#

and if we're on the same page, you can just check CraftBukkit and see the exact implementation & design

sterile token
#

Because i need to call method for replacing colors but as far i dont know what platform they use, i cannot call ChatColor#translateAlternativeCodes()

compact haven
#

@sterile token

#

of those all, I'd recommend #2

#

ehm but do note that the code in ChatColor falls under GPLv3

sterile token
#

๐Ÿ˜‚

#

But thanks for advice

#

What too many things all mixxed

#

You want to get server name from bungeecord right?

quaint mantle
#

yes

sterile token
#

Wait oh no, its the oppsite what you want

#

Lmao i cannot help i dont understand your questions

compact haven
#

he wants to get the server name listed in the bungeecord configs from the backend spigot server

#

am I correct @quaint mantle

quaint mantle
#

yes

compact haven
quaint mantle
#

yep

wet breach
#

is this a public plugin you are making

#

or is this for personal use

quaint mantle
#

personal

#

why

wet breach
#

because you should already know your server names

#

if it was a public plugin, I could understand needing to do that because you obviously wouldn't know what names everyone else chooses

#

but personal use you already have that information

#

just create a config file to hold your server names

compact haven
#

both the command "GetServer" again, and the server name

quaint mantle
#

i know it worked a few years ago but now it only return getserver nothing else idk why

compact haven
#
public class MyPlugin extends JavaPlugin implements PluginMessageListener {
  @Override
  public void onEnable() {
    this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
    this.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", this);
  }

  @Override
  public void onDisable() {
    //make sure to unregister the registered channels in case of a reload
    this.getServer().getMessenger().unregisterOutgoingPluginChannel(this);
    this.getServer().getMessenger().unregisterIncomingPluginChannel(this);
  }

  @Override
  public void onPluginMessageReceived(String channel, Player player, byte[] message) {
    if (!channel.equals("BungeeCord")) {
      return;
    }
    ByteArrayDataInput in = ByteStreams.newDataInput(message);
    String subchannel = in.readUTF();
    if (subchannel.equals("SomeSubChannel")) {
      // Use the code sample in the 'Response' sections below to read
      // the data.
    }
  }
}

(from https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel)
That'll call readUTF() once, which'll remove "GetServer" from it, and then you call in.readUTF() again to get the actual server name

#
    if (subchannel.equals("SomeSubChannel")) {
      // Use the code sample in the 'Response' sections below to read
      // the data.
    }

to

    if (subchannel.equals("GetServer")) {
      String serverName = in.readUTF();
    }
#

definitely should work, at least according to Bungecord source code

quaint mantle
#

ill try

sterile token
#

@quaint mantle please for long codes use ?paste

compact haven
#

that was me mate

sterile token
#

Ohh sorry

remote swallow
#

yo itzdlg, im just about to test this and realised how the hell do i write stuff via DEFAULT

compact haven
#

wdym

atomic swift
#

i have a switch statement to check the value of args[0] and have default:return false;} but it doesnt get called when i dont supply an argument

remote swallow
#

was i just blind

compact haven
#

whats the error?

#

am confused

atomic swift
remote swallow
#

no error atm, im just confused how do i write from ItemBuilder.DEFAULT

compact haven
#

ItemFactory.DEFAULT.write?

remote swallow
#

so i am blind

compact haven
#

paste the ItemFactory code

#

because all DEFAULT is is a static constant of an instnace of ItemFactory

remote swallow
#

it does exist

#

i am and idiot

compact haven
compact haven
#

doesnt your ide pop up with like 2 methods when you typed DEFAULT lol

remote swallow
#

it somehow only appears with read

compact haven
#

whats the access modifier on write

#

I can nearly guarantee it's not public

remote swallow
#

both write

#

i cant english

compact haven
#

lmao the fuck

remote swallow
#

intellij jank

compact haven
#

oh well

compact haven
#

need to send your whole code

#

at least, the entire commandexecutor

quaint mantle
#

ok that worked thank you @compact haven ๐Ÿ™‚

compact haven
#

np sebii

atomic swift
compact haven
#

well you definitely aren't checking console

#

because you'll have a fat error in there

#

ArrayIndexOutOfBoundsException

atomic swift
#

Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0

compact haven
#

correct

atomic swift
remote swallow
#

okay time to test

#

chances it works

compact haven
#

you may not access a value at an index that doesn't exist

#

so the default will only trigger if args[0] was set, meaning you had 1 argument, and it'll trigger if it was netierh "create" nor "collect"

#

you'l need an if statement at the top there to make sure that index exists

atomic swift
#

can i do case null:

compact haven
#

no

atomic swift
#

f

compact haven
#

it throws an error mate, you need that if statement

#

outside of the switch statement

if (args.length == 0) {
  player.sendMessage("/command <collect|create>");
  return true;
}
remote swallow
#

beat me to it

compact haven
#

if you have your usage message setup properly, just a return false will do

atomic swift
compact haven
#

I am well aware of how CommandExecutor functions xd

atomic swift
#

or are you ๐Ÿค”

compact haven
#

look at the message right above you

#

also, just a heads up, your switch will go to the default case if it's Collect, or any case variation of them

#

make sure you #toLowerCase() in the switch statement before you check the cases

remote swallow
tender shard
#

My Spigot Plugin Generator is finally done and fully working, at least on Windows. Maybe someone can try whether it also works on macOS and/or Linux? @remote swallow maybe?

remote swallow
#

ive only got wsl installed atm

tender shard
#

:<

#

anyone here using linux as desktop?

compact haven
#

where is those dependencies from?

tender shard
#

from the archetype-metadata.xml

#

it automatically generates that from the latest archetype version from github

#

now I just gotta setup github actions and then people can use it

compact haven
#

idk much about archetypes tbh

#

do you manually list dependencies? or does it compile from something else

tender shard
remote swallow
compact haven
#

u know how to fix that xd

remote swallow
#

probably

compact haven
#

thats my fault but u can fix that

remote swallow
#

one moment

#

need to turn my brain on

compact haven
#

just set handlers to a new ArrayList in Builder

compact haven
tender shard
#

yeah, pull requests for new dependencies are welcome

compact haven
#

do you have any specific criteria if someone was to PR their dependency on that list? PikaThink

tender shard
#

it shouldnt be something totally niche

compact haven
#

i.e. can I PR CLOUD and IF there lmao

tender shard
#

sure

compact haven
#

PikaThink and where is that cute gui from

#

sorry I was enamored by that

tender shard
#

that's swing + FlatLaf

#

how the fuck do github actions + releases work

#

all actions that I find on google are "syntax errors"

remote swallow
#

oh

#

my

#

god

#

it looks like it works

#

fuck yeah

tender shard
#

what works?

remote swallow
#

do these look at all any different

remote swallow
tender shard
#

nice

remote swallow
#

im hoping on that

#

i now just need to convert the name to its actual name

compact haven
#

@tender shard dependMockBukkit is default'ed true

#

tried it out without any depends and it generated in pom.xml, checked archetype-metadata

#

and the readme says all are meant ot be false by default

#

looks pog Epic

#

did u enjoy refactoring xd

atomic swift
#

do you guys hate me

compact haven
#

for several reasons

#

yes

atomic swift
remote swallow
compact haven
#

you dared show me a sidebar from eclipse or netbeans

remote swallow
#

maximum 12 hours on it

atomic swift
#

bc i dont think its bc i have 3 Ah.java

compact haven
#

thats one of them

atomic swift
compact haven
#

IntelliJ

torn shuttle
atomic swift
#

its eclipse

tender shard
#

none of these shitty "release artifacts" actions work and github also nowhere explains how to do it

atomic swift
remote swallow
worldly ingot
tender shard
atomic swift
compact haven
#

alex did u see my tag

tender shard
#

no

#

where?

tender shard
worldly ingot
compact haven
#

choco u cant even read the titles when I am seriously looking into something

worldly ingot
#

You probably don't need those 15 S/O tabs

compact haven
#

only the icons show

atomic swift
remote swallow
atomic swift
#

thought that would be more

worldly ingot
#

You're all masochists. I'm sitting at only a single pinned tab at the moment, Slack

compact haven
#

when I join a team using slack it'll be open, sometimes

atomic swift
#

i sometimes have over 100

compact haven
#

there's definitely a github workflow for publishing to github packages

remote swallow
#

same concept

tender shard
#

yeah but none seems to be working

#

if anyone finds anything, please lemme know

compact haven
#

ehm u might not be able to automatically publish releases

#

which doesnt make sense

remote swallow
#

im confused

#

somehow before my PotionEffect.toString converted it to its common name, on my createSection it doesnt

compact haven
#

u dun fucked up

remote swallow
#

but where

compact haven
#

you might be out of luck here

compact haven
remote swallow
#

one moment

#
@Override
    public void write(ItemStack item, ConfigurationSection section) {
        ItemMeta meta = item.getItemMeta();
        if (meta instanceof PotionMeta potionMeta) {
            if (potionMeta.hasCustomEffects()) {
                ConfigurationSection potionSection =  section.createSection("effects");
                for (PotionEffect customEffect : potionMeta.getCustomEffects()) {
                    ConfigurationSection customEffectSection = potionSection.createSection(customEffect.getType().toString());
                    if (!customEffect.isAmbient()) customEffectSection.set("ambient", false);
                    if (!customEffect.hasParticles()) customEffectSection.set("particles", false);
                    if (!customEffect.hasIcon()) customEffectSection.set("icon", false);
                    customEffectSection.set("amplifier", customEffect.getAmplifier());
                    customEffectSection.set("duration", customEffect.getDuration());
                }
            }
        }
    }
``` and old one was ```java
if (potionMeta.hasCustomEffects()) {
                    Map<String, String> potionEffectValueMap = new HashMap<>();
                    for (PotionEffect effect : potionMeta.getCustomEffects()) {
                        StringBuilder builder = new StringBuilder();
                        builder.append(effect.getAmplifier());
                        builder.append(" ; ");
                        builder.append(effect.getDuration());
                        potionEffectValueMap.put(effect.toString().toUpperCase(Locale.ROOT), builder.toString());
                    }
                    configurationSection.set("effects", potionEffectValueMap);
                }
atomic swift
#

how do i sterilize an ItemStack

compact haven
#

effect.toString() != effect.getType().toString()

remote swallow
#

well yeah

#

i just tried normal toString

compact haven
#

and?

remote swallow
#

ive already forgot

#

one second

compact haven
#

potionSection.createSection(customEffect.getType().toString()); in new code
potionEffectValueMap.put(effect.toString().toUpperCase(Locale.ROOT), builder.toString()); in old code

#

the only difference is the inclusion of getType()

#

and of course the toUpperCase, but that wont modify it past upper case, ofc

remote swallow
#

customEffect.toString() spits out INCREASE_DAMAGE:(60t-x3)

compact haven
#

my guess is that the rest of the nonsense is removed when it adds it to the configuration section

remote swallow
#

or

#

toUpperCase

compact haven
#

definitely not removing that data

#

but you can just

remote swallow
#

split('(')

compact haven
#

no

#

split(':')[0]

#

why would you split at the parenthesis

#

you dont want anything at or after the colon

remote swallow
#

oh yeah

atomic swift
#

how do i desterilize an ItemStack from its sterilized string form

remote swallow
#

ItemStack.deserialize?

atomic swift
#

i need a Map

compact haven
#

wdym

#

how do u serialize it

remote swallow
#

how did you even manage to get a itemstack to string

compact haven
#

yeah u just assuming we know tf u talking about

atomic swift
remote swallow
#

oh

#

god

#

by chance are you saving it in a config

atomic swift
#

in a database

compact haven
#

please dont

remote swallow
#

well you have 1 issue

#

ItemStack.serialize gives you a Map<String, Object>

#

what are you doing with that

atomic swift
#

yes then i do .toString() and get something like {v=2975, type=SPRUCE_SIGN, meta=TILE_ENTITY_META:{meta-type=TILE_ENTITY, lore=["(+NBT)"], internal=H4sIAAAAAAAA/03KuwrCQBCF4YkghAgWgiBWYWsRvFR2Kl7ACxa+wLgZw+i6K5sJGiTvroIEu3P4/ggggubMOH1dWGEpjpiGUOMEmje2pD2eZZJxakOoz51xHuong/r6uUd6yhi6LyWfoSZqz/aCqdt4zoTRqvLXjKBVNTtMKD4VlQ3/bIuFy6VX2QA6lU1zLexsvHZ5RqoMoLEy7sE2/YYQQPuAd/J9bQgtJUs2Qp6SAOANphosA+AAAAA=, blockMaterial=SPRUCE_SIGN}}

compact haven
#

yeah dont do that

remote swallow
compact haven
#

use #fromByteArray #toByteArray #toComplexString and #fromComplexString from the paste I sent above

#

u just need those methods I sent over my entire item util class

remote swallow
#

you would need to convert that json back to a map, if you want to deserialze

atomic swift
compact haven
#

toComplexString

#

toReadable is simply meant for displaying to users

#

and only has the name of the item & amount

#

and no from method, either

#

sorry I had given u the wrong methods

#

you need to and from complexString lol

#

along with the byte array ones

atomic swift
#

what are the byte array ones for?

compact haven
#

to actually serialize the object

atomic swift
#

hmm good idea

compact haven
#

if your database engine has a blob column type, u can use those directly

atomic swift
#

im using sqlite jdbc driver

compact haven
atomic swift
#

so i would assume it has blob lol

young knoll
#

SQLite is dynamically typed basically

young knoll
#

So it doesnโ€™t actually care

tender shard
#

I mean what's the point of running maven when you cannot even release the artifacts lmao

#

the workflows are sooo useless

compact haven
#

u can auto release to anything else lol

remote swallow
compact haven
#

u can publish a docker image, publish to nexus

tender shard
#

and I dont need to give github my nexus password

compact haven
#

yeah and that only works for you, meaning if I had write and I pushed it wouldnt work

#

and u also wouldnt have any other CI actions

#

remember that CI/CD isn't meant for 1 person and just a solution to deploy, like it's meant for a lot more than that

tender shard
#

I could just give you the nexus credentials, because if you got push permissions to the repo, you can push anything to the repo you like, anyway

compact haven
#

sure, but then what about a code quality check when PRs are made, that's a github workflow xd

tender shard
#

hm idk most of these "code quality" things are complete bullshit

#

i'd much rather use maven's checkstyle plugin

compact haven
#

welp I'm not going to argue the usefullness of CI/CD pipelines

compact haven
#

they'll test the code to make sure it compiles, run tests automatically, and then deploy if so

wet breach
#

you could have a symlink to of a directory to another repo

#

and they wouldn't have push access for that

tender shard
#

i always thought that with github actions, you just make it run maven package, and then the .jar is automatically in the "Releases" section

compact haven
#

github actions != github packages

tender shard
#

obviously it's not the same thing

compact haven
#

and no it would be under the deploy goal

#

but yeah xd

tender shard
#

but github repo also != github packages or github actions

remote swallow
#

why dont potions follow the enchantment stuff

#

like why arent those keyed

compact haven
#

please for the love of god

tender shard
compact haven
#

tell me if there is a way to make google shuffle in search results from "spigot Javadocs" at the end if I type something like "Enchantment"

remote swallow
#

i just have the jds pinned

young knoll
#

Nerd

tender shard
remote swallow
remote swallow
compact haven
#

hm?

#

there is

remote swallow
#

whhat daforick

#

can someone please stop trusting me with a brain

tender shard
#

are you confusing PotionEffect w PotionEffectType?

remote swallow
#

okay well

compact haven
#

^^ my q

young knoll
#

Hey I was the one who made that keyed