#help-development

1 messages · Page 799 of 1

storm crystal
#

I ask about shit, I get explanation, I dont get the explanation so I ask again, I get salted at for not understanding it for the first time, I am shoved even more resources that I do not get, so I ask again again, and you know how it goes

#

very redundant loop

compact haven
storm crystal
#

I thought utilizing screeching "think harder" is only used by teachers

compact haven
#

Honestly it's hard to attempt to get you to understand when we're virtual and typing on keyboards with 4 people

#

it's difficult

terse raven
#

maybe try somewhere else

compact haven
#

that's why most programmers learn it by try-it-and-see (you write code, figure out why it doesn't work, revise)

#

and by reading posted resources that attempt to explain a topic from top to bottom

#

for example, a disconnect we had here is that you asked about methods for each data type

#

we of course answered that you don't need them, because we thought you were asking about methods for each data column to write and read form the database

#

instead of from the object, which is very very standard Java. We weren't thinking about getters at all because that's just a common thing we write every day

compact haven
#

well maybe that should be an indication

terse raven
storm crystal
#

no I wasnt in mood and threw a few not nice words

#

thats something different

rotund ravine
#

Tried helpchat?

#

Maybe they’ll help you better

#

Or maybe paper

terse raven
#

considering its a simple sqllite issue ai chatbots should help

rotund ravine
#

He doesn’t trust them

terse raven
#

thats his issue

#

lol

rotund ravine
#

Cause they can’t use the 2nd law of thermodynamics

terse raven
#

certified troll

rotund ravine
#

Just saying my sql example earlier was entirely written by bing

storm crystal
#

if they can mess up with wikipedian definitions so badly

compact haven
#

Bro

rotund ravine
storm crystal
#

I am not going to use them for such stuff

compact haven
#

here

remote swallow
#

ai is fine for trying to get explanations or code exaples to base on

compact haven
#

this is 3 years old and honestly probably absolute trash

#

but it's code that (iirc) worked and is what you want

storm crystal
# rotund ravine

I mean yeah you resort to either copypaste ai/articles or ?learnjava

#

I wouldnt expect more from you

rotund ravine
#

@compact haven He’s looking for more abstract implementations

compact haven
#

wdym abstract implementation

rotund ravine
#

Obviously i am taking the lazy approach

rotund ravine
compact haven
#

wdym different database, different engines?

rotund ravine
#

Well flatfiles etc.

compact haven
#

Well what I sent has that

#

SQLHandler implements the StorageHandler, and JSONHandler implements StorageHandler

storm crystal
#

can i just

storm crystal
#

make connection manager, each class for table with getter setter and not use interfaces at all?

rotund ravine
compact haven
#

^ our pseudo that I hand wrote on Discord and JanTuck asked Bing did not include interfaces at all

compact haven
primal ermine
#

hi! is there an event when player brushes sus sand and gravel? I want to avoid any timers that are required with interact event

storm crystal
#

well imillusion did use interfaces so I thought they are important

compact haven
#

because that's honestly a concept you should understand before using databases

storm crystal
#

he just posted his code

#

and thats it

#

lol

compact haven
#

so search up in google "What are Java Interfaces and how to use them"

storm crystal
#

what do I even implement interfaces for in databases

#

like interface for each table manager

compact haven
#

No, an interface for each storage medium

storm crystal
#

whats storage medium

compact haven
#

so say you want to give server admins the choice of storing it in json, sqlite, mysql, or mongo db

primal ermine
compact haven
#

then you'd have an abstract management class that you interact with, then implementations of each ( json, sqlite, mysql, or mongo db) to write to those databases

storm crystal
compact haven
#

look at what I sent, the ChatMacro link is probably easier to understand

#

go through the code and see how I use it

primal ermine
# rotund ravine What?

archeology stuff. Player brushes suspicious gravel, it converts to normal gravel after that. I want to set delayed task for converting that block to suspicious gravel again for other players

rotund ravine
#

Didn’t even know brushes existed

primal ermine
#

i think it's 1.20 stuff

young knoll
#

It is

#

Archeology

rotund ravine
#

Then probably no event other than mentioned

young knoll
#

It fires BlockDropItemEvent when you brush an item out

#

Don't ask how I know

rotund ravine
#

Hacker

storm crystal
#

is it possible to implement images in item/entity lore/names?

remote swallow
#

probably

storm crystal
#

um, thanks?

rotund ravine
#

Try some shitty font schenanigans i guess

compact haven
#

it's probably possible with font bullshit in resource packs

#

it's probably not easy. I personally never done it

storm crystal
#

why is it shitty and bullshit

compact haven
#

Because you can't just give an image to the client to render in chat, in an item lore, etc

remote swallow
#

because you need negative space and custom font stuff with color and everything

compact haven
#

you need to turn it into different unicode characters and make sure the client has a resource pack to render each unicode character

rotund ravine
#

It’s just cancerous to do and extremely tedious so it’s shitty and bullshit

young knoll
#

You can either add the full image to a font

storm crystal
#

oh yeah this guy did it

#

something like that

young knoll
#

Or you can build it pixel by pixel until the client crashes from the massive NBT tag

#

lel

remote swallow
#

that would just be a custom texture for a unicode font

storm crystal
#

is there a way to "dress up" hostile entities as players?

compact haven
#

hm>?

#

you mean, make zombies i.e. display as a player?

rotund ravine
#

Oh my

storm crystal
#

yeah something like that

remote swallow
#

might be able to spawn a fake player and add the ai to it

rotund ravine
#

I think that’s too advanced for you

storm crystal
#

like for instance you got citizens I think? for making player NPCs

rotund ravine
#

Oh with an api sure

#

You can try

compact haven
#

^ but if you want to actually make aggressive zombies look like a player

#

you'd need to intercept render and movement packets, etc.

chrome beacon
#

Citizens does have a nice API

compact haven
#

and make them send player equivalent packets, or the packet with a fake player ID instead

storm crystal
#

I was thinking about making zombie invisible and just smashing fake player onto it

#

I dont think there is other way of making any entity retextured

rotund ravine
#

There def is. But, yeah i won’t tell

storm crystal
#

you are like the most helpful person here

rotund ravine
#

Thank you

compact haven
#

lmao

storm crystal
#

I dont think I ever resolved a problem with your answer/explanation

rotund ravine
#

Tells me a lot about you.

remote swallow
#

a lot of us can give great help or no help

storm crystal
#

nah no way it was great help of any kind 😭

remote swallow
#

oh we can give bad help too

rotund ravine
#

My help is an acquired taste

remote swallow
#

normally first few messages get good help, depending on the reaction to the help or just general messages can then change the type type of help you get in the future

storm crystal
#

very professional attitude

ivory sleet
#

guys what is this

rotund ravine
#

The usual dusktaler moment

ivory sleet
#

no1 is entitled to be "professional", but it is appreciated to keep the attitude reasonable

wet breach
torn shuttle
rotund ravine
wet breach
#

and then the other stuff before that too

#

-.-

torn shuttle
#

hey frost are you any good with quaternion rotations?

rotund ravine
#

Yeah i mean obviously it’s been an ongoing issue

wet breach
torn shuttle
#

I've got a problem

storm crystal
torn shuttle
#

I just figured out what's happening

remote swallow
storm crystal
#

but giving bad/harmful help on purpose on a help channel? xd

rotund ravine
torn shuttle
#

I have basically a series of angles which are all rotating, and they are tied in a hierarchy. I need to make it so if i rotate the base angle, the child angles also rotate

storm crystal
remote swallow
#

its rare to get bad help which is lucky

torn shuttle
#

thing is I got that to work but only "locally" i.e. it doesn't take the fact these angles are located in different spatial locations

torn shuttle
#

I am aware that I should be using a matrix to combine these but uh

#

it's not going good chief

storm crystal
torn shuttle
#

yeah

storm crystal
#

if Im gonna just use sqlite

rotund ravine
#

Of course

remote swallow
torn shuttle
remote swallow
wet breach
#

ok that is what you meant they are in different places

#

I was thinking like large distances

torn shuttle
#

yeah

#

nah they're usually relatively small

remote swallow
#

if you have multiple different storage types interfaces would be needed

storm crystal
torn shuttle
#

not hat it would really matter

storm crystal
torn shuttle
#

but the problem is that if I use "local" rotations these do not rotate correctly

#

because the x axis for one is the z axis for another one

torn shuttle
#

depending on where they are in space

wet breach
storm crystal
#

well makes sense why I didnt get why i'd need interface in my case

#

cuz I dont need it

remote swallow
#

like what @compact haven said, if you give server admins the option to use json, mysql, sqlite, etc you would need interfaces to make writing the code easier

storm crystal
#

nobody is gonna be an admin

torn shuttle
#

with my current approach one of the arms clips completely incorrectly because it sort of tumbles instead of raising up

wet breach
#

you are going to have to develop some kind of object that tracks the relative to the other

torn shuttle
#

that part I've done

#

I have all the data, I'm having a hard time conjugating it

storm crystal
#

do I need to make connection database manager class abstract?

rotund ravine
#

Do you need it abstract?

#

If you need to ask probably not

remote swallow
wet breach
torn shuttle
#

really it's just the bit where I take the existing euler angles of the parent and the bone and turn it into a bone angle rotated by the parent by the global coordinate system that I'm struggling with

rotund ravine
#

Oh no alf

storm crystal
wet breach
#

then you probably don't need it abstract lol

#

in the way you asked anyhow

storm crystal
#

i mean with abstract

#

I can just type extends

#

with non abstract

#

I need to make instance and shit

torn shuttle
#

any idea frost?

compact haven
#

you need to make instances anyways

#

abstraction is not a shortcut in your case

wet breach
#

abstract you also can't instantiate directly either

wet breach
# torn shuttle any idea frost?

it really doesn't seem too complex, if you already know the angles that need to be rotated and how much, and you already have an object that tracks the relative positioning of one from the other, then I don't see where it is hard to just make the stuff move?

#

you also already have a coordinate system of the thing around it

#

I guess the hard part is mapping internal coords to external ones?

torn shuttle
#

the real hard part is figuring out which part of this is actually bugged

#

it works almost entirely correctly

wet breach
#

ah yeah, debugging part probably be hard lol

torn shuttle
#

but it starts getting whacky when the parents are rotating

#

I was thinking it might be because I'm experincing a mismatch between rotation reference points

wet breach
#

that could be a possibility

torn shuttle
#

but the thing is it's really only happening to one axis which I'm having a hard time explaining

#

I don't know

#

I'm very tired

#

I think I'm done for today, this project is truly a curse

#

it's so close

#

I just want to be done with it

storm crystal
#

so I make insert and retrieve methods manually for each table in my database or can I scale it?

wet breach
torn shuttle
wet breach
#

didn't know you had a model editor lol

torn shuttle
#

I need to figure out the math to rotate the bone's coordinates by the parent's rotation

#

the screenshots I sent are from the model editor I'm using, blockbench

#

this is it in mc

wet breach
#

nice

#

yeah its hard to debug this from outside only because the way everything is supposed to rotate is really arbitrary in the sense it is really up to you how you want it to rotate based on the parent lol

torn shuttle
#

it's really hard when the behavior is close and only messes up under specific scenarios

wet breach
#

like if they did a twirl, there is no like standard in how the arms should move other then it should rotate with the body

#

pretty neat though you are doing this in MC

#

not that it makes it any easier

storm crystal
#

why does IJ force me to deal with unhandled SQL exception?

wet breach
#

because sql exceptions have to be handled

#

sql can throw a few different exceptions depending on what you are doing. Lets say you don't have perms, sql will return an error for that, or if your query is incorrect

#

you wouldn't know this was the case unless sql exception was thrown

young knoll
#

Checked exceptions they are called

storm crystal
#

how do I remake it so that it makes database if its not present?

#

wait nvm it works im getting different exception

keen valve
#

I ask before writing everything to avoid getting banned from the Discord. Are you open-minded here? If I talk to you about Custom JAR, 1.8.8, bedwars1058, KB Hit, PvP, and Practice Server, will I get attacked or banned? I'm asking because I got banned from the Paper Discord for this.

storm crystal
lost matrix
lost matrix
storm crystal
#

yeah they are quite open minded

river oracle
wet breach
#

so you can be happy to know that 🙂

lost matrix
storm crystal
lost matrix
#

k

storm crystal
#

wow that was cold

wet breach
keen valve
knotty aspen
#

you were kicked lol

storm crystal
#

what is Lombok getter and setter annotations?

young knoll
#

They automatically create getters and setters

#

Via compile time hackery magic

wet breach
storm crystal
#

so nothing bad if I dont use them?

keen valve
lost matrix
neat mesa
#

@dry hazel

dry hazel
storm crystal
#

saying it this way makes me wanna put @Getter and @Setter

rotund ravine
#

@keen valve

lost matrix
storm crystal
#

lmao for using one annotation?

wet breach
#

problems with annotation processors like Lombok comes in the form of when it generates problems. It is problematic in debugging it since the code it adds is actually not present in the source

keen valve
rotund ravine
#

Why?

remote swallow
young knoll
#

You can just store it as a string, or a specific json type in some databases

rotund ravine
#

We said they were not on any version

knotty aspen
#

please don't make stuff up, and move on. This isn't the place to bring up other servers, and you just brought 1.8 repeatedly without reason after being told its not supported

young knoll
#

But generally if you are using json in sql you may be misusing SQL

wet breach
storm crystal
#

do I make retrieve and set for each database table?

lost matrix
rotund ravine
#

@storm crystal

young knoll
#

Imagine an alternate dimension where people got stuck on something even older than 1.8

#

Like what if it was 1.1

wet breach
#

lol

eternal night
#

The whole modding community in shambles

lost matrix
median walrus
#

I think people still rock 1.7.10 for “pvp” reasons.

wet breach
rotund ravine
#

I know @wet breach There was no real attacks other than telling him to stop using old versions etc.

keen valve
#

Leaving that aside I have to write here or in another channel like #help-server to ask for information for when it concerns Jars, I wrote here to see if then I should not use PizzaSpigot as a base and create one myself

young knoll
#

Hey at least 1.8 has armor stands

#

And hoppers

rotund ravine
knotty aspen
#

no display entities 😦

#

best thing mojang added in years

smoky mauve
#

how to code so whenever my sword in minecraft gets a player kill it uogrades its sharpness level

rotund ravine
lost matrix
young knoll
#

Okay but what about entity displays

median walrus
young knoll
#

Oh wait :(

rotund ravine
smoky mauve
#

Do anyone know how I can do so my custom sword gets a sharpness level each kill I get on a player?

knotty aspen
wet breach
eternal night
#

Did that fork even add anything XD

wet breach
#

anyways, do note that any issues with forks we can't really help with here

storm crystal
knotty aspen
#

that fork doesn't seem to change anything

young knoll
#

Spigot forks have wacky names

keen valve
young knoll
#

At least it isn’t $300

knotty aspen
#

that fork is just a copy of the Paper repo 3 years ago, lol

rotund ravine
smoky mauve
storm crystal
#

it does

#

lol

young knoll
#

Nah it’s better because uhh

#

Pizza

eternal night
#

True I guess

knotty aspen
#

If you can't code in java this isn't the right channel

eternal night
#

Tho I don't see any added commits XD

rotund ravine
storm crystal
#

Do

#

I

young knoll
#

Does it remove any

eternal night
#

Idk

storm crystal
#

make playerstatsretrieve and playerstatsget

eternal night
#

Mobile client is ass

storm crystal
#

in the same class

#

as playerstats getters and setters

lost matrix
knotty aspen
keen valve
rotund ravine
knotty aspen
#

so that fork doesn't even have the log4j fix, thats concerning

storm crystal
#

why

eternal night
#

Good fork

eternal night
#

Run 1.8

wet breach
rotund ravine
# storm crystal why

Cause PlayerStats should not handle how to insert and select from the database

knotty aspen
#

time to use log4j exploit to forcefully upgrade the server to latest

young knoll
rotund ravine
storm crystal
#

so what do I use it for

rotund ravine
#

PlayerStats holds the data

#

That’s all it does

wet breach
rotund ravine
#

And should do

storm crystal
#

mine has only getters setters and constructor

#

anything else I need?

rotund ravine
#

Good

knotty aspen
#

If you really have to run 1.8, at least use something like PandaSpigot that is maintained

keen valve
wet breach
#

since its official and isn't touched by others doing who knows what

eternal night
#

Are you sure it isn't lynxspigot

#

The new 1.8 fork

rotund ravine
#

Why do you hate urself lynx

young knoll
#

Does it cost $300

eternal night
#

Yes

#

With canon patches

median walrus
#

Make it $500.

eternal night
#

For factions

rotund ravine
#

Async entities?

#

Multithreaded?

knotty aspen
#

Does it have async daylight cycle?

eternal night
#

Obviously it pulls from folia

young knoll
#

Async itemstacks

rotund ravine
#

Oh wow

keen valve
# wet breach the best one to use as a base would be spigot itself

To understand I only developed a plugin that I never released based initially on Paper api then I saw how much they expressly sucked and I switched to spigot ones and I had 0 problems because of those api it took me 2 years and I initially thought it was me sucking at programming then in the end it was their very limited API I couldn't do anything with it

median walrus
#

Speaking of Folia… does that support plugins yet?

eternal night
#

Yes

young knoll
#

Didn’t it always

#

Lol

rotund ravine
#

It just breaks a lot of em

median walrus
eternal night
#

Yes you need to adapt stuff for folia

lost matrix
young knoll
#

Yeah you gotta explicitly mark them supported as well

wet breach
young knoll
#

Just asm plugins to patch their runnables

rotund ravine
#

It was written in present tense wasn’t it?

young knoll
#

Smh

wet breach
#

¯_(ツ)_/¯

rotund ravine
#

It happens, i misread stuff all the time

#

Patient journals. Oh ur a man? Woman walks in /s

wet breach
#

well partially correct

#

just wrong thinking of which man

rotund ravine
#

Had a trans man the other day. I was unsure which gender they were cause of some journal notes

#

Confused me

median walrus
#

Are there any resources to getting started with plugin dev?

rotund ravine
#

Google probably has a ton

wet breach
rotund ravine
median walrus
rotund ravine
#

Didn’t need to ask after meeting them

wet breach
rotund ravine
#

Oh that’s true, but i think most will say biological gender nowadays on the forms if they are given any

wet breach
#

not in the US

#

well in some states it just says gender and they can't get upset because in some states they have laws that allow them to specify the other gender XD

rotund ravine
#

We get their social security number too, sadly that can be changed as well

wet breach
#

No social security number doesn't change fortunately

rotund ravine
#

Ours doesn’t change usually

wet breach
#

the only acceptable excecption is identity fraud but their new number still points to the old one

rotund ravine
#

Ours does not

#

Atleast we don’t get access to that

#

The person in question had half his journal missing cause it was on the other identity number

wet breach
#

nice

primal ermine
#

maybe anyone know what has changed with ComponentBuilder on 1.20.2? My item tooltips in chat just stopped working, without any errors or even warnings

storm crystal
#

is that okay?

primal ermine
#

cb.event(new HoverEvent(HoverEvent.Action.SHOW_ITEM, new Item(item.getType().getKey().toString(), 1, ItemTag.ofNbt(item.getItemMeta().getAsString()))));

rotund ravine
storm crystal
#

finally

#

i shouldve just stayed with configs

grand flint
#

what does folia change in terms of development

young knoll
#

Scheduler stuff

#

Notably

lost matrix
#

Scheduling works differently and interactions between tick regions need to be synchronized

young knoll
#

Probably also some stuff when interacting with the world

grand flint
#

is it worth switching to it

lost matrix
wet breach
lost matrix
#

But dusk is a bit truculent when it comes to suggestions

wet breach
#

just because something else may be better, doesn't necessarily mean it is easier

#

and configs in your situation would be fine anyways

grand flint
#

?

storm crystal
#

how do I insert only one statistic

#

like I got this

grand flint
#

u need to give the player uuid and such

primal ermine
# primal ermine maybe anyone know what has changed with ComponentBuilder on 1.20.2? My item tool...

no one plays with chat components? I have this code for making [item] in chat, and it just refuses to work on 1.20.2, but worked flawlessly on 1.20.1:

cb.append(Util.colors("&7"), ComponentBuilder.FormatRetention.FORMATTING);
cb.event(new HoverEvent(HoverEvent.Action.SHOW_ITEM, new Item(item.getType().getKey().toString(), 1, ItemTag.ofNbt(item.getItemMeta().getAsString()))));
if (itemMeta != null && itemMeta.hasDisplayName()) {
    cb.appendLegacy("§8[§7" + itemMeta.getDisplayName() + qty + "§8]");
} else {
    cb.appendLegacy("§8[§7");
    cb.append(new TranslatableComponent(item.getTranslationKey()));
    cb.appendLegacy(qty + "§8]§f");
}```
grand flint
#

what are you even asking

rotund ravine
grand flint
storm crystal
rotund ravine
#

No you do not

storm crystal
#

okay

#

player dies

#

what happens now

#

how do I add 1 to their death counter now

grand flint
#

u do +1

rotund ravine
#

You should have locally cached them in your handler

#

Then you locally fetch the cached object

#

And add one

#

On shutdown or a scheduled task you save the dirty stats and that’s that

keen valve
#

Does anyone know where to start to create your own jar based on Spigot

rotund ravine
#

?buildtools

undone axleBOT
rotund ravine
#

Just check out the version u need

keen valve
#

1.8.8?

rotund ravine
#

Yes

rotund ravine
#

Maps

storm crystal
#

what about it

#

where do I make it

rotund ravine
#

Cache ur retrived values on join

keen valve
#

Usually it's possible to run it with Java 17, usually h ow I saw on GitHub custom jars that all have .sh and .patch files in fact I was expecting that

rotund ravine
#

Where it makes sense

rotund ravine
lost matrix
# storm crystal what about it

You need to define a scope for your data. The lifecycle.
When does your data need to live, when can it get written back to rest.
In your case, the lifecycle is bound to a players session.
This means you load the data, once a player joins, and unload it when he quits.
(Periodically saving everything every few min. is a good practice)

Now what does loading and saving mean in your case?
The default approach is the following:

  • Write a manager class
  • This manager class contains a Map<UUID, YourData> where it maps players UUID to your data
  • Player joins: You load from DB into your manager
  • Player quits: You remove from manager and save back to DB
young knoll
#

You should always save incrementally too

#

In case of a crash

lost matrix
#

Lets see him chew on getting the basic loading/saving done.
Suggesting a scheduled task for saving is a finish move that needs to be prepared. smileybolb

storm crystal
#

how do I access playerStats from this

lost matrix
dry hazel
#

#get

storm crystal
#

I got lost

lost matrix
storm crystal
#

I want to make that fucking cache

#

but how do I do it

lost matrix
storm crystal
#

I already have like 3 managers that doesnt help

lost matrix
#

Cant have enough of them 🙂

pseudo hazel
#

you need a key to access the value of a map

storm crystal
#

the thing is that

quaint mantle
#

would a repository class be good for this

storm crystal
#

PlayerStats literally has UUID in it

pseudo hazel
#

well

#

that doesnt help

quaint mantle
#

?

pseudo hazel
#

since then you need to conjure one out thin air

#

work with what you got

#

you only have the player quit event at that point

quaint mantle
#

What type of designer pattern do you guys recommend for GSON. Here's my problem:

I want a JsonParser (this class name is already taken by GSON) with static methods, but you can register your own parsers to it anywhere you want and parse stuff too. Should I use a singleton, make everything static, or?

storm crystal
#

barely anything helps

lost matrix
rotund ravine
#

He told you in your scope you only really have the playerdeathevent

quaint mantle
#

it has limited parsing abilitites

rotund ravine
#

Now extract a uuid from that

quaint mantle
pseudo hazel
lost matrix
# storm crystal
@EventHandler
public void onQuit(PlayerQuitEvent event) {
  UUID playerId = event.getPlayer().getUniqueId();
  PlayerStats stats = playerStatsCache.remove(playerId);
  playerStatsManager.insertPlayerStats(stats);
}

blobspoonfeed

storm crystal
#

great what do I do with a player now

pseudo hazel
#

player.getuniqueid maybe?

grand flint
lost matrix
grand flint
#

what he thinks folia is

quaint mantle
#

oh bruh

#

gson is immutible

#

alr that sucks

grand flint
#

bro thinks my 30kx30k server has 32 chunks

rotund ravine
lost matrix
pseudo hazel
#

wait you guys dont use threadrippers?

quaint mantle
#

that's like my main issue lol

#

i thought about AdaptedJsonParser

storm crystal
#

like that?

lost matrix
quaint mantle
#

yes

pseudo hazel
lost matrix
rotund ravine
quaint mantle
#

but the only thing is that it will probably be a static only class

rotund ravine
#

But yes

molten hearth
#

if every chunk isnt threaded

#

is it actually multithreaded

pseudo hazel
rotund ravine
#

Xpdz

#

You do know how absurd that is right

storm crystal
pseudo hazel
#

do you know how many chunks are loaded with a render distance of about 10?

#

its quite a lot

grand flint
rotund ravine
grand flint
#

he is getting somewhere w this

young knoll
#

Let him cook

grand flint
#

how about every 2 chunks 😎

molten hearth
storm crystal
#

like

#

store data

#

and thats it

pseudo hazel
#

yes

storm crystal
#

how about this

pseudo hazel
#

but you seem to be posting the code as if you didnt know

grand flint
pseudo hazel
#

thats why I asked

rotund ravine
#

U lucked out though

#

Imagine if it returned a clone

molten hearth
storm crystal
#

idc

lost matrix
wet breach
#

not what I replied to, but maybe you know 😛

rotund ravine
#

I think he just had enough

lost matrix
rotund ravine
wet breach
lost matrix
#

Yeah at this point we all should be added as developers in the plugin.yml to be honest

rotund ravine
#

I agree

storm crystal
#

so it doesnt look good

rotund ravine
#

Now you troubleshoot

lost matrix
rotund ravine
#

Did u restart ur server after updating the plugin?

storm crystal
#

yes

#

database is not updated at all now

lost matrix
storm crystal
#

this doesnt work for sure

lost matrix
#

Add debug messages and find out what is happening

#

Lets impose a feeding stop for now. This NPE can be figured out, im sure.

storm crystal
#

I know it doesnt fucking work because my stats arent even zero'ed

lost matrix
#

Cool

#

Then

#

Add debug messages and find out what is happening

storm crystal
#

NPE is solved

#

one uppercase missing

#

thats whatever totally right now

#

I am talking about something different

rotund ravine
#

It will only update the database on join and exit

lost matrix
#

On join -> it loads
On quit -> it saves

Did you consider the case
On join -> it loads : But nothing is in your DB bc its your first join?

storm crystal
lost matrix
#

He is all over the place now, sending random screenshots and ranting...

rotund ravine
#

Figure out which sql statement is wrong and fix it

grand flint
#

should i code on notepad++ or directly notepad

storm crystal
#

that is literally the exception that I got

grand flint
#

lombok doesnt seem to work on this though

jagged bobcat
storm crystal
#

idk I took it from there

#

but I didnt even make any syntax mistakes

rotund ravine
storm crystal
#

so I remove duplicate key statement?

rotund ravine
#

You rewrite the statement

storm crystal
#

how

grand flint
#

mongodb or .yml for 400 player network?

#

planning to switch from mongo to due to costs sadly

rotund ravine
lost matrix
young knoll
#

It do

lost matrix
#

Oh it also has "on conflict" now

storm crystal
#

finally fucking works

#

I can go to sleep

#

picking databases was the worst mistake of my life

rotund ravine
#

I agree

storm crystal
#

well now im forced to use them

#

cba rewriting it for n'th time

#

do I make Hash<UUID, SomethingStats> manager for each table or a general one?

lost matrix
lost matrix
storm crystal
#

so each data table?

lost matrix
#

I wouldnt phrase it like that because one class can have relations to several tables.
For example if it contains a collection.

storm crystal
#

it wont dont worry about it

#

so in general

#

data table Something should have:

  • Something - it holds getters and setters
  • SomethingManager - it retrieves data from db into cached version and the reverse when saving
  • SomethingCacheManager - used in SomethingManager to manage caching
lost matrix
#

Sure. If you create a new data class, then it needs its own table and its own manager for in-memory storage and its own
DAO for loading/saving from/to DB

storm crystal
rotund ravine
#

Also cachemanager and manager does not need to be so exclusive

lost matrix
# storm crystal whats not ok

Just for phrasing:
Manager -> Usually in-memory only
DAO (DataAccessObject) -> loading/saving data

So for a Class "SomethingData"
I would create
SomethingManager holding a Map<Key, Something>
And a SomethingDAO transferring data between your Manager and the Database.

storm crystal
#

so I can mash them together?

#

kk

lost matrix
rotund ravine
#

I read that as ero

lost matrix
#

Thats on you squirtle

storm crystal
#

okay so

#

when I want to make command

#

/deaths

#

Id get those deaths from cache

#

not from db

#

y?

#

db is only for saving data to make it persistent

#

yy?

lost matrix
#

You fetched that right

storm crystal
#

well thats a lesson learned today

#

maybe dbs arent that bad

lost matrix
#

*There are some cases where you still get your data from DB, but thats for another day

storm crystal
#

bold of you assume im gonna mentally persist through it

young knoll
storm crystal
#

Elmo

lost matrix
storm crystal
#

I dont want to become dev

#

I am cybersecurity major

#

😭

wet breach
storm crystal
#

well I picked on java bcs I found python a bit boring

lost matrix
wet breach
#

because instead of just knowing that vulnerabilities can come from an application you would actually have a deeper understanding beyond that

storm crystal
#

soon-to-be 20

lost matrix
wet breach
#

but programming and cybersecurity go together 🙂

storm crystal
#

I might bear some kind of mental disability

#

but ive never been checked for that

storm crystal
rotund ravine
#

Well as long as it isn’t written somewhere no jobs can check it

wet breach
#

script languages just help you do things, programming languages help you understand the extent an application vulnerability can have as well as how to combat it

storm crystal
#

idk im only 3 months into uni

#

so far we got maths

#

maths

#

and maths

#

and basics of telecommunication

#

they want to sieve unworthy with linear algebra and mathematical analysis

#

already half didnt pass first exam wave

wet breach
#

Well, I did anti-cybersecurity in the military 🙂

#

the opposite of what you are going to school for

storm crystal
#

most of it is probably outdated

wet breach
#

it isn't

storm crystal
#

military revolves around using old shit so in military context no

#

but in general context yeah

wet breach
#

also, we have plenty of equipment that is modern

#

such as our ID database stuff 😄

rotund ravine
#

Alf used a microwave to disrupt radar

#

Totally

wet breach
#

I probably could have retrofitted one of the dishes to do that

#

not sure if it would have been effective nor can I think of a scenario it would have helped XD

rotund ravine
#

When the sky submarines come for you obv

wet breach
#

ah yes, the sky subs

storm crystal
#

so called security specialists when I distract their EM signal with one tiny funny device

wet breach
#

but yeah, anything and everything is relevant in terms of cybersecurity. Even if its old it still has relevance. For example zip bombs are still effective because some developers forget to not assume anything about the zip file

#

taught Optic about that one 🙂

#

at one point his malware scanner was susceptible to such a thing

rotund ravine
#

Jar bombs 💪🏻

wet breach
#

yep, you could have one 🙂

storm crystal
#

how old are you actually

#

like fossil old

#

or

#

30's

rotund ravine
#

22

#

Alf is 96 /s

wet breach
#

lol, 96

lost matrix
wet breach
lost matrix
#

But it feels like 23...

rotund ravine
#

96, but it feels like

storm crystal
#

my condolences in serving in military

young knoll
#

25

#

Already too old

wet breach
#

I have no regrets about it 🙂

storm crystal
rotund ravine
#

Lol

wet breach
storm crystal
#

not that US government is any great just saying

#

:v

wet breach
#

its better then North Korean Government

rotund ravine
#

Doesn’t say a lot

storm crystal
#

the fact that you needed to use NKr as comparison says a lot yeah

wet breach
#

no there is other countries

#

China, Russia, Israel, Iran, Dubai, Many countries on the Continent of Africa

rotund ravine
#

The US isn’t all it’s made out to be, but it’s not too bad either.

storm crystal
#

come on, now mention Afghanistan that has pretty much no established government since ages

lost matrix
#

squint Me watching help-dev slowly sliding into politics again

young knoll
#

Just another day

rotund ravine
wet breach
#

don't worry I will make sure it slides the other way 🙂

storm crystal
#

Poland is pretty cool

wet breach
#

never been there so I don't really know

lost matrix
wet breach
#

Anyways, yeah old stuff can haunt you

#

you will probably learn that in your schooling

storm crystal
wet breach
#

see

#

now school is going to teach you about it

rotund ravine
#

Feels like i am at my clinicals again

wet breach
#

lol

storm crystal
rotund ravine
#

Student nurse ye

wet breach
#

are you going to become a NP?

#

or well you know is that the end goal?

storm crystal
#

😭

rotund ravine
#

We probably have different terms here, but no i haven’t decided on what to do after my 3,5 years.

wet breach
#

NP = Nurse Practitioner

rotund ravine
#

Might join the military as a nurse for a bit

wet breach
#

they are almost like doctors

#

in the US you need a Masters to be one

rotund ravine
#

I see, i will probably get a masters. Though it’ll probably be more specialized like CCN or Anesthetics

storm crystal
#

its kinda funny cuz I went into uni without any interested in cybersec

river oracle
storm crystal
#

no idea what kind of job I can even get

#

or if I can get a job after this

wet breach
#

Cyber Security is in high demand

#

almost every large business needs one

rotund ravine
#

Just become a blackhat hacker and extort money 👌🏻 /s

wet breach
#

MS pays for that

#

its an actual job

brisk jetty
#

Are you actually able to change the Bukkit logger level

Whenever i try to it doesnt work and when i search it online it seems no one else can either

wet breach
weak meteor
#

Hello, i got a NPE in a Bukkit.createInventory

#

in that one.

#

Checked kit.getDisplayName(); and it works, it does have the displayname, it isnt null

#

KitInventory extends InventoryGUI that in the constructor calls that method

river oracle
#

its probably that tbh

weak meteor
#

its a custom one from me

young knoll
#

?stacktrace

undone axleBOT
weak meteor
#

okay

weak meteor
#

abstraction goes brr

rotund ravine
weak meteor
#

with CC.translate

rotund ravine
#

What am i looking at?

#

Dicko is what value

weak meteor
#

kit.getDisplayName()

#

lemme give you code

rotund ravine
#

So if you remove cc.translate and just pass kit.getDisplayName what happens

weak meteor
#

same thing

#

CC.translate its not the problem neither it is the kit.getDisplayName

rotund ravine
#

Wht happens if you print out kit in the method

river oracle
#

then print it with CC translate too after the fact

weak meteor
#

hmm

weak meteor
#

just tried it

#

its null when i create the KitInventory instance

#

but before it isnt

#

maybe it is because the InventoryGUI constructor calls createinventory?

rotund ravine
#

Perhaps

weak meteor
#

like
InventoryGUI constructor is first than KitInventory so that way the KitInventory kit instance is null cause his constructor executes later?

rotund ravine
#

I guess

weak meteor
#

and what happens if i delete InventoryGUI#createInventory?

#

like its a abstract class

#

fuck

#

damn

#

what can i do

river oracle
#

hopefully you find it useful in the future

weak meteor
#

hmm

river oracle
#

I'll get typing now

#

:3

weak meteor
#

okay

rotund ravine
#

Is it generics? We love generics

river oracle
#

no

#

functional

weak meteor
#

i havent seen generics in school

weak meteor
young knoll
#

Speaking of functional

#

What does the annotation actually do

river oracle
#

nothing its a markup

#

maybe a jvm optimization at best

#

nothing at worst

young knoll
#

Ah

weak meteor
#

i feel like im not going to understand a single fuck of functional

young knoll
#

Fair enough, I accidentally made a functional interface the other day and was confused

river oracle
weak meteor
#

okay

#

i trust

river oracle
#

@weak meteor I ran out of the character limit for nitro

#

so

#

I'ma need a bit more time

wet breach
weak meteor
river oracle
#

I'm fully explaining the problem

young knoll
#

“It’s really easy”
“I exceeded the character limit”

weak meteor
weak meteor
river oracle
river oracle
wet breach
#

therefore we need to trace it to where it originates

weak meteor
wet breach
#

but Y2K says hes got it so I will wait

river oracle
#

Couple things to preffice on why you are having an issue first off I'll educate you a bit more on how java constructors work.

Essentially when inherited the parent constructor always runs first. you may know this when in obvious examples such as below

public class MyParentClass {
  public MyParentClass(int arbitraryNumber) {
    // do stuff
  }
}

Now in this example we'll make a child class

public class MyChildClass extends MyParentClass {
  public MyChildClass() {
    super(5); // we must ALWAYS provide a super method first seeing as the parent constructor moust be run first
    int thisStuff = 51;
  }
}

as you see in my admittedly weird example. The super() call calls the parents constructor first no matter what. This is true even if the parent constructor has no parameters in its class.
Now let's pretend that MyParentClass is simply has a constructor with no arguments.

public class MyChildClass extends MyParentClass {
  public MyChildClass() {
    super(); // super is inferred
    int thisStuff = 51;
  }
}

as you see the super() method can still be there. But when the parent class has no arguments its usually inferred which is why this syntax is allowed

public class MyChildClass extends MyParentClass {
  public MyChildClass() {
    int thisStuff = 51;
  }
}

This doesn't change the fact that MyParentClass runs before MyChildClass.

Now lets get on about how to solve your problem in more relevant terms.
Right now you have an abstract InventoryGUI.java class which has the method

protected abstract Inventory createInventory();

This method in more simpler terms supplies your class's constructor with an Inventory value.

Now lets look at the issues with your implementation within KitInventory.java
firstly we can note that KitInventory extends InventoryGUI

    private final Kit kit;
    public KitInventory(Kit kit) {
        this.kit = kit;
    }

Knowing about what I said earlier we can infer that super is called within the constructor above like so

    private final Kit kit;
    public KitInventory(Kit kit) {
        super();
        this.kit = kit;
    }

    @Override
    protected Inventory createInventory() {
        return Bukkit.createInventory(null, 9*5, CC.translate(kit.getDisplayName()));
    }

As you can imagine right now we have quite the predicament. createInventory is being run before kit is assigned.
There are 2 solutions here. One is admittedly much better than the other, but I'll go through in explaing both.

First I'll talk about the naive solution
we can make a simple change to InventoryGUI for this naive solution to work. Firstly we add Kit to the constructor

    public InventoryGUI(Kit kit){
        inventory = this.createInventory(kit);
    }

Next we add kit to this.createInventory

    protected abstract Inventory createInventory(Kit kit);

Now I'll explain why this solution is naive. You're essentially killing your abstraction as you likely noticed. You've now bound your general InventoryGUI class to Kit and tightly coupled them. This obviously isn't Ideal especially if you want to easily use your GUI elsewhere.

Now I'll explain the better approach to solving this problem.
If we take a look back at your original method createInventory

    protected abstract Inventory createInventory();

We see all it really does is supply an inventory. Well cool enough java actually has a method built in to solve this
we can equate createInventory to something java has built in already, its called a Supplier. Suppliers just return a value! isn't that neat. that's exactly what your createInventory method does.
so now we can make some neat tweaks. to your class

#

First off lets remove that pesky createInventory method from InventoryGUI

    public InventoryGUI(){
        inventory = null;
    }

Alright, but now how do we assign the inventory that we have no method to inherit?
That's where the Supplier comes in a supplier allows you to pretty much inline a method I'll give an example after I implement it

    public InventoryGUI(Supplier<Inventory> inventoryCreator){
        inventory = inventoryCreator.get();
    }

nice now how would we apply this. I will use your example that previously errored as an example and hopefully you'll beable to understand the power of Suppliers

    public KitInventory(Kit kit) {
        // error no super arguments
        this.kit = kit;
    }

Now we must use the super keyword as our parent constructor has an argument.

    public KitInventory(Kit kit) {
        super(() -> {
          return Bukkit.createInventory(null, 9*5, CC.translate(kit.getDisplayName())); // kit is now in scope
        });
        this.kit = kit;
    }

Now this is neat we have all the power of the createInventory method but none of the draw backs. All of the data we need from the constructor is now in scope. the kit variable will nolonger be null because we have access to it from the constructor parameter.

#

@weak meteor

weak meteor
#

okay

#

lemme read everything

hazy parrot
weak meteor
#

Okay

#

I understood perfectly

#

it actually was what i thought

river oracle
#

in short

#

suppliers are rad

#

Consumers are pretty great too :3

weak meteor
#

Okay

#

thats actually cool

#

But know i got another problem

#

lol

sick ermine
#

Friends, I realized that I was transferring and using the classes from my previous projects in all of my minecrft plugins and that I was repeating my codes in most places, so I decided to code a core project to prevent this. When I examined some core projects, I noticed that they added an API module and coded the interfaces of most of the classes they would code in this API module, but they do not need polymorphism anywhere, but if they want to add a module for a different platform such as nukkit, it will not be that difficult to create classes that implement these interfaces. In short, my question is, is there any benefit in putting the interface of each class that I will code in the api module and the bukkit module in this api module?

brisk jetty
weak meteor
#

So the changes will affect him

river oracle
#

I mean if GKitInventory functions as normal the move to a supplier won't break anything

young knoll
#

Virtual entity vs inventory pr

weak meteor
#

yea

young knoll
#

Who’s cooler 😎

weak meteor
#

but what should i give?

river oracle
weak meteor
#

i got no Inventory instance to return

river oracle
weak meteor
#

oh nvm

river oracle
#

unless you understand

young knoll
weak meteor
#

yea just thought what i had to do

young knoll
#

Which idk I think is cool

weak meteor
#

got it

#

okay okay time to try

#

u are awesome

#

thats actually insane

#

i'll take notes of that

#

thank you so much for the knowledge lol

river oracle
#

part of me thinks Inventory PR will be merged first lo

young knoll
#

I kinda want to revive more old PRs

#

Might be some cool stuff in there

warped shell
#

how can i register a static event listener if at all possible?

weak meteor
#

this is used only on this context?

#

like working with parent and child?

river oracle
#

no, Suppliers have a ton of uses

weak meteor
#

you got one that i can check?

river oracle
#

I leverage java.util.function API a ton

wet breach
wet breach
#

The stringg in GetLogger should be one that matches a logger that already exists

weak meteor
#

oh Functionals is all the .functions package?

wet breach
#

optionally you could create a new logger instead and register the levels you want it to record

river oracle
#

etc

#

you can also make your own FunctionalInterfaces as displayed by the link I sent

weak meteor
#

yea this isnt readable

weak meteor
#

but cool to know

wet breach
weak meteor
#

okay thats better

river oracle
young knoll
#

Docs are for nerds

#

I’d really like to see the ArmorEquipEvent pr get merged but from what I’ve been told it’s not technically dead

#

The author is just busy

weak meteor
#

thanks y2k

#

really helped a lot

wet breach
#

yeah they provided more then what I was going to do

river oracle
#

I'm in a good mood right now be glad you caught me when I was happy angryasf when I'm mad I would probably have not exceeded the nitro character limit

young knoll
#

Weird flex but okay

weak meteor
#

i heard about Immutable Maps like

#

a year ago

#

its smth like ImmutableMap<K, V, V, ...>, right ?

hazy parrot
#

<K, V, V, ...> 🤔

weak meteor
#

idk if its true or not

hazy parrot
#

Map is key-value structure

weak meteor
#

thats why im asking

weak meteor
#

<K, V>

hazy parrot
#

so its only K and V

weak meteor
#

but i think theres a class that make it like

#

K, V, V

#

not from Java

hazy parrot
#

idk why would you have 2 same generic parameters

#

not sure if that would even compile

weak meteor
#

idk

#

Like its not Map<K, V, V>

#

its smth AnotherTypeOfMap<K, V, V>

river oracle
#

Your probably thinking about a table

hazy parrot
#

yeah, that wont compile

weak meteor
river oracle
#

Tables are cool it's how SQL stores data

weak meteor
#

maybe its that

#

yea its like sql

#

with the primary key and the values

river oracle
#

It's more applicable in databases than most core scenarios

weak meteor
#

yeah

river oracle
#

But it's also important to note not all tables have a primary key

hazy parrot
#

they should 😭

weak meteor
#

in core scenarios its really un-useful?

#

idk how to say it on english

#

like !useful to say it in java

weak meteor
#

the really should

#

like DynamoDB ones

river oracle
hazy parrot
#

yeah if there is no natural primary key, autoincrement one should be used

weak meteor
#

and now i gotta implement cooldowns

#

thats easy btw

#

Duration goes brr

river oracle
#

Nah long >>>>

#

(end - start)/1000

teal pond
#

how would i make a NMS mob's custom AI persist through server restarts?

weak meteor
#

.json

#

and gson

#

goes brr

river oracle
#

Oh you're saving to files

#

Fun

weak meteor
#

i love .json

#

my life is better since i knew .json

river oracle
#

Json is great

weak meteor
#

can i talk on spanish in here?

river oracle
#

No

weak meteor
#

k

river oracle
#

English only

weak meteor
#

What would the world be like without .json?

#

that sounds shitty asf in english

#

in spanish is better

river oracle
#

No hablo español anyways

river oracle
#

Ans hope optic isn't lurking

weak meteor
#

que sería del mundo sin .json