#dev-general

1 messages ยท Page 139 of 1

obtuse gale
#

init is the constructor block?

#

isnt it?

analog crater
#

So what is lateinit

obtuse gale
#

you dont have to initialize the variable there and then

#

and it throws an error if its not initialized i tihnk

prisma wave
#

lateinit means you don't have to give it an initial value without it being nullable

analog crater
#

Ok thnk

prisma wave
surreal quarry
#

this might be bad practice but i use lateinit a lot of my manager variables and for my plugin
i do a lateinit var plugin: MyPlugin
then in my onEnable i do plugin = this that way i can just call plugin anywhere in my project and it has an instance of my plugin

prisma wave
#

well DI is always preferable

surreal quarry
#

DI?

quiet depot
#

"Pop my cherry"

obtuse gale
#

?kotlin-dependency

compact perchBOT
#
FAQ Answer:

Dependency Injection
Dependency injection is when we pass a class through other class constructors to access that specific class in those other classes.

class Main : JavaPlugin() {
    
    override fun onEnable() {
      val other = Other(this)
      
      other.method()
    }
    
    fun myMethod() {
       /* Some code goes in here */
    }
}
class Other(private val main: Main) {

    fun method() {
      main.myMethod()
    }
}
quiet depot
#

questionable

#

but k

prisma wave
#

that was clip

frail glade
#

Damn ya'll still in voice

prisma wave
#
// clip - start
fun firstTime() = println("This is my first time using kotlin. Pop my cherry")
// clip - end```
#

it was the only plugin I had easily accessible lol

#

ah

#

I just looked up what that phrase meant

#

yeah time to change that I think

obtuse gale
#

o

prisma wave
#

lmao

obtuse gale
#

"Vulgar slang"

old wyvern
#

You didnt know what popping the cherry meant?

prisma wave
#

nope

#

I've never heard it before

#

might not be used much here

hot hull
#

Too young for such words

errant geyser
#

Wait BM

#

You actually didn't know what that meant?

prisma wave
#

no lol

errant geyser
#

wow

#

ok

prisma wave
obtuse gale
#

IVe never heard it either

#

actually

errant geyser
#

Would u like to explain to him BM?

obtuse gale
#

I think i mightve once - and looked it up, but forgot since then lol

prisma wave
#

Would u like to explain to him BM?
not in the slightest

#

alright third time lucky

#

how's this?

obtuse gale
#

whats with the java icon

prisma wave
#

good question

#

ยฏ_(ใƒ„)_/ยฏ

obtuse gale
prisma wave
#

probably because I installed the JDK through intellij or something

#

rather than with the installer

ocean quartz
frail glade
#

Not bad.

old wyvern
#

@hot hull You have used brigadier before right?

hot hull
#

Yes

old wyvern
#

Do you have an example I can have a look at?

#

The generic for the literal function seems to just default to Object for me for some reason

hot hull
#

Not really no

old wyvern
#

Im supposed to use the CommandSender for the dispatcher right?

hot hull
#

I believe you use the CommandDispatcher

old wyvern
#

CommandDispatcher<CommandSender> dispatcher = new CommandDispatcher<>();Yea I meant the generic argument

hot hull
#

CommandSourceStack

old wyvern
#

What library is that from?

#

Doesnt seem to be with brigadier

hot hull
#

Ah okay yea that's bukkit

#

Use the CommandSender

old wyvern
#

Ok and what about with the literal function call

#

it seems to result a argument with Object as the generic arg

hot hull
#

I doubt I'm the right person to be asking this fingerguns_reversed

#

I've used it once, but I can't remember shit from last week so fingerguns_reversed

old wyvern
#

Ah rip. Thanks tho ๐Ÿ‘

hot hull
#

I assume you trynna make them fancy colored commands?

old wyvern
#

I mean thats the goal but trying to understand how to setup a basic command with this

hot hull
#

Probs easier if you look at commodore or whatever tf lucko's command shit is called

#

Or atleast how he wrapped brigadier into it

old wyvern
#

hmm

cerulean idol
#

Does anyone mind explaining the difference of why mojang allows paid plugin resources and not mods? Is it just because mods tend to actually use mojang's code where plugins are mostly off of APIs?

forest forum
#
        if ("balance".equals(params)) {
            profile = this.instance.getProfileManager().getProfile(player);

            if (profile == null) return null;

            return String.valueOf(profile.getTokens());
        }```
#
        switch (params) {
            case "balance":
                profile = this.instance.getProfileManager().getProfile(player);

                if (profile == null) return null;

                return String.valueOf(profile.getTokens());
        }```
hot hull
errant geyser
#

๐Ÿ˜ก

obtuse gale
#

Hey i need an help my plugin is not registering with placeholder api

#

@chilly jungle

frigid badge
#

@obtuse gale

obtuse gale
#

no error placeholder not working

#

its not registering the expansion

frigid badge
#

well what's your code...

obtuse gale
#

let me pastebin

frigid badge
#

alrighty

obtuse gale
frigid badge
#

and how are you registering it?

obtuse gale
#

#register();

frigid badge
obtuse gale
#

Nope spigot wiki

frigid badge
#

read that instead, it's more updated

obtuse gale
#

still not working

#

new code

#

I think placeholder api is broked LOL.

hot hull
#

Show your main clas

#

class*

obtuse gale
#
        if(Bukkit.getPluginManager().getPlugin("PlaceholderAPI").isEnabled()){
            getLogger().info("Placeholder api found registering");
            new PlaceHolderApiHook(this).register();
        }
    }```
#

by placeholder api register part

hot hull
#

And you get the papi found message correct?

obtuse gale
#

yes

hot hull
#

add an indentifier to your onRequest code

#

And then /papi parse me %minestore_<indentifier>%

obtuse gale
#

kk

frigid badge
#

make sure you have canRegister returning true and persist returning true as well

prisma wave
#

that code will fail if papi isn't loaded

#

just saying

hot hull
#

KM, that code will fail in many ways, but oh well, not the concern here fingerguns_reversed

prisma wave
#

ยฏ\_(ใƒ„)_/ยฏ

old wyvern
#
 public String getPlugin() {
        return null;
}```Is that not supposed to return the plugin instance ![thonking](https://cdn.discordapp.com/emojis/379541184697204736.webp?size=128 "thonking")
#

nvm

#

Name

hot hull
#

yes

#

Yugi, any luck with the brigadier?

old wyvern
#

Yea figured it out

obtuse gale
#

its working showd the value

hot hull
#

colored commands? ๐Ÿ˜

old wyvern
#

Working on a simpler wrapper

#

but not atm, working on something else

hot hull
#

@prisma wave Any chances I could "inject/add" my own components (types) into a nms class?, or am I just being stupid rn fingerguns_reversed

prisma wave
#

unlikely

hot hull
#

I'm sad now

prisma wave
#

best option would be a subclass or something

#

bytecode modification might be possible, but probably not at runtime

frigid badge
#

make a derived class and replace it where it's used

hot hull
#

I kinda can't, since the method I'd use it in requires the specific nms class

frigid badge
#

how can you not?

hot hull
#

Unless I'm missunderstanding what you mean

distant sun
#

@obtuse gale use isPluginEnabled() as getPlugin() is nullable

frigid badge
#

@hot hull show what you wanna code and what your current/nms current code is

hot hull
#

Well I mean the code/specific example doesn't really, what matters is can you add let's say enums to a class that you can't edit yourself

prisma wave
#

technically I believe you can

hot hull
#

๐Ÿ˜ฎ

#

There's a thing in NMS for advancement frames,

AdvancementFrameType
I was hoping I could somehow modify it to see if it's possible to add my own frames

distant sun
#

cant you use reflection or smth to modify an enum?

prisma wave
#

with bytecode modification you could

#

^

#

you can edit existing constants, but not add new ones afaik

distant sun
#

F

hot hull
#

I mean yea I could just edit one of the existing ones to test if it's even possible

forest forum
#

I got my intellij ultimate for students

#

YAY

#

๐Ÿ™‚

#

I asked my college that im going to next year to give me my .edu email

#

and the came in plug!

prisma wave
#

nice

#

get the Github Student Developer pack while you're at it

#

it has a crap ton of free stuff

hot hull
#

KM, This is the enum I'm trying to get

CHALLENGE("challenge", 26, EnumChatFormat.DARK_PURPLE),
guide me fingerguns_reversed

#

Do I use DeclaredField or what?

prisma wave
#

it will be a public field

#

so you won't need declared I don't think

hot hull
#

And I just use the name as CHALLENGE?

prisma wave
#

yeah

hot hull
#

If I use set, would the first object param be the param name or the actual type?

prisma wave
#

uh

#

what?

hot hull
prisma wave
#

oh

#

first thing should be null

#

because it's a static field

hot hull
#

And the second? confused since there's 3 params to it

prisma wave
#

enums compile down to static constants

#
GOLD('6');
``` compiles to ```java
public static final ChatColor GOLD = new ChatColor('6');
#

you need to firstly remove the final modifier from the field

#

then instantiate a new ChatColor (insert enum name here)

hot hull
#

by setting it to accessible I assume?

prisma wave
#

then set the field value

#

no

#

you need to actually edit the modifiers field of the field

hot hull
#

oh I see

prisma wave
hot hull
#

Already running a slideshow but oh well

#

KM, if there's 2 param to the enum, what would that compile to?

prisma wave
#

new EnumName(params, here);

hot hull
#

fingerguns_reversed Thanks

errant geyser
#

hot

prisma wave
errant geyser
#

TIL

prisma wave
#

I mean, you wouldn't have this problem with Clojure fingerguns_up

#

since enums don't exist ๐Ÿ™‚

errant geyser
#

Fix my WE issue and I'll try Clojure

prisma wave
#

promise?

errant geyser
#

Yup

prisma wave
#

RIGHT

#

let's get to work

#

@onyx loom what did I tell you?

#

at least 1 person

errant geyser
#

I'm sorry Kali

#

I need this though

prisma wave
#

no

#

what you need

#

is clojure

errant geyser
#

Maybe so

#

But I won't know until after I fix this will I? ยฏ_(ใƒ„)_/ยฏ

prisma wave
#

indeed

#

right

#

let me test on a server quick

errant geyser
#

ok

hot hull
prisma wave
#

you'll have to call the constructor with reflection too

hot hull
#

Just my luck smh

errant geyser
#

Frosty I want that code when you're done boi

hot hull
#

Yeye I'll make the lib public

errant geyser
#

Cheers

hot hull
#

If I don't yeet myself before

errant geyser
#

Make it public now so if you do I can finish it

hot hull
#

nono

errant geyser
#

๐Ÿ˜ฆ

onyx loom
#

@onyx loom what did I tell you?
@prisma wave for fuck sake @errant geyser

errant geyser
hot hull
#

I'm a tad confused KM

prisma wave
#

about what?

hot hull
prisma wave
#

getDeclaredConstructor

hot hull
#

That makes sense ye :p

prisma wave
#

field.setInt that's not going to do what you want it to do

#

that's going to set the value of CHALLENGE to an int

#

I think

hot hull
#

ah I see yea I missed a part

#

I need to get the actual modifier field

prisma wave
#

yep

hot hull
#

Do I need to reasign the class now, or can I just return the starting one now?

prisma wave
#

where are you talking about?

#

oh, the Class will still have the same value

#

is that what you mean?

hot hull
prisma wave
#

I don't think this will work

#

everything else looks fine though

hot hull
#

Do I just cast it to AdvancementFrameType and return type then?

#

Yea that's a no ^

prisma wave
#

you should probably return the value of your first newInstance call

#

@errant geyser you're targeting 1.13 right?

errant geyser
#

1.13.2 yeah

hot hull
#

time to test fingerguns_reversed

#

oop spotted an issue, cause I'm stoopid

prisma wave
#

smh

hot hull
#

This ain't right ๐Ÿ˜›

Field.class.getDeclaredField("modifiers");

#

hm, see now I get the not visible shit on the modifiers field

prisma wave
#

wdym?

hot hull
prisma wave
#

because it's not part of AdvancedFrameType

#

it's part of Field

hot hull
#

ohhh

prisma wave
#

@errant geyser send your build.gradle

errant geyser
hot hull
#

Am I dumb or?

private AdvancementFrameType(String var2, int var3, EnumChatFormat var4)

prisma wave
#

which line throws the exception?

#

you'll need to make the constructor accessible

hot hull
#

final Constructor constructor = type.getDeclaredConstructor(String.class, int.class, EnumChatFormat.class);

onyx loom
#
        url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
    }

    maven { url 'http://ci.athion.net/job/FastAsyncWorldEdit/ws/mvn/' }
    maven {url 'https://maven.enginehub.org/repo/'}```
@errant geyser stick with the same style ![PES_Cry](https://cdn.discordapp.com/emojis/493359762432327691.webp?size=128 "PES_Cry")
hot hull
#

Lemme see if that fixes it

prisma wave
#

@errant geyser try BuiltInClipboardFormat.MCEDIT_SCHEMATIC

hot hull
#

Takes time to test cause I gotta throw shit into local maven, and then reimport yadi yada yada

prisma wave
#

Excuses

hot hull
#

I ain't going to sleep until this works so..

errant geyser
#

And what do I do with that?

#

There's no load method

prisma wave
#

the problem is that you're following the 1.12 docs for 1.13

#

the api changed a lot

#

or maybe it didn't

errant geyser
#

Alright, so how can I load the schematic using that then?

prisma wave
#

I've got a project which works in 1.15, it'll probably work in 1.13 too

#

although it doesn't use FAWE api

#

which isn't necessarily a problem

errant geyser
#

I can work with that, probably

hot hull
#

Aren't they similar af?

prisma wave
#

pretty much

#

bear in mind having FAWE loaded will speed up WE api calls

hot hull
#

server died fingerguns_reversed

prisma wave
#

and the FAWE API is usually just less boilerplate

#
compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.1.0")
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.1.0")```
it uses the DSL, sorry
#
fun File.loadAndPasteSchematic(source: Location)
{
    val format = ClipboardFormats.findByFile(this) ?: throw IllegalArgumentException("Invalid File Type")

    val clipboard = format.getReader(inputStream()).read()

    val world = source.world ?: throw IllegalArgumentException("No World")

    val session = sessionsByWorld.getOrPut(world) {
        WorldEdit.getInstance().editSessionFactory.getEditSession(BukkitWorld(world), -1)
    }

    val copy = ForwardExtentCopy(clipboard, clipboard.region, clipboard.origin, session, source.toWEVector())
    Operations.completeLegacy(copy)
    session.flushSession()
}```
#

feast your eyes on that

#

and try it

#

ideally

hot hull
#

Still getting no such method KM :c

errant geyser
#

lemme try that

prisma wave
#

interesting

hot hull
#
    private static AdvancementFrameType getCustom() {
        final Class<AdvancementFrameType> type = AdvancementFrameType.class;

        try {
            final Field field = type.getField("CHALLENGE");
            final Constructor constructor = type.getDeclaredConstructor(String.class, int.class, EnumChatFormat.class);
            constructor.setAccessible(true);

            final Field modifiersField = Field.class.getDeclaredField("modifiers");
            modifiersField.setAccessible(true);
            modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);

            final Object newInstance = constructor.newInstance("challenge", 26, EnumChatFormat.AQUA);
            field.set(null, newInstance);
            return (AdvancementFrameType) newInstance;
        } catch (final NoSuchFieldException | NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException ex) {
            ex.printStackTrace();
        }

        return AdvancementFrameType.CHALLENGE;
    }

errant geyser
#

What was your sessionsByWorld map?

prisma wave
#

just a Map<World, EditSession>

errant geyser
#

I don't need it either way but still

prisma wave
#

not sure if it's actually needed or not

#

toWEVector() just made a new BlockVector3 based on the location

errant geyser
#
fun Location.toWEVector(): BlockVector3 {
    return BlockVector3.at(x, y, z)
}``` this should be good right
hot hull
#

Okay anyways I'm going to sleep KM, I'll continue bothering you tommorrow fingerguns_reversed

prisma wave
#

wait

onyx loom
#

sleeping at 11pm yuck

prisma wave
#

I realized what the problem is

#

enum constructors have another parameter added

#

a String at the start that represents the enum name

hot hull
#

Kali, it's 10pm, and I'm probs gonna go watch a movie or something

#

ohhhhhh

prisma wave
#

println(AdvancementFrameType::class.java.declaredConstructors.contentToString()) => [private net.minecraft.server.v1_16_R1.AdvancementFrameType(java.lang.String,int,java.lang.String,int,net.minecraft.server.v1_16_R1.EnumChatFormat)]

hot hull
#

but that's an int as well

errant geyser
#

session.flushSession() what does this do? I need to keep the EditSession in tact so I can reverse it later is my concern

prisma wave
#

yeah the int is for ordinal iirc

hot hull
#

String, int, "challenge", 26 (not sure what this is just yet), color

#

Those are the params then

prisma wave
#
       AdvancementFrameType::class.java.getDeclaredConstructor(
            String::class.java,
            Int::class.java,
            String::class.java,
            Int::class.java,
            EnumChatFormat::class.java
        )```
#

String (name)
Int (ordinal)
the rest

hot hull
#

Yea, what is the ordinal then tho?

#

Or do I not haveto define those'

prisma wave
#

you probably should

#

but just copy the existing one

#

@errant geyser iirc it makes sure all the session's changes are persisted. might be necessary, might not be

hot hull
#

No I mean KM, what would the ordinal be? Not sure what that even means?

prisma wave
#

oh

#

ordinal is the order that the enums appear in

hot hull
#

so 2

#

If we start from 1 fingerguns_reversed

prisma wave
#
enum Test {
  A,
  B,
  C
}``` A has an ordinal of 0
errant geyser
#

ok that sounds alright

prisma wave
#

it starts at 0, same with arrays

hot hull
#

smh

prisma wave
#

but just use the existing one's ordinal

#

AdvancementFrameType.CHALLENGE.ordinal()

#

iirc

#

in case it changes

hot hull
prisma wave
#

probably because they're generated by the compiler

#

I tried it and it definitely works so

hot hull
#

yolo then

errant geyser
prisma wave
#

uhhhhhhhhhhhhhhh

#

the sk89q one

#

lemme find the url

#

sec

errant geyser
#
maven { url 'https://maven.enginehub.org/repo/' }``` I have this one defined rn
hot hull
#

;C

java.lang.NoSuchFieldException: modifiers

#

Imma continue with this tommorrow, thanks for the help fingerguns_reversed

prisma wave
#

oh

#

oops

#

remove the worldguard dependency

#

that's not even needed

errant geyser
#

Oh yeah why do I have that

#

๐Ÿคฆ

prisma wave
#

because I read it as worldedit and copied it lol

errant geyser
#

BM

#

Why in the frik

#

Windows confuses me

prisma wave
#

that's literally what mkdirs does

#

4head

errant geyser
#

Well uh

#

I knew that

prisma wave
#

also, use File.resolve

#

more ๐ŸŽ‡ idiomatic ๐ŸŽ‡

errant geyser
#

It then disconnects me when I get teleported due to an invalid movement packet or smth

prisma wave
#

i mean

#

they do say that fawe 1.13 is buggy

#

although that might be your fault

#

send code

errant geyser
#

Surely not unusably buggy

prisma wave
#

you'd be surprised

broken stratus
#

Hey I am getting this error when I try to export jar using maven

errant geyser
broken stratus
#

I can't post image :/

errant geyser
#

imgur

errant geyser
#

You're trying to set the source to Java 5

#

Why]

prisma wave
#

@errant geyser
xyz = rand.nextInt(Int.MAX_VALUE)
Tried Setting Block at x:9, y:1163593441 , z:9
ArrayIndexOutOfBoundsException: 72724590

#

big brain

errant geyser
#

Whats the max they can go to?

prisma wave
#

??????????????????????????????????????????????????

#

have you ever played minecraft ???

#

the max y is 256

distant sun
#

F

errant geyser
#

oh so

#

I gotta do it properly

#

ugh

prisma wave
#

4head

#

also, this is an excellent opportunity for a do/while loop

#

DRY

errant geyser
#

Show me da way

#

de*

prisma wave
#
do {
  initialize stuff
} while(collides)
#

ez

errant geyser
#

So the x and z can be up to max int right

prisma wave
#

yes

errant geyser
distant sun
#

while dont have a body

errant geyser
#

oooooooo I get it

distant sun
#

do { } while (true)

errant geyser
#

yup

#

Useful

prisma wave
#

That's probably FAWE's fault

#

Don't use fawe

#

It's buggy

errant geyser
#

How do I do it without FAWE without it being laggy as hell

#

Yeah rn it teleports you to a void world, you're outside the world border and then you fall

#

ยฏ_(ใƒ„)_/ยฏ

gusty fulcrum
#

just set a max no?

errant geyser
#

I do

#

x and z can be MAX_INT, so I don't define a limit, y can be 0-256 and so I set a limit

gusty fulcrum
#

try limit x & z maybe

#

worth a try

errant geyser
#

also BM data.dat still generates as a folder somehow

#

ohk I capped it to 256 everywhere and it worked

#

What in the fuck

#

The rest of it works as intended @gusty fulcrum, you want this for now? I gtg in 10 mins, but I'll figure out the limit tomorrow

#

Does this mean I gotta learn Clojure now BM

#

I have a feeling ima regret this

onyx loom
#

no it doesnt

#

it definitely does not

pastel imp
#

so I already asked this.. but jsut wanna be sure.. 1.12.2 is the best for prison servers right? cause I see lots of plugins 1.14.4+

static zealot
#

I'd say factions server since it has a lot of explosions

prisma wave
#

It does @errant geyser

#

You promised

#

:)

onyx loom
#

NO

prisma wave
#

A deal is a deal

static zealot
#

but for prisons if you have a good server it could go on the newer versions (I recommend latest)

onyx loom
#

omg guys

#

i created config

#

who proud

#

thank u!

#

i appreciate the love!

prisma wave
#

@onyx loom I don't care >:)

onyx loom
#

โ˜น๏ธ

#

the code is ass

#

so dont worry about that

prisma wave
#

Should've used

onyx loom
#

NO

#

DONT SAY IT

prisma wave
#

Scala

onyx loom
#

o

prisma wave
onyx loom
#

might learn scala

prisma wave
#

It's ok

onyx loom
#

its meant to be decent right?

prisma wave
#

Quite tricky at times

onyx loom
#

yea

prisma wave
#

It's powerful

#

but there's a lot of stuff that is difficult to learn

#

Steep learning curve

onyx loom
#

why so anyways

#

do u know?

prisma wave
#

(0/:l)(_+_) this is valid scala

onyx loom
#

oh yuck

#

what the fuck

#

what does that do? ๐Ÿ‘€

prisma wave
#

I think the main reason is that it has a lot of symbols for making concise, not readable code

onyx loom
prisma wave
#

It's equivalent to l.foldLeft(0)(x, y => x+y)

onyx loom
#

and what does that do LOL

prisma wave
#

adds up all the numbers in a list of numbers

#

I think

onyx loom
#

ic ic

#

id just use a forEach to do that

#

but never knew that existed

prisma wave
#

But that's not how functional programming does it

#

Scala is a functional language rather than Object Oriented

#

So is Clojure

onyx loom
#

eh it says its both

prisma wave
#

And to a degree, kotlin

#

Yeah it can be both

onyx loom
prisma wave
#

But scala puts a big focus on FP as far as I know

errant geyser
#

Well, kali I'm sorry but I agreed to this I guess

onyx loom
#

FUCK SAKE

errant geyser
#

I'll do it tomorrow since I've had to go

onyx loom
#

i swear to god if u convert to the dark side

prisma wave
#

Heheheh

errant geyser
#

Kotlin will always be the best language until proven otherwise

onyx loom
#

thats my boy

errant geyser
#

To me rn clojure looks like a heap of shit, but I've never used it sooo

prisma wave
#

I'm getting used to it

#

It's just different

#

Not necessarily better or worse

#

Just different

onyx loom
#

learn visual basic ๐Ÿ™‚

errant geyser
#

Guess I'll find out tomorrow

#

Kali

prisma wave
#

Indeed

errant geyser
#

Nobody has ever wanted to learn vb

onyx loom
#

good

#

keep it that way

prisma wave
#

I think we can ALL agree that VB sucks

errant geyser
#

Yep

onyx loom
#

yup

#

its ass

#

and my college made me learn it for a project ๐Ÿ˜”

errant geyser
#

We had a kid, proper gangsta like yeeeeeah real ard like yeah transfer from a London school to mine since he moved, he took CS for some reason (he dropped out within a week, my CS teachers HATED him), and when asked what language hed learnt at his old school, no shit he said VB. Everyone was stunned like wtf, who teaches people VB????

prisma wave
#

A gangsta doing VB

#

That's new

onyx loom
#

propa gansta

#

im sure he was real ard

errant geyser
#

WHY BARRY

#

I said poo hole

analog crater
#

Proper gansta lol. Was he like 5 5 with a dead trim

onyx loom
#

OMGG

#

let me show u this video

errant geyser
#

6"2 but yes

onyx loom
#

i should be allowed to post this vid

errant geyser
#

You know those people with Corsas who have those ridiculous exhausts and a chain thinking they look mad hard but actually look clapped? He was one of them

analog crater
#

Lmao did he pick up yr9s at maccies

onyx loom
#

omg

#

i almost spat out my drink

#

thanks

errant geyser
#

No, he hung out at our park and maccies with his drug addict friends on bikes

#

At least half the people in my year can get or have tried drugs

#

It's insane

onyx loom
#

jesus christ

errant geyser
#

The thing is we have a super low crime rate

#

ยฏ\_(ใƒ„)_/ยฏ

onyx loom
#

mine is the exact opposite

analog crater
#

Maybe because everyones high

errant geyser
#

Probably

#

We have a kid with tourette's

onyx loom
#

๐Ÿ˜ฌ

errant geyser
#

Holy shit is it the funniest thing you've ever seen

#

He abused the shit out of it

#

If a teacher said anything to him hed yell SUCK MA DICK and they couldn't say anything

onyx loom
#

๐Ÿ™‚

analog crater
#

Lmao that must get annoying asf though

errant geyser
#

Sort of

#

He varies it every now and again to keep it from getting boring

onyx loom
#

i watched a program on this mum with touretttes

#

very interesting

errant geyser
#

Lol

#

Have u guys seen tourette's guy

#

**FUCK fuck fuck fuck fuck fuck oh FUCK"

analog crater
#

Scottish tourettes is the funniest thing ever

errant geyser
#

F

#

Got deleted

analog crater
#

I pasted a coral advert link by accident lol

errant geyser
#

Oh

#

I'd watch that but its uh

#

Quite late

#

And I don't have headphones on me

analog crater
#

Yeah lol u need headphones to watch that. Very profane

errant geyser
onyx loom
#

picture urself in a beatiful green field LOL

analog crater
#

Pls stop breaking discord tos

#

Not very discordy

errant geyser
#

?

analog crater
#

Inject custom themes into discord

errant geyser
#

That's not a custom theme?

#

It was screenshot on mobile 8head

analog crater
#

Im sorry. I am severely mistaken but why os it so black

errant geyser
#

This setting

#

The AMOLED one

analog crater
#

Tf when was that a thing

errant geyser
#

Its been around for a while

prisma wave
#

Those are wise words

analog crater
#

Where

prisma wave
#

Tap dark a few times

#

It's secret

onyx loom
#

@analog crater lmao that vid is funny

errant geyser
#

I cant remember exactly how to get it, iirc u gotta spam dark yeah

analog crater
#

Ah. Thanks

#

It looks rate cool

errant geyser
#

Also why u sending hair spray to Poland boi

onyx loom
#

messenger yuck

errant geyser
#

Ikr

analog crater
#

Messenger is great for casual conversing

errant geyser
#

Guys I'm lvl 29

#

Soon I'll have an actually decent name colour

onyx loom
#

ew

#

who like tier 4

errant geyser
#

I do

#

Mine sucks

onyx loom
errant geyser
#

T4 blue ftw

errant geyser
#

@prisma wave basics of Closure tutorial time? Ima try to make a cli calculator or smth first

prisma wave
#

I only know the basics myself

#

but there are 2 key concepts

#
  1. Clojure is a lisp - everything is a List
#

which is done with the syntax (list elements here)

#

Clojure is functional, which is quite a different programming style to Java's imperative style or Kotlin's semi-functional/imperative style

#

everything (as far as I know) is immutable which can lead to some different ways of doing things

#

and you'll typically be chaining functions together (eg map, reduce, filter - think of Streams or Kotlin's Collection extensions)

#

other than that once you get the basic syntax it's fairly simple

#

(1 2 3) is a LinkedList, [1 2 3] is a Vector (think ArrayList but not literally)

#

and then Maps are {:key value} iirc, but @lunar cypress might correct me on that one

#

ez xp

errant geyser
#

Ooo ok

#

So I can use IJ for it right

#

How do I make a new Clojure project?

prisma wave
#

yeah I'm using IJ

#

get a plugin

#

can't remember what it's called but if you tell me the name I can tell you

lunar cypress
#

Cursive

errant geyser
#

Noice

#

Well, time to look up some docs for the morning

prisma wave
#

That's it

lunar cypress
#

Syntax is incredibly simple compared to other languages but it's the structure that might give you a headache in the beginning

errant geyser
#

Gn bois, you can expect to be harassed tomorrow as I inevitably fail at this calculator thing

prisma wave
#

God BLESS America

#

And god bless clojure

lunar cypress
#

Please do feel free to harass me

onyx loom
#

๐Ÿ˜‚

lunar cypress
#

That sounds wrong

onyx loom
#

god bless america

#

~the shittest first world country

pastel imp
#

but for prisons if you have a good server it could go on the newer versions (I recommend latest)
@static zealot so for a prison server.. you would recommend 1.16.1?

#

wouldn't it be risky?

subtle lynx
#

Hi

#

You guys don't mind me asking a Kotlin question here, right?

onyx loom
#

not at all

subtle lynx
#

Okay so. I'm being passed a string in the format int1 int2 int3
How would I go about getting those ints into either an integer array or multiple integer variables to do a math operation? I tried using toInt on a hardcoded String.get(), but then when I try to do math with my variables, I can't use math operators like *, +, or %.

#
val remainders = readLine()
val testInt = (remainders?.get(0)?.toInt())?.times(70))
#

yes, I know getting my integer with get() is a terrible idea because someone could give me a two or more digit number for some reason

onyx loom
#

maybe split at the spaces, then use map like .map { String::toInt }

#

u can try it

#

idk if itll work

ocean quartz
#

toIntOrNull then filter not null, maybe

#

Something like val numbers = reminders.split(" ").map { it.toIntOrNull }.filter { it != null }

topaz bay
#

mapNotNull

prisma wave
#

kotlin questions are the reason I get up every day

subtle lynx
#

val l = if (b != null) b.length else -1

#

wait I can do this?

ocean quartz
#

i think it can even be val l = b?.length ?: -1 but i could be wrong

topaz bay
#

You are completely correct.

#

I will say though, those are garbage variable names, please don't do that @subtle lynx

#

Use meaningful names

subtle lynx
#

well yeah

#

that's not my code lol

topaz bay
#

Ok

subtle lynx
#

Sorry it's been a bit; had to do something

    val ageRemainders = readLine()
    if(ageRemainders != null) {
        var ageRemainderList = ageRemainders.split(' ')

        val yourAge = (ageRemainderList[0].toInt() * 70  + ageRemainderList[1].toInt() * 21 + ageRemainderList[2].toInt() * 15) % 105
    }

Does anything here look stupid? (the math is provided by the thing I'm using to learn. I wanna know if how I'm getting the values is stupid, not if the equation is stupid)

ocean quartz
#

There is no reason for ageRemainderList to not be a val

tacit cave
#

Hello

#

why am i not getting warnings in Intellij, Maven Kotlin Minecraft

#

Any solutions?

#

Should I change it to Gradle/no?

ocean quartz
#

Saw this, can't check right now but hey give it a shot

One more reason could be IntelliJ is running on power saver mode, this could be disabled following way:

File Menu -> Power Saver Mode

hollow spade
#

what is so good about gradle?

versed ridge
#

Everything

obtuse gale
#

^

subtle lynx
#

https://imgur.com/a/oWXEDyl
How's my project organization thus far? Good or bad? I learned Java in school, but they didn't really teach me how to handle more than one class

analog crater
#

Why have you got commad.commands. wouldnt it be better to have command.handlers for your manager etc and command for all your commands

#

But apart from that its good

quiet depot
#

^ better naming would be implementations

#

or simply impl

errant geyser
#

Missed a semi colon in the Java bit but apart from that it should be right yeah?

nimble jungle
#

so like if i wanna get into coding plugins should i learn kotlin or java

quiet depot
#

java

nimble jungle
#

๐Ÿ‘๏ธ_๐Ÿ‘๏ธ im gonna b rlly embarrassed if they're the same thing

errant geyser
#

They aren't

remote goblet
#

kotlin

nimble jungle
#

okay ๐Ÿ˜Ž good to hear-

errant geyser
#

Personally I prefer Kotlin having used both, but its up to you

remote goblet
#

It's personal preference honestly

errant geyser
#

^

nimble jungle
#

Kotlin 2๏ธโƒฃ - Java 2๏ธโƒฃ

old wyvern
#

Better to start with Java, yes

remote goblet
#

but if you say you prefer java, you may get crusaded

nimble jungle
#

o

remote goblet
#

that didnt work

#

widePeepoSad

nimble jungle
#

sad

errant geyser
remote goblet
#

i meant the Poll thing didnt work

errant geyser
#

ik

remote goblet
#

Java is more commonly used and you can find more resources on it, kotlin is a fairly recent and not many people know or understand it mmSitStareMocha

errant geyser
#

Curse your Nitro

hot hull
#

Shitty bot

remote goblet
#

it requires two reactions now?????

errant geyser
#

Another for the collection

hot hull
#

Probs just requires perms

remote goblet
errant geyser
#

The person who sent the message has to react to it 4heads

remote goblet
#

Peepo

#

oH

errant geyser
#

See

remote goblet
#

want any of them

hot hull
#

second row 7 to the right

#

That's illegal

remote goblet
errant geyser
#

I want that one Ori

remote goblet
errant geyser
#

The one that Frosty was on about

old wyvern
#

This is how compiled kotlin looks with top level functions right?
@errant geyser
The bottom one is probably an inline function which you cant call from java

errant geyser
remote goblet
#

huh show me which one

#

lmao

errant geyser
old wyvern
#

ah nvm

remote goblet
#

ah

mighty elk
#

Is there a place to ask for help on here with come code?

remote goblet
old wyvern
#

then yes, thats how it would be called from java

mighty elk
#

thanks

errant geyser
#

Thanks Yugi

#

So

#

With my ItemExtensions obviously it works like this in kotlin, but in Java that'd be awful since it'd be java ItemStack item = ItemExtensionsKt.toItemStack(Material.whatever); item = ItemExtensionsKt.setDisplayName(item, "name");right?

#

I should probably just make an ItemFactory class so it looks clean in Java right?

old wyvern
#

Yes, You can just have the extensions use that internally

obtuse gale
#

has discord always had this option?

#

The speak message

old wyvern
#

Nope

errant geyser
#

ok cool

#

Cheers Yugi

old wyvern
#

๐Ÿ‘

errant geyser
#

A cast to Array<String> from Array<out String> should be safe right?

hot hull
#

Yes, what even is the difference between them?

errant geyser
#

vararags lore: String produces an Array<out String> rather than an Array<String> for some reason

regal gale
#

I just attempted to use an accidental .sk chunkbuster for referrence

#

The code was horrific...

hot hull
#

"code"

onyx loom
#

accidental what

regal gale
#

Sorry i just downloaded .sk without looking xD

#

So the script I just got from that is this (in pseudo):

       sendTimerMessage
       wait 1
       semdTimerMessage
       wait 1
   (5 times more)```
hot hull
#

dude

#

Stop it

#

heck out

regal gale
#

I need referrence so badly xD

#

That's not the best approach unfortunately

hot hull
#

Just don't do it all together jeez

regal gale
#

Sorry :P

remote goblet
#

Thread.sleep(Integer.MAX_VALUE.toLong()) do it

onyx loom
#

what's the point in the Long

remote goblet
obtuse gale
#

Thread.sleep(Long.MAX_VALUE);

onyx loom
#

o

remote goblet
#

or that

onyx loom
obtuse gale
remote goblet
#

how to bamboozle people 101

old wyvern
#

What in the hell are you guys trying to do?

errant geyser
#

Confuse people

remote goblet
#

We're doing tHREAD.sLEEP(sTRING.max_value) obviously

errant geyser
#

Lower case s Ori jeez

obtuse gale
#

no

old wyvern
#

Thread.Sleep
welcome to c# territory

obtuse gale
remote goblet
#

ah yes

hot hull
errant geyser
#

We all are

#

Where is that

hot hull
#

spigot discord

analog crater
#

For github, how do I setup actions to build with gradle and shade some dependencies?

errant geyser
#

Like automated build on push?

#

I use my jenkins (https://ci.katsumag.me). It just runs in a docker container on my VPS, and builds (I'm still working on it pushing to my Nexus) on commit

topaz bay
#

@analog crater define the checkout and java actions

#

mark gradlew as executable

#

and call gradlew shadowJar

#
name: Java CI

on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8

      - name: Build with Gradle
        run: |
          chmod +x gradlew
          ./gradlew shadowJar
      - name: Release Artifact
        uses: actions/upload-artifact@v1
        with:
          name: latest-versions
          path: build/libs
#

like that

#

will run the action, then attach the output binaries to it

#

ignore that expired message, this is an old archived repo of mine

#

(you might want to check if there are updates to those actions I've used)

analog crater
#

And how would I have to autocupdate versions

#

So like every new build has a new incremenr ver instead of latest-version

topaz bay
nimble jungle
#

hold on i didnโ€™t know there was a spigot discord

#

i asked a few times and everyone said to check the spigot message chat room thingy

#

idk what itโ€™s called

#

๐Ÿ‘๐Ÿ‘„๐Ÿ‘iโ€™m in

hot hull
#

Sx, any way of compacting down a for loop further?
ie: for (int i = 0; i < 5; i++) //code

errant geyser
#

repeat(5) {}

hot hull
#

That's kotlin isn't it :c

errant geyser
#

Yup

topaz bay
#

I mean... you could just use a while?

hot hull
#

But that's another variable to assign

#

So it's not really compacted

topaz bay
#

They both only use 1 variable

#

Its just inlined in the for loop

hot hull
#

Any equivalent to repeat in java?

topaz bay
#

Probably not

#

just use a for loop

quiet depot
#

@hot hull what's ur //code

#

show the whole loop

#

if it's just a one liner, you can do sneaky shit like this

hot hull
#

It's a one liner yea

quiet depot
#

for (int i = 0; i < 10; System.out.println(++i))

hot hull
#

Oh yea

topaz bay
#

Please

#

god do not do that

#

talk about error prone

#

jeez

hot hull
#

Shut up weeb

quiet depot
#

prefer a stream to what I posted frosty

topaz bay
#

all hail the mighty table creator

hot hull
#

I'm adding 0 to a list a specific amount of times

topaz bay
#

Bow to your goddess

quiet depot
#

what does the result look like sx?

topaz bay
quiet depot
#

o

hot hull
#
for (int i = 0; i < amount; i++) visits.add(0);
#

compact it further fingerguns

topaz bay
#

@hot hull um...

quiet depot
#

that's kinda yucky

topaz bay
#

Arrays.asList(new int[amount])

hot hull
#

Holy fuck, noice

topaz bay
#

ugh, fucking java

#

dont do that

hot hull
#

God fucking damnit

#

Java sucks

quiet depot
#

if you do that, please make sure to comment the semantics of int null being defaulted to 0

#

because noobs probably won't know that

topaz bay
#

final List<Integer> integers = Collections.nCopies(amount, 0);

#

Use that instead

hot hull
#

and then I just addAll correct?

topaz bay
#

what?

#

no

#

That will make a list of amount 0s

#

@quiet depot primitives cant be null

compact perchBOT
#
๐Ÿ“‹ Your paste, Skyy
https://paste.helpch.at/ibabizokay

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

hot hull
#

smh cube

subtle lynx
#

wait what

hot hull
#

Use our paste

subtle lynx
#

uhhh okay?

hot hull
#

(Was hoping cube added a converter for that one, but doesn't look like it)

subtle lynx
#

I don't see why it matters, in all honesty

pallid gale
#

Yeah neither

#

Frosty they're both the same?

#

lol

subtle lynx
#

yeah

hot hull
#

Yea I thought that was the ugly one :c

#

smh

subtle lynx
#

bruh

hot hull
pallid gale
#

pastebin the ugly one

subtle lynx
#

nullPointException

#

my god

hot hull
#

Nah there's plenty worse

#

Like the pebblehost one

subtle lynx
#

you'd think I've seen that error enough to know how to spell it

#

and I fucked up the caps

#

amazing

regal gale
#

What's yaml engine used for plugin?

quiet depot
#

snakeyaml

regal gale
#

Oh ok

hot hull
#

@quiet depot Can you send me the fingerguns emoji

subtle lynx
#

h*ck

#

sorry lol

hot hull
#

Skyy, why are you doing it like that?

quiet depot
errant geyser
#

I don't have Nitro otherwise I'd have reacted with em but eh

onyx loom
#

get nitro then 4Head

hot hull
#
ScoreboardTeam runnerTeam = mainScoreboard.getTeam("runnerTeam");
if (runnerTeam == null) {
  mainScoreboard.registerNewTeam("runnerTeam");
  runnerTeam = mainScoreboard.getTeam("runnerTeam");
}
runnerTeam.setColor(ChatColor.AQUA);
#

@subtle lynx

#

Piggy, the rotated one as well

quiet depot
#

I don't have them

subtle lynx
#

It just occurred to me that my if() wasn't even checking my variable

#

also, I was on the spigot discord and they told me that you can just use

runnerTeam = mainScoreboard.registerNewTeam("runnerTeam");
hot hull
#

if it returns the team sure

errant geyser
#

@onyx loom I'd say my VPS is more important than Nitro

#

Otherwise I would

onyx loom
#

i would disagree

#

just think of that sweet multi spin

#

or just get both

#

ยฏ\_(ใƒ„)_/ยฏ

errant geyser
#

boi I need my VPS

onyx loom
#

u dont need it

errant geyser
#

I don't need Nitro either

#

up to 52 items right now

distant sun
#

@hot hull just download them off discord

hot hull
#

Already got em fingerguns

nimble jungle
#

whatโ€™s the point in nitro when i canโ€™t even use my funny emojis in this discord ๐Ÿ˜”

hot hull
#

get gud

errant geyser
#

You can if you boost

#

Which is why I'm trying to get Cube to sponsor me

#

Since he'd have to pay 1p extra for nitro rather than 2 boosts, he gets to keep t3 and I get emojis

#

๐Ÿ‘€

nimble jungle
analog crater
#

Why would you spend 12p extra a year for something that gives you no gain and has less guarantee

errant geyser
#

sssssshhhhhhhh

hot hull
errant geyser
hot hull
#

I mean you can't use it anyway

#

Cause that's not the lib

#

That's just this fingerguns_reversed

errant geyser
#

But you forget the lib's dependency info is in it fingerguns

quiet depot
#

why don't you just set the Challenge Complete to the same colour as the bg

errant geyser
#

So I can use it

hot hull
#

You've no idea how much the Challenge Completed is annoying

#

Piggy, it's client sided

errant geyser
#

How is it pink?

quiet depot
#

feelsbadman

errant geyser
#

I thought it was always grey or smth

hot hull
#

There's 3 different ones

errant geyser
#

oof

pallid gale
#

pls install resource pack and change the item to fingerguns

hot hull
#

lmao

errant geyser
#

Time to make a shitty wrapper for it

hot hull
#

katsu, if you ask nicelly I'll add you to the lib repo

#

Not gonna make it public cause then everyone gonna copy my nice shit fingerguns_reversed

errant geyser
#

Please Mr Frosty can I be added to the repo so I can make a wrapper for it for ease of use

hot hull
#

I mean it's already easy to use what u mean

errant geyser
#

Meh

hot hull
#

Have you even checked the code ;C

errant geyser
#

idk how but I might be able to

hot hull
#

Well I mean only three things are there which are part of the wrapper

#

The rest is just personal preference

errant geyser
#

Ok fine

onyx loom
#

why u make in java

#

feelsbad

hot hull
#

Cause shut up

errant geyser
#

Please Mr Frosty can I be added to the repo to make a kotlin wrapper for it so everyone doesn't complain, and also to simplify whatever I can

hot hull
#

Well I mean, I gotta make the lib public then ;C

errant geyser
#

or you could add me to it like u offered to

#

cmon

onyx loom
#

written in java sorry

#

also, maven

hot hull
#

I mean how do you even use local repo shit with gradle?

#

I was trynna use gradle at first but couldn't figure it out lmao

errant geyser
#

mavenLocal() in the repositories block

#

Literally it

hot hull
#

oof

errant geyser
#

Then define it as a regular dependency

onyx loom
#

ok im sorry ill +1

errant geyser
#

๐Ÿคฆ

hot hull
#

@analog crater You've condemned yourself to be required an explanation, go

onyx loom
#

same reason as me fingerguns

hot hull
#

Jolly doesn't use kotlin does he?

ocean quartz
#

Kali my libs are written in Java and uses Maven

onyx loom
#

yuck

#

i mean java is fine

quiet depot
#

wtf

analog crater
#

I use kotlin lol. Also, im rewriting your advancedments to be more concise, kotlin and gradle

onyx loom
#

but no excuse for maven ๐Ÿ˜ 

quiet depot
#

frosty, why have you not learned yet

#

if you have a question

#

just tag me

errant geyser
#

its ok kali, my command handler is coming in Gradle and Kotlin

quiet depot
#

don't revert back to inferior technologies when you get stuck

hot hull
#

smh Piggy

quiet depot
#

just ask

prisma wave
#

Did someone say

#

Kotlin?

analog crater
#

Yes

hot hull
#

Oh fuck not this guy

onyx loom
#

yeah

errant geyser
#

everyone

onyx loom
#

not the c word tho

quiet depot
#

in my subjective opinion clojure is objectively better than kotlin

onyx loom
#

o

errant geyser
#

๐Ÿ˜ก

analog crater
#

Oh, why do you say that? What are you objectively comparing

prisma wave
#

I think you'll find it's objectively subjectively better actually!

hot hull
#

I love how everyone saying they gonna rewrite it, but you actually can't since this ain't the lib fingerguns_reversed

#

Bamboozled weebs

old wyvern
#

Objectively subjectfully objective

quiet depot
#

I'm objectively comparing my subjective opinion to other irrelevant subjective opinions, for the sake of objectivity

prisma wave
#

I want attention, here is my opinion

errant geyser
#

@hot hull Mr Frosty pls add me to repo mr boi you are best boi ever libs are good FJ good I love you yes

prisma wave
#

My opinion is TRUTH. yours is not

old wyvern
#

I want xp, here isnt my opinion

hot hull
#

Oh fuck no, just for that I'm not adding you katsu

errant geyser
#

NOOOOOO#

prisma wave
#

I love XP

errant geyser
#

Fuck

ocean quartz
#

Let me explain my reasoning,
Java - Cuz Spigot, no one wants a lib that adds 1.4mb for no reason
Maven - Because of Maven Central authentication, the same in Gradle is pretty annoying to do

errant geyser
#

I played myself

analog crater
#

Bruh. Theres no advancedapi

old wyvern
#

Xp is love, xp is life

#

Not sure if you got the reference