#dev-general

1 messages · Page 609 of 1

timber oak
#

Yeah

#

Hmm I think I'll just focus more on using DI instead of passing one dependency, as the main class and just using getters from there

#

I've actually overused it a lot

steel heart
#

No you can’t overuse DI

#

But yes your main class as a dependency, definitely

timber oak
#

Okay so I have a class where I use the main dependency to get 3 other dependencies, but the class is only about 100 lines. So should I really pass all 3 dependencies through the constructor or just keep using the 3 getters?

steel heart
#

What type of class is it

timber oak
#

It's a scoreboard manager

steel heart
#

BRB need to eat :3

timber oak
#

aight

timber oak
steel heart
#

oo

#

yeah

#

im backl

#

but like valdemar

#

I was thinking whilst enthusiastically eating

#

here are some reasons we avoid this class that is a dependency of every other class:

  • It gets really hard to see what our classes really depend on
  • It sometimes gets hard to reuse the code as that plugin instance always has to be passed
  • (Harder to unit test)
timber oak
#

I guess 3 instances are better than the main class instance then, right?

steel heart
#

yeah

#

like I can add you to a project I work on

#

if you want some sort of image how it might look without

timber oak
#

Would be nice

half harness
ocean quartz
#

Jetbrains is a little better at keeping track of it than github

#

My JB license expired like 2 years before the gh did kek

half harness
#

👀

#

ig ill just renew jetbrains license then 🥲

#

although i thought github required a renewal each year

#

lol

#

oh its every 2 years

#

whoops

#

ez 😌

#

now time to do the same with unity

ocean quartz
#

1 year actually, from JB

#

From GH

half harness
#

also

#

is unity still in dev pack

#

🥺

#

i can't find

#

D:

ocean quartz
#

Yeah that's what I mean, github student expired 1 year after jb student for me

half harness
#

ohh

#

oops

half harness
quaint isle
#

For a uni course, we have to analyze an open source project. Explore the architecture (modules, what's communicating with what etc.)
Do you know any cool projects that would be fun to look into? I was thinking OBS / Open Broadcast Software could be interesting. Any other ideas?

dense dew
#

ShareX is fine ig

wind patio
#

anyone did footnotes in markdown?

#

or doesn't it work in github wiki?

sweet cipher
#

Sending 1 packet with 1 player online every tick shouldn't cause lag right?

#

(Using ProtocolLib)

main prawn
#

¿Dónde puedo encontrar el DeluxeChat para la 1.18?

#

Buenas noches

obtuse gale
#

the game sends many more packets to many more players in smaller timeframes

#

you'll be fineeee

humble silo
#

How long did it take for other people to got copilot? Are they still doing pre-releases? Ive been on the waitlist since october and nothing

sweet cipher
forest pecan
#

if its a large ass packet then maybe

sweet cipher
#

Player rotation

#

Entity*

distant sun
#
string = string.replace("\u00A7", "&"); // Replace § with &
string = argsRegex.matcher(string).replaceAll("%$1%");```
Is there any way to do these replacements without re-assigning the `string`?
sweet cipher
#

StringBuilder?

#

Strings aren’t supposed to be mutable so I don’t see it being possible

#

You can possibly use reflection

distant sun
#

Yeah, not worth

eternal compass
oblique heath
#

is there a way to change the root directory for a server

#

so that i don't need to have the server jar in the same directory as the world files, configs, etc

inner umbra
#

Just change the startup command to the location of your jar.

half harness
#

that

#

i was too slow ☹️

oblique heath
#

how would i go about doing that

#

oh i think i see what you mean

half harness
#

im 99% sure that should work

oblique heath
#

thank you dkim, i was drawing a blank for a moment there

half harness
#

np 🥰

versed ridge
#

That won't work

#

It creates the server files where the jar is

#

@oblique heath

oblique heath
#

it's working for me right now

versed ridge
#

o

#

interesting

oblique heath
#

the working directory is where the server files will be created

versed ridge
#

oh

#

my bad

oblique heath
#

you're good, no worries

quiet depot
#

no absolutely unacceptable

#

how dare you

versed ridge
#

My sincerest apologies, I hope I can be forgiven

quiet depot
#

i'll think about it

humble silo
#

Is it bad form to create your own file systems in java? By that i mean actually implementing the FileSystem interface and stuff... I want to create paths from URI's(like referencing a jar online) and that seems to be the only way to do it

oblique heath
#

does java only let you specify memory limits with 2^x units like kb, mb, gb? or can it also use (10^3)^x units like kib, mib, gib

#

to follow that up, can kubernetes use something besides (10^3)^x units like kib, mib, gib 🥲

obtuse gale
humble silo
obtuse gale
#

Why is it a bad idea?

#

I'm not saying to extend it and "create your own"

#

But get one

humble silo
#

They dont support http or https

#

as far as i can tell

obtuse gale
#

Hmn

#

dev general moment

cursive breach
obtuse gale
#

smh

humble silo
#

lol

#

as i said

#

temp dir will be an easy fix

languid prawn
#

hiii guys i need help.
i want to make a spawn.yml file on using a command /setspawn

prisma wave
#

ok

indigo patrol
#

Hey

sly sonnet
rancid gazelle
#

just finished confirguring food, farming, ores, and mob drops shop ;-; took 2 hrs smh

#

not even half way

static zealot
#

Anyone that uses Nautilus is there a way to navigate folders in a terminal using cd and then open a gui directly in that folder?

#

so for example I open a terminal I do cd Downloads and then somehow do nautilus and it would open directly in Downloads and not in home?

#

ah

#

its literally just nautilus .

timber oak
#

What's best for a portfolio, being a dev in a big freelancing team or a server with about 200 active players?

steel heart
#

Former I’d say

timber oak
#

Former?

steel heart
#

Given that you got good rep

#

The first one

timber oak
#

ah

#

Yeah that's what I'm thinking as well, good to have some vouches ig

oblique heath
#

why not both

timber oak
#

I don't have the time for both at the same time

split sail
#

Above link is my message link with a scammer who looted away all my axies & funds from my Ronin Wallet by phishing. This profile is spamming everyone looting all their assets of Axie Infinity games players. Can we know the person behind these anyway? I complained at Ronin support team & also cyber crime portal. Pls help

languid prawn
#

guys does anyone know how to refresh scoreboard

regal moon
#

Plz anyone can tell how can i add command on an playerEvent?

distant sun
#

Hm?

regal moon
#

?

#

It mean if player usr that command, so playerEvent get trigger

#

In this case i am using player damage event and also velocity event

distant sun
regal moon
#

Did u not understand or something else?

distant sun
#

No, I do not, sorry

regal moon
#

Ok, so can you tell me that, if player type /<command> he get knockback

#

?

#

Now did you understand?

#

Plz

oblique heath
#

kai

regal moon
#

Yes

oblique heath
#

are you saying you want players to be able to toggle whether or not things happen to them after they run a command

regal moon
#

No, like did u know clutch plugin?

oblique heath
#

no

#

or are you asking how to add commands

regal moon
#

Well it does that, just player type command and get knockback without damage. And he has to just clutch with blocks

#

I am new so i dont know things

oblique heath
#

so you want the player to be launched into the air when they run a command?

regal moon
#

Ye

oblique heath
#

that's pretty straightforward

#

all you have to do is set the player's velocity to whatever you want it to be

regal moon
#

That i know.

#

But

#

How player get launch in air

oblique heath
#

by setting the y component of the velocity

regal moon
#

I will try

#

Thnx btw

oblique heath
#

no problem 👍

regal moon
#

Are u dev?

oblique heath
#

i develop, yes

regal moon
#

Nice

#

I am learning

oblique heath
#

nice, keep at it

regal moon
#

Did u learn urself?

#

Or any course?

oblique heath
#

i took classes on java in high school

regal moon
#

gg

oblique heath
#

and am now taking various programming and similar classes in uni

#

but i'm also teaching myself a lot of things to fill in the gaps

regal moon
#

U pro

oblique heath
#

not yet but hopefully soon 🥲

regal moon
#

U will

oblique heath
#

thanks lol

half harness
#

ivan = pro

wind patio
#

if I have a method call inside an async scheduler

#

the method is processed by it?

#

or main thread?

half harness
long dagger
#

I have a question for how bedwars plugins operate, do they have a single server per game, so the bedwars plugin only handles one game, or is it world based. and which one is better/easier/more efficient?

wintry plinth
#

Smaller scale it’s done per world I would assume, and at a larger scale done per server

dense dew
half harness
#

o.o

oblique heath
obtuse gale
static zealot
long dagger
#

alright

#

I think they create and delete instances dynamically as well

static zealot
#

but that's hypixel... with 80k-100k players on daily

long dagger
#

yeah

static zealot
#

pretty sure they posted dev blogs on their forums about this. so if you're willing to search you might find those interesting

long dagger
#

I am building a network, and I am trying to make it as easy as possible to scale and contract the network

static zealot
#

well you could just google hypixel dev blog # (# is a number) and you'll find quite a few of their blogs explaining a lot of interesting stuff

long dagger
#

alright

dense dew
#

long time ago

#

during the event

static zealot
#

damn. the old version of ivan was dumb af

long dagger
#

Also, does Hypixel run their own fork of a spigot server?

#

or a least a custom version of minecraft?

static zealot
#

and a 1.7.10 version as well

oblique heath
oblique heath
#

this will let you launch new minecraft instances across multiple physical machines and even into the cloud, all while keeping that layer hidden from the plugin perspective

#

theres also some special made minecraft server managers that use this stuff like pterodactyl panel i believe

half harness
thorny garden
#

whats the EnumParticle for 1.17.1

ocean quartz
#

Seems to be automatically added to all verified public bots

#

Actually no need to be verified just public

ocean quartz
# quiet depot how

Ah nvm it's not automatic, on the dev panel go to oauth2, on the authorization method do "in-app authorization"

marble plaza
#

Hey! Does anyone know how to load my plugin last, after all other plugins? I'm trying to create "server startup commands" plugin so when everything is loaded correctly, then plugin runs some commands.

#

Or maybe some event I could use...

distant sun
#

Schedule a task, I think they are only run once the server is done loading

marble plaza
#

Ahhaa, nice, did not know such thing existed. Thank you!

distant sun
#

Np

distant sun
clever rain
#

help

#

i need helo

#

someonepls

#

my mic aint workin when im on a call

#

but generallyt works

#

who do i tag?

#

@everyone

loud gyroBOT
#

The 'everyone' mention is disabled so you can't annoy people.

wintry plinth
#

?not-discord

compact perchBOT
#
FAQ Answer:

Looking for discord support?
HelpChat is a Minecraft plugin and development support server and is not affiliated with discord in any way.
If you require support from discord, we recommend you to visit their official support website at https://support.discord.com
On this website, you can read their FAQs, or open a support ticket if necessary.

clever rain
#

doesnt help

static zealot
#

yes it absolutely does

#

if you read

clever rain
#

ive already done many of the suggested troublweshoot actions

#

nothing happened

static zealot
#

that's not a suggestion. that's telling you this is not discord support. if you want support from them you should probably contact them thru: https://support.discord.com

clever rain
#

then wha ti s this

static zealot
rancid gazelle
#

What premium plugins does HelpChat have/own?

static zealot
# rancid gazelle What premium plugins does HelpChat have/own?

none. Clip however has like 3 and then Glare has 2 of his own. (those 2 are admins here. they're not owned by helpchat tho). There's other community members that have premium plugins and use helpchat as a help server but those are not related with helpchat.

static zealot
#

AutoSell, DeluxeChat and EzRanksPro. He also used to have MineCrates but that one is not maintained anymore. hasn't been for 3 years now

#

and Glare has Guilds and VoteParty

wintry plinth
#

DeluxeChat PepeHands

vital pollen
#

having issues with the chat. %player% or %player_name% placeholders are not working

#

i get the prefix and tag but not the playername, is anyone able to help?

compact perchBOT
#
FAQ Answer:

Player placeholder not working? If you are using a plugin which supports PlaceholderAPI, and the %player% placeholder doesn't work, then change it to %player_name% and download the player expansion.
Commands:
/papi ecloud download player
/papi reload

half harness
vital pollen
distant sun
#

why does iij now know how to show the value of a constant in kotlin 🥲
and I like the final val 🤣

wintry plinth
#

There’s this guy on twitter who keeps arguing about how he wants to structure his API.

I told him to give it a rest…

oblique heath
#

hopefully he didn't get too graph-ic

obtuse gale
#

@vagrant token Can you accept my friend request?

vagrant token
#

yes

#

what for?

ruby dew
sweet cipher
#

Can packets be sent async?

oblique heath
#

packets are sent async

#

one does not send a packet sync

sweet cipher
#

Whoops

#

So that would cause lag?

oblique heath
#

actually maybe you do send packets sync

#

i'm not sure how mc packets work but if you expect any sort of response you shouldn't send them on the main thread

#

however if they're only sent in 1 direction and you dont want a reply you can send them sync

sweet cipher
#

They are one direction

#

But they are sent every tick

oblique heath
#

it probably doesn't matter much either way (if you dont need a response) tbh unless you're sending an inordinate amount of packets

sweet cipher
#

It uses ProtocolLib if that makes a difference

#

The runnable seems to take up a lot of the tick in the timings report

oblique heath
#

try sending it async and see if it helps the timings

#

thats the best way to know for sure if you want to do that

sweet cipher
#

Okay cool, thanks for the help

#

I might be mis-remembering this, but I heard async tasks don't show up on timings so I'm going to see if I am doing anything else dumb first

oblique heath
#

they likely won't since they don't run on the main thread

#

which is good as that also means they can't waste server tick time

sweet cipher
#

Yeah

rancid gazelle
#

Why is my pack error?

#

Oop I cant upload pics

compact perchBOT
#
FAQ Answer:

You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/ to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.

steel heart
# sweet cipher Yeah

They’re queued to some netty thread iirc so basically synced somewhere else iirc

primal crystal
#

Hey... Has any one tried SSHJ or JSCH for SFTP Transfers?

#

Or something that works?

obtuse gale
half harness
#

wot

#

o.o

#

are there javadocs

obtuse gale
#

Used to annotate a constructor/factory parameter to indicate that returned object (X) will close the resource when X is closed.

#

basically something like uh a new InputStreamReader(in) or a new BufferedWriter(writer) etc, when you close those, in and writer are also closed

prisma wave
#

it's all async, just using the netty thread pool

stoic plover
#

hey

urban sleet
#

How much do you guys think would be a fair amount for a world generation plugin just to spawn flowers on the world surface?

#

Ping please

foggy pond
#

It's not exactly a showcase, just looking for some feedback as I am not sure if maybe each frame should last less/more, or if the particle itself just doesnt look good idk

prisma wave
#

kinda looks like butterflies

round parcel
#

anyone know how can i get the deluxechat thing?

sick belfry
round parcel
#

can any staff give me the role to deluxechat?

foggy pond
foggy pond
sick belfry
foggy pond
#

You can probably do it using resource packs I guess

#

Thank you (:

sweet cipher
#

With 3 people online

prisma wave
#

server lag or client lag?

#

because that's still a task that's gonna take at least a few milliseconds running multiple times every tick

#

you should be able to run it async

eternal compass
#

=check @round parcel

compact perchBOT
#
Forced Spigot Purchases Check!

Successfully checked that user for new purchases!

eternal compass
#

yeah, assuming that doesn't work you need to link

#

and if you are linked, then wait for the next db update

compact perchBOT
#
Buyercheck Status

Below is how long ago each plugin's buyers list were updated:

VoteParty:

VoteParty 1d 10h 16m

DeluxeChat:

DeluxeChat 14h 53m 52s

AutoSell:

AutoSell 23h 27m 53s

MineCrates:

MineCrates 102d 18h 6m

EzRanksPro:

EzRanksPro 23h 27m 58s

Guilds:

Guilds 1d 10h 16m

sweet cipher
pastel imp
#

Minecrates 102d lol

cinder flare
#

Is there a list anywhere of what dependencies Spigot/Paper expose to plugins? Like JDBC and stuff

quiet depot
#

not that I'm aware of but ij can show you

cinder flare
#

ooh how

quiet depot
#

go to the gradle tab

#

dependencies

#

then go to spigot

#

and you can expand spigot's dependency tree

#

oh, that'll only work for the api actually

cinder flare
#

looks like apache commons, gson, guava, and snakeyaml?

quiet depot
#

yeah that's what the api provides but I forgot there's more in the server jar

cinder flare
#

yeah like JDBC

#

weird

quiet depot
#

your best bet would be to look at the pom yourself

#

I don't think there's much else you can do

#

I lied

#

depend on spigot (nms) through maven local then you can use ij's dependency thing to see what it provides

pastel imp
#

Is this actually worth to do/use?

#

(Not the plugin, just the way it stores data since it is outdated)

oblique heath
#

not worth it

#

at that point just use a database

#

databases are also 'centralized' the way that claims to be, but they are indexed and can be traversed much much faster than straight files like that seems to use

wintry plinth
#

Honestly I like the idea of this, having one place, my trouble comes down to if you wanted to reset a particicular plugin then you're kinda fucked, and as Ivan said you basically have a db for that "centralised" purpose

oblique heath
#

it's also making a bunch of really weird claims that i can't imagine are actually true

#

like it's purpose being 'to save storage space' - even though all it does is keep data in one file instead of spreading it across several - i guess you're saving inodes but not any significant amount

wintry plinth
#

Yeah 😂 you aren't saving file space really

#

Just one less file

#

which is what, 1kb if that

oblique heath
#

yeah lmao

#

and any extremely marginal benefits you might see from the reduction in file count would be offset by all of the boilerplate data stored in this central system, like plugin namespaces in json being tracked for every individual player

wintry plinth
#

Yeah 😂

pastel imp
#

This one also seems cool. Although it’s only flatfiles

ocean quartz
#

What in the world

dense dew
#

lol

#

just screenshotted it

#

xd

steel heart
#

Yeah it will always be private, can’t be reassigned to public, duh /s

pastel imp
ocean quartz
#

Yeah it's in the screenshot in the page

distant sun
#

lombok 🥲

ocean quartz
#

Yup

#

I was looking at the source and was like "java, but val? wtf"

distant sun
#

wait what

ocean quartz
#

Lombok adds it

distant sun
#

bruh

ocean quartz
#

I love that sometimes it's final Type other it's val, very consistent

distant sun
#

is val a data type?

ocean quartz
#

It's the same as var

#

But works on Java 8 cuz Lombok will just compile it to final Type

distant sun
#

ah thats what you meant

ocean quartz
#

Ah yeah xD

wintry plinth
pastel imp
#

According to them, it’s enterprise level xd

wintry plinth
#

Otherwise flatfile, sqlite etc works amazingly even for larger sites or servers

wintry plinth
#

ye aha

pastel imp
#

Couldn’t you still not use a database for cross server stuff?

#

Can’t you like, use websockets or something like that

wintry plinth
#

technically yeah

pastel imp
#

Between servers

wintry plinth
#

Redis pubsub

#

bam

pastel imp
#

Don’t know that xd

#

But is it possible house websockets in this case?

wintry plinth
#

Yeah aha, redis pubsub is like websockets, allows you to send a message across

pastel imp
#

Oh k

wintry plinth
#

then receive on other end for example

pastel imp
#

Ye you would receive it and store it in a flatfile in that server itself

wintry plinth
#

https://twitter.com/levelsio this guy uses sqlite for everything and his sites make tons 😂 its comical because he doesn't stick to normal methods

#

Like he doesn't use autoscaling etc

pastel imp
#

Xd

#

(Idk what that is but pog)

wintry plinth
#

So with websites you can set it up so it uses maybe little to no ram cpu etc, and then when more visitors come, it automatically adds more ram etc, until its no longer needed

#

But services like this often cost money, sometimes its more affordable if your site is inactive for half the day

pastel imp
#

Oh ye

#

Xd

dim marsh
#

hello, i need help with something shuld i jsut ask my question here or someone pm?

#

idk if im the correcet place even 😛

wintry plinth
pastel imp
#

Love that website

#

Sooo, general thoughts on SimplixStorage?

wintry plinth
#

I like the concept, but I'd personally probably only apply that type of logic if I was building a custom server, because if only half your plugins convert, its pointless

oblique heath
pastel imp
#

I wasnt speaking about coredata

#

Simplixstorage is the one that lets you store data in json, yaml and toml

distant sun
#

what do you even want to do?

pastel imp
#

Uh, store data?

#

I am looking for a general purpose storage api

#

Found simplixstorage, which got my attention

distant sun
#

I personally use sqlite whenever I can and it fits my needs

pastel imp
#

I would use it in most if not all my plugins.

distant sun
#

LuckPerms for instance, uses H2 for flat storage (or.. yaml)

pastel imp
#

I dont know that one

distant sun
pastel imp
#

But isnt json a good and fast flatfile type of storage?

#

As an alternative ofc.

distant sun
#

idk what to say about that

#

for small stuff, probably is ok

pastel imp
#

So, I am better off using sqlite in your opinion?

#

Aka mysql too since they are almost the same

#

In terms of usage

wintry plinth
#

SQLite is amazing if you dont need a database

distant sun
#

if you want a lib for databases, there's HikariCP

wintry plinth
#

but for most apps its amazing

distant sun
pastel imp
#

Thx

#

Will check it out

ocean quartz
#

HikariCP + jOOQ

wintry plinth
#

joooq]

distant sun
#

exposed for java? Looks interesting

ocean quartz
#

Yeah pretty similar

round parcel
#

can any staff help me ? i dont have the deluxechat role

static zealot
round parcel
#

pass 24 hour

distant sun
#

=check @round parcel

compact perchBOT
#
Forced Spigot Purchases Check!

Successfully checked that user for new purchases!

distant sun
#

there

round parcel
#

thank you!

distant sun
#

np

novel crystal
#

i need help

compact perchBOT
#

There is no time to wait! Ask your question @novel crystal!

novel crystal
#

my fish is not moving anymore when i came back from giving it a walk

static zealot
#

give it mouth to gills resuscitation

sly sonnet
sly sonnet
#

aw shit

static zealot
#

use offline gradle

sly sonnet
#

yeah, already did that

static zealot
#

👍

hallow topaz
#

hi

hybrid wedge
#

I relinked my spigotmc account, but I didn't get receive for the plugin role I purchased, what should I do?

static zealot
wind patio
#

Stay strong

cinder flare
eternal compass
#

Yoooo golang got generics

#

finally

#

I can make an implementation of streams

#

so I don't have to use so many for loops

distant sun
#

Weak

wintry plinth
obtuse gale
#

namely code gen

cinder flare
#

yeah, thoughts on Exposed?

obtuse gale
#

idk never used it

cinder flare
#

recommendations of any kind then?

obtuse gale
#

there was one orm made by the dude who made hikaricp

#

uuh

#

SansOrm I think?

cinder flare
#

oh, apparently ORM is an antipattern

#

fun

obtuse gale
#

yeah lol

#

I've barely touched sql in java besides the jdbc api and jooq, but I'd trust the one made by hikari dude to be good lol

ocean quartz
#

Exposed is nice if you're using Kotlin

obtuse gale
#

I don't see myself moving out of jooq if i need to interface with db's from java again, lol

#

i'm also lazy to learn new technologies that are direct competitors with something I already use

cinder flare
#

oooh~

#

down with gson??

obtuse gale
#

maybe? 👀

half harness
cinder flare
#

what

#

how does it not work with spigot

half harness
#

🤷 but theres a github issue on it and i haven't gotten it to work either

#

🤷

cinder flare
#

ah it has to do with relocating Kotlin

half harness
#

oh

obtuse gale
#

man using convention plugins for multi-project gradle setups feels so bigbrain and so tidy and clean

#

rather than whacky ass subprojects/allprojects configuration

half harness
#

oh i think i remember u mentioning it before

#

but

#

i was too lazy to look further into it

#

hmm

obtuse gale
#

it takes a tad bit to get used to it but it's so nice

eternal compass
#

to not have streams

#

I had to have loops everywhere

#

filtering

#

and mapping

#

life is soo hard /s

cinder flare
#

yeah I'm hesitant about Go

#

it seems kinda cool but looks horribly ugly and annoying to write

obtuse gale
#

@half harness apply for dev role when

half harness
#

i did months ago :(((((

obtuse gale
#

@crimson beacon wtf

#

LMAOO

#

sorry (not sorry)

inner umbra
#

Last time it was brought up piggy just said he had been lazy so IDK if he got started on them again or not

obtuse gale
#

yeah he's been going through some apps lately

half harness
#

o

#

😮

obtuse gale
#

last week at least

half harness
#

piggy if you see this

#

if i put any repos on my app

#

dont look at those (and dont look at bedwars)

#

😃

obtuse gale
#

xD

static zealot
#

he went thru some yeah. accepted and rejected some.

half harness
#

🥲 🥲

#

(dont look at that either)

#

ah, back when i didn't use kts

#

🤢

distant sun
#

bin

half harness
#

yes

#

bin

#

:)

steel heart
#

@half harness I have question

half harness
#

Hello

steel heart
#

Why use extension functions

#

like for

#

Event listeners

#

In spigot

#

I’m just curious

static zealot
#

because that's what matt said

#

and he did it

#

ez

steel heart
#

Oh

static zealot
#

the story of my life

steel heart
#

Such intriguing story

half harness
# steel heart Why use extension functions

that 🥲
and
uhh i just do it to keep it more shorter

ex kt private fun BlockBreakEvent.onBreak() { player.sendMessage("Broke block at ${block.location}") } vs ```kt
private fun onBreak(event: BlockBreakEvent) {
event.player.sendMessage("Broke block at ${event.block.location}")
}

#

btw

#

by "that"

#

i meant

steel heart
#

Ah

half harness
#

what blitz said

steel heart
#

And then you also inline it?

half harness
#

yes although it's almost never 1 line

#

but if its 1 line

steel heart
#

Ah

half harness
#

i inline it

steel heart
#

Oh I mean like the inline function

#

thingy

half harness
#

fun test() = something() this? or something else

steel heart
#

Isn’t there an inline keyword?

obtuse gale
#

i accidentally deleted the whole plugins folder from my test server 💀

half harness
#

i think

#

wait lemme see

static zealot
steel heart
#

Similar to how lombok extension functions work

#

I think

#

Since they also get inlined

obtuse gale
#

note: if you've got a copyToServer task in gradle, never run cleanCopyToServer

half harness
#

wdym

ocean quartz
# steel heart Event listeners

Basically to change the receiver of the function, reduces event. calls
Can also be done with onBreak(event: BlockBreakEvent) = with (event) {

half harness
#

wait is that a plugin

steel heart
#

Ooo

#

Thanks matt and dkim

distant sun
half harness
#
private fun onBreak(event: BlockBreakEvent) = event.let {
    with(it) {
        println("cool event: ${player.name}")
    }
}
```\:)
eternal compass
steel heart
#

what’s the point of with btw?

half harness
#

like

eternal compass
steel heart
#

ah

static zealot
half harness
#

ye

#

that

#

idk

#

a

steel heart
#

So it just creates an anonymous function

#

That’s ebic

distant sun
#

It allows you to use this but as the given object

steel heart
#

Oo

half harness
steel heart
#

Well isn’t that a bit confusing tho?

half harness
#

just saying

#

:)

steel heart
#

Oh right

static zealot
half harness
#

🤷

steel heart
#

Blitz good point

steel heart
eternal compass
static zealot
half harness
steel heart
#

Got a commission and he demands the plugin to be written in kotlin because "performance" apparently

distant sun
#

Maybe, but it is useful for stuff like
a.doA
a.doB
..
a.doX
a.doY
a.doZ

A good example imo would be spawning an armor stand amd then modify its properties (setVisible, serBase, setCustomName, setCustomNameVisible and other 10 methods)

eternal compass
half harness
#

wot

cinder flare
eternal compass
#

oh ik it's good

#

it's insanely good

#

but it's still not perfect

cinder flare
#

I've been doing a lot of reading about optimizations and stuff in the hotspot jvm

#

It's probably better than Go in a lot of areas

half harness
#

i mean for a discord bot

eternal compass
cinder flare
#

And that doesn't mean anything

eternal compass
#

yup, I know

obtuse gale
#

I think it's safe to assume hotspot jvm is the single best JIT runtime environment

cinder flare
#

Brainfuck can be compiled to machine code and is still slow

eternal compass
#

well yes

cinder flare
static zealot
obtuse gale
#

yeah

static zealot
#

nah. I like kotlin

cinder flare
#

I very recently read an article comparing the performance of Go and Java, and Java won almost all of them due to runtime optimizations like lock elision with escape analysis

eternal compass
#

wild, java is about 6x faster with binary trees

static zealot
cinder flare
#

It's kind of crazy how good the JVM is

ocean quartz
#

with, let, also, apply, use, run, all really cool but kinda only useful in certain places

cinder flare
#

I never thought it was that good but god damn

eternal compass
#

500 seconds vs like 1

obtuse gale
#

python bruh

eternal compass
#

anyway, still worth learning go

obtuse gale
eternal compass
distant sun
ocean quartz
#

Yeah

obtuse gale
#

recently I learned that some (not all, it depends on what is called) reflection operations will actually be optimized into generated compiled code (which is undoubtedly faster than any kind of reflection op) via interfaces, similar to that of method references

ocean quartz
#

use is awesome for closable things, it's basically an auto try catch finally

distant sun
#

Ye, very nice

ocean quartz
#

My favorite feature is !! i love npes

eternal compass
#

wait how is c++ faster than c

#

aren't they compiled in similar ways

obtuse gale
#

if anything it's slower lol

eternal compass
#

this was just off google ofc

#

could be wrong

obtuse gale
eternal compass
#

it unsurprisingly beats java in every possible way

static zealot
#

anyone has a map of miencraft legacy colors and their hex values please?

distant sun
#

Mhm, delete object;

static zealot
#

ty emily!!

static zealot
eternal compass
#

3!

#

3 Whole Searches

#

that must have cost a lot :p

obtuse gale
#

lol

distant sun
static zealot
static zealot
#

yes. that

timber oak
#

Is it possible to change spawner rates in a plugin? and not just in the bukkit.yml

#

And upgrade the rates, for specific spawners using PDC

brittle leaf
#

CreatureSpawner exists

#

you wouldnt use pdc for it i dont believe

timber oak
#

Not sure how I would do it yet but yeah

brittle leaf
#

you could use pdc to store the values

#

of the upgrade

timber oak
#

Ye exactly

brittle leaf
#

tho you would have to take those values and do something with them to upgrade the spawner speeds

timber oak
#

Problem is that it needs to be compatible down to 1.8... And I hate just clean NBT

#

using reflection

#

It's a mess

brittle leaf
#

pdc doesnt exist below 1.14

timber oak
#

I know

#

But NBT does

#

using NMS

brittle leaf
#

ofcourse

#

im sure nbtapi exists

timber oak
#

Not really a good one

#

Cant find one at least

brittle leaf
timber oak
#

Oh wow yeah it also supports entities, nice

brittle leaf
#

i dont think you even need to have them download the plugin

timber oak
#

Yeah they've got a dependency in maven-public repo

brittle leaf
#

SQL looks hard

#

currently in the process of learning how to use sqlite to store data and wow its complex

timber oak
#

Well an interface with MySQL and SQLite iirc

brittle leaf
#

yeah please

#

ive been searching through coreprotect as a reference/rip

wintry plinth
#

What is it you need to be able to do with SQL?

brittle leaf
#

literally just to store a world,x,y,z location whenever the recorder makes an update

#

such as block break, piston event, etc

#

i was looking at core protect and how its done in that plugin and it has wid,x,y,z in one table and wid,worldname in another

wintry plinth
#

So if you need to store X Y Z I would have them as separate columns

brittle leaf
#

which is what im doing

#

wait

wintry plinth
timber oak
brittle leaf
#

world | x | y | z |

#

thats how im storing them

#

in 4 seperate columns

#

not in one big string

wintry plinth
#

Phew

hybrid wedge
#

I purchased Guilds. I didn't received role My spigot account already linked someone staff check?

brittle leaf
#

Is it a good practice to close sql connection after ive finished the sqlite task i wanted to do

humble silo
#

always

obtuse gale
#

i meeaaan

#

things like sqlite and h2 are a bit of a gray area

frail glade
brittle leaf
#

i did it

#

but org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)

#

which proceeds to lag the server to fuck

dawn hinge
#

unless it's a one time thing, I wouldn't recommend you to close the connection, only do it on disable

#

closing/open connections are quite intensive

brittle leaf
dawn hinge
#

Connection#isClosed

brittle leaf
#

does sqlite ever close the connection?

dawn hinge
#

🤷‍♂️

dark fjord
#

Anyone know of a similar mod to replay mod that is supported in 1.18.1 forge?

brittle leaf
#

im no longer closing the connection

#

also its working alright weirdly enough

hybrid wedge
frail glade
#

Should be good now.

obtuse gale
#

I don't think using a connection pool is any beneficial for sqlite as connecting to it locks the whole file for itself

#

Faaaairly sure

brittle leaf
#

how would i go about running async select queries?

obtuse gale
#

Use the scheduler?

#

Not sure what kind of question that is

brittle leaf
#
public boolean hasBeenBrokenBefore(World world,int x,int y,int z) {
        if (world == null) {return false;}
        PreparedStatement statement = prepareStatement("SELECT EXISTS (SELECT wid,x,y,z FROM fc_block WHERE wid = "+getWorldID(world.getName())+" AND x = "+x+" AND y = "+y+" AND z = "+z+")" );
        try {
            ResultSet rs = statement.executeQuery();
            return rs.getBoolean(1);
        } catch(Exception e) {
            e.printStackTrace();
        }
        return false;
    }

i want to run this async, wasnt sure if you could async select queries

#

as someone else said they couldnt get it to work

obtuse gale
#

Right so what you really want is to be able to run that async, yet get the return value immediately on the method call

brittle leaf
#

its not possible is it

obtuse gale
#

No, to return the value immediately you need to wait until the query is finished

#

What you can do is issue a callback for when the value is available, and then do something with it

#

Easiest way is probably something like this

CompletableFuture.supplyAsync(() -> {
  /* query */
}).thenAccept(value -> {
  /* use value */
});
#

Keep in mind that by the time you process the value, the method you called all that from will have long exited

This isn't an issue if you're e.g. sending feedback, running command, those can be delayed without issues. But if you do need the value immediately e.g. in an event you want to cancel, you will either a) have to block until it's done, or b) use a cache and load things before they're used

brittle leaf
#

i just needed a method to store what blocks have been broken before so i can figure out if to give skill xp or not

obtuse gale
#

Yeah use a cache

#

10000%

brittle leaf
#

a cache?

obtuse gale
#

Yes, a cache

#

basically a Map you use to pre-store values before you need them because querying for them is expensive etc

brittle leaf
#

load the data from sqlite into memory and save them every so often and on plugin disable

brittle leaf
#

you cant use pdc on blocks that dont have tile entity data

obtuse gale
#

^

brittle leaf
#

im storing every block, every dirt, stone and gravel.

obtuse gale
#

I mean you could store the data in the chunk PDC, but not in the block itself

#

That's a good solution nonetheless

primal crystal
#

I would go for Chunk PDC rather than HashMaps

brittle leaf
#

i was thinking of having the data based on the chunk

brittle leaf
#

tho had no idea how to actually go about doing that

obtuse gale
brittle leaf
#

originally i just had a hashset of locations, if the location was in the hashset then it was modified by a player, it was removed on if the block was made by a cobblegen for example

primal crystal
brittle leaf
#

it worked fine, only issue is i had no idea how to store it.

#

i dont care who placed the block, im not logging that

#

its specific for if it had be modified by a player

primal crystal
#

You need it to be persistent?

brittle leaf
#

between restarts

primal crystal
brittle leaf
primal crystal
#

store the data of the set when you are shutting down the server...

brittle leaf
#

i couldnt get json to work that was the issue

primal crystal
quiet depot
#

gson is great

primal crystal
#

Try a file-system API something like SimplixStorage or any other lib...if you feel Gson is hard

obtuse gale
#

Hi @quiet depot Did you know HikariJSON is a thing?

viral grove
#

On Kotlin, Kotlin serialize works great for Json

obtuse gale
brittle leaf
#

so scrap using sqlite and use json?

viral grove
#

For Java, I've used Moshi and Jackson. Both work not too bad as well

primal crystal
primal crystal
obtuse gale
#

a json lib, allegedly fast, very fast

#

Really really fast

brittle leaf
#

i literally only was to read and write worldname,x,y,z. thats it. if json is faster then sqlite then ill take it

primal crystal
obtuse gale
#

For both cases I'd suggest loading in onEnable, saving in onDisable, use the Set anytime in-between and forget about the rest

obtuse gale
#

I wanna try it out, it's not like I really need hyperspeed json processing but still lol

primal crystal
obtuse gale
#

Oh you mean published in a maven repo, no clue

primal crystal
brittle leaf
#

i had the idea of on chunk load query the database and load the data from those specific chunks into the hashset and then on chunk unload save the data from those same chunks

#

ofcourse ondisable save all the chunk data

#

maybe an async save here and there

#

chunk x | chunk y | relational x y z | world

#

so 6 columns

primal crystal
#

yeah...you could do that in chunk load event...but still if using SQL it would be still be a a resonable load to the server if the server has a decent player size

brittle leaf
#

hmmm

#

then im not sure what to do

nocturne remnant
#

How can I send toast when a player logs into the server. For example, "TEST JOIN THE GAME"?

primal crystal
#

@nocturne remnant

nocturne remnant
#

How do I add an achievement toast?

wind patio
#

Fastest performance out there 🙅‍♂️ 🧢

sly sonnet
#

real chads dont need databases

wind patio
wind patio
#

Persistent data? Imagine

#

Temporary data? Real shit

wind patio
cinder flare
wintry plinth
#

I think I’d much rather go with SQLite over JSON too, if I was having to write to it

cinder flare
#

Flatfile scales rather poorly in my experience, plus it's just nicer to be able to use any database engine

wintry plinth
#

flatfile works amazingly (SQLite)

#

I was surprised

cinder flare
#

yeah, i misspoke, i kinda don't consider sqlite flatfile for some reason even though it objectively is

#

that and H2

wintry plinth
#

Ahhh right

cinder flare
#

SQL-based flatfiles are surprisingly good

#

but storing shit in YAML kills me

wintry plinth
#

Yeah I agree then, JSON I wouldn’t use especially for lots of data

#

Or even worse still

#

Storing fuck tons in 1 file

cinder flare
#

yeah if you really want JSON, go Mongo at least

quiet depot
#

flatfile

wintry plinth
#

Yeah

quiet depot
#

what is the definition

wintry plinth
#

A flat… file piggy smh

quiet depot
#

sqllite is a file, .db

wintry plinth
#

Jk

quiet depot
#

json is a file, .json

wintry plinth
#

But is it flat

quiet depot
#

is one human readable?

cinder flare
#

so SQLite has a whole thing about how it saves the stuff

marble plaza
#

Hello! Can anyone help me to get TPS?
This doesn't work: double[] tps = Bukkit.getServer().spigot().getTPS()

cinder flare
#

also it probably doesn't return an array

marble plaza
cinder flare
primal crystal
marble plaza
#

lol ok, thanks.

cinder flare
#

looking through all that JSON is going to make you want to commit die

primal crystal
inner umbra
#

Or use the blocks PDC.

primal crystal
#

i thought it would take much larger resource to query request

primal crystal
cinder flare
#

If they're making like a CoreProtect knockoff, would not be good to store it in PDC

#

to be fair, i have absolutely no idea what they're making

primal crystal
inner umbra
#

I only read "place block", "query", "sql", json"

#

Lol

cinder flare
#

haha

primal crystal
cinder flare
#

well if you want a list of all blocks placed by a player, it might be worth doing both

#

then you can tell if an individual block was, plus you have a queryable list as well

inner umbra
#

If you don't care who placed the block you can also just check if the block exists in the initial chunk generation.

cinder flare
#

oh pfft lol

primal crystal
inner umbra
#

I'm not 100% sure but yes I think something is possible.

primal crystal
inner umbra
#

It wouldn't be just 1 method. You would have to write something to get the initial blocks from the chunk generation. If it's not in that list it was placed by a player.

wind patio
#

🤓

wind patio
#

Fake channel

#

Can't enter

cinder flare
#

Cause you're not a dev 😉

wind patio
#

Lies

#

And you know it

#

🙅‍♂️ 🧢

wind patio
primal crystal
inner umbra
#

We got another one seeing stars. Take him to the asylum.

wind patio
primal crystal
#

😂

#

The name says it

obtuse gale
#

please help me
i have a plugin Leader Heads 3.1.8.3 And PlaceHolderApi 2.9.2, i create a hologram with top kills and deaths, but kill and deaths always stay in 0, i dont understand please help

wind patio
#

🙅‍♂️ 🧢

obtuse gale
inner umbra
#

"X Blue Hat"?

#

"Cross Hat"?

wind patio
wind patio
inner umbra
#

Did you want one? Like are you asking for it?

cinder flare
#

yea it's rainy outside and his hair is getting wet

wind patio
#

😩

inner umbra
#

Lol

winter iron
#

💯

#

The floor bruh the floor is getting wet chill out

quaint isle
#

I'm going to give my old laptop to my sister and need to purchase a new notebook as secondary device.

Its purpose will be software development, so it should be beefy enough to run Jetbrains software well (PHPStorm/WebStorm, DataGrip, etc.)
Should have 3+ hours battery life, 15" and not too chonky.

Any suggestions? Looking to spend less than $1000. Refurbished is fine too.

wind patio
#

I'd say get a one with good CPU, any modern one should be beefy enough

static zealot
#

oh no. I'd personally say get one without a CPU

wind patio
#

Reasonable size SSD would be a plus too

#

And you should well fit in the budget

static zealot
wind patio
#

Laptop suggestions can vary

#

Maybe they don't like X

#

And want more of a Y

#

It's better to know what you should look for in it

#

There are a lot of laptop models that are beefy enough to run intellij

oblique heath
#

get the framework laptop

#

it's fancy, repairable, upgradable, albeit a bit expensive compared to the mass market laptops

static zealot
#

just a tad

#

xD

oblique heath
#

you can get decent specs on it for ~1100 usd

static zealot
#

yeah. but he said he has less than 1k

oblique heath
#

then he can get slightly less decent specs for 1k 🤷

#

do you need help unclogging a drain

#

peeling potatos, perhaps

compact perchBOT
#
FAQ Answer:

Looking for discord support?
HelpChat is a Minecraft plugin and development support server and is not affiliated with discord in any way.
If you require support from discord, we recommend you to visit their official support website at https://support.discord.com
On this website, you can read their FAQs, or open a support ticket if necessary.

oblique heath
#

looks like you joined one too many l33t hacking servers

static zealot
oblique heath
#

1k is not a low budget

#

you can get a laptop that meets his criteria for less than half of that

static zealot
#

but he said he mentioned he would like to spend under 1k. the cheapest prebuild from framework is 1k.

oblique heath
#

the diy starts at 750

static zealot
#

I guess he could go DIY

oblique heath
#

the diy is fine, its like building a pc

#

just slap the components together

wind patio
#

He needs a laptop, not a pc

oblique heath
#

the framework laptop is a laptop

static zealot
#

it is a laptop xD

#

you get the parts and put them together. framework is a modular laptop

oblique heath
#

i am using correct terms

static zealot
#

what was not correct there?

#

you literally put it together like a pc

wind patio
#

Misread

static zealot
#

just its a laptop

wind patio
#

Yeah I know abt the framework laptop

oblique heath
#

i will never forgive your transgression

#

how dare you make a mistake

wind patio
#

Thought he was talking abt pc component slapping together

#

Banned

oblique heath
#

insta banned

wind patio
#

You have 24 hours to live use your account

#

🧢

static zealot
#

they're joking, we don't know. we're not discord

wind patio
#

Probably just a warning

#

Not to do that again

static zealot
#

yeah like M0ii said its probably just a warning for now

oblique heath
#

as long as you are not actively participating in the 'cybercrime' the message mentioned you're probably safe

#

you're not... right?

#

sounds like a pyramid scheme

static zealot
#

both of them

#

xD

wind patio
#

Doing crime.. on internet

#

Participating is the same

#

Endorsing

oblique heath
#

artin if you're this worried just talk to actual discord support like blitz said initially

static zealot
#

as they said in that warning, you should be reporting and leaving. or just leaving.