#dev-general

1 messages · Page 335 of 1

static zealot
#

bcz request was bad

regal gale
#

It's still not enough compared to what I talked about lol

unkempt tangle
regal gale
unkempt tangle
#

Then tell me where is the send random voiceclips

static zealot
static zealot
#

probably in Chat Chat

regal gale
#

Aw man... i left there 🥲

static zealot
#

oh want invite?

steel heart
static zealot
#

its dead tho

#

like no one talks

#

ever

steel heart
regal gale
#

@steel heart i'ma end u

old wyvern
regal gale
half harness
static zealot
#

Just a chat chat

half harness
#

what is chat chat

regal gale
#

Just a simple chat chat land

half harness
#

-.-

errant geyser
#

Like help chat, but not

static zealot
#

oh no my neon 404 is broken 😦

half harness
#

discord invite? thonking

static zealot
#

its a secret

#

that only cool people get

half harness
#

;-; ok

static zealot
#

its gone

#

its broken

#

its

#

shit

regal gale
#

Also, the game I was talking about was Yandere Simulator

#

If you know her

#

😂

#

If someone still hasn't figured, there are a lot of memes that cited their code on reddit + people on yt started explaining codes

static zealot
#

hmm can you go back on github? Like 2 commits back or something?

#

like from the page itself not using commands

#

oh I can create branch from a commit

#

and then merge that one to the main lmao

#

or maybe not

lavish notch
static zealot
#

well bcz master is newer and has all the things the old branch has I can't pr it into master

lavish notch
#

Oh, I'm being dumb.

#

Click where it says the amount of commits

static zealot
#

yeah but I can't actually go back

#

from there

lavish notch
#

then click to the two arrows to the left of the commit you want to view

#

*right

static zealot
#

bcz that's what I did

#

and I made a new branch from that commit

#

and then I tried pr-ing the new branch onto the main one

#

but doesn't let me

old wyvern
#

You want to revert commits?

static zealot
#

yeah

#

and I don't know how to use commands

old wyvern
#

try
git reset --hard <commit hash you want to revert to>

#

then commit

static zealot
#

I don't even know how to connect to a repo using commands

#

lmao

old wyvern
#

You just use it in the ij terminal or command window

static zealot
#

oh is VS Code. I don't think it has a terminal

#

unless it does

#

oh it does

old wyvern
#

It does

static zealot
#

and I assume hash is the 7 char string

#

?

old wyvern
#

yes

static zealot
#

actually its way longer if you click on it but it takes the first 7

old wyvern
#

wdym?

static zealot
old wyvern
#

use the full one

static zealot
#

oh I ussed the short one lmao. and it worked

#

well I think it did

#

do I need to push now?

old wyvern
#

Commit and push

#

yes

static zealot
#

it asks me to pull first but if I pull it will just go back to the newest one won't it?

#

ah I had to force push it

#

git push --force

#

thanks

old wyvern
#

lol

static zealot
#

my neon page works again

old wyvern
#

Dont think you had to force push tho, but I might be wrong here

static zealot
#

it just sent an error saying I have to pull first if I didn't force

old wyvern
#

weird

static zealot
#

maybe I typed something wrong idk

lunar cypress
#

No this is correct

dusky drum
#

ugh
PacketPlayOutSpawnEntity
is wierd my items float up when i spawn them Xd

hot hull
#

kek

dusky drum
#

no idea why thism happens XD

regal gale
#

What's your argument on that packet lol

dusky drum
#

welp i figuret out i have to send seperate packet to cancel item velocity for some reason, and i also found that i dont know how to get datawatcher object to gravity on 1.8...

unkempt tangle
#

does anyone know how airships detect their altitude?

quiet depot
#

@compact perch what channel is this

compact perchBOT
stuck harbor
#

barry is correct there

unkempt tangle
#

May I wanna know how to develop such technology on my own?

stuck harbor
#

but this isn't an aviation channel

quiet depot
#

n3w0rk there’s a little man who drops down a rule from the plane and measures how far it goes till he feels it can’t go any further

keen orbit
#

thx

unkempt tangle
#

Like boats with their rope and knots?

quiet depot
#

no...

#

boats have a diver that goes down and sees how far it is

#

obviously

stuck harbor
#

ofc

unkempt tangle
#

Hmm.. There are rising some doubts

quiet depot
#

such as?

#

i will debunk any doubts u have

unkempt tangle
#

Haven't seen such a huge ruler

quiet depot
#

yeah only pilots can buy them

#

with long rulers comes great responsibility

unkempt tangle
#

But isn't dangerous if obstacles hits the ruler?

#

The earth isnt flat.

quiet depot
#

no the little man just pulls it up a little bit

#

and are you stupid?

#

the earth isn’t flat it’s just not not flat

unkempt tangle
quiet depot
#

4head

jovial warren
#

lol

jovial warren
#

12:58:33.062 DefaultDispatcher-worker-1 Server DEBUG NioEventLoopGroup is the chosen one quality lol

astral quiver
#

Hey folks, anyone that knows minecraft protocol?

#

the packet id is a varint by the specification, but currently I'm only seeing a Byte from it

#

I want to know if anyone knows if the packet id uses this varint currently

#

like, I don't new packets that need more the one byte to represent its ID

obtuse gale
#

Just wondering, what are your opinions on Python? Is it a good language to use?

prisma wave
#

I don't hate it

#

It's not my favourite language tho, although many people like it

#

Very easy to learn

obtuse gale
#

yeah

ocean quartz
#

Personally don't like the syntax, but it's a very useful language and very easy to learn too

obtuse gale
#

hmm okay

#

but Java runs faster at runtime right?

prisma wave
#

Yes

#

Significantly faster

ocean quartz
old wyvern
#

CPython might be close tho

#

Not sure

prisma wave
#

Isn't CPython just python?

old wyvern
#

Python compiled to C I think

prisma wave
#

That's Cython

old wyvern
#

Oh?

prisma wave
#

Afaik

old wyvern
#

Oh right

#

yes

#

nvm xD

jovial warren
#

@astral quiver what you struggling with?

jovial warren
#

the value will be a different amount of bytes depending on it's size

#

e.g. if the varint is between 0-255 (-128-127 for signed), it'll be one byte long

eternal compass
#

Does anyone here know how to generate images on the fly with NodeJs/Electron? (I know how to do it with a node webserver, but not electron)

jovial warren
#

if it's between 256-65535 (+-256 < x < +-32767 for signed), it'll be 2 bytes

#

etc. etc.

#

you get the idea lol

#

also, what you making btw?

#

and feel free to steal anything else you might want from that code btw if you're doing Minecraft protocol stuff

obtuse gale
#

does anybody know how to make a plugin that gives a user op when they join (uuid based)

obtuse gale
#

why?

old wyvern
prisma wave
#

Self ops bad

half harness
obtuse gale
#

i know

half harness
#

so why do you want to give everyone op ;-;

#

or anyone

obtuse gale
#

friends

#

xd

half harness
#

hmmmm

#

you can use luckperms

jovial warren
#

just manually give them OP when they join?

half harness
#

and give permissions that way

#

and that

#

just do /op playername

jovial warren
#

the list of OPs is saved in a file, so you won't have to re-op players every time they join

half harness
#

^

jovial warren
half harness
#

how do I fix intellij giving a billion warnings in build.gradle 🤔

#

i dont want to invalidate cache & restart 😫

#

since i have like a billion dependencies

half harness
#

._.

jovial warren
#

invalidate caches & restart

onyx loom
#

classic invalidate

old wyvern
#

and..... ij just crashed 🙂

onyx loom
#

i bet eclipse doesnt crash!

old wyvern
#

Nah but ElaraStorm doesnt

#

Coroutines being a beast and spamming messages 😩

stuck harbor
#

ew

onyx loom
#

giygh

astral quiver
#

So, you can use a function that reads var int to read packet id

#

or just readByte

#

and should work

#

What I'm trying to understand is that if minecraft currently have any packet that have a ID that is bigger then one byte

jovial warren
#

no it doesn't

#

I would still read it as a varint though, just in case that changes in the future

#

what you making btw @astral quiver?

#

also, anyone here up to give me a hand designing the start of Krypton's API btw?

astral quiver
astral quiver
#

but to increase performance and decrease memory allocation, I did this:

jovial warren
#

nice

half harness
#

What is the difference between a serverbound and a clientbound packet?

#

WOAH

#

TIER 5

jovial warren
#

think about it

half harness
#

LETS GOOO

#

anyways

jovial warren
#

where do clientbound packets go?

#

to where?

forest pecan
#

lol

half harness
#

uh

forest pecan
#

look at the word dkim

#

lmao

jovial warren
#

they go to the client

half harness
#

i dont know if it's client -> server or server -> client

jovial warren
#

and serverbound packets go to the server

half harness
#

ok

jovial warren
#

that's why they're serverbound

#

because they're bound to the server

half harness
#

would I be able to use the serverbound Handshake protocol to get the protocol version of the user?

#

idk what handshaking is

jovial warren
#

yes

#

oml

half harness
#

lol

jovial warren
#

handshaking is basically a way for a client to say hello to a server

half harness
#

oh

jovial warren
#

and a server to say hello back

astral quiver
#

why just: send by server + send by client

jovial warren
#

it's a way to establish a connection to someone else

astral quiver
#

much much much simpler to understand

half harness
#

does it "say hello" when the player pings the server or joining?

jovial warren
#

the handshake packet in Mojang code is called ServerboundHelloPacket, so I'll let you figure that one out

half harness
#

lol

jovial warren
#

In telecommunications, a handshake is an automated process of negotiation between two participants (example "Alice and Bob") through the exchange of information that establishes the protocols of a communication link at the start of the communication, before full communication begins. The handshaking process usually takes place in order to establ...

#

read that

astral quiver
#

The TCP protocol also does handshaking

#

so is two handshaking

jovial warren
#

actually trying to get you to read something is like telling a baby to not touch something because it's hot

#

just doesn't happen

jovial warren
#

basically, handshaking is when a client says hello to a server

#

and generally, the intention of a handshake is to establish a connection

#

in TLS for example, handshakes are used to establish an encrypted connection

#

TCP's handshake is to establish that you and the server are both alive and receiving packets correctly

#

also, thinking about Krypton's API, events are gonna be a real pain, since a lot of Krypton is async

half harness
#

oof

steel heart
#

Make it joinable so we can make it sync also

#

Or smtng

#

Actually that would be a problem

#

But yeah forcing async isn’t nice

jovial warren
#

chunk loading is done on an IO dispatcher coroutine, and so is sending the packets to other connected players when you join the server (e.g. spawn player, chat, etc.)

#

still actually debating whether I like Sponge or not

#

actually Sponge 8 is far from done so that's kinda out of the question, might use some of it as a reference though

astral quiver
#

Do you folks are using kt-mc-packet at Krypton ?

jovial warren
#

nah

astral quiver
#

I'm backing working on it

jovial warren
#

I think Krypton was made before kt-mc-packet was a thing

astral quiver
#

yeh, I know

jovial warren
#

and I'd rather not rewrite the backend to use it tbh

astral quiver
#

the major problem now is that some minecraft packets are dynamic, is not the same thing one a flag in the middle is true or false

jovial warren
#

yeah their structure changes based on the content, which is frustrating

obtuse gale
#

For example the tab complete packet fingerguns

jovial warren
#

and also, compression

#

compression completely changes the packet format

half harness
#

How do I use PacketContainer (protocollib)?

#

So confusing

obtuse gale
#

getWhatever will "give you" all "whatever" variables that are in the packet indexed

#

So if you do getIntegers().read(0) that will read the first integer in the packet

#

getIntegers().write(3, 69420) will set the 3rd int to 69420

half harness
jovial warren
#

wise man once said there's no such thing as a stupid question, just a stupid idiot asking the question I guess

half harness
jovial warren
#

also, what do you want to do? listen for when the packet arrives?

half harness
#

yes

#

i want to learn how to use protocollib

jovial warren
#

literally an example of that in the README

half harness
#

i know

#

but

#

i'm still confused

jovial warren
#

you probably want PacketType.Play.Client.PLAYER_DIGGING I guess? if that's what it's called

half harness
#

._.

#

anyone know?

jovial warren
#

oh btw, I've decided that I actually kinda like Sponge, and that implementing Sponge is gonna be far easier than designing my own API

#

I will still add some extensions and stuff to make it easier to use in Kotlin, but for the most part, it'll be Sponge

obtuse gale
half harness
#

so it's getFloats().read(0)?

#

oh then protocollib is ez

obtuse gale
#

It's a bit overwhelming at first and sometimes you have to use reflection of your own but yeah it does make things hella easier

timber oak
#

Does people usually make a class for Listeners or a package for them?

prisma wave
#

package

#

single responsibility principle

timber oak
old wyvern
#

We make functions!
OOP bad FP good!

stuck harbor
#

mmmhm

prisma wave
#

true!

prisma wave
old wyvern
#

Nah man, we do it in the break time

timber oak
#

What do you mean with the principle

old wyvern
#

study during the classes

#

🙂

stuck harbor
#

fundamental principles of OOP

#

other than being bad

old wyvern
#

Look up SOLID

stuck harbor
#

abstraction

onyx loom
#

?solid

compact perchBOT
old wyvern
#

abs

stuck harbor
#

inheritance

#

polymorphism

#

thunder noises

old wyvern
#

Polymorphic functions 🤤

prisma wave
#

parametric polymorphism 🤤

steel heart
#

Mutability, no thread safety and side effects

#

So nice

#

3 in 1

onyx loom
#

shut

timber oak
#

So in single responsibility principle it's just however you define one responsibility? Since a responsibility could be to just have all Listeners. Could also be a class per listener though?

prisma wave
#

where you draw the line depends

steel heart
#

SRP imagine

timber oak
obtuse gale
#

am i allowed to ask a question not related to placeholder?

steel heart
#

I code everything in one class (:

old wyvern
#

Basically divide it into the smallest units possible that can independently exist

prisma wave
#

^^ however, you might have 2 event handlers in the same class if they handle the same thing (eg death event + quit event for leaving a minigame)

timber oak
old wyvern
#

Not true

obtuse gale
#

take it as a yes then

timber oak
#

I see what you mean, I just have to know where to make a new class and when to just keep using the same

old wyvern
#

A class might need to listen to multiple events for its Unit functionality

obtuse gale
#

ok i have commandnpc how do i get my npc to run a mvtp though console to tp the player that clicked the npc to the correct world

prisma wave
old wyvern
#

fpprank 🥲

prisma wave
#

wasnt feeling it today 🥲

old wyvern
#

xD

prisma wave
#

feel free to do it yourself lol

old wyvern
#

forgot the link

stuck harbor
#

oh no

#

I have to

#

deal with

#

the areashop api

onyx loom
prisma wave
#

🙂

old wyvern
#

Ah there we go

onyx loom
#

first thing i see on the link 👀

old wyvern
#

That face 😌

#

Truely horrifying

prisma wave
#

he haunts me

old wyvern
#

yes, YT keeps recommending that

prisma wave
#

i think i watched it

#

finally

#

it was pretty interesting actually

old wyvern
#

Yea but seems he didnt have many attendees at the lecture

#

There were like 10-20

prisma wave
#

yeah it was pretty quiet lol

timber oak
#

What is the use of making classes for Listeners only? Like I'm making a GUI rn but why not just create the GUI in the same class as the event?

stuck harbor
#

noh

#

?solid

compact perchBOT
stuck harbor
#

altho that link

steel heart
#

How unfortunate I don’t follow a single one of them

stuck harbor
#
While these principles can apply to various programming languages, the sample code contained in this article will use PHP.
steel heart
stuck harbor
#

ive been learning PHP cause i need to make a portfolio website

#

and i only know wordpress sadge

steel heart
#

Rip

old wyvern
steel heart
#

Tbf just have a class for every method

#

Ez

onyx loom
steel heart
#

And ofc that class should have an abstract implementation and an interface

old wyvern
#

Nah man, what we need is a AbstractClassFactory and generate everything

#

self writing program

#

!!!

steel heart
#

Lmao

old wyvern
#

Take that Siri!

steel heart
#

We need a factory for that class as well

old wyvern
#

AbstractFactoryFactory#recursivelyCreate(AbstractClassFactory.class)

steel heart
#

LMAOOOOO

lunar cypress
#

but

steel heart
#

Lmao thanks for showing me

old wyvern
#

What in the...

timber oak
#

But then if I decide to make a second GUI do I then make two new classes again?

#

because then I'd end up with tons of classes

old wyvern
#

If that GUI is different from the first, yes. Ideally tho, if you are working with a lot of these, you'd build a minor internal GUI library or more likely use the pre-existing ones.

prisma wave
#

Who thought this was a good idea

lunar cypress
#

I do not know

#

I thought it was a joke at first

#

It's literally just replacing methods with constructors

prisma wave
#

That...

#

I can understand wanting to avoid static methods

#

But why this

onyx loom
#

because object-oriented programming 🙂

old wyvern
#

Yea I think its a joke

prisma wave
#

The irony is

#

On the "reasoning" page they say true Objects should represent real life entities

#

And then...

old wyvern
#

The SetOf object tho

#

That one's too real

#

Worse than slenderman

#

SCP-404

prisma wave
#

😟

#

I'm convinced this is a joke

onyx loom
#

wym this is great

#

gonna try it out rn

#

cant wait to transform my code into this beauty! 😍

prisma wave
#

I hate that

#

So much

dawn hinge
#

Eww

#

Wtf

hot hull
#

Ew

dawn hinge
#

My eyes angry_fingerguns

old wyvern
prisma wave
#

Lmao

surreal quarry
#

that is hideous kaliber

onyx loom
#

wym

#

i do not see anything wrong.

hot hull
#

Someone get this dude some glasses and a bag of brain cells

#

Took a lot of energy to come up with that!

onyx loom
#

wouldve been better if he turned the sout into an object too fingerguns

prisma wave
#

new Print

onyx loom
#

yes please

surreal quarry
#

new Out

#

new ConsoleLogMessageOutputter

onyx loom
#

new System 🙂

surreal quarry
#

new

old wyvern
#

new new new

prisma wave
#

Ok but when is new Variable(String.class, "s") coming

old wyvern
#

new (new (new NewFactory()))

surreal quarry
#

thats a great idea

static zealot
#

I love me some new new new new new new new new new new. The newest new

surreal quarry
#

Variable<T>

prisma wave
#

N.java

old wyvern
surreal quarry
#

NewFactoryFactory

static zealot
#

I also love using deprecated events because the new ones are broken

surreal quarry
#

sounds like a personal issue

onyx loom
#

sounds like a you problem

prisma wave
#

Sounds like you're not using enough OOP

static zealot
#

I love functional programming

old wyvern
#

NewLang
helloworld:

New New         neW     new new new   New     nEW     New
neW     New     nEW     new           neW     New     nEW
neW     New     nEW     new NEW       neW     New     nEW
neW         New nEW     new           New     nEW     nEW
NEW         new new     new NeW neW   new new new new new
onyx loom
#

new

static zealot
#

I don't know if I like this

surreal quarry
#

why not??!?!?!?!?

onyx loom
#

modern

half harness
#

making a forge mod is impossible 😭

onyx loom
#

is it tho 🤔

hot hull
half harness
#

it is

obtuse gale
#

for you lol

onyx loom
half harness
#

yes

#

for me

#

anything i can do?

static zealot
#

yes

half harness
#

what can i do

static zealot
#

kill myself

half harness
#

...

#

😕

static zealot
#

😕

half harness
#

i have 1.3 gb ram available

#

how much does gradle need?

#

😦

obtuse gale
#

6

half harness
#

How do I fix the project's gradle settings?

#

because I still have a gigabyte or ram left before it says "out of memory"

stuck harbor
#

sadge

old wyvern
#

Clash ?

stuck harbor
#

yawn sure

old wyvern
#

anyone else?

stuck harbor
#

there should be a clash role to ping

old wyvern
#

Yea

#

Shall I start for now?

stuck harbor
#

sure

static zealot
#

shall I ping?

#

xD

#

@old wyvern @steel heart @half harness @obtuse gale @onyx loom @ocean quartz @hot hull @prisma wave @jovial warren @stuck harbor @forest pecan wanna join?

stuck harbor
#

jesus this one rn

half harness
#

im busy trying to get this thing to work

stuck harbor
#

its mad

old wyvern
#

ayyy xD

old wyvern
#

xD

#

but holy shit

#

this question

static zealot
#

well I gotta go take a shit. see you in 2 hours

obtuse gale
#

lol

stuck harbor
#

ffs this one

#

i cba

onyx loom
#

what is with blitz and 2 hour poops

stuck harbor
#

2? those are paultry numbers

half harness
#

👀 it's been 11 minutes and it hasn't ran out of memory

stuck harbor
#

stonks

#

'decompileMc'

#

sheesh

half harness
#

1.5gb free memory

#

why does it take 15+ minutes to decompile mc

#

also the red x scares me

surreal quarry
#

he really forgot me in the mass ping smh my head

winter iron
#

same

#

:/

surreal quarry
#

this is why we need COC role

steel heart
#

Yep

half harness
#

its been 25 minutes

steel heart
#

Fabric or forge?

half harness
#

forge

steel heart
#

Please die

half harness
#

...

hot hull
stuck harbor
obtuse gale
steel heart
#

I concur

onyx loom
#

are we going to talk about compact mode

steel heart
#

I have it too

#

It’s very effective

onyx loom
#

questionable behaviour

steel heart
#

Albeit iOS does not have it which is a shame

half harness
#

so I finished the setupDecompWorkspace stuff but it's as if nothing happened...

#

it still compiles

stuck harbor
#

stonks

stuck harbor
#

well I think I can guess

forest pecan
#

lol

stuck harbor
#

that this is

#

in fact

forest pecan
#

cap

stuck harbor
#

perhaps

half harness
#

why is mod development so hard

#

why can't it just be like spigot, just run buildtools, add the dependency, done

steel heart
#

It’s nice but forge is a mess

forest pecan
#

then you make it

#

lmao

surreal quarry
#

L

steel heart
#

Therefore fabric

half harness
forest pecan
#

nah but like serious

half harness
#

nothing is working 😭

forest pecan
#

it cant get easier prolly

half harness
#

anything i should do

#

apparently it can't resolve net

#

no imports with net work

forest pecan
#

theres other ways to say u suck

#

:)

half harness
#

....

#

:(

#

😭

steel heart
#

👏 f a b r i c 👏

ocean quartz
jovial warren
timber oak
#

How are nametags created? Since armor stands are so slow I can't really see why you would use those for it.

steel heart
#

Packets

#

Async

errant geyser
#

Idk if this is a decent method anymore but the last time I did that I mounted the smallest magma cube to a player and used its name tag

#

It was barely above the regular height

timber oak
#

Some of you in here might have an idea of my plugin knowledge so how good is it compared to that I started a month ago? Am I like decent or? Honest opinion

surreal quarry
#

iirc you started learning java a month ago right

timber oak
#

Iirc?

surreal quarry
#

if i remember correctly

timber oak
#

No, I’ve used it a bit before

#

Maybe like a month totally

#

Idk

#

Before starting on plugins

surreal quarry
#

well anyways, you are still a beginner (as am I)
java itself is huge and takes years to learn (and even then you are still learning more about it every day)
the spigot api is also a relatively complex api (and poorly made in many cases)
it wouldn't make sense to be very good with any of it in that short of a period of time. you have improved since day 1 i would guess, but there is still a lot more to learn

timber oak
#

Alright, so would you say I’m improving fast or slow or whatever?

surreal quarry
#

no clue, i have a terrible memory lol

#

you're probably around where i was at a month or so

timber oak
#

Alright, just feel like this is more complicated than how I thought it was. But I guess most people think that then

#

For example DI

#

That was so confusing to begin with

#

Still kinda is but getting better

half harness
#

before u try using DI

#

you should probably learn more about how instances and constructors work

#

and static too

#

(dont use static)

#

but you should learn about it

#

yk what i mean?

surreal quarry
#

i did it the hard way and learned java while i was learning plugins. I would say i didn't really understand DI for a while, i sort of just recognized the patterns of passing instances of classes to one another. You'll understand it eventually. Reading online can be very helpful. theres good articles and SO answers about these things all over the place

half harness
#

i didn't know what overriding did until a loooooooooong time past i started learning lol

surreal quarry
#

static is ok to use in certain cases

half harness
#

ik

surreal quarry
#

stateless things

half harness
#

but dont abuse

#

it

steel heart
#

I use static everywhere

surreal quarry
#

indeed

half harness
#

ms edge is mean

surreal quarry
#

use chrome

#

noob

steel heart
#

It makes my code minimal, less lines

half harness
#

no

timber oak
half harness
#

JDA fingerguns

timber oak
#

But I mostly learn java through making plugins

half harness
#

JDA > spigot

steel heart
#

Discord4j > jda

half harness
#

🙄

steel heart
#

I don’t make the fax

half harness
#

anything > spigot

surreal quarry
#

discord4k

half harness
#

lol i just saw this in another discord

surreal quarry
#

Lmao

steel heart
#

Lol

half harness
#

my response:

timber oak
#

Why not just always avoid using static?

half harness
#

for example util methods

surreal quarry
#

it is very useful to have static for stateless things

half harness
#

theres no point of it having its own instance

#

so it's static

#

it might be confusing 😕

ocean quartz
half harness
#

^

timber oak
#

But I cannot access static methods and classes from non-static ones?

half harness
#

you can

surreal quarry
#

you can't call non-static methods in static methods

half harness
#

hm

surreal quarry
#

but you can call static in non-static

half harness
#

i have an example

timber oak
#

Ohhh

#

Makes sense

surreal quarry
#

actually thats not always true

ocean quartz
#

You can instantiate things in static methods which allows you to call non static members from the instance

timber oak
steel heart
#

Static is nice

#

Prevents object orientation

surreal quarry
#

if you pass an instance as a parameter you can

steel heart
#

Complicates code

#

And last of all hinders unit testing

surreal quarry
#

you can't do something like this

class ... {
    static void blah() { other(); }
    void other() { ... }
}```
timber oak
#

Like, earlier today I was testing out DI in standard java. You cannot use it in the main method though? Since it’s static

#

I couldn’t figure out how to do it at least

quiet depot
#

sure you can

surreal quarry
#

you can do something like this

quiet depot
#

yep

#

u beat me to it

surreal quarry
#

lol

quiet depot
#

was typing it out on phone

surreal quarry
#

lmao

#

that would've taken a bit

timber oak
#

Ohhh so that’s actually what I did In my main class in the plugin

surreal quarry
#

a plugin's entry point is already non-static

#

so no need for something like that

timber oak
#

I did need it to get access to other classes though?

surreal quarry
#

oh well you were creating an instance of a class in your onEnable i think

#

thats a bit different than this

timber oak
#

Aren’t you doing that here?

surreal quarry
#

not exactly. in a regular java application, your entry point is in a static context, so you would usually have 2 classes. a launcher and a main class. the launcher's only purpose is to create the main class and call any sort of initialization methods that main class has (if its not done in the constructor)

the point of this is to take your app from a static context to a non-static context. when make a new ReportBot() then call #start(), it gives the app a non-static entry point.

#

you can think of that start as if it was the onEnable of a plugin. its a non-static entry point

timber oak
#

Hmmm, but what you were showing above just created an object of another class though right?

surreal quarry
#

it did

#

i created a new instance of ReportBot and called the start method in that class

timber oak
#

I learned about creating objects when I was learning java. But not about how to make constructors make new objects or whatever it does

#

Not sure what constructors do yet. Like how they actually give access to the methods in the class

surreal quarry
#

in a minecraft plugin, you don't worry about that step. the spigot api takes your plugin, and uses reflection to call your plugins onEnable

steel heart
surreal quarry
#

it sometimes helps to think of a constructor as a very specific method. it can have 0, 1, 2, 3, 4, 382 or any number of parameters that you pass it

#

you pass those params when you do new MyClass(...)

#

so you are providing the new instance of MyClass with the params ...
those params may be a string, it may be another class, it may be a boolean

#

thats how you use DI to "give access" to the methods of a specific class

timber oak
#

But what does actually happen when you parse the class into the constructor as a parameter?

surreal quarry
#

thats up to you

timber oak
#

Like why does that “give access” to the methods

surreal quarry
#
public MyClass(OtherClass clazz) {

}```
this would do absolutely nothing. it doesn't provide you with any of the methods from `OtherClass`
```java
private final OtherClass clazz;
public MyClass(OtherClass clazz) {
    this.clazz = clazz; // assign the private value clazz to the clazz passed when the class was created
}
// in methods down here, `this.clazz` or just `clazz` is available because you are in the same class where the private variable was created```
This example does something. It takes the passed `clazz` and assigns it to a variable that the rest of the methods in your class can use
timber oak
#

Alright damn, I’m saving this message. This is the best explanation I’ve had of DI lol. I’m really tired right now so doesn’t make 100% sense to me right now. But more than ever before lol. What I don’t understand is that you would need to do something in OtherClass for this to work right?

surreal quarry
#

not exactly. you would need to make an instance of OtherClass at some point so you have something to pass to the constructor

#

and you would probably want methods or variables in OtherClass

#

otherwise there’s not really a point of injecting it

timber oak
#

An instance like this? “OtherClass clazz = new OtherClass();”? Or wdym. Typing this on phone so yeah kinda slow lol

surreal quarry
#

yea exactly that

timber oak
#

So which class do you do this in? Lol

surreal quarry
#

ooh ur blue now

steel heart
timber oak
#

I’ve used this multiple time before I’m just so tired rn lol

#

I can’t remember how to use this rn lol

surreal quarry
#

it can be in any class

timber oak
#

You make the instance in MyClass in this example right?

surreal quarry
#

you just need access to it when you make a new MyClass(...)

#

not in MyClass if you are passing it to MyClass using DI

#

it is sort of situational where and when you make it though

timber oak
#

Alright, kinda makes sense to me now. I’m just too tired to understand it rn I think. I’ll read through all this tomorrow again. Thank you very much for taking your time to explain all this!

#

This really helped me understand it

surreal quarry
#

yea np

steel heart
#

James epic carry

timber oak
#

Oh yeah blue name now lmao

timber oak
surreal quarry
steel heart
jovial warren
#

Been working on the Krypton API, using the good parts of Bukkit and some of Sponge as a reference

#

Currently got a somewhat existent API with the stuff to work with players, load and retrieve worlds and chunks, get status info, and create scoreboards. Also got Player inheriting from Adventure's Audience, because native Adventure support good

#

I may or may not have stolen Bukkit's Vector functions as well lol

#

The good thing about my vectors though is that they're completely immutable. All operator functions and calculations call copy with the new values, so you can be sure that your vector won't be modified by something else. It also means that things like the vector's length (sqrt(x^2 + y^2 + z^2)) is only calculated once

lunar cypress
#

It also means that things like the vector's length (sqrt(x^2 + y^2 + z^2)) is only calculated once
how so?

jovial warren
#

Because you only need to calculate the length once, as it won't change

#

Since it's immutable

lunar cypress
#

...sure, but when does it happen

jovial warren
#

Not sure, it's a val so likely when it's instantiated?

lunar cypress
#

bad idea

winter iron
#

calculate when u need it?

jovial warren
#

Yeah maybe that is a bad idea

lunar cypress
#

what I would recommend is a private lazy value and a public property that gives you the value of the lazy

jovial warren
#

Ah yes, lazy properties, that'll be it

#

Maybe just by instead of = might do that

lunar cypress
#

oh yeah you can do something like by lazy I think

#

Although I've never really understood property delegation

jovial warren
#

I think the way that works is it'll be calculated lazily but only once, which is exactly what I want

#

Also, Krypton has three types of positional indicator

#

You've got Location, which is bound to a world and supports coordinates with fractional precision, and it also supports the two rotational axes pitch and yaw

old wyvern
#

That doesnt seem like anything new?

jovial warren
#

You have Vector, which isn't bound to a world, and is essentially just a standard element of vector space. This also supports coordinates with fractional precision

#

Then you have Position, which isn't world bound either, but does not support coordinates with fractional precision

old wyvern
#

What would Position represent then if its not bound to a world?

jovial warren
#

It's things like block and chunk positions

old wyvern
#

Those should be bound to the world tho?

jovial warren
#

I know that technically means it should be bound to a world, but it's easier if it isn't

#

Unless it isn't easier

#

Actually I might make position bound to a world

#

The reason it's not in the server is because worlds and chunks are kept separate from one another due to the way they are loaded

old wyvern
#

Position here just seems like an unnecessary extension to Vector from the above description, i.e, a vector with integer coordinates

jovial warren
#

Chunks are loaded by loading region files with the RegionManager, and the WorldManager loads world data from level.dat

jovial warren
#

And I can't merge position with location because a location includes pitch and yaw, whereas a position doesn't

old wyvern
#

mhm, and if you do want a integer bound version, Id say atleast name it for the specific use case, so like BlockPosition instead of Position

old wyvern
jovial warren
#

Yeah but then if I name it that, I'll also have to make a chunk position, which just over complicates things imo

jovial warren
old wyvern
#

Yea but then entity could simply add on a Rotation property that takes care of that specific thing

jovial warren
#

True

#

I think storing double precision block positions is a bit wasteful though, and that means I'll have to check for that on the backend

#

Anyway, I got English now :(
See ya

old wyvern
#

Alright ciao

unkempt tangle
#

You can write your plugins in lua

#

Lul

stuck harbor
#

bad

unkempt tangle
#

Nu i guud

stuck harbor
#

only supports up to 1.12.2 haha

unkempt tangle
#

Minecraft Java Edition 1.13+ support is under development. Please don't join with 1.13 yet if you want a playable experience

stuck harbor
#

stonks

unkempt tangle
quiet depot
#

=plugin lukkit

compact perchBOT
#

vv2.1.2 by AL_1
Create Bukkit plugins quickly and easily using the lua scripting language.

Downloads:

677

Likes:

0

Reviews:

7

quiet depot
#

lua is at its heart, an embedded language

stuck harbor
#

fuckin' lua

#

if ur gonna just go over every single programming concept, at least do it like common lisp

stuck harbor
jovial warren
#

GraalVM means you can write plugins in a multitude of languages

#

Including Python

astral quiver
#

Any server implementation already supporting graalvm?

#

anyone knows?

#

I don't, Paper maybe?

stuck harbor
#

perhaps

#

perhapsn't

astral quiver
#

Someday I got more time to finish the project

#

There is alot of things to be done

#

specially with PDM

quiet depot
#

dev

#

server impls don't need to support graal

#

it's kinda like java's scripting engine, but even more usable

gentle coyote
#

Yo, I am trying to spawn a fake armor stand using ProtocolLib, however, wiki.vg tells me, I should use a 'Spawn Object' packet for Armor Stands (https://wiki.vg/Entity_metadata#Mobs) and references that packet, but there is no documentation about it. So I want to ask you what the most recent way of spawning an armor stand using packets is lol

obtuse gale
#

@gentle coyote they probably mean that mobs should be spawned with the "Spawn Living Entity" packet and the ones in yellow with the 'regular' "Spawn Entity" one

gentle coyote
#

Alright. And they also mention to use the Object ID instead the Entity ID. Im quite unsure what to specify for the entity ID when sending the packet if I use the Object ID...

obtuse gale
#

Probably the object id? Lol no idea

gentle coyote
#

No, theres a special field for that

jovial warren
#

If it runs on HotSpot, it'll run on Graal

unkempt tangle
#

Can you enchant books or boots for Frost Walker ?

ocean quartz
#

No .. or can you?
Vsause theme playing

obtuse gale
#

*proceeds to talk about everything in the universe without actually answering the question*

toxic python
#

Hey, I've downloaded DeluxeMenus 1.8.0 on my 1.8.8 Spigot Minecraft server and yet it doesn't work. It shows up as red in /pl.

  • I do not use /reload
unkempt tangle
#

Probably a conflict (lack of dependencies, config gone, version incompatibility, config yaml file is wrong)

toxic python
#

@unkempt tangle Thanks! I've fixed my issue, it required PAPI I didn't know it was a must for PAPI to exist so the plugin would work. Ty.

astral quiver
#

so, is not just a VM

half harness
#

#bot-commands 🙂

oak coyote
#

shh

#

see

half harness
#

-_-

#

🙂

oak coyote
#

imagine not having better discord

#

what an L

half harness
#

what-

#

...

oak coyote
#

nah i've made L a vowel just to prove a point

half harness
#

ok

#

you know betterdiscord is against discord tos

#

👀

stuck harbor
#

👀

#

betterdiscord isn't better, 'tis worse

half harness
#

HA you deleted ur MESSAGE

#

PROOF

ocean quartz
half harness
#

bAN

stuck harbor
steel heart
#

I use discordworse

stuck harbor
#

oops sry ping

steel heart
#

oops sry ping

unkempt tangle
#

isnt betterdiscord already taken off?

#

all years old

hot hull
#

I never knew PlayerQuitEvent doesn't get called when the server shuts down and the player is kicked

static zealot
#

oh wait for real?

hot hull
#

apparently yea

half harness
#

just use onDisable 🙂

#

||and manually call PlayerQuitEvent||

hot hull
#

Let's see if this works

#

nope

half harness
#

what

#

Frcsty lost connection: Yeet

hot hull
#

tried kicking the players on disable

static zealot
#

But why not do what you do on quits in onDisable?

hot hull
#

Because the code which I need executed doesn't get directly called from my main class so it'd be a fuckery to do that

forest pecan
hot hull
#

mac, ew

forest pecan
#

its me school laptop

#

chill

hot hull
#

Do you see my issue

forest pecan
#

with the oceans?

hot hull
#

it duplicates the item because it doesn't clear their inv on server shutdown

forest pecan
#

Oh

#

I see

#

I got two punch sticks now thonkdevil

hot hull
#

if I call it on join then I need to delay the give

#

Which I mean works but ew

forest pecan
#

Oooof

hot hull
#

Didn't kick you, server did

forest pecan
#

Lmao

hot hull
#

This is what I got so far

#

Still need to change the functional interface abuse

#

But idc rn

stuck harbor
#

mmm nice main class

hot hull
#

very

stuck harbor
#

very klean

hot hull
#

need to move the action stuff out

stuck harbor
#

I could do that even cleaner in a lisp

#

;)

hot hull
#

be gone

ocean quartz
#

@hot hull Isn't it supposed to be Registrable? xD

hot hull
#

Registerable

#

both are incorrect apparently

ocean quartz
#

Wdym both are incorrect?

hot hull
#

Registerable sounds better imo

static zealot
#

Regestribale

#

this is good ^

hot hull
#

could just make it Registry perhaps

steel heart
#

What have I done

#

I use lombok

hot hull
#

COnclure why

#

@ocean quartz btw using mf gui in that, gotta costumise the shit out of it

stuck harbor
#

mmmmmf gui

#

scrollingGui cool

hot hull
#

Yus

static zealot
#

motherf gui

jovial warren
#

right, it's time to design the command system for Krypton

#

might somewhat base it off of BungeeCord's command API, since I like the Command(name, permission, aliases)

obtuse gale
#

I personally prefer the idea of allowing predicates instead of plain strings as permissions

#

more like a "requirement"

jovial warren
#

yeah maybe

half harness
#

wdym

jovial warren
#

I could accept a Predicate<T> I guess

obtuse gale
jovial warren
#

but that might start to get a bit messy

#
class MyCommand : Command(name, { it != null }, aliases) {

    override fun execute(sender: Sender, args: List<String>)
}
#

for example

#

we're definitely not having an annotation-based command system, because I just don't like them all that much tbh

hot hull
#

If you don't add brigadier command colorization imma be mad

jovial warren
#

might cheat and have execute provide an Audience lol

hot hull
#

What's an Audience

obtuse gale
#

adventure audience

jovial warren
#

by Adventure documentation, an audience is a receiver of Minecraft media

obtuse gale
jovial warren
#

"Audience is designed to be a universal interface for any player, command sender, console, or otherwise who can receive text, titles, boss bars, and other Minecraft media"

prisma wave
jovial warren
#

yeah whatever lol

obtuse gale
#

lol

prisma wave
#

🤬

jovial warren
#

also, how would I then do permission checking if I was using predicates?

surreal quarry
#

it would actually be really nice if it provided an audience bardy

prisma wave
#

just make Sender implement Audience

jovial warren
#

there might not even need to be a Sender lol

#

since Audience covers just about everything I would need

prisma wave
#

wtf

#

??

jovial warren
#

lol

surreal quarry
#

lmao

prisma wave
#

wtf

half harness
#

lol

prisma wave
#

🤨

half harness
#

d;lol

prisma wave
#

Anyway

#

What I was going for

prisma wave
#

It can implement Audience but it should probably be a more specialised type

jovial warren
#

eh, apart from the name of the sender, that's about it

surreal quarry
#

yea you need a Sender and a Player of some sort, just make them both implement audience in some way

prisma wave
#

Compare CommandSender and Audience

#

Big difference

jovial warren
#

actually Permissible has quite a bit I might need yeah

prisma wave
#

getName, performCommand, all the permission based stuff

surreal quarry
#

doesn't have that much

jovial warren
#

true

#

it has a few things I might need though

surreal quarry
#

but its useful stuff

#

yea

jovial warren
#

also, how should I do perms btw?

#

I should probably just stick with string perms tbh, for compatibility

surreal quarry
#

if you do it the same way spigot does it

#

yea

onyx loom
#

just shove luckperms in the jar

jovial warren
#

predicates will get a bit messy as well

jovial warren
onyx loom
#

☹️

jovial warren
#

also, gl getting LuckPerms to work with predicates lol

surreal quarry
#

string permissions

#

people can use predicates if they choose to

obtuse gale
surreal quarry
#

you shouldn't have Command take the permission as an argument i dont think

#

unless its a predicate

obtuse gale
#

If you're making a stringly based permissions system I myself am gonna write an LP implementation for it fingerguns

jovial warren
jovial warren
surreal quarry
#

yea optional would be fine

jovial warren
#

defaults fingerguns

surreal quarry
#

but don't require people to use ur permission thing for commands. i sometiems have multiple perms for a single command depending on subcommands and stuff

obtuse gale
#

That's why it should take a predicate fingerguns

jovial warren
#

yeah I'll just do what bungee does

obtuse gale
#

D:

jovial warren
#

an empty string means no permission

#

this is just for executing the command btw

surreal quarry
#

null means no permission

obtuse gale
#

Strings!! Aargh!

jovial warren
#

you still have the execute body

jovial warren
#

also, still thinking of how I want to do plugins

prisma wave
#

PDM

surreal quarry
#

relocations when

prisma wave
#

what I mean is

jovial warren
#

I really want to use inheritance, but then I would probably need to support DI

prisma wave
#

Make that shit work with pdm

#

otherwise I will delete the repo

surreal quarry
#

lmao

jovial warren
#

I do and I don't want to do another Spigot and just instantiate the class myself

prisma wave
#

don't

jovial warren
#

that's the easy way

prisma wave
#

Don't copy bukkit's cesspit of a system

jovial warren
#

I might add a lightweight DI framework like Koin or Guice in there or something though, that's another option

surreal quarry
#

what is the point of a DI framework lmao

#

i've never understood that

jovial warren
#

to... inject... dependencies...

surreal quarry
#

you don't need a framework for that

jovial warren
#

no, but it's really nice to have one

surreal quarry
#

why?

jovial warren
#

especially with something like Spring, where dependencies come from literally everywhere

prisma wave
#

Yes use something lightweight such as spring boot

jovial warren
#

-_-

prisma wave
#

Maybe a bit of XML configuration too

jovial warren
#

might use Koin tbh

#

not sure it's really designed for this kind of stuff though

#

also, is there really a way I can have the main class not be instantiated by me and yet still get an instance?

ocean quartz
prisma wave