#help-development

1 messages · Page 162 of 1

echo basalt
#

I got 12 hours of programming class per week

#

the teacher is tired of hearing me

tardy delta
#

and i have to go to class or i loose marks smh

#

answering that much? kek

echo basalt
#

if I'm absent for a single class this year my degree is gone

sacred mountain
tardy delta
#

lol what

echo basalt
#

perks of being absent for months at a time

tardy delta
#

i can just not go to databases class and nobody cares

#

i aint understanding anything of what that guy says atleast lol

echo basalt
#

teacher is talking about big data and mongodb

#

20 theory classes and 0 practical classes

tardy delta
#

hmm yye kinda same here

echo basalt
#

we had 6 blocks of 3 hours each

tardy delta
#

next week is sql

echo basalt
#

where we had to write a fucking document

#

except all of them were the same

#

Big data - it is the concept of storing tons of data for analyzing it
Data warehouse - it's just a huge database cluster
Data mining - it is gathering data for Big Data that is stored on the Data Warehouse

#

ok now write 6 more

tardy delta
#

i should learn my lesson lol

echo basalt
#

we learned sql last year so we're gonna learn sql this year again

#

all you do on a programming course is learn how to make a calculator in 4 different languages across 4 years

tardy delta
#

i learnt sql two years ago and only forgot the advanced stuff

#

and regex

echo basalt
#

regex is easier than sql change my mind

tardy delta
#

mmh depends

echo basalt
#

also one thing that came with years of experience

#

is the shame that goes on every time someone asks what I do for a living

#

like

#

"Yeah uh... I'm basically a minecraft server developer"

#

then they start thinking I'm scamming their kids

#

Then they ask how much I make and it's like 3x their wage lmao

noble forge
#

it makes the big bucks though

#

same wavelength hehe

tardy delta
#

mye people dont like the word minecraft

echo basalt
#

perks of living on a country where the minimum and average wage is like 5$/hour

tardy delta
#

someone asked me if i was coding for mojang

#

yessir

echo basalt
#

and people reply "what do you do, really"

#

and I'm like...

#

"I make content for video games"

#

it just sounds so fuckin bland

#

it's like being a cashier

#

and saying

#

"I scan bar codes all day"

#

"and take money from people's hands and put it in a box"

tardy delta
#

true lol

echo basalt
#

except with cashiers people actually understand what's going on

#

with development people don't expect me to take 4 hours to synchronize a GUI with a database

noble forge
#

or spending 3 hours to figure out why theres a heisenbug in my code

echo basalt
#

that time I wasted 12 hours debugging client-sided items because the wiki.vg format didn't correspond to NMS and I didn't know that

#

only had to debug all fields on the packet 👍

sacred mountain
#

i got my minecraft gui to sync realtime to a web server using javascript and redis mongodb

echo basalt
#

ehh "real time" is subjective

#

probably with like 22ms latency

sacred mountain
#

yeah but still

#

i got it working in discord 💀

echo basalt
#

I'm thinking on grabbing my image board system and making a web engine

sacred mountain
#

betterdiscord plugins was fun

echo basalt
#

or just using gecko

#

and allow you to have a web browser

#

you click, a message appears on chat

#

you click that message and just start typing in chat

#

and it types on the keyboard too

#

like

#

[KEYBOARD] where you click

#

and it suggests a / command and anything you type after will be sent as a packet above 1.13

tardy delta
#

i quit with everything discord related lol

#

jda api sucks

echo basalt
#

so it looks like you're typing /www.google.com

#

🤔

#

then it pulls up google

#

this sounds more possible than it should be

sacred mountain
#

allows u to modify the way discord works

#

but u can get banned so i stopped

tardy delta
#

dunno what that is

sacred mountain
#

yeah i made like realtime translators for incoming messages and outgoing

#

so you can type in whatever language at the same speed

#

probably the only project i ever finished

frail gale
#

is there a way to create a new Custom Entity with reflection I mean by extending the entity's class and then overriding all of its methods?

echo basalt
#

you don't need reflection

sacred mountain
#

wait did u test this btw

echo basalt
sacred mountain
#

SOOO

#

oops caps

echo basalt
#

gun code just looks like this

sacred mountain
#

ight cool thanks

frail gale
echo basalt
#

you could modify bytecode but it's too hacky

frail gale
#

yeah ik

#

I use bytecode modifying mainly for Minecraft Mods

#

I'm asking because I saw some thread about someone saying that it's possible to modify the package address at runtime and making it version support like reflection

ivory sleet
#

Hi, you know why i can set a lore?

    public static ItemStack createItem(Material material, int amount, String displayName, List<String> lore) {
        ItemStack itemStack = new ItemStack(material, amount);
        ItemMeta itemMeta = itemStack.getItemMeta();
        itemMeta.setDisplayName(displayName);
        itemMeta.setLore(lore);
        itemStack.setItemMeta(itemMeta);
        return itemStack;
    }
tardy delta
#

take a string varargs and wrap that with Arrays.asList in createItem method

#

it expects a list now

ivory sleet
#

Okay thx!

echo basalt
#

if the garbage collector worked properly 90% of bukkit code would be gone

tardy delta
#

heh?

echo basalt
#

it's all garbage

tardy delta
#

ah now i understand lmfao

frail gale
tardy delta
#

Whatever createItem(..., String... lore) { meta.setLore(Arrays.asList(lore)) }

frail gale
tardy delta
#

no reason to create an arraylist lol

#
    public static ItemStack createItem(Material material, int amount, String displayName, String... lore) {
        ItemStack itemStack = new ItemStack(material, amount);
        ItemMeta itemMeta = itemStack.getItemMeta();
        itemMeta.setDisplayName(displayName);
        itemMeta.setLore(Arrays.asList(lore));
        itemStack.setItemMeta(itemMeta);
        return itemStack;
    }```
echo basalt
#

how much antialiasing does your ide have holy shit

frail gale
# tardy delta no reason to create an arraylist lol

At some point yeah but if you want to put a list in the String... lore variable it's not gonna work. I think the best is to have two methods one with String... lore and one List<String>. There is solution for the String... lore not taking a list by converting the list into an array but this will create another new list

frail gale
ivory sleet
#

I'm stupid

frail gale
#

remove the last dot

ivory sleet
#

Yes thx x)

frail gale
#

or you can import all the static methods by adding "*" after the dot and adding static after the import keyword.

#

by importing static you're not gonna need to type the class name

#

just type directly the method

frail gale
ivory sleet
#

ok thanks for your help

chrome beacon
#

An ItemStack has an amount

#

So just set that

tardy delta
#

new ItemStack(material, 5)

frail gale
#

when you're creating the ItemStack you can use the other constructor which takes int amount parameter

#

or set the amount of itemstack variable

tardy delta
#

then take an argument in ya method?

frail gale
#

itemstack.setAmount(int amount)

tardy delta
#

what

frail gale
#

Integer.parseInt(String arg)

#

if you want to convert String to an int

tardy delta
#

make sure to catch exception

frail gale
#

try & catch (NumberFormatException)

fluid river
#

umm

#

String... lore

#

what's wrong with that

tardy delta
#
int number;
try {
  // try to execute this code
  number = Integer.parseInt(args[x]);
} catch (NumberFormatException e) {
  // the player did not enter a number so an exception is thrown, we handle it here
  player.sendMessage("Please enter a valid number");
  return true;
}```
#

@quaint mantle

frail gale
tardy delta
fluid river
#

somebody said you need List<> over varargs

#

oh i read entire branch

#

my bad

tardy delta
fluid river
#

i found better solution

#
public void cringe (List<String> lore) { 
    List.of(lore);
}

public void cringe (String... lore) {
    List.of(lore);
}
tardy delta
#

no

#

Arrays.asList faster

fluid river
#

This thing works for both cases

#

It's not faster but better

tardy delta
#

man probably using java 8

fluid river
#

killed me

#

Java17CodersLivesMatter

frail gale
tardy delta
#

java 17 best

fluid river
#

#Java8CodersLivesDontMatterSoSwitchOverToNewJDK

tardy delta
#

only those stupid preview featurres suck

frail gale
#

I use Java 8 for Programming

#

Integer int = args[2] is not valid you need to convert it through Integer.parseInt(args[x])

tardy delta
#

yu cannot assign a string to an int

fluid river
#

try {
int amount = Integer.parseInt(args[2]);
} catch (NumberFormatException ex) {}

frail gale
fluid river
#

But still

#

It works for both cases

frail gale
#

wasting memory

fluid river
#

Omg

tardy delta
#

List.of(List.of(List.of()))

fluid river
#

it's getting erased later

tardy delta
#

compiler will fix anyways

frail gale
#

but still

fluid river
#

who cares

#

Predefine lore in constructor

#

now you don't need it as parameter

#

easy

frail gale
#

same with String... lore converting list to array and then converting the array to list

fluid river
#

guy blames me for slower but a lot wider solution

frail gale
#

I mean doing List.of(lore) when the lore is already a List is just useless

fluid river
#

Yeah but if you don't know if you would get varargs or list it's better

#

independent from value you gave

frail gale
#

yeah but var args is an array and when you put an array it will execute the other method which takes an array

fluid river
#

true if parameter

#

i think i realized the only way is parameter

#

so my solution is trash

#

woke up

#

finally

ivory sleet
#

List.of(Collection) isnt a thing its copyOf then

frail gale
#

then it will convert it to List here everything is good but I just say that the other method which takes only a List doesn't need to be converted to another List

ivory sleet
#

depends

#

if you want an immutable copy then its needed more or less

fluid river
#

I mean you can't make a method which eats both varargs and list in the same time

tardy delta
#

ImmutableList.of

fluid river
#

so my solution is bad

ivory sleet
#

List::copyOf just calls ImmutableCollections::listCopy under the hood as of now (hence immutability and a shallow copy)

frail gale
#

Immutable list was a list which cannot be edited right?

ivory sleet
#

yes

fluid river
#

oh i found

#

public void cringe (List<String> lore, String...) {

}

frail gale
#

does this mean that the Immutable list takes less memory?

fluid river
#

cringe(null, Lore lines)

tardy delta
#

no?

#

well

fluid river
#

if list is null transfer varargs

#

if list is not null then just use it

#

easy

frail gale
fluid river
#

the worst solution ever

fluid river
#

i'm just going to shitcode part

ivory sleet
#

its memory footprint is just as big as a normal list in principle

#

you have an additional array

fluid river
#

anyways gonna be garbage collected

ivory sleet
#

yeah gc is good

frail gale
#

I'm one of guys who wants to have super optimized code

ivory sleet
#

especially if it isnt the serial gc

fluid river
#

You don't need to worry about this

ivory sleet
fluid river
#

Nobody uses command 50 times in one millisecond

tardy delta
#

i saw my teacher calling System.gc manually in some code 🤔

ivory sleet
#

like time and space complexity O(expression)

tardy delta
#

gui application

fluid river
#

optimize this

frail gale
tardy delta
#

shes doing more crazy stuff

fluid river
#

well i used System.gc in my java courses

tardy delta
#

crazy woman

fluid river
#

to show how to get finalized objects finalize() to run before program stops

tardy delta
#

those are the most dangerous

#

was that you who teached gf to do that stuff?

fluid river
#

her too

#

not only

#

i have java blog on telegram

tardy delta
#

dang

fluid river
#

actually just to show that finalize() still works

tardy delta
#

where sound of dying cat

fluid river
#

well copy paste this code

#

and run

#

you will get them

tardy delta
#

ik it works

#

never needed to override it

#

and wheres ya super.finalize()

fluid river
#

finalize() is deprecated

tardy delta
#

ik

fluid river
#

i mean not directly

#

it doesn't have deprecated annotation

ivory sleet
#

its subject for removal

fluid river
#

yeah

frail gale
#

why would you use System.gc?

tardy delta
#

only saw @Deprecated(since="9")

ivory sleet
#

systems with limited resources kindercrowd

tardy delta
#

where forRemoval=true

fluid river
tardy delta
young knoll
#

I just run GC every tick

#

Saves ram

tardy delta
#

hopefully its an old algorithm which blocks other threads

fluid river
tardy delta
#

you?

fluid river
#

back then

#

it wasn't deprecated for me

tardy delta
#

ah

fluid river
#

so now it is

fluid river
tardy delta
#

only 1024 objects lol

young knoll
#

Can you even catch oom

fluid river
#

why not

young knoll
#

I mean

tardy delta
#

catch(OutOfMemoryError e) { Runtime.getRuntime().halt() } hehe

young knoll
#

The JVM shuts down when it’s encountered, no?

quaint mantle
#

don't think so

#

that's a flag

young knoll
#

Ah

tardy delta
fluid river
tardy delta
#

no

fluid river
young knoll
#

Oh lord that is

#

Not pretty

fluid river
#

why

tardy delta
#

also that font

fluid river
#

unsupported class version

#

java mismatch

tardy delta
#

ninjad me

young knoll
tardy delta
#

no empty lines you mean

young knoll
#

Or splitting things into methods

#

It’s just a big block of 🍝

young knoll
echo basalt
#

coding in russian

#

grr

fluid river
#

the plugin you are trying to shade into your

tardy delta
#

my teacher codes half in dutch/ english

fluid river
echo basalt
#

sure schools teach in their local language but I'm still against that

tardy delta
#

true

#

especially in college

fluid river
#

i'm running russian telegram blog

#

all of my words are on russian

#

same as my strings in code

echo basalt
#

specially here in portugal where tons of words contain ´`^~ç

fluid river
#

just to make people understand

echo basalt
#

just to fuck with variable naming

tardy delta
fluid river
#

um i only have Strings russian

#

Not variables

#

so "Name: " turns to "Имя: "

iron glade
#

what does a russian keyboard look like?

fluid river
#

same as english

#

we just have second layer below english letters

#

with russian latters

iron glade
#

ahhh

#

nice

fluid river
#

and cuz we have 33 letters

#

some of them are on ; ' < >

#

; Ж
' Э
< Б

Ю
` Ё

iron glade
#

are they mapped to the correct non russian letter?

fluid river
#

wdym?

iron glade
#

or do you have some other ordering

fluid river
#

just alt + shift

iron glade
#

I mean

#

is an A

fluid river
#

no they are not АБВГД

iron glade
#

this russian O

fluid river
#

same as QWERTY

#

ЙЦУКЕНГ

#

O О

#

no difference

#

between russian o and english one

#

the biggest problem is when you forgot to switch language

iron glade
#

so an N is a T in russian?

#

as symbol

fluid river
#

and instead of hello write руддщ

#

no

#

they are not same as english

iron glade
#

that's what I mean with mapped

fluid river
#

no they are not

iron glade
#

you have a new order

fluid river
#

then

#

basically

#

we use qwerty but russian version

iron glade
#

ahhh

#

okay

fluid river
#

йцукен

#

no matches

iron glade
#

cause I though there are only some russian symbols that look totally different

fluid river
#

A = A

iron glade
#

like a P is not a p in russian, right?

fluid river
#

Б = B

fluid river
iron glade
#

yea exactly

tardy delta
#

brrr

fluid river
#

and p is п

iron glade
#

:(

#

doesn't make learning russian easier xD

fluid river
#

привет

#

priveT

iron glade
#

hello?

fluid river
#

yeah

iron glade
#

nice

tardy delta
#

where wodka

iron glade
#

p is R?

fluid river
#

водка

tardy delta
#

looks very sussy

fluid river
#

vodka

iron glade
#

boaka

#

:D

tardy delta
#

д amogus

fluid river
#

mosly our vowels match

#

A O У Е

sacred mountain
fluid river
#

yeah that's d

sacred mountain
#

dmogus

tardy delta
#

i still dont believe ur a girl

fluid river
#

C is match too

#

who

iron glade
#

ok so the sussy A is a D

#

shouldn't be too hard to remember

fluid river
#

well

#

we mostly write cursive

#

so russian д is like d

#

анд russian b is similar to b

iron glade
#

are there differences between upper and lowercase?

fluid river
#

б

#

yeah a lot

#

in cursive

echo basalt
#

sometimes I wonder how tf some people join my network

fluid river
#

for default we have different Б and б

echo basalt
#

I just looked at my console and some dude joined from poland

#

through the proxy

#

on my test network

iron glade
fluid river
#

yeah

#

like 6

#

but б

echo basalt
#

that's restricted to a subdomain and port

hazy parrot
#

Здраво !

fluid river
#

Ф ф

#

F f

iron glade
#

what is this? в

hazy parrot
#

v

iron glade
#

UFF

fluid river
#

УФФ

#

Discord has weird rusisan F

#

looks like line on eye

#

basically the line is bigger

hazy parrot
#

Does russians have љ or њ ?

fluid river
#

like on lowercase

#

ф

fluid river
hazy parrot
#

so no

fluid river
#

л н

tardy delta
#

im out of ideas what i should code for my kingdoms server

#

plugin actually

fluid river
#

we have letters you would never pronounce

#

Ъ Ь

iron glade
#

seems complicated

fluid river
#

first is for hard pause

#

second for softing letter

#

so Ф is like F sound

#

and ФЬ is th

iron glade
#

hm

fluid river
#

подЪезд is like pod yezd

#

without Ъ it would be like podezd

iron glade
#

in Germany we have some similar stuff I guess? like "sch" is "shhhh" and "ch" is... idk how to spell it xD

fluid river
#

well on their own Ь and Ъ have no pronounsuation at all

iron glade
#

I see

fluid river
#

we just call them soft sign or hard sign

iron glade
#

languages can be really interesting

#

besides french

fluid river
#

Well esperanto is love

iron glade
#

all those `^ etc can be so annoying to remember

fluid river
#

yeah

#

nice we don't have them

frail gale
fluid river
#

lez go

frail gale
#

I'm from Bulgaria

fluid river
#

voice message

iron glade
#

only chuck norris can

fluid river
#

only dwayne rock johnson

frail gale
#

these two letters are in the Bulgarian alphabet

#

and many words are formed with these letters

#

so I can pronounce them very easily

fluid river
#

Ь and Ъ

#

how do you call them

#

and pronounse

iron glade
#

well, in bulgarian then I guess

fluid river
#

yeah we are both slavic

#

i should say that russian has the biggest amount of rules

#

cuz we have word generation algorithm

#

река trasnfers to междуречье

#

by adding prefix между which means between

#

so река is а river

#

and междуречье is a place between rivers

frail gale
#

Ь cannot be pronounce if it doesn't contain an "o" after the letter. If it contains an "o" it's pronounce like "yo" Ъ is like "uuh"

iron glade
#

and I thought German is a difficult language

fluid river
#

then we add Н suffix

#

so word transfers to междуречНый

#

which is adjective now

frail gale
#

Ь is really similar to Й

hazy parrot
iron glade
#

I thought about learning russian but seeing all those rules kinda demotivates me xD

hazy parrot
#

like река and међуречје

fluid river
#

the biggest amount of rules

#

is in russian

#

chinese doesn't count

#

rules are related to hieroglyphs

frail gale
#

This year I have Russian classes

fluid river
#

not to actual words

frail gale
#

but I'm in the start

fluid river
#

the only rule in chinese is the don't have r sound

#

at all

#

ri (sun) on chinese is zhi on english

#

also g in the end is like Ъ (hard) in russian

#

hang on chinese is han(hun maybe)

#

and han on chinese is han' on english

#

soft n

frail gale
#

pronounce this "ъй"

fluid river
#

omg

iron glade
#

easiest languages at this point are programming language smh

fluid river
#

programming is english

#

mostly

frail gale
#

except lambdas

fluid river
#

esperanto gonna be easier

fluid river
iron glade
#

I imagine programming being in german xD

fluid river
#

i had hard times remembering that these "" are quotes

#

and this ; is a semicolon

#

cringe words

#

{} curvy brackets

#

() circle brackets

iron glade
#

"if" would be "wenn" or "falls", "else" would be "sonst" or "andererseits" lmao

fluid river
#

square brackets bro

echo basalt
#

paranthesis

#

square bracket

#

curly brace

fluid river
echo basalt
#

()

fluid river
#

oh i see

iron glade
#

"klammer" in ger

frail gale
#

in Bulgarian

fluid river
#

скобки

#

on russian

iron glade
#

lel

fluid river
#

if -- если

#

else -- иначе

frail gale
#

they're prounced the same

frail gale
#

but if is - ако

fluid river
#

&

#

chat silenced

#

ampersand

#

i usually call it eight

#

cuz similar

#

or 7 sometimes

iron glade
#

do you guys know what we call ß in german?

fluid river
#

cuz it's shift 7

fluid river
#

something connected to pencils

#

you have this letter here

iron glade
#

"scharfes s" or "dreierles s"

#

which translates to "spicy s"

#

lol

#

and triple s or smth like that

fluid river
#

that's s

#

basically

iron glade
#

yea

fluid river
#

well one thing

#

we have с letter

iron glade
#

white was spelled "weiss" years ago, now we use "weiß"

fluid river
#

which is never k

#

always s

#

circle

#

idk why english is so dumb

#

but our С is same as C in circle

#

only

iron glade
fluid river
#

yeah

frail gale
#

our C is S

fluid river
#

russian letters are always pronounced like they should

#

except silent ones

iron glade
#

I think in German there aren't any words that contain a C by itself, only CH I guess

frail gale
#

and English C is Ц

fluid river
#

yeah

#

TS

iron glade
#

otherwise we use CK or K only

fluid river
#

basically

#

for example when we say подъезд(pod yezd)

#

we swap d on the end with t

#

when pronouncing

#

pod yezt

#

just to make words softer when we say it

#

so we are unlike german xD

iron glade
#

some german words have a d followed by a t

#

so dt

fluid river
#

stadt

frail gale
#

there was one compilation in Youtube

#

for different languages

iron glade
frail gale
#

and German was very angry

fluid river
#

exactly

#

well we have strong R which is not in english

#

mostly close to some italian

#

ravioli

frail gale
iron glade
#

another weird thing is the exact same word being pronounced differently based on context

er sucht (he searches, sucht pronounced like "suuuuucht" (streching the u)
die Sucht (the addiction, sucht pronounced like it's spelled (short u)

fluid river
#

well why do you cast your main to Plugin

frail gale
#

where are you calling this

fluid river
frail gale
fluid river
#

never cast it

remote swallow
#

probably needs di

#

?di

undone axleBOT
fluid river
#

probably needs

#

FREE JAVA LESSONS

checkmybio

#

where

remote swallow
#

where, not why

fluid river
#

not why

#

ahahaha

#

lmao

echo basalt
#

bruh intellij is tripping that I'm returning a HashSet instead of a Set

remote swallow
#

you out of date on ij or something

echo basalt
#

never expected to have to do this

frail gale
fluid river
frail gale
#

does the constructor calls the method?

fluid river
#

<? extends Set>

frail gale
fluid river
#

and ij will not argue

#

or just update IDEA or java version

frail gale
#

where are you calling this method miningSpeedGiver?

fluid river
#

or both

#

do you call it

#

or not

#

you just declared it

frail gale
#

but onEnable you're creating a new instance of the object

fluid river
#

miningSpeedGiver();

frail gale
#

and you're not calling it

echo basalt
#

This looks hella ugly

frail gale
#

just do className.miningSpeedGiver();

#

after creating the object

pseudo hazel
echo basalt
#

bruh moment

frail gale
#

yeah but you can also create a new variable which declares the object and after that call the method

#

it's more organized

echo basalt
#

grr why is this saving at the start if saving is the last thing I do

#

yet either mongo or gson are emptying the member set

#

ffs

tardy delta
#

joining cf is expensive isnt it

#

cant you just join on the end?

echo basalt
#

no because each thenRun is a cf

#

so it would break sync

tardy delta
#

hmm

echo basalt
#

cf.thenRun(cf2) doesn't ensure that cf2 will run after cf1

#

even then all of these cf's rely upon each other

#

and it all ends up at a supplyAsync on a single source

tardy delta
#

thought that they ran after e/o as implemented in the cf

#

anyways idk

echo basalt
tardy delta
#

spot the issue in 200 lines of code hmm lol

#

idk lol

#

too much stuff happening there

floral drum
#

uwu hi bois

echo basalt
#

hi purple

floral drum
#

hi illusion

tardy delta
#

what abour girls

remote swallow
#

by some chance, is your minecraft name Purple

floral drum
#

I call everyone bois

tardy delta
#

illusion wheres the issue?

echo basalt
#

idfk where it is

#

I just know that the data I'm saving is not the same data that is fetched

#

and that the data is being saved before it should be saved

#

would this fuck with collections within collections

tardy delta
#

sound like issues i had with my db

echo basalt
#

time to test

#

got like 10 minutes left

tardy delta
#

Map<String, Object> superior

echo basalt
#

ok now I gotta test saving a set

tardy delta
#

i had an issue where if i delete a home and try to get to again, its gone, but whenever i relog its back lol

#

forgot to delete it on the persistent end lol

echo basalt
#

Let's try something else

floral drum
#

I mean- F

tardy delta
#

i dont have methods to delete it lol

echo basalt
#

Yeah seems to work

tardy delta
#

just deleting all the ones that need to be deleted when saving them all

echo basalt
#

now let's try putting the set inside a map

#

along with a displayname

tardy delta
#

also anyone knows how to resolve this?

#

ultimate thing

echo basalt
#

Okay... storing a set inside a map works

#

THEN WHY THE FUCK DOESNT IT OWRK ELSEWHER

floral drum
#

it's ok ❤️

echo basalt
#

I'm wasting too much time

floral drum
#

F

echo basalt
#

gonna get paid triple the money this week ❤️

floral drum
#

wooo

#

whats your issues exactly

tardy delta
#

imagine setting a timer

echo basalt
#

I add stuff into collection

#

save that collection into cache

#

get from cache, save to database

#

collection is now empty

tardy delta
#

anyone else running server in ij?

#

like for testing

echo basalt
#

I run test servers in ij

#

yeh

floral drum
#

meh I don't

echo basalt
tardy delta
#

i find it useful but now im just running server on pi and tranferiing jar with filezilla every time

floral drum
#

that's why I love wakatime

echo basalt
tardy delta
#

whats wakatime

floral drum
echo basalt
#

you can easily graph availability

floral drum
echo basalt
#

where tf do you see that

floral drum
#

it's just an advertisement

#

that popped up at the top

tardy delta
#

what would happen when i interrupt main server thread lol

echo basalt
#

it would lag shit

floral drum
#

👀

tardy delta
#

with Thread::interrupt

flint pollen
#

hey, what is the event for player sending message to chat?

#

AsyncPlayerChatEvent is highlighted as deprecated in my IDE

floral drum
boreal python
#

How would I detect if there are at least 4 blocks directly surrounding a player excluding the block they are standing on? (if that makes sense)

urban kernel
#

are there any good papi tutorials?

ionic crest
#

how do I store a class name as a variable? so for example if you have
MyClass object = new MyClass();

would there be a way to accomplish the same thing by doing something similar to this?
Class clazz = MyClass;
clazz object = new Object();

small current
#

if i store data like itemstack and ... on the InventoryHolder, will it cause problems ?

#

like if the inventory is no more of a use will java get rid of it or what

ionic crest
#

yeah but I can't use that for instantiation

#

so like I wouldn't be able to do ArrayList<clazz> list = new ArrayList<>()

small current
#

you can just do getConstructors[0]

#

or getDeclaredConstructor

ionic crest
#

yeah i was wondering how i could make it work

#

but i think reflection might be good for what im tryna do

#

i think i have to lol

tardy delta
#

this is hot

hasty wasp
#

Is there a way to create these structure block like borders for a region in spigot and if yes how?

tardy delta
#

or good ol' reflection

ionic crest
#

so i have this loop where CustomEntity takes a entity type that extends entitycreature

for (EntityTypes type : types) {
    list.add(new CustomEntity<???????>(loc, type, as));
}
#

the ???? is supposed to be like EntityCreeper, EntitySheep, etc.

#

depending on the variable type

#

yeah i guess so

#

but i cant do that right

tardy delta
#

i'm thinking about a Function<Entity, CustomEntity> lol but idk what you need it for

ionic crest
waxen plinth
#

What's the purpose though

#

Also this can't fully represent a type

tardy delta
#

are you overriding nms code?

ionic crest
#

so if I just have one CustomEntity<T extends EntityCreature> i can just put one identical path finding method for every single mob

waxen plinth
#

Yeah but how does that help you

ionic crest
tardy delta
#

i'm thinking just have a default method that does some stuff :/

#

but idk how things are set up

waxen plinth
#

...

ivory sleet
#

Not really, only if you retain the type at runtime

dull whale
#

I have a java question, say I have a class for player data. If I put the Player as a variable in it, does it cost no extra memory and exist only as a referance thing or it takes as much memory as the Player class costs?

tardy delta
#

no more dealing with exceptions ig

ivory sleet
#

Its significantly harder if you create a public library for the world to consume

floral drum
#

how large is it LOL

tardy delta
#

references are small so dont bother about it

waxen plinth
#

You also never really need to instantiate one like that

#

Because you can always just infer

dull whale
#

ty

waxen plinth
#

And that can't fully represent types

tardy delta
#

a 6mb jar :C

floral drum
#

why so big

waxen plinth
#

For example Map<String, List<Integer>>

floral drum
#

not for a plugin unless it's huge

waxen plinth
#

6mb is huge for a plugin

tardy delta
#

idk wondering if thats big for a jar

#

ahh

waxen plinth
#

<>

hasty wasp
#

nah its normal if you use guice or okhttp e.g.

waxen plinth
#

Why do you need okhttp

ivory sleet
#

pvbble same whem you use var

waxen plinth
#

You can make web requests in vanilla Java

ivory sleet
#

The type is understated

hasty wasp
tardy delta
#

ij ultimate issue ig

floral drum
#

ngl you could probably do that with normal java?

ivory sleet
#

var x = "x"

waxen plinth
ivory sleet
#

The type of x is String

#

Thats type inference

#

Its not typed out

waxen plinth
#

It's not reinventing the wheel to use the standard library instead of shading fucking okhttp to make your plugin megabytes larger

ivory sleet
#

But java is smart enough to figure out the type

#

well for generics you can instantiate them really

#

They’re at a higher level

waxen plinth
#

No

ivory sleet
#

They dont really have anything in particular that touches objects/instances all by themselves

waxen plinth
#

But when you do know the base type you can

#

You don't actually need to know the generic types because they're erased at runtime anyways

#

So constructing only requires knowing the base class

ivory sleet
#

Yeah

waxen plinth
#

Then you take in a Supplier

ivory sleet
#

Like a collection class

waxen plinth
#

I don't really know what there is to show

#

A Supplier has a function to supply an instance of a given type

#

Wherever you need to instantiate that unknown type you take a Supplier<T> with T being the type

#

It's a functional interface

#

Collecting to an array is an example I guess

#

Let's say you have a List<String> you want converted to an array of lowercase strings

#

list.stream().map(String::lowercase).toArray(String[]::new)

#

The toArray call takes a Function<Integer, T[]>

#

Which is similar to a Supplier but it takes an int to indicate the size of the array

tardy delta
#

anyone knows what the dif is between sqlite DOUBLE and DOUBLE PRECISION?

waxen plinth
#

I would guess they're the same

tardy delta
#

mmh no idea

waxen plinth
#

Take a supplier

#

"instantiate a generic" doesn't make sense

#

You can't do new T() if that's what you mean

#

But you just take in a Supplier<T>

#

You take it as a parameter to your function

boreal python
ivory sleet
#

it means you pass an argument that knows how to create instances of said type

tardy delta
#

and REAL seems to be the same as DOUBLE lol

waxen plinth
#
public static <T> List<T> makeList(Supplier<T> supplier, int count) {
    return Stream.generate(supplier).limit(count).toList();
}```
#

Or

#
List<T> list = new ArrayList<>();
for (int i = 0; i < count; i++) {
    list.add(supplier.get());
}
return list;```
#

supplier.get() supplies an instance of T

#

So you could do

#

makeList(Math::random, 100)

#

This would get you 100 random numbers 0-1

orchid portal
#

help how to get dear variable (Plugin)

waxen plinth
#

dear variable plugin

tardy delta
#

?di

undone axleBOT
waxen plinth
#

Seems like you don't have one, if you're in the main plugin class you can use this

tardy delta
#

why would it work? use dependency injection to get your plugin instance ^^

waxen plinth
#

Huh

#

How can it not be type T

tardy delta
#

Supplier<T> returns an instance of T lol

waxen plinth
#

A Supplier<T> gives you instances of T

#

In this case, Double

#

Then the Supplier would need to pass them into the constructor it's calling

orchid portal
waxen plinth
#

Or you would pass in a Function that can take in parameters and pass them through to the constructor to make an instance

undone axleBOT
waxen plinth
#
public <T> T[] makeArray(Function<Integer, T[]> arrayMaker, Supplier<T> itemMaker, int count) {
  T[] arr = arrayMaker.apply(count);
  for (int i = 0; i < count; i++) {
    arr[i] = itemMaker.get();
  }
  return arr;
}```
#

makeArray(Double[]::new, Math::random, 100)

#

Same as

#

makeArray(i -> new Double[i], () -> Math.random(), 100)

dull whale
#

does making anything async make any performance difference?

waxen plinth
#

It can

tawdry python
#

Is there a way to check what kind of generator the player has in their inventory

dull whale
waxen plinth
#

In what sense

waxen plinth
tawdry python
waxen plinth
#

Iterate through the items in their inventory

#

See if they have one

sterile token
#

Hey stop it please

#

Stop arguing

waxen plinth
#

??

#

Who's arguing

#

Initialize each command how

sterile token
#

A guy asking for su domain help was arguing with another

waxen plinth
#

Do you want to try my command framework

#

It's new and shiny

dull whale
# waxen plinth It can
        Bukkit.getScheduler().runTaskAsynchronously(Main.get(), () -> {
            for (int i = dataList.size() - 1; i >= 0; i--) {
                PlayerData data = dataList.get(i);
                if(data.getP().getUniqueId() == p.getUniqueId()){
                    p.getPersistentDataContainer().set(new NamespacedKey(Main.get(), "dataID"), PersistentDataType.SHORT, (short) i);
                    p.getPersistentDataContainer().set(new NamespacedKey(Main.get(), "lastMenuID"), PersistentDataType.BYTE, (byte) -1);
                    break;
                }
            }  
        });
``` anything wrong with this?
tawdry python
waxen plinth
#

I need more info about what you're trying to do before I can help though

tardy delta
#

why async?

sterile token
#

Redempt when is your cmd framework rexoded

waxen plinth
#

Looks like you should be using a map

waxen plinth
#

It's already good to go basically

sterile token
tardy delta
#

guess i fucked up

waxen plinth
#

It's much better than RC already especially because it has unit tests

dull whale
tardy delta
#

still..

waxen plinth
#

Map<UUID, PlayerData>

dull whale
#

how slow it can possibly get because I dont think it can make a big problem when I do it async

#

idk

sterile token
waxen plinth
#

Just use a map ffs

#

You don't need an async loop over an array checking equality of a field to find one specific element

#

Use a map

dull whale
#

does this make any sense

sterile token
dull whale
#

but doesnt it only effect the player who joined when I use async?

waxen plinth
#

use a map

#

use a map

#

use a map

sterile token
#

Use a map

waxen plinth
#

use a map

tardy delta
#

next question: what is a map

dull whale
#

no really

#

I was using it

sterile token
#

Do you want so

dull whale
#

changed it today

sterile token
#

😂

#

Do what you want its simple

sterile token
#

??

tardy delta
#

theres no reason to use async here

sterile token
#

Agree

dull whale
#

I got it wrong then :D

tardy delta
#

no it doesnt

dull whale
#

ok ill change it

sterile token
#

I thinking he didnt learnt kava

dull whale
#

I swear i did :(

#

i had a wrong idea with async only

sterile token
#

Either that or logic problems

tardy delta
#

had issues with async before too

waxen plinth
#

Rust plugins when

sterile token
#

Yes async is really painfull

dull whale
#

logic problem I thought when I use async it would only make a pause for the playerjoined event thread for that player onl

sterile token
#

I have problems with it

waxen plinth
#

Can't have async issues if your code won't compile

tardy delta
#

lmfao

#

anyways, there no need to do it async, your code isnt doing some expensive computations (hoping your list doesnt contain 2 million users tho)

#

if you'd for example load an user from the database, ye then async is useful

dull whale
waxen plinth
#

M a p

dull whale
#

i got it

tardy delta
#

well youre using a map now anyways so doesnt matter

sterile token
#

Redempt he is trolling

tardy delta
#

lol

sterile token
#

I have dm conclure to take Actions

tardy delta
#

verano on weed again?

sterile token
#

You have tell him a Map in a round of give

waxen plinth
#

I should get on weed like if you agree

#

DM me

tardy delta
#

i should get alcohol

sterile token
waxen plinth
#

GOOD idea

tardy delta
#

smirnoff what

sterile token
#

Let go to drink and just do our things

tardy delta
#

then my code will complain even more

sterile token
#

Hahaha

#

Mi es too

tardy delta
#

changed smth in ij settings and now @Language("SQL") is yelling at me 🤔

#

🤷‍♂️

#

worked before

sterile token
#

Try other ""

#

'SQL'

tardy delta
#

thats not how a char works mate

sterile token
#

Im trying to halp just

#

I wish discord has audio settings

#

😡

tardy delta
#

it has?

#

ooh ultimate has docker support

sterile token
#

I mean audio like talking instead of texting or callong

sterile token
#

Just realize

orchid portal
tardy delta
#

hmm i can manually inject language thro ide settings but that goes brr

sterile token
#

Fourten

#

Why do you use langannot!

#

Just add a plugin

#

I dont know why you are reinventing the wheel if its already invented

grand pebble
#

@sterile token ! (Sorry for ping) I found the solution for my problem (check thread)

sterile token
#

Oh

#

I will heck 8t

grand pebble
#

👍

sterile token
#

Not worry for ñinging

tardy delta
#

cuz @Language worked before lol

halcyon mica
#

Is it possible to process an event after it has been processed?

#

I need to modify a brewing stand inventory after inventory click events inside of it have been processed

tardy delta
#

wdym after it has been processed? after the tick has happened?

halcyon mica
#

After the event has been passed down to other event handlers and is considered complete

#

i.e. after any potential changes to the inventory have been made

#

Including vanilla behaviour

tardy delta
#

if youre still in the tick when the event happened ig

halcyon mica
#

This is not tick driven

#

It's event stuff

tardy delta
#

well i mean if the tick of the event has passed you are modifying an event that wont change stuff in the game anymore

halcyon mica
#

Yeah, but I can't check for every brewing inventory every tick

#

I need to be able to catch a event and add a post process hook or smth like that

mellow pebble
#

hi guys im trying to make practice core plugin and i really dont know how should i remove all blocks from map when game ends ?

#

should i try to save every coordination of block that player placed and then replace that block with air

#

or does someone have better idea ?

waxen plinth
#

Disable world saving

mellow pebble
#

so if that is off (in server properties i guess) it is not a problem to make players be able to place blocks

waxen plinth
#

You call setAutosave(false) on the world

#

And you disable saving on every ChunkUnloadEvent

mellow pebble
#

and if i have many players and all of them want to play unranked builduhc how do i put them on the same map ?

waxen plinth
#

Should do the trick

waxen plinth
#

Make duplicates

mellow pebble
#

and what would be the best the best way of keeping players that are on one map

#

should i save them in list per world

#

or should i do something else

shrewd sphinx
#

day 20 of watching paint dry waiting for plugin ideas to come to mind

waxen plinth
#

Then you can just call getPlayers() on the World

fluid river
#

100 worlds running on one server

#

💩

small current
#

spigotmc website is not loading for some reason, how can i send the achivement pop up to a player

fluid river
#

probably Advancement

#

you need

#

Player.getAdvancementProgress()#

small current
#

should i use packets ?

#

i have to get spoonfeeded cause spigotmc is not loading

#

if check-host works for you guys check it for iran