#dev-general

1 messages ยท Page 98 of 1

prisma wave
#

use when for one thing

#

group up the common conditions

#

eg steptember and june will be the same

onyx loom
#

ty ty

#

wait how would i group them up?

#

nvm

old wyvern
#

what about just check 2, odd and even?

#

actually nvm

errant geyser
#

@ocean quartz I need that editor, what is it? I use np++ and its great and all but that is in my dreams

onyx loom
#

Lite text editor

heady birch
#

ok thats cool, but whats the name of the text editor so I can download it?

onyx loom
#

๐Ÿ™„

errant geyser
#

Is it literally called Lite or are you just messing with my one braincell?

onyx loom
errant geyser
#

I'm on my phone ok, that's blurry af on here. Y u buuuly me :(

onyx loom
#

๐Ÿ™‚

#

its called lite

errant geyser
#

No ik, your screenshot is fine. Its Matt's one that I couldn't read

#

That's the screenshot Matt sent in the read me isnt it?

ocean quartz
#

Yeah that one

onyx loom
#

O.O

ocean quartz
#

You can do even better, if the month % 2 == 0 you have a 31 days month, else it's 30
You don't even need the when ;p

onyx loom
#

but february ๐Ÿ˜ฆ

#

but yeah thats what yugi was saying

#

i guess i will do it that way as im not sure how to nest an if into when

jovial warren
#

wait input() is a thing in Kotlin?

#

you learn something new everyday

ocean quartz
#

You could return on the ifs, so you don't need elses

onyx loom
#

@jovial warren its my second function

jovial warren
#

ah okay

#

can format() not be called from LocalDateTime.now()?

#

or do you definitely need a new instance of that

onyx loom
#

hmm let me see

jovial warren
#

the if statements look like arrow code to me

#

gotta be a better way

#

also your braces are all over the place

onyx loom
#

wat

#
    val year = LocalDateTime.now().format(formatter).toInt()

i removed one of the vals, so ty bardy

jovial warren
#

np

onyx loom
#

@ocean quartz could u give me an example? ๐Ÿ˜…

jovial warren
#

there has to be a better way to do that big himalayas setup you got going on

onyx loom
#

i mean ye there is a better way, but i prefer everything being braced

ocean quartz
#
if (month == 2 && year % 4 == 0) {
  println("This month has 29 days")
  return
} else {
  println("This month has 28 days")
  return
}

if (month % 2 == 0) {
  println("This month has 31 days")
  return
}

println("This mont has 30 days")

quiet sierra
#

That doesn't work perfectly

jovial warren
#

still looks a bit funny

quiet sierra
#

December and January both have 31 days

#

Something like May and June aswell

versed ridge
#

You guys wanna review my first plugin in kotlin

jovial warren
#

couldn't you use a when there @ocean quartz ?

ocean quartz
#
when {
  month == 2 -> {
    if (year % 4 == 0) {
      println("This month has 29 days")
    } else {
      println("This month has 28 days")
    }
  }
  
  month % 2 == 0 -> println("This month has 31 days")
  else -> println("This mont has 30 days")
}
#

Yeah

quiet sierra
#

Also you could turn

if (month % 2 == 0) {
  println("This month has 31 days")
  return
}

println("This mont has 30 days")

into

println("This month has 3" + (1 - (month % 2)) + " days");
rotund egret
#

Readability gone

onyx loom
#

less readable

#

^^

jovial warren
#

@quiet sierra nice

#

I knew there was a better method

onyx loom
jovial warren
#

also, use ${} instead of + +

quiet sierra
#

Not a C expert

ocean quartz
#

C? xD

jovial warren
#

:cmonBruh:
for me, readability isn't key

quiet sierra
#

or whatever the lang may be

versed ridge
quiet sierra
#

I remember my first plugin

#

Vault + SlimeFun integration

versed ridge
#

let me know if I did anything completely wrong lol

quiet sierra
#

Because I argued a feature was possible and I got banned on the server

ocean quartz
#

Config.java ๐Ÿ‘€

jovial warren
#

println("This month has 3${1 - (month % 2)} days")

versed ridge
#

shh

#

I couldn't get it to work other wise

jovial warren
#

println("This month has 3${1 - (month % 2)} days")
I'd be surprised if that was valid

onyx loom
#

went with matts when expression because readability :p

ocean quartz
#

You'd need an object with @JvmField

jovial warren
#

went with matts when expression because readability :p
that's what documentation is for

onyx loom
#

so ty matt and everyone else ๐Ÿ™ƒ

quiet sierra
#

If you want to look "professional" on your homework go with mine

#

less readability = better grade

#

trust me

onyx loom
#

๐Ÿ˜‚

jovial warren
#

less readability = cleaner code

#

imo

onyx loom
#

the teachers wont know what uve wrote, so they give u instant A*

quiet sierra
#

yeHA

jovial warren
#

readability is what documentation is for

quiet sierra
#

As long as it works under 1 line

jovial warren
#

fuck people being able to read the code, they can read the docs

quiet sierra
#

What docs

rotund egret
#

That means I have to write docs

jovial warren
#

javadocs

quiet sierra
#

Just look at the method name

jovial warren
#

or kdocs for kotlin

onyx loom
#

yes @rotund egret well said

ocean quartz
#

@versed ridge Let me blow your mind with Kotlin

quiet sierra
#

if the method is named getDaysInMonth(int month)

#

Then wtf is it gonna do

#

Yep, get the current weather

ocean quartz
#
fun PlayerMoveEvent.onPlayerMove() {
}

Boom

onyx loom
#

lmao

versed ridge
#

oo

rotund egret
#

Readability is more for future work, or other devs looking at your code.

jovial warren
#

@ocean quartz good use of JVM magic

ocean quartz
#

That way you don't even need event

rotund egret
#

It's more of a good practice thing

onyx loom
#

agreed

#

even if i could fit everything on 1 line, i wouldnt do it

ocean quartz
#

Specially important if you want to collaborate

jovial warren
#

yeah

#

I try to compact my code as much as possible

onyx loom
#

i guess its just preference

#

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

jovial warren
#

but I do want people to be able to somewhat read my code

ocean quartz
#

@versed ridge Another small thing that could help you out ;p

private fun User.teleportTo(location: Location)

user.teleportTo(location)
versed ridge
#

woahh

#

That's cool

ocean quartz
#

Ikr, function extensions are great

jovial warren
#

yeah

#

that JVM magic is really useful

onyx loom
#

magic

jovial warren
#

it's JVM magic

onyx loom
#

JVM magic

jovial warren
#

that's what it's doing

onyx loom
#

๐Ÿ˜ฎ

quiet sierra
topaz bay
#

that is barely magic

jovial warren
#

it actually adds that method to the class at runtime afaik

topaz bay
#

coroutines are jvm magic

prisma wave
#

it's not really magic

topaz bay
#

And no.

#

It does not.

#

Its a static function

prisma wave
#

extension functions compile to static helpers

topaz bay
#

That takes the receiver as the first param

rotund egret
#

The kotlin bois ran it at the same time

ocean quartz
#

I also need a drink after that tweet wtf

jovial warren
#

what about stopping other methods from executing without stopping what's executing them? now that's JVM magic

rotund egret
#

Tweet?

ocean quartz
quiet sierra
#

go up a bit

topaz bay
#

huh??

quiet sierra
#

yay for matt because I can't send imges

versed ridge
#

@ocean quartz So what is @JvmField

topaz bay
#

ha

#

HAHAHA

#

KJBAjkhsbSAKjvbdkjghvdujghasdb

ocean quartz
#

Basically makes the compiler not create setters and getters for the field and make it public

#

Which is what you need for ConfigMe fields

jovial warren
#

also, mockk, that's JVM magic

onyx loom
#

enlighten me

#

whats mockk

jovial warren
#

basically makes you able to mock specific classes, objects, or methods, and change what they return

#

for example, if WhateverClass.whateverMethod() returns x and you want it to return y for testing, you could do:

declareMock<WhateverClass> {
    every { whateverMethod(any()) } returns y
}
topaz bay
#

Wait what?

jovial warren
#

basically, every time that method is called, with any values for parameters whatsoever, you can change what it returns

topaz bay
#

You dont need that for configme

#

you just target the annotations at the field

ocean quartz
#

I know, was just telling him what annotating the field with @JvmField does

jovial warren
#

Which is what you need for ConfigMe fields

ocean quartz
#

Yeah, you need to annotate fields with @JvmField for them to work with ConfigMe

topaz bay
#

no you dont

prisma wave
#

@field:Comment for example iirc

ocean quartz
#

I'm confused, how do you not need?

jovial warren
topaz bay
#

properties are the combination of a field, getter and setter

ocean quartz
#

Don't you need to do this?

@JvmField
val NAME: Property<String> = newProperty("name", "")
topaz bay
#

You really shouldnt?

#

The only difference is that it wont make a getter for it

#

The field would still exist

jovial warren
#

also, what's ConfigMe?

topaz bay
#

trash config system

#

lol

jovial warren
topaz bay
#

yes

jovial warren
#

what's so bad about it?

#

never used it before so I'm not defending it

#

just curious

topaz bay
#

Nothing really

ocean quartz
#

Sx, it does not work without it

quiet sierra
#

wait

#

On the example

#

it says newProperty(...)

#

But that isn't defined on the SettingsHolder interface

#

wtff

topaz bay
#

Its a static method

#

@ocean quartz that doesnt even make sense

quiet sierra
#

Yeah but tf does it call

topaz bay
#

??

quiet sierra
#

newProperty seems to not be defined anywhere

topaz bay
#

I said its a static method

#

Its not in settingsholder

quiet sierra
#

I don't see any class

#
 public static final Property<String> TITLE_TEXT =
        newProperty("title.text", "-Default-");
#

what class contains the static method

topaz bay
#

ITS A STATIC METHOD

#

ITS IMPORTED

#

STATICALLY

quiet sierra
#

oof

#

This tutorial could use some imports

#

It's PropertyInitializer

ocean quartz
#

@topaz bay It doesn't, Exception in thread "main" ch.jalu.configme.exception.ConfigMeException: Could not fetch field 'TOKEN' from class 'Setting'. Is it maybe not public?
You even were the one that told me I needed to use @JvmField, you even use it on VoteParty

topaz bay
#

Glare did that actually, I was very much against using it

#

But wow, thats extremely stupid

ocean quartz
#

It is yeah, it requires you to use a public static field

versed ridge
#

Seems easier to just make it a java class

#

or at least cleaner

jovial warren
#

@JvmField is only really used for testing though

topaz bay
#

What would be easier would be configme simply using setAccessible(true)

#

Its not even a matter of it not resolving the field, they literally use getDeclaredFields

#

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

prisma wave
#

Why not make a PR if it's 1 line lol

topaz bay
#

You think I'm gonna fork this entire thing, and pollute my repo list

#

To change 1 fucking line.

#

Absolutely not.

#

It also makes no difference to me whether they do it or not, as I don't use this.

prisma wave
#

Fair enough

sour spade
#

Has anyone used multicraft? I cant seem to connect to the panel remotely
I can connect to it localy but not remotly
I forwarded to
21, 80, 25465
I tried externalip:81 and ipv4:81

obtuse gale
#

Hello

errant geyser
#

Hi :)

obtuse gale
#

Do you guys know why untouched odino left?

errant geyser
#

Uh, long story

obtuse gale
#

He was making a plugin for me and he's offline for long

#

Tell me plox

errant geyser
#

Verrrry long story

#

Theres chat logs in off topic if you wanna read for yourself

#

Just search from untouched odin

obtuse gale
#

Oh lots of scrolling

#

Okk

#

Thank you

errant geyser
#

Np

obtuse gale
#

Hope he will reply me :((

#

I don't like to stalk people on the internet

#

But I will have to do it

upper crypt
#

Does deluxetags work with luckperms?

hot hull
#

Yes, and this isn't the right channel

upper crypt
#

I just joined what channel is it for asking questions like that?

hot hull
upper crypt
#

๐Ÿ‘

hot hull
#

enchanting works, just the getting rid of the starting item doesn't

hot hull
old wyvern
#

Yes

prisma wave
hot hull
#

lol

topaz bay
#

oh dear god

#

I feel that

onyx loom
#

lmao

#

reminds me of charlie with his new domain per week ๐Ÿ‘€

heady birch
#

Lol

sour spade
#

What is a good free server panel? I have multicraft but it's only 1 server.

#

Or how can I share my console

distant sun
sour spade
#

Okay can that support multiple servers

distant sun
#

ye

#

it has most multicraft features but less shitty

onyx loom
#

make ur own panel. not hard.

#

๐Ÿ˜

hot hull
#

Kotlin man strikes again

sour spade
#

Thanks School

onyx loom
#

what u want frosty aPES3_PeepoAngry

sour spade
#

does rcon show errors?

solemn monolith
#

Can node canvas do shadows?

jovial warren
#

I'd imagine so

solemn monolith
#

funny would know ๐Ÿ™‚

solemn monolith
#

aha that makes more sense then what I was doing

pallid gale
solemn monolith
#

yep, it works now ๐Ÿ˜„

#

thanks!

distant sun
#

is java awt canvas ok for discord bots?

heady birch
#

๐Ÿ˜ฆ

#

use a buffered image and graphics2d

#

canvas is a component

obtuse gale
#

Putting it in embed is more trickier than

heady birch
#

@distant sun

#

I am ceo of graphics2d

onyx loom
#

u are ceo of everything ๐Ÿ™‚

obtuse gale
#

Idk how Barry gets canvas drawn and uploaded to embed message immediately

onyx loom
#

magik

obtuse gale
#

Sure ๐Ÿ‘€

onyx loom
#

search from: Niall#4640 ceo

heady birch
#

ceo of Search tool

onyx loom
#

u are ceo of everything ๐Ÿ™‚

heady birch
#

ceo of ceos

obtuse gale
#

CEO of making everything ceos

onyx loom
#

๐Ÿ‘€

obtuse gale
#

๐Ÿ˜‚

onyx loom
#

.

heady birch
#

ceo of emoji?

#

make my nickname ceo please

onyx loom
#

boost ๐Ÿ˜ 

heady birch
#

thank you

#

oh

#

it seems you havnt set my nickname yet

onyx loom
#

a ceo is not getting what he wants ๐Ÿค”

#

this is outrageous funnycube

heady birch
#

I want to speak to the ceo of help chat

onyx loom
#

u are the ceo of help chat

heady birch
#

Whats better

obtuse gale
#

2nd

onyx loom
#

bottom

obtuse gale
#

Cause 1st is harder to track

heady birch
#

I make it an option I like first

topaz bay
#

I dont understand the dashed line

onyx loom
#

nor do i

distant sun
#

No animation is better

topaz bay
#

Isnt that supposed to represent the next/prev viewbox

#

Why does it never actually align

#

lol

heady birch
#

you wanna see the math?

#

you cant handle the math

onyx loom
#

i think u scared him

#

good job PES_BlankieThumbsUp

distant sun
#

Show the math@heady birch

heady birch
#

graphics2D.drawRect(cursorPoint.x - 50, cursorPoint.y - 50, 100, 100);

distant sun
#

O damn

heady birch
#

@topaz bay No it represents the scale

#

If you look at the solid one, the dashed one represents what the solid viewport scales to

topaz bay
#

I dont understand

heady birch
#

@topaz bay ??

#

Look at the top image

#

SOLID square scales to the DASHED square

onyx loom
#

das crazy

topaz bay
#

I still dont get it

#

lol

lavish notch
#

is there where I can ask for development/java programming help?

onyx loom
heady birch
lavish notch
#

Cheers

heady birch
topaz bay
#

cheers

onyx loom
#

๐Ÿ˜‰

heady birch
#

I still dont get it
@topaz bay ??

topaz bay
#

WHAT HOE

#

I DONT GET IT

onyx loom
#

??

#

SOLID square scales to the DASHED square
how do u not understand?

hot hull
old wyvern
#

GG

onyx loom
#

๐Ÿ‘

signal tinsel
#

Nice

#

I need to upgrade my custom enchants system

#

But currently custom enchants are stored on a user

#

Im changing it to multiple pickaxes and shareable

#

How would i do dis

hot hull
#

just store it on the pickaxe object?

signal tinsel
#

How

onyx loom
#

just do it 4Head

signal tinsel
#

I dont wanna get a list of enchants from a lore

#

My sweater says that @onyx loom

hot hull
#

Just apply the enchant?

signal tinsel
#

No

#

Custom enchants

hot hull
#

"No" ?

#

I mean yea, I'm using custom enchants as well lol

#

And I'm applying it

sour spade
#

Does remote console display warns / erros

signal tinsel
#

How u apply

distant sun
#

you have to display them as lore anyhow

hot hull
#

finishingItem.addEnchantment(enchantment, level);

#

Well yea, but if you have an actual enchant on the item, it's 100 times easier to manage it

signal tinsel
#

Hm

#

I might just make a custom string with all enchants and parse that

hot hull
#

Why tho

signal tinsel
#

explosive:20;lightning:5

#

Idk

hot hull
#

How are you creating the custom enchant rn?

signal tinsel
#

Just itemstack

#

And add lore

hot hull
#

Jesus

#

extend Enchantment

#

and make an actual enchantment

signal tinsel
#

No

hot hull
#

Why not lmao

signal tinsel
#

Because

hot hull
#

Because what?

signal tinsel
#

Just because

onyx loom
#

i believe thats how TE does it too frosty

signal tinsel
#

Nah i wanna allow creation of enchants ingame

distant sun
#

it used to @onyx loom

hot hull
#

And TE is trash

onyx loom
#

โ˜น๏ธ

versed ridge
#

I use nbt for custom enchants

signal tinsel
#

I wanna add enchant creation to my admin gui

hot hull
#

Well the anvil adition made it a tad less bad

signal tinsel
#

Same deatb

hot hull
#

I mean you could still make a class which would register any enchant you want

signal tinsel
#

Nah

hot hull
#

"Nah"

signal tinsel
#

Lmao

#

Yes

hot hull
#

Y'all legit taking a ew way of doing this

signal tinsel
#

Who cares

hot hull
#

I do ;c

signal tinsel
#

Its only me who will ever see it

hot hull
#

Still

signal tinsel
#

Its a private plugin

old wyvern
#

still

hot hull
#

utilize the api to it's full potential

versed ridge
#

Doing it with nbt is super easy

signal tinsel
#

Are nbt stringlists a thing

hot hull
#

What if you want to add a thing in the future?, you're gonna have to rework the entire system of getting enchants

signal tinsel
#

Otherwise ill mame it myself

#

Make

ocean quartz
#

This man is against extendibility

hot hull
#

This way you can just add a method and you're set

signal tinsel
#

Lol

#

How tho frost

#

Meh ill take a look when im on pc

versed ridge
#

Wym

#

I can add anything I want

#

Without changing anything

hot hull
#

You can't tho

old wyvern
#

What if you change the enchantment name

versed ridge
#

Wym I canโ€™t

signal tinsel
#

Not an issue

versed ridge
#

I literally have

signal tinsel
#

It has an id

#

That wont change

hot hull
#

Like I can add as many things as I want

#

Without having to change the system at all

signal tinsel
#

I have a customenchant class

versed ridge
#

So can I

signal tinsel
#

I already do

hot hull
#

You're storing it in nbt, how are you gonna add lets say an enchant tier, without changing how you parse things?

ocean quartz
#

Frosty make the class final ;p

hot hull
#

smh

signal tinsel
#

Ill change it

#

No problem

versed ridge
#

Wym an enchant tier

signal tinsel
#

And that

old wyvern
hot hull
#

Just an example, like what tier is the enchant

#

out of Basic, Common, & Uncommon

heady birch
#

Add a secret thing in the lore

signal tinsel
#

I have no tiers

hot hull
#

Dude..

versed ridge
#

^

signal tinsel
#

Lmao

hot hull
#

What if you had

#

It would require you to change the entirety of the system you currently have

signal tinsel
#

I could make the initial nbt tsg a list of enchsnt ids

#

Then add more nbt tags

#

Like <id>_level

hot hull
#

This hurts my head

versed ridge
#

Well how do the tiers work

signal tinsel
#

Or tier in ur case

#

Lmaoooo

hot hull
#

You do you, icba to continue

heady birch
#

add a secret thing in the lore

signal tinsel
#

How would i store enchants otherwise

#

Lol

heady birch
#

Like a unique line

hot hull
#

By legit making an enchant and applying it to the item

#

Niall, no.

heady birch
#

no?

onyx loom
#

secret thing
force op

signal tinsel
#

Then you cant programmatically add enchants

hot hull
#

You can

signal tinsel
#

Like create

#

How

heady birch
#

your lore line would have an invisible token

hot hull
#

By making a manager for those enchants, which adds whatever enchant you want lol

heady birch
#

store the token alongside everything

hot hull
#

Niall, can you stop with lore

heady birch
#

๐Ÿ™„

hot hull
#

legit the worst way of handling them..

signal tinsel
#

Send example code

hot hull
#

I don't create my enchants on the go, so I've no code to show.

signal tinsel
#

...

heady birch
#

use lore

#

Add some cool thing

onyx loom
#

niall ur gonna make frosty yeet himself

heady birch
#

intercept the packets and hide it to user

hot hull
#

Niall, can you stop giving this man a bad example..

#

sMh

signal tinsel
#

Lol

onyx loom
obtuse gale
#

F

signal tinsel
#

Ill use ur idea niall

heady birch
#

gooba

onyx loom
#

gooba gooba

signal tinsel
#

Should be perfect

hot hull
#

Like yes you need to still manage the lore to display them, but using the lore to actually store them is just simply said dumb

signal tinsel
#

I dont

#

Lol

heady birch
#

Like yes you need to still manage the lore to display them, but using the lore to actually store them is just simply said dumb
is there a better way

hot hull
#

Same goes for nbt

onyx loom
#

lore is best

hot hull
#

I'm done

heady birch
#

I wanna know the other way

signal tinsel
#

How else without nbt

heady birch
#

Wait

#

What do you want to actually do?

hot hull
#

I showed it above Niall

onyx loom
#

aPES_ReeTriggered
frosty rn

hot hull
#

x10

signal tinsel
#

Show example code of how the fuck else lol

hot hull
#

Opening the window as we speak

signal tinsel
#

Of how to store them

onyx loom
#

this might take a while

signal tinsel
#

Thats what i need code example for

hot hull
onyx loom
#

oh god disgusting

prisma wave
#

@hot hull nice nice

hot hull
#

๐Ÿ˜‰

#

Kali, be gone kotlin nerd

onyx loom
#

โ˜น๏ธ

hot hull
#

(Ignore that dive event registration at the bottom, forgot to remove it)

topaz bay
#

imagine not using kotlin

#

๐Ÿคข

signal tinsel
#

Thats hacks

versed ridge
#

I donโ€™t see a reason to do it that way instead of nbt lol

hot hull
#

Because it's 100 times cleaner and more expandable?

onyx loom
#

lets see the nbt version of this

#

compare time

hot hull
#

I'm actually interested in seeing that ^

onyx loom
#

me too

#

because that looks nice

#

well done frosty

#

i was only joking before ๐Ÿ™‚

hot hull
#

lies

onyx loom
#

fine then

ocean quartz
#

Was recommended a video on youtube called "Object-Oriented Programming is bad" and this comment is pretty good

"There are only two kinds of languages: the ones people complain about and the ones nobody uses." - Bjarne Stroustrup

onyx loom
#

next time ill shit all over ur work

signal tinsel
#

Lol

#

No you wont

#

No balls

onyx loom
#

well first id need an actual physical form of this code, maybe printed out onto a piece of paper

#

then ill record it and send to ur dms ๐Ÿ™‚

signal tinsel
#

Lol

#

Sure

#

Print it out

#

Also shiy on whose work

#

Mine or frosts

hot hull
#

Maffie, can you show the way you're handling it

onyx loom
#

both 3djoy

signal tinsel
#

When im at pc

#

But rn its stored on the user

#

In the data file

#

But im rewriting

onyx loom
#

does .. only work when using a positive step? (e.g 1..5)? as it seems i can only use downTo to create a negative step

heady birch
#

Wait what do you want to do @signal tinsel

#

@onyx loom cant you do 5..1

signal tinsel
#

Store enchants on the item

heady birch
#

lol?

#

Store enchants on the item
@signal tinsel Enchantment api?

hot hull
#

DR, can I see your way? :p

versed ridge
#

This is what I'm doing

#

That's all I do to add an enchantment

heady birch
#

@solemn monolith was it you I made that enchantment plugin for?

solemn monolith
#

Nope, not me ๐Ÿ˜„

heady birch
#

Sure it was..

solemn monolith
#

erm feel free to send it over yea

versed ridge
#

Enchantment being my own class btw

solemn monolith
#

but not me lol

onyx loom
heady birch
#

Oh I made paypal set

solemn monolith
#

yea

signal tinsel
#

?

onyx loom
#

its not a big deal anyway, i would just prefer to have it being .. as it looks a little nicer

heady birch
#

idk ask sxtanna or bm lol

solemn monolith
#

the paypal thing was me

hot hull
heady birch
#

@chilly zenith You still use that plugin i made for you?

hot hull
#

Also, if you wanted to display the enchantment as

lore:
  - 'enchant 1, enchant 2, enchant 3'
  - 'etc'
#

Your way would probably break

onyx loom
#

why the heck would u ever do that

versed ridge
#

yeah lol

hot hull
#

That's how hypickle does it :p

onyx loom
#

????????

signal tinsel
#

?

onyx loom
#

theyre fukin weirdos then

hot hull
#

And idk, it looks good in some cases

versed ridge
#

I mean I'm sure I could modify my way to do that instead

#

I wouldn't want to though

chilly zenith
#

@heady birch minebombs?

heady birch
#

yeah CK bombs wasnt it

chilly zenith
#

sum like that

heady birch
#

A feat of human engineering

chilly zenith
#

and I have, I might use it for my next Season

heady birch
#

Nice

hot hull
#

Wait

#

Tig has a server?

old wyvern
#

Wow leads can be used as a swing

hot hull
#

Best usage of leads is a pinata party

old wyvern
#

No

#

You can swing

#

SpiderSteve

hot hull
#

AOT swing?

old wyvern
#

Time to make spider steve a reality

#

AOT what?

#

whats AOT?

hot hull
#

Oh yea I gotta send you that reddit post

old wyvern
#

wha

#

xD

heady birch
#

Advanced widget toolkit

old wyvern
#

what was that a reply for?

hot hull
#

That swing

#

Damn 134 comments

old wyvern
#

Thats a grapple pull

#

not swing

hot hull
#

Shush

old wyvern
#

xD

hot hull
#

Make a lasso

old wyvern
#

I meant the swing part

#

lol

#

Sure xD

#

How far can you bend a lead

#

dont think it can loop

hot hull
#

spawn multiple

old wyvern
#

hmm

hot hull
#

The leash is a packet, so you could just use that to make the ring

#

@ocean quartz

commandManager.getCompletionHandler().register("#enchantments"
                , (input) -> Arrays.asList(<values>))
        ;
``` This is correct right?
#

Cause it's telling me it's not registered

#

nvm I'm stupid, was registering it after the command

ocean quartz
#

Yeah that's what i was going to ask xD

versed ridge
#

yo matt

ocean quartz
#

Heyo

versed ridge
#

How goes the tab completion xd

hot hull
ocean quartz
#

Will do it will do it xD

rotund egret
#

Hm, kinda want to make that for sponge now.
Seems fun

#

The downside is I'd have to use the data API

hot hull
#

Make what ๐Ÿ‘€

rotund egret
#

The custom enchants

onyx loom
#

dewit

old wyvern
#

I mean isnt it easier with forge?

rotund egret
#

Well sponge also supports vanilla, so itd support both technically

hot hull
#

damn

old wyvern
#

ah

#

I like how java allows any object to be created with the default object constructor with reflectionfactory xD

#

access-modifiers ded

#

ReflectionFactory#newConstructorForSerialization

heady birch
#

@topaz bay apis

topaz bay
#

?

heady birch
#

go lang server

#

How would you describe/name each one?

#

It will be selectable by user and I have NO idea what to name each method

onyx loom
#

canada

heady birch
#

:rolling eyes:

#

@topaz bay

#

First can you see my question above

#

Then wondering how I can put this into a single equation:

#
if (wheelRotation > 0) {
  newScale = currentScale / (1.0 + wheelRotation * 0.05);
} else {
  newScale = currentScale * (1.0 - wheelRotation * 0.05);
}
#

The math somehow must cancel out or something. Im talking about / and + in first equation and * and - in second

topaz bay
#

name it selectable?

#

Also, theres no reason to put that into 1 equation

heady birch
#

no but.. could you?

topaz bay
#

I am not the math guy

#

I hate math, I suck at math

heady birch
#

same

topaz bay
#

I always approach math with pure logic, I would 100% do it that exact same way

prisma wave
#

I like how java allows any object to be created with the default object constructor with reflectionfactory xD
@old wyvern

Wait until you find out about Unsafe

heady birch
#

my MapLayer class, should they have a render method...

#

Or should I make an LayerRenderer e.g

#

although I also need to detect clicks and hovering

#

maybe LayerHandler

#

Idk how to structure this

old wyvern
#

Then wondering how I can put this into a single equation:
@heady birch

Curscale * (e^(log((1.0 + |wheelRotation| * 0.05)^-signum(rot))))

as in

curscale * Math.exp(Math.log(Math.pow(1.0 + Math.abs(wheelRotation) * 0.05, - Math.signum(rot)) )

topaz bay
#

gross

heady birch
#

... I will try this... but performance is really key so I will most likely use the if else

old wyvern
#

Basically we are using (log|A| + log|B| = log|A*B| ) property ,(log|A| - log|B| = log|A/B|) property and (log|B|^x = xlog|B|) property

#

sure

heady birch
#

ok

#

you lost me

prisma wave
#

That's very gross

hot hull
#

Yugi check DMs

old wyvern
#

oen sec frosty

versed ridge
#

@prisma wave wanna review some kotlin code sir

native stirrup
#

Hi

prisma wave
#

Absolutely

versed ridge
#

alrighty

#

That's my first plugin in kotlin

hot hull
#

Nice pfp

versed ridge
#

ty :P

hot hull
#

:>

versed ridge
#

perfect lol

old wyvern
#

Whats throwables?

onyx loom
#

it was in showcase a while ago iirc

hot hull
#

Something, decently cool

#

Noone seemed to like it tho

old wyvern
#

what is it tho?

#

Error handling?

hot hull
#

sec, and no

onyx loom
#

u throw shit

topaz bay
#

lol

#

@versed ridge I'm gonna flame you now

versed ridge
#

not too hard pls

jovial warren
#

that RTPCommand seems a little like arrow code to me

topaz bay
#
        val timeout = System.currentTimeMillis() + Utils.toMillis(settings.getProperty(Config.TIMEOUT))

        while (!isSafe) {
            if (System.currentTimeMillis() > timeout) {
                failed = true
                break
            }
            if (user.data.hasCooldown("rtp") or delays.contains(user.uuid)) break
            location = getRandomLocation(user.location)
            if (isSafeBlock(location)) isSafe = true
        }
#

This is not ok

versed ridge
#

I tried my best to not make it an arrow lol

old wyvern
#

o.o

#

nice

#

frost

#

dm

jovial warren
#
if (settings.getProperty(Config.COOLDOWN_ENABLED)) {
    if (!user.isAuthorized("rtp.bypass.cooldown")) {
        if (!user.data.hasCooldown("rtp")) {
            user.data.giveCooldown("rtp", settings.getProperty(Config.COOLDOWN_TIME))
        } else {
            user.sendMessage(
                settings.getProperty(Config.PREFIX) + settings.getProperty(Config.TELEPORT_COOLDOWN)
                    .replace("%time%", user.data.getCooldown("rtp"))
            )
            return
        }
    }
}

that's an arrow alright

#

ignore the bad formatting lol

versed ridge
#

@topaz bay What would you suggest I do instead

topaz bay
#

ignoring the fact that its a while loop with a user configurable exit condition on the main thread

jovial warren
#

yeah that's gonna break some stuff

topaz bay
#
while (!isSafeLocation(location))
{
  location = getRandomLocation(user.location)
}
#

Way simpler than playing around with that boolean

#

Not to mention
if (isSafeBlock(location)) isSafe = true
should just be
isSafe = isSafeBlock(location)

prisma wave
#

Is that a Utils class in kotlin

jovial warren
#

also, that failed = true could just be a user.sendMessage followed by a return if I'm not mistaken

jovial warren
#

afaik you can return in a while loop

topaz bay
#

You can

jovial warren
#

which makes the whole failed thing redundant

#

also where are your build files?

topaz bay
#
while (!isSafeLocation(location))
{
  if (timeoutConditionMet)
  {
    return user.sendMessage(failedMessage)
  }

  location = getRandomLocation(user.location)  
}

// location is safe here
versed ridge
#

Like the build.gradle?

jovial warren
#

yes

versed ridge
#

Didn't put that on github

jovial warren
#

you're supposed to push that

#

build.gradle, settings.gradle, gradlew and gradlew.bat are all supposed to be pushed

#

afaik

topaz bay
#

Also, you start with isSafe being false, and you replace the original location

#

Even if that original random location was safe, you enter that while loop

#

xD

versed ridge
#

tru

jovial warren
#

if I were you I'd rewrite a lot of it, and include the build files in the commit

#

without build files, someone coming along trying to fork this repository can't build the project on their machine

#

because they don't know what you depend on

#

first step I say is to push those build files

#

ASAP

onyx loom
#

lol

jovial warren
#

and if you don't intend on having people fork your project and make changes you shouldn't have it open-source

prisma wave
#

I mean

#

There's no reason not to open source something

jovial warren
#

good point

versed ridge
#

I just put it on github so I could get opinions on it

jovial warren
#

well, I strongly recommend you push those build files as soon as possible to the repository

onyx loom
jovial warren
#

do they enter the numbers one by one?

#

or in one input?

onyx loom
#

i want to do it in one input

heady birch
#

There's no reason not to open source something
@prisma wave people seeing my poor code ๐Ÿ˜ฆ

onyx loom
#

and if possible theres no need for them to enter how many numbers they need to input

topaz bay
#

I mean...

#

You probably want to follow the prompt though

onyx loom
#

this isnt like an actual website or anything

#

its just a pdf with loads of challenges

versed ridge
#

updated the top bit @topaz bay

jovial warren
#

@onyx loom make them enter numbers with spaces in between, or some sort of separator in between, then split them by whatever splitter you asked them to use, then do whatever you want to do

onyx loom
#

was thinking that, ty

versed ridge
#

@prisma wave Why is my Utils class bad

jovial warren
#

because you don't tend to need utility classes when using Kotlin

topaz bay
#

@versed ridge better

#

still a lot to do though

jovial warren
#

like fixing that arrow code

versed ridge
#

I'm thinking of how I can fix that rn lol

topaz bay
#

if-not-return instead of if-so-continue

prisma wave
#

Because the entire concept of a Utils class isn't very kotlin idiomatic

topaz bay
#

exit early

versed ridge
#

But I don't want to return if those conditions aren't met

prisma wave
#

You should favour either objects, or top level functions (ideally extension functions)

versed ridge
#

I want it to continue

topaz bay
#

It doesn't apply to every possible situation ofc

#

But look at this

#

Your logic should not be in this if statement

#

This if should return

#

also

#
if (from.block == to?.block)
versed ridge
#

ah

#

Yes that makes a lot more sense

topaz bay
#

Also, some of these ifs can be combined

#

this also brings into question your cooldown api

versed ridge
#

The cooldown is stored in a file

topaz bay
#

thats irrelevant

#

Why not have a function that combines the logic of this?

jovial warren
#

also, having your config be a class of constants is a questionable way of getting config values imo

versed ridge
topaz bay
#

An example of how mine works

jovial warren
#

considering the fact that Spigot already caches config values, I find libraries like that to be quite pointless

topaz bay
#

Its not about caching

jovial warren
#

they do make your code a bit more readable I guess

prisma wave
#

Type safety

#

smaller chance of typos

#

Cleaner

jovial warren
#

yeah fair point

prisma wave
#

Technically slightly faster

jovial warren
#

just don't think a class of constants is quite the right method

#

it's a bit messy imo

versed ridge
topaz bay
#

No, I meant on the side of the cooldown api

versed ridge
#

ah

topaz bay
#

And this method use will send a message saying how long they have to wait

versed ridge
#

for the cooldown part

topaz bay
#

eh

#

ig

#

this send message is bothering me

versed ridge
#

me too

topaz bay
#

I dont understand why theres a permission node in that method

#

Also, please dont mix braced and non braces statements

#

Always use braces

versed ridge
#

wym?

topaz bay
#

oh

#

wow

#

I didnt even realize

versed ridge
#

And I included a check for a perm in the giveCooldown method to remove 1 less if lol

topaz bay
#
if (user.data.hasCooldown("rtp") or delays.contains(user.uuid)) return
#

That is...

#

No...

#

Dont use or

jovial warren
#

you can do one-line if statements if you please

topaz bay
#

for 1

#

No, you cannot

versed ridge
#

Why no or?

topaz bay
#

Mixing braces is not good

#

Its messy

#

And because or does not do the same thing as ||

jovial warren
#

if you want to do one-line if statements you can do one-line if statements, the only thing I say is: don't have a non-braced if statement followed by a braced else statement

topaz bay
#

or is a function youre calling, and it does not short circuit in the same way || does

jovial warren
#

that's a bad mix of braces

topaz bay
#

Anyways

#

Like I said, always use braces

jovial warren
#

if he wants to use a one-line if statement that's up to him

versed ridge
#

What do you mean by that

#

always use braces

jovial warren
#

he means you should never use an if without {}

#

which you can do if you want to

#

doesn't make all that difference

#

just personal preference

topaz bay
#

No, I mean don't use any control flow without braces

#

Because its messy

#

And you can do literally anything if you want to

jovial warren
#

there's nothing objectively or fundamentally wrong with control flow without braces

topaz bay
#

You could write the entire class on 1 line if you so wished

versed ridge
#

I think it looks better without them for 1 line

jovial warren
#

so do I

#

just personal preference

versed ridge
#

And so I should replace or with ||?

prisma wave
#

yes

#

or is the same as |

topaz bay
#

No

#

Its not

prisma wave
#

is it not?

jovial warren
#

the fact of you not needing braces for control flow statements was put there for the express purpose of allowing you to write control flow statements without needing braces

#

anyway, let's move on

topaz bay
#

Nvm, it is

prisma wave
#

ez

hot hull
#

oi you geeks, is it possible to create a custom effect, and have it display where the night vision is?

topaz bay
#

@jovial warren ?????

hot hull
#

Or is that another thing mc fucks us with?

topaz bay
#

That argument doesnt even make sense

jovial warren
#

what about it doesn't make sense?

topaz bay
#

Like I said, you could write the entire class on 1 line

#

Is that allowed specifically so that you can do it?

prisma wave
#

@prisma wave no, it's client side i believe

#

wait wrong person

#

@hot hull

hot hull
#

lol ponged urself, what a noob

steel heart
#

Frosty pretty sure it isnt

jovial warren
#

if they didn't want to allow you to write control flow statements without braces they wouldn't've allowed you to write control statements without braces would they @topaz bay

hot hull
#

Anyhow, shame

versed ridge
#

Well besides the arrow code anything else that I should change?

jovial warren
#

anyway, whether you write control flow statements with or without braces when it's a single condition is up to you

topaz bay
#

@jovial warren dude

#

That doesnt make sense

jovial warren
#

it does

#

if they didn't want to allow you to do it they wouldn't've allowed you to do it

topaz bay
#

There are plenty of things you can do that are convention breaks

jovial warren
#

yeah and I don't believe not bracing control flow statements is one of them

#

although that depends on the style you use

prisma wave
#

convention isn't an opinion

#

it's a set of defined standards

#

you can't jsut say "i don't think this is conventional"

topaz bay
#

Its just bad design to not use braces

#

Its messy, and it leads to issues

jovial warren
#

I guess that holds up

#

still doesn't mean you should be acting like it's against the law

topaz bay
#

You really should though

#

If you dont make a big deal about the little things, you end up with the thousands of shitty programmers who make bukkit spigot tutorials on youtube

#

People not caring about the details is literally how you breed shittyness

#

@versed ridge push the changes to gh

versed ridge
#

kk

jovial warren
#

and push the build files as well

#

very important

#

push the build files

#

there should be a gradle/wrapper directory, build.gradle, gradlew, gradlew.bat, and settings.gradle I believe

#

actually idk whether settings.gradle is necessary

#

someone verify that

topaz bay
#

it holds properties and some pre setup logic

jovial warren
#

so answer is yes then

#

push all those files aforementioned

versed ridge
#

they have been pushed

#

but not the build files :)

jovial warren
#

๐Ÿคฆโ€โ™‚๏ธ

topaz bay
#

spacing

#

please

versed ridge
#

what about spacing

jovial warren
#

also, try to improve your commit naming

versed ridge
#

I usually do name them decently

#

Just didn't for this

topaz bay
#

no

#

Never use !!

#

Absolutely fucking never

jovial warren
#

yeah that'll break some shit

#

if that is null it'll throw a NullPointer

#

I believe

topaz bay
#

spigot has a method in location for this

jovial warren
#

!! is the equivalent of Objects.requireNonNull I believe

topaz bay
#

user.uuid in delays

ocean quartz
#

I think it's more equivalent to assert != null

jovial warren
#

yeah, quite similar things

#

assert is much stronger though

topaz bay
#

its literally just if (thing == null) throw NPE

prisma wave
#

closer to requireNonNull since it's an NPE

#

not an assertionerror

topaz bay
#

Like literally, the code is if null throw npe

jovial warren
#

pretty much

topaz bay
#

no, thats literally what it is

#

LOL

jovial warren
#

that's kinda what I mean when I say pretty much

topaz bay
#

"pretty much" means "nearly"

versed ridge
#

spigot has a method in location for this
What method?

old wyvern
#

Like literally, the code is if null throw npeIsnt that exactly what requirenonnull does tho?

topaz bay
#

toCenterLocation

prisma wave
#

Like literally, the code is if null throw npeIsnt that exactly what requirenonnull does tho?
yes but !! avoids a method call iirc

old wyvern
#
public static <T> T requireNonNull(T obj) {
        if (obj == null)
            throw new NullPointerException();
        return obj;
}```
prisma wave
#

it's inlined

versed ridge
#

uh

#

I'm not seeing that anywhere?

prisma wave
#

it gets done by the compiler

old wyvern
#

oh

topaz bay
#

@versed ridge it might be paper

versed ridge
#

oh

#

rip

topaz bay
#

Just use paper?

ocean quartz
#

The problem with paper is that, well if the users are using spigot it won't work

topaz bay
#

And?

#

People who dont use paper are idiots

ocean quartz
#

Well there are people that still uses spigot lol

old wyvern
#

tuinity

topaz bay
#

Theres never a reason to use spigot over paper

ocean quartz
#

Tell that to the people downloading the plugin

topaz bay
#

I have no issue with doing that

#

In fact, I often do

versed ridge
#

alright I have switched it to paper

topaz bay
#

@versed ridge good

versed ridge
#

pushed more changes

topaz bay
#

Your random location method is kinda questionable

#

why not get the highest block at x and z

#

And get the location from that?

versed ridge
#

Does it make a difference?

jovial warren
#

don't think it'll make any major, major differences, just maybe a bit cleaner and better of a method

ocean quartz
#

Sx, added the set accessible on my fork of config me and no longer need the JvmField, it really was just one line there

topaz bay
#

lol

#

did anyone say anything on my issue?

#

Oh how nice

#

comments? @ocean quartz @versed ridge @frail glade

#

You are the nerds who apparently use this thing

versed ridge
#

I mean as long as I don't need to put @JvmField every where them it's fine imo

ocean quartz
#

Yeah i think that's basically it
I think there was also a thing were we needed to use * because of varargs but I'm pretty sure i was just doing it wrong

topaz bay
#

The annotations would get rid of the kotlin warning for platform nullability ambiguity

#

wow.. say that 5 times fast

versed ridge
#

Why is sand not tagged with valid spawn

#

Mobs spawn on sand?

onyx loom
#

yes?

#

have u never saw a desert in mc

versed ridge
#

yes?

onyx loom
#

oh right

versed ridge
#

Mobs spawn there do they not?