#dev-general

1 messages ยท Page 159 of 1

quiet depot
#

no

#

void is the absence of a return type

viscid charm
#

yes

#

u didnt put void on

quiet depot
#

I did?

viscid charm
#

COolObject

quiet depot
#

ah

prisma wave
#

Because it's a constructor

viscid charm
#

you didnt put void on CoolObject

#

OHh

quiet depot
#

will get onto constructors in a minute

viscid charm
#

i see yea

#

BUT every method requires a void right?

#

Like in the syntax

quiet depot
#

CoolObject obj = new CoolObject("test");, and it's id is 1, then obj.setTest("test2");
what do you think the id of obj is now?

#

no, not every method is void, some have return types

viscid charm
#

obj.setTest("test@" same id

quiet depot
#

correct

#

now, this is also a good time to go back to the levels I was talking about earlier

#

class level and local level

#
public final class CoolObject {
  private String test;

  public CoolObject(String test) {
    this.test = test;
  }

  public void setTest(String test) {
    this.test = test;  
  }
}```

as you can see, in the setTest method, we've got a parameter (variable) called test, but the class also has a field called test

#

we can reference the class's test, via this

#

we don't access it via CoolObject.test, because test is bound by the classes instance, not the class itself

#

we know this, because it doesn't have static infront of it

#

now, about constructors

#

constructors are effectively a type of function, and they do have a return type

#

the return type is the class itself

viscid charm
#

wait one sec

#

public CoolObject(String test) {
this.test = test;
}

"we don't access it via CoolObject.test, because test is bound by the classes instance, not the class itself
"

#

You mean like this

#
public CoolObject(String test) {
    this.test = test;
CoolObject.test
  }
#

right?

quiet depot
#

well, remember my previous example on the hello world thing?

obtuse gale
#

How do i run an intellij scratch file? Everytime i press the green arrow this is printed fun main(): Unit

quiet depot
#

where I did System.out.println(HelloWorld.MESSAGE);?

viscid charm
#

yea

dusky drum
#

from when doesnt spigot have gson inside?

quiet depot
#

it still has gson shaded

#

fresh, that's because MESSAGE is bound by the class, not instance

#

since test is bound by the instance, not the class, we don't prefix it with the class name

#

and since the name test is also being used by a local variable, we can access the class-level test field, via the keyword this

prisma wave
#

@obtuse gale kotlin scratches are scripts, they don't have main functions. They just execute from top to bottom

viscid charm
#

WAIT

#

wheres the instance here tho?

#
public final class CoolObject {
  private String test;

  public CoolObject(String test) {
    this.test = test;
  }

  public void setTest(String test) {
    this.test = test;  
  }
}
#

you didn't create new <-

quiet depot
#

CoolObject obj = new CoolObject("test");, and it's id is 1, then obj.setTest("test2");

obtuse gale
#

I pressed run and now it just printed this

#
val parsed: String


val regexed: String```
viscid charm
#

Oh

dusky drum
obtuse gale
#

ew

dusky drum
#

friking snapshot

#

how da fk

obtuse gale
#

nvm got it working

quiet depot
#

how da fk
@dusky drum every spigot version is a snapshot, they don't do releases for some reason

viscid charm
#

What did u mean by this tho

#

"we don't access it via CoolObject.test, because test is bound by the classes instance, not the class itself
"

dusky drum
#

its 2200 versions behind.

quiet depot
#

ok, so, in the HelloWorld example, we access the class level field MESSAGE, via HelloWorld.MESSAGE

#

so, naturally, you'd assume to access test in the setTest method, you'd also do CoolObject.test

#

but, since test is not static (bound by the class), that's not the case

viscid charm
#

wait no but

#

public void setTest(String test) {
this.test = test;
}

#

What test are we planning on using tho?

quiet depot
#

so, when you use that method, you provide a string

#

that string is a variable, called test

#

that's a variable that exists at the local scope

#

the method sets the class level test variable, to the value of the local scope test variable

viscid charm
#

public void setTest(String test) {
} ^ Lets assume this is the thing for now

#

you said that string is a variable

#

how so?

#

ok well yea

#

its a variable yea

quiet depot
#

aight so, as you should've deducted by now, there's multiple variables types in java

#

for example, fields

#

the variable declared there is a parameter

viscid charm
#

Yea so the parameter variable is waht u meant right?

lunar cypress
#

It's a variable with the special property that it's assigned on each method call

viscid charm
#

so what did you mean this.test = test;?

#

this.test <- does that mean the parakmeter variable = test?

quiet depot
#

that specific statement assigns the class level variable (field) test, to the local level variable (parameter) test

#

this accesses the class scope

viscid charm
#

wait so

#

JAVA Public void setTest(String test) <- THAT IS Field or Parameter??

quiet depot
#

String test this bit is a parameter

viscid charm
#

parameter is mroe general then field?

quiet depot
#

No

#

it's merely another type of variable

viscid charm
#

OH so field is what you put inside the thing like a variable and the parameter means whatever is insid ethe brackets

#

like field is inside the setTest

quiet depot
#

fields are class level variables

viscid charm
#
public void setTest(String text) {
String hello;

}```
#

hello is a field

quiet depot
#

no, that's a variable

viscid charm
#

and String text is parameter

#

Why is it not a field?

quiet depot
#

fields can only exist at the class level

viscid charm
#

It needs to be initialized to be a field?

#

oh

#

so watever is inside that method

quiet depot
#
public final class CoolObject {
  private String test; // this is a field
}```
viscid charm
#

is not a FIELD?

quiet depot
#

correct

#

however, keep in mind, you can access fields in a method

viscid charm
#

what do u call shit which is inside method

#

like a variable

quiet depot
#

yes

#

just call them variables

viscid charm
#

no speicifc word?

#

ok

quiet depot
#

I mean you could call them local variables

viscid charm
#

But what about the

#

Variables inside the parameters

#

like for example

#

public void setTest(String text) {

#

isnt text a variable?

quiet depot
#

text is a variable

#

a parameter is a type of variable

viscid charm
#

anything more speicfic tho>?

quiet depot
#

text is a parameter

#

that's the specific part

viscid charm
#

I thought Parameter is everything INSIDE the brackets

#

rahter tahn text

#

text is just the name of the String right?

quiet depot
#

essentially

#

methods can have multiple parameters

#

e.g.

viscid charm
#

So what is the text called alone

quiet depot
#
public void setTest(String test, String someOtherString)```
viscid charm
#

what about be both test and someOtherString be called

#

other than variables?

prisma wave
#

Parameters

quiet depot
#

they're both parameters

viscid charm
#

BVut isnt parameters both

prisma wave
#

Yes

viscid charm
#

String test <- isn't that the parameter

prisma wave
#

They are both parameters

viscid charm
#

so how can test be parameter?

prisma wave
#

2 separate parameters

viscid charm
#

we cant call test parameter can we?

prisma wave
#

Why can't we?

quiet depot
#

the specific text test in that code, is the name of a variable, and that variable is a parameter

viscid charm
#

Cus isnt parameter the entire String test?

#

So it would be fine to call the variable name a parameter?

prisma wave
#

Oh

#

"test" would be a parameter name

quiet depot
#

call the variable name what it is, a variable name

viscid charm
#

Ok

#

so when you do this.test = test;

#

this.test <- is taht the parameter name?

quiet depot
#

no

#

this.test = test <- this is the parameter name;

viscid charm
#

this.test = test;
What is Left side and what is right side?

quiet depot
#

field = parameter

viscid charm
#

Right side = parameter name?

quiet depot
#

yes

viscid charm
#

public void setTest(String test) {
this.test = test;
^ parameter name like the "String test <-" part

}

quiet depot
#

yep

viscid charm
#

ok then what is this.test?

quiet depot
#

let's break it up

#

ignoring the this, test refers to the field called test

#

since there's also a parameter called test, we have to use this, to tell java to target the field

#

not the parameter

#

this, refers to the current instance of the class we're operating in

viscid charm
#

wiat wat was field again?

quiet depot
#
public final class CoolObject {
  private String test; // this is a field
}```

@quiet depot

viscid charm
#

Class level variables ok

#

IS PARAMETER name a class level varaible?

quiet depot
#

no

viscid charm
#

Ah ok

quiet depot
#

parameters are local variables

viscid charm
#

BUT

#

VARIABLES Inside a method which are NOT parameter names are ALSO local varialbes right?

quiet depot
#

correct

viscid charm
#

ok

quiet depot
#

@prisma wave take notes lol, you should cover all this shit in your tut

dusky drum
#

which function is the best for sending area sounds?

prisma wave
#

Yeah I am lol

#

This is good

viscid charm
#

I know a good ass tutorial on youtube one of the best ones i found I was gonna watch this but i just asked some questions :P

quiet depot
#

link

viscid charm
quiet depot
#

I'm yet to find a "good" tutorial after years of searching

viscid charm
#

I watched many tutorials and I didnt get it

dusky drum
#

howly 6:48h

viscid charm
#

butI watched that one i goot it, Then I quit for like 6 - months or 1 or 2 years

quiet depot
#

yeah nah i'm good lol not watching that shit to determine it's quality

dusky drum
#

ohhhh indian english yes

viscid charm
#

and i forgot it so rip

#

CodeAcademy was also good

hot hull
#

No

#

It's absolute garbage

viscid charm
#

why?

dusky drum
#

i learned java by looking into all stuff on oracle XD

#

i was brain washed

viscid charm
#

Dude oracle hurts my eyes man

hot hull
#

You can probably find docs on why it's trash

#

Many people went over it

dusky drum
#

?

viscid charm
#

i liked the video i linked the most

#

outta everything i did

#

Oh

#

and the online docs

#

NO THX

#

I seen the online docs

hot hull
#

Not what I'm implying

viscid charm
#

I prefer either reading a book like they taught in school OR the video

dusky drum
#

then order one

quiet depot
#

fresh, it's of paramount importance that you do not hold any information from tutorials like these orthodoxically

viscid charm
#

I took programming way back in grade 10, regret not taking it later on

quiet depot
#

you should assume at all times, that the content in the video, is plain wrong

#

because it usually is

viscid charm
#

Y?

dusky drum
#

when you take programing classes in slovenia you learn cout << "THIS IS COUT" << endl; YESSSSSS

#

i've learned i know more than professors

viscid charm
#

but if someone teaches at schools and universities they shud be good right?

quiet depot
#

I'm sure they excel in other areas

viscid charm
#

they cant be wrong

quiet depot
#

no fresh

hot hull
viscid charm
#

and teach in universities and schools

quiet depot
#

you should always assume everyone is wrong

#

especially yourself

viscid charm
#

lol wait wat y?

quiet depot
#

that doesn't mean you can't use and apply the information you learn

#

just remember it's probably not the best way

viscid charm
#

one of my devs said best way was to buy Java 8 Book from Amazon and go over it

dusky drum
#

teachers usually teach the easiest way to learn not the best way one.

quiet depot
#

well, that may be your dev's opinion

#

but it's just that

viscid charm
#

i think its better to learn from someone who has taught java to students for many years

#

sot hey streamline their shit so that the students understands it

#

the best

hot hull
viscid charm
#

it asks to log in

#

CA$154.99

#

not 12$

quiet depot
#

personally, I learn best when taught irl, hands on; i'm a kinaesthetic learner

hot hull
#

Oh rip then, sale gone

quiet depot
#

fresh it's on sale frequently

viscid charm
#

Yea like they teach in schools @quiet depot

quiet depot
#

they don't teach in the schools where I'm from ๐Ÿ˜ฆ

old wyvern
#

I mean I have a DSA professor who has been teaching for a some time now and looks like he has a stroke everytime he tries to convert any of the algorithims he teaches to C xD

viscid charm
#

well ok thats not full hands on so nvm

#

they talk about it and if you have questiosn you can ask

#

but you follow the instructions in book

quiet depot
#

I mean I have a DSA professor who has been teaching for a some time now and looks like he has a stroke everytime he tries to convert any of the algorithims he teaches to C xD
what does he use to teach them?

#

the p word language?

old wyvern
#

yea pseudo code

quiet depot
#

lol

old wyvern
#

xD

quiet depot
#

i mean python is basically pseudo code

hot hull
#

ew python

old wyvern
#

He hates python as well

viscid charm
#

y hate python?

old wyvern
#

I mean I like that he hates it

#

but yea

quiet depot
#

does he actually use python or pseudocode?

old wyvern
#

pseudocode

quiet depot
#

thought u were joking lol

old wyvern
#

oh no I was beign srs xD

lunar cypress
#

I thought you meant pascal by p word lool

viscid charm
#

isnt pseudocode just code where you explain what your code is in shit like // or /* */

quiet depot
#

I said p word because I fucking hate python

hot hull
#

php, get rekt noob

old wyvern
#

We correct the dude everytime

quiet depot
#

i'll try make that more obvious next time

dusky drum
#

why do you have python?

lunar cypress
#

Poor python

old wyvern
#

One of my friends likes python a lot and whenever he shows the prof something in python he screams at the dude

dusky drum
#

hate*

hot hull
#

Cause python doodoo

quiet depot
#

@viscid charm those are comments

viscid charm
#

then what is pseudocode?

quiet depot
#

pseudo code is a general, understandable execution process of code, written however the fuck you want to write it

viscid charm
#

wtf they said thats waht pseudocode was

quiet depot
#

it's not a real language

old wyvern
#

ouch barr

#

mhm

quiet depot
#

hate*
@dusky drum python is just a terribly designed language

dusky drum
#

ok

old wyvern
#

very

quiet depot
#

it's on par with javascript

hot hull
#

Kotlin on the other hand, what a beaute

quiet depot
#

fingers crossed for python 4

old wyvern
#

I like js slightly more ๐Ÿ™ƒ

dusky drum
#

c++ wins

quiet depot
#

same lol

old wyvern
#

fingers crossed for python 4
When is it comin?

quiet depot
#

soonish I expect

old wyvern
#

ah

quiet depot
#

I prefer js over python any day

lunar cypress
#

it's on par with javascript
@quiet depot bad opinion

viscid charm
#

yo quick question

quiet depot
#

it's not based on fact johnny

dusky drum
#

LUA the best!

quiet depot
#

but you can't lie

#

python is terribly designed

viscid charm
#

if short is more efficient than int in terms of like data why dont more devs use SHORT

old wyvern
#

^

viscid charm
#

instead of int

dusky drum
#

check out lua Piggy

quiet depot
#

I've used lua before

viscid charm
#

assuming they arent gonna go above a certain amount of numbers

lunar cypress
#

Who said that short is more efficient than int

#

Because it isn't, mostly

old wyvern
#

if short is more efficient than int in terms of like data why dont more devs use SHORT
Not more efficient, uses less bits

dusky drum
#

I've used lua before
interesting

viscid charm
#

Uses less data so doesnt it make it more efficient?

quiet depot
#

lua is fine

#

better than python

old wyvern
#

Wait until you hit an overflow

dusky drum
#

if not work then

quiet depot
#

lua is especially great as a scripting language imo

hot hull
#

Fresh, it's nominal

old wyvern
#

Uses less data so doesnt it make it more efficient?
Barely anything at this day and age

quiet depot
#

it's also used in modding for games

#

not sure where else it could be used

lunar cypress
#

they're still stored like an int

dusky drum
#

idk where

viscid charm
#

what do u mean nominal @hot hull ?

hot hull
#

Meaning just use int

viscid charm
#

shouldnt we use short if we can instead of int?

dusky drum
#

i know lua from fivem, used to make resources for fivem (scripts for servers).

lunar cypress
#

No

hot hull
#

No point

viscid charm
#

isn't it good practice to do that when int is not required you can just use short?

lunar cypress
#

No not really

hot hull
#

i know lua from fivem, used to make resources for fivem (scripts for servers).
Thank god that a c and not a k

quiet depot
#

only time I've seen short used in java is when networking is involved

old wyvern
#

shouldnt we use short if we can instead of int?
If you are absolutely sure your value wont exceed it you can, unless you want to face an overflow.
XD
its ussually just good practice to just use ints

#

Its just a 2 byte difference

dusky drum
#

2 byte is 2 byte

viscid charm
#

OH if the options are like 1 - 2. Still use an INT?

quiet depot
#

if they're 1 or 2, use a boolean

dusky drum
#

1-2 use boolean

old wyvern
#

2 byte is 2 byte
Overflow is overflow

viscid charm
#

1 - 3*

hot hull
#

I mean if you're concerned about an int instead of a short, you should look at your other parts of the code

dusky drum
#

then use the shortest stuff there is

quiet depot
#

really depends what those numbers represent fresh

lunar cypress
#

You guys don't really get it. The JVM is optimised for ints and you mostly don't even end up saving anything when using short

viscid charm
#

Would using an INT over a short make the code more readable? If thats true then it makes sense to use int over short (EVEN if u dont need to use int)

lunar cypress
#

What does that have to do with readability

hot hull
#

Nothing fingerguns

viscid charm
#

it makes it mroe readable tho

hot hull
#

How so?

viscid charm
#

ur more familiar with ints,

#

most people are

#

rather than shorts

hot hull
#

:what:

old wyvern
#

the smallest unit of data on the JVM stack is 32 bit

quiet depot
#

only people who don't code would have that opinion fresh

old wyvern
#

Nice

heady birch
#

Well it would signify the possible range

distant sun
#

Things arent always pretty ๐Ÿคท

heady birch
#

I Barely ever use shorts or bytes unless its networking

viscid charm
#

OH byte is the smallest

#

not short

heady birch
#

boolean ๐Ÿ˜„

hot hull
#

bruh just forget those two exist, you'll never use them (and if you do, it's going to be specific af)

dusky drum
#

true

#

but it says byte is for saving memory whoever said there is no difference.

hot hull
#

Just like everyone should forget that Thread.sleep exists fingerguns

viscid charm
#

Ok but if thats the case why not use Long over INT?

hot hull
#

Because overkill

dusky drum
#

yep

viscid charm
#

cus Long would mean that in case it EVER gets to HUGE ass numbers you won't fk up or something

heady birch
#

why not use BigInteger ๐Ÿ™‚

viscid charm
#

oh whats that?

dusky drum
#

why not use STRING?

lunar cypress
#

the smallest unit of data on the JVM stack is 32 bit
@old wyvern yeah that's what I was talking about. Primitives are stored on the stack where you can't get any smaller than 32 bit

heady birch
#

big integer is string

viscid charm
#

String not a number tho

hot hull
#

Use a string and count the chars :kek:

distant sun
#

Niall, dont

heady birch
#

basically

hot hull
#

Y'all confusing this man now

viscid charm
#

O i thought it was 8 bit

#

I thought byte was 8 bit

lunar cypress
#

doubles and longs take up to places on the stack

old wyvern
#

yes it is pepper

distant sun
#

You need an entire machine to store 10^100

dusky drum
#

btw long is usualy used for hex stuff in java if im not wrong.

heady birch
#

long is used often

lunar cypress
#

which is why they can't be modified atomically btw

heady birch
#

currency and timestamps and stuff

dusky drum
#

ye

viscid charm
#

long would be useful for prisons where balances are like in trillions

lunar cypress
#

not without further measures that is

dusky drum
#

isnt currency usually in double?

hot hull
#

You'd use BigInteger for that Fresh

quiet depot
#

no

#

lol

lunar cypress
#

isnt currency usually in double?
@dusky drum Not if you actually need accuracy

distant sun
#

BigInteger bad

viscid charm
#

Double I think

hot hull
#

ew Gasper, imagine having a currency which supports decimals

viscid charm
#

you'd use double i think

dusky drum
#

frosty you have cents?

hot hull
#

No

dusky drum
#

yes

hot hull
#

No clue what that is

dusky drum
#

XD

#

price 99.99โ‚ฌ

hot hull
#

Nah it's 99

dusky drum
#

whats that .99

#

?

viscid charm
#

but everything piggy explained me, you guys think the spigot devs would know it xD?

quiet depot
#

no

#

well yes

viscid charm
#

wait actually?

quiet depot
#

it's sort of common sense

#

they probably wouldn't explain it like I did

#

but they'd understand it

viscid charm
#

O

dusky drum
#

anyone has idea why when water flows over crops and breaks them in fromtoevent even if i set crop.type = Material.AIR it still drops seeds?

#

like water flows faster than event ends?

hot hull
#

Does it have a drops list?

quiet depot
#

I'd imagine because the event wasn't cancelled

dusky drum
#

but then water wouldn't flow

quiet depot
#

exactly

#

and if the water flows, the item breaks

#

no way to prevent it that way

dusky drum
#

i did it in java

quiet depot
#

you'd need two separate events

dusky drum
#

idk why i cant in kotlin

quiet depot
#

oh

#

yeah no fucking clue lol

dusky drum
#

ye thats just spigot i guess

quiet depot
#

no

#

that's kotlin

dusky drum
#

nnooo

#

i did something different in java

#

not sure what

quiet depot
#

just paste your java code into ij?

dusky drum
#

gonna try

quiet depot
#

it'll convert it to kotlin, and preserve semantics

prisma wave
#

most of the time

dusky drum
#

since i used event.block and not event.toblock but event.block is always AIR for some reason.

quiet depot
#

shit's funky

dusky drum
#

nvm

viscid charm
#

yo guys if you put a double into a int, it will lose some data like their decimal value. But what would happne if you put an int into a byte would it just lower the value to less than 127?

dusky drum
#

its same

prisma wave
#

Spigot messy

dusky drum
#

im fucking confused now

viscid charm
#

double d = 5.5;
int i = d;

system.out.println(i);

#

it will show 5

#

so it lost 0.5

hot hull
#

bruh what is that spacing

viscid charm
#

what would happen if you do something like that with int to byte <-?

hot hull
#

Also fix that beggining of arrow code fingerguns

viscid charm
#

Would it lose value or give error?

lunar cypress
#

over/underflow is what happens

dusky drum
#

round the value.

viscid charm
#

it will round the value or throw over/underflow?

lunar cypress
#

how does rounding help when you take 3/4 of the size away

viscid charm
#

wait no it will be compilation error

old wyvern
#

overflow is not an exception

viscid charm
#

i remember i tried it

old wyvern
#

its a bit overflow

#

Your sign bit gets inverted

lunar cypress
#

it's not a compilation error

old wyvern
#

So you end up at the negative end

dusky drum
#

oh and did spigot 1.8 not have gson shaded in?

quiet depot
#

spigot 1.8 has gson

viscid charm
#

public class FirstCode {

public static void main(String args[]) {


    int i = 128;
    byte b = (byte)i;
    System.out.println(b);
dusky drum
#

cause that person still gets NoClass error

viscid charm
#

It gfave nothing

quiet depot
#

tell them it's a case of pebcak gasper

viscid charm
#

yea it shows nothing

#

in println

old wyvern
#

Try something out of byte range

quiet depot
#

128 is out of range

old wyvern
#

256+ numbers

viscid charm
#

127 is max nubmer

#

it can process

#

byte can only do 127 to-127

old wyvern
#

wasnt 8 bits up to 256

lunar cypress
#

no

old wyvern
#

Oh nvm

viscid charm
#

No thats short i think

quiet depot
#

bytes are -128 to 127

lunar cypress
#

are you sure you even ran the programme

viscid charm
#

yes i ddi cus it said hello world

lunar cypress
#

I just did the same and it overflows as expected

quiet depot
#

paste the whole code

viscid charm
#
public class FirstCode {

    public static void main(String args[]) {


        int i = 128;
        byte b = (byte)i;
        System.out.println(b);

        Herro.HerroDer.hello();

    }

    public static class Herro {

        public static class HerroDer {

            static void hello() {
                System.out.println("Hello World");
            }

        }

    }

}```
quiet depot
#

should work ยฏ_(ใƒ„)_/ยฏ

lunar cypress
#

it's impossible that it doesn't print anything before hello world

viscid charm
#

OH

#

WTF

#

I SEE It now

#

-128

#

wtf?

#

rounded it donw

#

i guess

lunar cypress
#

no

#

no rounding

#

still overflow

viscid charm
#

changed it

#

doesnt say overflow tho

lunar cypress
#

overflow is not an exception

old wyvern
#

We arent talking about a stack overflow

lunar cypress
#

we've been over this multiple times now

old wyvern
#

Thats just a problem with stack datastructures in general

viscid charm
#

why does my eclipse say this about this

#

long l = 21415303450;
The literal 21415303450 of type int is out of range

#

giving me error

#

eventho its a long

lunar cypress
#

it's not a long

viscid charm
#

it says long

hot hull
#

"eclipse"

lunar cypress
#

any numeric literal expression without a decimal point is an int

hot hull
#

There's your first issue fingerguns

old wyvern
#

add an L after the number to specify that its a Long

viscid charm
#

AH i gotit

#

i added L

#

yea

#

why do u have to do that?

lunar cypress
#

I just told you

old wyvern
#

^

viscid charm
#

It doesnt say overflow for me it says these things for me:
"-128
-59533030"

old wyvern
#

It wont "say" overflow

viscid charm
#

Ah so I thought it was cus int is the default for all numbers without decimal point and double for all decimals

old wyvern
#

we litrally told you this multiple times now

viscid charm
#

didnt read my bad

lunar cypress
#

Ah so I thought it was cus int is the default for all numbers without decimal point and double for all decimals
@viscid charm that is why

viscid charm
#

Ok so if
double d = 1.1D; what would be the ending for a int?

lunar cypress
#

when java sees a regular number it doesn'T care about the size it just assumes it's an int

old wyvern
#

Int doesnt need one

viscid charm
#

yea double doesnt need one either

#

but i am wondering

#

so thats why it makes sense to just use int all the time for integers rather than short or byte @lunar cypress

old wyvern
#

No

#

The choice for having ints as the normal was BECAUSE ints are preffered

lunar cypress
#

byte has its purpose

#

especially with arrays

#

in a lot of lower-level applications you need to deal with arrays of bytes

viscid charm
#

wat do u mean by

lunar cypress
#

And arrays are different because they're reference types, meaning only their reference is stored in the 32 bit on the stack

viscid charm
#

lower level applications?

prisma wave
#

fewer abstractions

viscid charm
#

Ok so you know how
int a; The int part is data type. Primitive data type.
Would Player p; for spigot or bukkit or watever be considered a DATA type or just a type?

lunar cypress
#

those are synonyms

viscid charm
#

so Player p; The PLAYER part is a DATATYPE?

prisma wave
#

Type and Data Type mean the same thing

#

And yes Player is a type

viscid charm
#

Data Type seems more specific to me

old wyvern
#

The only difference would be that the Player p; would be a reference to something on the heap while the primitive resides on the stack itself

prisma wave
#

^

viscid charm
#

what do u mean heap?

#

Like in your code?

#

and stack as in JVM?

prisma wave
#

the heap is a section of memory

#

As is the stack

viscid charm
#

wahst the difference then?

lunar cypress
#

read this

viscid charm
#

You learned java from that site @lunar cypress ?

lunar cypress
#

no

#

lol

old wyvern
#

Thats the official documentation xD

lunar cypress
#

it goes into the technical details

#

explains how the jvm works

#

all your specific questions have an answer there

viscid charm
#

Is it best to learn from java documentation?

#

it sucsk to read it tho X_X

prisma wave
#

I will mention that you probably don't need to know how the heap and stack work

#

As long as you know the basic concepts

lunar cypress
#

This is not the type of documentation you start with

viscid charm
#

Woudlnt my plugin be more optimize if I understand it @prisma wave ?

hot hull
#

You're worried about the wrong optimization

prisma wave
#

Knowledge of how the JVM works might allow for potential micro-optimizations

lunar cypress
#

it should be noted that those are expert topics. It's useful to know what you're working with, but it doesn't help you much as a beginner

prisma wave
#

^

lunar cypress
#

you should be concerned with the fundamentals of the language first and foremost

dusky drum
#

i still have no idea why my fromtoevent doesnt work correctly

hot hull
#

Because spigot fingerguns

dusky drum
#

its the same code as java but in kotlin it just doesnt work

heady birch
#

kotlins explicit casting ๐Ÿคข

#

although rust has it

#

but rust does it better

meager cairn
#

Anyone here work with some kind of crate (wheel of fortune) plugin, before? Does the timer when the "wheel" spinning is the same? ๐Ÿค” . Or it stop when it pick the the correct prize ๐Ÿค”

obtuse gale
#

Ive got a command service bean, and it runs on enable, but for some reason my listener service bean doesnt.t.t.

#

its the exact same as the other one, but for listeners not commands

#

in b4 frcsty says baked beans as well

hot hull
#

Baked Beans

heady birch
#

Ive only worked with rust crates

#

Ive got a command service bean, and it runs on enable, but for some reason my listener service bean doesnt.t.t.
@obtuse gale Wot

#

Is this spring?

obtuse gale
#

yea

heady birch
#

Minecraft plugin?

obtuse gale
#

no

#

discord bot

heady birch
#

Send listener class
Make sure its annotated with @Component or something

obtuse gale
#

@Service
class ListenerService @Autowired constructor(
    private val attachment: Attachment,
    private val waiter: EventWaiter,
    private val jda: JDA
) {
    @Bean
    fun listeners() {
        println("Registering listeners")
        jda.addEventListener(attachment)
        jda.addEventListener(waiter)
    }
}```
heady birch
#

Beans are meant to return something

obtuse gale
#

o

#

that would be it

heady birch
#

Just put the listener registring in a

init {
}

block

obtuse gale
#

@heady birch still doesnt printout the thingo

heady birch
#

too early for this

obtuse gale
#

lol

heady birch
#

you gotta use the listener service somewhere I believe

obtuse gale
#

right

#

I never use the cmd service anywhere tho

heady birch
#

show the class now

obtuse gale
#
@Service
class ListenerService @Autowired constructor(
    attachment: Attachment,
    waiter: EventWaiter,
    jda: JDA
) {
    init{
        println("Registering listeners")
        jda.addEventListener(attachment)
        jda.addEventListener(waiter)
    }

}```
heady birch
#

Hm

prisma wave
#

Shouldn't it be a Component

#

Probably won't make a difference but

heady birch
#

both should work

prisma wave
#

ye

obtuse gale
#

my other one is the same

heady birch
#

right service import?

#

org.springframework.stereotype

obtuse gale
#

import org.springframework.stereotype.Service

#

yea

heady birch
#

set log level trace

obtuse gale
#

how what when where

heady birch
#

one sec

#

application.properties

#

logging.level.root=TRACE

regal gale
#

@prisma wave ok so I already tested thing yesterday and apparently it returns MemorySection (yaml class)

prisma wave
#

ah yeah that makes sense

regal gale
#

Guess I have to convert them back to Map...

#

Wait, should I do HashMap or LinkedHashMap?

prisma wave
#

doesn't really matter but probably Linked

remote goblet
#

Whats the difference

prisma wave
#

Linked maintains insertion order

#

HashMap doesn't

regal gale
#

^

#

Uhm.. i think i should do Linked one for the safety of array index preserve..

heady birch
#

I have forgotten the way of manual dependency injection

#

Plugin class as the composition root ๐Ÿคข

#

object1 = new Object1(this);
object2 = new Object2();
object3 = new Object3(object1, object2);
object4 = new Object4(object1);
object5 = new Object5(object3);
object6 = new Object6();
object7 = new Object7(object4, object5, object6);
object8 = new Object8();

#

Makes me sick

prisma wave
#

horrifying

hot hull
#

You disgust me Niall

obtuse gale
#

@heady birch I enabled it, what should I be looking for in the logs?

heady birch
#

anything that mentions that class really

obtuse gale
#

11 results

heady birch
#

@prisma wave me without DI container ๐Ÿ˜ฆ

#

Spigojector

prisma wave
#

clojure doesn't need DI ๐ŸŒš

#

neither does VBScript

heady birch
#

Me.SomeField = False

obtuse gale
#
Creating shared instance of singleton bean 'listenerService'```
#
Creating instance of bean 'listenerService'```
#
Eagerly caching bean 'listenerService' to allow for resolving potential circular references```
heady birch
#

Thats fine

obtuse gale
#
Finished creating instance of bean 'listenerService'```
#

So whats the problem lol

heady birch
#

Probably kotlin fault

prisma wave
#

quiet

#

it's not

heady birch
#

FIx it then

prisma wave
#

no

heady birch
#

Open an issue on kotin bug tracker

#

They will love it

obtuse gale
#

how would one fix this then lol

heady birch
#

Idk

prisma wave
#

sounds like a spring problem

#

spring bad

errant geyser
#

Spring gud

quiet depot
#

guice better

hot hull
#

Baked beans do I hear

heady birch
#

When I am picking a license for an open source premium plugin. I don't want any of this "I contributed 3 lines worth of a null check" and then release there own forked free version, or a forked premium version.
So short term, I would allow:

  • Contribution to the base repo.
  • Forking for private use
  • No forking for public redistribution (free or premium)

and of course bukkit GPL license comes into this:

  • All plugins being required to be GPL because they use Bukkit.
#

Which license is suitable, if not I can write my own pretty easily right?

hot hull
#

Write your own fingerguns

#

And just sue anyone who tries to release it illegaly reversed_fingerguns

heady birch
#

i wouldn't take action

hot hull
#

Time to fork and release as premium then >:}

heady birch
#

FrozenBoard

#

Great name

#

"My board froze plz help"

hot hull
heady birch
#

Like... ๐Ÿ˜ฆ

#

It's all I've ever known

hot hull
#

You don't

regal gale
#

I finally added something on js-expansion :)

heady birch
#

So?

hot hull
#

Is this not correct?

archiveFileName "SpawnerMechanics-${version}.jar"

I had this inside shadow jar, but it doesn't like it

regal gale
#

Instead of doing like this:
var amount = Data.get("data.thing.that")
will be:
var amount = DataVar.data.thing.that

#

Ofc i won't remove the 1st one there

#

Btw, now with array support :+1:

hot hull
#

My IJ's font is cucked, it feels so odd now

onyx loom
#

@hot hull archiveFileName = ""

hot hull
#

smh

onyx loom
#

and does ${version} even work?

hot hull
#

My own string so yes fingerguns

onyx loom
#

ic

distant sun
#

project.version

main grotto
#

When I am picking a license for an open source premium plugin. I don't want any of this "I contributed 3 lines worth of a null check" and then release there own forked free version, or a forked premium version.
So short term, I would allow:

  • Contribution to the base repo.
  • Forking for private use
  • No forking for public redistribution (free or premium)

and of course bukkit GPL license comes into this:

  • All plugins being required to be GPL because they use Bukkit.
    @heady birch don't go for open-source
hot hull
#

Go for OS

main grotto
#

No

hot hull
#

Yes.

main grotto
#

No open-source license would allow him to do that ...

hot hull
#

If he made his own it would

onyx loom
#

project.version
@distant sun thats what i use ye

prisma wave
#

Open source good

onyx loom
#

imagine making ur own string

prisma wave
#

Closed source bad

hot hull
#

Kali, what? I already have a version string so what's the point?

version = "1.0.0"

prisma wave
#

That's shorthand for project.version afaik

hot hull
#

It is yes

prisma wave
#

Groovy is weird

#

I actually had to write some groovy the other day

#

It was a strange experience

onyx loom
#

why strange

#

what u write

prisma wave
#

I was testing how closures work for the pdm plugin

#

They're weird

#

You like make a function and then you initialise it with the receiver type or something

hot hull
onyx loom
#

i kinda like that

hot hull
#

Someone should really make a completelly rainbow plugin

#

Also KM, seems like you can only define 5 colors, which is :((

prisma wave
#

๐Ÿ˜”

heady birch
#

yeah thats what i thought

#

everything i stated kind of.. isnt open source

dusky drum
#

whats so different from 1.16.1 to 1.16.2?

onyx loom
#

great question

#

@heady birch os it no balls

hot hull
#

@dusky drum nms changes, brutes were added

onyx loom
#

but nms still bad yes?

prisma wave
#

it's not great

onyx loom
dusky drum
#

why nms bad?

#

howly they added support for custom biomes

#

wat ta hak

prisma wave
#

messy

dusky drum
#

but will probably get better over time wont iot?

prisma wave
#

maybe a bit

#

but it's always been a mess

dusky drum
#

true

#

but i love new custom biomes feature :3

empty flint
#

Awesome my parser also colors actions correctly now!
@ocean quartz Is that available as open-source? I want to steal borrow your code, it looks dope

obtuse gale
#

That looks like it - I think lol

dusky drum
#

what would be the best way to handle Locales, using enum class?

empty flint
#

what would be the best way to handle Locales, using enum class?
@Gasper Lukman#6926 Resource Bundles

dusky drum
#

wtf is that

#

im on kotlin btw

#

so if anyone has idea how i could handle Locales, instead of getting configuration file each time.

ocean quartz
#

@empty flint Yup it's the link Aj posted but it's not ready for production yet

dusky drum
#

wait can i see showcase @ocean quartz i didnt see it in action

ocean quartz
prisma wave
#

this is a long shot, anyone got any idea why 1 project would deploy to a nexus repository manager instance just fine, but the other would fail with the error peer not authenticated?
For context, I'm running this script on Travis-CI:

echo Publishing Common Lib...
./gradlew common-lib:publish
echo Done!

echo Publishing PDM Runtime...
./gradlew pdm:publish
echo Done!

the common-lib publishes fine, but pdm fails. Completely the same publishing config in build.gradle, credentials are setup correctly

empty flint
#

so if anyone has idea how i could handle Locales, instead of getting configuration file each time.
@dusky drum Im telling you, use Resource Bundles. IntelliJ -> new -> Resource Bundle.

#

Just Google how to use it instead of fucking about with Enums

dusky drum
#

are you fucking retarded thats locales for fucking formating stuff.

ocean quartz
#

I use enums but it isn't great

dusky drum
#

oke.

#

gonna check your github repo to see how ya do it

#

if i can find them

ocean quartz
#

Check triumph-pets

#

The development branch

dusky drum
#

danke

regal gale
#

@prisma wave i did some nasty moves for yaml now ๐Ÿ‘€

#

Converting from MemorySection -> HashMap recursively

hot hull
obtuse gale
#

probably because 1.8

hot hull
#

I managed to fuck up the entire storage system without even touching it

#

๐Ÿ˜•

remote goblet
#

imagine not using RoseStacker peepoHappy

prisma wave
#

@regal gale lol why not just to MemorySection#getValues?

quiet depot
#

@silk jewel are you using bukkit's config api, or snakeyaml directly?

#

#getMapList

#

it's a list of maps

#

they're wildcard generics

#

means the type is unknown

#

equivalent to Object

lavish notch
#

With gradle, I was told I could compile with only what I used in a specific library (in this case, ConfigMe) - to reduce file size. How do I do it?

prisma wave
#

minimize()

#

in the shadowJar closure

lavish notch
#

Could you show me an example?

prisma wave
#
shadowJar {
  minimize()
}```
#

although that's literally exactly what you do

#

lol

lavish notch
#

Just minimize(), or something like minimize(Library)?

prisma wave
#

no

#

literally just minimize()

lavish notch
#

k

#

That didn't seem to do anything

#

My file size is the same

#

Actually I tell a lie - 10kb difference

prisma wave
#

yeah it won't be a significant difference for only 1 library

#

configme is already pretty small afaik

lavish notch
#

My file size is currently 384kb

#

for a super simple, stupid fly management plugin

onyx loom
#

wait thats a thing

#

so how much would it save if i minimize with kotlin ๐Ÿค”

prisma wave
#

not a whole lot

#

between 300 and 600kb usually

#

but imagine using shadow anyway

onyx loom
#

pfff who needs minimize anyway when u have pdm

#

YEP

surreal quarry
#

does anyone know why something would show up in my external libraries, but i wouldn't be able to use the dependency or any of its methods

#

its in mavenLocal()

prisma wave
#

is the jar file right?

surreal quarry
#

yea when i look at it in winrar it has everything i would expect to see

prisma wave
#

build.gradle?

quiet depot
#

winrar

#

smh

#

vb, quick jvm question, is it possible gc is killing my list before my schedule runs?

prisma wave
#

oh boy

#

possibly?

#

i doubt gc is that agressive though, what's the delay on the task?

quiet depot
#

1 - 3 secs

prisma wave
#

hm seems unlikely

surreal quarry
prisma wave
#

which bit in particular is null?

quiet depot
#

no clue

#

it just points to the lambda

#

will try some debugging

prisma wave
#

alrighty

quiet depot
#

ahh

#

sneaky

#

i see the issue

prisma wave
#

what is it?

quiet depot
#

there's a flaw in my logic somewhere

prisma wave
#

@surreal quarry what's the dependency that can't be resolved?

quiet depot
surreal quarry
#

dev.jaims.mcutils:bukkit:2.1.1
and dev.jaims.mcutils:bungee:2.1.1.

quiet depot
#

not sure how that's possible

#

everything is filtered beforehand

#

guess i'll have to debug that too

prisma wave
#

odd

#

yeah

#
publishing {
        publishing {
            publications {
                mavenJava(MavenPublication) {
                    from components.java
                }
            }
            repositories {
                mavenLocal()
            }
        }
    }```

publishing {
publishing {```
?

#

you sure that's correct?

surreal quarry
#

nope lol

#

its probably not

#

changed to

    publishing {
        publications {
            mavenJava(MavenPublication) {
                from components.java
            }
        }
        repositories {
            mavenLocal()
        }
    }```
#

still doesn't seem to be working

#

but i guess ill check the syntax for the rest of it

prisma wave
#

that looks alright

#

you've checked that it's in the correct path of maven local right?

surreal quarry
#

yea
.m2/repository/dev/jaims/mcutils/bukkit/2.1.1/{jar here}

#

same for bungee

#

but bungee instead of bukkit

#

its publishToMavenLocal right

#

for the task

prisma wave
#

not sure

#

try publish

quiet depot
#

does bukkit block have a custom equals & hashcode impl?

#

need to know if I can rely on it in a set

surreal quarry
#

yea publish didn';t change it

prisma wave
#

but subclasses might define one

quiet depot
#

fak

#

maybe the location has one

prisma wave
#

Location definitely has one

quiet depot
#

yep it does

#

neat

#

will just use that

prisma wave
surreal quarry
#

well bm when i use the maven plugin and run gradle install, it works fine

#

nothing appears to change but it works for some reason

prisma wave
#

odd

#

that plugin is deprecated afaik

surreal quarry
#

yea i think it is

#

im not planning to use it i just wanted to test it

#

the difference actually is it didn't include any of my shadowJar artifacts

#

nothing is shaded

prisma wave
#

you probably shouldn't be publishing shaded artifacts anyway

surreal quarry
#

like don't shade at all for that stuff?

#

just add the dependencies in the project

prisma wave
#

if you're publishing a library you would typically declare any transitive dependencies with the api or implementation configurations

surreal quarry
#

ok

#

well idk why but not shading stuff fixes it

#

so i guess i'll go with that lol

prisma wave
#

@quiet depot I don't suppose you know how to fix this?
pdm is in 3 modules, I need to publish 2 of them to a maven repo, and 1 to gradle plugins portal
I was doing this with a simple shell script: ```sh
./gradlew common-lib:publish

./gradlew pdm:publish

./gradlew pdm-gradle:publishPlugins
``` but for some reason my repo rejects the second publish task (peer not authenticated, credentials are definitely correct).
It works if I don't publish common-lib, so it's possibly a problem with gradle

Anyway, my idea for a possible fix is to make a single gradle task that publishes everything

task publishAll {
    dependsOn subprojects.find { it.name == 'common-lib' }.tasks.getByName("publish")
    dependsOn subprojects.find { it.name == 'pdm' }.tasks.getByName("publish")
    dependsOn subprojects.find { it.name == 'pdm-gradle' }.tasks.getByName("publishPlugins")
}

but this fails because publishPlugin's cant be found (because it gets loaded before the pdm-gradle module loads its plugins)
any ideas?

#

sorry for the huge paragraph btw

#

just running out of ideas lol

quiet depot
#

i'm sorry dude

#

I've got no clue

#

I've never used the publish task

#

I have a big fat script that interacts with maven cli whenever I publish shit

prisma wave
#

Ah it was worth a try

#

Thanks anyway I guess

onyx loom
#

when bm helps everyone but no one can help him ๐Ÿ˜”

hot hull
#

Sheesh

prisma wave
#

๐Ÿ˜”

#

suffering from success

#

i think i've got an idea for a workaround

hot hull
#

When noone helps BM, so he helps himself ๐Ÿ˜ฃ

ocean quartz
prisma wave
#

lmaoo

onyx loom
#

๐Ÿ˜ญ

hot hull
#

That is godly Matt

ocean quartz
#

I prefer this one

hot hull
#

Doesn't sound as nice as the other one

prisma wave
#

got ratelimited by my own maven repository ๐Ÿ˜”

#

i think

#

fuming

#

IT WORKS

analog crater
old wyvern
#

Probably not his fault and just an issue with WorldGuard version change from 6 to 7

versed ridge
#

Why wouldn't he just ask him to update it lol

onyx loom
ocean quartz
#

anyone able to fix it if I send source? its a custom plugin made by kotsumag but he's a bit busy atm

versed ridge
#

ah

#

my b

ocean quartz
#

It's alright was just showing the reason ;p

hot hull
#

Everyone legit wanting plugin ipdates recently, does everyone just discontinue their plugin after the first update :p

prisma wave
#

there's no money to be made from updating stuff

#

ยฏ_(ใƒ„)_/ยฏ

ocean quartz
#

Ayy you changed your name back to normal xD

prisma wave
#

for now

ocean quartz
#

What's gonna be the next one? C++ Mitten?

#

PDM Mitten ๐Ÿ‘€

prisma wave
#

I'd rather die

#

๐Ÿ‘€

old wyvern
#

C# Mitten plz

prisma wave
#

Elara Mitten

old wyvern
#

YES

#

DO IT

prisma wave
#

when it actually works I will

quiet depot
#

have u fixed elara yet?

old wyvern
#

Also, structs almost done alongside type parameters for func def

prisma wave
#

nice

#

@quiet depot fixed what bit?

quiet depot
#

all the inconsistencies I outlined the other day

prisma wave
#

oh

#

uh

#

maybe

quiet depot
#

.-.

old wyvern
#

What were the inconsistencies you specified?

#

function syntax?

quiet depot
#

i can't even remember

prisma wave
#

I think it was mostly let

old wyvern
#

rip

#

oh

quiet depot
#

oh yet

#

let was one of them

#

regarding functions, I questioned why you chose =>

ocean quartz
quiet depot
#

you said => was easy to type

old wyvern
#

Ayyy gg matt

#

is it complete?

quiet depot
#

even though => is objectively harder to type than ->

old wyvern
#

you said => was easy to type
@quiet depot
Wait wha

prisma wave
#
  • is right next to =
old wyvern
#

the keys are next to each other

prisma wave
#

lol

ocean quartz
#

Almost, there is still a few things to do involving colors and also need to work on a good basecomponent to string converter

prisma wave
#

the easiest might be something like >>

quiet depot
#

it's like a millimeter closer

#

in my defence, I don't think I brought that one up

prisma wave
#

you mentioned it briefly I think

quiet depot
#

yeah, I mentioned it, but I didn't bring up => specifically

#

lemme check

old wyvern
#

Almost, there is still a few things to do involving colors and also need to work on a good basecomponent to string converter
@ocean quartz
Ah I see, GJ bro ๐Ÿ’ฏ

quiet depot
#

ohh

#

it was :=

#

I was saying => is harder to type than :=

prisma wave
#

oh yeah

quiet depot
#

u said u don't like walrus operator, and then I said my reasoning of why it's better

#

which was it's easier to type

prisma wave
#

well you can't really compare the 2

#

they do different things

onyx loom
#

vbscript for life

quiet depot
#

do they?

prisma wave
#

walrus is usually for variable declaration

#

=> is usually for functions

quiet depot
#

usually is irrelevant

#

only thing that matters is what elara uses

prisma wave
#

true

#

it's using => atm

quiet depot
#

ahhh ok

#

I re read

#

so here's exactly what happened

#

I said I like vlang, niall said :=, I said yep, you said walrus operator is hard to type

prisma wave
#

ah yeah

quiet depot
#

I said => is arguably harder to type

#

was nothing todo with the usage of either in elara

old wyvern
quiet depot
#

merely the presence

prisma wave
#

yeah

quiet depot
#

in fira code

prisma wave
#

being tricky to type isn't the only reason I dislike it

quiet depot
#

walrus or =>?