#dev-general

1 messages · Page 160 of 1

prisma wave
#

:=

quiet depot
#

not that hard to type imo

#

why don't you like it?

prisma wave
#

imo it's one of those symbols where unless you know the language, it's not really clear what it does

quiet depot
#

ah

#

what paradigm is elara?

prisma wave
#

primarily functional

#

could be procedural too though

#

and kind of pseudo-oop as well

dusky drum
#

hmm someone said

Kotlin is only good if you intend on using it for android dev. Aside from that it doesn't give much benefit.

prisma wave
#

wrong

dusky drum
#

well tell that to him he says thats the only benefit

prisma wave
#

¯\_(ツ)_/¯

hot hull
#

Clearly a smoother brain fingerguns

lost edge
#

Anyone have any idea what would cause an IOException when creating a file for a single person? My plugin works for me and others that I know use it but there is this one person who seems to get an IOException and I have no idea what would cause it.

prisma wave
#

depends what the exception message is?

lost edge
#

Well I currently don't know I cant recreate the exception and only one person out of the many who use my plugin have the issue. Could it be possible that the plugin does not have permission to create the file?

prisma wave
#

possibly

#

does it always happen for that person?

#

and nobody else?

#

oh you mean 1 user of the plugin

#

not 1 player

#

it's really hard to say, possibly

#

get them to send the exception?

hot hull
static zealot
errant geyser
#

Is there anything in the Spigot API you guys don't like or think could be simplified/shouldn't need NMS? for ASF, I already asked on Reddit and that flopped, don't buuly

analog crater
#

There should be ways to unregister for events at runtime

errant geyser
#

There already are, aren't there? HandlerList.unregisterAll(yourListener) works for me, or someEvent.handlers.unregister(yourListener)

analog crater
#

Holy fuck. This helps soo fucking much

errant geyser
#

lol

hot hull
#

Any suggestions on how someone would improve their documentation/over all information when it comes to commits and such? Does anyone have any informative templates?

analog crater
#

Keep it clean concise and informative

hot hull
#

I mean yea but how

errant geyser
#

Keep it clean concise and informative

static zealot
#

xD

quiet sierra
#

@errant geyser Why do I need NMS to make an entity walk somewhere

#

makes me go ree

errant geyser
#

oooo custom entities and pathfinding

quiet sierra
#

pretty much

#

things simplified from 1.9

#

but 1.8 is so annoying

#

Literally need packets for everything

errant geyser
#

Well, I'd be building off of 1.16, but if you have 1.8 code for it you can submit an issue/pr and I'll add it

quiet sierra
#

I can't bother anymore

#

I'm already working o n my own server impl

#

Screw spigot

#

or mc server code

errant geyser
#

¯_(ツ)_/¯

quiet sierra
#

Does looping through constructors also include super class constructors?

#

Using reflections

prisma wave
#

reflections or reflection?

quiet sierra
#

reflection

#

whatever

#

Like

prisma wave
#

just they're very different things lol

#

and no I don't think so

#

since superclass constructors usually aren't applicable to their subclasses

static zealot
#
        cmdManager.parameterHandler.register(Entity::class.java) { argument ->
            // Gets the entity from the UUID
            val entity = Bukkit.getEntity(UUID.fromString(java.lang.String.valueOf(argument)))
                    ?: return@register TypeResult(argument)
            // Checks if the entity is null or not and returns only the argument used
            TypeResult(entity, argument)
        }``` this is how it gets automatically get converted by IIJ
ocean quartz
#

Yeah it's better here xD

static zealot
#

the default example

#

so I have the same list of strings. How would I make them into a parameter type?

ocean quartz
#

I don't think you can make a List of strings a parameter type, since the argument will always be just one

static zealot
#

yeah but would I just make a variable for each string?

#

would that work?

viscid charm
#

Yo guys is it better practice to name Player player; rather than Player p;?

prisma wave
#

Yes

#

Descriptive variable names are always better

static zealot
#

I name it player myself Fresh but I saw a lot of people using p for player and e for event. I just go for the long names xD

ocean quartz
#

You'd probably just use String, since you'll be getting one value from the List

static zealot
#

Descriptive variable names are always better
also I know this from my teacher so yeah

ocean quartz
#

And yes descriptive variables always

#

P can mean multiple things

viscid charm
#

I think it's more readable and moree descriptivbe

#

yea

#

Yo why do i get error when I name a variable class or inferface?

#

String interface;
String class;

ocean quartz
#

Because those are used keywords

static zealot
#

keywords that was the word I was looking for xD

viscid charm
#

so I cant have a variable named class or interface?

ocean quartz
#

Nope

viscid charm
#

Is it true that it would be safer to assume -> is a constructor rather than a method because it has capital? Hello()
helloder() <- that would be method right?

ocean quartz
#

Yes, classes will always be upper camel case while methods lower camel case

analog crater
#

^ nOoB DEvS saY nO

errant geyser
#

You mean professional spigot developers

analog crater
#

"Professional " announce yourself as that when you make a living wage from it

ocean quartz
#

You should always assume that, if you're wrong, remove what ever api you're using xD

analog crater
#

And make a pr to fix it

viscid charm
#

yo i dont get this...

        int m = 4;
        int n = 5;

        m = n++;

        //n++ // n = n + 1, 
        
        
        System.out.println(m);``` Why is it returning 5? But when I do ++n, I know its post and pre increement but I just dont see n++ the value of m being 5. shouldnt it be 6?
ocean quartz
#

Basically it'll run like this:

m = n++;

m = n;
n += 1;
#

So m = 5

#

Which was the value of n when it was assigned to m

viscid charm
#

so n will be 6?

ocean quartz
#

Yeah n will be 6 and m 5

viscid charm
#

is it beetter to have say (n+2==1) or to have (n + 2 == 1)?

ocean quartz
#

Second imo, but that's more of preference

viscid charm
#

What would you call == basicaly? Would you call it same? Like 1 == 1, one is same as one?

static zealot
#

a == b

#

a is same as b

ocean quartz
#

I call it equals a equals b

#

= is for assigning so it's the assign operator

viscid charm
#

Yo why does this keep printing hello infinitely on my end

#
        for (int i=0;i<5;i++) {
            System.out.println("Hello");
        }
        int i=1;
        while(i<=5) {
            System.out.println("Hello");
        }```
prisma wave
#

Because you never increase i

viscid charm
#

OHH lol true

prisma wave
#

In the second loop

viscid charm
#

Yea

#

Qucikq uestion ok so

#
        for (int i=0;i<5;i++) {
            System.out.println("Hello");
        }

        int i=1;
        while(i<=5) {
            System.out.println("Hello");
            i++;
        }```
#

In taht code, do the i's not interfere?

#

both variables are named the same

#

shouldn't it mess anything up?

prisma wave
#

no

#

The first variable is only inside the scope of the for loop

#

So when you're outside the loop, i doesn't exist

viscid charm
#

Oh

prisma wave
#

The next one would if you were doing anything afterwards

viscid charm
#

Ah I see

#

Why would one use a While Loop instead of a For Loop?

onyx loom
#

if u want the loop to be constant until a condition changes

prisma wave
#

Yeah

#

For loops are better for predefined ranges

#

Eg looping over every item in a list

#

While loops are better for dynamic ranges

viscid charm
#

dynamic ranges?

quiet sierra
#

Think of repeating code until a condition is met

prisma wave
#

^

#

Yeah dynamic ranges maybe isn't the best terminology

onyx loom
#

is good imo

viscid charm
#

yea repeating the code until condition is met. isn't that the same with For loop?

onyx loom
#

u could have it loop twice, or a thousand times

prisma wave
#

Yeah

quiet sierra
#

For loop just loops through variables

#

While loop executes code while the boolean is true

static zealot
#

yeah for just loops thru known things

prisma wave
#

for loops also have to define a variable

static zealot
#

like variables, ranges etc.

prisma wave
#

While doesn't

#

^

viscid charm
#

OH

#

while(true) {
System.out.println("Hello");
i++;
}

#

I see

static zealot
#

well it could

#

but while has other uses as well

ocean quartz
#

That'll loop forever

static zealot
#

than just what for can do

quiet sierra
#

Which one is better?
while(true)
for(;;)

ocean quartz
#

None tbh xD

onyx loom
#

matt lol

quiet sierra
#

Sometimes you need while trues

viscid charm
#

wtf is for(;;)?

quiet sierra
#

defines no variable, checks no condition and changes no value

static zealot
#

probably an infinite loop

quiet sierra
#

Basically an infinite loop

viscid charm
#

o wow

onyx loom
#

in that case while

ocean quartz
#

A lot of the times that you need while true, you probably can find a better way to do it

viscid charm
#

SO you dont need a variable for a forloop?

prisma wave
#

technically not

#

Usually you do though

#

In kotlin you do

quiet sierra
onyx loom
#

In kotlin you do
@prisma wave

#

🙂

prisma wave
#

🥴

ocean quartz
#

A lot of the times

quiet sierra
#

Yeah

#

This is just a random scenario

prisma wave
#

Minecraft uses while (true)

#

Somewhere

viscid charm
#

SO BASICALLY use While loop when you have a true or false thing/loop that you wanna do?

prisma wave
#

Probably

quiet sierra
#

This is just my minecraft server impl

ocean quartz
#

Most likely, for the ticking

quiet sierra
#

handshake is fun

viscid charm
#

rather a for a loop but, you can do that with a for loop as well right?

prisma wave
#

handshake is fun
@quiet sierra no it isn't

quiet sierra
#

It is

#

Trust me

prisma wave
#

Trust me

#

It's not fun

prisma wave
#

that's the status state

#

Technically not handshaking

#

If we're being pedantic

quiet sierra
#

It's part of handshake

#

The real fun begins after handshake

#

sending all map packets

viscid charm
#

Why would you use a do while loop

quiet sierra
#

clean code I guess

viscid charm
#

Just to hav ea condition run at least once?

prisma wave
#

while loop doesn't do that

#

do / while does

viscid charm
#

Do while loop <-

prisma wave
#

Yeah

#

@quiet sierra I'm on map packets at the moment

quiet sierra
#

Same

prisma wave
#

I already want to die

quiet sierra
#

Kinda crashes my client

prisma wave
#

Wow

#

I thought mine was bad lol

quiet sierra
#

lol

#

It's because I'm using 1.8

#

and taking a lot of inspiration from 1.16

prisma wave
#

gross

#

Although that makes sense

#

Considering the wiki.vg docs aren't updated for 1.16 yet lol

#

Unless I was doing something wrong

lavish notch
#

When you say you're on X at the moment, are y'all following some course?

split talon
#

const log = console.log;

viscid charm
#

I can access any variables in a method if that method is in INSIDe the class right?

#

Yo why can't I do this?

class Calc {

    int num1;
    int num2;
    int result;

    public void perform() {

        result = num1 + num2;
    }

}

public class FirstCode {

    int hello;

    public static void main(String args[]) {

        Calc obj = new Calc(); // The new Calc() is the object.
        obj.num1 = 3;
        obj.num2 = 5;

        obj.perform();

        System.out.println(obj.perform().result);

    }
#

why cant I do printline of obj.perform().result?

onyx loom
#

i dont think u can access result variable

#

instead, i would recommend returning num1 + num2, then itll print out

viscid charm
#

System.out.println(obj.result);
works but

#

I am wondering why you cant do obj.perform().result

#

Ah is it cus of return type?

versed ridge
#

Because that method doesn't return anything

viscid charm
#

of Void?

#

I see

#

BUT if there was a reeturn type then it would work correct?

onyx loom
#

yes

versed ridge
#

If you returned Calc then yeah

onyx loom
#

System.out.println(obj.result);
works but
@viscid charm this works because its declared outside of the method

#

u wouldnt be able to access the variable inside the method

#

hence why it should be returned instead

viscid charm
#

int result; <- this is what you mean by "declared outside" right?
Also what do you mean hence why it should be returned instead? @onyx loom

onyx loom
#

int result; <- this is what you mean by "declared outside" right?
yes, that is outside of the perform() method
Also what do you mean hence why it should be returned instead?
something like

    public int perform() {

        return num1 + num2;
    }```
and then just print `System.out.println(obj.perform()`
viscid charm
#

no

#

that woudlnt work tho

#

OH NVM

#

cus on mine it was void

onyx loom
#

yup

viscid charm
#

and on urs its a return type

#

I see

onyx loom
#

🙂

viscid charm
#

but can you do

#

println(obj.perform().result;?

#

IF you declare result in there?

#

like int result;?

onyx loom
#

i highly doubt it

viscid charm
#

AH so you can't really GO inside a method which is returning something

#

Oh rip you cant go inside a method period

onyx loom
#

ya

viscid charm
#

cus i tried it with a void

#

ye

onyx loom
#

when u call a method all u are mainly doing is returning something or returning nothing (void) as such, there is no need to access the contents of the method itself, but rather the end result of the method

#

if that makes sense

viscid charm
#

So it makes sense to NEVER have

#

varialbes in the

#

method

#

right?

onyx loom
#

not really

viscid charm
#

y shud one declare varialbes INSIDE a method?

#

ASSUMIGN they arent constant

#

you won't be able to access it

onyx loom
#

u should aim to have variables inside methods (and then pass the variables in parameters when needed) where possible, afaik it saves more resources

#

someone can correct me on stuff that im saying, im not very good myself 😅

viscid charm
#

o rip

#

OK WATHA BOUT THIS question

#

Also qucik question about constructors. What if you create a constructor but add a VOID return type to it. Does it just make it a method now? Or wat happens? Or even if you make it a return type.

onyx loom
#

example?

viscid charm
#
class Calc {

    int num1;
    int num2;
    int result;

    public Calc() {

        num1 = 5;
        num2 = 2;

    }
    
    public void Calc() {
        
    }

}

public class FirstCode {

    public static void main(String args[]) {

        Calc obj = new Calc(); // The new Calc() is the object.

        System.out.println(obj.num1);

    }

}```
#

See the public void Calc() {} <- ?

onyx loom
#

thats not a constructor?

viscid charm
#

yeea

#

SO would it cause any issues

#

or anyhting?

onyx loom
#

oh because of the naming?

viscid charm
#

yea

onyx loom
#

shouldnt do

#

to access it it would just be obj.Calc() probably

#

and ur accessing ||(insert better word here, ur not really accessing it rn) || the constructor when initalising the class

viscid charm
#

yea hmm ok

#

So to like communicate with a class

#

you must intilias the class using the constructor of that class

#

right?

#

If your in another class that is.

#

And once you do that you can technically access or use any of the methods INSIDe that class in a different class where you initilized that class? right?

onyx loom
#

yea

#

thats if the things u wanna access isnt marked as private ofc

viscid charm
#
Class Calc { 
  int num1;

    public Calc(int number1) {

        number1 = num1;```
Whats better to do? number1 = num1; or num1 = number1;? I know it means the same thing but what do you guys prefer and if theres conventional way?
#

Also would num1 be considered local?

class Calc {

    int num1;
    int num2;
    int result;

    public Calc(int number1) {

        number1 = num1;
        System.out.println("Hello");

    }

}

public class FirstCode {

    public static void main(String args[]) {

        Calc obj = new Calc(1); // The new Calc() is the object.

    }

}
distant condor
#

btw you can use kotlin markdown, it's a thing apparently

split talon
#

nhmber1 is a local variable, not num1

distant condor
#

anyway, by default they are private but it has getters

#

iirc

#

so it seems like it is public but kotlin actually generates getters for you

viscid charm
#

if number1 is a local variable which it is, WHAT would be call num1? Some say instance variable

#

BUT what if I didn't create new Calc(1);

#

would it still be called instance variable?

distant condor
#

is public Calc(int number1) supposed to be a constructor?

split talon
#

Yes any variable defined without static keyword and not in a method is an instance variable

#

Or constructor

distant condor
#

wait are you able to create constructors like that hmm

#

I thought you had to define it in the class xyz

#

and use init

#

yeah this code is invalid I think

viscid charm
#

what code/

#

Also would num1 be considered local?

class Calc {

    int num1;
    int num2;
    int result;

    public Calc(int number1) {

        number1 = num1;
        System.out.println("Hello");

    }

}

public class FirstCode {
       String helloder;

    public static void main(String args[]) {

        Calc obj = new Calc(1); // The new Calc() is the object.

    }

}
distant condor
#

wait nvm

viscid charm
#

helloder is called instance variable?

#

right @split talon ?

distant condor
#

lol my brain died for a sec

#

I was thinking in kotlin

#

shit

#

sorry

split talon
#

Yeah

ocean quartz
#

number1 is a parameter, num1 is a field

distant condor
#

anyway you might want to specify private for all those values

#

java convention is using getters and setters and not changing it by defining it public (I think?)

viscid charm
#

haven't gotten to that yet

distant condor
#

alright

#

so what's your question again?

#

or has it been answered?

viscid charm
#

Is it bad to have this. FOR all fields taht your mention or instance variables inside your methods whilst assignign them to the local variable or parameter?

#

like

#
    public Casio(int i) {
        
        this.num1 = i;```
distant condor
#

as in is it bad to have just variables around in the class?

viscid charm
#

I didn't need to add this <-. num1 is instance variable/field btw.

#

No like

#
    public Casio(int i) {
        
        num1 = i;``` VS
```JAVA
    public Casio(int i) {
        
        this.num1 = i;```
#

"this." is not needed in this case unless its this.i = i;

distant condor
#

yeah

viscid charm
#

Yea so would using this. be bad convention?

distant condor
#

using this or defining variables that belongs to the class/object?

viscid charm
#

using this

#

for something that doesnt need this

distant condor
#

I'll show an example

#

using this
this is just more explicit

#

if it seems clearer, you can use it

#

but if you can understand what you are changing without calling this there is no use I guess

viscid charm
#

Hm I see, if it helps you see that it's OUTISDE of that method

#

I see what u mean

#

But someone whos experienced would definately not use this because they already know its outside. and this should generally be only used if they are the same named variables

distant condor
#

not definitely, but they have the choice not to use it

#

this is one of those conventions no one really cares about (I think?)

#

but try to keep it consistent throughout your project

#

does that answer your question?

viscid charm
#

What do most people use?

distant condor
#

Some people use this some people don't

viscid charm
#

I mean like majority

#

like if they use this as a majority

#

it would make more sense to use this EVEN if you dont need it because more people can understand ur code better

distant condor
#

this might help if your constructor has loads of variable, maybe you are doing some calculations or something in it

#

it is more project-dependent than anything else

#

if you want, you can check out some examples on github and see how people use then

#

I hope that answers your question?

viscid charm
#

Ok i see

#

Btw we use static for if we want all the objects to have the same thing?

distant condor
#

static just means the method/variables will belong the the class, not the object

#

so you don't need to instantiate it by calling the constructor

#

you call the method directly to the class

#

you don't call it on an instance of that class

viscid charm
#

Hmm you said u dont need to instantiate by claling constructor OK so

#
class Emp {
    int eid;
    int salary;
    static String ceo;

    public static void shtatic() {
        System.out.println("Static");
    }
    
    public void nonStatic() {
        System.out.println("Not Static");
    }

}

public class StaticDemo {

    public static void main(String args[]) {

        Emp.shtatic();
        Emp.nonStatic();
    }
}```
#

AHH so the Emp.nonStatic(); won't work without calling the constructor and creating an object

#

So i'd need to add:

#
        Emp obj = new Emp();
        obj.nonStatic();```
#

I have heard static abuse. What does that mean btw? Are static's bad? Isn't it good that you don't need to create "new EMP();" because wouldn't that take up more space/

quiet depot
#

don't worry about it taking up more space

viscid charm
#

wait so you can't access non static variables in a static method correct? Theres no OTHERT way other then to make the varaible static to access that variable?

quiet depot
#

static's aren't bad, it's just recommended you avoid them till you fully understand how they work

viscid charm
#
public class StaticDemo {

    int i = 0;

    public static void main(String args[]) {

        i = 1;

        Emp.shtatic();
        Emp obj = new Emp();
        obj.nonStatic();


    }
}
#

Like that

quiet depot
#

yeah that wouldn't work

viscid charm
#

I can make the static int i = 0;

#

BUT

#

is there no other way?

#

just wondering

quiet depot
#

new StaticDemo().i = 1;

viscid charm
#
public class StaticDemo {

    int i = 0;

    public static void main(String args[]) {

        i = 1;


    }
}```
quiet depot
#

but obviously that only changes i for the instance of StaticDemo you just created

viscid charm
#

Oh like this

#
public class StaticDemo {

    int i = 0;

    public static void main(String args[]) {

        StaticDemo satatic = new StaticDemo();
        satatic.i = 1;
        

    }
}```
quiet depot
#

yes

#

that'd change the value of i for the instance of staticdemo you're creating

#

if you created another instance of staticdemo, i would be 0, whereas your old instance would still be 1

viscid charm
#

Ah

#

Static

quiet depot
#

oh btw, in our conversation the other day, I mentioned ids

#

technically java does have ids, but they're obviously not numbers

#

1 - 3

#

they are numbers, just not like that, they called hashcodes

viscid charm
#

wait so

#

if its static

#

i create another method

#

and make i = 1;

#

i will be even in other methods

#

is what ur saying right?

quiet depot
#

just write the code out

viscid charm
#
public class StaticDemo {

    static int i = 0;

    public static void main(String args[]) {

        StaticDemo satatic = new StaticDemo();
        satatic.i = 1;
        

    }
}
#

would thsi work?

quiet depot
#

no

#

2 secs

#

maybe

#

need to open my ide

tacit cave
#

Hello

#

can i ask a simple question

#

?

#

=Is Material.Brick is not a Brick block?

obtuse gale
#

yes

#

i presume its the ingot

tacit cave
#

oh thanks.

obtuse gale
#

Thats just a guess tho

viscid charm
#

I see what u mean @quiet depot

#
public class StaticDemo {

    int i = 0;

    public void show() {

        System.out.println(i);

    }

    public static void main(String args[]) {

        StaticDemo obj = new StaticDemo();
        obj.show();
        obj.i = 0;
        obj.show();

    }

}
#

where as if it was static and you changed it inside the method it would actually be 1

viscid charm
#

Yo i don't get the obj.new concept

#
        Outer obj = new Outer();

        Outer.Inner obj1 = obj.new Inner();```
quiet depot
#

new Outer.Inner();

viscid charm
#

What does new exactly mean?
I get that Outer is the class reference, obj is name of the reference, i dont get what NEW means. but I get Outer() is the constructor.

quiet depot
#

new literally just means construct a new instance

#

new allows you to call a constructor

#

to get an instance

viscid charm
#

ok then what is obj.new?

quiet depot
#

that's not valid java

viscid charm
#

like hard to see

#

wat do u mean?

quiet depot
#

Outer.Inner obj1 = obj.new Inner(); this is not valid java

viscid charm
#
public class StaticDemo {

    //variables, methods, class

    public static void main(String args[]) {

        Outer obj = new Outer();

        Outer.Inner obj1 = obj.new Inner(); //        Outer.Inner obj1 = new Outer.Inner();

        obj1.display();


    }

}```
#

It works for me

quiet depot
#

wtf

#

ok well

#

don't ever do that

viscid charm
#
class Outer {


    class Inner {

        Inner() {

        }
        public void display() {

            System.out.println("In Display");

        }

    }```
quiet depot
#

Outer.Inner obj1 = new Outer.Inner(); do this

viscid charm
#

No

#

thats if its static

#

You do that if its static

#

BUt let me try it

#

Outer.Inner obj1 = new Outer.Inner();

#

oops

#

No enclosing instance of type Outer is accessible. Must qualify the allocation with an enclosing instance of type Outer (e.g. x.new A() where x is an instance of Outer).

#

If I make inner class static

#

then it works

#

static class Inner {

quiet depot
#

k

viscid charm
#

But I just dont see

quiet depot
#

what don't you see?

viscid charm
#

Outer.Inner obj1 = obj.new Inner();

Understnad the obj.new Inner(); part

quiet depot
#

well frankly I didn't even know that was valid syntax until now

#

but I can make an educated assumption

#

Inner is not static, as you said, and is therefore bound by the instance of it's upper class

#

so in order to construct an instance of inner, you first need an instance of Outer

#

obj is your instance of outer

#

so, obj.new Inner();

#

however, I'd just like to point out, I've never seen this sort of system used once in my entire time coding in java

#

there's probably a very good reason for that

viscid charm
#

What do you mean this "therefore bound by the instance of it's upper class"

#

IF it was static

#

it wouldnt be bound by the instace of it's upper calss?

quiet depot
#

correct

#

it'd be bound to the class itself, not an instance of the class

viscid charm
#

So in other words we can say, static doesnt require a new instance right?

quiet depot
#

yes

viscid charm
#

So it requires a new instance of it's upper class is what you meant. when you said the bound part.
So
Outer.Inner obj1 = new Inner(); wouldn't work because it needsthe instance of outer and obj.
OK i see that now

#

took a while xD

#

had to read what u wrote many times and see it x_x

#

BUT what do we needa do this?

#

i dont get this part

#
Outer.Inner obj1 = new Outer.Inner();```
#

FOR static class

#

if it's static why do we need the "NEW" stuff

#

aka the instance stuff

quiet depot
#

the class is static, that doesn't necessarily mean it's properties are

#

generally static classes are preferred iirc

viscid charm
#

wait what do u mean iirc?

quiet depot
#

if i recall correctly

viscid charm
#

oh

#

Like for all types of programming?

quiet depot
#

java

viscid charm
#

Ok but like what is static abuse then?

quiet depot
#

the misuse of static as an access modifier, instead of what it actually is, a memory tool

viscid charm
#

What do you mean by memory tool?

quiet depot
#

Java's memory usage is automatically managed, by something called a garbage collector

#

not all languages have this

#

for example, c

#

you have to manually remove your data from memory

#

and manually add it

#

with java, it's not like that

#

you create an instance, and the jvm handles the memory portion of it

#

when that instance is no longer needed, the garbage collector automatically removes it

#

static things, can not be garbage collected (unless you kill their classloader, this is somewhat irrelevant though)

#

this is a MASSIVE oversimplification

#

because the simple fact is, it's not beginner friendly

viscid charm
#

WAIT

#

BUT static is infact more beginner friendly dont u agree?

quiet depot
#

erm

#

yeah I suppose so

#

that's why so many people use it by accident

#

they see static, and see that it easily allows them to pass instances around

#

but they don't realise what static is actually doing underneath

#

which can lead to memory leaks, and semantic issues

#

i.e. static abuse

viscid charm
#

Is it possible to avoid it ENTIRELY though?

#

like not use statics at all?

quiet depot
#

which is why we strongly recommend you completely avoid static until you fully understand how it works

#

yes, you can code without ever using static in java

viscid charm
#

ANY plugin that I wish?

#

No use of Static?

quiet depot
#

yep

viscid charm
#

I see

quiet depot
#

It's important to note, static isn't bad

#

it's just hard to understand

#

and therefore beginners should avoid it

viscid charm
#

yo what does the : mean for the for each loop or the for enhanced loop

surreal quarry
#

you mean like for (String s : someListOfStrings)

#

the : in there?

viscid charm
#

yea

surreal quarry
#

think of it as the word in

#

for String s in someListOfStrings

#

then you loop through that entire list of strings

#

and do something with each string

viscid charm
#

its only meant for arrays or lists right?

surreal quarry
#

maps, arrays, lists, etc. anything that stores multiple things

#

thats not a great way to explain it but hopefully it gets the point across lol

viscid charm
#

So basically

#

For String s : ListsofString)
Loop through Reference Name of reference In Collection of Things.

#

What is s used for tho?

quiet depot
#

String s is a variable

surreal quarry
#

yea thats a goo way to explain it
the s is the string itself

old wyvern
#

Looping through a collection or array

#

its called an enhanced for loop or in some other languages, a for each loop

viscid charm
#

ok but what would we do with the s in the loop?

surreal quarry
#

depends

quiet depot
#

that's the variable

#

String s is a variable fresh, equal to the element of the current iteration

old wyvern
#

the s is an element in the list

viscid charm
#

No i get its the name of hte variable

#

String is reference type of String

#

so if I have print s

#

it owuld print out everyt possible thing in the list/collection?

surreal quarry
#

it will print out every thing in the list

#

yea

old wyvern
#

yes pepp

viscid charm
#

This can also be achieved via For Loop tho right?

old wyvern
#

Yes

surreal quarry
#

this is a for loop

old wyvern
#

Not in all cases possibly

#

Sets, you will most likely go with the iterator and while loop or something if not enhanced for

#

coz the for loop approach depends on having an index

#

you cant fetch a set element with a index

drowsy widget
distant sun
#

Does java compiler cast objects to the required value, for example JavaPlugin to Plugin, or that's just the decompiler or anything else?

quiet depot
#

bit of both

distant sun
#

Interestig

tacit cave
#
        if(e.getBlock().getType() != null && e.getBlock().getType() == Material.IRON_ORE) {
            if (e.getBlock().getLocation().getChunk().getBlock(3, 3, 3).getType() == Material.ACACIA_DOOR) {``` is this correct? xD
distant sun
#

you need to check if the block is null before access other methods such as getType

viscid charm
#

Yo @quiet depot someone on here said that whenever you can, you should create local variables/ variables inside methods rather than having instance variables/fields? To be more optimized/use less resources?
Is this true?

distant sun
#

Isnt it the other way around?

#

The compiler will do some optimizations for you anyways

viscid charm
#

I thought it was other way around

#

but, dude said that

#

You should always access your variables via getter/setter methods right?

distant sun
#

Yes, public mutable fields arent good.

regal gale
#

@regal gale lol why not just to MemorySection#getValues?
@prisma wave you would need another recursive anyway, as value could be another MemorySection

viscid charm
#

yo what does SOmething#getSomething mean?

#

I see people do that a lot but i dont get it

distant sun
#

Method reference

viscid charm
#

Dont get it what do u mean by reference?

#

MemorySection <- Would be the name of the class or method?
and getvalue is name of the ^?

distant sun
#

ClassName#methodName()
Method methodName from class ClassName.

viscid charm
#

Oh

#

ah ok

viscid charm
#
class A {

    public void show() {
        System.out.println("in A Show");
    }

}

public class StaticDemo {


    public static void main(String args[]) {

        A obj = new A()
                {
            public void show() {
                System.out.println("in sadgsg");
            }
                };
        obj.show();
    }

Why is the new A() {}; considered a class?

distant sun
#

Doesnt that only apply to Interfaces?

viscid charm
#

No it can also work with class

#

its called an anonymous class

#

Do we use many lambda expressions in minecraft plugins? It only applies for functional interfaces right so if they only have 1 abstract method?

old wyvern
#

functional interfaces

#

Lambdas apply to only interfaces with a single non-default function

viscid charm
#

yea i tested it on abstract class and it didn't work

old wyvern
#

Yes

viscid charm
#

the lambda thing

#

but anonymous class worked.

old wyvern
#

Yea

#

Whats the problem?

viscid charm
#

Oh iw as just wondering if you could add lambda to abstract

old wyvern
#

No

viscid charm
#

Is lambda like faster or something?

old wyvern
#

No just more readable

viscid charm
#

o

#

But annoynmous class faster tho right?

old wyvern
#

No?

hot hull
#

So I've got a slight issue, when placing the block I get the first location, and when I break it I get the second one, issue now is that I use a location to identify a spawner there, and since the locations don't match (even though they should), it completelly breaks

[1] Location{world=CraftWorld{name=world},x=-250.5,y=64.8999969959259,z=42.5,pitch=0.0,yaw=0.0}
[2] Location{world=CraftWorld{name=world},x=-251.0,y=65.0,z=42.0,pitch=0.0,yaw=0.0}
#

I have to somehow normalize the location which is given when a user places the spawner, yet I've no idea how I'd do that

#

Also, the fuck is this, one rounds up, the other down?

42.5 -> 42.0
250.5 -> 251.0

dusky drum
#

use block.x so you dont get decimals

#

@hot hull

hot hull
#

Normalizing the location, yet it still prints out decimals so..

    private Location normalize(final Location location) {
        location.setX(location.getBlockX());
        location.setY(location.getBlockY());
        location.setZ(location.getBlockZ());

        return location;
    }

output: Location{world=CraftWorld{name=world},x=-258.5,y=64.8999969959259,z=42.5,pitch=0.0,yaw=0.0}

dusky drum
#

Wtf

#

But i dont get those

hot hull
#

I'm hella confused

dusky drum
#

Same

#

Let me hop onto pc

hot hull
#

Some weird shit is going on..

dusky drum
#

oke so how i get block locations is
(kotlin)
block.x
block.y
block.z
?

#

and why do you normalize locations, how do you get those locations=

#

use
block.getLocation()

hot hull
#

That's what I'm using yes.

dusky drum
#

interesting

#

so example
val cropLocation = CropLocation(base.x, base.y, base.z, base.world.name)
For me prints
x = 5
y = 5
z = 20
i dont get decimals
val base = event.block.getRelative(BlockFace.UP)

#

i dont like normalize locaitons

hot hull
#

I mean yea because you create a new location

dusky drum
#

thats seperate class, smaller since i dont need yaw and pitch

#

but both dont give decimals for me

tacit cave
#

can we check a brekead block with itemstack?

dusky drum
#

?

#

still what do you mean itemstack?

tacit cave
#
                        HeadDatabaseAPI api = new HeadDatabaseAPI();
                        ItemStack NetherGenerator = api.getItemHead("39000");
                        if (block.getType() == NetherGenerator) {```
#

maybe we can't check a block that is custom like heads

dusky drum
#

type is always gona be head, you have to check its blockdata?

#

type is just gonna be PlayerHead

hot hull
#

Also, lowerCamelCase plz, ktnxbye

tacit cave
#
                        HeadDatabaseAPI api = new HeadDatabaseAPI();
                        ItemStack NetherGenerator = api.getItemHead("39000");
                        if (block.getData() == NetherGenerator) {``` depricated ;/
viscid charm
#

Anyone know hwy this throws an error? Is it a java 1.8 bug?

#
public class StaticDemo {


    public static void main(String args[]) {

        int i, j;
        i=8;
        j=0;

        try {
            int k = i/j;
            if (k == 0 ) {
                throw new CustomException("This is not possible");
            }
        }
        catch(CustomException e) {
            System.out.println("Error" + e.getMessage());
        }
        System.out.println("hello");
    }
}```
dusky drum
#

what type of error does it throw?

hot hull
#

It'll throw a division by 0 iirc

#

Arithmetic something exception

dusky drum
#

so then he just needs to check for that error, thats basic since you cant devide something by 0.

hot hull
#

Indeed

viscid charm
#

catch(Exception e) { seems to work

#

but the catch(CustomException e) {

#

says the arthemitic error

hot hull
#

Well catch the other error

viscid charm
#

wat do u mean?

hot hull
#

says the arthemitic error

#

Catch this error

dusky drum
#

instead of using Customexception use ArthemeticException....

viscid charm
#

yes.. I know that tho lol

hot hull
#

I mean what's the issue then?

viscid charm
#

Exception in thread "main" java.lang.ArithmeticException: / by zero
at me.freshpeppermint.StaticDemo.main(StaticDemo.java:13)

#

thats what it says when I run it

dusky drum
#

omg.

#

im done.

viscid charm
#

If I use: Exception it says

#

Error/ by zero

dusky drum
#

USE FRIKING ArithmeticException

#

ArithmeticException

#

ArithmeticException

hot hull
#

Gasper..

obtuse gale
#

I mean why even catch this

#

Why not just handle it

hot hull
#

^

viscid charm
#

To learn about CustomExceptions

obtuse gale
#

if(j == 0) return;

#

bam

hot hull
#

I don't think you can just go around throwing your own exceptions to bypass others

dusky drum
#

anyone knows why when blockgrowevent is triggered by melon/pumpkin growing the block that grew is AIR?

#

its not pumpkin or melon

viscid charm
#

How do I cahnge java versions?

#

in eclipse

obtuse gale
#

Dont use eclipse

#

Also it works for him since j isnt 0

#

You cannot divide something by 0, and as such the Arithmetic exception is thrown

viscid charm
#

Ah I didnt see that my bad

#

Hey guys I heard this is bad to do, why. And why is this other thing a better solution?

#
public class ConfigValues {

    LitTestPlugin main = new LitTestPlugin();

    public String configString() {
        return main.getConfig().getString("String");
    }

    public String getitemName() {
        return ChatColor.translateAlternateColorCodes('&', main.getConfig().getString("itemname"));
    }

}```
quiet depot
#

does LitTestPlugin extend javaplugin?

hot hull
#

LitTestPlugin main = new LitTestPlugin();
If it's your main, this ain't it chief

viscid charm
#

yea

quiet depot
#

it's not bad practice, it simply doesn't work

viscid charm
#
public class ConfigValues {

    private LitTestPlugin main;

    public ConfigValues(LitTestPlugin main) {
        this.main = main;
    }

    public String configString() {
        return main.getConfig().getString("String");
    }

    public String getitemName() {
        return ChatColor.translateAlternateColorCodes('&', main.getConfig().getString("itemname"));
    }

}```
quiet depot
#

that's better

#

you can't initialize your main class in plugins

#

you can only pass it's instance around

viscid charm
#

Oh cus its an interface?

quiet depot
#

No

viscid charm
#

oh then why?

quiet depot
#

spigot just prevents more than one instance of JavaPlugin existing at runtime

#

it's called a singleton

viscid charm
#

Whats another alternative to what I just did there?

quiet depot
hot hull
#

Dependency Injection

quiet depot
#

main can be final though

viscid charm
#

I know but any other

#

That's the only way?

#

orr

hot hull
#

sTaTiC

quiet depot
#

You can retrieve an instance of your javaplugin class via JavaPlugin.getPlugin

#

JavaPlugin.getPlugin(LitTestPlugin.class)

#

you can use a dependency injection framework (like guice)

#

you can create your own static instance getter

#

there's many options

#

stick with dependency injection though

viscid charm
#

whats dependency injection?

quiet depot
#

@hot hull what's the di faq

hot hull
#

?java-dependency

compact perchBOT
#
FAQ Answer:

Dependency Injection
Dependency Injection is a method of passing our dependencies, into the classes that need them. In java, this is commonly done by passing an instance of the dependency via the constructor.

public final class CoolPlugin extends JavaPlugin {
    @Override
    public void onEnable() {
        final Other other = new Other(this);
        other.method();
    }

    public void myMethod() {
        /* Some code goes in here */
    }
}

public final class Other {
    private final CoolPlugin main;

    public Other(@NotNull final CoolPlugin main) {
        this.main = main;
    }

    public void method() {
        main.myMethod();
    }
}```
hot hull
#

smh

viscid charm
#

Doesn't final mean it's a constant?

quiet depot
#

no

#

a constant is static and final

#

final alone, simply means the variable is immutable

viscid charm
#

so anything that doesnt change should have final next to it

quiet depot
#

yes

#

you should make absolutely everything final by default, except for methods/functions

#

it's redundant to make methods/functions final, because your classes will be final

#

if your class isn't final, then those methods/functions are obviously meant to be extended, so still redundant to make them final

viscid charm
#

i forgot what fucntions were. What are functions again?

quiet depot
#

static methods

viscid charm
#

Ah ok

lunar cypress
#

Technically the term function does not exist in java terminology

#

Except with functional interfaces perhaps

viscid charm
#

Having trouble seeing/understanding this tho.

public class ConfigValues {

    private final LitTestPlugin main;

    public ConfigValues(LitTestPlugin main) {
        this.main = main;
    }```
lunar cypress
#

But static methods are still called methods

quiet depot
#

yeah

#

not official naming, but I swear by it, because it makes sense

#

and most people will understand it

dusky drum
#

hehe my pumpkins grow stone,dirt

viscid charm
#

y do we need this

    public ConfigValues(LitTestPlugin main) {
        this.main = main;
    }```
WHEn we already have this:
```JAVA
private final LitTestPlugin main;```
quiet depot
#

cuz u have to assign a value to the field main

#

otherwise it's just an empty variable declaration

viscid charm
#

Hold up why does private int a; not give an error?

quiet depot
#

because it's not final

#

a final variable has to be assigned a value

#

non final variables do not

viscid charm
#
private final LitTestPlugin main;```
What is that saying technically?
like private access modifier, final is to signify no change, LitTestPlugin , main is the name of the reference.
#

nvm i just realised its class is what it's staying

#

Reference to a class

#

Ok why do we have these 2 values in the brackets?

public ConfigValues(LitTestPlugin main)```
cant we just use a default constructor with no parameters?
quiet depot
#

technically you can store the main plugin instance as a constant

private static final LitTestPlugin MAIN = JavaPlugin.getPlugin(LitTestPlugin.class);
#

as a beginner though, it's crucial that you get used to dependency injection

#

as you'll need to use it everywhere else

viscid charm
#

Ok but why are we doing the dependency injection here?

    private final LitTestPlugin main;
    
    public ConfigValues(LitTestPlugin main) {
        this.main = main;
    }```
Do you know? You do this to communicate with the other classes? And why is it on a constructor? Can't you basically create a method instead for it?
hot hull
#

You need to look at both sides of it, the class you're using DI in, and the class you're initializing your other class in

viscid charm
#

Can you have a method inside method btw?

obtuse gale
#

dont think so

errant geyser
#

You can in Kotlin, but idk why you'd want that

viscid charm
#

Yo how come this is not working

#
public class TestCode {

    public void show() {

        System.out.println("Okay!");

    }

    public static void main(String args[]) {

        TestCode obj = new TestCode();
        obj.show();


    }

}

class Hello {

    private final TestCode classname;

    public Hello(TestCode classname) {
        this.classname = classname;

    }

    classname.show();

}```
#

the classname.show() <- part

lunar cypress
#

Well if you wanna count lambdas or anonymous/local classes you can

errant geyser
#

PepperMint, you can't run code outside of blocks

viscid charm
#

wat do u mean?

errant geyser
#

well, you can't run the classname.show() code outside a block like you are doing, hence it doesn't like it

viscid charm
#

wat do u mean by a outside a block?

errant geyser
#

"A block in Java is a group of one or more statements enclosed in braces. A block begins with an opening brace ({) and ends with a closing brace (}). Between the opening and closing braces, you can code one or more statements"

viscid charm
#

O

errant geyser
#

Take your constructor and main function as an example of one

viscid charm
#

public class TestCode {

    public void show() {

        System.out.println("Okay!");

    }

    public static void main(String args[]) {

        Hello obj = new Hello(X);
        obj.hello();


    }

}

class Hello {

    private final TestCode classname;

    public Hello(TestCode classname) {
        this.classname = classname;

    }

    public void hello() {
    classname.show();
    }
    
}```
#

what would I put in X?

#

Hello(X);

errant geyser
#

this

viscid charm
#

What would this mean in THAT scenario?

errant geyser
#

this would refer to the TestCode class

viscid charm
#
public class TestCode {

    public TestCode a;
    
    public void show() {

        System.out.println("Okay!");

    }

    public static void main(String args[]) {

        Hello obj = new Hello(a);
        obj.hello();


    }

}

class Hello {

    private final TestCode classname;

    public Hello(TestCode classname) {
        this.classname = classname;

    }

    public void hello() {
    classname.show();
    }
    
}```
#

that would work?

#

having a instead?

#

cus I put public TestCode a;

dusky drum
#

TryAndSEE

viscid charm
#

Well I meant to say

#

public TestCode a; <- THAT a would be same as this correct?

dusky drum
#

you need to set a so in main do a = this();

#

or this;

#

not sure

#

if it needs ()=

viscid charm
#

but it says cannot chance static reference to non static thing

dusky drum
#

oh

errant geyser
#

public TestCode a; that would just be null

viscid charm
#

I changed it to public static TestCode a;

#

so it stopped giving error

errant geyser
#

Would still just be null

viscid charm
#

o wtf

#

it gave null pointer xD

#

How so?

errant geyser
#

I did say twice it would be null

#

Because you never instantiate it

#

public TestCode a; is the same as doing public TestCode a = null;

viscid charm
#

hmm I still don't get what goes inside the Hello() <-

errant geyser
#

this

viscid charm
#

Cannot use this in a static context

errant geyser
#

unless its static context

#

opk yeah

viscid charm
#

BUT this wouldnt return null btw?

#

and the other thing I said would?

#

Why wouldn't this return null as well?

errant geyser
#

this is a Java thing, it's never null.

viscid charm
#

o

errant geyser
#

It always points to an instance of the class you use it in

#

public TestCode a = this; and then passing in a might work.
I only really do stuffs in Kotlin now and we don't really have static. Our mains are literally just

fun main(args: Array<String> (<- optional btw)) {
  //do whatever
}``` so `this` is perfectly valid for us Kool Kotlin Kids
viscid charm
#

Cannot make a static reference to the non-static field a

#

the a

errant geyser
#

Yeah you really can't do that because of your static main

#

Kotlin ftw

dusky drum
#

just make new class and initialize everything there thats how i used to do.

viscid charm
#

No i am like trying to see

#

private final TestCode classname;

public Hello(TestCode classname) {
    this.classname = classname;

}
#

that part to understand it a bit better

#

whilst keeping the code as simple as possible

errant geyser
#

I swear GitHub supported relative links in markdown

dusky drum
#

rip

lunar cypress
#

It does

errant geyser
#

So what have I done wrong

lunar cypress
#

Prefix it with ./

errant geyser
lunar cypress
#

Can you send a link to the repo

errant geyser
dusky drum
#

this might help you

errant geyser
#

yeah thats what I tried

dusky drum
#

hmmm

#

maybe

#

you need
%20

errant geyser
#

worth a shot I guess

#

Though spaces should be converted to %20 anyway but eh

dusky drum
#

you never know XD

#

and i dont see users using ./

errant geyser
#

u have to be kidding me

#

That actually worked

dusky drum
#

hbahahaha

errant geyser
#

Thats idiotic, thanks

dusky drum
#

XD

lunar cypress
#

Ah well url encoding

dusky drum
#

yeh

lunar cypress
#

Well it makes sense

#

Didn't notice the spaces there

dusky drum
#

XDD

lunar cypress
#

What do we learn from this? Don't use spaces in file names

dusky drum
#

indeed

tacit cave
#

one more simple question

#

!= means false, == means true, || means or, && means and, am i right?

obtuse gale
#

yeah

dusky drum
#

lets say it that way yes, but for me != means not equal and == means equal.

tacit cave
#

kk

#

thx

obtuse gale
#

!= if it doesnt equal == if it does if this is || or if this is if this is && and this is

dusky drum
#

anyone has any good formula for leveling like how much xp for each level?

old wyvern
#
Minecraft Wiki

The main part of this page has a redirect to it's self just so you guys know. 24.10.30.125 08:15, 11 September 2011 (UTC)vanstrat
Someone needs to fix the Bugs text, because that has been officially fixed by Jeb. 173.72.72.214 22:00, 19 September 2011 (UTC)

dusky drum
#

not mc one

old wyvern
#

oh?

dusky drum
#

i need it for something else

old wyvern
#

You can use whatever function you want

#

Depends on how you want the gradient to be

dusky drum
#

ye but i cant find good one

old wyvern
#

go wild

dusky drum
#

either i get to small amount of xp or to big of a change between levels

old wyvern
#

consider one axis to be level and the other experience

#

Work on making a curve

#

And choose what seems right

dusky drum
#

i think this is kinda broken:

old wyvern
#

what is?

dusky drum
old wyvern
#

What function did you put in?

#

looks parabolic

dusky drum
#

(x-1)^2 * 100

#

((currentLevel - 1).toDouble().pow(2.0) * 100)

old wyvern
#

oh god

lunar cypress
#

This is not broken

old wyvern
#

Dont use too high exponents

lunar cypress
#

But not suitable for levels

old wyvern
#

oh it was raise to 2

lunar cypress
#

2 is not a high exponent lol

old wyvern
#

I saw it as 2 * 100 xD

prisma wave
#

@regal gale pretty sure getValues(true) will get literally every value, no recursion necessary

onyx loom
#

who the frick downvoted papi 3 in showcase

lunar cypress
#

getValues() returns a map

regal gale
#

It isn't making any difference dude...

#

You would get this later on anyway: Map<String, MemorySection>

prisma wave
#

I'm not sure that's what happens with getValues(true)

#

It'll flatten the keys and just use a Map<String, Object> afaik

regal gale
#

It is a different story with this for example:

data:
  data1: "Hello"
  data2: 
  - Hi
  - property: Hello
  - Hello2

data1 will return a normal String object, but with data2, it will not be recognized as a full Array, as there is another property inside

heady birch
#

who the frick downvoted papi 3 in showcase
@onyx loom 😠 my beautiful api 😦

onyx loom
#

😭

errant geyser
#

It was SWIFT

#

Explain yourself mortal

hot hull
obtuse gale
#

imo its solving a problem that doesnt exist

onyx loom
signal tinsel
#

Doing some fun shit with commands lol

dusky drum
#

owo level xp circle isnt prfectly centered

signal tinsel
#

Owo I just made an auto command/listener detection system (injecting variables) without reflections

#

Out of boredom

dusky drum
#

:;?

#

my brain lagP

#

i have no idea what ya talking :3

heady birch
#

sound in java is trash

dusky drum
#

why?

heady birch
#

this application has an alarm system and it crashed while running and this super loud screeching just kept going

dusky drum
#

idk what ya doing

heady birch
#

dont be nosy then

#

thank you

quiet depot
#

Owo I just made an auto command/listener detection system (injecting variables) without reflections
@signal tinsel how's it work?

signal tinsel
#

Like

#

@Dependency

#

It then gives that variable a value

quiet depot
#

how does it work behind the scenes lol

heady birch
#

NerdCon

quiet depot
#

idc about the api

signal tinsel
#

Uh i dont know, im on phone

#

xD

#

What do you wanna know tho

quiet depot
#

how does it find the classes?

signal tinsel
#

Uhh i use guavas classpath

quiet depot
#

oh

#

careful with that, I've always had issues with it when using it in spigot plugins

#

I gave up on classpath scanning ages ago, ended up just recursing through the jar itself to find classes.

signal tinsel
#

Yeah i could do that

#

But idk how

signal tinsel
#

What does it use Framework for

#

@quiet depot might use

dusky drum
#

i love how mc added support for animated "world maps"

signal tinsel
#

Oh i get it

#

I understand the code i think

vast pilot
#

is 1.16 ready?

old wyvern
#

wdym?

vast pilot
#

does it support 1.16?

old wyvern
#

What are you referring to by it?

vast pilot
#

ChatReaction 1.8.0

old wyvern
#

It does not say so on the plugin thread but seems to work fine on my server

pastel imp
#

another question of the day: is it a good idea to merge like 5 plugins into a "core" plugin and only have one plugin?

heady birch
#

no

signal tinsel
#

@quiet depot aight ima try ur thing

#

Update, @quiet depot ty, also works

#

Tbf ACF is good

#

Rewriting my prison plugin

#

Tbh its less of a server now tbh

#

Its more of a side project for fun

#

To experiment with

#

I wanna add things to my GUI framework tbh, its fairly simple rn

dusky drum
#

anyone has any good GUI framework?

signal tinsel
#

I have one

heady birch
#

Niallgui

signal tinsel
#

I haven't open sourced it yet tho

#

Lol

#

That doesn't exist

dusky drum
#

whats the sound for tool break?

heady birch
#

tool_break

#

Idk

signal tinsel
#

Sound.ENTITY_ITEM_BREAK

#

I think

glad spear
#

Doesn’t Matt have a framework

heady birch
#

yes

#

MF-GUI

steel heart
#

I’d recommend looking into Mfgui, helper, Smartinvs, vignette, if, inventorygui, Canvas

heady birch
#

if?

ocean quartz
#

InventoryFramework

glad spear
#

if then if then if then else if then if

heady birch
#

canvas?

ocean quartz
steel heart
glad spear
#

Tf, did that just embed and then disappear for anyone then

steel heart
#

Yeah

#

That’s a thing

glad spear
#

Sounds dumb 4769_apudancer

pastel imp
#

another question of the day: is it a good idea to merge like 5 plugins into a "core" plugin and only have one plugin?
no
@heady birch why isn't it?

hot hull
#

Well I mean if it's for a private thing it makes sense, not always the cleanest thing tho

steel heart
#

^ often if you aim to make a public plugin it should only have 1 core feature

#

The server owner will most likely already have a plugin for that other feature

prisma wave
#

SRP should apply to plugins too

#

A plugin should do 1 thing well, rather than many things poorly

pastel imp
#

it's not a public plugin

#

it's private

steel heart
#

I mean sure but be sure to keep a good structure

pastel imp
#

and the plugins are with almost the same objective

hot hull
#

BM, I mean if you split it up properly you can still abide by it fingerguns

pastel imp
#

as "core" systems

#

sooo

#

what's the answer

#

xd

#

I mean sure but be sure to keep a good structure
and yes

#

that's why I want it to be in one single plugin

#

cause I have methods that I use in both

#

soo

#

ye

#

I want to compact it

steel heart
#

Go ahead, it’s private anyways so creating a bunch of stuff like making 5 invidual plugins is quite unnecessary in your case is only going to slow you down.

pastel imp
#

what's an example of unnecessary stuff

#

?

#

.-.

steel heart
#

Just put it all in one plugin but keep it maintained

hot hull
#
Location{world=CraftWorld{name=world},x=-256.5,y=67.8999969959259,z=41.5,pitch=0.0,yaw=0.0}
Location{world=CraftWorld{name=world},x=-257.0,y=68.0,z=41.0,pitch=0.0,yaw=0.0}

@prisma wave I still don't know what to do about this.. I tried rounding it myself but it still doesn't change the location printout

pastel imp
#

you mean organized?

steel heart
#

Yeah

pastel imp
#

ye I usually use lots of packages

#

and managers

#

to organize everything

steel heart
#

Almost never use managers but that happens sometimes

#

But yeah that’s fair enough

pastel imp
#

I mean rlly depends

steel heart
#

Yup

pastel imp
#

but ye