#dev-general

1 messages · Page 17 of 1

prisma wave
#

Hate when autocorrect just doesn't happen

obtuse gale
#

maybe pee happens in levels idk lol

prisma wave
#

Well yeah you have to have some constraints otherwise you'd never actually write any logic

#

Which I guess is actually fairly common in enterprise java

ocean quartz
#

In that case you can have Handler -> LevelHandler -> PeeLevelHandler

prisma wave
#

AbstractMegaPeeFactoryHandlerLevelBuilderSupplier

agile galleon
#

Handler -> ObjectHandler -> LevelHandler -> PeeLevelHandler -> PDCPeeLevelHandler

ocean quartz
#

Yes

#

And then you blink and end up here

prisma wave
#

Yeah it's also important to not go overboard

agile galleon
#

what would your hirarchy be for pee stored in pdc and sql

prisma wave
#

flat

agile galleon
#

so two impls of something

prisma wave
#

Well not flat

ocean quartz
#

Pee is stored in the pdc balls

agile galleon
#

and what would be in the api part and what only intern

prisma wave
#

Can we use a different name it's really hard to take this seriously

agile galleon
obtuse gale
#

it is not uncommon for when you make an API to think like "I want to expose the implementation without exposing the implementation" and so you just end up with a one to one mapping of the actual impl - this is quite common if you make the API after you make the system

agile galleon
#

UltraDiharrhea

prisma wave
agile galleon
#

i have never spelled this word correctly

obtuse gale
#

BallPeeStorage implements PeeStorage

#

guys keep chatting

#

please

agile galleon
#

okay

obtuse gale
#

or i will commit dkim and delete my messages

agile galleon
#

so what i got from the pee filled commets here

prisma wave
#

If you want a really good example of proper API design and abstraction look at rust (THIS IS A JOKE)

obtuse gale
#

bro

agile galleon
#

ObjectStorage<T> has functions set(T value, Player player) ->
PeeStorage implements ObjectStorage<Pee> (still an interface) ->
PDCPeeStorage implements PeeStorage (not exposed in API) overrides set(Pee pee, Player player)

obtuse gale
#

what are you saying 😢

solemn laurel
#

the mega pee handler ☹️

prisma wave
#

AAAAAA no I can't do it sorry that was a joke and sarcasm and a lie DO NOT

agile galleon
#

hm

#

yea

obtuse gale
#

ObjectStorage

#

hmm

#

Storage perhaps

agile galleon
#

PlayerStorage maybe

prisma wave
#

Yeah I was thinking playerstorage

agile galleon
#

storage is kind of fishy in my opinion

ocean quartz
#

AttributeStorage perhaps

solemn laurel
#

who thought pee was a good idea, i cant take any of these seriously now even though theyre legit ideas

prisma wave
#

Well if it's a supertype of PeeStorage maybe it should be FluidStorage

obtuse gale
prisma wave
#

Then we can add support for other fluids down the line

solemn laurel
#

other fluids 😨

obtuse gale
#

stop right there

prisma wave
#

such as

obtuse gale
#

no

#

none

prisma wave
#

blood

agile galleon
#

no

#

pleae

prisma wave
#

water

#

And uh

obtuse gale
#

MongoDatabase fluid

solemn laurel
#

what are the other implementations of BodilyFluid

prisma wave
#

Saliva

#

Bile

ocean quartz
#

Sweat

obtuse gale
#

hair

prisma wave
#

Hydrochloric Acid

#

Insulin

solemn laurel
#

hair implementing bodilyfluid is something you'd see in the support channel here

obtuse gale
#

yes

agile galleon
#

diarrhea

prisma wave
#

I bet hair follows fluid dynamics

agile galleon
#

DiarrheaStorage

#

sounds wrong

prisma wave
solemn laurel
#

the whole point of diarrhea is there is no storage

agile galleon
#

there is

#

but once you call FluidStorage#flush

#

the server crashes

ocean quartz
#

Alright folks this was interesting before, but now it's goodbye

prisma wave
#

oh we forgot cum

#

And yes goodbye

obtuse gale
#

NOOOOO

agile galleon
#

i thought we were an enough mature server to avoid it

#

thought wrong

#

well thenk you guys for enlightening me

solemn laurel
#

you mean this conversation was your fault?

agile galleon
#

also by the way the kentucky anthem states that people become gay

agile galleon
#

and yes it partially was

#

especially because the last half was based around pee, how to store pee and other questionable bodily fluids (and how to store those)

prisma wave
solemn laurel
#

guys talking about "partially"

obtuse gale
#

why is your brother inside christ?

agile galleon
#

not yet

#

also this

#

i mean, id still respect him but he gotta tell me beforehand

#

christ was my friend

#

oh no

#

i have something sinful on my mind

prisma wave
#

very pious

agile galleon
#

i hope no religous people here

#

because

prisma wave
#

I wouldn't worry too much, you're already going to hell for the pee plugin

half harness
#

it is a good idea

#

unique idea

agile galleon
prisma wave
solemn laurel
#

whats the difference between hi and hi

prisma wave
#

?

agile galleon
#

i can see it but i cant

solemn laurel
#

``hi`` vs `hi`

agile galleon
#

your mom

#

jk

prisma wave
#

nothing

solemn laurel
#

ah

agile galleon
#

exactly

half harness
#

whats the difference between hi and hi​

agile galleon
#

your dad

#

okay ill stop

half harness
#

👏

agile galleon
#

hi&ZeroWidthSpace;

#

hehe

#

shit

#

okay wat

half harness
#

@prisma wave hi

agile galleon
#

ik you put a unicode thing there

prisma wave
#

WHAT do you want

agile galleon
#

i know it

#

i can feel it

half harness
agile galleon
#

in my balls implements PeeStorage

prisma wave
#

@half harness

agile galleon
#

if anybody wants to make MegaPee or any affiliates reality, contact me and ill license you the idea

prisma wave
#

I'd sooner drive off a bridge

ionic gust
#

imagine not uploading ur plugin on github, modrinth, polymart, spigot, and bukkit

solemn laurel
#

its going on mediafire with no description

ruby dew
agile galleon
#

Adds realism to minecraft

#

So the actual character has to pee

ruby dew
#

if you had told me any sooner i would have got it done right away lol
had quit minecraft 1-2 years ago

tranquil crane
#

I didn't mean to start a war on API conventions oops

midnight isle
#

hello

#

where can i ask for help ?

#

from people

tranquil crane
midnight isle
#

ty

tranquil crane
obtuse gale
tranquil crane
#

apparently yeah lol

#

ok how do we feel about Impl at the end if it's just going to be a single implementation

wintry plinth
tranquil crane
#

like StackedEntityImpl implementing the StackedEntity interface which is exposed to the API

#

because I absolutely refuse to do IStackedEntity for the api version

wintry plinth
#

I use I even tho it looks odd

tranquil crane
#

I think it looks incredibly cursed when all you see in an API is just a ton of I classes

solemn laurel
#

i thought I notation was used for C# mostly

tranquil crane
#

Generally yes C# still uses it which is also cursed

solemn laurel
#

at the place i interned we used that everywhere xD youd hate it

tranquil crane
#

Used it a ton at my last job too :L

#

we also prefixed method parameters with p

half harness
#

what

tranquil crane
#

now that is the worst

obtuse gale
#

I feel sorry for you

solemn laurel
#

is that a thing

tranquil crane
#

for c# yes it's an actual convention we worked with

#

I don't think it's in the official microsoft conventions but it's at least a decently common enough one

solemn laurel
#

we should start a fake convention and pass it on to as many people as possilbe

#

like a global G notation

half harness
#

all static variables start with s_

#

👍

tranquil crane
#

sounds good to me

solemn laurel
#

all variables are static 🙂

tranquil crane
#

public static int Gs_Global_Variable = 17;

solemn laurel
#

oh god

#

shes combining techniques

tranquil crane
#

no final to make it extra cursed

half harness
#

public static int Gfs_Global_Variable = 17;

#

f = final

#

s = static

#

and G = global

tranquil crane
#

marked final while still not actually marked final

#

that's even worse

solemn laurel
#
>>> five = 5
>>> print(five)
5
>>> five, print, = print, five
>>> five(print)
5
>>> print(5)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'int' object is not callable
>>>
obtuse gale
solemn laurel
#

are you norsk

half harness
#

IUserAPIInterface

obtuse gale
#

Nope

tranquil crane
#

IUserAPIInterfaceFactoryBeanFactory

solemn laurel
#

<Doubleton>

half harness
#

Tripleton<

tranquil crane
#

boom api classes

#

how do we feel about modules being capitalized like that

ruby dew
#

ok

tranquil crane
#

I feel like the capitalized modules are going to annoy somebody

ruby dew
#

take it further by making everything capitalized

#

you can do it

tranquil crane
hard dagger
#

the convention is kebab case

#

😠

ocean quartz
#

I feel like C#'s conventions was done by a guy that thought to himself "what if we took all the worse conventions from every language and used it"

old wyvern
#

chatgpt not opening up for anyone else?

ocean quartz
#

Works for me

ruby dew
#

chatgpt is disabled in my region sad

old wyvern
#

ah rip

static zealot
#

😭

#

someone help me. he is so right

solemn laurel
#

Waiting for my professors to catch up with the world and realize 90% of their homework’s can be chatGPT’ed

queen saffron
#

Shh don't tell em

obtuse gale
#

Or do and cause havoc ablobcatnomblobcatparty

solemn laurel
#

we'll have in-person exams for every class

humble silo
#

Lol

obtuse gale
#

good

tranquil crane
#

be annoyed

#

I'm gonna change them to all lowercase because it's started to annoy me more

ocean quartz
#

Good

#

While you're at it lowercase repositories name on github too ;p

sweet cipher
#

You’re supposed to reverse the case of the names

#

Like hooK

#

And plugiN

tranquil crane
#

the artifactId is still rosestacker but the project name will remain RoseStacker because it looks better >:(

distant sun
#

Nicole, does rose stacker stop wither skeletons from spawning in nether from skeleton spawners, or zombie villagers from zombie spawners?

distant sun
#

@tranquil crane bop

obtuse gale
#

@tranquil crane bop

tranquil crane
distant sun
#

what about zombie villagers?

tranquil crane
#

it only spawns the original entity type out of the spawner and doesn't change it based on the location or randomness

distant sun
#

fair

tranquil crane
#

things like sheep colors are randomized but I wasn't aware vanilla spawners would do that

obtuse gale
#

what's rosestacker exactly?

tranquil crane
#

mob, item, spawner, and block stacking plugin. block stacking for skyblock mostly, mob stacking I generally only recommend for spawner mobs to reduce gameplay impact

obtuse gale
#

not the mob stacker!

tranquil crane
#

I know the community generally frowns upon mob stacking plugins which is why I only really recommend using it to stack spawner mobs

obtuse gale
#

uuh

#

spawners also have its own limiting thing

tranquil crane
#

well some communities, idk about this one specifically

obtuse gale
#

like they won't spawn any more of the entity when there are X amount of them within Y radius

distant sun
#

many servers are highly based on spawners + relocation, so 😬

tranquil crane
obtuse gale
#

okay nice

tranquil crane
#

it's also a full spawner plugin allowing customizing conditions/timings and stuff

tranquil crane
distant sun
#

yes

tranquil crane
#

are java 9 modules worth using

obtuse gale
#

not in a plugin

#

it will only make things worse

tranquil crane
#

understandable

#

good enough answer for me

obtuse gale
#

in any other real world project 100000%

half harness
#

what does it do?

obtuse gale
half harness
#

alr

obtuse gale
#

i don't really feel like going all over it again

distant sun
#

Long-story-short: It is nice

obtuse gale
#

long story short

#

good things

#

stuffs

tranquil crane
#

this brings me pain

#

I don't know what else to name them

prisma wave
#

getting deja vu here

distant sun
#

remove the Impl suffix?

tranquil crane
#

the interfaces are named BlockStackSettings etc

#

I guess I could just remove the suffix but then the names would be the same

distant sun
#

ah I thought it is just BaseStackSettings

tranquil crane
#

o no the basestacksettings implements stacksettings lol

#

I'm breaking the project out to use interfaces for the new api layer

distant sun
#

I couldnt bother more so I went with Impl as well xD

tranquil crane
#

welp alrighty

#

I have to do it for another 5 classes too

#

it just feels a little clunky

distant sun
#

the I prefix on the other hand is 🤢

tranquil crane
#

The I prefix is far worse

#

imagine opening an api for the first time and everything is just prefixed with I, disgusting

distant sun
wind patio
#

it doesn't look as bad now, but when I teleport to a player I have to wait like 10 seconds for it to load

half harness
#

slow CPU?

#

server

urban sleet
#

Pregenerating the world should help

wind patio
#

it's pregenerated

#

I think the issue is the server is very slow at sending the chunk data to the client

wind patio
prisma wave
#

i remember that was an issue ages ago when 1.18 (?) had just released

wind patio
#

yeah I forgot to mention, it's 1.18.2

#

paper

prisma wave
#

latest?

wind patio
#

wait no, not paper

#

pufferfish

#

fork of paper ig

tranquil crane
#

dang that's slow slow for a 3900x

#

I have the same cpu and chunks basically load instantly

wind patio
#

these seem to be fine

tranquil crane
#

is the server using a HDD or an SSD

wind patio
#

SSD

half harness
#

what is the tps

#

when loading chunks

tranquil crane
#

a spark report would likely give a pretty good idea of why it's so slow

wind patio
#

well it's 130 players online, TPS is pretty stable at 20`ish

tranquil crane
#

stable 20 with 130 players is rather impressive

wind patio
#

MSPT sometimes is a bit bigger than I'd want but for the most part it's fine

tranquil crane
#

that loading speed is abysmal though, could you run a spark profiler and load a bunch of chunks?

wind patio
distant sun
#

damn

wind patio
#

https://spark.lucko.me/83xhCB2q6b
that's 30 second of me trying to load chunks (probably other players too)
I can do a longer one if needed.

spark is a performance profiler for Minecraft clients, servers, and proxies.

wind patio
half harness
#

btw update spark on your next restart 👍

tranquil crane
#

12% spent by hoppers moving items around, plugin usage looks mostly good other than NCP being a cpu hog as per usual

tranquil crane
#

as for the chunks since paper does them async they don't even show up on the spark report FacePalm

half harness
#

the CPU is only 7%

#

so there's enough room for paper to do chunks async

tranquil crane
#

yeah that's weird that the chunks would be going that slowly if the cpu is that low

half harness
#

the ping is also low so it's not an issue with internet/sending too many packets

tranquil crane
#

and you have aikar's flags so idk what's going on there

#

that 206mspt is a bit sus

#

give me a minute to remember how to use that plugin properly

wind patio
#

They have a guide on their web

tranquil crane
#

/spark profiler --timeout 30 --only-ticks-over 75

wind patio
#

yeah I remember using this one

tranquil crane
#

that still probably won't help show why the chunks are borked

wind patio
tranquil crane
#

do I even want to know what this is

wind patio
#

a plugin

tranquil crane
#

I'm going to pretend I didn't see that percentage

half harness
#

File IO on main thread 🤔

distant sun
#

old combat mechanics 😬

tranquil crane
#

that plugin caused the entire spark report to go wack

#

welp either way doesn't tell anything about the chunks unfortunately

wind patio
distant sun
#

lame, but I feel you

obtuse gale
tranquil crane
#

is there a chunk limiter per tick or something that's causing it to slow down massively like that

#

cpu was still at only 10% so something else has got to be throttling it

wind patio
tranquil crane
#

It seems weird that they're calling that manually since it's run in the PlayerQuitEvent, shouldn't that data just be saving on its own thonk

#

it seems redundant to call that

wind patio
#

I might just go play around in the test-server and disabling plugins one by one
then again, the environment wont be the same, since it won't have that much players online lol

tranquil crane
#

There is apparently a chunk rate limiter built in somewhere

#

could you share what you have for those in config/paper-global.yml

#

those are the settings for 1.19.3 so idk how much is gonna be different from 1.18.2

wind patio
#

I don't have config folder in root dir

tranquil crane
#

uh it might just be paper.yml on your version

wind patio
#

probably

distant sun
#

yeah

tranquil crane
#

I'm guessing since you have so many players on it might be hitting one of the throttle caps

wind patio
#

kinda lost on what's and why it's happening

tranquil crane
#

why must java generics allow return values to be subclasses of the interface but it doesn't work with generics screams

potent nest
#

because that wouldn't be sound

#

if that works, I could put a StackedEntityNotYourImpl into your map, now what happens if you try to read it as StackedEntityImpl again?

obtuse gale
#

question mark extends stacked entity

#

Alternatively, just return a Function<? super UUID, ? extends StackedEntity> trollface

potent nest
#

smort

obtuse gale
#

uhm actually it would be a PartialFunction? 🤓

potent nest
obtuse gale
#

pleading_face_with_3_hearts

prisma wave
#

Function???

obtuse gale
#

Excel is the most used FP language

prisma wave
#

True!

obtuse gale
#

According to SPJ

prisma wave
#

I love spj

obtuse gale
#

dude

#

that's gay

prisma wave
#

No it's not?

#

Why is it

wind patio
#

it's !not

prisma wave
#

Oh, i see.. I guess you're right then

solemn laurel
#

when chatgpt makes the plugin and midjourney makes the logo

#

and my only job is to slap the $400 paywall 😉

prisma wave
#

u forgot to add the command to plugin .yml

#

oh

#

guess im talking to myself

#

the voices the voices the voices the voices the voices

rugged spear
#

its thtat the right channel?

#
  core:
    description: core command
    usage: /core```
#

anywya i did it

prisma wave
#

no but it's ok i forgive you

#

is for support

rugged spear
#

alright

ionic gust
#

@half harness what is roboref

ruby dew
#

satisfying too

#

i need permission to use this as my pfp

#

like pls

#

this pic is priceless

ionic gust
ruby dew
#

oh its literally the plugin you are showcasing lol

ionic gust
#

LOL

ruby dew
#

but dude this pic is so damn cool

#

and funny as hell

ionic gust
#

here's the original steve:

ruby dew
#

ohhhhhh

#

did you make this lol the hand steve

#

or its just a meme

ionic gust
#

i just googled "steve with hand out" 💀

ruby dew
#

oh alr cool

#

thx lol

#

guess i will take that

ionic gust
ruby dew
#

yeah just searched it up lol

#

the plugin is cool too

ionic gust
#

which gets u this:

ionic gust
#

new update gonna be epic with block pushing

ruby dew
#

like you are basically a tornado and blocks revolve around you

#

that would be cool too

ionic gust
#

that gives me an idea

#

inverse forcefield 👀

ruby dew
#

or blackhole

#

lol

ionic gust
#

lmao that pfp

#

its priceless

ruby dew
#

yeah lmao

#

coolest pfp 2023

ionic gust
#

btw how'd u find forcefield plugin? out of curiosity

ruby dew
#

just got on to spigot then found your plugin in the last update category

ionic gust
#

ooo nice ok

ruby dew
#

i mean i have no reason to not click on it

#

with that pic lol

#

plugin turns out to be really cool too

ionic gust
#

:)

half harness
#

who is this steve

#

tier 2

ionic gust
half harness
#

true

#

:(

#

i need a new profile picture

ionic gust
half harness
ionic gust
#

mhm

ruby dew
ionic gust
#

L dkim

half harness
#

it took me a whole minute to realize who you were

#

because i look at pfp

#

not username

#

I need pfp

ruby dew
ionic gust
half harness
#

😮

#

omg

#

is this good

ionic gust
#

no

#

i will make

#

just wait

ruby dew
ionic gust
#

hang on i need to crop it

half harness
#

nooo it can't be mc related

#

I want to detatch from mc

ionic gust
#

u have to use it, or else ur hurting my feelings :(

ionic gust
ruby dew
#

its a tofu head

ionic gust
#

yeah whatever tofu is

half harness
#

it doesn't fit

ionic gust
#

ok

ruby dew
#

any chance for transparent background

half harness
#

^^

#

sorry I can only use transparent or full backgrounds

#

white space bad

ruby dew
ionic gust
#

its a little bit distorted but here u go:

#

it adds character

#

its like a slime animation

#

@ruby dew https://www.spigotmc.org/threads/forcefield.583836/#post-4522920

New update coming soon that'll feature:

  • Block pushing (maybe don't use this on production... lmao)
  • Inverse forcefield, will make the forcefield pull targets instead of pushing them
  • Some backend/internal improvements
    Maybe coming in the future:
  • Special forcefield types, such as tornado, which will make targets revolve around you
ruby dew
#

you actually did it lmao so quick

ionic gust
#

i havent done tornado yet

#

that will probs take a day of attempting, a day of crying, and then a day of completing

ionic gust
half harness
#

my schedule:
day 1: procrastinate
day 2: procrastinate
day 3: get 5% completed
day 4: repeat

ionic gust
ionic gust
#

ok now inverse should be done

#

@ruby dew 💀

#

oops

#

i sent msg before video was done processing

ruby dew
ionic gust
#

im adding so many security measures to make sure ppl cant get access to blocks by cheating or smth

#

theres a config list of players who can use blocks, instead of a permission

#

and an enabled toggle in config too

ionic gust
#

still gotta do some final tests

half harness
sweet cipher
#

Same, do you live in Australia?

tranquil crane
#

turns out you can just do this and it works for some reason FacePalm

#

I have no clue how the type inference works anymore

sinful geyser
#

so im a little confused event.getClickedInventory().getTitle() isnt working for me anymore how do you get the title of an inventory?

potent nest
wind patio
distant sun
wind patio
drifting yoke
#

I'm making an app like AirBnb. When the logged in user opts to check one's rating should I create a User object at that moment or what?

prisma wave
#

huh?

drifting yoke
#

It's java so it's weird

#

Like when the user clicks on a profile which is a username

#

Should I create a User object at that moment so I can fetch all the info?

#

or should I just grab piece by piece from the file and not bother making an ojbect

prisma wave
#

what is "the file"?

#

seems more like it would be doing a database / backend query if anything

#

to get the user info

drifting yoke
#

There are going to be files, like yml (It's a uni project so we're not using any dbs)

prisma wave
#

okay, well still effectively a database

#

a store of data

drifting yoke
#

Everything is going to be a rep on github so I can't access servers for databases

#

It's going to be just a sample with like 10 users

prisma wave
#

i dont see any correlation there but ok

#

even so, definitely just load a user object

drifting yoke
#

Oh yeah, a database by means

prisma wave
#

your ui code shouldnt have any idea where the data is coming from

drifting yoke
#

So I have this log in format where a user logs in and there's a method getActiveUser() that's why I don't bother makign more User objects

prisma wave
#

it should just be able to call some method to get a User from a username and then use the data stored in the user object

drifting yoke
#

Hmm, okay, what about Buildings? I have made a BuildingManager class where it stores all the accomodations

#

So its basically a List of accomodations

prisma wave
#

yeah again, UI code should have absolutely zero knowledge of the underlying database (or lack of). it should just be able to lookup an object from the controller layer and render / modify its data

drifting yoke
#

Yeah, I'm working on the API for now, trying to make sure that the UI won't have to implement any logic

prisma wave
#

yeah i can't really be more specific without more knowledge of the stack you're using but you may wanna look into the MVC architecture for a good way of structuring your backend

drifting yoke
#

But, is it fine if I store all the Buildings in a List or should I go on the same path as the Users

prisma wave
#

uh

#

wdym?

#

store it in a list where?

drifting yoke
#

As I mentioned, I have a BuildingManager class that instantiates all the Buildings once the program is running

prisma wave
#

oh so internally

drifting yoke
#

Yes, but is that a bad idea or should I just instantiate a building object whenever needed?

prisma wave
#

I'm a little confused by your use of the word "instantiate" - if you're loading things from a database, typically you want a single object per database entity (or as few as possible) whereas you seem to want to create new ones every time

#

if they're mutable objects then you definitely want as few instances as possible

drifting yoke
#

So, It's a Building class where I just create an object for every different Building stored in the database

prisma wave
#

Well yes

#

but that's different to "instantiat[ing] whenever needed"

#

i see what you mean though

drifting yoke
#

instantiating I meant fetch the info then create the object

prisma wave
#

yeah

#

anyway you likely want some form of caching, on a larger scale it's probably not a good idea to load all the buildings at once (as there could be billions), so a Map is probably the best underlying structure as it'll let you query by ID faster. if you don't need that, a List is fine but a Set would be slightly better for the uniqueness guarantees imo

drifting yoke
#

A Map? How could i implement the map

prisma wave
#

do your Buildings not have an ID / primary key?

drifting yoke
#

Yes they do

#

The map would consist of?

prisma wave
#

Map<Id, Building>

drifting yoke
#

But still, making so many objects is practical?

prisma wave
#

sure

#

the only thing you may wanna consider is lazily loading them rather than doing them all on startup

#

but that might not be practical depending on ur architecture

obtuse gale
#

oh

#

new javadoc generation is a tad nicer on mobile

#

very nice

drifting yoke
#

If I make them seriliazible objects do I need to convert them into an object before being able to fetch any info?

prisma wave
#

?

drifting yoke
#

I'll serialize the objects so I make them into a file all at once then in order to get it back I need to call it

#
FileInputStream fi = new FileInputStream(new File("myObjects.txt"));
            ObjectInputStream oi = new ObjectInputStream(fi);

            // Read objects
            Person pr1 = (Person) oi.readObject();
            Person pr2 = (Person) oi.readObject();
distant sun
drifting yoke
#

Which library should I use for json?

half harness
drifting yoke
#

I'm not coding a minecraft plugin rn

#

But I'm going with gson

#

Also, I have a question. What happens when I save an object in json file that has other objects in it?

prisma wave
#

depends on how you're writing the file

#

but it'll likely overwrite

drifting yoke
#

Like I have a file for Building which I'll convert to json
But building has an object inside it BuildingAttributes which has some Strings and Lists of Stirngs

#

Will it "deserialize" the object on its own?

prisma wave
#

gson will yes

drifting yoke
#

Is there a way to give the files the name I like?

prisma wave
#

yes?

drifting yoke
#

How!

prisma wave
#

the important thing to realise is that converting to/from json is an entirely separate process to reading/writing to a file

#

so you're responsible for the file handling

drifting yoke
#

Can't I write with gson?

prisma wave
#

which is why that's an odd question to ask

drifting yoke
#

But

#

When i create the file with json

#
        gson.toJson(user, new FileWriter("/data/users"));```
prisma wave
#

you can, in that there are methods that use a FileWriter but you're still responsible for actually making a file name

#

it doesnt just magically come up with a name

drifting yoke
#

oh so I need to include it on the FileWrite?

#

/data/users/username.json ?

prisma wave
#

yes

drifting yoke
#

Thanks Brister!

prisma wave
#

np

#

also

#

make sure you close the FileWriter

drifting yoke
#

How will i do that since im creating an instance on the spot

#

.close()?

prisma wave
#

easiest way would be try-with-resources

#

dont create it inline

#

create it in a twr and it'll get closed automatically

drifting yoke
#

Doesn't it close automatically the way I did it?

prisma wave
#

no

drifting yoke
#

That's how it has it on the blog I'm reading

#

Also, another question. I want to have different types of Buildings. Should I make them enums or subclasses?

#

For the users I have made two subclasses one for Guests another one for Providers

prisma wave
#

subclasses is certainly a more OOP way

drifting yoke
#

It's just weird because, how do I fetch, how do I instantiate object?

prisma wave
#

?

drifting yoke
#

Like I know it's a building object but I don't know what subclass object im creating when im fetching it from json

prisma wave
drifting yoke
#

I can't know whether it's a Bangalow or a Mansion

prisma wave
#

well hang on

#

if the 2 types are identical apart from a "tag" then you may as well use an enum

#

there's no real benefit to having subtypes there

drifting yoke
#

Hmm then what about the case of User

#

In the Provider class there are extra stuff like a list of buildings the provider owns

prisma wave
#

really that seems like bad design

#

a user could be a guest and a provider

#

they're not mutually exclusive

drifting yoke
#

In the project our professor mentions that the User is either guest or a provider. If he opts to be a provider he needs to have access to extra possibilities like Add Accomodation or Remove Accommodation

prisma wave
#

ah okay

#

well in this case you can use RuntimeTypeAdapterFactory which will let you add "tags" for each of the subtypes

#

eg ```java
RuntimeTypeAdapterFactory<Animal> runtimeTypeAdapterFactory = RuntimeTypeAdapterFactory
.of(Animal.class, "type")
.registerSubtype(Horse.class, "horse")
.registerSubtype(Cow.class, "cow");

Gson gson = new GsonBuilder()
.registerTypeAdapterFactory(runtimeTypeAdapterFactory)
.create();

drifting yoke
#

Where does that code go?

#

To the file manager?

#

Is it like an extra field that I'm saving?

prisma wave
#

Yes

drifting yoke
#

I'm really confused with this adapter thing

prisma wave
#

It just adds an extra field to mark which subtype it is

drifting yoke
#

So what code do I need to implement in my subclasses then?

#

Oh no code?

#

It saves the subclass automatically in the json file

#

and when I fetch do i need to have 2 different methods for the User Type?

#

hmm that wouldnt make sense

prisma wave
#

?

drifting yoke
#

When I fetch the file

prisma wave
drifting yoke
#

When I do the deserialization to get the object

#

how do I know which subclass to cast it with

prisma wave
#

you don't need to cast anything

#

and gson knows from the saved subclass

drifting yoke
#

I do User user = ... and it just returns a Guest?

prisma wave
#

yes

drifting yoke
#

Btw how do I make sure that an actual User object never instantiates?

prisma wave
#

make it an abstract class

drifting yoke
#

Abstract classes can have instances tho

prisma wave
#

No they can't

drifting yoke
#

Oh

#

Why do I remember my professor saying "making them abstract classes gives you the option to instantiate but interfaces dont"

prisma wave
#

They probably meant that you can define constructors for an abstract class

drifting yoke
#

oh yeah youre right

prisma wave
#

There are also anonymous subclasses but those are possible with interfaces too

drifting yoke
#

Like creating a class in the class?

prisma wave
#

no like java new Blah() { @Override blah }

drifting yoke
#

Huh? What's the difference with

class Subuser{}



}```
prisma wave
#

Anonymous subclasses, as the name suggests, don't have names

#

So they only exist once

solemn laurel
prisma wave
#

No they're not

solemn laurel
#

oh

drifting yoke
#

what are anonymous classes used for

prisma wave
#

Mainly lambdas

#

You don't see them in the explicit form too much nowadays

drifting yoke
#

oh yeah i know lambdas

#

but that seems strange

solemn laurel
#

i use them to create small runnables

prisma wave
#

Yeah lambdas are just syntax sugar for anonymous subclasses of the functional interfaces

drifting yoke
#

for example you can do foreach(t ->)

#

does that create an anonymous class or what

prisma wave
#

yes

solemn laurel
# prisma wave No they're not

what do you mean by this it confused me, is "subuser" not a nested non-static class? sorry dont mean to having you answering two lines of questions at once xD

prisma wave
#

My bad

solemn laurel
#

no worry

prisma wave
drifting yoke
#

What's annoying about my java course is that our professor show us how to code in java and the general way around it but won't show us details like lambdas and stuff, or teach us ways to organize a project but straight up ask a whole AirBnb app from us

#

I don't remember what Consumer does tbh

solemn laurel
#

i swear

prisma wave
solemn laurel
#

we have no education on devops or design patterns (at my school)

#

this is why it took me the whole day to get worldguard dependency xD

drifting yoke
#

so T is naturally the object inside the list i'm using foreach?

prisma wave
#

T is a generic type representing whatever the list elements are

drifting yoke
#

Yes that's what I meant

prisma wave
#

List<String> -> T = String

#

Yeah

drifting yoke
#

Great

#

So, I create a RTAFactory, I create a Gson the gson builder then I save the User user type and it automatically detects its a subclass and saves the type?

prisma wave
#

Yes

drifting yoke
#

Great thanks Brister

#

Any idea how to add the gson extras in my project ?

wind patio
#

small question for IJ IDE experts here
I have two projects, as shown in the image.
One is the root project (M0-Pagrindai) and the other one, module M0-PagrindaiDC.
In the root settings.gradle there's a line
include 'M0-PagrindaiDC', what that does is includes the compile output into the root project. I don't want that, but I still want to be able to build the both projects independently. If I remove the include .. part, then everything breaks

half harness
#

using implementation

#

typically you don't have an src in the base module if you have submodules too

wind patio
#

well, maybe there are some IDE tricks that I don't know that does the magic, wasnt sure, but anyways
I am, in fact, using shadowjar, but it's compileOnly, not implementation

#

yeah, well, I wasn't sure how to properly do it and so it happened I made a submodule

half harness
#

odd

#

by default I don't think it should be shading it in

ocean quartz
#

Hard to tell without seeing the gradle files

wind patio
#

yeah well I'm currently ripping my project inside-out, gonna re-do everthing, lol

wind patio
#

I tried connecting to a server that's running in an oracle vps instance, but had no luck.

obtuse gale
#

eeeeeeeeeeeeeeeeeeeeeeeeeeeee

prisma wave
#

i lied

prisma wave
#

i know

#

but

#

semantically they are

obtuse gale
#

eeeeeeee

#

okay

#

neither but okay

prisma wave
#

why not

#

is there any difference apart from performance between the two?

obtuse gale
#

let's say lambdas are a stronger form of anonymous classes

old wyvern
prisma wave
#

apart from performance

solemn laurel
#

syntactic cocaine

hard dagger
hard dagger
solemn laurel
#

thats the cocaine part

hard dagger
#

Lmao

obtuse gale
#

it uses ASM to generate a new class so a class is being loaded anyway

#

🤓 but that's implementation detail and may not always be like that

#

not like loading a single class is going to make a huge difference in performance anyway

hard dagger
#

Interesting

#

What optimizations does it do then?

obtuse gale
#

idk about other jvms but hotspot at least is able to do "singleton lambdas"; in both cases (anonymous classes and lambdas) you end up creating a new instance every time they're used, but on hotspot, if the lambda takes no captures the jvm will basically cache the instance as a singleton and reuse it
e.g. s -> System.out.println(s) can be optimised in that way, System.out::println cannot (var out = System.out; Consumer<String> c = s -> out.println(s);, out is a capture variable) (also in this latter case, an Objects.requiresNonNull(out) check is performed at every call as well)

distant sun
#

Question: Metod reference is just a thing for the user? Like, at compile time it will be the same as x -> methodThatTakes(x) or are they evaluated differently?

obtuse gale
#

it depends

#

Type::method would be the same as t -> t.method() / t -> Type.method(t)
variableOrFieldOrThis::method isn't (see above)

distant sun
#

The first case, t.method() / Type.method()

quiet depot
old wyvern
#

Happy new year!

prisma wave
wind patio
#

well, I added TCP/UDP,
then I added all, still no luck

#

This is as far as I get

prisma wave
#

interesting that it's timed out rather than refused

#

curious...

potent nest
#

Sounds like it doesn’t get a response

obtuse gale
#

Is the port on the OS firewall open? iptables or what has you

wind patio
#

well, I added the port via ufw, still no luck. probably still missing something

#

also, wut

prisma wave
#

i think oracle doesnt use ufw

#

iirc i had the same issue

wind patio
prisma wave
#

u need to use iptables as well as the web firewall

#

iirc

#

Running Uncomplicated Firewall (UFW) on Ubuntu images might cause issues with these rules. Because of this, we recommend that you do not enable UFW on your instances.

wind patio
#

well, I disabled the ufw, and I removed the iptables via
sudo cp /etc/iptables/rules.v4 /etc/iptables/rules.v4.bak && sudo truncate -s 0 /etc/iptables/rules.v4

prisma wave
#

well you need to use iptables to allow the port lol

#

does telnet <ip> 5005 do anything?

mint tusk
#

yo

prisma wave
#

hello

mint tusk
#

please help me

#

my minecraft keeps crashing

wind patio
#

am I dumb or what

mint tusk
#

idk what to do

#

can someone please help me

prisma wave
prisma wave
mint tusk
#

alr

wind patio
#

sudo iptables -I INPUT -p tcp -m tcp --dport 5005 -j ACCEPT did the job

prisma wave
#

splendid

wind patio
#

cool, finally managed to connect lol

#

this saves so much headache

mint tusk
#

yo

#

@prisma wave

wind patio
#

pingpong

mint tusk
#

i need to send a picture

#

of my problem

wind patio
#

you can upload it to an image service

#

and paste the link

mint tusk
#

what image service

wind patio
#

imgur?

#

etc.

#

if it keeps crashing the logs would probably tell you more than us seeing a screenshot

mint tusk
#

do you see

wind patio
#

well it clearly says it's an issue with drivers

mint tusk
#

yeah

#

well

#

how to fix

wind patio
#

usually you fix by downloading correct and working drivers

#

or it's an issue with your graphics card and you might not be able to solve it. (not a certified technician here, might not be the case)

obtuse gale
#

isn't ufw literally just a wrapper around iptables?

#

in any case it works fine for me lol

prisma wave
#

yeah idfk

#

but

#

¯_(ツ)_/¯

#

ufw didnt work for me

#

back when my account wasnt banned

#

😒

obtuse gale
#

haha

#

imagine getting your account banned

#

I would never

dry panther
#

hello

half harness
prisma wave
#

no

half harness
#

Weird

#

I used ubuntu

#

And it works fine

dry panther
#

how do i fix EzRankupPro rankup per group? to make not reset by Luckperms group?

half harness
#

Make sure u port forwarded

#

Or not port forward

half harness
#

But the firewall on wrbsite

half harness
dry panther
#

Mb

ocean quartz
#

Solution to the whole problem of finding the right name for implementations of interfaces, just ask ChatGPT pepelaugh

pastel imp
#

someone somehow make this an intellij plugin xD

prisma wave
#

?

obtuse gale
#

yeah it's called github copilot

agile galleon
#

with comments or

half harness
#

yes

agile galleon
#

damn

half harness
#

or just writing code and it'll autocomplete

#

like ```kt
fun doSomethingCool()

agile galleon
#

yeah ive used that feature

prisma wave
#

copilot should say :nokotlin: when you try that

agile galleon
#

-.-

#

funny mitten

obtuse gale
#

it wasn't a joke

sweet rune
#

When im using the Flame particle it creates like a explosion instead of just staying in place (trying to make a flame circle around a player). is there a way to fix this?

solemn laurel
#

set the speed of the particle to zero. oops, someone already answered in a diff chat

dense dew
prisma wave
#

no it shouldnt

obtuse gale
#

more like crap language

prisma wave
#

yes!

pastel imp
#

Stupid question that will become even more stupid after you read it. Any way to "force use" mongodb in a public plugin (or plugin that I am not able to change) that uses mysql? In some way "translate" it to mongodb?

PS: this is mainly out of curiosity, I know making it myself directly is simply better at the end lol.

obtuse gale
#

no

prisma wave
#

not at all

drifting yoke
#
        User user = new Gson().fromJson(re, User.class);
        re.close();```
#

is closing the bufferedreader enough or do i need to close the filereader as well?

pastel imp
#

Also, pros and cons on making a full custom coded server vs using public plugins?

half harness
drifting yoke
#

Ive put the exception on the method

half harness
#

this is different

#

a try-with-resources automatically closes whatever you put in the () for you

#

you can also put multiple stuff by separating it with a ;

drifting yoke
#

Oh okay

sweet cipher
#

public abstract Collection<? extends AnimationTemplate<?, ?>> getAnimationTemplates();
for (AnimationTemplate<?, ?> data : multiAnimationTemplate.getAnimationTemplates())

Required type: Object

Provided: AnimationTemplate<?, ?>
What?

#

I feel stupid but why does this not work

#

I'm so confused

#

This is the AnimationTemplate class
public abstract class AnimationTemplate<T extends Animation, B extends AnimationBuilder<T, B>>

prisma wave
#

Any particular reason for using ? extends?

sweet cipher
#

Just to see if it fixed it

#

I tried without it too

#

This is how I'm calling it

     if (template instanceof final MultiAnimationTemplate multiAnimationTemplate) {
            for (AnimationTemplate<?, ?> child : multiAnimationTemplate.getAnimationTemplates()) {
                this.save(child);
            }
            return;
        }
#

This doesn't work either
public abstract Collection<AnimationTemplate<?, ?>> getAnimationTemplates();

#

I just tried changing it to public abstract Collection<String> getAnimationTemplates(); and that doesn't work either

#

This is the whole class:

#
public abstract class MultiAnimationTemplate<T extends Animation, B extends AnimationBuilder<T, B>> extends AnimationTemplate<T, B> {

    public MultiAnimationTemplate(BlockAnimator plugin, String typeId, boolean loop, boolean reverse, int tickDelay, List<PlayerFunction> playerFunctions, ListMultimap<Integer, AnimationEffect> tickAnimationEffects) {
        super(plugin, typeId, loop, reverse, tickDelay, playerFunctions, tickAnimationEffects);
    }

    public MultiAnimationTemplate(BlockAnimator plugin, String typeId, boolean loop, boolean reverse, int tickDelay, List<PlayerFunction> playerFunctions) {
        super(plugin, typeId, loop, reverse, tickDelay, playerFunctions);
    }

    public MultiAnimationTemplate(BlockAnimator plugin, String typeId, boolean loop, boolean reverse, int tickDelay) {
        super(plugin, typeId, loop, reverse, tickDelay);
    }

    public abstract Collection<AnimationTemplate<?, ?>> getAnimationTemplates();
}
agile galleon
#

java generics suck

#

i had similar issues lately

#

hold up

sweet cipher
#

It works if I use an implementation of the class like this:
if (template instanceof final ChainedAnimation.Template multiAnimationTemplate)
idk why the abstract class wouldn't work

agile galleon
sweet cipher
#

what

#

Do you mean the String thing?

agile galleon
#

yes

sweet cipher
#

Like it still treats it as just an Object

sweet cipher
#

If I say Haskell is amazing will you fix it?

#

Wait I figured it out

#

I had to do MultiAnimationTemplate -> MultiAnimationTemplate<?, ?>
Idk why that would cause the issue, and also idk why IntelliJ didn't give a warning for not having the generics

#

If someone could explain why that would happen I would appreciate it too, because I don't understand why that would happen even if I didn't add the generics, because the generics weren't used in the return type of the method

obtuse gale
agile galleon
#

you defo work at oracle

obtuse gale
#

jesus fucking christ Fish what is that constructor

sweet cipher
#

Does it make you feel better that the only time the constructor is actually used is in a Builder?

sweet cipher
# obtuse gale

Also I can’t tell if this one is making fun of me or not

#

I probably should separate out the constructor at some point though

#

Realistically though separating it out would probably just end up being more of a pain then it’s worth, and I would have to figure out the best way to separate the parameters because they’re all pretty much related

obtuse gale
sweet cipher
#

lol

sinful geyser
#
for (String l : meta.getLore()) {
                if (l.contains(ChatColor.GRAY + "Raw Blocks Mined: ")) {
                    String numericString = l.replaceAll("[^0-9]", "");
                    int mined = Integer.parseInt(numericString);
                    newLore.add(ChatColor.GRAY + "Raw Blocks Mined: " + ChatColor.YELLOW + (mined + 1));
                }
                else {
                    newLore.add(l);
                }
            }

so i have this that executes every time someone mines a block but instead of just counting up by 1 every single time it adds a 7 in the front... does anyone have a clue why?

half harness
sinful geyser
#

oops

#

ty btw dkim my savior once again xD

past bone
#

What is this server?

#

I need help on my discord account

#

Can anybody help me?

humble prism
#

!notdiscord

#

!discord

#

Well those eidnt work

#

This is not for discord help

#

Its for minecraft

worthy violet
#

hey can someone remind me of the name of the server software for Minecraft that is very barebone doesn't even have player data file storage. It was a server software in java but it was just the bare bone of a server, AI wasn't implemented yet and needed to be coded, its was meant to be a good template for anyone creating a minigame that doesn't need all the features that the base Minecraft server has.

Found it! ||https://minestom.net/||

wind patio
#

is it possible to view and interact with a linux screen with the same user account?
issue is, the server owner usually connects to the console to monitor the server
then I can't connect myself
or the only solution is to use tmux?

young trail
#

the server is stuck at [14:17:17] [Server thread/INFO]: Preparing level "crmapin"
[14:17:18] [Server thread/INFO]: Reloading ResourceManager: Default, bukkit

unique owl
#

how can I change global placeholder?
I have %event_active%
and I want to change it from one server, so it affects all servers under BungeeCord

drifting yoke
#

If i convert an object to json file that already exists, will it replace the previous one?

brittle leaf
#

probably

potent nest
#

depends on how you're doing it

drifting yoke
#

I'm just doing a toJson thing

potent nest
#

that doesn't tell how writing to disk is done

drifting yoke
#

well I mean.. what else?

#

file.write(obj.toJSONString()); ? that's all

potent nest
#

💀

agile galleon
#

Well then youre overwritint obviously

potent nest
#

yeah, file.write is what's writing to the file, not related to json at all

agile galleon
#

Maybe look at the documentation xD?

drifting yoke
#

What I want to do is simply just overwrite. I don't think editing it would be efficient

potent nest
#

documentation will tell you

sick belfry
#

extremely stupid question but its been a while since I have touched java and I forgor, how do you trim a double to only use 2 decimals?

#

I'm doing some physics simulations and the doubles are fucking huge

#

also dont ask why java

obtuse gale
#

wouldn't you need the accuracy if you're doing physics simulation? why get rid of it?

sick belfry
#

its like an engine

#

for a project I'm doing

#

and I dont want to show the person who uses it absolutely huge numbers

potent nest
#

use string formatting

sick belfry
#

alright

#

ty

fierce bone
#

emm where i can make suggestion?

#

anyway if someone developer read this: can you make when we can make more folder on deluxemenu?
bc im working on one big project where we use deluxemenu and we have over 100+ yml file, who is the same gui_menu and we starting testing if we can make multiple folder where we can working but deluxemenu only allow use 2folder main 😦

brittle leaf
#

like just specific the path

#

so like uhh menufolder/thismenu.yml or smth like that

#

it could be a backslash

#

i cant remember

fierce bone
#

you mean make inside gui_menus folder other folder?

brittle leaf
#

yeah

fierce bone
#

but how to make to working that is inside that folder?

brittle leaf
#

some like

fierce bone
#

ty

sterile lance
#

Hello, I am creating a server in 1.18.2 and I created my little shop with the currency of Vault and Essentials. I would like to put another currency system that people can buy on the store and create a small cosmetic shop on DeluxeMenu, however I would like to know another currency plugin that is compatible with DeluxeMenu ^^

quiet depot
#

@wind patio did you figure it out that quick

wind patio
#

im not sure, maybe

#

changed the order of include, rebuilding now

#

cuz my sub B depends on A, but I include B first

compact perchBOT
#

There is no time to wait! Ask your question @pale timber!

quiet depot
#

cool

#

that's a big commitment

#

what if I don't know the answer

#

I don't trust you

#

I've never met you

#

I don't know you

lavish notch
#

lmfao

#

Did you kick 'em or did they leave trying to crash your Discord piggy?

quiet depot
#

is that link meant to crash your discord

lavish notch
#

I can only assume since they left after posting.

quiet depot
#

I banned them but think they left first

obtuse gale
#

There is no time to wait! Ask your question @pale timber!

solemn laurel
#

i need help

compact perchBOT
#

There is no time to wait! Ask your question @solemn laurel!

solemn laurel
#

i dont need it

#

i just wanted to see what triggered the bot

zealous orchid
#

help

#

hmm that doesnt do it

solemn laurel
#

maybe he just doesnt want to help you

#

he might be rude

zealous orchid
#

sad

foggy pond
#

How does this even work

#

How can the bubble UI be turned into... that

#

without mods

agile galleon
#

resource pack

#

and im pretty sure that thats not the bubble ui

#

just custom font which has the letters much lower than normal

#

if you put the letters into the action bar, they appear there

foggy pond
#

That is really clever actually

#

So you recon there is no action bar messages

#

i know it's a resource pack, just couldnt figure out how this worked

ocean quartz
#

You can still do action bar messages and have the actionbar be the UI at the same time