#help-development

1 messages · Page 811 of 1

weak meteor
#

THERES NO JAVA_HOME AND NOTHING IN PATH

river oracle
#

C/C++ isn't hard its just different

weak meteor
#

WHAT ELSE DO I DO

crude drift
river oracle
#

oh

#

yeah nvm then lol

weak meteor
#

how tf

#

i uninstall

#

the shitty jdk 18

#

ill chatgpt that

crude drift
#

just download eclipse temurin 8

#

and use the java executable in there

weak meteor
#

he's a beauty isnt he?

young shell
#

Shooting myself in the foot isn't an issue I had myself, yeah since it's programmable it allows you to do a lot more, but for me maven is just incredibly verbose, hard to read and generally slower. One question that comes up to me is why you don't see a benefit in using the groovy dsl at all

weak meteor
#

finally im free

#

i love deprecated software

#

even legacy

crude drift
weak meteor
#

everything legacy is beautiful

river oracle
weak meteor
#

!

#

i have it public on

#

spigot

#

ig

#

idk

crude drift
#

ok

river oracle
weak meteor
#

how would you like

#

xml

#

that shit isnt readable

crude drift
crude drift
weak meteor
#

html also shit

young shell
weak meteor
#

also css

#

js itss

#

its oop its disgusting

#

but i like js

young shell
#

I'm starting to like toml

crude drift
#

javascript is if java didnt require classes and was dynamically typed

river oracle
weak meteor
#

js

#

and its

#

prototypical oop

#

can

#

suck 3 balls

young knoll
#

JOMLConfiguration when

weak meteor
#

omg just use .txt as config files

#

!

#

ok, now that i used BuildTools for 1.8.8

#

how gradle can import that

worthy yarrow
#

Can anyone explain the differences in syntax between pdc and metadata please?

weak meteor
young shell
river oracle
#

metadata is temporary and leaky

#

aka metadata kinda suks and PDC is pretty great!

worthy yarrow
#

So for example I would set my namespaced key to whatever and plug in the values?

crude drift
#

im actually about to punch a hole in my wall

worthy yarrow
#

I was reading that, just having a hard time understanding the syntax

weak meteor
#

never understood pdc

#

never going to understand

crude drift
river oracle
#

I also still have a few PRs in my backlog I haven't been able to start yet

crude drift
#

FINALLY

river oracle
#

so for the time being we cope with maven :P

chrome beacon
#

Gradle always breaks when I use it

crude drift
river oracle
river oracle
chrome beacon
#

Usually ends with me spending hours trying to fix it

young shell
young shell
#

Like 250 lines of buildscript for that shit alone

river oracle
young shell
#

Also valid

remote swallow
#

@river oracle just get good bozo

river oracle
#

Gradle has been something I've had my eye on for a while though

#

mostly because of kotlin scripting

remote swallow
#

i will fight you if you kotlin for spigot

weak meteor
#

@young knoll can i bother u?

remote swallow
#

always bother coll

river oracle
#

what you need ciro

#

I know a few things

remote swallow
#

do you though

weak meteor
#

CraftEnchantmentBookMeta

#

doesnt exist

river oracle
#

NVM omg CHICKEN NOODLE SOOP!

weak meteor
#

but i still get the error

#

on console

river oracle
#

bye everyone

weak meteor
#

bye

#

!!

#

WHY MAKING ADAPTERS IS SO DIFFICULT

young shell
#

Because that's not api thats supposed to be interacted with

remote swallow
weak meteor
#

what

#

?

remote swallow
#

craftEnchantBookMeta is craftbukkit

weak meteor
#

yeah

#

but

#

its in

remote swallow
#

so in org.bukkit.craftbukkit not org.bukkit

weak meteor
#

error says its: org.bukkit.craftbukkit etc

#

but lemme cry

#

doesnt exist

river oracle
remote swallow
#

shut up miles

weak meteor
#

yea it is that way

#

error says its

#

org.bukkit.craftbukkit.v1_8_r3.inventory.meta.CraftEnchantmentBookMeta

#

but when i see on code

remote swallow
#

do you have just spigot api

#

if you only have spigot api craftbukkit wont be there

weak meteor
#

IT DOES EXIST

#

just imported

#

craft bukkit

#

with gradle

#

here it is

#

but i can't import it

#

its like this

remote swallow
#

is it package private

weak meteor
remote swallow
#

just image i spelled that right

torn shuttle
#

I'm getting trolled by resource packs

young knoll
#

It might be package private tbh

weak meteor
remote swallow
#

you need to ad mavenLocal too

weak meteor
#

i swear to god if its that

torn shuttle
#

somehow this model and this model alone has extremities that go over the rsp size limit

weak meteor
#

im gonna cry

remote swallow
#

it probably is

weak meteor
#

no it isnt

remote swallow
#

?paste ur build.gradl

undone axleBOT
weak meteor
torn shuttle
#

aha

#

the issue only happens when these have a size

weak meteor
#

i hate craftbukkit

torn shuttle
#

hm

remote swallow
#

holy fuckin shit

weak meteor
#

why does it exist?

remote swallow
#

why are you shading spigot api

#

remove the -api from the spigot

weak meteor
#

cause yes

remote swallow
#

and make it compileOnly

weak meteor
#

i always used api

#

done

crude drift
#

dont shade the spigot api holy fuck

remote swallow
#

dont shade spigot either

crude drift
#

thats what you DONT want to shade

weak meteor
#

compileOnly made it

remote swallow
#

then reload gradle and check

weak meteor
#

k

#

same

remote swallow
#

craft meta enchanted book is package private

weak meteor
#

how do i check that

remote swallow
#

thats why you cant import it

weak meteor
#

and what can i do

#

make a class by myself

remote swallow
#

you would need to use reflection

weak meteor
#

hell nah

#

ok

#

how to use reflection

#

never used it in my life

remote swallow
#

its super fun

weak meteor
#

i understand the concept

#

but idk how to like

#

code it

#

same as LinkedList 😻

#

dont know how to code it

#

!

remote swallow
#

try and write a serializer for enchanted book meta first

weak meteor
#

there's the problem

#

look

#

i got this from copilot chat

remote swallow
#

you cant use craft for it

#

use the bukkit class

weak meteor
#

But the error says its Craft

#

doesnt matter?

remote swallow
#

yeah

#

thats the impl class

#

the bukkit class serialize should work

weak meteor
#

org.bukkit.inventory.meta

#

doesnt exist

#

Enchantmentbookmeta

#

maybe

#

Storage?

remote swallow
#

thats probably it

young knoll
#

It is

weak meteor
#

okay

#

sure

#

now what

#

got the 2 methods

remote swallow
#

write the adapter for the data from the meta

weak meteor
#

never wrote one

#

to be honest

#

oh isnt difficult

young shell
#

Average minecraft dev read documentation / Google their problem impossible edition

river oracle
weak meteor
young shell
#

Also miles, I got my company to pay me to learn rust, even though we only use Java lmao. "Professional Education"

river oracle
#

All that money for what

weak meteor
#

maybe it works?

river oracle
young shell
#

Hopefully

river oracle
river oracle
river oracle
#

I've always assumed that was cl/ci

weak meteor
#

i thought you were on school

river oracle
#

And build tooling

weak meteor
#

not on university

#

just like me

young shell
#

CI/CD, docker, Kubernetes etc

river oracle
weak meteor
#

cs?

river oracle
#

Yes

young shell
#

Automating the shit out of stuff

weak meteor
#

damn

#

how you going?

river oracle
river oracle
young shell
#

I mean we're soon migrating to git from subversion

weak meteor
#

apparently, my adapter didnt work

young shell
#

Can't wait to torch that server

river oracle
weak meteor
#

legacy goes brrr

river oracle
#

I just dual credit for every class

remote swallow
#

ha

young shell
remote swallow
#

senior

#

OLD

weak meteor
#

well

#

im just starting to study cs

young shell
#

When the project was started, git didn't even exist yet

weak meteor
#

like on school

#

and it is pretty fun

#

IT WORKED

river oracle
weak meteor
#

like

#

that supposed to happen?

river oracle
weak meteor
river oracle
#

I'm focusing on specifically doing systems programming

weak meteor
#

idk whats the level on my country

#

im already studying oop and data structures

#

it doesnt have enchantments

river oracle
#

@young shell seems like the slime commented time to sit back and see if any of the paper folks say anything xD

young shell
river oracle
river oracle
#

the path ahead of me is a challenging one with many professors who do not speak english that can be comprehended, but I am willing to accept such a challenge

weak meteor
young shell
#

Low level code is fascinating but I prefer my languages garbage collected

young shell
river oracle
young shell
#

C isn't really low level though 🙃

river oracle
#

from the perspective of java it definitely is

weak meteor
young shell
#

And in embedded systems your oftentimes so memory constrained that you'll need to use assembly

weak meteor
#

asm?

river oracle
#

in the grand scheme of things it really isn't

young shell
#

Yeah

river oracle
#

low level is relative really

#

in the grand scheme of things C is in a weird inbetween area

young shell
#

Yeah

river oracle
#

I already know assembly, but it'd be stupid to make anything with

young shell
#

It's like not low level enough to have major efficiency gains but low level enough to shoot yourself in the foot

river oracle
#

though I wouldn't mind assembly if they had lots of well made macros

young shell
#

Whatever you do, stay away from arm asm

#

It's

#

Something

river oracle
#

even compared to x86? which was painful

#

I can't imagine developing a full extensive project in pure assembly

hazy parrot
#

im sure very small ‰ of devs can imagine that KEKW

river oracle
#

it sounds fun though

#

but it'd be more practical to learn C than continue with asm

#

can plugins create advancements?

#

I don't think so right?

young knoll
#

Not easily

#

But they can

weak meteor
#

idk what else to do

#

fuck adapters

#

im going to cry

hazy parrot
#

what's hard about adapters

weak meteor
#

i tried to write my own

river oracle
weak meteor
#

but well, meta is empty

#

it shouldnt

#

i give a sharpness enchanted book

#

i get a enchanted book normal

#

without enchantments

young knoll
#

It’s not NMS

#

There is a method in UnsafeValues to load an advancement from a json string

river oracle
#

is it just not stable enough for API?

#

or do plugins not get loaded at the right time for it to be API

hazy parrot
weak meteor
#

.registerTypeHierarchyAdapter()

young knoll
#

You shove in a giant json string for Pete’s sake

remote swallow
#

why pete

#

who is pete

weak meteor
#

same question

young knoll
#

Is that not the expression

#

Idk

remote swallow
#

sure its an expression

#

but its not good enough for spigot

weak meteor
#

@hazy parrot maybe i got a solution

#

cause, yeah im returning meta

#

but its never applied in ItemStack

river oracle
weak meteor
#

smth like that i think it is

river oracle
#

Bukkit#addAdvancement????

#

granted reading it from a json file is still kinda cool API i like that even though it seems kinda lazy

young knoll
#

I mean it’s not even reading

#

You gotta read it yourself

weak meteor
#

who u talking to

#

y2k or me

river oracle
versed sapphire
#

hi, i wanted to make a fork of Spigot so I could fix something and add a pull request, but when I tried to log into my account it said I don't have permission to access BitBucket. would it be better for me to just submit a bug report? (it's almost more of a feature request than a bug report so I was hesitant, and it was a super-easy change so I wanted to just try and do it myself)

undone axleBOT
versed sapphire
#

awesome thank you so much

slender elbow
#

cla cla real smooth

young knoll
#

However yes you are welcome to submit a feature request as well

wraith dragon
#

@echo basalt !!!! sorry for the ping, in your minigame structure guide specifically in the PhaseChain class, how would the event registering and unregistering work? LIke putting all the events in a private list and unregister them using HandlerList?

echo basalt
#

something like this

#

Have an EventBus per game

wraith dragon
echo basalt
#

Maintain single responsibility across your classes, separat eit

wraith dragon
#

Alright

#
public abstract class AbstractGamePhase implements GamePhase {

    private final AppleCore plugin;
    private final EventBus eventBus;

    public AbstractGamePhase(AppleCore plugin, EventBus eventBus) {
        this.plugin = plugin;
        this.eventBus = eventBus;
    }


    public <EventType extends Event> void registerEvents(Class<EventType> eventClass, Consumer<EventType> handler) {
        eventBus.subscribe(eventClass, handler);
    }

    public void scheduleSyncTask(Consumer<BukkitTask> task, int delay) {
        //TODO implementation
    }

    public void scheduleAsyncTask(Consumer<BukkitTask> task, int delay) {
        //TODO implementation
    }

    public void scheduleRepeatingTask(Consumer<BukkitTask> task, int offset, int delay) {
        //TODO implementation
    }

    public void onStart(Runnable task) {
        //TODO implementation
    }

    public void onCancel(Runnable task) {
        //TODO implementation
        // This might be called by external factors, make sure to not just set a new task, but to "add" to the old one
    }

    public void onEnd(Runnable task) {
        //TODO implementation
    }

    public void dispose() {
        //TODO implementation
        // This is where you cancel all the tasks and unregister your listeners
        eventBus.dispose();
    }

    @Override
    public void end() {
        // Call the end task
        dispose();
    }

    @Override
    public void cancel() {
        // Call the cancel task
        dispose();
    }
}
#

alr so just ignore the other stuff

#

I implemented the EventBus

#

and listener and stuff

echo basalt
#

Make the gamephase depend on an EventBus, not impl one itself

wraith dragon
#

oh so like put it in the constructor?

echo basalt
#

init there or something

wraith dragon
#

oh wait

#

I should just make a new class

#

implement EventBus in that class

#

and then use that

#

So I followed the SimplEventBus and did the implementation there

#

I put the EventBUs class as my constructor in AbstractGamePhase

echo basalt
#

You can skip the eventbus stuff if you want

#

and just impl Listener

#

in the gamephase

#

and register itself or sumn

#

on start ig

#

There are multiple approaches

#

I am not too happy with how minigame code turns out

wraith dragon
#

also thanks a lot for helping me understand java more lol

#

I didnt know that I could seperate so much stuff into other classes

alpine canyon
#

Hi i think this is the right channel i have a waterfall server and it wont display how much players i have online unless in lobby which is default server do you know how to fix this this is for bungee btw

young knoll
#

No it’s for waterfall

#

Contact their support

versed sapphire
# versed sapphire awesome thank you so much

actually before I make this pull request / feature request I mentioned, I guess I should ask here... is there a particular reason why TrimMaterial and TrimPattern are interfaces and not enums? I feel like they make way more sense as enums and enums are also way more convenient to code with.

young knoll
#

We tend to avoid enums now

#

As minecraft is becoming increasingly data driven

#

Iirc trim material and pattern have corresponding registries, so they are registry backed

versed sapphire
#

ahh is it because datapacks are starting to adapt custom trims? i know they cant actually do that yet but it does look like they're working toward it

young knoll
#

Yes

#

We are trying to move away from enums for all the registry based stuff

versed sapphire
#

that makes sense, got it

#

what im trying to do is totally possible without enums, it's just way more annoying so i figured i'd ask lol

slender elbow
#

things worse than death:
* enums
* french

remote swallow
#

what about french enums

upbeat hornet
remote swallow
#

choco speaks it

upbeat hornet
#

i love choco then

rigid otter
#

Is it right/good to check a Bedrock players via their UUID leading by zeros?

ashen quest
#

when using Player#setGliding = true, it does it in a way that when u land on land, like get in contact, it doesnt disable the glide, like vanilla does

young knoll
remote swallow
#

no you arent

ashen quest
#

🥖

remote swallow
#

Hon hon hon baguette je suis crepe du garcon baguette hon

ashen quest
#

hon hon

#

oui oui

#

i listen to a rapper in french and he sounds hella different than the normal french u see

#

maybe because he is from senegal but french immigrant

mortal hare
#

can someone explain to me why in networking we use mostly big endian byte order in multi byte structures. Ok this kinda makes sense if the last bits are lost the most significant digits aren't so its not that bad as it was lost almost completely, but why the is the order in bytes not in bits, why don't we have multi bit ordering where most significant bit would be at the first closest address, and the least significant bit at the last in the end, wouldnt that be even better in this case?

worldly ingot
mortal hare
#

i get it that big endian in networking byte order, orders Bytes MSB being first while LSB last, but why not bits are ordered like that?

#

its not as if networks receive data in bytes and not bits (lost packets, connection interruptions, etc)

ashen quest
#

lmao i read it as Indian Byte (im indian)

mortal hare
#

chat gpt says that big endian in networking is a joke and its just a compat thing that we dont need anymore but exists

#

but i guess big endian could provide some safety regarding if the packet is corrupted and you have first bytes only

#

those bytes could show the magnitude of the value, thus recovering some of the data

#

still that wouldnt make sense since you can even provide more precision for data loss if you arranged bits also, so its not the reason why its arranged

#

and i was so confused why tf we use such complicated an unnecessary operations

lament slate
#

Hey my plugin is having issues with finding the main class. TO run the spoigot plugin I use cardboard which is a spoigot plugin runner for fabric btw. recently after adding more randoms to my code the plugin just stopped working.

All I added was the chat colors and more random options

https://hastebin.com/share/ilaxarolik.java

rigid otter
mortal hare
young knoll
#

Geyser has an api

lament slate
young knoll
#

You should really just make a fabric mod

#

Cardboard isn’t supported by us or by fabric

lament slate
#

well it was working until like 20 minutes ago

#

when i added chat coolors and messages

mortal hare
river oracle
#

it ain't that hard

#

I believe in you

lament slate
lament slate
#

Could not load 'plugins\OriginSwap.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `skii.originswap.OriginSwap is what I keep getting

#

I am confused if I need to rename my main class or sometihng

river oracle
#

probably just jank from the runneer

young knoll
#

Your package is skii.untitled

#

Not skii.originswap

river oracle
#

:O

#

expozed

lament slate
#

Thank you!

mortal hare
#

i'm still horiffied of the big endian byte ordering nature its so bizzare

#

you arrange most significant byte at the first place

#

least significant at the last

#

but most significant bit of each byte is still kinda little endian in bit level

lament slate
rigid otter
young knoll
#

I would imaging you need it on the backend yeah

#

Or send the data from the proxy

#

Although just checking the uuid should be fine

rigid otter
#

How can we use its API without installing it on the backed end server?

weak meteor
#

ItemStack#serialize() covers enchantments and stuff?

rigid otter
#

May I ask more. I've tried 2 days for no best solution. I want my server to have mixed mode auth. How can I accomplish it?

weak meteor
#

that meta stuff includes the enchantments right?

#

cause i want that to be true

rigid otter
#

My solution is running two proxies, one for online and one for offline. But I see other server can use only one proxy to auth both type.

weak meteor
#

technically yeah

rigid otter
#

I've been doing research on it several hours. I couldn't find the solution.

brisk jetty
#

i kind of forgot that stack overflow is an actual error

#

i just got it

#

and am now trying to figure out why it happened

#

lmao

quaint mantle
#

How do I log with color to console?

river oracle
#

you don't

#

console logs aren't meant to be fancy

quaint mantle
#

Ok well I want to so

#

🤓

river oracle
quaint mantle
#

Ik u can do it with ChatColor.translate but

river oracle
#

here you go if you want to ignore me

quaint mantle
#

I do want to ignore u

young knoll
#

You can also just cheat it with the console sender

quaint mantle
#

i do gui and add items from list
but i want to start these items from specific slot
and I want it to be cut in specific slot
it doesn't happen when i put air item up to a certain slot and then put normal items.
should i set items with a loop?

young knoll
#

Yes

#

Setting a slot to air doesn’t actually fill the slot

quaint mantle
#

ty

ashen quest
#

how would one counter the decrease in speed caused when gliding using an elytra that decreases the speed

#

i want to make it constant

grim hound
#

I'm spoofing the PlayerInfo packet

#

But if the players had a custom tab name set before the spoofing, the nicknames in tab remain

#

the same as the player's default name

twin venture
#

Alright i will try it once i back home .

inner mulch
#

is there a way to check if an item.getType is a banner without having to check all the different color etc.?

#

(i alr tried instanceof banner)

eternal night
inner mulch
#

thanks

noble adder
#

can anybody help me with a plugin im doing in eclipse please?

eternal oxide
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

noble adder
#

i would like to add a lore to an item. im not learning im just trying to fix a plugin so im editing the source code.

#

so you get a golden head by using a comand, would like to add a lore.

rotund ravine
#

What have you tried?

noble adder
#

this.setLore(lore);

rotund ravine
#

Gj

noble adder
#

this. i think sould be the golden apple right?

eternal oxide
#

only if the class extends ItemStack

noble adder
#

don't get it sorry

eternal oxide
#

or it has a setLore method

#

?paste the class

undone axleBOT
eternal oxide
#

click save and copy the http link it gives you to us

noble adder
#

do you see it?

eternal oxide
#

I don;t see you setting the lore

#

set lore to meta, set meta to skull

noble adder
#

like this? meta.setLore(lore);

eternal oxide
#

then set teh meta to the skull

#

ah I see you do

#

I didn;t notice teh lines

#

you need this.meta.setLore

#

you also need to provide lore

twin venture
#

Now its not giving me any error , but nothing is happening , how i can know if its sending the data?

noble adder
eternal oxide
#

no, there is no setDisplayLore

noble adder
#

still says lore cannot be resolved to a variable

eternal oxide
#

yes, you have to provide the lore

noble adder
#

how friend?

eternal oxide
#

what lore are you trying to set?

twin venture
#

both lobby , game connected to same redis server :

noble adder
sterile axle
eternal oxide
#

this.meta.setLore(Arrays.asList( new String[] {"this golden apple will heal you"});

noble adder
eternal oxide
#

yes

noble adder
twin venture
#

i mean i do publish thats correct right?

noble adder
twin venture
#

nothing is being run here

#

this is the new ArenaSubscriber

sterile axle
#

you are only subscribing to the channel "arenaHeartBeat"

twin venture
sterile axle
#

you clearly have a specific channel to subscribe to, it's in your chanel variable.

#

so use that

twin venture
sterile axle
#

stop sending random photos and read what i said

twin venture
#

i use that to publish the data

#

why are you being like this ..

#

thanks anyway

sterile axle
#

because you are spamming the channel with giant photos

sterile axle
#

what channel are you subscribing to

#

and what channel should you be subscribing to

twin venture
#

arenaHeartBeat

#

should be the same?
arenaHeartBeat

sterile axle
#

No, you have a specific channel variable called chanel

#

why are you not subscribing to that?

twin venture
#

forgot about that , its my first time using redis

sterile axle
#

try subscribing to that one and see if it helps

twin venture
#

now it works

#

thanks!

sterile axle
#

you're welcome

twin venture
#

Thats super amazing

#

now i have a question if you don't mind

#

i want to get this data and show it in a gui for arena servers

#

how would i do that for every server that connect , and load its arena?

sterile axle
#

in the future, consider using a pastebin like paste.md-5.net, instead of sending photos and put all your code there, even if it's multiple classes. it might take a little longer but it is much easier for helpers to read and figure out

twin venture
#

1 arena per server , so yes

#

i was about to use bungee messeging system , but i didn't like it and allot of friends told me to not use it , not safe or fast

sterile axle
#

well on bungee you can listen to the serverconnectedevent, and when that server loads up you can dispatch a redis event and your spigot servers can listen on a special channel for that so they know to load an arena or something, I guess

#

but that's kind of open ended

twin venture
#

So for example what iam trying to achive is this :
Or something similler!

sterile axle
#

yeah, i would listen to the ServerConnectedEvent, meaning bungee has a new server available to use, and when you get that, send a message on redis to a special channel that contains what server is available (like, what game does it serve or something) and your spigot servers can receive it and update their state about what's available. then when a player wants to join, from the spigot server, send a redis message to bungee requesting to join the arena for the player, and then on bungee you can move the player to that server

drowsy helm
#

if you dont want to use bungee messaging you dont have many other options unless you want a third party system like redis

sterile axle
#

you're basically coming up with a simple protocol between your client "the user" and the bungee server

#

he is using redis already

twin venture
sterile axle
#

it's just a question of how to do what he wants

#

which there are many ways, but what i just said is one way

drowsy helm
#

if you do havethe option i'd recommend redis any day

twin venture
#

i will do the code my self , i just want to know how would i structure it

sterile axle
#

what i said is one way to do it, and probably not a bad way

drowsy helm
#

could have your own packet implementation with tthe bungee proxy being the manager

sterile axle
#

but it's open ended, you can implement this a lot of ways

twin venture
#

alright thanks

noble adder
eternal oxide
#

this.meta.setLore(Arrays.asList( new String[] {"this golden apple will heal you", "Second line"});

noble adder
sterile axle
#
List<String> lore = item.getLore();
lore.add("...");
item.setLore(lore);

or remember the original lore and do above

noble adder
sterile axle
#

up to you

noble adder
shadow night
#

I'm making a little whitelisting plugin for my private server, what would be better, storing the players in a txt file split by newlines or storing it in a yml file? I don't really care about two microseconds of performance or readability, so idk.

sterile axle
#

if you don't care about the performance, yaml would be better in terms of ease since libraries exist but reading the text file would need you to write the code to open the file, read all the lines, load them into a list, and then use them. neither are "better" in this case, but one is less work (yaml)

eternal oxide
#

yaml as it's already included

shadow night
sterile axle
#

so you've done both?

shadow night
#

No

#

I mean, it looks like it

#

I'll make a new class anyways and there is gonna be a file

sterile axle
#

performance wise unless you're talking about millions of lines, you aren't going to notice any major performance difference. computers are fucking fast. and if it's a small amount of lines, chances are it reads the entire file in one syscall when you go all the way down either way

#

so, choose one and go with it

shadow night
#

Hmm

#

So, essentially, it's the same thing

sterile axle
#

when you boil away the file format details, pretty much. yaml will be doing more to process its file format and load it into data structures that you can access, but when you don't have relatively many entries in that file the performance difference is negligible

#

so i'd just go with yaml. it's easy, it's included, and you don't really have to do all that much extra work

shadow night
#

True

#

And if I need to add another option in that file later, I can just do it

sterile axle
#

yup

shadow night
#

Well, time to try

glossy venture
#

anyone know why the client isnt displaying the formatted title, again might be a protocollib or minecraft issue but want to know if this is a known bug/fix

finite cloud
#

what are the permission needed when using upgradablespawner plugin silktouch enabled

#

im using it and when mined i dont get the spawner

sterile axle
#

read.

finite cloud
rotund ravine
glossy venture
#

this just crashed the server

quaint mantle
#

Hi

#

If i have an async storage system, would it be ok to do stuff with a completablefuture in the storage's thread

weak meteor
#

Can i do Gson#toJson(JsonObject)?

slender elbow
#

sure

native bramble
#

how can i change ores generation? like just replace 50% of all ores with stones or deepslate?

glossy venture
#

is there a way to stop chunks from being loaded past a certain area

#

mainly just looking for a cancellable ChunkLoadEvent

#

but idk if theres smth like that

young knoll
#

Don't think so

umbral ridge
#

It's possible with NMS I think

#

probably

slender elbow
#

the chunk generator api doesn't really let you modify vanilla generation, you have to replace an entire stage with your own logic

glossy venture
#

you could use ChunkPopulateEvent and replace blocks but idk if thats a good idea

native bramble
#

Note: Do not use this to generated blocks in a newly generated chunk. Use a BlockPopulator instead.

#

i think a bad idea

umbral ridge
#

how do you cancel the click event everywhere, in both player inventory and upper inventory?

#

also is it possible to only show the upper inventory without the player inventory and hotbar slots

rigid otter
umbral ridge
#

Now I'm dealing with shift-click and drag events

minor junco
#

Sometimes when you cancel the click event but the player tries to move an item quickly it is still cancelled and just a client side visual error that your item is where it was last cancelled

slender elbow
#

if you're placing items the drag event will still be fired when, well, dragging, it's separate from the click event

inner mulch
#

is there an approach to ensure that lore stays in place? (when i want specific lore to be at the bottom of lore that it will remain at the bottom no matter how the lore gets changed?) or do i need to have checks in every method that changes lore? :(

quaint mantle
#

Guys, could you help me, practically in my lobby system I'm adding the possibility of creating holograms, so far so good, but sometimes wrapped randomly for no apparent reason the entity no longer spawns, not even if I try to place it via Item compare, a fun and even if I touch a part of the code and move a folder not related to holos everything explodes start a server from scratch to try but nothing, the plugin and with api 1.20 ditto the server and Paper 1.20. I no longer know how to resolve it, the event that disables the entities obviously doesn't work, in fact item frames appear without problems

inner mulch
#

pls tell me more about it

rotund ravine
#

Oh i said yes to the last part

inner mulch
#

:/

#

oh no

#

this is awful

shadow night
#

You could make a method that changes the lore with checks and just call it each time instead of the normal way

inner mulch
#

yeah i will probably create a customitem fabric, thanks for the advice

ashen quest
#

how to make it so a player's speed never decreases (when they are gliding using elytra)

shadow night
#

Keep setting some velocity to the player probably?

ashen quest
#

hmm

umbral ridge
#

You could do it with a scheduler

ashen quest
#

and how do i increase the speed of player that is flying like creative, like essential has /flyspeed X

rotund ravine
ashen quest
#

oo

umbral ridge
#

How do you get the bottom and top inventory on InventoryClickEvent?

remote swallow
umbral ridge
#

where is it

remote swallow
#

on the event

umbral ridge
#

OH

#

bottom inventory will always be player inventory?

#

I guess

remote swallow
#

yeah

umbral ridge
#

so to detect either dragging or shift-clicking, do I have to use InventoryDragEvent and InventoryMoveItemEvent, or can I handle this in InventoryClickEvent. I need to check from where the item was dragged or moved and to where

#

I want to prevent players from moving anything at all to the upper inventory in all ways possible

remote swallow
#

i think shift clickis inv click event

slender elbow
#

moveitem isn't really applicable here btw

#

it's for when a hopper or a dropper place an item in a chest, for example

umbral ridge
#

Oh

#

so on InventoryClickEvent how do I get from where and to where item was moved

#

or I cant

inner mulch
#

oh wait

#

i didnt read correctly

young knoll
#

For player use setFlySpeed

remote swallow
#

( @ashen quest ^^)

slender elbow
#

there's also the hotbar numbers, and F

#

you can check the click type for those

ashen quest
#

whats the normal speed

#

1?

young knoll
#

I think so

#

?

ashen quest
#

1 is the max value u can use through #setFlySpeed

#

the range is -1f to 1f

valid burrow
#

is there an event for when a potion runs out

slender elbow
#

EntityPotionEffectEvent

#

check cause/action

valid burrow
#

thank u

#

so action is like either effect gone or applied right?

vast ledge
#

Action is an enum

#

you can check what the action is

valid burrow
#

ikik

#

just wanted to know if there for that purpose

vast ledge
vast ledge
#

The Action Enum

#

is there for that

#

As its contents tell you (ADDED, CHANGED, CLEARED, REMOVED)

pure stag
#

I add my custom enchant via addEnchantment and addUnsafeEnchantment, everything works until I fix the item I enchanted or rename it, etc. for example, I have a sword for custom enchantment, which kills mobs immediately when I hit them if I add durability or some other enchantment through the anvil, then mine is simply deleted, also with renaming and repairing. How can this be fixed?

young knoll
#

You would need to use the anvil events

#

Or use PDC for enchantments

river oracle
#

Reminder EnchantmentWrapper will likely be removed by 1.20.3

pure stag
#

PDC?

river oracle
#

?pdc

valid burrow
blazing ocean
#

how can I make a specific group of players glow for each other and in a specific colour? like having a group of 4 people who are in a team glow for each other in their team colour

i tried using scoreboard teams but the colours dont seem to work

valid burrow
river oracle
river oracle
river oracle
#

Entities chunks items etc

river oracle
#

It is being removed soon

pure stag
#

And what should I use then?

young knoll
#

pdc

river oracle
#

Use lore and item PDC

valid burrow
#

mb

pure stag
#

Okay

#

Thanks everyone

river oracle
#

This is why you don't extend api

valid burrow
#

its gonna be alright

#

plugins that actually many people use will take a few days max to fix that

#

usally if the dev doesnt care about the plugin anymore and doesnt update it doesnt have many users anyways

charred blaze
#

How do i determine what packet is this? Packet@7bcdf983

eternal oxide
#

usually get the type not it's identity hash

charred blaze
#

lets say i have id of packet

#

how do i know then?

valid burrow
#

why do you only have the id

charred blaze
#

System.out.println("Received packet from " + socket.getRemoteSocketAddress() + ": " + packet.getId());

#

Just wondering what bard can do

river oracle
quaint mantle
#

Why this does not set maxhealth?

valid burrow
#

why this fon

#

font

#

its hurting my eyes

remote swallow
#

thats minecraft font

valid burrow
quaint mantle
#

sure

val ins = player.getAttribute(Attribute.GENERIC_MAX_HEALTH) as AttributeInstance
ins.addModifier(AttributeModifier(
    UUID.randomUUID(),
    "bear_change",
    (pet.level.toDouble() * 2.0),
    AttributeModifier.Operation.ADD_NUMBER
)
)
valid burrow
#

thx

quaint mantle
#

Nvm lol

#

I didnt use that class

#

So its not working

valid burrow
#

yh i was confused too

#

couldnt find an error

#

xd

quaint mantle
#

Yeah its working now

valid burrow
#

arl

#

:uwu

charred blaze
#

Received packet:
ID: 97
Data: [97]

#

for example

#

how do i search for packet with id 97

inner mulch
#

why do i need to give names to attributemodifiers even tho im setting attack damage which is a default minecraft value?

charred blaze
#

is packets even numbered?

eternal oxide
#

97 would probably be Clientbound

river oracle
#

They'd have to be how else would you know what packet it is as a server?

eternal oxide
#

if you are giving the correct id

minor junco
hushed spindle
#

does anyone know what event fires when a suspicious sand/gravel block is fully brushed

young knoll
#

BlockDroppItemEvent

hushed spindle
#

oh i thought that was only for blocks being broken

warm mica
#

97 is 0x61 = Set Title Text

#

Note that the packet ids greatly depend on the protocol version

fluid river
#

how is main class loaded

#
result = loader.loadPlugin(file);```
#
public interface PluginLoader {

  @NotNull
  Plugin loadPlugin(@NotNull File paramFile) throws InvalidPluginException, UnknownDependencyException;```
glossy venture
#

JavaPluginLoader

#

iirc

fluid river
#

oh

#

PluginClassLoader actually

#

URLClassLoader actually...

#

ClassLoader actually

#

everything ends here java /** * Finds the class with the specified <a href="#binary-name">binary name</a>. * This method should be overridden by class loader implementations that * follow the delegation model for loading classes, and will be invoked by * the {@link #loadClass loadClass} method after checking the * parent class loader for the requested class. * * @implSpec The default implementation throws {@code ClassNotFoundException}. * * @param name * The <a href="#binary-name">binary name</a> of the class * * @return The resulting {@code Class} object * * @throws ClassNotFoundException * If the class could not be found * * @since 1.2 */ protected Class<?> findClass(String name) throws ClassNotFoundException { throw new ClassNotFoundException(name); }

young knoll
#

Why are you in the classloader

fluid river
#

just curious

#

i'm thinking about Unity's MonoBehaviour

#

where every class is loaded without a constructor

#

when scene launches

chrome beacon
#

What about it?

#

Trying to make smth simillar?

fluid river
#

nah just delving deep in that

#

everything ends up in native defineClass ,ethods

#

i thought it's smth related to Reflection

#

but well, i only found native define methods which contrsuct a Class object

#

oh no i'm wrong

#

it's in the classloader class

#

it's actually using newInstance along with those native methods

glossy venture
#

im pretty sure what it does is

  1. read the plugin.yml from your JAR
  2. create a new custom loader extending or using URLClassLoader in some way (i think its called like PluginClassLoader)
  3. get the main class property from the plugin.yml
  4. load the class with the PluginClassLoader and verify it extends JavaPlugin, then construct and register the instance
young knoll
#

yep

glossy venture
#

dont think its that hard to do, but bukkit does some special class loading shit tho and abstraction of plugin types and load order etc which makes it more complicated

fluid river
#

i knew the first 3

glossy venture
#

thats mostly gonna be JDK code

#

loading classes

fluid river
#

yeah and that's what i posted above

glossy venture
#

ah ok

fluid river
#

loads of jdk code

glossy venture
#

i thought u wanted the bukkit code/process

glossy venture
fluid river
#

there is also code lol

glossy venture
#

not much in ClassLoader itself

#

in terms of defining classes

fluid river
glossy venture
#

idk what that does that seems to make a secure class loader or smth tho

#

interesting

fluid river
#

and well, other methods are native

#

so i probably shouldn't care much about them rn

#

for java that's the furthest i can get

glossy venture
fluid river
#

if only you knew how much loadClass methods i passed through 99 classes to get to it

glossy venture
#

lmao

fluid river
#

🙂

glossy venture
#

that code is called on vm start to initialize the system class loader tho

#

if u want more details look at URLClassLoader

fluid river
#

well as i can see the loadClass method has 3 steps

#

first one is to search for class in already loaded classes

#

if it's there return

#

second one is i forgor

glossy venture
#

lmao find in parent

#

is 2

fluid river
#

and third one is findClass which uses defineClass

glossy venture
#

yeah

fluid river
glossy venture
#

pretty immediately delegates to more internal jvm code tho

#

so doesnt really show much

fluid river
#

c++?

glossy venture
#

yeah

#

well this is C

#

the actual logic will most likely be in C++ though

#

as the jvm is

fluid river
#

is it really

glossy venture
#

yeah

fluid river
#

looks more like ++

#

oh wait cpp has nullptr, not NULL

glossy venture
#

this is C

fluid river
#

nvm

#

i can't find the difference tho

#

i'm sure i can copypaste that to cpp and there would be no errors

glossy venture
#

yeah

fluid river
#

i'm only curious if cpp actually has NULL

#

oh lol it's just #define 'd from std::nullptr_t

glossy venture
fluid river
#

scary

glossy venture
#

yeah

fluid river
#

imagine this code without assert()

glossy venture
#

lmfao

#

true

fluid river
#

well, ig unity does the same stuff

glossy venture
#

wtf is a miranda method lol

fluid river
#

but for every class which extends MonoBehaviour

#

unlike only one class in mc plugins which extends JavaPlugin

#

so you don't use constructors in unity unless you want your class to be non-monobehaviour'd(abstract/interface/static)

glossy venture
#

i cant find anything on so-called miranda method wth

fluid river
#

miranda rule about cops saying that you have rights when getting you

#

here we go

glossy venture
#

fr thats what i thought of too lmao

#

that does not look like java

fluid river
#

maybe that's for ones below 1.8

glossy venture
#

oh thats prob like operator overloading but for other shit than operators it seems

fluid river
#

like extra-early java

glossy venture
#

its still in the code tho

fluid river
#

A ValueGuard is used in the E language to guard the return value of a method.

#

E language

#

E is an object-oriented programming language for secure distributed computing, created by Mark S. Miller, Dan Bornstein, Douglas Crockford, Chip Morningstar and others at Electric Communities in 1997. E is mainly descended from the concurrent language Joule and from Original-E, a set of extensions to Java for secure distributed programming. E co...

glossy venture
#

ohh

#

but wtf does it mean in the context of the jvm then

noble adder
#

guys im trying to make an item not droppable on death and from inv, i would like to code it in my plugin and not download a whole another one just for 1 item

summer scroll
#

I'm trying to change GameProfile to a PlayerProfile so I can set player skull to the textures that I want, how can I do that?

String identifier = Main.getHeads().get(Main.RANDOM.nextInt(Main.getHeads().size()));
GameProfile profile = SkullUtils.detectProfileFromString(identifier);
PlayerProfile playerProfile = Main.getInstance().getServer().createPlayerProfile(profile.getId(), profile.getName());
                
skull.setOwnerProfile(playerProfile);
skull.update(true);
noble adder
#

can anybody help me?

fluid river
#

probably

glossy venture
#

lmqao

fluid river
fluid river
#

antlr is made on E-on-Java

#

so twitter uses Java E ig

glossy venture
#

wait gcc had a java compiler?

fluid river
glossy venture
#

damn this is from 2004

noble adder
fluid river
#

oh lol

fluid river
noble adder
#

not that much

#

I worked on the plugin

fluid river
#

well, it would be extremely hard to help you then

noble adder
#

i did so many things with help from you guys here alr

valid burrow
#

how is there an "old" and a "new" effect on an entity potion effect event

fluid river
umbral ridge
#

😿

noble adder
#

ItemMeta meta = this.skull.getItemMeta(); this should be the item right?

fluid river
noble adder
#

yes

fluid river
#

this.skull is the item

noble adder
#

what should i add to make it not droppable and loosable on death?

#

so it destroyes basically

fluid river
#

you need to make an EventListener

valid burrow
#

wait

fluid river
#

which listens for player death

valid burrow
#

i still dont udnerstandt if thats the case whats the point for the action enum

glossy venture
#

i found an explanation finally

#

its deep in the code lmao

valid burrow
#

i though the action enum determines weither the effect is applied or removed

noble adder
fluid river
glossy venture
#

maybe if an abstract class implements an interface

#

idk

#

or if the compiler fucks up

fluid river
#

good compiler

valid burrow
#

what do you need

fluid river
#

he needs to code a listener for player death

noble adder
#

im trying to make an item not droppable on death and from inv when alive

fluid river
#

if player had special item in inv then not drop it, but destroy it

valid burrow
#

where are you add rn

#

at*

#

did you make a listener?

noble adder
valid burrow
#

if not

noble adder
#

no how do i make it?

valid burrow
#

okay

fluid river
#

my branch got destroyed

#

😭

valid burrow
#

make a class call it PlayerDeathListener

#

implement Listener

#

let me show you an example

noble adder
#

yes please friend, thank you for your time

fluid river
#

i can finally close all of that shit

river oracle
#

NULL

valid burrow
#
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;

public class PlayerDeathListener implements Listener {
    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent e){
      //Do what ever here
    }
}```
fluid river
valid burrow
#

@noble adder

noble adder
#

ok i did

valid burrow
#

now on the player death u can check if the player has ur item in his inventory

#

or wait

#

actually

#

u want to make the death not happen if the player has the item right?

#

in that case

#

playerdeathevent is too late

#

cause you cant cancel that

#

instead

#

use

#

entitydamageevent

tardy delta
# glossy venture i found an explanation finally

Fixes and old jdk 1.1 bug where the linker tries to resolve a symbolic method reference of an abstract class, which doesn't define that method but inherits it from an interface, the sun jvm didn't look for declared methods in interfaces, only in classes. javac doesnt emit miranda methods anymore since java 8 though
e.g. ```java
interface I { void x() }
abstract class A : I {}
class B : A { void x() {} }
void main { new B().x() // wouldn't be resolved at runtime as its not declared by any non-interface parent }

noble adder
#

no i wan't when he dies no matter how item destroyes,

valid burrow
#

ah okay

#

alright

valid burrow
#

in that case entity death event is fine

#

now

tardy delta
#

no

valid burrow
#

do you want to destroy all items of a certain kind?

glossy venture
#

i assume u meant B

noble adder
#

i mean is a kitpvp so the only way they can achive heads is if i give them so