#help-development

1 messages Β· Page 766 of 1

hazy parrot
#

This really depends on u

#

That question looks like something that can easily be googled

storm crystal
#

Doesnt that apply to any questions here, kind of break the point of help channel existence

hazy parrot
#

It doesn't

storm crystal
#

Pretty sure it does

#

But ig ill find answer there faster at this point

ivory sleet
#

Practically yes

#

Depends

#

But usually its not too shabby to partition it per functionality

#

Like

upper hazel
#

can playerInteract cause bugs?

smoky oak
#

OH YES IT CAN

#

(im still salty if u couldnt tell)

lilac dagger
#

yeah, like the double interact

smoky oak
#

here's a list

  • Can trigger twice
  • Sometimes does not trigger
    • The way around it (ArmAnimationEvent) cannot distinguish left and right click
  • (only reported to me, couldnt verify) sometimes right click gets read as left click
worldly ingot
#

It triggering twice isn't a bug. It's called for each hand and you have to account for that :p

#

That's very much intentional

smoky anchor
#

Aight, are the instances when it sometimes does not trigger documented ?
Never had that problem

smoky oak
#

ik but thats not the issue im having lol. relevant for both of u i guess
theres a specifici distance where neither interact nor entitydamage triggers when you left click

upper hazel
lilac dagger
worldly ingot
#

That sounds like the fault of older plugins not updating after 7 years πŸ‘€

slender elbow
#

yeah plugin authors should awaken from their decade old slumber to update their abandonware

river oracle
quiet ice
#

MethodHandles lol

river oracle
#

MethodHandles are amazing

#

I love them

#

Such great api I always love using them

echo basalt
#

1.7 to 1.20.2 take it or leave it

quiet ice
#

Though speaking of updating, I should check whether EnchantmentsPlus still works on the newest versions

#

But eh, not so much should have changed between 1.19.2 and whatever the current version is now

river oracle
#

Which I use oh so much

quiet ice
#

Although the codebase is still largely the same as it was 1.16

river oracle
#

1.21 the update of change!!!!

quiet ice
river oracle
#

If I don't see registries merged in 1.21 just gonna run off the experimental branch and code for that until it runs l ok l

#

Maybe inventories in 1.21 too who knows:3 need commodore though for it to not break things

quiet ice
#

Well I'll probably will make my own spigot artifact so I do not have to update all my switch statements

river oracle
#

The PR handles all of that :3

#

Don't you worry

#

Well for bytecode

#

You shouldn't be using switch with material anyways

#

Or most of the enums tbh thats cursed

quiet ice
#

You cannot switch on non-enums

river oracle
#

Actually nvm it's not

quiet ice
#

At least at compile-time. So naturally you know where I am getting at

river oracle
#

It's just been deprecated

#

For the others

#

They've actually been moved iirc

quiet ice
#

Yeah, but what is the point of updating if you still use deprecated APIs?

slender elbow
#

when are we getting bukkit v3.0

river oracle
#

When are we depreciating spigot and moving to cb

glad prawn
#

when craftspigot

quiet ice
#

god CB is dead, and we killed them.

river oracle
#

Well at an actual source level

#

Though there are some fairly notable exceptions such as components

opal carbon
#

what would the wierd material update break anyways

lilac dagger
#

no, a cb killed itself

river oracle
lilac dagger
#

spigot just reborn it

river oracle
#

Then anything you do with the enums pretty much that non enums can't do

opal carbon
lilac dagger
#

i thought the new material will be in different classes?

river oracle
# opal carbon what

Well there is a shit ton of byte code fixed at runtime that prevent it from breaking

river oracle
#

Pretty much the death of enums

#

I've got a PR to kill InventoryType too

opal carbon
#

why

river oracle
#

It's the worst thing ever

#

Don't get me started

opal carbon
#

arent those inventory types the only ones the vanilla client can interpret anyway

river oracle
#

real talk though its not easy to explain if you kinda don't have a semi bearing for internals

river oracle
slender elbow
#

do you have a pr to make spigot multithreaded

river oracle
opal carbon
#

thats wacky

slender elbow
#
class DedicatedServer {
  void tick() {
    // tick logic
    new Thread(this::tick).start();
  }
}
river oracle
slender elbow
#

that's my server impl

lilac dagger
#

wait, doesn't this create too many threads and die?

river oracle
#

nah

#

it'll be fine

young knoll
#

Looks good to me

river oracle
#

lgtm merged

slender elbow
#

it works on my machineℒ️

river oracle
opal carbon
#

ah okay

river oracle
#

for example InventoryType.CRAFTING which is the players inventory can't be opened, neither can the CreativeMenu those are client side only

young knoll
#

I wish we had the power of the creative inventory

#

Could do a ton with that

river oracle
slender elbow
#

well, there is a registry for the creative menu nowadays πŸ‘€

#

it isn't network synced, but maybe one day

#

one can hope

young knoll
#

There are many registires I would rather have first :p

river oracle
#

hey coll

#

test my inventory pr pweaseee

opal carbon
#

why does composter even have an inventory lol

river oracle
#

an inventory isn't what the player sees

#

its just a slot

#

like thats it

smoky oak
#

better than like 7 block states lol

river oracle
#

the composter has a slot you can put items in technically under the hood

young knoll
#

Its for hoppers mostly

opal carbon
#

that makes sense

river oracle
young knoll
#

Did you provide a test plugin

river oracle
#

no I should do th at though my test plugin is kinda ass

young knoll
#

I use the same plugin for every test :p

river oracle
#

before anyone asks

#

I'm using discord as a cdn

young knoll
#

I just slap code into a /test command or an event

river oracle
young knoll
#

That's way too much effort

river oracle
#

create, open, blockopen, legacycreate, openentity

#

5 comamnds my bad

young knoll
#

/test 1 /test 2 /test 3

#

:p

river oracle
#

I also have tab completion for arguments

#
        final Inventory inventory = Bukkit.createInventory(null, type);
        inventory.setItem(0, new ItemStack(Material.DIAMOND_AXE));
        TestPlugin.thenLater(() -> {
            player.openInventory(inventory, "UwU");
        }, 1);``` UwU
#

titles are nolonger bound to inventories

ancient plank
#

UwU

opal carbon
#

UwU

halcyon hemlock
#

Ew

river oracle
#

@eternal night lurker

eternal night
dry hazel
#

ew

river oracle
#

I thought youi were typing for a second

young knoll
#

Why does inventory.setTitle not exist anyway

river oracle
#

it actually got me 😭

halcyon hemlock
river oracle
#

that's stupid API

eternal night
#

smh

halcyon hemlock
river oracle
#

don't need NMS

halcyon hemlock
#

Inventories do have titles

river oracle
#

no not in NMS

halcyon hemlock
#

Yes

river oracle
#

only Containers do

#

or MenuTypes

#

whatever you wanna call them

halcyon hemlock
#

;

river oracle
#

really I'd love to see the IInventory impl that's not CraftInventoryCustom with the title methood

young knoll
#

Hey if I can pass a title when making it

river oracle
#

CraftInventoryCustom isn't NMS its a terrible patch job for a bad api

young knoll
#

Then I want to be able to change that tile

halcyon hemlock
halcyon hemlock
river oracle
#

you don't pass a title when making an Inventory with my change, and if you do CraftInventory handles the legacy createInventory and assigns the title

halcyon hemlock
#

So can't access it

young knoll
#

Or a suplier for title

#

That would be nice too

#

I don't like rebuilding my inventories when the lang file is reloaded

#

:c

halcyon hemlock
#

Huh

eternal night
river oracle
#

fixes all of this

#

in the InventoryView

#

not the Inventory

young knoll
#

How does the legacy stuff work

halcyon hemlock
river oracle
#

AnvilInvetory specifically is very hacky

halcyon hemlock
#

.

river oracle
#

but there is not much that can be done about that. Bad API addition bad lognterm consequences

slender elbow
#

adventure$title πŸ‘οΈ

eternal night
#

πŸ‘β€πŸ—¨

slender elbow
#

🧿

young knoll
#

Ideally I would do all my translating on the packet level

river oracle
#

Deleting CraftContainer was the happiest moment in my life (wow i have a sad life)

young knoll
#

But

  1. I don't want to use a packet api
  2. Translating a string to 1 or more components sounds kinda painful
river oracle
#

just don't allow people to reload your lang files

opal carbon
#

protocol lib is the enemy

river oracle
river oracle
opal carbon
young knoll
#

Plib has nice lisneters

#

But using it to send packets is painful

river oracle
#

pappa packetevents

young knoll
#

I bet I could make a very simple API to send packets

#

That one could shade

lilac dagger
#

use bukkit events

#

oh nevermind

#

but for listening i'd def use bukkit events

river oracle
#

really i just use NMS events much easier

#

honestly don't even use the bukkit api anymore

lilac dagger
#

you have to

river oracle
#

no I made my own pluginloader for NMS much easier than using whatever tf bukkit is

lilac dagger
#

unless you're okay with changing your code at mojang's whim

river oracle
#

(I'm joking if it isn't obvious)

lilac dagger
#

sorry, i can't see jokes today haha

young knoll
#

I mean we have api methods for a lot of packets

#

But not everything

#

The virtual entity/snapshot PR will open a lot of possibilities

river oracle
#

I gotta test that one still

young knoll
#

I need to test it more too

ancient plank
#

I didn't hab issue wif pwotocowwib and sending pwackets

young knoll
#

And fix some final stuff

#

It's just very verbose

#

I mean, I know why it's verbose, but still

river oracle
ancient plank
#

Da onwy issue I had was wif da pwotocow website an twying to figuwe out if I couwd even do wut I wanted

young knoll
#

No

#

That's something the PR covers

river oracle
eternal night
#

thing always worring about the "lets do virtual entities by just reusing the entity interfaces" is the general assumption that held till now that well, you should only really have an instance of Entity if it is alive and well

#

so plugins doing wild stuff with that "premise" are gonna get fucked

young knoll
#

There is world.createEntity iirc

#

It shoudln't break plugins too much

#

Since they likely will never recieve a virtual entity

eternal night
#

Yea I mean that is kinda the gamble πŸ˜…

young knoll
#

I'm trying to think how they would get it

eternal night
#

I mean, API ?

young knoll
#

Yes but how

#

For example, none of the world based queries will find them

eternal night
#

no like

#

plugin A passes it to B

young knoll
#

Ah

slender elbow
#

plugin D passes it to N

eternal night
#

its not gonna run into it from world querring yea

young knoll
#

That's on plugin A to use the new api carefully

#

:p

eternal night
#

well yea but that is the thing

#

it really isn't new API xD

young knoll
#

?

eternal night
#

Well like, Entity still exists

young knoll
#

Yes

eternal night
#

The somewhat implicity contract of the entity type is the one that is getting mutated

#

retconned into existence that it can also represent an entity that is not in a world

young knoll
#

So far I haven't seen any issues from mutating virtual entities

eternal night
#

Well yea most things should be fine, hopefully ?, that just needs a lot of going through methods

young knoll
#

Tho that is the main thing that still needs testing

#

ye

lilac dagger
#

i mutate some parts of my nms entities no problem

#

it depends tho on some methods that might require the entity to be bound to a world

young knoll
#

I suppose I could probably remove the virtual entity part altogether and just rely on snapshots

#

idk

young knoll
#

Entity is always bound to a world, just might not be spawned in said world

eternal night
#

idk, I mean, there is 100% a need for something along the line of a fully fledged interface for setting this

#

snapshot is useful too 100%

#

actually, wait let me see what your snapshot concept was xD

young knoll
#

It's basically a wrapper around an NBT tag

#

Which holds the entity

eternal night
#

e.g. fun side question, what happens with addPassanger ?

young knoll
#

On a virtual?

eternal night
#

yea

young knoll
#

Not too sure yet

#

I imagine a virtal passenger on a virtual works as one would expect

eternal night
#

yea but is that gonna call events

#

VehicleEnterEvent is called e.g.

young knoll
#

True

eternal night
#

which, if no, I guess that is fine maybe ?
If yes, oh god now we have virtual entitys in an event

#

now we don#t even need plugin A to pass to plugin B

young knoll
#

Yeah I may just avoid calling it

#

We shall see how it works

eternal night
young knoll
#

Although it may just be fine for old plugins to recieve virtual entities

#

If they behave the same

#

I need to remember to make that jira ticket for direct byte serialization of certain objects

eternal night
#

BukkitObjectOutputStream

young knoll
#

Doesn't that use ConfigurationSerialization

quaint mantle
young knoll
#

Aka it turns it to strings first and then byteifies that

eternal night
#

ehh, it throws the Map at the object output stream iirc

upper hazel
#

?paste

undone axleBOT
upper hazel
#

why effect not give "effect"

young knoll
eternal night
#

you'd be correct

#

Well

slender elbow
#

just gzip it and call it a day

#

gj

eternal night
#

like yea, depends completely on the format

worldly ingot
#

Emily's a network developer I can tell

slender elbow
#

yep

#

i do the network stuff

eternal night
#

if(connected) sendEmilia()

#

bam

young knoll
#

Plus direct nbt serializtion can work on stuff that isn't ConfigurationSerializable

eternal night
#

Sure, idk its introducing a new binary format to the API

#

those are always fun

#

and people tend to go over board

#

doesn't paper have a fucking PDC to blob method ?

slender elbow
#

i mean they're just different formats, e.g. with jvm serialization you can have cyclic references, A has field B has field A, if you throw something like that to a CompoundTag it'll blow up lol

eternal night
#

Yea idk, I mean you can certainly throw a bunch of random toByte helpers everywhere, that is pretty much just what paper does

#

or you can dream up a new way to serialise stuff

#

which might be nicer down the line maybe but maybe not

slender elbow
#

in short, paper's byte[] footprint in memory is horrible

#

don't use it

eternal night
#

agreed, too many byte[]

#

my profiler told me

slender elbow
#

need to use long[]

#

so it's more compact

eternal night
#

pack that shit up

slender elbow
#

8 bytes per byte

eternal night
#

free real estate

young knoll
#

Yeah basically I want what paper does

worldly ingot
slender elbow
#

lmao

eternal night
eternal night
slender elbow
quaint mantle
#

Who uses long😭

worldly ingot
#

I'm smart and I screenshot the preview window

#

No clue why they never considered that

slender elbow
#

damn

young knoll
#

Twas a fun ticket

worldly ingot
slender elbow
#

if it's so good then why didn't you pull all paper patches

eternal night
#

Checkmate

worldly ingot
#

bUt ThE pAtChEs ArE MIT

young knoll
#

I mean

eternal night
#

*mid

young knoll
#

If it wasn't for the CLA

eternal night
#

The patches are mid

smoky anchor
#

where link, let other ppl have fun as well

worldly ingot
#

And, you know, morals went out the window KEKW

thin iris
#

java or kotlin

eternal night
#

And then you wait for leaf to return because now your world border kills people

#

The price you pay for paper atches

thin iris
#

python or java

eternal night
#

Javascript

young knoll
#

now your world border kills people

#

As opposed to what

eternal night
#

No like, it glitches then back

#

Once behind the border

#

It's fucked XD

worldly ingot
#

OMEGALUL You have a teleporting world border?

#

That's so awesome

river oracle
#

I wish we had a teleporting world border :(

#

ours just

#

its just not the same

river oracle
slender elbow
#

J#

river oracle
#

πŸ€“ guys lets implement spigot API with rust

#

it'll be so much faster, and the project won't die within 1 month

hybrid spoke
#

lets make our own language huh

#

spigot made with water

river oracle
#

GUYS i'm gonna make my own minecraft server

#

in python

hybrid spoke
#

and code flow would be water flow

#

kinda nice

#

methods could be waves

#

i think im onto something

slender elbow
#

(minecraft.run is implemented in c)

river oracle
#

yep

#

precisely as one would write any python program

#

just simply implement it in C

#

everybody knows python is just as fast as C if you write it in C

#

I can see the drama now PYTHON IS NOW FASTER THEN C!

quiet ice
#

I did work on a minecraft in python impl once - never again.

river oracle
#

whoever wrote that needs to step back and realize they need to learn another language

agile edge
#

I have written a plugin that adds new blocks like solar panel, controllers, electric furnace. They currently transfer electricity between them only when they are placed close to them. I want to make wires between them. Wires are a fence block πŸ˜‚

sry for the cyrillic in pictures, no more screenshots πŸ˜„

#

now I need to think how to realize the wires
maybe someone has seen it somewhere?
I just need a starting point

quiet ice
#

Just do wireless transfer \s

young knoll
#

Some kind of energy network system

#

Can probably refrence one from a mod

river oracle
#

I think that'd look neat

#

you can probably gett away with hooking them to display entities maybe?

#

that way they aren't as bulky

#

or you could use display entities themselves

agile edge
#

hmm

tranquil dome
#

Is there something like vault for vanish plugins? Or do I need to look for all existing vanish plugins and try to hook into those?

river oracle
#

there really aren't many standards as constant as vault

tranquil dome
#

So I guess the latter then?

tall dragon
#

well most vanish plugins actually set metadata

#

Essentials,Cmi for a fact

agile edge
#

I will try to implement it this way

tall dragon
# tranquil dome Is there something like vault for vanish plugins? Or do I need to look for all e...
    /**
     * Return true if the player is vanished. We check for "vanished"
     * metadata value which is supported by most plugins (CMI, Essentials, etc.)
     *
     * Does NOT return true for vanish potions or spectator mode.
     *
     * @param player
     * @return
     */
    public static boolean isVanished(final Player player) {
        final List<MetadataValue> list = player.getMetadata("vanished");

        for (final MetadataValue meta : list)
            if (meta.asBoolean())
                return true;

        return false;
    }

for example

#

you can also consider just checking Player#canSee

worldly ingot
#

PES_SadGePray Metadata

tall dragon
river oracle
#

I can't go to class today cuz my car broke down :( time to just fuck around with NMS and bukkit all day

tall dragon
#

oh no wut happen to car

river oracle
#

battery died

#

can't replace it till tonight either

tall dragon
#

well at least its a relatively easy fix

#

could be worse eh

river oracle
#

true, considering that battery is old as fuck

#

I don't think its been replaced for many years

#

I honestly can't remember the last it was replaced

warm crater
#

Hi guys I want to write a plugin with custom damge, how can I get started?

rotund ravine
#

What type of damage

warm crater
#

Something like on hypixel

#

A custom damage modifier

rotund ravine
#

Idk what you are talking about

#

Like an enchant on items or what

warm crater
#

items

rotund ravine
#

??

#

Please speak in full sentences with a proper overview of what you are looking to create

#

Instead of whatever that is

glad prawn
#

based on the damage displayed on the item ig

rotund ravine
#

Is that custom?

shadow night
#

What

glad prawn
tranquil dome
rotund ravine
#

Well good luck my guy

worldly ingot
#

That is pretty hot

#

Are you spawning an invisible lead entity and an invisible armour stand or something?

river oracle
#

can you attach leads to display entities

#

that would be neat

worldly ingot
#

Not sure. Never tested it

#

I believe you can ride them though. I know you can ride interaction entities. I specifically tested that

river oracle
#

Armor stands tick too much :P

#

you can ride them

#

fs

#

``

#
        Entity entity = this.getVehicle();

        if (entity != null && entity.isRemoved()) {
            this.stopRiding();
        }```
#

they tick

#

so

#

wonder why this can't be done lazily

#

like I wonder if the entity can be removed on the server if the remove method is not called, otherwise you could probably just override remove and do this

thin iris
#

how do i git ignore a file again

river oracle
#

go into your gitignore and type in its path

#

you can also ignore by extension

#

for example

# intellij
*.iml
*.ipr
*.iws
.idea/

/src/main/resources/achievement
/src/main/resources/lang
thin iris
#

my file structure is /src/<a package>

#

i dont have main

remote swallow
#

if ur using maven/gradle why dont you have a main

thin iris
#

bc im weird

river oracle
#

you need a main for gradle/maven

#

unless you specify

thin iris
#

errr

river oracle
#

otherwise

thin iris
river oracle
#

which would just be weird asf

worldly ingot
#

Definitely recommended :p Lets you separate out your source sets, like for tests

remote swallow
#

do you not use maven/gradle

#

hi choco

thin iris
#

i use maven

remote swallow
#

you should have a main then

thin iris
#

ok

#

but i dont rn

#

can i do it without a main

remote swallow
#

ye

river oracle
#

@worldly ingot I'm still a bit confused on this does this mean this stuff doesn't happen on the server?
if (this.level().isClientSide) {

worldly ingot
#

Correct

#

Shared codebase, only triggers on the client

river oracle
#

okay I see

#

I wonder how you would go about not ticking an entity

#

I'm just trying to fuck around right now no important meaning to this lol

thin iris
#

src/org/transl/translationsx/utils/Config

#

this?

remote swallow
#

you use slashes there

#

its dots inside java slashes elsewhere

thin iris
#

oh

#

like that?

remote swallow
#

ye

worldly ingot
#

dots in packages are just a directory separator

remote swallow
#

choco did you know coll is jira staff

worldly ingot
#

Yeah a few of us are

river oracle
#

ofc choco would know :P

worldly ingot
#

I am as well

remote swallow
worldly ingot
#

When I requested that he get it KEKW

remote swallow
#

fuck

river oracle
#

choco do you know if entities have to tick?

remote swallow
#

do you also know what the slime offered him

worldly ingot
river oracle
#

interstingly enough TileEntities don't but it seems like mob entities can

remote swallow
worldly ingot
#

Why what did he break?

remote swallow
#

nothing

#

the slime just offered coll something

lost matrix
remote swallow
#

im surprised you dont know choco

lost matrix
remote swallow
#

guess

river oracle
#

I think atleast

ivory sleet
lost matrix
river oracle
#

trying to figure things out about the server

remote swallow
river oracle
#

Anyways more importantly I'm going to get side tracked on something I've wanted to do for a while now

#

anyone know of any good resources online to learn C with

ivory sleet
ivory sleet
river oracle
#

no

#

like really :3

#

how can one appreciate rust without knowing the problems which it solves in depth

ivory sleet
#

the other one (how I sorta learnt the basic C i know of) is to do a simple project in C, like XOR cipher for instance

#

just to sorta get to know the semantics

river oracle
ivory sleet
#

myea

#

do some small projects you know how to write in other languages

#

that usually helps :)

river oracle
#

I think I'll do code academy for like basic stuffz to start if I get bored I'll start some projects

thin iris
#

wats jira

river oracle
#

bug report

#

eww I have to use an account for code academy nvm

#

Just will start coding and figure it out later

ivory sleet
#

y2k def start with a project immediately

#

u wanna try to practically apply w/e u learn somewhere

#

wouldnt go all in just theory

river oracle
#

is C extension .c or .h

#

I've seen .h somewhere forgot what is was

fringe yew
#

how would i stop the player from having multiple of the same item in their inventory

ivory sleet
#

its .c

#

.h is for header

#

technically used in c/cpp also

river oracle
#

whats a header

#

ig I can just look it up

ivory sleet
#

yeah, im not a c master so idk how to explain it nicely, i know @ Emily is pro cpp so hit her up if u dont understand sth I suppose :P

river oracle
#

@slender elbow hehe I'm not going to ping you a lot, but by pinging you this one time I'm going to leave you uneasy to whether or not I might just be extremely annoying

storm crystal
#

How do i get rid of nullpointerexception

eternal night
#

assert obj != null

#

NODDERS /s

lost matrix
#

./s

storm crystal
#

So how to do it the "proper" way

dry hazel
#

don't dereference nulls lol

lost matrix
#

Check your objects if they are null

river oracle
#

though I always make sure my code is within an if statement that gives it a 50% chance to work. This reduces the nullpointer errors I encounter by >=50%

storm crystal
#

And what if its null or air

wet breach
river oracle
lost matrix
lost matrix
halcyon hemlock
#

Why not use optional instead of returning null?

#

Rust better

echo basalt
#

scam

#

@worldly ingot you here?

worldly ingot
#

Nope

echo basalt
#

:/

worldly ingot
#

?ban @atomic totem Spam/Scam bot

undone axleBOT
#

Done. That felt good.

worldly ingot
#

ty

alpine urchin
#

Spam em then scam em

storm crystal
#

it can be null cuz nullpointerexception but apparently is never null?

lost matrix
storm crystal
#

so what now

lost matrix
#

No need to check the display name for null

warm mica
#

But you'd do it with == null, as he said

frozen shadow
#

Jeez people come on

storm crystal
#

do I just check if item.getItemMeta()) is null?

#

I mean if its air then it would be null?

lost matrix
#

Yeah you would have to check if the ItemMeta == null after getting it.
But dont call getItemMeta() multiple times. You always get a new copy of it

storm crystal
#

like this?

lost matrix
# storm crystal

Not quite. The type and name declarations can be shifted down, after your condition.
And dont call getItemMeta() multiple times.
You can also simply check if an item is air by calling .isAir() on the type.

storm crystal
#

idk

agile edge
#

wow

#

looks good

lost matrix
#
ItemMeta meta = item.getItemMeta();
storm crystal
hazy parrot
frozen shadow
#

You're welcome

lost matrix
storm crystal
#

and what about name thhen

#

it doesnt give out name

lost matrix
storm crystal
#

okay I get item meta and check for meta being null

#

but what about name then

#

if I cant declare it again

lost matrix
#

You declare your name variable after your if condition

pseudo hazel
#

doesnt really change much, but I guess its better for memory if you dont always create the string if you dont need it

storm crystal
#

that good?

lost matrix
#

Better. You could replace the material check with item.getType() == Material.NETHER_STAR

storm crystal
#

Whats the difference?

glad prawn
#

better lol

pseudo hazel
#

you're sure to get the right material

lost matrix
#

Checking against Material is compile time safe

pseudo hazel
#

less prone to typos

echo basalt
#

also legacy support

#

craftlegacy whatev

#

also isn't it better to just use pdc in this case?

pseudo hazel
#

doesnt the displayname also work for renamed items in anvil?

echo basalt
#

yeh

pseudo hazel
#

yeah then thats probably not what you want

storm crystal
#

Its a fucking test plugin to learn stuff for god sake 😭

#

I know im gen z but i cant multitask that well

#

One thing at time

pseudo hazel
#

I mean its better to start with good habits

#

rather than trying to adapt later

storm crystal
#

so how to use pdc

glad prawn
#

?pdc

storm crystal
#

how many pdc can I have in item

pseudo hazel
#

a lot

young knoll
#

How many keys? basically infinite

pseudo hazel
#

until your server is full

young knoll
#

There is a size limit for NBT tags

#

You'll hit it eventually

storm crystal
#

I dont get this pdc tag stuff

#

what do I type in pluginInstance

pseudo hazel
#

your plugin instance

#

of the class that extends JavaPlugin

storm crystal
#

do I just make instance of plugin within plugin class or what

#

where do I put this pdc stuff then

peak depot
#

Hey I try to make it so if I right click I glide with the chicken as a like parachute but when I try to give the chicken velocity again it throws this error: https://paste.md-5.net/malapuhawo.cs

grim hound
#

why the hell

#

are you using the BukkitRunnable

#

the most cursed and broken class of them all

peak depot
#

Runnable also dont work :/

grim hound
#

it will

grim hound
peak depot
#

?

grim hound
#

there is no run() method since it'll be an interface

#

Just () ->

storm crystal
#

how do I make commands?

hazy parrot
azure hawk
undone axleBOT
hazy parrot
grim hound
#

hol' on

#

let him first learn the basics

storm crystal
#

can I return two different value types in one method?

#

like int and string?

grim hound
eternal oxide
#

yes

grim hound
#

you need to wrap them into something

hazy parrot
#

Union πŸŽ‡

storm crystal
#

is this how to use pdc

hazy parrot
#

That is wrong way to get plugin instance

#

You would get exception there

storm crystal
#

it doesnt get any errors in ide

hazy parrot
grim hound
storm crystal
#

idk it ran properly

hazy parrot
#

You still didn't run it

#

You just compiled it

grim hound
#

you need

storm crystal
#

same, no errors

grim hound
#

to run it on a server

grim hound
#

THE PART

hazy parrot
#

xD

grim hound
#

my god

storm crystal
#

oh yeah i didnt make command to give netherstar with this pdc

#

wait

hazy parrot
#

That code will 100% throw error

#

You have to pass down your main class instance, not create new one

storm crystal
#

its my first time doing pdc tags

hazy parrot
#

?di

undone axleBOT
hazy parrot
storm crystal
#

okay im a little lost with those tags

grim hound
#

or you can create a static one and add instance = this; in onLoad

hazy parrot
#

Or getPlugin(Class) πŸ˜›

grim hound
#

you mean

#

getProvidingPlugin?

shadow night
#

Isn't there like JavaPlugin#getPlugin(...) or something

grim hound
#

wait, what's the difference between the two?

#

getPlugin requires the plugin to be a JavaPlugin

#

and the other one doesn't

#

wait no

#

wat

shadow night
#

Wasn't the JavaPlugin one static or am I high

grim hound
#

aaaa

#

I see it now

grim hound
#

and the inverse for the latter

storm crystal
#

whats wrong with this?

frank kettle
#

"Class must implement the method onCommand..."

lost matrix
storm crystal
#

how about this one

reef acorn
#

Is there a way to save packages (such as PacketPlayIn... etc.) in a config and get them again?

grim hound
#

Main class

#

not in the command clazz

lost matrix
shadow night
#

Or if you have a plugin object, plugin.getCommand

shadow night
frank kettle
lost matrix
#

But why?

grim hound
#

it's better to have a seperate

#

file

frank kettle
#

it looks like that

reef acorn
storm crystal
#

well yes I am using a tutorial but doing what it says step by step

shadow night
grim hound
#

yes you can

#

but save it like that:

shadow night
#

And you don't save dat shit to config lol

grim hound
#

packet class name:parameters etc.

#

cuz packet names can change on different versions

#

so byte serialization won't probably get you far

#

also their constructors also change

storm crystal
#

I dont get what might be wrong, I set command in plugin.yml, I registered it in onEnable in main class, I wrote actual command in another class

storm crystal
#

it says just that

#

but other than that no errors

shadow night
#

Those are warnings

grim hound
#

now plugin.yml

shadow night
river oracle
#

Intellij moment

#

I disabled those warnings ⚠️

grim hound
storm crystal
shadow night
reef acorn
frank kettle
shadow night
storm crystal
#

okay but my plugin doesnt load either way

river oracle
# storm crystal

Having your permission as a * might definitely fuck up luck perms

hazy parrot
river oracle
#

And other permission plugins

grim hound
# grim hound same

but now when I write ```java
if(array.length == 2) {
String s3 = a[2];
}

shadow night
storm crystal
#

I also get this

hazy parrot
shadow night
grim hound
storm crystal
#

okay apparently setting permissions to * fucks up entire plugin

grim hound
# grim hound no

maybe you're using constant without creating a string each time, however saying that would also be wrong

#

so there's no real advantage

#

Yo I love coding in

subtle folio
#

holymoly

storm crystal
#

any solution?

eternal night
#

you cannot create an instacne of your main class

#

the server creates that instance

lost matrix
storm crystal
#

if I delete it then it doesnt work either

tender shard
hazy parrot
storm crystal
#

I was busy doing something else, but I still dont get how to do it in my case

#

im not doing playerstats plugin

#

yeah it just doesnt work

lost matrix
tender shard
undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

storm crystal
#

it says this

#

but on tutorial nobody put anything in here

tender shard
#

yeah obviously this "does not work"

#

?learnjava

undone axleBOT
lost matrix
hazy parrot
#

I would kindly advise to look at fundamentals first, would make your job much easier

lost matrix
#

He doesnt want to learn

tender shard
#

kk thx then I can stop wasting time, gΓΌnther jauch starts in 20 minutes anyway

pseudo hazel
#

who is gunter

tender shard
# pseudo hazel who is gunter

gΓΌnther jauch is a german journalist and tv moderator, gunter is the dude who works in the museum in stardew valley

pseudo hazel
#

right

storm crystal
#

yeah ill just skip the pdc part for now

pseudo hazel
#

so they are the same person right?

lost matrix
storm crystal
#

idk man people literally days ago told me its fine to learn java while making plugins but apparently it's not, would appreciate if some of you made your mind

tender shard
#

the error message also tells you that it expects one argument but you passed 0

storm crystal
tender shard
#

You often need a reference to your main instance (the instance of your class that extends JavaPlugin) in some of your other classes. There’s two basic concepts for this. Choose whichever you like more. Method #1: Static Getter First way is to create a static method called getInstance() or similar in your main class. You...

frozen shadow
storm crystal
tender shard
ivory sleet
#

DuskTaler drop the attitude, they tried to help you, if you gonna be like that then dont ask for help in the first place

tender shard
#

it's like if you declare a "Person" constructor that takes in a name as string and you just do new Person()

frozen shadow
#

dont you use python or something @storm crystal

storm crystal
#

maybe it was just bad luck?

storm crystal
tender shard
#

as already mentioned, if you declare your constructor, in this case "OtherClass" to take in a parameter "MyPluginMainClass" then you cannot just do "new OtherClass()" without passing in a MyPluginMainClass

frozen shadow
#

The command wants an argument, not familiar with spigots syntax right this second, but if you made "Command" you made it to take in an argument, you have to pass something to it

#

Woohoo

storm crystal
#

idk I just dropped making command and pdc for now I guess thats too much

#

at least I fixed nullpointerexception problem thats some progress

river oracle
#

Works for me, doesn't mean it has to work for you. I possess enough braincells to see nullability regardless of the annoying warning

frozen shadow
#

Responding with a java tutorial to everything doesn't help someone with spigots syntax 😭

frozen shadow
#

I'm dying at that bruh

ivory sleet
#

yes

lost matrix
pseudo hazel
#

idk if this is the right chat, but should I update my plugin to api version 1.19.4 and leave out 1.18? before this I have included 1.18 but I am interested in using the new features.. I am basically asking for an opinion

ivory sleet
#

regex is the lazy yet easy way out lol

storm crystal
#

is there any way to fix this problem? entity isnt being thrown upwards and I suspect that's because of damage

ivory sleet
#

if u use git or sth just create a new branch for newer stuff

river oracle
#

anyone know what this warning means in C
Make the type of this parameter a pointer-to-const. The current type of "array" is "int *".sonarlint(c:S995)

int binary_search(int *array, int size, int key)
ivory sleet
#

so in case a bug appears u can fix it for the 1.18 users

pseudo hazel
#

right

ivory sleet
river oracle
#

Proved his point by sending java syntax

frozen shadow
ivory sleet
#

java syntax != spigot syntax which is non existent

lost matrix
frozen shadow
#

"How a program is written in java"

river oracle
#

spigot has no syntax

pseudo hazel
#

is it not better to do new stuff on main branch and keep a separate branch for older support?

ivory sleet
#

yeah it doesnt

#

idk what u on about

storm crystal
#

I mean

twin venture
#

hi i have a question :p

storm crystal
#

both messages before and after it work

lost matrix
#

Alright. For kittech and ofluffydev spigot is a programming language with its own syntax.
For the rest of us its a framework/api written in java.

#

Lets settle there

ivory sleet
#

and what are you on about again? didnt read message history as per usual?

twin venture
#

if i for example have this boolean , and i set it to true in :
here , so next time the method run , it will be false?

ivory sleet
#

then why would you just drop random comments that make no sense whatsoever

storm crystal
#

hey thats usually what im saying xd

twin venture
#

yes

#

itsa boolean = false;

#

so i need to store it as false when its finished :p?

#

alr

ivory sleet
#

kittech im gonna take those comments in the future as trolls, this is really a warning...

#

you know exactly what I mean, else start to read message histories

devout tartan
ivory sleet
#

?ban @quaint mantle trolling

undone axleBOT
#

Done. That felt good.

river oracle
#

oh my

devout tartan
river oracle
#

what is the main difference

devout tartan
#

const int *

river oracle
#

between const int *array and int *array

devout tartan
#

const

#

const int * is a pointer to const int value

#

(int or an array of ints, simplifying)

river oracle
#

ahhhk

devout tartan
#

if you have a const int, you can't have a non const pointer to it

#

const in C++ is fun (no 😭 )

river oracle
#

I'm just learning raw c

#

least I think

devout tartan
#

Send me your C/C++ questions if you have them (I LOVE C/C++ questions)

river oracle
#

will do

low marlin
#

does anybody know what's the listener of lightning spawning with channeling enchantment or how to disable the lightning spawned only spawned with the channeling enchantment?

devout tartan
austere cove
#

const is an illusion

devout tartan
#

just don't tell him about const cast

river oracle
#

why does this work even to obtain size of an array

sizeof(array) / sizeof(array[0])

what does sizeof measure

lost matrix
river oracle
#

I'm pointing a const pointer to a non constant variable

storm crystal
lilac dagger
devout tartan
#

so many questions

river oracle
#

though

eternal night
devout tartan
eternal night
#

you put on your wizard hat and guess, welp, this would have 3 ints

lilac dagger
river oracle
lilac dagger
#

and assumes

river oracle
#

I was confused what sizeoff measured at first

#

it measures the size of bytes

#

so ofc the devision would work

low marlin
#

Thank you

lost matrix
low marlin
#

Yeah I only needed the listener

#

Thanks

river oracle
#

what should my first C project be

#

now that i know how a pointer works

eternal night
#

do pointer to a pointer

#

infinite pointer

river oracle
#

cursed

lost matrix
#

Mandelbrot set

river oracle
#

wtf is a Mandelbrot set

eternal night
#

πŸ‘€

pseudo hazel
#

do a pointer pointing to a pointer that points to teh first one

lost matrix
inner mulch
#

can someone explain what a connection pool is and if or why i should use it?

devout tartan
#

i think modifying ptr is now UB if you cast const away like that

storm crystal
#

does set cancelled true make any code below that not execute?

#

or just cancel original event?

devout tartan
lost matrix
river oracle
#

int main(void)
{
    int src = 5;
    const int * ptr = &src;
    const int ** ptrr = &ptr;
    const int *** ptrrr = &ptrr;
    printf("ptrrr, %d", ***ptrrr);
}``` I was worried I wouldn't know the value of ptrrr
eternal night
devout tartan
eternal night
#

now you a) don't have to create connections all the time and b) can have an individual connection per thread/future/whatever

river oracle
#

hmmm I kinda wanna make a minecraft server

#

sounds like a beginner friendly project

devout tartan
#

in C++?

river oracle
#

no

#

in C

devout tartan
#

Sorry, in C

#

Hm

inner mulch
eternal night
#

you don#t implement it

devout tartan
#

Sounds quite interesting actually

eternal night
#

you use hikaricp

lost matrix
eternal night
#

implementing your own connection pool is pretty not smart kekwhyper

devout tartan
#

is the minecraft protocol very well documented? i.e, what the client sends/expected, and in what order?

pseudo hazel
#

documentation in my minecraft?

inner mulch
river oracle
#

the entire protcol is doccumented

eternal night
ivory sleet
devout tartan
lost matrix
eternal night
#

baeldung πŸ₯°

frozen shadow
#

method structure is a part of syntax. Syntax is the set of rules that govern how a language is used to construct sentences and programs. Method structure refers to the rules that govern how methods are defined and used in a programming language.

#

anyway

austere cove
#

baeldung doesn't really explain anything

#

hate that

river oracle
#

I know I'll probably need some form of socket

#

lol

devout tartan
#

yep

frozen shadow
#

Maybe start actually helping instead of saying "learn java" that'd be nice, this is the only server on discord I've ever seen have this problem to this level 😭

dire marsh
#

what's the easiest way to send custom biomes to players (for fog/sky colours) these days?

lost matrix
devout tartan
#

I don't know if you care much about books, but Unix Network Porgramming is an incredible reference for network programming in C

ivory sleet
river oracle
#

Ig I'll lookk into it

river oracle
#

I need to make graphics

#

😭

austere cove
#

in my experience, it's nice to get started with some simple stuff using snippets from baeldung, but the moment it becomes slightly more complex it's all ogre

#

just random code without explanation as to why you need to do what they do

eternal night
#

I mean, code to get started is like

lost matrix
eternal night
#

the whole reason I like to link them kekwhyper you really don't need to know more about like, hikaricp than, This is how you create it, this is how to use it. Done

austere cove
#

this shit

#

I copied this (partially) from baeldung

#

doesn't explain shit

river oracle
austere cove
#

also this calls deprecated methods and the docs don't tell me what else im supposed to do

lost matrix
ivory sleet
#

Yeah some of them are slightly outdated since the pokemons writing the articles probably don’t really go back and up date them but rather just produce new articles all the time

#

I by sincerely mistake signed up to get mails from them

#

And oh god what they deliver articles

lost matrix
river oracle
#

oh lord I've never written a png before

#

I think I should start with some basic IO first then

storm crystal
#

how should I structurize my plugins?
should I put several classes in one .java file?
should I put methods in separate class and use them in listeners and event handlers in main class or can I dump them into that class as well?

devout tartan
ivory sleet
devout tartan
lost matrix
eternal night
#

don't say rust in discord, the rust foundation will come for you

lost matrix
#

lul

ivory sleet
#

lol

storm crystal