#help-development

1 messages · Page 898 of 1

charred blaze
#

so the config path is correct

#

??

remote swallow
#

print config.getValues

charred blaze
#

oh my bad

#

ok ill try to run it

hazy parrot
#

Why not javafx 😭

charred blaze
remote swallow
#

the config isnt saved

charred blaze
remote swallow
#

on the server

charred blaze
#

arenasConfig.load(arenasFile);

#

it should be

remote swallow
#

close and reopen the file

#

and check code is running in order

charred blaze
#

why do i need to reopen the file

remote swallow
#

it should reload it

charred blaze
#

how will that help track the issue?

river oracle
#

Anyone have a clue of why Translateable components wouldn't be working with Menus???

#
        val title = MenuBuilderImpl.title(type)
        menu.title = title
        Bukkit.getLogger().info(title.toString())
        serverPlayer.sendSystemMessage(menu.title)
        menu.checkReachable = false
        entity.openInventory(menu.bukkitView)
        return menu.bukkitView
#

when printed out to the player it provides the correct translations, but when opened its in english no matter the language

#

as you see the player inventory is in spanish, the title set on the server with the translatable component isn't, but its correctly printed out in chat and the console contents are as expected

#

must be a CB internal issue ig

#

figured it out, its how CraftBukkit opens inventories without considering translatable components

young knoll
#

Kek

#

Fix it

river oracle
#

I mean I can fix it in my project

#

but spigot can't until components are merged

young knoll
#

Wdym

#

Like merged into cb?

#

Cuz they are already in spigot

river oracle
river oracle
charred blaze
#

i load it in onenable

remote swallow
#

are you calling .set

mellow edge
#

how can I fix that when I call .dropItem the item won't go a little bit up and then go to a random direction but instead just drop it directly on the ground?

charred blaze
#

before that line

river oracle
remote swallow
#

do you save

charred blaze
#

yea

#

if i reload config before getting location it works.

#

thats weird

#

fixed

#

found solution

charred blaze
#

how do i cancel runtasklater from other class?

wet breach
charred blaze
#

and just store it somewhere?

#

hm ok

wet breach
#

ideally since you plan on being able to cancel it

charred blaze
#

ok

wet breach
#

the alternative

echo basalt
#

BukkitRunnable?

wet breach
#

is to make the task have a condition it checks and from there it would dictate if the code runs in the task or not

charred blaze
#

how do i get the task id

echo basalt
#

Just overengineer your stuff

wet breach
charred blaze
#

but its pretty hard in my example

charred blaze
wet breach
#

put the task in a variable

echo basalt
#

:)

charred blaze
#

aham

wet breach
#

handy illusion has stuff already made XD

#

even more so I don't have to type anything out now

echo basalt
#

I have A LOT of stuff made

charred blaze
#

scheduler.runTaskTimer(plugin, (bukkitTask -> {
taskId = bukkitTask.getTaskId();
task.accept(bukkitTask);
}), delay, period);

#

wait wouldnt taskid variable only change after tasktimer executes?

echo basalt
#

Nope

#

Each Bukkit task has a task ID

#

That ID is assigned by the scheduler

wet breach
#

anything that gets scheduled gets an ID

echo basalt
#

This method passes a Consumer<BukkitTask> to the scheduler

#

Which the scheduler accepts when it creates the task

#

although this keeps re-assigning the taskId field

#

Every time the task ticks

#

(which barely matters)

wet breach
#

overall however, it shows how to get the task id which is what you were wanting 😛

echo basalt
#

¯_(ツ)_/¯

#

frosty opinions on making a minigame network?

wet breach
#

you are making a minigame network?

echo basalt
#

maybe

#

At the moment yes, for a commission

#

but after this I might make my own

quaint mantle
#

99% requests: bedwars

wet breach
#

interesting, I might be interested in joining it

echo basalt
#

Rn I'm still working on infrastructure while I can

charred blaze
#

i dont understand what to put in delay and period

wet breach
#

I could provide a dedicated server 🙂

echo basalt
#

at some point I'd love to have a server or two to test

charred blaze
#

my task's options?

echo basalt
#

The other is how many ticks between iterations

charred blaze
echo basalt
#

?scheduling

undone axleBOT
quaint mantle
#

Remember: Download sources

charred blaze
echo basalt
#

Yeahj

charred blaze
#

oh i was confused because i was doing runtasklater actaully

echo basalt
#

Then yeah you modify your class a bit

charred blaze
#

action.accept(task);

#

whats this

#

cant i just put my task's code there instead

echo basalt
#

Consumer

#

You can but you won't have context of the task id

charred blaze
#

wdym context

charred blaze
#

why cant i just

#

will that tasklater execute?

echo basalt
#

It will

charred blaze
#

ok so heres thing i was looking for

quaint mantle
#

omg

#

I can post imgs now

echo basalt
#

me when I get a real job

quaint mantle
#

Rust developers when they make algo 1ns faster

grim hound
#

how can I reference a specific line in a spigot link?

worldly ingot
#

On what website?

#

The Stash? Forums?

grim hound
#

so basically like github, where you get to specify the line

grim hound
worldly ingot
#

Resources? You can. Though some browsers support text highlight linking

grim hound
worldly ingot
#

On Vivaldi at least I have a link in my context menu

#

Unsure where that would be on Chrome

grim hound
#

the website shows up normally

worldly ingot
#

Yeah, my text was probably too long or something

grim hound
#

it doesn't

worldly ingot
#

Then you may not be on a browser that supports it

#

It's a Chromium feature so you need a Chromium based browser

dire saffron
#

Hi spigot people!

Im looking for a dev to show or code me a bungee plugin that changes /server (name) to open a custom menu (deluxe menus) instead

grim hound
worldly ingot
#

Might just not support it

grim hound
worldly ingot
#

I mean it's working fine on my browser

#

Sends me right to it and highlights it

worldly ingot
grim hound
#

I'm trying to reference it with like a *

worldly ingot
#

That one works for me

grim hound
#

and ain't for me

#

hmm

worldly ingot
#

I promise!

grim hound
#

mmm

#

if it doesn't work for me, won't for others as well

worldly ingot
#

Or at least not those on a browser that doesn't support it 😛

#

That's kinda your only option though

rough ibex
#

#:~: wacky syntax

worldly ingot
#

Blame Google

slender elbow
#

i like the face it makes

#

:~:

worldly ingot
#

Like it just had a tummy ache

grim hound
#

since I don't have it automated

#

gonna tell other to scroll to it

buoyant viper
heavy zephyr
buoyant viper
#

you dont, Bukkit learns you

heavy zephyr
#

huhuhuhuhuh

buoyant viper
#

your sleeping patterns, your habits, your daily routine

#

Bukkit is always watching

#

observing

#

learning

remote swallow
buoyant viper
#

that too

heavy zephyr
#

not how long he used it for

remote swallow
#

he probably learned it by using it

#

bc i doubt docs were very good back in 2014 a year after release

slender elbow
#

wut

#

bukkit has been a thing since 2011

remote swallow
#

same thing

heavy zephyr
#

I use Kody Simpson

#

to learn

eternal oxide
#

back then we learnt it by throwing code at an IDE and waited to see what worked.

young knoll
#

Wait you don’t do that anymore?

rough ibex
#

maven or gradle

heavy zephyr
rough ibex
#

did you add the vault dependency

heavy zephyr
#

ye

rough ibex
#

show pom

grim hound
#

does somebody here know Bash?

#

cuz this mfo

rough ibex
#

hm?

#

what of it

grim hound
#

useless piece of software

rough ibex
#

again, what of it...

grim hound
#

doesn't show the password inputted

#

and when clicked enter

remote swallow
#

yep thats normal

rough ibex
#

that's normal

remote swallow
#

you type it without seeing it

grim hound
#

doesn't accept any inputs

rough ibex
#

and intended behavior

#

it does accept input.

grim hound
#

NOR DOES HE ACCEPT THE HIDDEN INPUT

remote swallow
#

it accepts input you just dont see it

grim hound
#

HE DOESN'T

rough ibex
#

it does

grim hound
#

HE FUCKING DOESN'T

#

I TRIED IT

#

I CHECKED

rough ibex
#

i don't think su has a gender

grim hound
#

HE DOESNT'

rough ibex
#

but

#

then are entering the wrong password

grim hound
rough ibex
#

why are you using su anyway

grim hound
grim hound
#

if I try to login as root from the start

#

the server just refuses the connection and tells me to login as opc

rough ibex
#

root often is not able to be logged into

#

it has no password

#

you cannot su to it normally

#

as you are intended to use sudo -u

#

for other user

grim hound
rough ibex
#

or use sudo -i

grim hound
#

but I don't have sudo

#

cuz fucking aarch

#

so I need root

#

to install sudo

rough ibex
#

what distro

grim hound
#

uh like 64

rough ibex
#

i'm sorry?

grim hound
#

how can I check this?

rough ibex
#

you installed it

#

you should remember what you installed

grim hound
#

well it's raw aarch86_64

#

I think

remote swallow
#

thats architecture

grim hound
#

it doesn't tell me

#

it just says aarch

rough ibex
#

how did you install it

#

what did you install

grim hound
#

did it long ago

#

don't remember

remote swallow
#

run cat /etc/os-release

grim hound
#

this it what the mc server says at start-up

remote swallow
grim hound
#

will do

rough ibex
grim hound
#

the server just needs to shutdown

rough ibex
#

thats java version and kernel

remote swallow
grim hound
#

I wanted to get root

#

so that I can install screen

grim hound
remote swallow
#

smh oracle linux

grim hound
#

can't do much about it now

rough ibex
#

ah fedora

grim hound
#

this is what happens when I try to login as root

#

the terminal just closes right after saying this

rough ibex
#

yep

drowsy helm
#

login as opc then

grim hound
#

so I need to change to root via su

#

which doesn't work

drowsy helm
#

is this a vps

rough ibex
#

yes because root you cannot login as normally

grim hound
#

how do I access it

grim hound
drowsy helm
#

unless it's a managed OS i don't see why oyu dont get root access

remote swallow
#

try and connect as root

rough ibex
#

its normal for root to not be able to logged in as

remote swallow
#

root@ip

grim hound
#

doesn't accept

#

any passwords

rough ibex
#

you can either

grim hound
rough ibex
#

set root's password and allow login

remote swallow
#

no

#

when you connect

rough ibex
#

or use sudo if you can get it

remote swallow
#

you should be using ssh or putty, change it from whatever to root

grim hound
grim hound
#

have sudo

remote swallow
#

how do you connect to it

rough ibex
#

however you're connecting to it

#

user@host

grim hound
remote swallow
#

change the connection info then

grim hound
#

I input the private key, ip and configure the keepalives

grim hound
#

I only have one private key

remote swallow
#

hold on ill install putty

grim hound
#

do I use the server's private ip?

remote swallow
#

no

#

do you have this

grim hound
#

yes

#

or rather

remote swallow
#

change it to root@publicip

grim hound
#

not with the @

#

it's just

#

public ip

remote swallow
#

replace it anyway

grim hound
#

and the fucker closed

remote swallow
#

try opc then

grim hound
remote swallow
#

opc should have the same access as root

grim hound
#

uh

#

it does?

remote swallow
#

iirc it does yeah

grim hound
#

then how do I install like screen and sudo on bash linux?

remote swallow
#

you should be able to access sudo from opc

grim hound
#

how did it just start working

#

I did not work a few days aback

#

the sudo

#

it just said "bash: sudo: command not found"

#

I did not install anything

remote swallow
#

to me that looks like whatever you tried to do with sudo failed

grim hound
#

it just typed "sudo"

grim hound
#

cuz when it works for me I look at ppl who have problems with like like at idiots

#

until I try to help em, and boom, different situation, won't work

#

the hell

drowsy helm
#

proceed where

trail thunder
#

hello, im trying to build spigot from source but got

[ERROR] Failed to execute goal on project spigot: Could not resolve dependencies for project org.spigotmc:spigot:jar:1.20.2-R0.1-SNAPSHOT: The following artifacts could not be resolved: org.spigotmc:minecraft-server:jar:1.20.2-R0.1-SNAPSHOT (absent): Could not find artifact org.spigotmc:minecraft-server:jar:1.20.2-R0.1-SNAPSHOT in minecraft-libraries (https://libraries.minecraft.net/) -> [Help 1]

just downloaded latest build tool and launched it in a new directory and clean maven cache with java -jar BuildTools.jar --rev 1.20.2
im fairly new to java, what can be the cause and where do i get this dependency? thanks!

lost matrix
river oracle
#

BuildTools downloads maven and uses that

#

Likewise with git

lost matrix
#

Ok, but you dont compile the spigot project with BuildTools

#

*When doing it manually

river oracle
#

I assumed this was a BT error

#

But if it's not yes you're right

lost matrix
#

Hm, i mean IJ comes bundled with a maven environment. So opening and compiling there should work.
Im jsut worried that maven doesnt find its local .m2 folder.

ivory sleet
#

Smile how much for a code review?

surreal hornet
#

( i know its more of a java question than a spigot question but ..) what tool is usually used for monitoring plugin to prevent from things like memory leaks ?
for example how can i check how many instance of a sorten object exist on memory ? so i can make sure there is no reference to that object so it will be collected by gc

sullen marlin
#

a memory profiler like VisualVM, Eclipse MAT, etc

ivory sleet
#

^

#

and regarding the references, there are techniques to ensure no references to a given object, however before u resort to those, its usually vice to revise ur design rather

sullen marlin
#

as long as you dont leave things in a map list or array you don't need anymore, it's pretty hard to leak with a plugin

surreal hornet
#

I have an obsession with performance and memory leak prevention, and I want to take extra care as my plugin grows. I've checked my code design multiple times, but I'd like to confirm that there are no references to my objects on Lambda expressions or Bukkit Runnables.

#

thank you for advice

young knoll
#

Well you could just hold a hard world reference in your main class then unload the world

#

Pretty sure that’ll do it

surreal hornet
ivory sleet
surreal hornet
ivory sleet
#

Yes

#

Pretty sure it works

#

It can also sometimes be harmful to eagerly clean references up in terms of optimizations

trail thunder
lost matrix
surreal hornet
#

I have created an object that includes an armor stand as one of its properties. I have also implemented a feature that removes every reference to the object when the armor stand dies, and this functionality is working as intended. However, I have noticed that for example if I have 20 instances of that object in memory and then reload the server, those 20 instances remain stuck in memory , even though there are no references to them. Is this behavior normal?

#

is this why so many people hate /reload ?

lost matrix
lost matrix
surreal hornet
#

yeh yeh thats fine, i dont wanna make my plugin compatible with reload i just wanted to know if this behavior is normal or not

lost matrix
#

I feel like those instances should be gone if you kept them in a Map<K, V> as values, and the keys being the ArmorStands.
But depending on your design, tracing the reference can be tricky.

surreal hornet
#

i dont save those instances on any persistent container

#

they are all on memory

#

anyway

#

thank you

quaint mantle
#

do you guys think this is useless

lost matrix
#

Also: What is all this primitive stuff?
PrimitiveNumber.ofDouble(double) looks reduntant to me as double is already primitive

quaint mantle
#

i needed to make a wrapper cause every element can have their own metadata

lost matrix
#

For example?

quaint mantle
#

the only reason i did that is cause a lot of serialized forms are essentially key value pairs

#
public interface PrimitiveElement {
    <T> Optional<T> getMetadata(Class<T> var1);

    void setMetadata(Class<?> var1, Object var2);
    //...
lost matrix
#

How is this metadata used? Is it serialized as well?

quaint mantle
#

it depends on the serializer

#

like i could add a Comment metadata

#

yaml would serialize that

#

but something like json wouldnt

lost matrix
#

Hmm

quaint mantle
#

ima rename the yamlconfigservice to yamlserializer

#

but the plan was something similar to like

#

bukkit's config sys

#

for my other non mc plugins

#

bros writting an essay

lost matrix
#

I really dont like having maps as configuration structures. I would prefer the config being (de)serialized to instances reflectively.
For example

public static class MessageConfiguration {
  
  @ConfigName("Plugin Prefix")
  @Comment({"Some mult line", "comment"})
  private String pluginPrefix = "AM";

}

This way i have actual type safety for my configuration, and im not prone to errors which oftern occur when using String keys to retrieve config values.

quaint mantle
#

i made smthing similar to that

river oracle
#

I do something similar but I use something more like below

DataField<String> pluginPrefix = new DataField<>("plugin-prefix", "AM");
#

than cache the method handle :P

#

prob don't need to cache it tho tbh

young knoll
#

Yeah mine looks almost identical to smiles

river oracle
lost matrix
#

*I dont have that. Just made it up. My approach is to throw everything into Gson because im lazy.

worldly ingot
#

pft. annotations

river oracle
#

I dislike annotations :P

worldly ingot
#

interfaced and all that fun stuff. I likey

young knoll
#

Gson works but it isn’t yml

remote swallow
#

Choco sus

worldly ingot
remote swallow
#

Lets use .properties for configs

river oracle
#

I use Gson lol

#

💪

young knoll
#

Yeah just idk

remote swallow
#

You would use xml if you could

young knoll
#

People will fuck up the brackets

#

Granted people fuck up indenting anyway so

river oracle
#

I would also consider Lua for that though

remote swallow
#

Sus

#

Pineapple script when

river oracle
#

Lua is great as its easy to embed so you can really get some sweet ass stuff with it

young knoll
#

Not fast enough!

worldly ingot
#

Lua would actually be super sick for an inventory framework

river oracle
#

see choco gets me

#

iirc some Hypixel Skyblock (players) nerds made some Lua Inventory Framework type shit

remote swallow
#

Yeah well you two are weird

young knoll
#

I should make a scripting system for my plugins at some point

worldly ingot
#

I don't have access to the SkyBlock team stuff, so 👀 I wouldn't know

young knoll
#

I can think of many uses for that

remote swallow
#

Josh while ur here i have questions for you

quaint mantle
#

choco how does your plugin handle config updates

worldly ingot
#

Nothing is held in memory. It just pulls from Plugin#getConfig()

quaint mantle
#

Like let's say you completely remodel the config

#

what happens to all the old values

worldly ingot
#

oic, not local updates, just over time feature updates

quaint mantle
#

What's oic

worldly ingot
#

I announce them in the update notes and if they don't wanna use them, it'll fall back to defaults

#

I don't add them

remote swallow
# remote swallow Josh while ur here i have questions for you

Does ur config thing work like this

Find @ConfigEntry annotations
check if config exists if yes add missing defaults if no skip
Get Type
check if adapter exists
if yes run it if no try and cast to string
use result to call YamlConfig#set
save
load all from config

river oracle
worldly ingot
#

oic = oh i see

quaint mantle
#

Damn

#

yeah honestly that's the way to go

#

Ima start doing that

worldly ingot
#

Yeah, not really understood the obsession with constantly putting in config values that don't really need to be there tbh

#

I keep my default config on the description page

#

If they need them, they can find them 😄

young knoll
river oracle
#

@quaint mantle if you find yourself remodeling a config you are going need to hand map all the values if you change your config a shit ton multiple times you need to rethink your plugin designing the goal is to not change things plan ahead

remote swallow
#

Bcim making me own

quaint mantle
#

Wait @worldly ingot how many hypixel devs are there

worldly ingot
#

pft... uh...

#

Probably 35 or something?

remote swallow
#

Like tree fiddy

worldly ingot
#

Maybe 45?

#

35 - 50 is my estimate lol

quaint mantle
#

is it true they got a special team just for fixing bugs

river oracle
#

it shouldn't and if it does you are going to have to either A. Don't do anything and require players to update or B. manually map all the old to new values

echo basalt
#

that's a lot more than my 15-20 estimate

#

can you tell them to hire me ktnxbye

young knoll
worldly ingot
#

I mean I could be wrong

young knoll
#

If it doesn’t find an adapter it just yells at you

remote swallow
#

Oh

echo basalt
#

Like

quaint mantle
#

Wait so

remote swallow
#

Maybe ill add basic serialization

river oracle
quaint mantle
#

choco is minikloon a Sr dev what role is he actually

worldly ingot
#

I can go count if you want 😅

echo basalt
#

there's cerus, you, paul, minikloon, plancke, mgrf, relenter, inventive, connor

#

uh

#

I'm starting to forget names

remote swallow
#

Simon

echo basalt
#

simon is not a dev

river oracle
#

Y2K_ is a hypixel dev

echo basalt
#

neither is chi lynn

remote swallow
#

Uhhhhh

echo basalt
#

neither is pensul or bembo

#

externizable is a web dev

#

I guess we can count him

quaint mantle
#

Max

worldly ingot
#

22 developers, so yeah, I was a bit off lol

echo basalt
#

fun

remote swallow
#

Theres probably a steve on there

quaint mantle
#

is minikloon the superviser

echo basalt
#

every time I see choco talking around I get inspired to apply for like the 19th time

river oracle
echo basalt
#

but then I remember I'm just gonna get rejected the moment they look at my name on my CV

remote swallow
#

Inventive is prob supervisor

echo basalt
#

nah

quaint mantle
remote swallow
#

Its choco isnt it

echo basalt
#

minikloon is a goated dev but I don't think he's doing management

#

he has the passion for development

#

Like there are 2 paths you can take as an elite dev

quaint mantle
#

y2k is not and I repeat is not the supervisor

remote swallow
#

Yes he is

echo basalt
#

you either become a code wizard or you give up development for a more management position

#

kloon is a code wizard

river oracle
river oracle
young knoll
#

What constitutes a wizard

remote swallow
#

Y2k is one of hypixels elite employees

echo basalt
#

dude's just years ahead

river oracle
young knoll
#

Listen here you little shit

quaint mantle
#

Woah woah

river oracle
#

for example @young knoll

quaint mantle
#

who's above minikloon other than simon

river oracle
#

I'm pretty much top dog

echo basalt
#

simon and kloon are friends irl

quaint mantle
echo basalt
#

but I believe noxyd is higher in terms of management

#

although he's more hytale

young knoll
#

Who’s the one that Simon made maps with

#

Reezus or something

quaint mantle
#

if I ever get management on hypixel it's actually over for the server

echo basalt
#

yeah

river oracle
#

author of Inventory PR

echo basalt
#

let's see when did I last apply to hypixel

#

november

quaint mantle
#

What I'm about to do to the players

#

all the opps are gonna vanish

river oracle
#

do you even know who you are talking to?

#

I am the greatest developer ever to spawn on planet erath

young knoll
#

Imagine hypixel using /op

echo basalt
#

lmfao

#

imagine hypixel using luckperms

#

or essentials

#

cmi puke

quaint mantle
#

Skript

river oracle
#

we use luckperms guys

young knoll
#

I love /sethome in bedwars!

quaint mantle
#

they don't use Java they use Skript

echo basalt
#

half their shit is made with command blocks

river oracle
quaint mantle
#

Who's we

#

U ain't on the team bud

river oracle
#

me and the hypixel team

echo basalt
#

y2k and his other brain cell

remote swallow
#

Hypickle

river oracle
echo basalt
#

I'm still planning my minigame network >:)

worldly ingot
#

Can confirm, CMI is installed on the Hypixel network globally
(for legal reasons, this is a joke)

remote swallow
lost matrix
quaint mantle
#

Do you guys think an industry dev would be a good minecraft dev

echo basalt
young knoll
echo basalt
#

I was talking to frostalf ab it and he offered a dedi

river oracle
young knoll
#

Blizzard employee

echo basalt
#

janitor md_5

lost matrix
quaint mantle
rough ibex
#

holy shit I love using JSON5 as my config

echo basalt
#

ew json

river oracle
quaint mantle
#

u a little late

river oracle
#

@rough ibex we must be related

lost matrix
#

I mean. Json isnt a configuration format really.

quaint mantle
#

oh have you guys seen apple's config?

echo basalt
#

I remember joking ab flying developers out to break each other's kneecaps in case of nda breach at hypixel

rough ibex
#

Why not?

young knoll
#

It doesn’t even support comments

lost matrix
#

Its convenient but probably not a good choice

young knoll
#

Well technically

rough ibex
#

I should amend

quaint mantle
#

they made a config system where you can code with it

rough ibex
#

I'm using JSON5

#

My bad

lost matrix
# rough ibex Why not?

Bc its used for mainly persisting data. Yml is for example better suited. One reason are comments.

echo basalt
#

toml

rough ibex
#
val thing = config["object"] as? JsonObject ?: throw AssertionError("Item \"object\" must be an object.")
#

I have seen the light

quaint mantle
#

I'd throw illegalstate

#

imo

#

Just me tho

rough ibex
#

true

#

although I also have some asserts in here

young knoll
#

Throw oom

quaint mantle
#

Idk I've never really thrown an AssertionError before

rough ibex
#

I just like to be consistent and throw 1 exc type if I can

#

Considering they convey the same message.

quaint mantle
#

I throw an Error

#

cause it's an error

rough ibex
#

Aren't Error and Exception not the same

quaint mantle
#

yeah they arent

rough ibex
#

haha

echo basalt
#

just fail silently

#

ezpz

quaint mantle
#

But I make sure my plugin stands out

river oracle
lost matrix
young knoll
#

Just brick the server

rough ibex
#

Well, I'm not using GSON

echo basalt
#

Thread.currentThread().join() to prevent further contamination

lost matrix
#

Where is "JsonObject" from then?

quaint mantle
young knoll
#

Something goes wrong? Unsafe#putInt(0, 0)

rough ibex
river oracle
quaint mantle
#

pretend ur a clueless server owner

rough ibex
#

I use Jankson but the pattern can be adapted to any JSON lib I suppose.

young knoll
#

Jankson

rough ibex
#

plus,

Jankson is, for the most part, a drop-in replacement for Gson or Hjson, but can also be used as a preprocessor to fix quirks and strip comments, re-baking it into standard JSON syntax for another parser to consume.

young knoll
#

I love the name

rough ibex
#

It's nice.

quaint mantle
#

"IllegalArgumentException" tf is that prob nothing important

"Error" ima start investigating

rough ibex
#
class No(message: String) : Exception(message)

now we're cooking

echo basalt
#

Funny that the only use case scenario I have for it is preventing obscure memory leaks

young knoll
#

How long until java blocks us reflecting unsafe

quaint mantle
#

wdym

river oracle
#

I forget when they plan to do that by

echo basalt
#

you're telling me that I actually have to fork and fix code

#

hell naw

#

just unsafe inject a bunch of proxied classes n fix shit

quaint mantle
#

I could've sworn Records were supposed to be like really safe

echo basalt
#

most useless change

quaint mantle
#

Like anti reflection safe

river oracle
#

also I doubt Records are anti-reflection

rough ibex
#

*theUnsafe

quaint mantle
#

They arent

young knoll
#

They are already on their way to blocking runtime attaching instrumentation

quaint mantle
#

gson can serialize and deserialize records

#

was kinda surprised with that

echo basalt
quaint mantle
#

and they will now recursively serialize nested objects

river oracle
#

I mean records are just a fancy class

quaint mantle
#

Wtf is happening with my keyboard

young knoll
#

If the server wasn’t so stubborn I wouldn’t have to ASM it

#

Smh

lost matrix
quaint mantle
#

json5 looks stupid

lost matrix
#

You will also get some nice surprises...

river oracle
#

guys we can finally stop arguing about which config is best apple released pickl the arguments are over

quaint mantle
rough ibex
quaint mantle
#

From javas framework

#

Does it just fail

river oracle
#

unless their is a type adapter ya

quaint mantle
#

I found it interesting how they have a type adapter for uuid built in

#

wasted my time making one

lost matrix
quaint mantle
#

hm

#

what's the default?

lost matrix
#

You cant really deserialize an interface or an abstract class without storing its runtime implementation.
So it will throw an exception.

torn shuttle
#

hey in ClientboundSetEquipmentPacket for the id of the entity what id is expected there? It feels like it's the ordered list of entities that the player knows about or something because it's not uuid

lost matrix
#

Isnt it just the int id? The client usually has no idea about the UUID

young knoll
#

It’s the internal int id

#

Yeah

torn shuttle
#

there's an int id?

young knoll
#

Yes

#

Bukkit even exposes it

worldly ingot
#

Entity#getEntityId() iirc

torn shuttle
#

uh the problem is my entity is purely packets-based

worldly ingot
#

Oh, so you should have an entity id then because you need it to spawn one

quaint mantle
#

Kinda an odd question but what should I do if I face an exception but I also fail to notify the user of the exception (like an exception while alerting an exception)

torn shuttle
#
        ClientboundAddEntityPacket clientboundAddEntityPacket = new ClientboundAddEntityPacket(
                entityType.getTypeId(),
                UUID.randomUUID(),
                spawnLocation.getX(),
                spawnLocation.getY(),
                spawnLocation.getZ(),
                spawnLocation.getPitch(),
                spawnLocation.getYaw(),
                net.minecraft.world.entity.EntityType.ARMOR_STAND,
                0,
                new Vec3(0,0,0),
                0);

hmm is it the first one

#

there's a few "mystery ints" for me here

worldly ingot
#

No that's its type

torn shuttle
#

that was more of a guess on my end tbh

worldly ingot
#

Oh, my mistake, yeah, it is the id :p

torn shuttle
#

right

worldly ingot
#

You just happen to be giving it the entity type's id as its id

torn shuttle
#

so I should randomize it?

worldly ingot
#

Which uh... shocked it hasn't broken yet

young knoll
#

No

#

There’s an atomic int in Entity that you should use

torn shuttle
#

didn't have much time to break considering I barely got it to compile once thus far

worldly ingot
#

I mean you're already directly invoking NMS so you could use the int field in the Entity class

young knoll
#

Although iirc it’s protected

torn shuttle
worldly ingot
#

I think there's a method to get the next entity id somewhere tbh

#

looking now :p

torn shuttle
worldly ingot
#

Oh there isn't. That's sad

#

Yeah that's the one

#

You'll have to get it reflectively

torn shuttle
#

fantastic, my favorite

young knoll
#

Convince choco to PR a visibility change :p

worldly ingot
#

Nah

torn shuttle
#

I don't quite thing the dumb shit I'm doing right now will get thrown into the api but I could be wrong

young knoll
#

I think downstream does expose a method to get the next Id

torn shuttle
#

people keep complaining that my models aren't 100% async so I'm just making them entirely artificial so I can send packets in async

young knoll
#

👀

#

I mean you can generally send packets async anyway

worldly ingot
#

There should be a class in Apache Commons to do things more easily. I think it's FieldUtils#getDeclaredField() or something

worldly ingot
#

Yeah that works fine too

young knoll
#

Oof obfuscated names

worldly ingot
#

Don't know what it obfuscates to tbh

torn shuttle
#

yeah so I'll have to deal with per-version obfuscation....

#

this is great

young knoll
#

That’s why I switched to getting fields by type and index

worldly ingot
#

I mean, I don't actually know if it'll break if you provide some absurdly high number, it's just not technically guaranteed to be unique

torn shuttle
#

what was that really handy place for checking obsfuscated garbage

worldly ingot
#

Could just try 100_000_000 + x or something lol

torn shuttle
#

ngl the temptation is there

#

thanks

young knoll
#

Technically it’s not unique anyway

worldly ingot
#

d in 1.20.4

torn shuttle
#

I want the d

young knoll
#

It will eventually wrap around

worldly ingot
#

Hell yeah you do

young knoll
#

    private static final Field ATTRIBUTE_FIELD = ReflectionUtils.getField(LivingEntity.class, AttributeMap.class, 0);
    private static final Field CRAFT_ATTRIBUTE_FIELD = ReflectionUtils.getField(LivingEntity.class, CraftAttributeMap.class, 0);
#

No names required :p

torn shuttle
#

fun I have to do this from 1.17 thru to 1.20.4 and it probably won't cover all of them

worldly ingot
#

That # resets on server restarts lol

young knoll
#

Yeah

#

Smh Mojang why no atomic long

worldly ingot
#

I'll give you an atomic long >:(

young knoll
#

Oh boy

torn shuttle
#

choco's long atomic

#

I should make that into an item

young knoll
#

Oh yeah you did the free minecraft models

#

Item displays when?

torn shuttle
#

this is literally what I am working on

#

they will be full async

young knoll
#

Nice

torn shuttle
#

also hoping to find a packet that has next to no latency because that is my greatest problem right now

#

mc keeps interpolating api teleports and it's super slow

young knoll
#

Make sure to set the display entities teleport duration

torn shuttle
young knoll
#

No idea

#

Mine were all choppy until I set it to match how often they got teleported

#

Granted I believe mine only move every 3 ticks

torn shuttle
#

yeah that would make it choppy

#

hmmm

#

I can try

#

teleport duration?

torn shuttle
young knoll
#

Uhh

#

Idk I set it through the api

#

Might be part of synched entity data

torn shuttle
young knoll
#

setTeleportationDuration

#

Or maybe setTeleportDuration

#

Something like that

torn shuttle
#

pretty sure those don't exist under entity

#

or livingentity

#

are you thinking about portalcooldown or something?

young knoll
#

It’s on Display

torn shuttle
#

wait what

young knoll
#

We talking about display entities aren’t we

torn shuttle
#

oooooooooh

#

ok I got you, I haven't actually started using those yet

#

I was doing pure packet entities first and then moving to display entities

young knoll
#

Ah

torn shuttle
#

actually now you have me wondering if the tighter teleport bounds are a display entity property

#

and unrelated to packets

#

do they actually visually teleport faster?

young knoll
#

Don’t think so

#

They just don’t interpolate teleporting by default, while all other entities do afaik

torn shuttle
#

also in reflections I only need to expose a static field once right, no reason to keep doing it every time I access it?

young knoll
#

Correct

#

Same with non static

torn shuttle
#

damn

#

I could've kinda skipped what I'm doing

#

well too late

#

I thought I could do some packet trickery to skip the interpolation

young knoll
#

I still need to fix those janky animation transitions

#

Oh well

torn shuttle
#

big pog moment

quaint mantle
#

Help with figuring out a nice elo equation

int maxEloToGain = 23;
int eloBounce = (int) Math.round(Math.random() * maxEloToGain));

This is what i have so far, it works nicely but I don't know if i can balance it more

torn shuttle
#

tf

ClientboundUpdateMobEffectPacket clientboundUpdateMobEffectPacket = new ClientboundUpdateMobEffectPacket(id, new MobEffectInstance(MobEffects.INVISIBILITY, Integer.MAX_VALUE, 0));

        ((CraftPlayer) player).getHandle().connection.send(clientboundUpdateMobEffectPacket);

[05:51:07 WARN]: java.lang.NoSuchMethodError: 'void net.minecraft.world.effect.MobEffectList.<init>(net.minecraft.world.effect.MobEffectList, int, int)'

How did that even happen

#

am I doing something dumb here because the method does exist and it is public

#

am I tripping?

quaint mantle
torn shuttle
#

did you see the screenshot that shows the method?

quaint mantle
#

Big difference

torn shuttle
#

...which is how I'm using it?

#

which part of this isn't a method

#

that I am doing incorrectly

quaint mantle
#

I mean i've reviewed your code

#

I dont know.

#

It looks like when you pass in MobEffects.INVISIBILITY that could be your issue

#

Your calling a different constructor then the one in image

torn shuttle
#

it isn't, I tried that as a standalone and it works

#

it ceases to work the moment I try one of the initializers that takes more than one argument

#

doesn't work

quaint mantle
#

Im not familiar with API you are using, I think its Forge?

torn shuttle
#

it's nms

#

with mojang remappings

quaint mantle
#

Oh.. for 1.20?

#

Try passing in new MobEffect()

torn shuttle
#

this one specifically happens to be 1.19.4 but I'm supporting 1.18-1.20

quaint mantle
#

Idk if MobEffect is a class

torn shuttle
#

but MobEffects.INVISIBILITY works

quaint mantle
#

Oh that returns a MobEffect?

torn shuttle
#

and it's the same requirement on every initializer

#

like I said the first one works but none of the other ones do

quaint mantle
#

Like what do the two ints mean

torn shuttle
#

duration, amplifier

#

which is why the first one is useless

quaint mantle
#

Hmm..
What doesnt work?

torn shuttle
#

it throws the error I posted

quaint mantle
torn shuttle
#

which doesn't make sense

#

it's like I'm not looking at the right api but I know I am

quaint mantle
torn shuttle
#

I mean I don't think I'm tripping, even the mappings website sees these

quaint mantle
#

Try that

#

From what im reading that would work

torn shuttle
#

that is exactly what I was testing

quaint mantle
#

Try and see, should be good now

torn shuttle
#

now?

#

compared to the 20 times I already did it?

#

actually no I take that back because you use mobeffect which is not even a class

quaint mantle
quaint mantle
#

Oh i asked you that before you didnt say anything, my bad

quaint mantle
#

Where are all of those constructors

torn shuttle
#

rather mobeffect is not instantiable

quaint mantle
#

Lol okay

#

Its not your code bro

#

Its definitely your server

#

U need to use same version in your project as you do on your server.

#

Thats why you get NoSuchMethod error

#

The version of Spigot on your server does not contain this method

#

I have a feeling this is the issue, because I had same problem the other day when I was working with NBT stuff

#

Instead it was NoClassDefFoundError

quaint mantle
torn shuttle
#

so it's definitely not the server software, I just tested on paper and spigot

#

but there is something really weird I just noticed, MobEffects is decompiling for 19_R3 which is correct but when I try to decompile a MobEffect from that page it decompiles a 18_R1 class, how is that even possible

#

has anyone ever seen something like this happen?

#

although when I just do invisibility it works so that shouldn't be the issue

#

what the hell is up with this

sullen marlin
#

You don't need nms for this

torn shuttle
#

unfortunately the entity only exists in packets so it can be fully async

#

so unless there's some api feature I am unaware of I do need to figure out how to apply this potion effect the hard way

#

it's for freeminecraftmodels so that the custom model overlay can be run in async, people keep requesting that feature pretty much every day

#

any hints?

#

this one also doesn't work

sullen marlin
#

Idk about packet entity

torn shuttle
#

the general idea is just that an entity can't be async but theoretically you can kinda abstract it away from the game and just send packets

#

uh... it started working?

proud badge
#

Which one is fired on InventoryClickEvent?

torn shuttle
#

kinda, not really but I think that's because i'm doing it on the same tick

proud badge
#

Since theres no blocks or airs in here

proud badge
#

not .getAction

torn shuttle
#

this is kinda weird, I got it to at least run correctly but the effect is not working

#
((CraftPlayer) player).getHandle().connection.send(clientboundContainerSetContentPacket);

        Bukkit.getScheduler().scheduleSyncDelayedTask(NMSManager.pluginProvider, () -> {
            ClientboundUpdateMobEffectPacket clientboundUpdateMobEffectPacket = new ClientboundUpdateMobEffectPacket(
                    id, new MobEffectInstance(MobEffects.INVISIBILITY, Integer.MAX_VALUE, 1));
            Bukkit.getLogger().info("it should be invisible 3");

            ((CraftPlayer) player).getHandle().connection.send(clientboundUpdateMobEffectPacket);
        }, 60);

it runs but it doesn't modify anything, ideas?

fossil axle
#

Hello, I’m working on a plugin for which I need to get the best type of tool for one specific block. How do I do this? Without checking for all blocks and their tools manually.

lost matrix
#

Including enchantments etc

#

Ill just assume thats what you want.
Paper has a ItemStack#getDestroySpeed(BlockState) method.
For Spigot you need NMS because it is currently not exposed in the API.

quaint mantle
#

how would i get the JumpVelocityMultiplier of a block

lost matrix
quaint mantle
#

well, when you jump on a honey block you jump low, but when you jump on stone you jump normally

lost matrix
#

What prevents you from checking if a player jumped from a honey block then?

quaint mantle
#

there are more blocks like that probably but honey block is first i think of

#

and just in case minecraft adds any other blcoks like that

rough drift
#

there are not

#

fair enough

dreamy plank
#

My friend's message looks like this; (muted playername): hi how can I fix this?

devout pivot
#

I dont know anything about plugin development. theres a plugin i want to use but it isnt up to date. the last version it was updated to was 1.19 and I want to know how much do I have to learn to update that plugin on my own

rough drift
#

?services maybe?

undone axleBOT
devout pivot
#

anti farm

drowsy helm
#

Does his name show up as muted playername

dreamy plank
#

Yeah and in grey instead of the prefix I want

drowsy helm
#

Itll be another plugin doing that

dreamy plank
#

But he can see my message how I want it

drowsy helm
#

Youll have to go through all of them ans figure out which one

dreamy plank
#

Even if I don't have OP

drowsy helm
#

Doesn’t change the fact that it’s a plugin

#

Youll just have to figure out what is doing it and disable it

dreamy plank
#

Okay

fossil axle
drowsy helm
#

Pretty sure threre was a magic numbers utility for it right?

lost matrix
fossil axle
#

Ok

dreamy plank
drowsy helm
torn shuttle
#

oh I think the effect might actually have been working but this is not how it's supposed to function

fossil axle
lost matrix
fossil axle
#

I honestly don't even know where I see which version I use, other than when creating the plugin

lost matrix
#

In your pom.xml usually (When using maven)

fossil axle
#

<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>

#

You mean this?

chrome beacon
#

Yeah

fossil axle
#

I don't know what I did earlier but now it works perfectly. Thanks for the help

lost matrix
torn shuttle
#

uh oh how does entitydataaccessor even work

mighty gazelle
#

repositories {
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}

dependencies {
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
annotationProcessor("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
compileOnly("org.bukkit:bukkit:1.20.1-R0.1-SNAPSHOT")
annotationProcessor("org.bukkit:bukkit:1.20.1-R0.1-SNAPSHOT")
}

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}

Why it doesn't work?

The Error:
Execution failed for task ':compileJava'.

Could not resolve all files for configuration ':compileClasspath'.
Could not find io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/io/papermc/paper/paper-api/1.20.1-R0.1-SNAPSHOT/maven-metadata.xml
- https://repo.maven.apache.org/maven2/io/papermc/paper/paper-api/1.20.1-R0.1-SNAPSHOT/paper-api-1.20.1-R0.1-SNAPSHOT.pom
- https://oss.sonatype.org/content/repositories/snapshots/io/papermc/paper/paper-api/1.20.1-R0.1-SNAPSHOT/maven-metadata.xml
- https://oss.sonatype.org/content/repositories/snapshots/io/papermc/paper/paper-api/1.20.1-R0.1-SNAPSHOT/paper-api-1.20.1-R0.1-SNAPSHOT.pom
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/io/papermc/paper/paper-api/1.20.1-R0.1-SNAPSHOT/maven-metadata.xml
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/io/papermc/paper/paper-api/1.20.1-R0.1-SNAPSHOT/paper-api-1.20.1-R0.1-SNAPSHOT.pom
Required by:
project :

Possible solution:

lost matrix
#

This has been answered already

mighty gazelle
#

?

#

It not work

lost matrix
#
  1. You are using the wrong repository
  2. Neither bukkit nor paper are applicable as annotation processors
  3. Importing bukkit together with paper is rather useless
mighty gazelle
#

So?
repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}

dependencies {
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
compileOnly("net.luckperms:api:5.3")
annotationProcessor("net.luckperms:api:5.3")
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
}

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}

lost matrix
#

Nope. You are still using the spigot repository but importing paper.

#

Also luckperms is not an annotationProcessor

mighty gazelle
#

What is annotationProcessor("") ?

lost matrix
#

Its used by your IDE to preprocess compile annotations before compiling.
You should not worry about that.
compileOnly is all you should need for the beginning.

mighty gazelle
#

Okay

torn shuttle
#

where should I check for data related to datawatchers?

#

oh I think I was looking for the entity metadata format

lost matrix
# mighty gazelle Okay

Pls read a setup guide for either spigot or paper.
They both have official guides for setting up a project and compiling it.

mighty gazelle
#

Okay Thanks @lost matrix !

#
    mavenCentral()
    maven("https://oss.sonatype.org/content/repositories/snapshots")
    maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
    maven("https://oss.sonatype.org/content/repositories/central")
}

dependencies {
    testImplementation(platform("org.junit:junit-bom:5.9.1"))
    testImplementation("org.junit.jupiter:junit-jupiter")
    compileOnly("net.luckperms:api:5.3")
    compileOnly("org.spigotmc:spigot:1.20.1-R0.1-SNAPSHOT")
}

java {
    toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
#

It works not more

lost matrix
mighty gazelle
#

What is NMS?

late sonnet
lost matrix
#

This is a clear no then.

#

Use spigot-api instead of spigot

#
compileOnly("org.spigotmc:spigot:1.20.1-R0.1-SNAPSHOT")

->

compileOnly("org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT")

Probably want to update to 1.20.4 as well

mighty gazelle
#

It works.... Thanks 7smile7!

fossil axle
#

So now my plugin is working but it's causing a big error. Is there some way to post it here?

#

Can anyone help?

warm mica
#

You didn't click on a black whereby it returns null

fossil axle
#

Oh

#

Would it be solved if I just checked before the code that it isn't null?

warm mica
#

Yes, that would fix the error

fossil axle
#

Ok, thanks

warm mica
#

You're welcome

eternal night
#

?blockpdc

undone axleBOT
eternal night
#

?morepdc

undone axleBOT
eternal night
#

?pdc

fossil axle
# warm mica You're welcome

I added this if (!e.getClickedBlock().equals(null)){CODE} but now it's complaining about the return value of event.getClickedBlock being null

#

Did I check the wrong way?

eternal night
#

you do null checks with == null

#

.equals(null) makes no sense

fossil axle
#

Oh

eternal night
#

you'd be trying to call the .equals method on null

fossil axle
#

oh

eternal night
#

which would lead to a null pointer exception

fossil axle
#

I'm not fully awake yet I guess

fluid river
#

yo guys

#

How can i sync this

#

that's a pretty normal situation for real life i guess
i can probably start quest like "Return knife to it's owner" for p2
and when he completes it, i remove the knife quest from p1 with message like "Cancelled BringMeMyKnife since other player passed it"

lost matrix
fluid river
#

is that actually a good solution

#

i avoid collecting the knife if quest wasn't started at all

#

i just spawn it in random chest on the map when somebody takes the quest

lost matrix
#

Why wouldnt you let each player have his own quest? Is this a first come, first serve quest that can only be done once?

fluid river
#

just as a test project

#

World is controlled by server, so every action is displayed for both players

#

so if one passed the quest like "KILL THIS GIANT MONSTER WHO IS ONLY 1 IN THE WORLD"

#

second player can't kill him again since it's breaking the world story

lost matrix
#

Alright. Then why are there two knifes to begin with?

fluid river
#

there is only one

lost matrix
#

What... Let me read your problem again

rapid pelican
#

Why would the knife spawn in the dungeon if the quest didn't start?

rapid pelican
#

I get it

eternal oxide
#

Don;t spawn it at all. Only spawn it upon opening a chest with the quest active.

lost matrix
eternal oxide
#

easy to add to the chest contents when opened

fluid river
#

so second player won't be able to get it at all this way