#dev-general

1 messages · Page 152 of 1

hot hull
#

Very informative error fingerguns

[13:51:06 WARN]: Exception in thread "Thread-10" com.mrpowergamerbr.temmiewebhook.exceptions.WebhookException: {"embeds": ["0"]}
[13:51:06 WARN]: at com.mrpowergamerbr.temmiewebhook.TemmieWebhook$1.run(TemmieWebhook.java:49)
[13:51:06 WARN]: at java.base/java.lang.Thread.run(Thread.java:832)

prisma wave
#

very detailed

dusky drum
#

i have mutablemap of blocks placed, and if someone breaks one block it gets removed, but i also have scheduler that syncs data to database very 3600secs

#

and in that time when it starts syncing if someone breaks block

#

i get error

#

so i want to clone it.

#

so it doesnt get edited when its syncing

prisma wave
#

MutableMap.toMap

dusky drum
#

ow

#

danke

#

i must say recoding plugin is quite fun.,

hot hull
#

That can't be good

BUILD SUCCESSFUL in 666ms

#

@prisma wave You're familiar with regex right? fingerguns

prisma wave
#

reasonably

hot hull
#

So I need to get the image link from this
Some info, image: https://imgur.com/unknown.png

dusky drum
#

make url parser?

#

or split string

#

like

#

string#split("image: ")

#

and use the other half

hot hull
#

Nah it's a random string

dusky drum
#

make url parser

#
// Pattern for recognizing a URL, based off RFC 3986
private static final Pattern urlPattern = Pattern.compile(
        "(?:^|[\\W])((ht|f)tp(s?):\\/\\/|www\\.)"
                + "(([\\w\\-]+\\.){1,}?([\\w\\-.~]+\\/?)*"
                + "[\\p{Alnum}.,%_=?&#\\-+()\\[\\]\\*$~@!:/{};']*)",
        Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL);
#
Matcher matcher = urlPattern.matcher("foo bar http://example.com baz");
while (matcher.find()) {
    int matchStart = matcher.start(1);
    int matchEnd = matcher.end();
    // now you have the offsets of a URL match
}
empty flint
#

Does anybody know of an open-source Minecraft plugin repo on github written in Kotlin that I could take a gander at?

dusky drum
empty flint
#

Merci

dusky drum
#

thats 5 years old, just so you know

prisma wave
#

shameless plug lol

dusky drum
#

who uses
fun da()
{
}
and not
fun da(){ }?

prisma wave
#

clever people who realise that Allman is objectively better fingerguns

dusky drum
#

no

prisma wave
#

it literally is though

#

it makes it clearer when blocks start and end

dusky drum
#

no

#

wut

#

for me no

hot hull
#

allman is objectively better

#

Shut up

dusky drum
#

for you

#

not for me

prisma wave
#

that's the point of objectively

#

it's better by fact, not opinion fingerguns

dusky drum
#

its less readable for me.

prisma wave
#

you get used to it

#

¯\_(ツ)_/¯

dusky drum
#

i cant get used to it.

#

even intellij is defaulted not to use it. hehehhe

hot hull
#

I mean yea because IJ is defaulted as k&r

prisma wave
#

i cant get used to it.
Literally the only difference is a line break before a {

dusky drum
#

its wierd

prisma wave
#

It's not unreadable

hot hull
#

It's not for the faint hearted fingerguns

prisma wave
#

You have to choose to use it so that only the clever people use it

dusky drum
#

not realy

prisma wave
#

Yeah I am kidding

#

But personally I think allman spaces out your code better

dusky drum
#

ah i dont like it but, if you do i dont realy mind each person has its own opinion on stuff :3

prisma wave
#

Indeed

#

Tbh I hated it at first too

dusky drum
#

is there better way of doing this filemanager variable?
?

#

if (true)
{

    }
#

frik

prisma wave
#

But after trying it I started liking it

dusky drum
#

it didnt save my pic

prisma wave
#

if true?

#

lol

dusky drum
#
class CropDrops(plugin : SimpleCrops, fileManager: FileManager) {
    val fileManager = fileManager

}
quiet depot
#

;-;

dusky drum
#

it says something that i dont need that val blabla

quiet depot
#

then remove it

dusky drum
#

no

#

i meanž

#

...

old wyvern
#

Personal opinion: Allman weird for Java

hot hull
#

This is the best bracket style:

if (something)                    {
  banBrister()                    ;
  if (isSomething()               {
    remove()                      ;
                                  }
                                  }
prisma wave
#

wow

dusky drum
#

it says it can be declared in consturctor or something.

prisma wave
#

Why ban me

#

because it can @dusky drum

old wyvern
#

😂

dusky drum
#

ye idk how

quiet depot
#

press alt + enter

#

and let ij fix it for you

dusky drum
#

it doesnt

#

omg

#

im stupid

prisma wave
#

}
dusky drum
#

im so stpid

prisma wave
#

automatic constructor parameter with backing properties fingerguns

old wyvern
#

Simple soln to all problems, Elara

dusky drum
#

is sql code slower in kotlin?

quiet depot
#

no

dusky drum
#

it takes some time for 128 data entires to be processed for some reason

old wyvern
#

Why would sql be slow for kotlin

dusky drum
#

idk

#

just asked

empty flint
dusky drum
#

idk why i cant find better solution to sync data from plugin to sql than deleting everything from table and then inserting everything.

prisma wave
#

Noo

dusky drum
#

thats like those lua mans

#

that do

coor =           this
coor2 =          this2
hot hull
#

This is the best bracket style:

if (something)                    {
  banBrister()                    ;
  if (isSomething()               {
    remove()                      ;
                                  }
                                  }

@empty flint smh

quiet depot
#

that's not a practice exclusive to lua gasper

dusky drum
#

well i saw it in lua

#

so idk

#

i never saw it in java or kotlin

empty flint
#

idk why i cant find better solution to sync data from plugin to sql than deleting everything from table and then inserting everything.
@dusky drum Wut?
Have you heard of the UPDATE statement?

dusky drum
#

update?

#

as i know sqlite doesnt have it

#

i dont mean that

empty flint
#

@empty flint smh
@hot hull cursed_coding_style.jpg

dusky drum
#

my bad i mean what if i remove something from data?

#

hows that gonna be updated?

empty flint
#

um... DELETE statement?

dusky drum
#

how can i know if something was deleted if all i have is map of data

empty flint
#

how can i know if something was deleted if all i have is map of data
@dusky drum I don't think I understand what you mean after all

ocean quartz
empty flint
#

Can you give an example?

dusky drum
hot hull
#

Already figured it out Matt p

#

:p*

ocean quartz
#

Oh okok ;p

empty flint
dusky drum
#

i drop stuff in table

#

then insert everything

#

since i edit that map on bloc break/place

empty flint
#

That's barbaric... only delete the data you need to delete, update the data you need to update and insert new data. Don't delete the table contents and re-write it all again

dusky drum
#

how can i know what to delete

#

i've tried that

#

but then some random guy places and breaks stuff in same space 2000 times

#

and there you go

empty flint
#

By tracking the changes

dusky drum
#

tracking changes

#

20000 chagnes on 1 block

#

isnt that great?

empty flint
#

Re-writing the table for all blocks because of 20000 breaks on the same block is exactly what you should avoid

dusky drum
#

thats why i just clear data and paste in new one

#

every 5 mins

empty flint
#

But... why???? Why not just update the entry for the one block?

dusky drum
#

since

empty flint
#

It makes no sense

dusky drum
#

its easier to access data that way

#

since its all in Map

empty flint
#

so if you have 10000 crops in your table and somebody breaks one, you delete it all and re-write 10000 entries.

dusky drum
#

i do that every 5 mins even if noone breaks anything

empty flint
#

since its all in Map
@dusky drum what's the key of the map

dusky drum
#

String

#

x:y:z:world

empty flint
#

jesus

dusky drum
#

???

empty flint
#

just get the value for the one entry and update the row, it's literally the same effort on your part but it's so much less strain on the server/db

dusky drum
#

?

empty flint
#

Create a new map, if a block breaks where your map would change, enter the new data in the new map

dusky drum
#

data must be instatnt sql isnt instant

empty flint
#

What's the primary key of your table?

dusky drum
#

noone

empty flint
#

the location?

dusky drum
#

basicly ye

#

so string

#

since i dont want to insert entire class into there

empty flint
#

noone
@dusky drum that's not possible

dusky drum
#

i havent specified primary key

empty flint
#

Then specify a primary key and use that to update the rows that change, do not delete all the data and re-write it, that's terrible practise

dusky drum
#

i have no idea how i would keep track on which block was removed and then placed again in same spot 200 times

#

thats 200 entries-.

empty flint
#

idk why i cant find better solution to sync data from plugin to sql than deleting everything from table and then inserting everything.
@dusky drum This is why you can't find a better solution.

dusky drum
#

so youre telling me its prfect solution?

empty flint
#

i have no idea how i would keep track on which block was removed and then placed again in same spot 200 times
@dusky drum Why would you keep track of all 200? Just keep track of the last change on the block. Except if you need the history of course

#

But it doesn't look like you do

#

Since you have no date field

dusky drum
#

of curse i dont have date

#

wtf

empty flint
#

so if somebody breaks a block 200 times, you change the value of your block in the map 200 times and update only one row 200 times

#

instead of writing the whole table 200 times

#

because I assume your map contains more than the one block, right?

dusky drum
#

thats not efficient calling sql for eachtime someone breaks/places block

empty flint
#

thats not efficient calling sql for eachtime someone breaks/places block
@dusky drum No, you can still keep calling it every 5 minutes if you only need the 5 min window of data inconsistency. But when you do call the sql code, call it the right way, not the brute-force way

#

But with updating the table instead of re-writing it, you can call this every 5 seconds instead of every 5 minutes without overspending server resources

dusky drum
empty flint
#

definitely better than rewriting tables

dusky drum
#

now

#

my data is gone

#

XD

#

nvm

#

im friking stupid

#

forgot to remove delete stuff

ocean quartz
#

Ugh, I can't figure this out >.<
So anyone wanna help me ease my brain pain?
Problem:
In a sequence like this:

text *text **text** text*
     ^     ^^    ^^     ^
     O     ??    ??     C

The first one is easy to set, it'll be an opening asterisk O, the last one is also easy since it'll be a closing one C
However I have no idea how i'll check for the middle ones and detect if they are opening or closing
Plus more things come to mind like for example: *text **text** *text** <- this is invalid -> text text text

hot hull
#

Oh god that looks oof

ocean quartz
#

I've been in this for days, my brain hurts

empty flint
#

are you looking for them using regex?

ocean quartz
#

No, it's token based, the tokens in that case will look like TEXT, ASTERISK, TEXT, ASTERISK, ASTERISK, TEXT, ASTERISK, ASTERISK, TEXT, ASTERISK

hot hull
#

I'm assuming you could keep track of opening tokens, but I'm guessing that wouldn't be exactly fast

empty flint
#

Ah gotcha. What lexer/parser language are you using?

#

I had the Same issue with ANTLR4 and the solution was contexts

ocean quartz
#

I mean the plan is to keep track of opening tokens, but how do you even decide which one is opening and which is closing? xD
And it's my own lexer/parser

empty flint
#

Keep track of what tokens were opened. If it was opened already its a closing one, otherwise its an opening one.

hot hull
#

Matt, I'd guess by having a scope which stores the first token it comes accross, ie.

Store X, Y, and when you get to another token, check if that token is already set, if it's not it's not the closing sequence, if it is, then it is

X Y
*Text **Some** More Text*

empty flint
#

This is assuming you can't do something like

open one ast. open and close second ast close one ast.

hot hull
#

You can escape them, but you could check for that as well

empty flint
#

An escaped char is a totally different thing though...

hot hull
#

I mean yea..

ocean quartz
#

Escaping is done when tokenizing it

empty flint
#

Can you keep track of them?

ocean quartz
#

I can, but i'll have to mark them as ambiguous or something, idk, can't think of any good way

#

Like the only way I can think of would require many iterations, which.. isn't great, for example:

text *text **text** text*
     O     CC    CC     C
     O     OO    CC     C

Where everything after the first one will be marked as close, and then on the second iteration it marks the opening ones accordingly
But i don't like that solution at all

dusky drum
#

anyone has idea how i would get base block of sugarcane like if someone breaks top block of sugarcane i would get the base one like the bottomest one.

empty flint
#

Like the only way I can think of would require many iterations, which.. isn't great, for example:

text *text **text** text*
     O     CC    CC     C
     O     OO    CC     C

Where everything after the first one will be marked as close, and then on the second iteration it marks the opening ones accordingly
But i don't like that solution at all
@ocean quartz Can't you match occurrences of *<any text>* and then you know the opening and closing is at the first and last index?

#

then just parse the <any text> thing through again?

#

Hm could I actually start a webserver from within the plugin that lets users access it via the web, similar to how luckperms works?

ocean quartz
#

Yeah that's what I had in mind too i'll try some things

dusky drum
#

luckperms uses github for webinterface if im not wrong.

empty flint
#

luckperms uses github for webinterface if im not wrong.
@dusky drum I think you are...

#

I see some webserver implementation stuffs.

dusky drum
#

i mean

#

it opens github

#

they just send data to github

empty flint
#

As far as I saw when I mulled over the code, it wrote data to a pastebin-type site.

#

Bytebin I think it was called

#

Not github

#

Also, I want to have users be able to host the webserver luckperms contacts on their own server...

dusky drum
empty flint
#

That's entirely possible

#

They don't seem to be doing that now though

errant geyser
#

They write data to Luck's Bytebin and that gets loaded in their web editor

#

Then to save they write the modified data back to Luck's Bytebin and that gets put into the link you get

empty flint
#

Inb4 this channel has more Kotlin associated activity than the official Kotlin Discord 😄

prisma wave
#

that would be quite an achievement

#

wait

#

kotlin discord?!?!!?!?

analog crater
#

Kotlin don't have an official discord

dusky drum
#

i wish they had discord

onyx loom
#

omg

#

we wouldve sinned for not being in an official kotlin discord 😅

dusky drum
#

XD

empty flint
#

I mean idk if it's an official server but it's the only one I found and it fits all the criteria

dusky drum
#

ok

empty flint
#

discord gg / RsQv9f idk if the bot deleted the invite url or not.

dusky drum
#

recoding plugin into kotlin is quite fun

analog crater
#

... who pinged me again

prisma wave
#

helpchat should become the official kotlin discord

static zealot
#

xD

dusky drum
#

hm

onyx loom
empty flint
#

Jolly you might have gotten pinged by the bot. I posted an invite url to the kotlin discord and didn't consider it might be forbidden. Apologies!

#

Is polling a database from the plugin feasable?

#

Meaning does it use up too many resources?

dusky drum
#

is that normal:
if current level = 14
(2.0.pow((currentLevel - 2))) * 100
it returns something like 100k
if i put like this in calc
12*12 *100 i get like 14k?

prisma wave
#

what?

empty flint
#

where did you get 12*12 from?

#

that would be 12.pow(2)

#

not 2.pow(12)

prisma wave
#

@empty flint interacting with a database in a plugin is fine

empty flint
#

@empty flint interacting with a database in a plugin is fine
@prisma wave Yeah but how often per second is it ok? 😛

dusky drum
#

isnt 2.pow(12) = 12^2?

prisma wave
#

no

#

It's 2^12

empty flint
#

Noooooo

#

it's 2^12

dusky drum
#

wtf

empty flint
#

that's 2 raised to the power of 12

dusky drum
#

so

#

222-... 12 times?

prisma wave
#

Yes

#

That's what ^ means lol

empty flint
#

2*2*2*2*2*2*2*2*2*2*2*2

dusky drum
#

omgh

prisma wave
#

@empty flint it's async, so it will probably be fine unless you're doing thousands

dusky drum
#

i did it wrong

empty flint
#

@empty flint it's async, so it will probably be fine unless you're doing thousands
@prisma wave so like 100 times per second is fine?

dusky drum
#

then

#

math.pow(12, 2) is 12^2?

prisma wave
#

Yes

#

@empty flint what could you possibly be doing that needs 100 sql queries a second?

empty flint
#

@empty flint what could you possibly be doing that needs 100 sql queries a second?
@prisma wave maybe I am going at this all wrong

#

So I am thinking of people installing the plugin on multiple servers on the same network, right

#

like bungee network or some shit

#

All the plugins use the same database

#

So if I change one thing on one server that affects an entry in the database (INSERT, UPDATE, DELETE and the sorts), then I'd have to somehow relay that info to the other plugins running on the network, right?

#

Unfortunately not all SQL implementations support alerting the clients to changes

#

MySQL doesn't

#

SO I have to poll the database

#

I figure 100 times a second should be enough

#

or maybe 10 times a second?

#

1 second for changes to take affect is too long in 2020 god damnit

prisma wave
#

that is probably a very bad idea

empty flint
#

I agree

#

That's why I am asking 😄

prisma wave
#

if you need fast reading and writing, consider an in-memory database like redis

#

or use plugin messages / web requests

empty flint
#

Is Redis persistent?

#

Never used it before

prisma wave
#

well no

#

it's in memory

empty flint
#

Yeah so that's not an option then

prisma wave
#

typically you'd have a redis installation with a persistent server as a backing cache

#

so redis + sql

#

or redis + flatfile

empty flint
#

Ugh

#

I mean sure, that's a possibility

#

But then the problem is still how to keep data consistent between the different Redis instances of the different servers/plugins on the same bungee network?

prisma wave
#

redis is fine to query loads of times

#

it's in memory, so your only real bottleneck is latency

#

and if you're on the same network, that's virtually nonexistent

#

you could also take a reactive approach with plugin messages / web requests / some message server

empty flint
#

Hold up I'm not sure I understood Redis correctly then.

#

Is Redis like a server in memory that another server can access as well?

prisma wave
#

yes

#

well pretty much

empty flint
#

Say you have server A running the plugin and server B running the plugin. Where does Redis sit?

#

On server C?

#

On server A but server B gets access somehow?

static zealot
#

anyone here made a discord bot using kotlin and would be able to share the SC?

prisma wave
#

they can be on the same server @empty flint

#

physical server that is, not minecraft server

empty flint
#

they can be on the same server @empty flint
@prisma wave I don't get it.

prisma wave
#

it's basically sql but in memory (except not literally because it's NoSQL)

#

you still query it in the same way

empty flint
#

physical server that is, not minecraft server
@prisma wave Oh, right, yeah so the server owner has to provide a redis instance?

prisma wave
#

yes

empty flint
#

aaah

#

now I gotchu

#

alright

#

say they don't

#

😛

#

What then?

prisma wave
#

then you'd need to use some other method

#

but any bungee network should have access to one

#

a lot of plugins use redis

empty flint
#

Oh really? Like which?

prisma wave
#

RedisBungee is an obvious one, i couldn't name any others specifically but a lot of bungee plugins will provide it as an option

empty flint
#

RedisBungee is not being maintained anymore though

#

And it's 20$ so no chance of getting at the sourcecode

prisma wave
#

true

#

wait

#

it's open source

#

lol

dusky drum
#

whats redis bungee, bungee that connects bungee?

empty flint
#

it's open source
@prisma wave oh lol ur right. I just looked at the price and noped out.

prisma wave
#

for synchronizing data over bungee with redis

#

yeah

empty flint
#

But the code is horrendous

prisma wave
#

¯_(ツ)_/¯

#

my point still stands

empty flint
#

I mean mine isn't better

#

but I can read mine

prisma wave
#

redis is fairly widely used

empty flint
#

Right

#

So

#

Force server owners to provide redis or suffer the consequences

dusky drum
#

why would you stop updating redisbungee :?

prisma wave
#

i mean

empty flint
#

Got it

prisma wave
#

that works i guess

empty flint
#

The consequences meaning risking data inconsistencies for half a second

#

xD

#

Dude this is gonna be so complex now...

dusky drum
#

almost did recoded main functionality of plugin into kotlin

empty flint
#

@prisma wave So here's my new plan:

Redis, MySQL, MariaDB, PostgreSQL, MongoDB, H2 can be selected as storage. H2 would be the persistent backup for Redis (if nothing else specified because it's just flatfile). The Redis storage handler implementation would periodically save the data to the persistent database. All other databases would get polled 5 times a second. Is that feasable?

prisma wave
#

5 times a second is quite a lot

earnest narwhal
#

Hey guys would you reccemend using SQLite?

empty flint
#

Hey guys would you reccemend using SQLite?
@earnest narwhal I would rather eat a bowl of nails before touching SQLite again.

#

Without milk.

earnest narwhal
#

because it’s not even working properly

#

I used it in nodeJS

empty flint
#

Hey guys would you reccemend using SQLite?
@earnest narwhal It's fine for simple tasks, very limited in its capability though

earnest narwhal
#

And it doesn’t establish the connection

#

I’ll try using MySQL any good tutorials I can look at?

#

Or what db do you reccemend?

empty flint
#

MySQL is fine. MariaDB is my personal Fav. Oracle is the godking in my experience but it's more for professional use...

#

At work I use oracle, privately I use MySQL or MariaDB

#

5 times a second is quite a lot
@prisma wave Hm I mean I guess mc plugins aren't critical...

ocean quartz
prisma wave
#

huge

empty flint
#

congrats dude!

#

Looks great!

onyx loom
#

👏

ocean quartz
#

Using commonmark, unfortunately not my parser xD
But hey it works pretty well and most likely better than what I would make so pretty nice

dusky drum
#

as long as it works!

#

talking about sql,mysql
just use hikaricp.

heady birch
#

Hibernate 🙂

pastel imp
#

I am trying to figure out how tf you are doing that

#

but probs too much for my brain

#

but here's more challanges:

#

this

#

this

lavish notch
#

Theoretically It's pretty simple and straight forward...

ocean quartz
#

i've been at it for over a week

errant geyser
#

matt help me, your command framework is giving me telepathic aids

#

That's my own fault for trying to convert it but eh

ocean quartz
#

What's up? xD

errant geyser
#

So you know I want to convert it to like, using actual objects and stuff? Yeah that's not as easy as I expected. I made another abstract class for it and it sorta works as intended, I just dont know what to do with my actual command class and what it needs to hold, since I'll be using a CommandBuilder and then returning a Command at the end

#

Idrk

#

I have to modify a decent bit of your CommandManager class buuuuuut

ocean quartz
#

Just wait a few more days and i'll change a bunch of stuff on it that'll make this a lot easier for you

errant geyser
#

Oooo ok

#

Please spam ping me when you finish it lol

ocean quartz
#

Will do ;p

ocean quartz
prisma wave
#

Interesting

#

So is it (text)[HOVER TEXT] for hover action?

ocean quartz
#

Was thinking of [text](hover: Hover Text) and [text](click: Click action) and things like that

prisma wave
#

Ah yeah that's good I think

ocean quartz
#

Need to figure how it'll work though, since i think commonmark won't allow multiple words in the link area, i guess i can just run it through regex

ocean quartz
prisma wave
#

gross

errant geyser
#

Oh nyoo

prisma wave
#

When is BungeeKord coming

errant geyser
#

Wym

prisma wave
#

Bungee

#

But in kotlin

errant geyser
#

Someone pls

#

I needs dis

#

How large is bungee anyway

prisma wave
#

Pretty small afaik

errant geyser
#

Ok but if someone actually did it

#

What purpose would that have

prisma wave
#

idk

#

Not using Lombok

#

which is a worthy cause tbf

errant geyser
#

Since we cant exactly PR it since MD_4head would be like, bitch, idk that SUPERIOR language

prisma wave
#

pretty sure MD said kotlin sucks once or something

#

Evil man

errant geyser
#

Is he looking to start a crusade

prisma wave
#

If he wants one he'll get one

errant geyser
#

Noice

#

So u know this lexer I gotta make

#

I've never done anything like this before pls dont hurt me where the hell do I start

prisma wave
#

¯\_(ツ)_/¯

#

I'll make a list of token types in the morning

#

Then probably just regex it

errant geyser
#

It's worse than you could possibly imagine

ocean quartz
#

Pretty sure he doesn't like Kotlin yeah

prisma wave
#

He will be lunsihed

#

punished*

errant geyser
#

I dont comprende the comprende you comprende to comprende the regex comprende, comprende?

ocean quartz
#

A lot of people in the Paper/Spigot discords don't like it

prisma wave
#

@errant geyser lexer splits text into tokens. Check if bit of text matches regex, if so add matching token to list

#

simple

#

I propose a crusade upon the Paper discord

errant geyser
prisma wave
#

They will learn the power of Kotlin in one way or another

regal gale
#

In my opinion, a lot of people ik uses BungeeCord back in the day they're all a cracked community 👀

errant geyser
#

I more meant I have no idea about like, using regex. The most I've ever done is detect a lower case character, which I think is [a-z] right

prisma wave
#

oh

#

yeah

#

lol

#

this could be difficult

#

I mean you don't have to use regex that's probably just the easiest way

regal gale
#

My most achievement in regex i could do is detect comment codes in the entire script text...

prisma wave
#

Regex isn't that hard

errant geyser
#

Well theres sites that let you build/test regex right? I could probably figure it out with that and the Overflow on Stacc

prisma wave
#

regex101 is a godsend

errant geyser
#

Quickly screenshotting for tomorrow

distant sun
prisma wave
#

Looks like Kotlin to me

errant geyser
#

Imagine hard coding that and not using TensorFlow to predict which agency you wanna hack

prisma wave
#

Good, good

remote goblet
split talon
#

It’s too eye searing

quiet depot
#

Bungee api uses fucking lombok..
@ocean quartz use kyori adventure

#

A lot of people in the Paper/Spigot discords don't like it
They're also against gradle, and sometimes even intellij

#

oh, also discord lol

#

md said for the longest time he wasn't going to make a discord, hardcore irc user

obtuse gale
#

Competable future vs callback?

quiet depot
#

callback is a concept, completable future is an implementation

#

they're the exact same thing

obtuse gale
#

Is one "better"?

quiet depot
#

...

#

callback is a concept, completable future is an implementation

obtuse gale
#

well yeah but what should i use lol

ocean quartz
#

Why?

obtuse gale
#

or does it not matter

#

just wondering

quiet depot
#

aj callback is a concept

#

like a practice

#

a pattern

#

completablefuture is an implementation

#

code, that adheres to that pattern

obtuse gale
#

what?

quiet depot
#

Why?
@ocean quartz why what?

obtuse gale
#

From what I can tell they do essentially the same thing

ocean quartz
#

use kyori adventure

quiet depot
#

Oh, it's way better than bungee's text api

#

also platform independent

#

From what I can tell they do essentially the same thing
I'm not sure how to explain this in any other way

#

callback is a concept

obtuse gale
#

right

#

so if i want something to happen after something

quiet depot
#

you use a callback

obtuse gale
#

and when would i use a completable future

quiet depot
#

and java's implementation of the callback, is completable future

obtuse gale
#

o

quiet depot
#

as I said before

#

completable future is an implementation of the "callback"

#

I don't want to use a lib with another lib, it's one of the things i didn't like about minimessage
yeah that's understandable, but otherwise you gotta deal with lombok

ocean quartz
#

Yeah, well i don't mind it that much now, but i could change to adventure if it's too annoying to use

quiet depot
#

does mf have classpath scanning?

#

the command framework

#

not the gui one

ocean quartz
#

it doesn't

quiet depot
#

might pr a little something

ocean quartz
#

Nice!
I'll kinda rewrite it a bit later to have modules, it's a bit sucky right now

quiet depot
#

oh

#

it's using maven

ocean quartz
#

Yeah, maven central shenanigans

quiet depot
#

can you not upload to central from gradle?

ocean quartz
#

Only stages, doesn't release, i need to go there and manually do it

quiet depot
#

ah

#

well, I have a few ideas to pr

#

first of all, classpath scanning

#

or at least my version of it

#

no dependencies required, it's just a single class

#

at it's barest form*

#

also want to pr guice support, in a separate module

#

like in maven, you can add mf as dep, or mf-guice

#

however, I've got no clue how to modularise a project with maven

#

so would greatly appreciate your help with that

ocean quartz
#

Apologies, in the middle of a warzone match xD
Sounds nice!
I think i know how to do modules with maven, though i'll need to try a few things
I wanna make it more abstract, for jda and stuff

quiet depot
#

aight

#

i'll wait till you've got that done then

#

so I can see how you modularised it

ocean quartz
#

Oh okok, I'll get to it as soon as i finish this markdown stuff, which should take long

quiet depot
#

no rush

#

i'm already preoccupied with papi 3

#

nearly at 15k lines

distant sun
#

"Papi3 coming this century on your server"

quiet depot
#

it's coming along nicely

ocean quartz
#

Soon™️

distant sun
#

Matt, dont.

ocean quartz
#

What? xD

distant sun
#

Dont post that 'soon' image

#

It scares me

#

😂

ocean quartz
#

Don't even know which image you're talking about xD

distant sun
#

Was it lemmo?

#

The one with a bird

ocean quartz
#

Oh!
I think that was me yeah

#

It was an ostrich

#

Or emu, idk

distant sun
#

Smh

raw rapids
#

?help

compact perchBOT
#
FAQ Answer:
» Give the helpers some details
» Ask suitable questions
» Be polite
» Wait

Source

keen creek
pallid gale
keen creek
#

oops sorry

oak kindle
#

Hey

#

I need some general help

#

Someone reviewed my plugin today and he says he is from China and that that "many Chinese server owners want a translated language file" but idrk if its just someone who wants to steal the code of my plugin

#

either way the code is already in my github

#

is this some kind of scam or something?

#

because he says he is from china but he follows 2 spanish devs i've seen on youtube, who make videos in spanish

regal gale
#

How can you "scam" when it's already free

oak kindle
#

ik but its weird

#

like

old wyvern
#

Just allow a message config

oak kindle
#

my plugin is not known

old wyvern
#

No need to provide source

oak kindle
#

and randomly a user comes and says "Your plugin is amazing!" and other things

#

looks kinda

#

idk

regal gale
#

That's normal?

oak kindle
#

not for me

#

its my first resource

regal gale
#

Technically, just don't bother about it

oak kindle
regal gale
#

Welp

oak kindle
#

._.

regal gale
#

Now that's weird thonking

oak kindle
#

and

#

what is MCBBS???

hot hull
#

Chinese MC forum site or some shit

oak kindle
#

im not the only one in that list of msgs

#

there's even more lol

hot hull
#

I've been messaged a while back as well

oak kindle
#

he like searches plugins with not too many downloads

regal gale
#

I usually don't trust any of Chinese products, actually, especially to that site

hot hull
#

They apparently just link your plugin download (so it's still through spigotmc), and just translate the page to chinese

oak kindle
#

check the new image

hot hull
#

If your plugin is OS, there's really no concern lol

dusky drum
#

i mean i got randoms asking me if they can put my plugin there to.

obtuse gale
#

Service] Just Code
[Request]
I need a code of /kill (player) because I don't know to use bukkit.getPlayer correctly
Bukkit.getPlayerExact(name).setHealth(0)

#

@obtuse gale

#

Same lol I got a couple Chinese people ask me if they could link the spigot resource with the description translated to Chinese to some website

#

mcbb something

oak kindle
#

^

#

Aj3 use setHealth(0)

#

ah nvm

#

u changed it

hot hull
oak kindle
#

whats that

obtuse gale
#

As long as it complies with the license I'm all good lol

#

wait I have to use name not args[0] ?

#

well...

#

is args[0] the name?

#

name of the player ?

#

args[0] is help in this case
/test help ahhh oof

#

ye that

#

so yeah use args[0]

#

but check if its null first

#

ok

#

thx

#

btw in this case I have to use strings[0] Right ?

(CommandSender sender, Command command, String s, String[] strings)
#

yeah

#

but if you want you can rename that param

#

ye ik

#

and thx again

#

also

#

Bukkit.getPlayer might return null if the player doesnt exist

#

I forgot

#

So be careful abouit that

hot hull
#

Just use Matt's framework, ez fingerguns

obtuse gale
hot hull
#

Any progress Aj?

obtuse gale
#

ehhh

#

not really lol

#

idk where it is ?

regal gale
#

Explained how i got the native country name from the last #showcase

#

Good job Testy 👀

#

Yeah.. no idea how to do this in kotlin

#

Oh well, I figured myself

dusky drum
#

its so fun when you have to check if cactus gets broken on grow or no ...

hot hull
#

What's not fun is me having to remake this mob stacking :((

prisma wave
#

Serious question here, if I was to make a plugin tutorial that doesn't suck, can you think of any problems with starting with kotlin instead of Java?

quiet depot
#

Yes

#

people don't know what kotlin is, and it's relation to the jvm/java

#

and that's not something you can explain either in a beginner tutorial

#

not to mention, starting them off with kotlin is not doing them any favours when they try make their own project, and can only find java resources online

prisma wave
#

Good point

#

I suppose you could handwave an explanation with "it's a language that is compatible with Java" or something

quiet depot
#

😬

#

I really think you should just do java

prisma wave
#

You're probably right

#

I just think Kotlin is probably easier for a complete beginner to learn

quiet depot
#

really?

#

I would've thought the opposite

#

there's a direct link between verbosity and readability, two categories that java excels in

#

kotlin on the otherhand, is not anywhere near as verbose as java

#

and is therefore less readable

prisma wave
#

True, but a lot of the syntax reads more naturally I think

#

It's a lot easier to understand "fun name" than it is "public void name"

#

There's probably positives and negatives to both but I think you're right

errant geyser
#

Or you could tell them to learn the language first, and then not deal with this fingerguns

#

BM voice reveal incoming?

quiet depot
#

bm you should totally upload the videos to helpchat channel btw

prisma wave
#

Sure

#

Probably more likely to get more views there anyway

hot hull
#

God I'm sick of this "If you want to save the world" ad, I've heard it like 500 times the past two months

quiet depot
#

imagine seeing ads lol

prisma wave
#

Ecosia?

versed ridge
#

ads? what's that

hot hull
#

Shut up Piggy, we just got spotify in our country, still haven't set it up :((

quiet depot
#

what you need spotify for

#

youtube is way better than spotify

#

youtube is the best place to listen to music

prisma wave
#

is it though

versed ridge
#

nah

quiet depot
#

yes

hot hull
#

I listen to it on mobile

quiet depot
#

youtube has way more content than spotify

hot hull
#

Indeed it does

prisma wave
#

True

#

But on mobile Spotify is a lot more accessible

errant geyser
#

I'd prefer Spotify honestly, it usually cuts off those songs that have that weird intro shit and just gives you the song

quiet depot
#

I don't listen to music on mobile

#

purely because of the reason that spotify doesn't have the sort of music I listen to

hot hull
#

I do, because ya know, one too many chrome tabs and the pc explodes fingerguns

prisma wave
#

YouTube music?

quiet depot
#

I don't use youtube music

#

just normal youtube

hot hull
#

Just normal yt yea

errant geyser
#

Imagine using chrome fingerguns

hot hull
#

Imagine using a PC, now shut up weeb

errant geyser
#

Exqueeze me

#

WEEB

#

I'll have you know I've never watched that weird japanese anime stuff

quiet depot
#

youtube could easily be the best music app in existence if they allowed video-less streaming with autoplay

errant geyser
#

That, piggy, is why you use YouTube Vanced

quiet depot
#

the hek is that

#

o android app

#

i'm an apple user sorry

errant geyser
#

It's a YouTube wrapper? I guess? App that is literally youtube but allows autoplay and can play videos with your phone closed

#

Oh god

prisma wave
#

YouTube without ads

#

It's sick

hot hull
#

ew apple

onyx loom
#

ew frosty

quiet depot
#

oh clojure, ended up implementing lazy initialization for the material api like you recommended .-.

prisma wave
#

seems like the only way around it

quiet depot
#

I wonder if I can create some sort of java api that allows for a standard method of lazy initialization

#

like kotlin's lateinit

prisma wave
#

Interesting

#

That could be cool

#

Although lateinit isn't lazy

quiet depot
#

oh

#

am i thinking of something else? or just misunderstanding what lateinit is

prisma wave
#

there are variable delegates for that kotlin val lazyVar by lazy { someValue }

quiet depot
#

ah ok

prisma wave
#

You could do something similar

#

it would need a method call to actually get the value ofc

hot hull
wise badger
#

Which Youtuber would you recommend watching in order learning how to make Java Plugins?

regal gale
#

Which is better, Gson or Jackson

wise badger
#

What

regal gale
#

No, not you

wise badger
#

Ah

regal gale
#

Also, I don't recommend going to Youtube for such stuff

wise badger
#

What would you recommend?

#

It's really hard for me learning without any example

regal gale
#

Internet has a lot of examples than that

analog crater
#

And github (both for examoles)

wise badger
#

I can’t understand documents, trust me I’ve tried. If you guys have a good tutorial on YouTube I’ll appreciate it!

hot hull
#

ayy it works

prisma wave
#

Nice

#

@wise badger once you know the basics, #development is a very useful resource

wise badger
#

The thing is I can understand the Language but I can’t code from 0..

obtuse gale
#

Do you know what a method is?

hot hull
obtuse gale
#

java

hot hull
#

smh

wise badger
#

Any recommended YouTuber?

obtuse gale
#

none

rapid ingot
#

Idk where to post this so I will try here

#

My friend is hosting a sever and occasionally the server motd just says pinging and when I try to join it gets suck on loading terrain and after a little while it times me out.
Sometimes it does this sometimes it doesn't.
Does anyone have a idea how to fix this.

wise badger
#

Maybe the server is running off ram?

#

or it's located far away from you

rapid ingot
#

Ram isn't a issue it has 14gb

#

It's located in the is us and I live in the uk

#

it only happening on this one server

wise badger
#

hmm, can you send me your console message?

rapid ingot
#

of the join and leave message?

wise badger
#

on server start

rapid ingot
quiet depot
#

Which is better, Gson or Jackson
@regal gale gson gang

#

doesn’t matter though

heady birch
#

jackson

obtuse gale
#

jackson

quiet depot
#

gson vs jackson is the equivalent of swinging doors vs sliding doors

#

they both work fine

obtuse gale
#

except sliding doors are objectively better

heady birch
#

but swinging doors smack you in the face

obtuse gale
#

^

quiet depot
#

well

heady birch
#

sliding doors do the work for you

quiet depot
#

I really tried but I couldn’t think of anything else

heady birch
#

lol

obtuse gale
#

and require you to clear room around for the door to swivel out

quiet depot
#

help me, what’s 2 equivalent things that can be compared

obtuse gale
#

with that example you could also say

#

eclipes vs intellij

quiet depot
#

no

#

because intellij is obviously better

obtuse gale
#

they both technically work, but one smacks you in the face

#

so are sliding doors

quiet depot
#

gson and jackson aren’t like eclipse and intellij

obtuse gale
#

no

#

because gson and jackson arent like doors and sliding doors

#

they are like eclipse and intellij

#

wait

quiet depot
#

well then help me think of a better example

obtuse gale
#

what did i just say

#

I just said no to your statement then just said your statement.....

#

idk what im sayingl ol

quiet depot
#

idk dude I can’t think of anything

#

point is neither is better than the other

#

they both have pros and cons

#

my preference is gson

#

Regarding the “code from 0” problem. We (#development) can help you get started

rapid ingot
#

could someone help me out with my issue

prisma wave
#

Wrong channel

rapid ingot
#

oki

static zealot
rapid ingot
#

i did minecraft

distant condor
#

guys

#

kotlin good

#

java bad

prisma wave
#

kotlin good java bad

#

!!!

distant condor
#

we need to enlighten all the heretics

#

!!!!

prisma wave
#

ever heard of clojure though

distant condor
#

hmm no

#

lemme google it

obtuse gale
#

dont

prisma wave
#

do

distant condor
#

is clojure good java bad

prisma wave
#

yes

obtuse gale
#

yes

prisma wave
#

clojure good kotlin good java bad

obtuse gale
#

but kotlin good clojure bad

prisma wave
#

no

#

wrong.!

distant condor
#

kotlin best clojure good java bad?

prisma wave
#

hmmmm

#

that seems like a fair compromise

distant condor
#

time to execute the kotlin naysayers

prisma wave
distant condor
#

petition to get barry to censor "kotlin bad"

old wyvern
#

🤦‍♂️

prisma wave
#

circle jerking good

earnest narwhal
#

Hey, who is experienced with NMS here?

prisma wave
#

Don't ask to ask

#

Just ask the question

heady birch
#

Kind of

ocean quartz
onyx loom
#

4 stars kapp

static zealot
#

xD

quiet depot
#

petition for spigot to rename reviews to
"Single Response Support & Error Section. WiTH STaRs!!1!"

ocean quartz
#

Oof I need suggestions for this
Would this look good for multiple actions? Separated by |
[text](hover: Hover message|click: Click action)
And also idk how I'll do the types of clicks and stuff like that
Maybe [text](clipboard: ) where the clipboard can be url, command, suggest_command, hover, how would this look?

obtuse gale
#

Hey idk where to say this. but i need a way to do /discord on my mc server im fairly new to this plugins and stuff does anyone know how i can install such a plugin or make it myself?

heady birch
#

Matt use <> html looks nice

obtuse gale
#

excuse me

#

wTf did yoiu just say

ocean quartz
#

@heady birch What? Use <> for what in there?

obtuse gale
#

Hey idk where to say this. but i need a way to do /discord on my mc server im fairly new to this plugins and stuff does anyone know how i can install such a plugin or make it myself?
MyCmds can probably do that if all you want is it to send you a discordd link

heady birch
#

<hover text="hover text">txt</hover>

ocean quartz
#

Yuck, plus that defeats the entire purpose of making it a markdown like syntax

heady birch
#

awesome

#

look forward to it

ocean quartz
#

Oof just realized that this action stuff will be pretty hard

#

Since the lib only accepts [text](link) if there is a space in the link area, it'll work, which will just append that in the chat, though as soon as I add bold and stuff inside the tags it breaks xD

jovial warren
#

F

prisma wave
ocean quartz
#

Now wait till they say there is no source only decompiled version xD

static zealot
#

xD

prisma wave
#

Oh no

hot hull
#

@forest whale Can you elaborate a bit more on your request, do you have source? Which plugin exactly, etc

forest whale
#

MoreFish Plugin

hot hull
#

Got a link?

distant sun
#

When creating a database for a ptero server, what do I set as allowed IPs to allow only local connections? Tried 127.0.0.1 but it doesn't allow plugins from other servers to connect.

ocean quartz
#

I need someone to criticize this:
https://paste.helpch.at/ipubewakek.php
Since it can't handle the actions like i want i am doing it my own way, so I need to tokenize the actions first
The test string i used was
"[test](action: **test**) <#22967b>This -is- [test](action: **test**) a *lexer* example [test](action: **test**) final text"
Which turned into this:
[{action}, <#22967b>This -is- , {action}, a *lexer* example , {action}, final text]
Anything you guys would improve on the parser?

hot hull
#

No source, have fun with that fingerguns

ocean quartz
distant sun
#

stoopid

hot hull
#

Bruh

#

It's not like you have a large title which clearly says Source Code that can be used for that

ocean quartz
hot hull
#

That man should not be allowed to use kotlin :(

prisma wave
#

Murder him

onyx loom
prisma wave
#

@ocean quartz isn't that lexing not parsing?

#

It seems like you've merged the 2 processes into 1

ocean quartz
#

I'm unsure tbh, because basically I need to parse the actions before handling everything, but i need to keep them in the correct place in the string, then later I'll have to parse each of the tokens data individually again

#

It doesn't need to be a token, just thought it made sense to be

prisma wave
#

Hm

#

Well typically in language parsing, you split the text into tokens and then parse the token stream

#

I'd recommend you do the same, since trying to do it in 1 process usually gets messy

ocean quartz
#

Actually yeah this is more of a lexer, basically I'll lex them into tokens, one that'll have just text and other that'll have the action stuff, like display text and the action itself, which will be parsed later together with everything else

prisma wave
#

yeah

#

Well lexing is usually small tokens

#

So you might have an ASTERISK token, a LPAREN, RPAREN, LSQPAREN, RSQPAREN, etc

#

You want to make the tokens as specific possible

ocean quartz
#

Gotcha, I'll try making this work

forest whale
#

@hot hull so , are you gonaa do it m8?

hot hull
#

Nah, I ain't got time, was just curious fingerguns

forest whale
ocean quartz
ocean quartz
static zealot
#

nice nice

onyx loom
#

i just went back to Darcula for a second and it sucks 😅

#

atom one dark good

prisma wave
#

Yes

#

Wise words

onyx loom
#

thanks for the suggestion

#

ur the one who told me about material

prisma wave
#

Was I?

#

Pretty sure everyone says to use it

onyx loom
#

well yea

#

but i seem to only listen to u fingerguns

distant sun
#

Noob

onyx loom
#

thats not nice gaby

#

say sorry 😦

prisma wave
#

Fair enough

#

In that case

onyx loom
#

no not clojure

prisma wave
#

Use clojure

#

Lmao

#

Nice prefire

onyx loom
heady birch
#

Gross

#

Darcula and Classic are the only good themes

prisma wave
#

Gross

onyx loom
#

silence, light theme user

heady birch
#

Heh

#

I will have you know

#

I'm using dark theme right now

onyx loom
#

congrats, thats a start

#

but its still not Material theme

heady birch
#

No

#

No

#

Shutup

#

Im not doing that again

#

No wonder frosty complains about his damn ide locking up

onyx loom
#

thats just his bad pc

dusky drum
#

my pc is potato and it can still run Material Themes

heady birch
#

I am discusseded

split talon
#

Does using a spigot jar vs a paper jar make any difference?

dusky drum
#

paper has some functions removed i think

split talon
#

this is probably a dumb question actually

#

ah

onyx loom
#

and has its own extra methods

dusky drum
#

^^

#

so

split talon
#

okay so not a dumb question

#

Lol

dusky drum
#

maybe paper plugin isnt compatible with spigot

errant geyser
#

Paper plugins aren't compatible with spigot servers if you use paper specific things

#

But that's like, common sense

#

Overall it depends if you want to support everyone, or just paper

split talon
#

ah

#

Well the choice seems pretty obvious ngl

prisma wave
#

paper good

dusky drum
#

i love when pepl think i abandoned project and they just give 1 star since they cant wait for pepl to update stuff.

split talon
#

lol

#

Feels bad 😦

dusky drum
#

i know

#

he just said i didnt take any interest in fixing issues.

#

like wtf man ask first.

jovial warren
#

Was just browsing around the Firefox web store (was looking for a notepad) and just decided to put in "atom" to see what I could find, and I found this. For those of you by the way (like me) like the look of the Atom Material Icons, I found an extension that brings them to GitHub. It's also a useful tool to identify a file type, and looks quite nice as it is.

Firefox (objectively superior browser): https://addons.mozilla.org/en-GB/firefox/addon/atom-file-icons-web

Chrome: https://chrome.google.com/webstore/detail/atom-file-icons-web/pljfkbaipkidhmaljaaakibigbcmmpnc

Edge (the worst browser ever created): Not available because it's so bad

Download Atom File Icons Web for Firefox. Changes GitHub and BitBucket file icons according to their extension or framework

heady birch
#

thats acctualy pretty neat

onyx loom
#

very nice

jovial warren
#

wow I actually discovered something useful for once xD

onyx loom
#

wait does the extensions not work on different chromium browsers?

jovial warren
#

what browser do you use?

onyx loom
#

i use chrome

jovial warren
#

then it'll work

onyx loom
#

but i thought edge users could also use chrome extensions

#

etc etc

jovial warren
#

no idea

onyx loom
#

🤔

heady birch
#

yes if they download chrome

onyx loom
#

o well. f edge users xd

prisma wave
#

Yeah they can

jovial warren
#

but I searched the store and couldn't find anything

prisma wave
#

New edge is based on chromium

#

I think it can use Chrome extensions therefore

jovial warren
#

but that comment I left at the bottom is very true

prisma wave
#

Nah new edge is decent

jovial warren
#

I suppose we can give it some credit

#

it's not comparable to Firefox or Chrome though

#

well, imo Chrome isn't comparable to Firefox

#

idk

onyx loom
#

doesnt edge offer the best resolutions also?

prisma wave
#

No idea

#

I think it looks nice though

jovial warren
#

Firefox is faster, Chrome and Edge are cleaner

prisma wave
#

And performs decently

onyx loom
jovial warren
#

I don't think Googles chromium rendering engine because I somehow forgot it again Blink will ever be comparable to Gecko though

onyx loom
#

how true is this thonking

prisma wave
#

Oh for netflix

#

Yeah

#

It does

#

Because it can enforce the Netflix DRM on an OS level

onyx loom
jovial warren
#

yeah but who watches Netflix on their computer when they have a Sky Q Mini box that has it built-in am I right guys?

prisma wave
#

I mostly watch on mobile

onyx loom
#

mobile?????????????

jovial warren
#

????????

#

who tf watches on mobile????????

onyx loom
#

i remember watching some on mobile, and im like yuck. the screen is so small xd

prisma wave
#

My phone has a big screen

jovial warren
#

this guy man am I right @onyx loom

prisma wave
#

And like in bed and stuff

onyx loom
#

just get a tv 4head

jovial warren
#

^^^^

#

I got a 32 inch TV with a Sky Q Mini box that has Netflix built-in

#

(though I literally rarely ever use Netflix anyway, I maybe use it once or twice a month? lol)

prisma wave
#

I have a TV

#

But mobile is better resolution

#

Higher DPU

jovial warren
#

????

prisma wave
#

DPI*

#

more accessible