#dev-general

1 messages · Page 157 of 1

onyx loom
#

and i replied saying thats another 3 years OMEGALUL

dusky drum
#

idk why even minecraft blocks access to some classes like WHYP''

hot hull
#

wut

dusky drum
#

like

#

with anvil guis

#

you have to do some realy wierd stuff

#

cause mc blocked access to some class functions

lavish notch
#

What's saturation? (Currently looking at player.setSaturation(Int))

onyx loom
#

saturation is when u eat and then it gives u saturation until the next time u need to eat afaik

#

the more saturation, the longer the time before ur hunger bar goes down

lavish notch
#

ah

#

Also - does .setFoodLevel do what I think it does? - that being, set your hunger bar

onyx loom
#

yea

lavish notch
#

Is there some API limit, or ?

#

as I have two loops altering the hunger bar for 10 iterations each

pastel imp
#

What are the good things about using yaml to store data? Like I could use MySQL but never rlly worked with it and ye I wouldn’t use my plugin in a network so no need for that I suppose..?

#

Need opinions

hot hull
#

Mackenzie, this ain't discord

distant sun
#

@pastel imp sqlite maybe

hot hull
#

You can spam shit as much as you want, just like ya know don't call it thousands of times a second

distant sun
#

Yaml isnt the best storage option

hot hull
#

Depends what kinda data

surreal quarry
#

spigot rate limiting lmao

#

imagine

distant sun
#

Some plugins uses it but lets not xd

#

Shitty api + rate limits = :rip:

lavish notch
hot hull
#

Bad enough that the api is shit :p

lavish notch
hot hull
#

That's fine

lavish notch
#

I see no change in hunger bar though

pastel imp
#

Welp store like player levels

hot hull
#

Also please do not do what you're doing

pastel imp
#

Or ranks

#

Never used sqlite either

lavish notch
#

You telling me that frosty, or Afonso?

pastel imp
#

So would be something new for me

hot hull
lavish notch
#

What is a better wait then?

distant sun
#

Sql it's not that hard

hot hull
#

Runnables

distant sun
#

What do you need to store?

old wyvern
#

Yes lets all just put the main server thread to sleep 🙂

distant sun
#

:))

hot hull
#

Where did you learn about Thread.sleep? If it was from a person, please block them

distant sun
#

Gn

pastel imp
#

What’s the difference between sqlite and MySQL? Also store player level/xp

#

An int

#

For each player

hot hull
#

If it was a google link, please delete it, just forget about it

old wyvern
#

sqllite is local

distant sun
#

Sqlite store data to a file

lavish notch
#

@hot hull You're welcome to murder me.... StackOverflow

distant sun
#

And mysql has some functions that sqlite doesnt if im not wrong

old wyvern
#

Yea

hot hull
#

Don't go in our lord and savior kangarkoo's steps please

lavish notch
#

Frosty, can you give me some wait code?

old wyvern
#

I mean each of the diff sql implementations have diff features

hot hull
#

runnable

lavish notch
#

I am noob

pastel imp
#

So what’s my best option?

old wyvern
#

Don't go in our lord and savior kangarkoo's steps please
WHo the hell is that?

hot hull
#

Bruh

#

MemeAcademy

old wyvern
#

Oh that plugin academy weirdo?

distant sun
#

:))

old wyvern
#

oh

pastel imp
#

MySQL I suppose?

distant sun
#

Boy that was fun

#

Depends.

old wyvern
#

Who is the bloody hell pays for that

#

lol

hot hull
#

He closed his company or some shit now I think

old wyvern
#

oh

distant sun
#

Probably nobody

old wyvern
#

xD

pastel imp
#

Wait depends on what?

hot hull
#

Plenty of people bought it due to sheer stupidity

old wyvern
#

Kangaroo

#

Really?

distant sun
#

On what you need to store

pastel imp
#

As said INTs

old wyvern
#

INTs is not a proper answer

#

What exact structure are you storing

pastel imp
#

Welp player level and do

#

Xp

#

To be precise

old wyvern
#

Show us the class defenition maybe?

pastel imp
#

Don’t even started

old wyvern
#

A basic plan would suffice

pastel imp
#

I am trying to know how I will store it

old wyvern
#

Ah

pastel imp
#

And only after

#

Do the coding adapted to it

old wyvern
#

You can most probably just go with Sqlite for most cases

distant sun
#

You can also use persistent data if you are on 1.14+ I guess

pastel imp
#

But is a lag free option though?

#

I am on 1.12.2

distant sun
#

Depends how you do it

old wyvern
#

But is a lag free option though?
@pastel imp
Completely on how you manage that

#

Avoid connections on the main thread

pastel imp
#

Which means?

old wyvern
#

Handle transactions on other threads

pastel imp
#

Ye idk what you are rlly saying there xd

distant sun
#

If they get xp each 5 ticks you dont want to constantly update the database if im not wrong

old wyvern
#

Do you know what a Thread is?

pastel imp
#

As said never used SQLite

#

Thread indirectly yes

#

But you better explain to be sure

#

Lol

distant sun
#

Qustion, will bukkit remove from memory already run / cancelled runnables?

pastel imp
#

If they get xp each 5 ticks you dont want to constantly update the database if im not wrong
@distant sun ye they would get xp by mining blocks?

distant sun
#

I would store the lvl when it's modified and the xp on interval

#
  • on player quit
pastel imp
#

So I would need to store the data in a var and like each 2minutes or so store it in the database?

#

Welp actually good question

#

I am gonna use the xpbar as progression system

lunar cypress
#

Qustion, will bukkit remove from memory already run / cancelled runnables?
@distant sun bukkit removes nothing from memory but I'd assume it doesn't randomly keep references of your runnable objects

pastel imp
#

Couldn’t it be used to store the xp?

#

Without need to use external databases

distant sun
#

Probably

pastel imp
#

I mean the xpbar is percentage

#

I just get the amount you need to go from level 1 to 2

#

And get the amount the player has

#

And voila

#

?

distant sun
#

dont use the spigot methods for that

old wyvern
#

What exactly are you even trying to do

distant sun
#

They are shit

pastel imp
#

What exactly are you even trying to do
@old wyvern player levels

old wyvern
#

You just want to set a player's level?

pastel imp
#

dont use the spigot methods for that
@distant sun you mean the setLevel etc?

#

You just want to set a player's level?
@old wyvern I want a custom level system

distant sun
#

get / setTotalExp

pastel imp
#

But I won’t have the vanilla system

old wyvern
#

Oh dont use spigots set level for that lol

pastel imp
#

Sooo my system is gonna replace vanilla system

#

So I can customize the xp needed etc

distant sun
#

Can probably do some math and use it @old wyvern

dusky drum
#

is there anything plugin breaking in 1.16.2 update?

old wyvern
#

?

pastel imp
#

So what would you suggest using then?

distant sun
#

Actually

old wyvern
#

What was the reply about gab?

distant sun
#

If you set the level to X, will the xp also change?

old wyvern
#

xp is just the visible bar afaik

pastel imp
#

The amount you have yes

old wyvern
#

0 to 1

pastel imp
#

But what I am thinking isn’t getting the amount xp the player has

#

But the progression of the xpbar

#

As it’s 0-100

#

So if I have 50% of the xpbar

#

And xp needed to level up

distant sun
#

Ye but can you use setLevel without modify the total xp?

pastel imp
#

Is like 500

#

Means I currently have 250

old wyvern
#

Ye but can you use setLevel without modify the total xp?
There is no total xp

pastel imp
#

There is no total xp
@old wyvern ^^

distant sun
#

No?

old wyvern
#

Spigot just has level and the percent of the bar filled

#

yea

pastel imp
#

Yes

distant sun
#

how so lol

old wyvern
#

Confused me a lot when i was working on something last year tbf

pastel imp
#

Xp is a separated system

old wyvern
#

how so lol
wdym?

pastel imp
#

But the xpbar works as a percentage

distant sun
#

I know

old wyvern
#

getXP just returns the percent of the xp bar filled

distant sun
#

anyways

old wyvern
#

getLevel gets the current level

#

You can get the total xp with some math tho

#

Theres a function on the wiki for that

pastel imp
#

So means if I block ANY vanilla ways of getting xp I can use the default xp storing system in my advantage? Xd

old wyvern
#

Dont

pastel imp
#

Why

old wyvern
#

It will be a pain in the ass, trust me.

pastel imp
#

Don’t think it will

old wyvern
#

Then go ahead 🙂

pastel imp
#

As I already have already have everything in my mind

#

On how it would work

old wyvern
#

👍

pastel imp
#

The maths

#

Etc

#

Logic and theory is something

#

Actually doing it is different

static zealot
#

on a scale from 1 to 2 how hard would you say making a global chat plugin that only players with a permission would see is?

pastel imp
#

1

static zealot
#

btw I have no bungee experience and just some basic spigot

pastel imp
#

Oh bungee support?

distant sun
#

Global as in bungee?

static zealot
#

ye

#

my bad

distant sun
#

I guess you can use plugin messaging event

pastel imp
#

Well 1.2 then

distant sun
#

And get the message then broadcast it to people with a certain permission

pastel imp
#

1.6

distant sun
#

You probably dont have to use bungee at all

static zealot
#

xD

#

than went from 1 to 1.6 very quick

#

well then how would I broadcast it on other servers?

pastel imp
#

Ye xd

distant sun
#

Check if plugin message event its on spigot or bungee

pastel imp
#

Websockets?

#

I am dreaming

#

Lol

static zealot
#

I suppose Matt's FM works on bungee btw?

lavish notch
#

How do I do a for loop with a wait in it? (Minecraft, pls give code)

heady birch
#

Become Self Reliant

#

@lavish notch What kind of wait

#

One that laggs the server, i'm guessing not 🙂

lavish notch
#

yeah

#

not thread.sleep

heady birch
#

What are you foring through?

#

Users or something?

lavish notch
#

I guess like a count down is the best way to desribe it

heady birch
#

Ah okay

lavish notch
#

IE: 3, 2, 1, GO

#

sorta thing

pastel imp
#

So

#

Send 3

#

Wait 1s

#

Send 2

#

Wait 1s

#

Etc

#

Something like that I would assume

lavish notch
#

Actually

#

lmao

#

I small brain worked it out lol

pastel imp
#

??

heady birch
#

class Countdown extends BukkitRunnable {
  int i = 5;
  
  @Override
  public void run() {
    //do something with i.
    if (i == 0) {
      //countdown finished
      cancel();
      return;
    }

    i--;
  }
}```
lavish notch
#

So I had this Bukkit.getScheduler().scheduleSyncDelayedTask(main, () -> commandSender.setFoodLevel(finalI), 10);

#

..and to do what I needed was Bukkit.getScheduler().scheduleSyncDelayedTask(main, () -> commandSender.setFoodLevel(finalI), 10*finalI);

#

difference being *finalI

#

(The loop iteration counter)

heady birch
#

oh yeah that works as well 👍

lavish notch
#

One more thing

#

I have 2 plugins

heady birch
#

yep

lavish notch
#

And one, breaks the other with Plugin already intilialized how can I fix it?

#

Plugin.yml for one:

name: "Wack"
main: "ml.mackenziemolloy.Main"
author: "Mackenzie Molloy"
version: "1.0"
apt-version: "1.15"
commands:
  wack:
    aliases: [wk]
    description: Main command
pastel imp
#

Does any of them depend on the other

#

?

lavish notch
#

No

heady birch
#

Fully qualified class name is the same

#

ml.mackenziemolloy.Main

pastel imp
#

Oh ye

#

If both have the same path

heady birch
#

ml.mackenziemolloy.<pluginname1>.Main

lavish notch
#

yes

#

thx

hot hull
#

Please rename your main class

#

Ktnxbye

steel heart
#

class Countdown extends BukkitRunnable {
  int i = 5;
  
  @Override
  public void run() {
    //do something with i.
    if (i == 0) {
      //countdown finished
      cancel();
      return;
    }

    i--;
  }
}```

@heady birch NO

#

I mean use Consumer<BukkitTask> wesmart

surreal quarry
jovial warren
#

aye my man got a Kotlin example

surreal quarry
#

yessir

#

i did it in kotlin first then decided to add java for the people who use java lmao

jovial warren
#

wait what is KHttp?

surreal quarry
#

its what i use for json requests

jovial warren
#

ah a Kotlin HTTP library

surreal quarry
#

yea

jovial warren
#

what does it use for JSON?

#

kotlinx.serialization?

surreal quarry
#

not too sure honeslty

#

idk if thats what you're looking for

jovial warren
#

ah okay it uses org.json

remote goblet
prisma wave
#

if only

#

🙂

remote goblet
#

too bad it succ

#

implementation costing my storage

prisma wave
#

WOW

remote goblet
#

idk pdm didnt work for me

#

so ehhh

prisma wave
#

😠

#

that's a you problem

remote goblet
#

no thats a you problem

surreal quarry
#

sounds like user error

remote goblet
#

goddamn kotlin-reflect adding another 3mb peepoSad

prisma wave
#

also there have been many bugfixes since

remote goblet
#

well i can guarantee this plugin isnt going on spigot anytime soon

prisma wave
#

it will if you PDM™️ it

remote goblet
#

do you want me to try pdm again

prisma wave
#

not really

#

it'll probably break

#

and that's embarassing

frail glade
#

Relocations when

prisma wave
#

but in theory yeah

#

¯_(ツ)_/¯

#

whenever I can rustle up the willpower

frail glade
#

Or do you want me to link you previous examples of how to do the class loader stuff?

remote goblet
#

okay sp what we've learnt so far

#

all pdm does

#

is add another 100kb mmSitStareMocha

frail glade
#

Lol what

remote goblet
#

im stupid ignore me

frail glade
#

Oh

remote goblet
#

literally ignorem e

prisma wave
#

excuse me

remote goblet
#

pdm succ never work

steel heart
#

pdm good

prisma wave
#

wow

steel heart
#

veri good

prisma wave
#

no

steel heart
#

no?

prisma wave
#

you're doing it wrong probably @remote goblet

steel heart
#

aight

prisma wave
#

i am innocent

remote goblet
#

we've discussed this one before sir

prisma wave
#

discuss it again

#

😠

remote goblet
#
plugins {
    id 'java'
    id 'com.github.johnrengelman.shadow' version '6.0.0'
    id 'org.jetbrains.kotlin.jvm' version '1.3.72'
    id 'me.bristermitten.pdm' version "0.0.18"
}

dependencies {
    // Overlord language
    pdm "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
    pdm "org.jetbrains.kotlin:kotlin-reflect:1.3.72"

    // Spigot Stuff
    compileOnly 'org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT'
    compileOnly 'me.clip:placeholderapi:2.10.9'
    pdm 'dev.rosewood:guiframework:1.1.1'

    // Other
    compileOnly 'com.zaxxer:HikariCP:3.4.5'
}

jar.dependsOn project.tasks.getByName('pdm')
#

there isnt anything else to discuss mmSitStareMocha

prisma wave
#

are you running gradle shadowJar

remote goblet
#

absolutely EmiCool

prisma wave
#

then that is why

#

fool

#

4head*

remote goblet
#

what am i supposed to do then

#

fool

prisma wave
#

gradle build

remote goblet
#

these are the things you must explain on your readme

#

clown

prisma wave
#

i do

steel heart
#

lol

prisma wave
#

well

#

kind of

#

I thought it was obvious that you don't run shadowJar

#

lol

remote goblet
#

these are things you should explain on your readme that are comprehendable

prisma wave
#
jar.dependsOn project.tasks.getByName('pdm') //Always run the pdm task when we build. Alternatively, just run [gradle pdm build]```
steel heart
#

tell them they need a computer as well

prisma wave
#

that is very comprehendable

remote goblet
#

i aint read that far

static zealot
#

wait are you not suppose to use gradle shadowjar?

onyx loom
#

ori 9head

prisma wave
#

not with pdm

static zealot
#

I was told to use that instead of gradle build

prisma wave
#

yeah

#

pdm is just an alternative to shadow

onyx loom
#

if ur not using pdm and need to shade then yes shadowjar

prisma wave
#

^

static zealot
#

ah Ic

prisma wave
#

1892head

#

ori

onyx loom
#

also, wtf is jython mitten

#

u disgust me

remote goblet
#

Jython is a new garbage language

prisma wave
#

jython good

#

clojure bad kotlin bad java bad

onyx loom
#

java + python = jython? sounds awful

remote goblet
#

Jython is an implementation of the Python programming language designed to run on the Java platform. The implementation was formerly known as JPython until 1999. Wikipedia

#

Sounds like

#

absolute

quiet sierra
#

yesterday you were idolizing clojure

remote goblet
#

fucking garbage

prisma wave
#

If you can't handle the truth we can't be friends 🙂

remote goblet
#

I can't handle the truth

onyx loom
remote goblet
#

now fuck off with yo garbage languages

quiet sierra
#

or however tf you spel

#

idk

onyx loom
#

kotlin good

prisma wave
#

Jython is the future, today

onyx loom
#

The end.

quiet sierra
#

Just code in electrical pulses

prisma wave
#

Unlike all of these gimmicky languages

quiet sierra
#

Shock the motherboard real quick

prisma wave
#

Jython is consistent and powerful

remote goblet
#

now lets find where that jar file went

prisma wave
#

Second only to JRuby

quiet sierra
#

shit I can't change my name

onyx loom
#

wym ori

steel heart
#

Skript my dude

onyx loom
#

its like in the same spot

#

bnasically

quiet sierra
steel heart
#

Skript will always hit different

prisma wave
#

Hear me out

#

Skript

#

But it compiles to JVM bytecode

steel heart
#

OOWWW

remote goblet
#

Brister

#

go home

#

you're fucking stupid

prisma wave
#

i am home

remote goblet
#

not drunk

prisma wave
#

:)

remote goblet
#

just stupid

steel heart
#

ori why u have minusonehead

prisma wave
#

i have seen the future of programming

#

i assure you that JSkript is the future

remote goblet
#

ah found it

steel heart
#

perhaps its being used already

onyx loom
#

just put a J infront of everything now ig

prisma wave
#
make new class called Main that extends JavaPlugin:
  when Main is enabled:
    kill every player
onyx loom
#

uh oh

#

please no

prisma wave
#

clearly

onyx loom
#

what the fuck

prisma wave
#

this is the future

steel heart
#

lmao

prisma wave
#

it is expressive but powerful

onyx loom
#

not even funny

prisma wave
#

clean and concise

steel heart
#

there will exist plugins that code plugins

remote goblet
#

This is getting concerning

onyx loom
#

very

prisma wave
#

you cannot handle the truth

onyx loom
#

no u cant

steel heart
#

nor deny it

prisma wave
#

this is objectively superior

remote goblet
prisma wave
#

you don't need to worry about complicated algorithms anymore

prisma wave
#

just simply

#
do what the plugin needs to do```
steel heart
#

evenhandedly

remote goblet
#

brister despite the fact you now think kotlin is bad

steel heart
#

fallacious error

prisma wave
#

expected 1 argument

#

sent 0

steel heart
quiet sierra
#

EternalReports line 90

#

You probably need to provide an argument

remote goblet
#

OH NO

quiet sierra
#

what

remote goblet
prisma wave
#

oh wow

ocean quartz
#

Wtf happened there, he started having stroke at the end

prisma wave
#

it's the real james gosling

dusky drum
steel heart
#

i fuqking hate maven users fr

dusky drum
#

dont say maven

#

i die

#

its .xml is su ufly

#

ugly*

steel heart
#

I found good library

#

but maven

dusky drum
#

if its maven

ocean quartz
#

It's fugly

steel heart
#

so shaded stuff and dependencies is fuqed

#

like hell

dusky drum
#

you can still get gradle still

remote goblet
steel heart
#

yes

dusky drum
#

frik my eng

#

su gud

steel heart
#

Im gonna pr

dusky drum
#

IM SO friking good in eng.

#

howly

#

yay just got notification that i have windows update waiting for restart of pc.

steel heart
#

never seen more exceptional sophisticated english

#

lol

dusky drum
#

eh

steel heart
#

do ur thing

dusky drum
#

?

steel heart
#

udpate

lunar cypress
#

so shaded stuff and dependencies is fuqed
@steel heart you do realise that all that gradle does when publishing is generate a maven pom?

steel heart
#

You don’t really know the context but that’s correct.

surreal quarry
surreal quarry
#

@agile stag what do you have to say for yourself

agile stag
#

Fuck you

prisma wave
#

Kotlin good

agile stag
#

No

surreal quarry
#

kotlin very good

agile stag
#

Java as a whole sucks major dick

surreal quarry
#

yea java is bad

#

kotlin is good

agile stag
#

C# is better and faster

#

Ur dumb

#

Kotlin gets interpreted into java

#

That isnt efficient at all

prisma wave
#

are you joking

#

Because that is completely wrong

agile stag
#

Its built on java

#

Am i wrong?

surreal quarry
#

probably

prisma wave
#

it compiles to JVM bytecode

#

That's different to being built on Java

#

whatever that means

agile stag
#

Thats what i mean

#

Its like writing in C vs Assembly

prisma wave
#

Ok but it's not "interpreted into java"

#

How so?

quiet depot
#

bruh java is speedy gonzales

agile stag
#

^

#

Vs slow kotlin

prisma wave
#

...

quiet depot
#

no kotlin is speedy gonzales v2

agile stag
#

No

prisma wave
#

They're literally the same speed

#

They compile to the same thing

#

The kotlin compiler is literally faster than Java's in some situations

agile stag
#

Faster != efficient when compiling

onyx loom
#

what

#

kotlin gets compiled to jvm bytecode

prisma wave
#

What are you basing these remarks on?

onyx loom
#

just like java...

agile stag
#

Its me vs everyone here im not gonna win any arguments

quiet depot
#

What are you basing these remarks on?
the best tool of intellectual argument, opinion

onyx loom
#

🤣

prisma wave
#

you're not going to win because you're wrong

onyx loom
prisma wave
#

Nothing to do with how many people there are

agile stag
#

Whatever you say

prisma wave
#

kotlin is just as fast as Kaba

#

Java*

agile stag
#

Both are slow anyways

onyx loom
prisma wave
#

In what world

agile stag
#

C is better :)

quiet sierra
#

Electrocute your motherboard with proper timing

onyx loom
#

damn now thats speedy

prisma wave
#

kotlin is ancient
C is better

onyx loom
prisma wave
#

Anyway

#

Anyone heard of clojure?

quiet sierra
#

kotlin bad motherboard shock good

onyx loom
#

nope

prisma wave
#

It's good

#

I would recommend

onyx loom
#

unfortunately i would have to disagree

#

for obvious reasons

#

very unfortunate...

prisma wave
#

no

#

You are wrong

#

Just plain wrong

#

Clearly the system has brainwashed you

#

Wake up

#

Keeple

quiet depot
#

jython

#

YOU'RE the brainwashed one

prisma wave
#

Clojure is the only acceptable future

#

D:

#

No

quiet depot
#

yes

#

i can prove it

#

you ready for my irrefutable proof?

onyx loom
#

u are brainwashed

quiet sierra
#

I need to use motherboard shock device to shock mitten

prisma wave
#

fine

#

Show me this so called proof

onyx loom
#

hes brainwashed for thinking kotlin compiles to jvm bytecode Kappa

quiet depot
#

cuz i said so kid lol

onyx loom
#

o

surreal quarry
#

insane

onyx loom
#

u got him good there

surreal quarry
#

can't argue with that

#

he is an admin after all

prisma wave
#

oh boy

#

well

#

you are clearly correct

quiet depot
#

so with that in mind

prisma wave
#

Tell me what is the best language?

onyx loom
#

😬

quiet depot
#

the best language is in fact vbscript

prisma wave
#

of course

onyx loom
#

😳

prisma wave
#

It all makes sense now

onyx loom
#

cant disagree with that

prisma wave
#

I was just too 4headish to see it

#

Fun fact

#

Changing your nick on mobile lets you see all of the roles

onyx loom
#

oh yea i remember seeing that

prisma wave
#

mildly interesting

onyx loom
#

indeed

regal gale
#

Dummy-tier I and II aren't applied to anywhere, why those exists thonking

prisma wave
#

¯\_(ツ)_/¯

onyx loom
#

wdym

#

they are

prisma wave
#

Maybe Barry makes copies of every tier automatically

regal gale
#

@onyx loom proof for that pls

onyx loom
#

i mean if someone is a booster

#

and changes nick

regal gale
#

Anyway, I'm finishing this (probably stupid) move in the code project rn

#

Converting from JSON -> yaml file

#

And some placeholders for my World expansion

quiet sierra
#

Just create a json converter

prisma wave
#

JSON is valid yaml

#

Afaik

regal gale
#

That's what I'm trying to do?

quiet depot
#

thien

#

like vb said

#

this is valid yaml:

#
{
  "key": "value"
}```
regal gale
#

I mean, the format code, not the validation

prisma wave
#

that might be a cool side project

#

A tool that could convert between markup languages

#

Yaml > JSON > XML > toml

#

And korm ofc

regal gale
#

I'm almost finishing the convert part when this screwed me off:

yaml1:
- 1
- <package..smth>
- 3
-4

with this json:
[1, {"Hi","Hello"}, 3, 4]

prisma wave
#

Map lists

regal gale
#

I'm trying that method a while back, probably gonna re-make it

steel heart
#

Uhm anyone got a good tutorial about how to make ssh keys etc

#

?

quiet depot
#

ssh-keygen -t ecdsa -b 521

steel heart
#

what would that do?

quiet depot
#

create an ssh key

steel heart
#

with any specific permissions?

#

and limitations?

quiet depot
#

ssh keys don't have permissions

#

the key is just a password

#

you're free to limit the account it's linked to though

steel heart
#

hmm okay

#

and not any stuff with ip limitation as well?

quiet depot
#

it's literally just a file with text in it

#

anything else you want is done on the server

steel heart
#

I feel dumb but I know nada about this

#

ty anyways

#

very helpful

#

btw

#

how would I manage the permissions then? like in the server

quiet depot
#

what sort of permissions?

steel heart
#

accessability to directories

quiet depot
#

you can't

#

you'd have to virtualize them

#

for sftp, you can chroot

#

but there's no way to limit ssh like that

steel heart
#

uh okay

#

its ftp access btw

quiet depot
#

do not use ftp

steel heart
#

well I guess

#

oh why not?

quiet depot
#

ftp is ancient and insecure

#

use sftp

steel heart
#

oh yeah

#

well so no real limitations unless magic

quiet depot
#

if all you're worrying about is sftp, disable ssh access on the account and chroot the directory

#

however, if you really require fool proof permissions of the sort, virtualization is the only way

steel heart
#

wait how do I do that

#

okay

#

how do I achieve virtualization

quiet depot
#

depends on the level of virtualization

#

docker for example, may be fine

#

or you may need something like proxmox

steel heart
#

oh okay ty, have a good day

#

I will look up a tutorial about chroot then

quiet depot
#

what's it for out of curiosity?

steel heart
#

no, my friend @wispy ravine needs some help

#

but his discord is broken

quiet depot
#

what's he trying to do

steel heart
#

well he is basically trying to give me limited sftp access

prisma wave
#

Why not just make an account that only has access to a certain directory

steel heart
#

uhm I mean if that is possible

prisma wave
#

As far as I know it is

quiet depot
#

it's not fool proof vb

prisma wave
#

Ah

quiet depot
#

with ssh access, workarounds will always be possible

prisma wave
#

Huh

quiet depot
#

oh my bad it's sftp

prisma wave
#

Even with an account with virtually no permissions?

#

Oh

quiet depot
#

even with sftp though

#

same still applies

#

yeah vb

prisma wave
#

TIL

quiet depot
#

it's probs not what u think

#

it's potential vulnerabilities

prisma wave
#

Yeah

#

I guess for personal use it wouldn't be a huge risk

quiet depot
#

shitty software running on root that can be accessible from a non-root account for example

prisma wave
#

Oh yeah good point

heady birch
#

This power point contains MACROS would you like to allow third party MACROS?

obtuse gale
#

Does

    public static boolean pCB(String pathBoolean) {
        return plugin.getConfig().getBoolean(pathBoolean);
    }

and

plugin.getConfig().getBoolean("path.hi")

do the same thing ?

heady birch
#

yes

obtuse gale
#

🤔 then why my plugin is crashing (getting error)

heady birch
#

probably because pcb is static and when you call it plugin is null or something

hot hull
#

Would be easier if you showed the error fingerguns

obtuse gale
#

ok wait

obtuse gale
#

utils line 39

#

plugin is probably null

#

or the boolean doesnt exist in the config

#

ok let me check

obtuse gale
#

@obtuse gale which class are u talking about ?

remote goblet
#

@prisma wave why not just make pdm not limited to plugins EmiPopcorn

old wyvern
#

It isnt

remote goblet
#

from what i can see

#

it is

old wyvern
#

I remember him specifically telling me its possible to use with your own class loader

#

Let me find that

remote goblet
#

well the pdm itself implements the spigot api aswell so EmiShrug

old wyvern
#

Not everywhere

#

Just in specific places

#

If you dont load those classes it would work fine

hot hull
#

If you load it with a different approach it can be used outside of plugins

hot hull
#

It's just not convenient at all

heady birch
#

Gross

obtuse gale
#

whats class utils line 39

remote goblet
heady birch
#

Kotlin

remote goblet
#

well yes

heady birch
#

😍

#

Someone using my API 🙂

#

Jesus christ

obtuse gale
#

thats one thicc main class

heady birch
#

Lightweight dependency injection frameworks?

#

no

#

guice

#

spring

#

pico

#

cdi + weld

#

open web beans

analog crater
#

https://paste.helpch.at/dkfjfjfj.cs someone just sent me this to review. How do I tell him in a nice constructive and respectful way how bad it is? I want to rant but that won't make our relationship better

obtuse gale
#

oi fuckface, your codes shit

hot hull
#

<insert bruh sound>

#

Jolly, tell him that it's shit, but also tell him why it's shit

analog crater
#

Ok. I've told him its shit because of the redundant checks, arrow code, lack of switch, unused if else, bad naming. Anything else?

hot hull
#

Once he fixes all of the above, send it again

analog crater
#

He said he will recode it once he fixes his problem...

hot hull
#

nono it doesn't work like that

analog crater
#

He seems quite arrogant now and says that his code doesn't need to be recoded

#

He says it works so its fine

obtuse gale
#

then why did he ask you to review it...

analog crater
#

Idk tbh.

#

Maybe he's a lazy bastard or he was tryna show it off but backfired

heady birch
#

🙁

#

Lol

hot hull
#

Just don't respond to him anymore, ez

analog crater
#

Ok

prisma wave
#

@remote goblet yeah like yugi said. If there was actually demand I'd decouple PDMBuilder, but I really don't think anyone is gonna be using it outside of plugins rn

remote goblet
#

using it for discord bots would simply be chefskiss

prisma wave
#

good point

#

It's probably possible

#

Just a bit of a mess

remote goblet
#

i tried it and instantly got an error where it was just like

#

not happy

#

couldn't find anything EmiCool

prisma wave
#

Yeah PDMBuilder won't work

#

But that's probably the only thing that won't

remote goblet
#

but aye

#

it shortened my jar file from 27mb to less than 300kb

#

so thats cool atleast

prisma wave
#

Probably slim

#

Actually

#

It will probably work it's just not a very efficient way of storing them

#

Because you only include positive X and positive Z

regal gale
#

@prisma wave am I thinking wrong about yesterday or this doesn't make any sense:

#

Btw, did you know of js-expansion yet?

dusky drum
#

is there a way to listen to both piston events in 1 function? instead of having 2?

prisma wave
#

@regal gale what happened yesterday lol

regal gale
#

About JSON here:

"json": {
    "data": {
        "group1":"Hello"
    }
}```
When I called Data.get("data").json.data, it returns an empty string (supposedly Data.get() is actually getConfig().get())
prisma wave
#

Well yeah

regal gale
#

But using Data.get("data").json.data.group1, script throws error cause "property doesn't exist" or smth

prisma wave
#

Because the path would be "json.data.group1" ?

regal gale
#

The property that doesn't exist is "group1"

#

Supposely your assumption is already applied before

#

Btw the yml is like this:

data:
  json:
    data:
      group1: "Hello"
prisma wave
#

Hm

#

So what path are you using rn?

regal gale
#

But using Data.get("data").json.data.group1, script throws error cause "property doesn't exist" or smth
@regal gale

prisma wave
#

ohh it's in JS

#

Right

remote goblet
obtuse gale
#

VBScript thonking

prisma wave
#

Does something like get().json work @regal gale ?

#

@obtuse gale it's the best language

#

Objectively

regal gale
#

Returns empty string

remote goblet
#

anddd

#

still broken

#

i love life

prisma wave
#

That kind of makes sense

remote goblet
prisma wave
#

Ew

#

Ew*

#

Ew

obtuse gale
#

what happened to clojure

regal gale
#

I still don't get why path returns empty then error at the end

remote goblet
#

give me a fix pls idk what im doing SadCat

#

BM has now converted into using skript

obtuse gale
#

and how do you know so many laguages

prisma wave
#

Firstly

#

Never use requireNonNull in kotlin

#

@obtuse gale idk VBScript piggy just convinced me it was superior

regal gale
#

Erm.. my problem please 👀

prisma wave
#

@remote goblet

val value = getString() ?: defaultMessage
return value.colorify()
#

@regal gale I'm pretty sure what's happening is that Data.get is returning a LinkedHashMap, and as such JS can't do property access

#

Try printing out the result of get()

#

Pretty sure it will be a Map

regal gale
#

On phone rn so I can't test

remote goblet
#

no it dont

#

now we fix these goddamn files again

distant sun
#

Why that item for border

obtuse gale
#

i like it

remote goblet
#

thatsj ust a random item i chose

dusky drum
#

what da fk:

org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event org.bukkit.event.block.BlockEvent. Static getHandlerList method required!
remote goblet
#

lmao

dusky drum
#

apparently this line:

 pm.registerEvents(CropPistonListener(cropStorage, cropDrops), this)
#

i guess BlockPistonEvent isnt valid event :?

distant sun
#

:))

dusky drum
#

ugh...

#

so i have to have 2 functions.,...

distant sun
#

Do you listen to BlockEvent?

dusky drum
#

i listen for piston retract/extebd

distant sun
#

ye but to BlockEvent?

dusky drum
distant sun
#

that's the base for BlockPiston events

#

and it doesn't have HandlerList

dusky drum
#

yeh

#

i realized that

distant sun
#

BlockPistonExtendEvent / BlockPistonRetractEvent

empty flint
#

Does Kotlin have a way of forcing classes that extend another class to implement a static method?

prisma wave
#

not really, best option is making every companion object implement a certain interface

#

static inheritance is kind of a hack anyway

empty flint
#

not really, best option is making every companion object implement a certain interface
@prisma wave That works for me, ty

#

@prisma wave got another issue here:

I have my data class Attribute defined like so:

data class Attribute<T> (...) {...}

#

and a 'Unique' interface:

interface Unique<A, T> {
    fun from(id: T): A
}
#

So now, I'd like the Attribute companion object to extend that Unique interface

#
data class Attribute<T> (...) {
  companion object : Unique<Attribute<T>, String> {
    override fun from(id: String) {...}
  }
}
#

But the compiler doesn't see T as a generic type

#

and doesn't know what to do with it

#

class Attribute<T> works, but in the companion object Unique<Attribute<T> doesn't

prisma wave
#

yeah because the companion object can't be generic

#

it's a singleton

empty flint
#

Oh shit

#

right yeah that makes sense

#

Can I make it return an unspecified Attribute<?> ?

prisma wave
#

I believe so

#

although it's Attribute<*> in kotlin

obtuse gale
#

If I wanna use the same project on two pcs and imma do this through git, do i add the .idea stuff? Or just let IJ auto generate that on the second pc

#

Im willing to bet 5 bucks im gonna get issues with this lol, especially since its different OS's for each pc

errant geyser
#

Don't include .idea

obtuse gale
#

alright how bout .gradle?

errant geyser
#

Not needed I'd say

#

Just use the .gitignore that IJ builds

obtuse gale
#

er

#

what if it didnt make one

#

I manually made one so I think that overwrote it or smthn

errant geyser
#

make it yourself

#

yeah probs

obtuse gale
#

now what else do i put in it lol

#

atm ive got

errant geyser
obtuse gale
#

alright

remote goblet
errant geyser
prisma wave
#

Not in a whole lot of detail

#

but yeah

#

Will probably end up using that

#

although I'd prefer an in-house solution

obtuse gale
#

I changed my .gitignore to add something new and its not removed off the thing, do i need to manually remove it first? If so how

lunar cypress
#

git rm (--cached if you want to keep it on the file system)

dusky drum
#

talking about shading:

[15:23:01 WARN]: [VirtusCustoms] Loaded class eu.virtusdevelops.virtuscore.utils.TextUtil from SimpleCrops v1.0-SNAPSHOT which is not a depend, softdepend or loadbefore of this plugin.

so should i like do what since i use same core in all my plugins.

hot hull
#

softdepend on the core

dusky drum
#

no

#

core is not seperate plugin

#

its built into each pl

#

i just shade it in with fatjar

hot hull
#

I mean in all honesty you can ignore it, since that's just spigot being smooth brained

dusky drum
#

okay.

#

but then theres problem if one of my plugins runs older version of core, other plugins try to use that and get error something like function or something thats missing in older version.

hot hull
#

relocate it

dusky drum
#

yeh i need to guess how to do that

hot hull
#

u using gradle?

dusky drum
#

yes

#

uu and frosty since ya here do you know Janša banned 5G

hot hull
#
shadowJar {
  relocate "path", "new path"
}
errant geyser
#

Make sure you have the plugin imported ^
id 'com.github.johnrengelman.shadow' version '5.2.0'

dusky drum
#

oke

hot hull
#

Ne spremlam, sej gre vse skup u kurac pocas

dusky drum
#

XD

hot hull
#

6.0.0 katsu

errant geyser
#

¯_(ツ)_/¯

dusky drum
#

um github says 5.2 btw forsty

#

frosty*

hot hull
#

Just use 6.0.0 github outdated

dusky drum
#

oke

#

so how exactly is that gonna work?

#

i did:
relocate "eu.virtusdevelops.virtuscore", "eu.virtusdevelops.virtuscorecrops"

empty flint
#

Can you specify a companion object in an interface?

ocean quartz
#

I don't believe so

#

I guess it "can"

In Kotlin, an interface can have a companion object but it is not part of the contract that must be implemented by classes that implement the interface. It is just an object associated to the interface that has one singleton instance. So it is a place you can store things, but doesn't mean anything to the implementation class.

empty flint
#

yeah that makes sense

#

and is actually exactly what I want xD

hot hull
#

What would one call a package with listeners inside it which manage entity mechanics, I already have a base mechanics package for it, and I don't wanna name it the same, any suggestions?

prisma wave
#

listeners?

#

handler?

ocean quartz
#

"listeners" yeah

hot hull
prisma wave
#

mechanic.handler or mechanic.listener probably ?

hot hull
#

Not what I'm asking

prisma wave
#

oh

#

isn't it?

dusky drum
#

what ya asking then? (napisi po slovensko ce neves kak bi eng explaino)

hot hull
#

I'm gonna have a subpackage for the entity one, because I want to seperate them, but I don't want to name them mechanic because it'd look odd, so I need an alternative word for it

dusky drum
#

oh so you dont want like mechanics.mechanics?

ocean quartz
#

So something like mechanic.listener.entity?

hot hull
empty flint
#

^ mechanic.entity.listener

#

oh nvm the listeners aren't in the package, are they?

hot hull
#

but that's vague af, the entire mechanic category is listeners (with the expection of the event package)

obtuse gale
#

mechanic.entity.listeners.bukkitevents.listeners.help.mechanic.core

dusky drum
#

howly

hot hull
#

bruh, inb4 NIall pops up

empty flint
#

but that's vague af, the entire mechanic category is listeners (with the expection of the event package)
@hot hull mechanic.entity.mob

obtuse gale
#

frcsty ur intellij theme bad

hot hull
#

Leave

dusky drum
#

why do you say its bad, each person has its own taste???

obtuse gale
#

No. There can ONLY BE ONE

#

fuck having opinions

dusky drum
#

....

hot hull
prisma wave
#

horrible

dusky drum
#

wth is that resolution?

obtuse gale
#

to be fair the themes not that bad on its own, that combo you got going there is a bit weird tho

#

with the grey

hot hull
dusky drum
#

wtf

hot hull
#

3:4

dusky drum
#

square!

hot hull
#

No

#

Go back to school

dusky drum
#

semi square

hot hull
#

Rectangle

errant geyser
#

u wot Gasper

dusky drum
#

for me its square

hot hull
#

Your 4head is a square

dusky drum
#

noice

ocean quartz
#

I like how you say you like oceanic theme and yet the actual code portion isn't oceanic xD

hot hull
#

Base of it is

#

I just modified some colors to make them pop

ocean quartz
#

I see you copied my string color ;p

hot hull
#

It's butiful

ocean quartz
#

Need to figure what to do with the oranges in my color scheme i don't like them

hot hull
#

blue fingerguns

dusky drum
#

pink

hot hull
#

or purple/pink

ocean quartz
dusky drum
#

hmmm

#

white

#

no

hot hull
#

It's a shame all classes have to be the same color

#

Would be nice if you could customize it further

dusky drum
#

cant be ping due to all purple

ocean quartz
#

Pink is for static

dusky drum
#

try tomato color

hot hull
#

use the background color fingerguns

dusky drum
#

#FF6347

#

(255,99,71)

ocean quartz
#

let's see

dusky drum
#

but thats gonna kinda mess up with red

#

maybe this:
#ccff00

ocean quartz
#

Oh god, that's worse

dusky drum
#

try this:
#ccff00

ocean quartz
dusky drum
#

ye

#

try this: #ccff00

hot hull
#

#00f6ff

#

do it

ocean quartz
#

Yuck yellow xD

dusky drum
#

its not yellow but ok.,

ocean quartz
#

It's like a lime

hot hull
#

No seriously, the one I pasted above is GWcmeisterPeepoLove

dusky drum
#

try the one frosty sent

ocean quartz
#

Just a sec

empty flint
#

Lot of orange
@ocean quartz I need that color scheme plis

hot hull
dusky drum
#

wdfw

#

XD

prisma wave
#

different for constructor calls?

#

for some reason

lunar cypress
#

rainbow brackets?

hot hull
#

Damn imagine if you could make everything rainbow

lunar cypress
#

you can

prisma wave
#

rainbow brackets is a godsend

lunar cypress
#

technically

hot hull
#

Elaborate Johnny

prisma wave
#

Rainbow Brackets is a plugin

#

it makes brackets rainbow