#dev-general

1 messages · Page 115 of 1

obtuse gale
#

well....

jovial warren
#

sb.toString()

obtuse gale
#

why is it printing out the right thing

jovial warren
#

no idea

distant sun
#

In what context would you do smth like &#Abcdef and not want it to be a color

obtuse gale
#

also IJ tells me I dont need toString

jovial warren
#

¯_(ツ)_/¯

old wyvern
#

In what Aj?

distant sun
#

You sure thats a stringbuilder?

jovial warren
#

I usually prefer to use Bukkit.server.broadcastMessage() I think it is

#

yeah you sure that's an SB

distant sun
#

The good one at least

true bane
#

@open creek you have 24 hours to check your emails before I open a fraud case against you

#

You have been warned

obtuse gale
#

yes its a string builder lol

distant sun
#

Lol

jovial warren
#

@true bane what did he do?

obtuse gale
true bane
#

Fraudulent chargebacks

prisma wave
#

you don't need to call toString

#

It's implicit

#

Same with concatenation

obtuse gale
#

so why tf this not wrokingREEEE

jovial warren
#

then don't call toString() for Bukkit#broadcastMessage aj

prisma wave
#

Send code

obtuse gale
#

broadcast message needs a string

jovial warren
#
        println("Final sb: $sb")
        Bukkit.broadcastMessage(sb.toString())```

Final sb: $sb prints out the string builder as it should be, but nothing is getting broadcasted

@prisma wave

pallid gale
#

You have 24 hours to check your emails before I open a fraud case against you
Interesting place to send a warning

jovial warren
#

yeah

#

interesting

onyx loom
prisma wave
#

broadcastMessage only messages to people with a permission iirc

obtuse gale
#

wait what

jovial warren
#

no broadcast() requires a perm KM

true bane
#

@pallid gale he blocked my discord so there he will see it

jovial warren
#

broadcastMessage() sends to all

pallid gale
hot hull
#

There's multiple methods.

true bane
#

Oh, where should I put that lmao

pallid gale
obtuse gale
#

whyd u ping him if he blocked you

#

he wont get the ping?

true bane
#

I did email him but he isnt checking it

#

He wont?

pallid gale
#

Yeah he wont

true bane
#

Well fuck lemme make a new discord

obtuse gale
#

thats literally the point of blocking

glad spear
#

Nice dev talk

obtuse gale
#

soo

#

what should i do about my issue lol

prisma wave
#

More relaxed area to discuss development

true bane
#

I mean I coded 2 plugins for him if that counts?

pallid gale
#

Creating new account to bypass blocks is against discords Tos

#

just fyi

prisma wave
#

Try sending it to just 1 player @obtuse gale

onyx loom
#

i DoNt cArE

true bane
#

well fraudulent chargebacks is against my tos so whatever

#

😂

jovial warren
#

I personally use Server#broadcastMessage over Bukkit#broadcastMessage

#

though not sure if it makes any difference

#

probably doesn't

distant sun
#

Sout

hot hull
#

That's why you request 100% upfront lmao

obtuse gale
#

wait is it something to do with frcstys method maybe

prisma wave
#

Potentially

jovial warren
#

show full code

#

not just snippet

obtuse gale
#

Im using frcstys method to convert it to the fancy colours, which returns a string not a text component

prisma wave
#

@jovial warren all the Bukkit methods delegate to Server so no it doesn't matter

hot hull
#

TextComponent.fromLegacyText(String)

prisma wave
#

Pretty sure you need to send a component

jovial warren
#

^^^^

#

not required @prisma wave

hot hull
#

And then you using sender.spigot().sendMessage

prisma wave
#

The colours aren't supported for normal chat

jovial warren
#

if you translate the colour codes then you can send that as a String

prisma wave
#

The hex colours?

jovial warren
#

ChatColor#translateAlternateColorCodes

#

not sure KM

#

but it's always worked before

prisma wave
#

Pretty sure protocol wise they only come from the JSON component

#

this is with the new API

jovial warren
#

ah okay

obtuse gale
#
fun String.colourize():String{
    var translation = this
    var matcher = HEX_PATTERN.matcher(translation)
    while(matcher.find()){
        var hexString = matcher.group()
        hexString = "#" + hexString.substring(2, hexString.length -1)
        val hex = ChatColor.of(hexString)
        val before = translation.substring(0, matcher.start())
        val after = translation.substring(matcher.end())
        val translation = before + hex + after
        matcher = HEX_PATTERN.matcher(translation)
    }
    return ChatColor.translateAlternateColorCodes('&', translation)
}``` thats frcstys method
jovial warren
#

yeah no idea

prisma wave
#

afaik they aren't supported for normal chat

hot hull
#

this is bungee api

#

Since it was moved to that

obtuse gale
#

well how do i broadcast a text component??

prisma wave
#

Just loop all players

hot hull
#

loop through online players

obtuse gale
#

do i have to loop the players

#

ok

prisma wave
#

make a helper function for it

jovial warren
#

wait does ChatColor#translateAlternateColorCodes not support hex colours?

#

that's bull shit

prisma wave
#

fun Bukkit.broadcast(component: TextCompoment) 😏

hot hull
#

Not really

prisma wave
#

The bukkit one doesn't

hot hull
#

KM, I tried that

jovial warren
#

fun Bukkit.broadcast(component: TextCompoment) 😏
that's already a thing afaik

prisma wave
#

Because it's not part of the normal chat

hot hull
#

but it shat itself

heady birch
#
public String translateHexColors(String string) {
        final Pattern hexColorPattern = Pattern.compile("(&#([0-9a-f]{6}))");
        final Matcher matcher = hexColorPattern.matcher(string);

        while (matcher.find()) {
            final String hexColor = matcher.group(2);
            string = string.replace(matcher.group(1), constructChatColor(hexColor));
        }

        return string;
    }

    private String constructChatColor(final String hexColor) {
        final StringBuilder colorBuilder = new StringBuilder("§x");

        for (final char hexChar : hexColor.toCharArray()) {
            colorBuilder.append("§").append(hexChar);
        }

        return colorBuilder.toString();
    }
jovial warren
#

at least, it always has been in the past

heady birch
#

Havnt tested try that

#

Built it from the Chatcolor from bungee

obtuse gale
#

TextComponent.fromLegacy returns like an Array <out> or someshit

hot hull
#

No?

heady birch
prisma wave
#

BaseComponent

#

Send that the.

#

Then*

jovial warren
#

also, I thought things like Bukkit#broadcastMessage would have support for BungeeCord's chat component API

#

like Sender#sendMessage does

prisma wave
#

Bungeecord isn't bundled with bukkit

#

Spigot might patch it

#

Idk

jovial warren
#

but the chat component API has been implemented

prisma wave
#

not in bukkit

jovial warren
#

in Spigot at least

obtuse gale
prisma wave
#

Yes

jovial warren
#

who even uses Bukkit? use Spigot

hot hull
#

How do you convert a Component (from kyori text) to a base component kek?

jovial warren
#

no fucking clue

obtuse gale
#

lol

jovial warren
#

what even is kyori text

hot hull
#

Like I'm legit lost

#

Some text lib

obtuse gale
#

How does fcstys method even work

jovial warren
#

what's the point of it though

prisma wave
#

send the BaseComponent[] with Player.Spigot#sendMessage

#

To all online players

#

Ez

heady birch
#

I'm going to try and test my method now

obtuse gale
#

how do i convert my string to a BaseComponent

prisma wave
#

fromLegacyText

jovial warren
#

that's pretty much what Bukkit#broadcastMessage does KM

prisma wave
#

You literally sent it lol

obtuse gale
#

that was on text component

#

and it returned an array <out> or smthn

jovial warren
#

just for some really stupid reason it doesn't have CC API methods

heady birch
#

E o

hot hull
#

TextComponent.fromLegacyText

#

Which return a BaseComponent

obtuse gale
#

returns an Array <out>

prisma wave
#

I literally said

hot hull
#

No it doesn't Aj..

prisma wave
#

BaseComponent[]

hot hull
#

That's just kotlin being kotlin

prisma wave
#

Array is just the kotlin equivalent

#

Because kotlin arrays are pseudo-higher level

jovial warren
#

hold up

obtuse gale
#

what do i do with BaseComponet[]

#

im confused lol

jovial warren
#

Server#Spigot

prisma wave
#

Player.Spigot#sendMessage

jovial warren
#

has the broadcast methods

#

hold on

hot hull
#

player.spigot().sendMessage(TextComponent.fromLegacyText(Color.colorizeM(msg)));

jovial warren
#

no no no

obtuse gale
prisma wave
#

Use the spread operator

jovial warren
#

Bukkit.server.spigot.broadcast()

prisma wave
#

Ew

hot hull
#

Bardy

obtuse gale
#

spread??

prisma wave
#

No

jovial warren
#

has support for components

hot hull
#

It shits itself

prisma wave
#

Yes

obtuse gale
#

o

prisma wave
#

Converts an array to vararg call

hot hull
#

Eventhough it says it does support that, it doesn't actually

jovial warren
#

use Bukkit.server.spigot().broadcast(BaseComponent[]... components)

prisma wave
#

No

#

Don't

jovial warren
#

why not?

hot hull
#

I just told you ;C

prisma wave
#

It's ugly for one thing

#

And yeah

hot hull
#

It won't work

jovial warren
#

it doesn't support chat components?

prisma wave
#

Frosty said it's broken apparently

jovial warren
#

that's stupid

hot hull
#

I just tested it, it legit doesn't work

heady birch
#

@distant sun Did you want the method for replacing that format?

jovial warren
#

md_5 needs to get his ass in gear

prisma wave
#

Make an extension function on Bukkit

distant sun
#

@heady birch not really but that's nice, ty :)

heady birch
#

I gotta see if it works

#

Servers still generating worlds 🙄

prisma wave
#

a 1 liner is a 1 liner though ¯_(ツ)_/¯

obtuse gale
#

still doesnt work lol

prisma wave
#

elaborate

obtuse gale
#

If I dont put it through frcstys method it works fine

#

Like doesnt get broadcasted

prisma wave
#

could be invalid json

obtuse gale
#

hm

prisma wave
#

moral of the story: frosty bad

obtuse gale
#

does it matter its lowercase?

prisma wave
#

what

obtuse gale
#

the hex code

prisma wave
#

Doubt it

#

That method is kinda gross though

#

Why add # to substring(2) when the # is already present?

#

And the amount of mutability there is disturbing too but maybe that's me being fussy

obtuse gale
#

im passing itA#<fe1d19>B#<19abfe>

prisma wave
#

Ah I see

#

Whats with the A and B?

obtuse gale
#

thats just text lol

prisma wave
#

But like

obtuse gale
#

i put them in the wrong place

#

I know

prisma wave
#

The A won't be coloured lol

obtuse gale
#

but the B should still get converted

prisma wave
#

yeah

obtuse gale
#

iknow lol

prisma wave
#

Print out the JSON

#

I'm gonna guess there's an invalid colour somewhere

ocean quartz
remote goblet
#

are you doing that

prisma wave
#

Invalid messages?

remote goblet
#

in notepad?

remote goblet
#

f

prisma wave
#

ew

hot hull
#

How am I bad ;C

remote goblet
#

obfuscating your code is stinky

hot hull
#

It works perfectly fine for me

obtuse gale
#

how do i get the json??

hot hull
#

Wdym json????

ocean quartz
#

I wonder if i can decompile the jar with the maps to navigate it on IJ

hot hull
#

You're using components

prisma wave
#

Maybe aj broke the method when converting then lol

obtuse gale
#

lol

#
val HEX_PATTERN: Pattern = Pattern.compile("#<([A-Fa-f0-9]){6}>")
fun String.colourize():String{
    var translation = this
    var matcher = HEX_PATTERN.matcher(translation)
    while(matcher.find()){
        var hexString = matcher.group()
        hexString = "#" + hexString.substring(2, hexString.length -1)
        val hex = ChatColor.of(hexString)
        val before = translation.substring(0, matcher.start())
        val after = translation.substring(matcher.end())
        val translation = before + hex + after
        matcher = HEX_PATTERN.matcher(translation)
    }
    return ChatColor.translateAlternateColorCodes('&', translation)
}```
#

I made it a string extension, maybe i fucked up somewhere there

#

oh

prisma wave
#

I'm fairly sure there's a kotlin alternative to Matcher but that's besides the point

obtuse gale
#

waitta minute

#

one sec

#

hol up

prisma wave
#

o_O

obtuse gale
#

this might be a bruh moment

prisma wave
#

The moment of realisation?

obtuse gale
#

hol up

#

recompiling that bad boy

errant geyser
#

AJ if u get that working Ima nick it

#

lmk if u do

obtuse gale
#

nope

prisma wave
#

If not I'll make one

obtuse gale
#

we all good

prisma wave
#

that's idiomatic

errant geyser
#

Senpai pls

hot hull
#

Everyone be nicking shit, when Nicole was the first one to make this :kek:

prisma wave
#

Oh well

hot hull
#

This is the true representation of how lazy devs are

obtuse gale
#

I thought it was because I was redeclaring translation

#

but apparently its not that

prisma wave
#

if you don't want it nicked don't make it open source

errant geyser
#

Why reinvent the wheel when we know something works Frosty?

onyx loom
#

why when i only have one condition it works, but adding the or operator breaks it PES_Cry

    var i = readLine()?.toLowerCase()
    while (i != "paper" || i != "scissors" || i != "rock") {
        println("Invalid Input")
        i = input()
    }
    return i
}```
hot hull
#

Yea was gonna say katsu, but still

obtuse gale
#

The moment of realisation?
nope :((

heady birch
#

No one like my cross platform version 😦

prisma wave
#

it should be && @onyx loom

obtuse gale
#

it sends it to me

#

But its just not coloured

onyx loom
#

wait wot

obtuse gale
#

nope

#

i just

#

hol up

#

i think i

onyx loom
#

isnt && AND?

obtuse gale
#

recompiling ONCE AGAIN

prisma wave
#

Yes

hot hull
#

Aj, clean and compile

obtuse gale
#

ey

#

it works

errant geyser
#

Yeah KM AJ's lost his mind, we're gonna need yours

obtuse gale
#

Im dumb

prisma wave
#

You want to say it's invalid if it's not rock, AND it's not paper, AND it's not scissors

errant geyser
#

o nice

prisma wave
#

Not or

hot hull
#

See, I no dumb

onyx loom
#

ah i see

prisma wave
#

Rock != Scissors so the condition always succeeds

#

or

hot hull
onyx loom
#

the saviour has came to my rescue

#

thank u very much

obtuse gale
#

that took too long to make lol

heady birch
#

Frosty what you trying to do

#

I havnt updated the expansion yet

obtuse gale
#

It gets the amount of characters in your message, generates that amount of hex codes, and puts one before each thing, so you can make a gradient with any colour

prisma wave
#
val ALLOWED_INPUTS = setOf(
  "rock", "paper", "scissors"
)

if(i !in ALLOWED_INPUTS)``` much better
hot hull
#

Niall not an expansion

#

Using MiniMessage, but not sure if it even has rainbow

obtuse gale
#

someone give me two random hex codes

#

I wanna test this lol

hot hull
#

#4a56b9

versed ridge
#

#a3f577

obtuse gale
heady birch
#

Nice work

#

I still havnt gotten mine to work

obtuse gale
#

mine used alot of copy and pasted code lol

heady birch
#

Let alone this server keeps timing out every 10 minutes

obtuse gale
#

dont ask me how this works lol

#

cos i have no clue

onyx loom
#

bm that setOf didnt work, saying it found String? instead of String. oh well

heady birch
#

Yeah you got to calculate a step

#

To fit the gradient in

#

When you have 2 chars the step is literally the range between the two colours you entered

#

If you have 10 chars the step would be the range between two colours / 10 e.g

obtuse gale
#

this doesnt work for 1 letter messages

#

no clue why

heady birch
#

Im going to assume your joking

#

Lol

obtuse gale
#

no as in

#

no message gets sent

#

not the gradient doesnt work

heady birch
#

Oh lol

#

Probably because it has no effect anyway

prisma wave
#

oh is i nullable @onyx loom ?

#

do (i == null || i !in ALLOWED_INPUTS)

onyx loom
#

o

#

didnt realise it was

#

works

prisma wave
#

you might wanna do i.toLowerCase too

onyx loom
#

its in readline

#

var i = readline?.toLowerCase()

prisma wave
#

O yes

onyx loom
#

🙂

prisma wave
#

btw I think i could be a val

#

And you do return input() instead of i = input()

#

Slightly cleaner imo

#

And you could use if instead of while then

onyx loom
#

done

prisma wave
#

nice

#

Recursion good

onyx loom
#

would u like a full code review laugh

#

its fukin awful

prisma wave
#

I'll be a minute to get on pc but sure lol

onyx loom
#

fuck do i really wanna share this

#

ok fine

prisma wave
#

I've seen worse tbh

#

but

onyx loom
#

but

prisma wave
#

Sec

errant geyser
#

Hey KM you should review my god awful Kotlin

prisma wave
#

sure

onyx loom
#

i could probably make allowedInputs constant right?

prisma wave
#

i was just about to say that

#

companion object

#

you should probably also make all the strings constants

#

you can use const val for that

#

I would use a raw string (""") instead of \n

#

and would use repeat(5) instead of for (round in 1..5)

onyx loom
#

how would i get the iteration of the repeat?

#

oh wait id just make a new var laugh

prisma wave
#

fun repeat(times: Int, run: (Int) -> Unit)

#

it takes a lambda

#
repeat(5) { round -> 
  //blah
}```
#

finally computerChoice could be simplified a bit

#

the computerChoice variable is useless

#

because when is an expression

#
return when(randomNumber) {
  1 -> "rock"
  2 -> "paper"
  3 -> "scissors"
}```
#

you could also make all of the options an enum

#

and have the winning resolution resolved in there

onyx loom
#

even better

        1 -> "rock"
        2 -> "paper"
        else -> "scissors"
    }```
#

😄

prisma wave
#

true

onyx loom
#

tell me more about enum?

prisma wave
#
return listOf("rock", "paper", "scissors")[(1.3).random()]
#

perfection

#

1 sec

#

planning it out

prisma wave
#

x?

#

oh yeah

#

¯_(ツ)_/¯

#

ok @onyx loom maybe nvm about the enum I couldn't figure out a way of making it nice

onyx loom
#

hmm

errant geyser
prisma wave
#
       dataFolder.mkdirs()
        saveResource("config.yml", false)

saveDefaultConfig() does this

#

the builder pattern in kotlin is kinda ew but ik that's just the lib you're using

#

ArmyCommand.plugin could be val

#
   inventory.setDefaultClickAction { event -> event.isCancelled = true}``` this could benefit from a line break here and there
#

private val inventory: Gui = Gui(plugin, InventoryType.HOPPER, "Warriors") no need to declare the type here

errant geyser
#

the builder pattern in kotlin is kinda ew but ik that's just the lib you're using
MF-GUI

#

Blame Matt

prisma wave
#

the things in Extensions should be separated more cleanly - put your string extension functions in things like Strings.kt, etc

#

yeah

#

might fork and add some kotlin extension functions 😏

#
fun getPluginConfig(): ConfigurationSection {
    return JavaPlugin.getPlugin(ZombFields::class.java).config
}

fun getPlugin(): ZombFields {
    return JavaPlugin.getPlugin(ZombFields::class.java)
}``` the very existence of these 2 is... questionable. 
I don't think static access should be that simple, as it becomes something you rely on more often
#

you should be prioritising DI

#

Countdown.kt should use the bukkitRunnable function you defined

#

and should be using val unless it needs to be mutable

#

like in java

#

I don't think Countdown should be responsible for parsing the time input either. It should take a Long time, probably in ticks, and deal with it. parsing should be done in a different class

#

val countdowns: HashMap<UUID, Countdown> = HashMap()
since it's static, it should be COUNTDOWNS, and should probably also be val COUNTDOWNS = mutableMapOf<UUID, Countdown>(). Follow Liskov

#

although having countdowns be static seems a bit of an odd decision

#

either make CountdownManager an object and leave it at that, or make none of it "static"

#

that's all I think

errant geyser
#

oh dang, I got the full KM experience huh? Ima just take a minute to read it all

prisma wave
#

yep you did

#

an honour I'm sure

errant geyser
#

Used primarily in my Enum class to get my plugin config since I use its constructor for, well, the Enum

#

Its a great honour, yes. Idk if theres a bow discord emoji but if there is, I'll use it

prisma wave
#

that may be, but I think you should be calling the long methods manually

#

having the static access so accessible means that you're more likely to use it later as an easy way out

#

plus it's less explicit

errant geyser
#

might fork and add some kotlin extension functions 😏
Wall of fame material

#

As for the rest I'll fix it rn

prisma wave
#

awesome

obtuse gale
#

never used .filter before, but is this how i would use it?

#
        Bukkit.getOnlinePlayers().filter{ it.hasPermission("whatever.whatever") }.forEach{
            
        }```
prisma wave
#

yes

obtuse gale
#

alright

prisma wave
#

but ideally on a new line

obtuse gale
#

lol

prisma wave
#

because that lambda is ugly as hell

#

it's the same as java's filter

ocean quartz
#

Ugh finally managed to update the plugin to 1.16, one letter change and boom it's all broken lmao

prisma wave
#

rip

heady birch
#

Eh

#

I've just seen all the logic going on behing IChatBaseComponent's serializer

obtuse gale
#

it's the same as java's filter
never used that either

errant geyser
#

I've used it like once and I was so proud

prisma wave
#

👏

#

streams bad though

errant geyser
#

I used a stream

#

😦

prisma wave
#

they slow

#

kotlin inline collection functions good

#

fast

errant geyser
#

I was so proud

return getAPI().getParty(party).getOnlineMembers(true).stream().map(partyPlayer -> Bukkit.getPlayer(partyPlayer.getPlayerUUID())).collect(Collectors.toSet());``` takes some Party plugins players that are online and converts them all to players. I get excited over one liners, ok? Leave me alone
obtuse gale
#

imagine knowing what a stream is

prisma wave
#

that... is hideous

errant geyser
#

But it works

prisma wave
#

🤮

errant geyser
prisma wave
#

that's a lot of packages

heady birch
#

Is IChatBaseComponent getString implemented from Message class what's sent as the packet payload

obtuse gale
#

is there a better way of doing this?

        if(Bukkit.getVersion().contains("1.16")){
            player.spigot().sendMessage(*TextComponent.fromLegacyText("#<B518AF>You have done thing".fancyColour()))
        }else{
            player.sendMessage("&cYou have done thing".regularColour())
        }```
hot hull
#

Yes

#

public static final boolean HEX_USE = Bukkit.getServer().getClass().getPackage().getName().contains("16");

#

😏

obtuse gale
#

I mean the messages lol

#

like the if/else

hot hull
#

I mean not really

obtuse gale
#

oof

#

There needs to be a way to get the closest legacy colour from the hex lol

hot hull
#

That'd be an oof

frail glade
heady birch
#

Pointless

#

String -> Text Component ->Json -> IChatBaseComponent -> Probably back to json -> Packet sent to Client

#

I got a possible work around, do I want to disclose it though

frail glade
#

Just tested it. Worked first try from what I can see, KM.

prisma wave
#

awesome

heady birch
#

Ugh I hate libraries

prisma wave
#

basically, the gradle plugin doesn't do everything - you still need the runtime (which is tiny) shaded, which actually does the downloading and classpath stuff. this is found at me.bristermitten:pdm:version. it'll be shaded automatically by the plugin, but if you want to do it yourself you can do disableRuntimeBundling() and declare it manually

frail glade
#

Ahh

obtuse gale
#

I feel like this is an incredibly stupid question rn lol

#

So basically If I have a list of UUIDs, in the main class, and I wanna pass it to command classes, I do that with DI, but if I edit the list in one of those command classes, it wont be edited in the other command classes will it?

#

I feel like thats a dumb question lol

prisma wave
#

it will be modified

#

which is why passing mutable types around is dangerous

obtuse gale
#

well I mean

#

I want it to be modified lol

#

Im just getting some weird results

old wyvern
#

There needs to be a way to get the closest legacy colour from the hex lol
Distance formula should apply same here,
sqr root of sum of differences of R, G and B values

#

pick the one with the least distance

prisma wave
#

Im just getting some weird results

which is why passing mutable types around is dangerous

obtuse gale
#

define dangerous

prisma wave
#

you shouldn't pass a mutable list

#

your function should return the values that should be added

#

and the caller function should control the mutability

obtuse gale
#

its a command

prisma wave
#

define dangerous
can cause bugs basically

#

then you should encapsulate access to the list via another class

#

don't just expose the MutableList type

obtuse gale
#

wdym

old wyvern
#

I want it to be modified lolHave functions on the injected main class to do the modifications for you instead

prisma wave
#
class ListController {
  private val list = mutableListOf<Any>() 

  fun add(value: Any) {
    //perform checks on value
    list.add(value)
  }
}```
old wyvern
#

^

obtuse gale
#

o

prisma wave
#

you should never be directly exposing any mutable type

old wyvern
#

Also probably shouldnt be having the UUIDs stored in the main class

ocean quartz
#

Anyone know how to make an IChatBaseComponent? xD

jovial warren
#

why?

obtuse gale
#

I want something to happen the when someone places down lava, but i dont want it to happen if the last placed item was lava, so it will only run if the last placed thing was not lava

#

Would I just store thing in like a Map<Player, IDK>

old wyvern
#

If its only to check if last placed was lava, you could get away with just using a set of Players or UUIDs

obtuse gale
#

Hey all, does anyone know how to make a rectangular world border? I can only seem to make square ones.

jovial warren
#

don't think they exist

obtuse gale
#

I've seen it done before but they often require other plugins.

#

I was wondering how they did it.

jovial warren
#

¯_(ツ)_/¯

obtuse gale
#

alrigth I'll mess with some apis

hot hull
#

@ocean quartz This is how

    private static Object createIChatBaseComponent(String text) throws ReflectiveOperationException {
        return chatSerializerMethod.invoke(null, "{\"text\":\"" + text + "\"}");
    }
heady birch
#

It's poor

#

You got through 3 different apis to do one thing

prisma wave
#

3?

jovial warren
#

what?

#

also why would one want an IChatBaseComponent?

#

also @heady birch I need some help with my bot lol

heady birch
#

I mean internally

jovial warren
#

I mean maybe it's not a Spring issue

heady birch
#

String -> Text Component ->Json -> IChatBaseComponent -> Probably back to json -> Packet sent to Client
@heady birch

#

Whats the issue

jovial warren
#

okay that's a lot

#

basically, I've got my TrackService set up, which in one of the methods it calls AudioPlayerManager#loadItemOrdered, which is supposed to load the item

#

yet it can't seem to find any results for certain queries

heady birch
#

Hm

#

Not sure if you mean a Jpa Repository or not?

#

Or a normal class

jovial warren
#

and the old one found results and played them just fine

#

a Jpa repo?

heady birch
#

Database

jovial warren
#

no databases here

#

it's supposed to query youtube and find a search result, then play that

#

and it did that just fine before, but it doesn't seem to want to do it now

#

idk why

#

if I debug it, it shows that it's doing it properly and sending it the right thing

heady birch
#

Hm

#

Whats in the class?

jovial warren
#

in TrackService?

#

or in my ResultHandler implementation

#

the one that handles the result of loadItemOrdered

heady birch
#

The one you get the results from

jovial warren
#

the AudioPlayerManager?

#

Future<Void> loadItemOrdered(Object orderingKey, final String identifier, final AudioLoadResultHandler resultHandler);

#

which gets implemented like this:

@Override
public Future<Void> loadItemOrdered(Object orderingKey, final String identifier, final AudioLoadResultHandler resultHandler) {
  try {
    return orderedInfoExecutor.submit(orderingKey, createItemLoader(identifier, resultHandler));
  } catch (RejectedExecutionException e) {
    return handleLoadRejected(identifier, resultHandler, e);
  }
}
heady birch
#

The only thing i can suggest

#

Is make sure they are all annotatted with service I guess

jovial warren
#

AudioPlayerManager isn't my class, so ofc it isn't

#

but it's beaned

#
@Component
class AudioPlayerManagerBean {

    @Bean
    @Scope("prototype")
    fun audioPlayerManager(): AudioPlayerManager = DefaultAudioPlayerManager()
}
#

okay apparently there's no autowiring for MusicService

#

lemme see

ocean quartz
#

@jovial warren Trying to fix the JSON message lib to work on 1.16 and the packet requires IChatBaseComponent

jovial warren
#

ah okay

#

@heady birch you wanna come and have a look around for yourself?

#

send me a friend request and I'll send you my anydesk code lol

prisma wave
#

why does the spring initializr use the kotlin DSL 😔

gusty fulcrum
#

before I request it as a paid job I just want to make sure my idea is possible. Is there a way to make an alert system for owned faction land? So if a faction owns land and a enemy faction member comes within 100 blocks it alerts the faction land owners?

jovial warren
#

because Kotlin DSL better @prisma wave

#

🙂

gusty fulcrum
#

I imagine it could cause lag if not done properly

prisma wave
#

no it's not

#

it sucks

#

@gusty fulcrum theoretically possible

jovial warren
#

there isn't much difference

prisma wave
#

there kinda is

#

the dsl is more verbose

#

and uglier

gusty fulcrum
#

can you think of any issues with the idea?

prisma wave
#

not really, although if it was badly made it could cause lag

gusty fulcrum
#

could you suggest anyone?

jovial warren
#

oh well @prisma wave

prisma wave
#

😦

#

@gusty fulcrum anyone with the dev role is guaranteed to be at least semi-competent

jovial warren
#

hey you able to take another look around my project by the way?

prisma wave
#

but it's kind of a mixed bag lol

#

not right this minute

jovial warren
#

alright

gusty fulcrum
#

Okay thanks

modern garnet
#

How to get Guild claims from API ?

jovial warren
#

which API for which plugin for what software?

modern garnet
#

Guilds

jovial warren
#

Spigot plugin?

modern garnet
#

yeah

#

wrong channel?

jovial warren
#

@frail glade you might know this

prisma wave
#

technically yes

jovial warren
#

we can't see #guilds smh

modern garnet
#

I don't have access to guilds

prisma wave
jovial warren
#

^^^^

prisma wave
#

but i don't own it so ¯_(ツ)_/¯

modern garnet
#

I don't need support

#

I'm asking because somebody asked for Guilds support in one of my plugins

prisma wave
#

asking how to use the API is still needing support i guess

jovial warren
#

^^^^

prisma wave
#

but it's open source

#

it's probably fairly obvious

jovial warren
#

yeah Guilds is fully OS

modern garnet
#

Since it has a strange way of dealing with claims

#

I guess I wanted to save some time and ask

jovial warren
#

there we go

#

clipboard errors lol

modern garnet
#

I already know the repo link

#

I did not ask for the repo link

#

Sorry for assuming HelpChat would help

prisma wave
#

that sounds awfully passive agressive considering we are trying to help

#

that wasn't so hard

#

took about 2 minutes of browsing

modern garnet
#

That's a kotlin class

jovial warren
#

and... your point is?

prisma wave
#

so what?

jovial warren
#

Kotlin better anyway

#

idk what your point is here lol

modern garnet
#

Point is I won't shade kotlin for a 100kb plugin

prisma wave
#

you don't need to

jovial warren
#

^^^^

prisma wave
#

it'd be shaded into guilds

jovial warren
#

just set scope provided

#

yeah

prisma wave
#

so you can treat the classes as provided

heady birch
#

KOT LIN

prisma wave
#

GOOD

heady birch
#

JAVA

modern garnet
#

NICE

jovial warren
#

@heady birch you read a ma messages

prisma wave
#

BAD

#

:)

heady birch
#

yes

#

I have no idea im afraid

jovial warren
#

you send me a friend request?

heady birch
#

and kind of busy sorr

topaz bay
#

Thats odd that it takes an instance of worldguard wrapper

modern garnet
#

Yeah

prisma wave
#

you're odd

topaz bay
#

Ok pharmacy boy

modern garnet
#

I'll try and suggest to use another plugin first

prisma wave
#

but yes I agree

#

pharmacy??

topaz bay
#

LOL

#

There was a pharmacy in the background of the snap you sent

prisma wave
#

oh yeah lol

#

it was a nice view

topaz bay
#

nah

#

it was smol

#

Like you

prisma wave
#

I would never need a pharmacy

jovial warren
#

lol

topaz bay
#

😈

prisma wave
#

i'm in perfect health

#

and perfect size

topaz bay
#

WHAT

prisma wave
#

:)

#

jesus

topaz bay
#

Pharmacies are fire for random shit

prisma wave
#

can't type

topaz bay
#

They got the good shit

prisma wave
#

indeed they are

jovial warren
#

Pharmacies are good

prisma wave
#

but i could live without them

#

probably

jovial warren
#

they are where I get my ADHD medication from

topaz bay
#

I wonder, was that a 100% pharmacy

#

Or was it like a CVS

#

I dont think we have pure pharmacies here

prisma wave
#

that's odd

topaz bay
#

Theyre always inside of other places

prisma wave
#

the one in question is for buying things and picking up prescriptions

#

is that unusual in the states?

topaz bay
#

I dont think Ive ever seen a building who's only purpose is a pharmacy

prisma wave
#

oh lol

#

strange

topaz bay
#

Ive also like... hardly ever get prescribed things so... meh

prisma wave
#

same

#

¯_(ツ)_/¯

jovial warren
#

yeah we have Pharmacies everywhere

#

on their own I mean

prisma wave
#

and rightly so

#

god save the queen

#

🇬🇧 🇬🇧 🇬🇧

#

/s

jovial warren
#

usually they'd be in some sort of parade of shops

topaz bay
#

get that imperial shit out of here

prisma wave
#

just in case

prisma wave
#

most are standlone here

topaz bay
#

LMFAO

jovial warren
#

we have streets of fully attached buildings

prisma wave
#

oh yeah

#

@topaz bay well we all know who won the war :)

jovial warren
#

yeah not us

remote goblet
prisma wave
#

that's horrible

remote goblet
#

its perfect wdym

topaz bay
#

The usa knows no defeat babyyyy

prisma wave
#

cough vietnam

jovial warren
#

like parades of shops

prisma wave
#

we don't have those here

jovial warren
#

yw?

prisma wave
#

or at least I've never seen one

topaz bay
#

I dont think vietnam counts as a "lose"

prisma wave
#

debatable

remote goblet
prisma wave
#

wow

hot hull
#

Adding brackets doesn't make it more appealing Ori

topaz bay
#

¯_(ツ)_/¯

#

Technically, we withdrew

prisma wave
#

doesn't mean you won

topaz bay
#

We didn't surrender

prisma wave
#

that's what they all say

remote goblet
#

List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<String>>>>>>>>>>>>>>>> stringList = new ArrayList<>();

prisma wave
#

AAAH

hot hull
#

Stop it Ori

#

Get some help

prisma wave
#

i mean it'll just compile to List

remote goblet
jovial warren
#

beautiful
why the fuck is that possible

#

nobody likes your pointless coding style

prisma wave
#

i mean it's very future proofed

jovial warren
#

it's very stupid

prisma wave
#

who knows what kind of data you might need to store

jovial warren
#

and memory inefficient

prisma wave
#

that method covers it all

#

actually it's not

jovial warren
#

that's gotta be large in memory

prisma wave
#

well it kind of is

jovial warren
#

I suppose if you filled it

prisma wave
#

but remember type erasure is a thing

jovial warren
#

can you even fill a List<E>?

prisma wave
#

not that that matters

#

depends on the implementation

remote goblet
#

idk what everyone is talking about

prisma wave
#

ArrayList yes

remote goblet
#

i dont see the issue with that

prisma wave
#

LinkedList you could keep going until you ran out of memory

#

in theory anyway

jovial warren
#

just throw it on one of google's massive servers

#

and give it infinite swap

#

or the entirety of the hard drive's worth of swap

#

that'll take long to fill

remote goblet
#
LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<LinkedList<String>>>>>>>>>>>>>>>>>>>>>>>>>>>> list = new LinkedList<>();
``` not good?
jovial warren
#

oh ffs

remote goblet
#

its giving me a headache even making it lmao

jovial warren
#

that's like a 30-dimensional list

#

for no absolute reason whatsoever

#

if you can find a use for that I'll pay you £1

#

and the use has to be verified by me btw

#

anyway cya lot later

prisma wave
#

Adios

remote goblet
#
Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<Map, Map<String, String>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> mapList = new HashMap<>();
``` even better
heady birch
ocean quartz
#

The lines don't get close than that right?

errant geyser
timid niche
#

Hey! How do I code a OnlyProxyJoin-Plugin?

errant geyser
#

So only joining from the proxy ip/port?

timid niche
#

Yeah. I tried already the OnlyProxyJoin-Plugin, but it didnt worked.

#

Idk y

errant geyser
#

AsyncPlayerPreLoginEvent, you could probably check it in there (match from config), and if they're coming from outside the IP, disallow it

timid niche
#

Hmm ok

#

And are you sure, that the player will have the same ip the server has?

#

Or proxy

#

Cause, I think that's the problem

errant geyser
timid niche
#

Ty, pal. :3

errant geyser
#

Even better idea: write it in Kotlin

onyx loom
#

🙂

timid niche
#

Im learning new things here. :3

hot hull
#

SpOnFeEd

timid niche
#

Yeah. Sure

#

I will now try to understand the code.

timid niche
#

So, what does a Executor Service do? Does it wait until this happens, what this Future submits?

prisma wave
#

@errant geyser not entirely sure, Probably a DSL for item building, and some other stuff. Never actually used the framework so I don't really know what's in it

errant geyser
#

hmmm ok

ocean quartz
#

@topaz bay Curious question, why are these files lower case?
Are KT function files supposed to be like that? ;o

topaz bay
#

Because theyre just files

ocean quartz
#

Ooh okay thank you, naming some right now so wanted to do it right ;p

topaz bay
#

I'm pretty sure the convention is still to use camel case

#

but I dont care..

#

Its easier for me to do it this way

prisma wave
#

easier how lol

topaz bay
#

camel case is how we define classes

#

at a glance, its easier to see that these sort of files are not classes

prisma wave
#

fair point

#

but i guess that's implied by the name of the file rather than the capitalization anyway

topaz bay
#

ProcessDeclarations.kt

#

Is what the example gives

#

Who's to say that isn't the name of the class in that file

lavish notch
#

The local variable player may not have been initialized

remote goblet
#

Jesus

#

christ

lavish notch
#

How could I fix this?

remote goblet
#

what is that

lavish notch
#

A flytime plugin, @remote goblet

remote goblet
lavish notch
#

How could I fix this?

remote goblet
#

in the meanest way i can put this

#

delete it

ocean quartz
#

player doesn't exist, you named it p

remote goblet
#

well i lost 10 braincells

#

nice

ocean quartz
#

Oh wait the player down there is not initialized

#

This is null ^

lavish notch
#

How do I initialize it?

jovial warren
#

@lavish notch rewrite the whole damn lot lol

topaz bay
#

....

ocean quartz
#

Just use p there is no point in declaring it again

topaz bay
#

what the HELL Mackenzie...

jovial warren
#

code quality < 0

lavish notch
#

It's not my code....

topaz bay
#

Good

jovial warren
#

fair enough

topaz bay
#

Delete it.

errant geyser
#

rewrite it

lavish notch
#

Trying to update an old plugin

jovial warren
#

rewrite it

errant geyser
#

Also Eclipse stinky

topaz bay
#

rewrite it

remote goblet
#

rewrite it

jovial warren
lavish notch
#

I barely know plugin development lol

remote goblet
#

even my code doesn't get that bad pepega

errant geyser
#

rewrite it in KOTLIN

jovial warren
#

^^^^

onyx loom
#

katsu always with the big brain...

remote goblet
#

rewrite it in CSS

errant geyser
onyx loom
#

😄

jovial warren
#

lol

errant geyser
#

Thx Kaliber for the truly inspirational meme

onyx loom
#

wait why do i have 2 reddit accounts wtf

errant geyser
#

¯_(ツ)_/¯

onyx loom
#

Kqliber is when i got the memes on my phone, ItsKaliber is logged in my pc

topaz bay
#

This is still bullying btw

onyx loom
#

LMAO

jovial warren
#

yeah

onyx loom
#

man this sub is great

topaz bay
#

I hate everyone involved in this

jovial warren
#

that was BM

onyx loom
#

i hope u are all members

jovial warren
#

MCKnightz

#

that's definitely @prisma wave

topaz bay
#

I know

jovial warren
#

it's funny though you gotta admit

#

and true

onyx loom
#

good meme format 10/10

topaz bay
#

IT AINT TRUE

prisma wave
#

yeah that's me @jovial warren

topaz bay
#

Its only... slightly true...

#

;(

jovial warren
#

both you and I know that's true

#

and there's no denying

prisma wave
#

spitting fax

jovial warren
#

unless you can't see yourself sx

topaz bay
#

ugh.. I love sandra bullock

jovial warren
#

lol

errant geyser
#

I hate everyone involved in this
Sx we recognise you as our lord and saviour and you treat us like this?

onyx loom
#

^

topaz bay
#

You DARE to strike your GOD

jovial warren
onyx loom
#

our great and wise prophet

jovial warren
#

that's true

errant geyser
#

sorry papa

jovial warren
#

that one's definitely true

remote goblet
#

i need to watch into the spiderverse

topaz bay
#

Are we WRONG THOUGH

#

ARE WE?!

remote goblet
#

usually you are

onyx loom
#

@remote goblet lets watch together

#

i havent either

#

little date

remote goblet
#

owoPlease👉👈

ocean quartz
topaz bay
#

gay

remote goblet
#

also i can say shit like that because im blocked by sx so he doesn't see itHR_HatDab

#

i think

onyx loom
#

sx join us 😦

remote goblet
#

pls no

topaz bay
#

Absolutely fucking not.

onyx loom
#

y not

remote goblet
#

thank god

topaz bay
#

Fuck that kid, that's why

onyx loom
#

LMAO

remote goblet
#

its illegal

#

thats why

jovial warren
#

I fucking love Kotlin, look at the difference
👍

remote goblet
#

is spiderverse on disney+

#

if not

jovial warren
#

gj

remote goblet
#

ima riot

#

i dont feel like pirating today

onyx loom
#

it should be thonk

#

marvel is there

remote goblet
#

they dont have all the ice age movies

#

which is a fucking scam

#

so EmiShrug

onyx loom
#

😮

#

WHAT

remote goblet
#

they're missing the dinosaur one

onyx loom
#

thats illegal

remote goblet
#

thats the coolest one

onyx loom
#

i cant really remember ice age

#

all i remember is sid

remote goblet
#

i remember the sid shuffle i think

onyx loom
#

YES

#

epic moment

remote goblet
#

sid shuffle > tootsie slide

onyx loom
#

sjkid zthe szhloth

remote goblet
#

its not on disney+

onyx loom
#

😔

#

lets riot

remote goblet
#

this is all the spiderman movies/shows

#

the disney & marvel relationship is wack because they can't get the rights to the decent shit

topaz bay
#

Disney owns Marvel

#

You mean the Disney and Sony relationship is whack

remote goblet
#

yea

topaz bay
#

Sony owns Spiderman, and they are pussies about it

remote goblet
#

but atleast we still hopefully can get tom holland's spiderman

remote goblet
#

i love doja on ig recently lmao

errant geyser
#

Daily reminder Kotlin gud

remote goblet
#

Daily reminder to nest the fuck out of your List<E>

errant geyser
#

List<Object>, God

remote goblet
#

no

#
List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<String>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> stringList = new ArrayList<>();
#

like this

errant geyser
#

Disappointed you didn't use an Object rather than a string

#

Looks cool tho

#

In Kotlin would that be like 100 nested mutableListOf() calls?

prisma wave
#

listOf

onyx loom
#

what the fuck ori

prisma wave
#

or not

#

it would be pretty much the same in kotlin

#

but val stringList = listOf(listOf(listOf(listOf(listOf(listOf(listOf(listOf(listOf(listOf(listOf(listOf())))))))))))))))))

onyx loom
#

anyone made some more kotlin memes?

errant geyser
#

I'll draw one tomorrow

onyx loom
#

no now

#

theres no excuse aPES3_PeepoAngry

errant geyser
#

Mobile tho

#

And u said 4hrs of sleep isnt good

onyx loom
#

oh right yeah go to sleep

errant geyser
#

If I put effort into it its gonna take me days on mobile

jovial warren
#
List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<String>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> stringList = new ArrayList<>();

@remote goblet that doesn't even compile smh

errant geyser
#

I like how you actually tried that

jovial warren
#

lol

onyx loom
#

not enough nesting there thats why

jovial warren
#

not enough nesting on the actual assignment

prisma wave
#

uh

#

diamond operator?

#

compiles fine for me

errant geyser
#

Nice

#

Bardy you got any idea about my Certbot crap?

topaz bay
#

certbot bad

#

do it manually

#

/s

errant geyser
#

Certbot stinky. I spent like 4hrs trying last time and Bardy had to do it for me, tho idk what he did

topaz bay
#

certbot is literally the easiest way to manage ssl certs in the history of computing

#

How tf do you manage to fuck it up

errant geyser
#

certbot certonly --standalone -d katsumag.me comes back the request timed out, verification failed. Port 80 and 443 are open, DNS records pointing to my VPS

#

¯\_(ツ)_/¯

topaz bay
#

Uhhhh

#

Youre using standalone, which would imply you have no server software?

#

Which would beg the question of why you are specifying the domain in the command?

#

They give you exactly what to run on their website, based on which software and OS youre running

errant geyser
#

And I ran what it gave me .-.

#

Which is certbot certonly --standalone, then type your domain when prompted. But you can pass it in as a flag so I do that instead

#

Using CentOS 7 and Caddy

topaz bay
#

Are you not using server software?

errant geyser
#

Wdym exactly?

topaz bay
#

Youre using caddy

#

Which is running?

errant geyser
#

No

#

The site says to stop your web server before running Certbot

topaz bay
#

Are you sure its stopped?