#dev-general

1 messages ยท Page 177 of 1

dusky drum
#

dont you see hitbox on screenshot

#

it even pushes me back if i try to get into tthat hibox

jovial warren
#

you must have a glitched slime then

dusky drum
#

no it happens everytime i spawn it with packets

jovial warren
#

because the mini ones don't have big hitboxes like that

dusky drum
#

thats why im confused if i spawn it using spawnegg its normal if i spawn it using packets its like that

jovial warren
#

ยฏ_(ใƒ„)_/ยฏ

prisma wave
#

@dusky drum there is probably a "state" or "data" field in the entity packet that you haven't sent

dense belfry
#

where can i post a question about bungee? ๐Ÿ˜„

jovial warren
#

and also, just a general tip, don't ask to ask ๐Ÿ™‚

dense belfry
#

thanks ๐Ÿ˜„

jovial warren
#

you're welcome

jovial warren
#

(.*?)(<([^ ]*)(.*?)>(.*?)<\/\\3>)(.*) anyone got any idea what this regex is likely to be for?

#

@heady birch you'll be the most likely to know since it's your regex

#

but I'm terrible with regular expressions lol

vestal mist
#

Any graphql developers in here

jovial warren
#

you kinda asked for that ngl

vestal mist
#

just trying to get minetax up

jovial warren
#

fair enough

#

that's a nice offer you got there

winter iron
#

A question about web development, how do I have a "template" in html and then replace data with placeholders in that template before displaying it. I assume there is use of javascript or possibly other scripting languages to do this?

jovial warren
#

sounds like something you'd need to do with JS

winter iron
#

would it be possible with Python too since you can do web stuff with it?

jovial warren
#

you can't use Python for your frontend silly

winter iron
#

oh yeee

jovial warren
#

also Python is trash as a backend as well

winter iron
#

i forgot about that

#

lmao

jovial warren
#

just... don't use Python for this sort of stuff lol

winter iron
#

Ok

jovial warren
#

Python good for small projects that ya kinda just throw together, but things where performance matters is where Python lacks

onyx loom
#

need to do a project for school which involves html / js / php. would it be worth me picking up webstorm for it or just use IJ?

winter iron
#

webstorm is really nice

#

i cant lie

onyx loom
#

yea i feel like trying it out

#

and might do some web development in the future so

winter iron
#

its really easy to deploy web stuff with it

#

and its just clean to use for debugging

jovial warren
#

yeah webstorm is really, really good

#

I'd suggest to use WebStorm because I find using separate IDEs for separate platforms helps you distinguish between projects easier

onyx loom
#

hmm true

#

ig ill pick it up then ๐Ÿ™‚

jovial warren
#

no matter how many times @prisma wave says "just use IntelliJ", just ignore him, it's just one of the things he says that is proper wack lol

winter iron
#

Especially with a name like that

onyx loom
#

everything is wack about bm

winter iron
#

I'm not sure he is mentally stable

onyx loom
#

tellin me to use clojure ๐Ÿ™„

#

i tell him to f off

jovial warren
#

^ yeah that's wack lol

prisma wave
#

Damn

#

Haters round every corner

onyx loom
#

๐ŸŒ

prisma wave
#

Can't trust anyone these days

onyx loom
#

full moon hates u too

prisma wave
#

good

#

I hate it

onyx loom
#

๐ŸŒš

#

what about new moon?

prisma wave
#

new moon is chill

#

They can stay

#

They will have to share with clojure moon though

old wyvern
#

๐Ÿคฎ

prisma wave
#

Oh wow

#

Another hater joins the club

#

They hated GroovJureScaLinJava Mitten because he told them the truth ๐Ÿ˜”

onyx loom
#

what truth

prisma wave
#

Idk

#

Something really cool

#

I was gonna pull the clojure joke but that's getting stale

#

Anyway

onyx loom
#

good ๐ŸŒ

prisma wave
#

$40/hour ???

onyx loom
#

no

#

15-40

#

so its 15 ๐Ÿ™‚

prisma wave
#

Ah true lol clojuremoon

onyx loom
#

i mean still tho

#

i wouldnt mind taking 15/hour

#

especially at our age

prisma wave
#

Yeah 15 is very good

#

Especially since minimum wage is like 4.50 lol

onyx loom
#

ya

prisma wave
#

20 secondary developers

#

They must have an insane budget

onyx loom
#

might have to learn js just to take this offer up ๐Ÿ˜ณ

#

js is always great to know

prisma wave
#

very useful

#

JS is easy anyway

#

probably the easiest language to learn imo

#

Apart from python perhaps

old wyvern
#
They hated GroovJureScaLinJava Mitten because he told them the truth pensive```
Wait what did I do? ๐Ÿ‘€
prisma wave
#

๐Ÿคฎ
@old wyvern

#

hater

#

๐Ÿ˜”

old wyvern
#

Oh ๐Ÿ˜‚

#

Yes PlusOne

prisma wave
#

I walk a lonely road

old wyvern
#

๐Ÿ˜‚ ๐Ÿ˜‚

jovial warren
#

You'll never walk alone

old wyvern
jovial warren
#

PlusOne to anyone who gets that reference (and no, I'm not a fan if you understand the reference)

remote goblet
#

@prisma wave its official, i hate your library

old wyvern
#

Liverpool song?

#

idk

remote goblet
#

putInJar 'dependency' ez

#

makeJarSmall()

old wyvern
jovial warren
#

How did you find that lol

old wyvern
#

Black magic

onyx loom
#

thats cool

jovial warren
#

Oof

old wyvern
#

๐Ÿ˜‚

jovial warren
#

Forgot that even existed lol

woeful sigil
#

gogle

regal gale
#

Jesus christ.. the nms block handling looks hardcoded as hell

dusky drum
#

if anyone has any good way of doing this

#

nvm

heady birch
#

text<text key=value>text</text>text

dusky drum
#

Holodisplays just doesnt do it the proper way.

#

it cuts the text

#

and i dont

hot hull
#

Make sure you release that plugin Gasper fingerguns

dusky drum
#

i mean

#

i edit packets of HD

#

and set custom text

#

gotta figure out how to get the name of that

#

problem is i can only get json

#

and i cant colorize json

heady birch
#

what are you using protocol lib?

dusky drum
#

??

#

i use it like you do in your HoloExtension lul

hot hull
#

Gasper, nah handle everything yourself fingerguns

dusky drum
#

die

#

if niall doesnt then i dont hav eto

heady birch
#

does the HD dev add hex colours yet

dusky drum
#

no idea

#

thats the issue

#

if he added them that would be nice

#

but no

heady birch
#

eh im gonna write my own hologram plugin at some point

dusky drum
#

same

#

packet BASED

jovial warren
#

Ah okay @heady birch , also you gonna be on today? lol

#

Because I've got way, way more questions xD

hot hull
#

Okay so I was thinking of having something like a MessageResponse after an event has fired (ie. join), which would contain all the executed format information (which format was used, etc). Now i'm wondering if it would make sense to have something like a ResponseListener which a user can implement and would grant them a onResponse sort of an "event" so they could access that. Would that make sense, or does anyone have any better suggestions?

cough @quiet depot ๐Ÿ˜ cough

heady birch
#

maybe

jovial warren
#

Okay good

empty flint
#

Which files in the project do I have to add to the repository and which ones get auto-generated when importing a project?

#

like do I need the .gradle, gradle, .idea, and build folders?

#

what about gradlew etc...

hot hull
#

@quiet depot :((

quiet depot
#

@empty flint you want to push gradle/, gradlew, and gradlew.bat

#

.gradle, and build/ shouldn't be pushed. .idea usually doesn't need to be pushed, this isn't always the case tho

#

@hot hull sounds fine

#

MessageResponse isn't a good name tho

#

as I assume messages aren't the only thing frozenjoin can do on join

hot hull
#

Well it can do anything basically

#

ActionResponse perhaps?

quiet depot
#

do you have some sort of object that holds an individual join action?

#

I'm thinking Multimap<ActionType, Action>

#

which is held in your response event

hot hull
#

That might be smart to do yea, so the user already receives processed data

quiet depot
#

actiontype being like

#

message

#

sound

#

etc

hot hull
#

yeye

hot hull
#

Now I'm debating whether I should rewritte my action lib in java ;((

prisma wave
#

Why

hot hull
#

wdym why..

#

I can't access it from kotlin

prisma wave
#

are you sure

hot hull
#

no

prisma wave
#

ok

#

Problem solved then

#

although iirc it could be an issue with your gradle configuration

hot hull
#

Well I can access it all fine and dandy within a java class, just not kotlin so I don't know GWcmeisterPeepoShrug

prisma wave
#

Send buildscripts

heady birch
#

everyone making libs nowadays

#

give me a lib to make

quiet depot
#

give me a lib to make
@heady birch make a lib that takes full control of code execution in the jvm

#

everything on a single thread

#

every line executed one by one

#

with a configurable interval in between

heady birch
#

wha

quiet depot
#

that's what we all need

#

that's what everyone wants

prisma wave
#

make all of the bukkit API thread safe

#

By making wrappers that just add synchronized to everything

#

Ez

quiet depot
#

that already exists

#

it's called HOSE

heady birch
#

Yo

quiet depot
heady birch
#

Can you make gradients in a github WIKI?

#

CSS?

#

instead of me making a loada images

prisma wave
#

Oh my god

#

Does it really just make everything synchronized

quiet depot
#

yes

#

and uses thread safe data structures instead of non thread safe structures

#

for paper, we have torch

#

same thing

#

just paper instead of spiglet

heady birch
#

update no you cany

prisma wave
#

lmao

quiet depot
#

it's 200 iq

prisma wave
#

Huge brain

quiet depot
#

ginormous

hot hull
#

Ayy Piggy

BUILD SUCCESSFUL in 28s

quiet depot
#

yay

jovial warren
#

@heady birch what's the createAnimation method for PulseAnimation?

#

because I got some really wacky decompiled code lol

heady birch
#

one massive switch case

jovial warren
#

yeah I thought that's what it was, isn't it more than one though?

heady birch
#

no only 1

jovial warren
#

ah okay

hot hull
#

Piggy, would it make sense to make my own Listener thingy so I can manage both spigot and bungee listeners (as well as any custom ones) myself, (Instead of having like 3 different things for them)?

quiet depot
#

yes and no

#

don't make your own

jovial warren
#

lemme show you what kinda wack I got from the decompiler first @heady birch lol

quiet depot
#

but yes you should use a platform independent one

#

anyway

#

guava has you covered

jovial warren
quiet depot
#

what kind of shitty decompiler are you using lol

jovial warren
#

that came from luyten

heady birch
#

oh my

quiet depot
#

try cfr

heady birch
quiet depot
#
heady birch
#

look like tis

jovial warren
#

repeated code lol

#

also why do I have an n variable I wonder

#

I have it in a few places

hot hull
#

Piggy waiting for chrome to open so I can read up on the EventBus, in the meantime, I was thinking this would be the structure ish

bungee:
  events:
  - Handshake Event
  - Disconnect Event
  - etc.

spigot:
  events:
  - Join Event
  - Quit Event
  - etc.

Then I'd have either some sort of listener implementation, because the goal would be that the bungee version only provides the events (fires them), and things still get handled trough the spigot version

quiet depot
#

wat

#

no

jovial warren
#

Chrome ew

quiet depot
#

your common subproject should have abstract join & quit events

#

which are called from bungee & spigot

#

the handling is in the common project

#

not spigot or bungee

jovial warren
#

yeah I was thinking that

#

is there a way to do that though?

quiet depot
#

yes

jovial warren
#

like how would you call them using event handlers?

quiet depot
#

guava has as event api you can use, called eventbus

jovial warren
#

ah okay

quiet depot
#

you just make the event classes

#

and call them from spigot/bungee with the relevant data

#

then listen to the events in the common

#

also bardy idk if u saw my message before

#

but look into cfr, because it's arguably a better decompiler than procyon

jovial warren
#

also @heady birch , in AnimationContext, what is the String method called?

#

@quiet depot okay yeah will do

dusky drum
heady birch
#

gettext

jovial warren
#

so I did get it bang on then yay

heady birch
#

gasper

#

better PR hext with this

dusky drum
#

yes?

#

pr?

jovial warren
#

that ain't an addon to something Niall

hot hull
#

Interesting Piggy

quiet depot
#

it's not that interesting

jovial warren
#

also can I show what I've got in the API package @heady birch ?

quiet depot
#

it's the most straight forward solution

heady birch
#

yes

quiet depot
#

honestly, and please take no offence, I've got no idea how you came up with yours

jovial warren
#

well, not package, module lol

hot hull
#

I have a very smooth brain Piggy fingerguns

jovial warren
dusky drum
#

howly fk

quiet depot
#

gasper?

heady birch
#

Decent yeah

jovial warren
#

oh and also, the placeholder API is coming together somewhat as well

heady birch
#

nice

#

i mean

dusky drum
heady birch
#

if you got improvements suggest

jovial warren
#

I swear I'm gonna end up with a better project than the original lol

quiet depot
#

yo niall what happened to the ecloud

heady birch
#

because the only reason I holding back is its probably not great

#

lemmo happened

jovial warren
#

what's not great?

quiet depot
#

wym

heady birch
#

animation api and placeholder

#

can probably be improved

#

and i dont like changing stuff, after releasing it to the API

jovial warren
#

as I said, animation API is still a W.I.P, I just put that in there because I wanted a skeleton to build on to

heady birch
#

if you see what I mean

jovial warren
#

yeah fair enough

quiet depot
#

niall wym lemmo happened

heady birch
jovial warren
#

the placeholder API is still W.I.P as well because I literally added that last night

heady birch
#

seperated frontend&backend

jovial warren
#

yeah ik that's what you got in there

heady birch
#

i mean its good but i have no idea

jovial warren
#

also I want to abstract with the events as well

#

if possible, I'd like for the API to be pretty much entirely standalone

heady birch
#

what you mean?

#

by abstract events

jovial warren
#

have Bukkit handle them in the common module rather than the API module, relieving the API module from the dependency on Bukkit

heady birch
#

yeah

#

that would be nice

jovial warren
#

I'm really going for an interface-only kinda approach to this API

heady birch
#

and tbh one of things annoy me with the animations

#

i cycle through the frames then regenerate them

#

because of the damn placeholders

#

ofcourse it checks if its neccesarry first

jovial warren
#

that sounds like it can get quite performance intensive and also sounds like it can be improved somehow

#

as I said, still W.I.P, I'll see what I can do lol

hot hull
#

Piggy so if I'm understanding this (not sure if I am),
I'd have something like this

class SomeListener : Listener {
  
  @EventHandler
  @Subscribe
  fun onSomething(event: SomethingEvent) {
    // Some code
  }
}

Or am I missunderstanding this completelly?

quiet depot
#

idk

#

I haven't used eventbus in yonks

jovial warren
#

if that's in your API module then no

#

unless @EventHandler comes from Guava and Bukkit lol

#

ยฏ_(ใƒ„)_/ยฏ

hot hull
#

Bardy, shush right now, Ignore me fingerguns

#

All you're gonna do is confuse the shit outta me

#

Okay so yea the Subscribe annotation is a substitutor for an interface, ie. Listener

jovial warren
#

hold on, say if I had an event that's an interface that's implemented in the common module where the implementation extends Event, and I register the event properly, now say if someone was to use that event from the API, if they made something like this: ```java
@EventHandler
fun handleMyEvent(event: MyEvent) {

}
```where MyEvent is the abstracted event from the API, would that still work since the implementation extends Event?

#

or do I still not fully understand how interfaces work lol

steel heart
#

Now thats java but whatever

jovial warren
#

converting to Kotlin from Java is easy though

steel heart
#

^

jovial warren
#

also am I the only one here who calls their event handler methods handleSomethingEvent instead of onSomethingEvent because it makes more sense as I'm handling the event? Just curious lol

steel heart
#

I have never thought of which one is the best

hot hull
#

Well in my case I'm just calling another event from those

steel heart
#

Particularly speaking Bard, onSomeEvent is shorter

jovial warren
#

yeah but for me, using the word handle makes more sense

steel heart
#

I mean both makes quite the same sense?

jovial warren
#

I mean, I guess?

hot hull
#

I mean does it really matter?

jovial warren
#

not really

#

I was just curious lol

steel heart
#

It does matter because on is shorter in terms of length compared to handle

jovial warren
#

also @heady birch , I thought what might also be cool with some of the interfaces in the animation API is to turn them in to @FunctionalInterfaces where they only have a single method, for example: InterpolationStrategy's interpolate (or whatever you called it lol)

#

because being able to make a lambda from that is kinda handy

steel heart
#

yes we love functional interfaces

jovial warren
#

in Kotlin we just have higher-order functions so we don't really need them all that much

steel heart
#

yh Ig

#

Although Java doesn't

quiet depot
#

@jovial warren you're not handling the event though

#

handling would imply you're calling it

#

you're merely listening to it

jovial warren
#

very true

quiet depot
#

therefore, onEvent is the convention

jovial warren
#

didn't think of that

quiet depot
#

@hot hull also sorry I was afk

jovial warren
#

but you'd still be handling it because you don't pass it on (actually that's BS), you handle what happens when it gets called

quiet depot
#

guava's eventbus doesn't have a listener interface

hot hull
#

No worries, I'm reading this, but I'm sort of lost

quiet depot
#

at least I assume that's the case

hot hull
#

How would I listen to the event bus?

quiet depot
#

Listener (common):

public final class ChatListener {
    @Subscribe
    public void onChat(@NotNull final ChatEvent event) {
        if (event.getMessage().equalsIgnoreCase("beep boop")) {
            System.exit(0);
        }
    }
}```
Registration (common):
```java
public void start() {
    blah(); // fill vending machines
    blah2(); // dust counters
    blah3(); // change the date
    blah4(); // flip the door sign
    blah5(); // ensure there's toilet paper in the stalls
    blah6(); // open the gates
    eventBus.register(new ChatListener()); // register chat listener
}```
Spigot/Bungee:
```java
public final class ChatListener implements Listener {
    @EventHandler
    public void onChat(@NotNull final AsyncPlayerChatEvent event) {
        eventBus.post(new ChatEvent(event.getSender(), event.getMessage()));
    }
}```
#

I deducted all of that from the example on the page I linked earlier,

// Class is typically registered by the container.
class EventBusChangeRecorder {
  @Subscribe public void recordCustomerChange(ChangeEvent e) {
    recordChange(e.getChange());
  }
}
// somewhere during initialization
eventBus.register(new EventBusChangeRecorder());
// much later
public void changeCustomer()
  ChangeEvent event = getChangeEvent();
  eventBus.post(event);
}```
#

it may be wrong

hot hull
#

Yea I saw that, but wasn't sure how exactly you "listen" to them

#

I'll play around with it, much thanks

quiet depot
#

first code block is how you listen to them

jovial warren
#

also @heady birch , in PlaceholderManager, what is the method that returns String and takes a String and a final KiteUser? is it replace?

steel heart
#

BiFunction<String,KiteUser,String>

#

?

jovial warren
#

wat?

steel heart
#

I have actually no clue what you're talking about just made a wild guess lol sry

jovial warren
#
public String a(String a, final KiteUser kiteUser) {
    final Iterator<PlaceholderReplacer> iterator = this.c.iterator();
    while (iterator.hasNext()) {
        a = iterator.next().a(a, kiteUser);
    }
    return a;
}
```this is the method I got
#

I've been replacing a lot of these wack iterator thingys with foreach loops

steel heart
#

ah

jovial warren
#

c is a Set<PlaceholderReplacer>

#

and a() is a method I'm unsure of, though it's most likely replace

steel heart
#

PlaceholderReplacer#a(String ,KiteUser)

jovial warren
#

also, updating a parameter's value as if it was a field is a bad idea right? I mean, there's a reason why Kotlin parameters have strict immutability

#

yeah @steel heart that's the method there

steel heart
#

I mean generally speaking I can't it being particularly bad

#

Although it can be confusing when later on calling it.

jovial warren
#

yeah

#

in Kotlin, all parameters are just final anyway, whether you specify it or not, and that's what I'm used to lol

#

I'm thinking it's a better idea to wrap a temp variable to store stuff in

steel heart
#

yh

quiet depot
#

I personally don't think it's bad

#

I think it's only looked down upon because it's uncommon

jovial warren
#

I can just use a StringBuilder there which makes my life easier

hot hull
#

Piggy, all the listeners should be registered in common right?

quiet depot
#

I don't think there's actually any underlying issues with modifying parameter values

#

yes

#

all the eventbus listeners

hot hull
#

yeye

jovial warren
#

or in a separate API module if you're smart lol

quiet depot
#

wat

hot hull
#

No

quiet depot
#

why tf would you register listeners in an api module

jovial warren
#

actually I stupid lol

#

I thought you meant events

#

ignore me

hot hull
#

I will fingerguns

quiet depot
#

frosty your events should be in an api subproject

jovial warren
#

^

#

and ideally, your API should be standalone

hot hull
#

I smell like this is gonna be like 3 iterations before I release it :kek:

jovial warren
#

yeah it probably is

hot hull
#

Worth it tho

jovial warren
#

yeah

#

oh I'm remembering how I register commands in my multi-module project now lol

quiet depot
#

i use my scanner for that shit

jovial warren
#

I basically use reflection to get all the subtypes of PunishCommand (the command interface implemented by all commands in the project) and create a new instance, get the name, and then set the executor lol

#

this: ```kotlin
Reflections().getSubTypesOf(PunishCommand::class.java) {
val command = it.newInstance()
getCommand(command.name).setExecutor(command)
}

#

(don't ask why it uses org.reflections, that wasn't my idea, I'm moving to kotlin reflect lol)

quiet depot
#

kotlin's reflection api isn't a replacement for org.reflections?

#

org.reflections is a classpath scanner

#

it's name is a bit misleading imo

jovial warren
#

it's even easier to do that with Spring, because in Spring, you can DI all beans that are a sub type of a specific type

#

yeah idk

dusky drum
#

does kotlin not have Iterator#remove()?

jovial warren
#

why would you need that?

dusky drum
#

well

jovial warren
#

if you call next(), it moves to the next element

dusky drum
#

ye but what if i want to remove it?

jovial warren
#

isn't that what an iterator does anyway?

dusky drum
#

no

jovial warren
#

when you move to the next element, it disregards the current element

#

actually it's not Iterator that has remove(), it's Iterable

dusky drum
#

aha

#

okay.

jovial warren
#

and Collection is a sub type of Iterable

#

and Collection is also a super type of List, Set, basically any immutable collection

prisma wave
#

ListIterator#remove

#

actually

jovial warren
#

for mutable collections, you have MutableCollection, which is a sub type of MutableIterable, which is also a sub type of Iterable, because Kotlin has built-in collection immutability (unlike cough Java cough xD)

prisma wave
#

iirc Iterator#remove is a thing too

hot hull
#

Piggy, should I have my event in my common, or should they be split up in spigot/bungee? Thinking common since that'd make more sense

foggy pond
#

How difficult is this to understand? I am struggling to find a simple way to explain what this config section does

hot hull
#

What is that path sheesh

jovial warren
#

okay, first of all, that path does not follow convention at all

#

paths are meant to be snake_case

prisma wave
#

there's no convention

foggy pond
#

In config.ymls?

hot hull
#

or atleast path-path

foggy pond
#

Wat

jovial warren
#

so it should be karma_soft_cap

prisma wave
#

but spaces in a path name seems like a bad idea

jovial warren
#

^

foggy pond
#

Bruh I legit never saw that in my life

quiet depot
#

your event class(es) should be in a separate subproject, called apifrosty

jovial warren
#

apifrosty

hot hull
#

ohhhh

jovial warren
#

seems legit lol

foggy pond
#

Like legit all config.ymls I am looking at on the list of plugins I have do it like that ๐Ÿ˜‚

hot hull
#

Bardy, best api ever ๐Ÿ˜

jovial warren
#

I dare you to call your subproject exactly that just for kicks lol

hot hull
#

Klyser, spigot plugins right? :kek:

prisma wave
#

@dusky drum it's MutableIterator in kotlin

jovial warren
#

@foggy pond then they also have no idea lol

#

@dusky drum it's MutableIterator in kotlin
@prisma wave how did I forget that lol

prisma wave
#

ยฏ_(ใƒ„)_/ยฏ

jovial warren
#

when you remember list immutability but don't remember that iterators also have immutability

foggy pond
#

The reason why I have spaces and no camel case is just for ease of readability, I don't care much if it follows conventions in this case but more that it is easy to read and understandable

#

Either way, nobody answered my question about whether the comment is hard to understand

jovial warren
#

spaces are not recommended, but eh

#

and yeah that comment is a bit much

foggy pond
#

Yeah but I have no idea how else to explain it

dusky drum
#

how do i make static methods in kotlin is it companion object?

jovial warren
#

yes and no

#

you can make methods that can be called from a singleton with the companion object

prisma wave
#

favour top level functions over companion object members

jovial warren
#

if you want them to be static as well, you need to annotate them as @JvmStatic

#

but static doesn't really matter in Kotlin, it's just for Java interop

foggy pond
#

What should I do if I cannot think of a better way to write it? I don't want to remove that config section, I'd rather the user be able to customize that

jovial warren
#

ยฏ_(ใƒ„)_/ยฏ

#

I'd definitely remove the spaces in that path though

foggy pond
#

Shut up about the path name ๐Ÿ’ข

jovial warren
#

lol

#

I'm one of those people who doesn't shut up until a problem gets fixed xD

foggy pond
#

it ain't a problem in my eyes

prisma wave
#

ngl I didn't even know it was possible

foggy pond
#

I already said why I made this decision, I am aware that it is technically bad practice but I'd rather it be slightly more readable for new plugin users

#

That spaces are allowed?

prisma wave
#

yea

jovial warren
#

fair enough I guess

#

you do you lol

#

also, that comment will be fine for now

#

it explains what the thing does

foggy pond
#

The examples are somewhat necessary, maybe some day I will come up with something better

jovial warren
#

also @heady birch you sure about that regex btw? because I've put the text in that you sent and it says no match

hot hull
#

@quiet depot Should I prefix other plugin events which I've made in my plugin (ie. a RegionEnteredEvent from WorldGuard) with Frozen? So it's uniform in the api, or not?

quiet depot
#

no

jovial warren
#

there we go lol

dusky drum
#

wtf is this

jovial warren
#

wtf is what

dusky drum
#

that regex?

jovial warren
#

it is supposed to match what I put in

#

it's not my regex lol

dusky drum
#

ahah made packet based holograms

#

ez

#

with working placeholders

jovial warren
#

noice

dusky drum
#

now i just change placeholder handler a bit to make it not run every 2 ticks

#

on every single hologram even if it doesnt have placeholders

#

now i have to make simple regex to check if hologram contains placeholders or no

#

or

#

wait

#

i can do that different

hot hull
distant sun
#

is it me or spigot it's slow?

hot hull
#

Everything is moving slow for me today

#

Weather's been shit

obtuse gale
#

My intellij is still hella laggy on my mac even after a reinstall

#

also this dropbox things are kinda shit lol, you gotta actually click on the link to see the vid

jovial warren
#

wait... @quiet depot plays rust?

#

my brother plays that game

#

@obtuse gale why are you writing Integer.valueOf smh

#

"".toInt()

obtuse gale
#

idk i didnt know w hat to type and i wanted to show the autocomplete lagging

jovial warren
#

yeah I get that sometimes

#

it's just IntelliJ being IntelliJ

obtuse gale
#

this is always on my laptop tho

jovial warren
#

try increasing it's max heap RAM

#

default is 1024 I think, which is nowhere near enough

hot hull
#

Mine uses 800 and it works fine fingerguns

jovial warren
#

mine's set to 4096 lol

#

and I still get issues sometimes

obtuse gale
#

just changed to 3072 and we'll see what happens

jovial warren
#

actually nvm mine's set to 2048

#

time to set that to 8192 because yolo

#

actually I think it was already 8192

obtuse gale
#

Nope, didnt improve it at all, also cntrl + X normally just cuts a line, on this it works but it like takes 5 seconds to delete it and if you hold it down intellij lags for like 20 seconds, idk what to do lol

hot hull
#

Do you think it's overkill if I add all the bungee connection related events to FJ, or nah?

prisma wave
#

@obtuse gale updated pdm to 0.0.26, should make it a bit faster, give it a try

#

load times not compile times

dusky drum
obtuse gale
#

alright ill check it out when im on my main pc tommorow, im on my laptop rn bm

hot hull
#

kek

#

u good?

obtuse gale
#

me or gasper

hot hull
#

u

obtuse gale
#

,my hands just shifted to the right lol

jovial warren
#
        switch (KiteUserImpl$2.a[groupType.ordinal()]) {
            case 1: {
                this.g = group;
                this.a();
                this.c();
            }
            case 2: {
                this.h = group;
                this.b();
                this.d();
                break;
            }
        }
```why does luyten do this to me lol
#

@prisma wave you're good with decompiled thingys right? what does that KiteUserImpl$2 mean?

#

doesn't $ usually mean a reference to an inner class or something?

prisma wave
#

Anonymous class

jovial warren
#

anonymous class? okay

#

what is likely to be there?

prisma wave
#

An... Anonymous class?

#

Or a lambda

#

Which is just shorthand for an anonymous class

jovial warren
#

yeah but what type of anonymous class?

#

or is it impossible to tell

prisma wave
#

what type?

steel heart
#

lambdas in switches ๐Ÿ˜ฎ

jovial warren
#

ยฏ_(ใƒ„)_/ยฏ

#

not my code lol

#

@heady birch I call upon thee once again

steel heart
#

wish java 8 had it

jovial warren
#

this is Java 8

#

which means that isn't a lambda

#

if you can't have lambdas in switches in Java 8

steel heart
#

oh yh

prisma wave
#

it's not in a switch

#

it's in the expression

steel heart
#

but iirc java 14 have something like this:

switch (input) {
  case 1, 2: -> {

  }
}``` or smtng
jovial warren
#

can you have lambdas inside of switch expressions in Java 8?

steel heart
#

I don't remember

prisma wave
#

the input can be anything

#

and yeah pretty much @steel heart

jovial warren
#

ah okay

#

can you tell what type of anon class it's most likely to be or is it completely impossible?

prisma wave
#

just like

#

look at the class?

#

and wdym by type

jovial warren
#

I need to know the type to construct a lambda from it

#

don't I?

prisma wave
#

what

jovial warren
#

I don't know

#

I don't understand this whatsoever

#

I've never ever put a lambda in a switch

prisma wave
#

bruh what are you on about

jovial warren
#

in the expression I mean

prisma wave
#

just look at the class definition

jovial warren
#

you mean the KiteUserImpl$2?

prisma wave
#

yes

jovial warren
#

so the type is KiteUserImpl there

#

or an anonymous class of that?

prisma wave
#

neither

#

it's an anonymous class / lambda that was defined in KiteUserImpl

jovial warren
#

ah okay

#

is there any way to tell what type of functional interface goes in there?

prisma wave
#

just look at the contract?

#

it's not necessarily a lambda anyway

jovial warren
#

what contract

prisma wave
#

the contract of the function

#

what's the contents of KiteUserImpl$2?

jovial warren
#

contents?

#

how tf would I know that?

prisma wave
#

the code

#

with a decompiler...?

jovial warren
#

there is no lambda in here

#

or functional interface

prisma wave
#

dude

jovial warren
#

anywhere

prisma wave
#

it's a class

#

open the class

#

decompile it

#

look at the code

jovial warren
#

oh you want the contents of KiteUserImpl?

prisma wave
#

no

#

of KiteUserImpl$2

jovial warren
#

it's not in there

#

is it gonna be a separate class in the same package or what?

prisma wave
#

yes

#

lol

jovial warren
#

yeah there's nothing with the name KiteUserImpl$2 in that package

prisma wave
#

what is there?

jovial warren
#

wait lemme actually decompile it fresh instead of referencing my saved code

#

the class with the square around it is the KiteUserImpl class, I highlighted it because this is the obfuscated version

#

could luyten be doing anything here?

prisma wave
#

potentially

jovial warren
#

lemme try using that one that pig mentioned earlier

prisma wave
#

check the obfuscated code to see what it references instead

jovial warren
#

the obfuscated code references a$2

prisma wave
#

interesting

jovial warren
#

ah okay I know

#

CFR to the rescue

#

the actual code is: ```java
switch (groupType) {// GroupType is an ENUM
case SCOREBOARD:
// do thingys
}

#

apparently enums compile to anonymous classes?

#

oh of course it's an enum because it calls groupType.ordinal()

#

I should've seen that wow

#

also I guess you learn something new every day

#

@prisma wave figured it out

prisma wave
#

i see

#

probably some agressive optimisations

jovial warren
#

@quiet depot you are an actual god

prisma wave
#

afaik they don't compile to anonymous classes though

quiet depot
#

o

#

what did i do

hot hull
#

Piggy!

jovial warren
#

you recommended CFR, which knows how to decompile enum switches properly

quiet depot
#

o

jovial warren
#

using luyten I got this: java switch (KiteUserImpl$2.a[groupType.ordinal()]) { case 1: { this.g = group; this.a(); this.c(); } case 2: { this.h = group; this.b(); this.d(); break; } } but with CFR, I got this: ```java
switch (groupType) {
case SCOREBOARD: {
// same as above
}
case TABLIST: {
// same as above
}
}

old wyvern
#

Also, km is right, enums dont always compile to anonymous classes

#

Only when it overrides any functions

jovial warren
#

which this doesn't... ๐Ÿค”

old wyvern
#

In which case it should simply be a static final field which is assigned to an instance of the class with the normal constructor

prisma wave
#

yeah

jovial warren
#
public enum GroupType {
    SCOREBOARD("Scoreboard"),
    TABLIST("Tablist");

    private final String name;

    private GroupType(String string2) {
        this.name = string2;
    }

    public final String getName() {
        return this.name;
    }
}
```this is the pure decompiled enum from CFR
#

and luyten gives the same result

dusky drum
#

ugh i need to get brains my plugin uses like 1.6ms per tick or something what titmings say

jovial warren
#

also I never knew that compilers retained field names

old wyvern
#

Wdym?

prisma wave
#

They have to?

#

For reflection

hot hull
#

So this is what I get right now when I build the project, 4 jars, 1 for each module, how does one fusion 360 or someshit them all into 1?

jovial warren
#

@prisma wave true

ocean quartz
#

Implement them on the main one Frosty

jovial warren
#

just make bukkit depend on common for example, which depends on API, and then build bukkit and you'll get all of them bundled together @hot hull

hot hull
#

Trying

jovial warren
#

also make sure not to forget your bungee.yml and plugin.yml (something I always forget somehow lol)

ocean quartz
#

On the main build.gradle implement all modules and it should build it all into one jar

jovial warren
#

@ocean quartz that's not quite what he wants

#

afaik

hot hull
#

Well I'm still not sure what I want

#

:p

ocean quartz
#

Pretty sure it is

jovial warren
#

because FrozenJoin kinda needs a Bukkit and a Bungee version

ocean quartz
#

Why?

onyx loom
#

also make sure not to forget your bungee.yml and plugin.yml (something I always forget somehow lol)
@jovial warren thats what mc dev is for fingerguns

hot hull
#

No Bardy

ocean quartz
#

You can have all in one jar

old wyvern
#

You can have them in one jar bard

jovial warren
#

yeah ik, but how would you use Bukkit-specific features in a plugin designed to work with both?

ocean quartz
#

Two different main classes

#

One wouldn't use stuff from the other

jovial warren
#

true

#

I mean, personally I hate the idea of a JAR that does both because it makes it difficult for me personally to differentiate, but my opinion isn't something I can lay down as a fact against it

old wyvern
#

Differentiate what?

ocean quartz
#

^

jovial warren
#

differentiate between the versions of the plugin

#

because embedded in that single JAR is both a Bukkit and a Bungee version of the plugin

ocean quartz
#

I mean get the jar, stick it anywhere and run

jovial warren
#

true

#

idk

hot hull
#

Shouldn't this be all I need?

include(
        "common",
        "spigot",
        "bungee",
        "api"
)
ocean quartz
#

Hmm idk never did it like that

hot hull
#

How did you do it?

prisma wave
#

That won't shade it

ocean quartz
prisma wave
#

You should have a module that declares implementation dependencies on all of the other modules I think

#

Or just use the root module

ocean quartz
#

Don't look at the rest of that, it's pretty bad

hot hull
#

:what:

steel heart
#

Material.matchMaterial or Material.getMaterial ?

prisma wave
#

matchMaterial

steel heart
#

I only want to match precise Material names like BEDROCK etc

#

not the minecraft:bedrock and all the other stuff

prisma wave
#

pretty sure neither support namespaced keys

#

if you want an exact match, use valueOf or getMaterial

steel heart
#

yeah getMaterial won't throw the exception right?

ocean quartz
#

I think matchMaterial would be better

steel heart
#

It does like double amount of checks

#

or I mean if the string isn't found in getMaterial it tries to modify it in terms of hopefully being able to retrieve it in getMaterial again

dusky drum
#

anyone here that would help me optimize my test plugin (its realy bad code)

hot hull
#

Show

empty flint
#

Can I use lazy {...} to initialize a top-level val whose value depends on something I calculate or obtain during execution?

#

Like I have a file that I'd like to store in a top-level val. But the file location is dependent on a specified folder.

#

Is there a way to do that?

dusky drum
#

its java/kotlin

jovial warren
#

might do after I've finished with KiteBoard

dusky drum
#

kiteboard?

jovial warren
#

yeah

dusky drum
#

nice

jovial warren
#

I'm deobfuscating it (with Niall's permission) and kinda messing around with it to make it better

dusky drum
#

wtf

#

why are you even deobfuscating it?

jovial warren
#

because it's kinda fun lol

dusky drum
#

uke

jovial warren
#

idk, I = weird human being sometimes

dusky drum
#

eh i somehow cant make my plugin work faster, i guess protocollib doesnt have the fastest packet sending system?

jovial warren
#

idk, SuperVanish uses it and that's pretty fast

prisma wave
#

The level of abstraction that protocollib introduces is pretty small

dusky drum
#

ye but i mean sending packets every 2ticks to everyplayer active idk if im doing it good way

prisma wave
#

It's gonna be close to the speed of direct nms

#

If you're really concerned about performance, run a profiler

dusky drum
#

profiler?

#

i dont have money for jprofiler

jovial warren
#

you realise there are free profilers right?

dusky drum
#

yes i just relized

prisma wave
#

Jprofiler also has a free trial I believe

jovial warren
#

VisualVM is one of them

prisma wave
#

There is also one included in Java 8+ iirc

prisma wave
#

Timings isn't going to give much useful information here

#

It's way too limited

hot hull
#

Gasper, why are you sending it to every player?

dusky drum
#

every player thats in range to see hologram?

prisma wave
#

Lucko's thingy might be able to do a bit better

dusky drum
#

oh Spark?

hot hull
#

Also check if the user is facing the hologram, that should reduce a few more

dusky drum
#

isnt that another check?

prisma wave
#

Yes

#

Although probably not a particularly intensive one if you do it right

#

It depends what the lag problem actually is

dusky drum
#

its updaing (placeholder) based lines every 2 ticks

#

atm there is only 1 holo with 1 line that has placeholder and it takes quite long time

prisma wave
#

Server side lag?

dusky drum
#

yes

#

i mean it uses more cpu than HD

prisma wave
#

Reducing the amount of packets sent probably won't make a huge difference unless you significantly reduce it then

dusky drum
#

its probably my op code

#

thats garbage

prisma wave
#

Afaik sending packets (apart from the IO) is pretty lightweight

#

Like I said, run a profiler if you want really detailed information

dusky drum
#

okay any that you recommend?

prisma wave
#

Idk enough to say

#

Java flight recorder seems to work fine

empty flint
dusky drum
#

okay so how do i use profilers

#

blocky its a packet based holograms

prime mica
#

Has DeluxeChat got 1.16.2 support as of rn

onyx loom
#

#spigot-linking

dusky drum
hot hull
empty flint
#

How do I track plugin usage via bstats? Does anybody have an example?

jovial warren
#

there's a Wiki on how to do that somewhere

jovial warren
#

oof

#

wait wtf?

#

0.2 + 0.0 + 0.0 + 0.0 + 0.0 != 100

prime mica
#

#spigot-linking
@hot hull the owner of the server im on has it, i only wanna know if it has 1.16.2 so i can ask him to update, do i rly have to go all around the houses for a yes/no answer?

dusky drum
#

thats profiler

#

jprofiler

#

that top one

#

is all off tasks of entire server

#

i used search

jovial warren
#

@prime mica according to what I can see on the official Spigot page, it does indeed support 1.16

dusky drum
#

i guess that HD placeholder handler isnt realy the best to use.

#

plugin.tick updates placheolders on holograms

onyx loom
#

according to what I can see on the official Spigot page, it does indeed support 1.16
@jovial warren for 1.16.2 u need the pinned message in #deluxechat

prime mica
#

see that was the answer i needed jesus

dusky drum
prime mica
#

ill bring the owner in to get it ty

hot hull
#

I'm annoyed Gasper

dusky drum
#

220ms of that is used by wrappedchatcomponent

#

and why are you annoyed?

hot hull
#

It's an easy return and you decided to indent the entire function -.-

prisma wave
#

0.2 + 0.0 + 0.0 + 0.0 + 0.0 != 100
@jovial warren 100 is the entire process time

jovial warren
#

yeah I didn't realise he was they were (it's 2020, I don't wanna get scalded lol) in search lol

dusky drum
#

which one frosty?

hot hull
#

if alive

dusky drum
#

stfu

hot hull
#

Ne.

dusky drum
#

sendpacket uses quite a lot huh

#

so basicly most of process is used by optional ...

#

next is hexutil

#

mostly parse gradients

#

if anyone has idea how to optimize that WrappedChatComponent#fromChatMessage

#

for gradients i can limit them thats the easiest fix from them all

somber tulip
dusky drum
#

im not sure if i can put packet into packet :'

dusky drum
prisma wave
#

very nice

heady birch
#

Good job

hot hull
#

Gotta say, can't believe mojang is gae

heady birch
#

Yeah

#

Well no

#

They use json in chat

#

but who guessed people would send thousands of packets a second on some wack animated scoreboard

#

Hm @jovial warren KiteUserImpl anonymous classes?

#

most likely these:

#

rip ๐Ÿ˜”

jovial warren
#

no it was the thingy

#

the enum switch poorly decompiled

#

@heady birch

heady birch
#

Oof

#

I might open source by end of this month

jovial warren
#

yeah that would be good

frail glade
#

What, KiteBoard?

heady birch
#

Yeah perhaps

frail glade
#

Oooo

hot hull
#

Nono Niall, not the topic I was implying

jovial warren
#

once I'm finished can I upload to a private repo or something to show you what I got?

heady birch
#

yeah sure

jovial warren
#

okay cool

heady birch
#

or actually zip it up and send it to me

#

@frail glade Do you think thats a good idea?

frail glade
#

Hmm?

heady birch
#

Open sourcing

#

Like the TAB guy did it

frail glade
#

I think it's a personal preference but it might allow more people to contribute to it.

jovial warren
#

yeah I'll zip it and send it when I'm done

#

I say open-sourcing is a brilliant idea, but I'm very biased as I'm a massive fan and backer of open-source

frail glade
#

I don't think it'll drop your sales or anything.

heady birch
#

give it a week

#

KiteBoardX [IMPROVED] 19.99$

jovial warren
#

hey btw, can you tell me what the replace string is in AboutCommand? @heady birch

#

@frail glade who cares about sales am I right xD

old wyvern
frail glade
#

I mean, I do, it helps pay for my college.

jovial warren
#

I don't care about anything that happens to my work, or any money that I make from it, because I program for fun, it's just a hobby for me

#

I mean, don't get me wrong, I love to see my work being appreciated and used, but money just isn't something I'm interested in for this sorta stuff

#

it's why I'm a fan of open-source, because it allows me to collaborate with others, which is fun, and I'm not bothered if making it open-source means I make no money

#

I'm probably one of the only programmers around here who actually doesn't care about the money lol

prisma wave
#

anyone who has expenses cares about money

jovial warren
#

true

#

I suppose I am still 15, I don't have expenses to worry about yet

obtuse gale
#

Hello, I will be making a custom difficulty for Minecraft in plugin
What price would be fair for changing 50 game mechanics

dusky drum
#

niall i mean if you shared you prfect packet handler i wouldnt mind XDD

prisma wave
#

like what mechanics?

dusky drum
#

how he can send so many packets with no lag.

#

i get 200ms

#

over time

#

like 2-3ms

#

for packets

prisma wave
#

custom serializers

dusky drum
#

see i want that XD

jovial warren
#

I haven't seen any custom serialisers in this project lol

#

wait what classes as a "custom serialiser"?

dusky drum
#

brain

jovial warren
#

@prisma wave what counts as a custom serialiser?

prisma wave
#

idk apparently he uses custom packet serializers

#

for the scoreboard packet or whatever

jovial warren
#

which plugin are we talking about here? like which one does this?

prisma wave
#

kiteboard

#

i think

jovial warren
#

KiteBoard doesn't have any custom serialisers from what I can see

#

it just makes a new packet, updates the fields reflectively, and sends the packet on to the player

#

but he chooses quite carefully when to actually send packets

#

also @heady birch do you think it would be cool if I added support for more database engines using ORM?

#

or is it not really that worth it

heady birch
#

i just dont do that load of serialising and deserialising that the tutorials say

#

they make you get a chat component like:

#

IChatBaseComponent.ChatSerializer.a("{'text':'Your text'}"); or something

#

You can literally do

#

new ChatComponentText("your text")

#

but yeah i wrote a custom implementation to speed it up

#

Also Orm, probably not

jovial warren
#

what's wrong with ORM? lol

heady birch
#

big

jovial warren
#

raw SQL is ew though

#

also @heady birch , StorageProvider has two methods that take a KiteUser, can you tell me what they are please?

heady birch
#

push and pull

jovial warren
#

okay

#

makes sense

#

and then the last one's save right?

heady birch
#

its actually onShutdown

#

saves the yaml e.g

#

but yeah save is the same thing

jovial warren
#

ah okay

#

is it only users that are stored btw @heady birch ?

heady birch
#

yeah

jovial warren
#

you got the format that they're stored laying around or am I gonna need to figure that out myself

#

I know they're stored by UUID

heady birch
#

uuid:
toggle: true/false

#

just that basically

jovial warren
#

okay that's easy then lol

#

this table's gonna be tiny lol

obtuse gale
#

Guys

#

what could be causing this?

#
   at net.minecraft.server.v1_16_R2.EntityPlayer.closeInventory(EntityPlayer.java:1381) ~[patched_1.16.2.jar:git-Tuinity-"f663f6e"]
        at org.bukkit.craftbukkit.v1_16_R2.entity.CraftHumanEntity.closeInventory(CraftHumanEntity.java:456) ~[patched_1.16.2.jar:git-Tuinity-"f663f6e"]
        at ot.dan.GameManager.Objects.Games.Types.BuildBattle.Events.BuildBattleHandler.onVoteInventoryClose(BuildBattleHandler.java:63) ~[?:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor27.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.16.2.jar:git-Tuinity-"f663f6e"]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.16.2.jar:git-Tuinity-"f663f6e"]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.16.2.jar:git-Tuinity-"f663f6e"]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.16.2.jar:git-Tuinity-"f663f6e"]
        at org.bukkit.craftbukkit.v1_16_R2.event.CraftEventFactory.handleInventoryCloseEvent(CraftEventFactory.java:1421) ~[patched_1.16.2.jar:git-Tuinity-"f663f6e"]
distant sun
#

do you open an inventory after closing it? Also, send the full stacktrance

obtuse gale
#

Well yeah I am opening an inventory when a player closes one

#

Shouldn't that be possible?

#

Oh wait this isn't the support channel my bad. But yeah that is the log can't fit it all its too long @distant sun

jovial warren
#

@obtuse gale that error only occurs when you run out of space on the stack

obtuse gale
#

But that is not caused by my plugin from what I understand ...

jovial warren
#

show the code

obtuse gale
#
@EventHandler
    public void onVoteInventoryClose(InventoryCloseEvent event) {
        if (Games.getSelected() instanceof BuildBattle) {
            if (Games.getSelected().gameState().equals(GameState.VOTING)) {
                Player player = (Player) event.getPlayer();
//                player.sendMessage("Test");
                Voting voting = new Voting(player);
                player.closeInventory();
                player.openInventory(voting.getInventory());
            }
        }
    }
}
#

I am just instantiating a new Voting object but that should be a problem

jovial warren
#

I can see the error straight away

#

that'll get caught in an infinite loop

obtuse gale
#

No its not the closeinventory

#

I already tried it without it

jovial warren
#

you got a stack trace for without?

obtuse gale
#

Yeah I got that error while having only the openInventory

jovial warren
#

also send me line 63 of BuildBattleHandler

obtuse gale
#

That was line 63

#

I think let me rebuild the plugin as is

jovial warren
#

also you realise at the state that you're opening a new inventory, the current inventory isn't fully closed yet

obtuse gale
#

Well I never had a problem opening an inventory while the other one is closing on older versions

jovial warren
#

InventoryCloseEvent is called as soon as the player presses escape to exit out of the inventory, and because this is fully synchronous, it executes your code before finishing execution of the inventory closing

obtuse gale
#

Well there isn't an InventoryClosedEvent so that is not an option

empty flint
#

lmfaoooo

jovial warren
#

actually, just cancel the close

#

that should work

#

I think

obtuse gale
#

It doesn't implement Cancellable

empty flint
#

Just started a new server and this was the first notable thing that happened on the server

[23:21:11] [Server thread/INFO]: Done (34.119s)! For help, type "help"
[23:21:24] [Server thread/INFO]: Villager EntityVillager['Villager'/82, l='ServerLevel[world]', x=-251.30, y=91.05, z=70.30] died, message: 'Villager suffocated in a wall'
#

f for the villager

obtuse gale
#
    @EventHandler
    public void onVoteInventoryClose(InventoryCloseEvent event) {
        if (Games.getSelected() instanceof BuildBattle) {
            if (Games.getSelected().gameState().equals(GameState.VOTING)) {
                Player player = (Player) event.getPlayer();
//                player.sendMessage("Test");
                Voting voting = new Voting(player);
//                player.closeInventory();
                player.openInventory(voting.getInventory());
            }
        }
    }
}
#

This is the code as is for the error

#

Line 64 is the event handler

hot heron
#

AFAIK, you have to delay the opening of the new inv

tranquil crane
#

The documentation for that event warns you not to open an inventory within it

jovial warren
#

why didn't I think of that lol

tranquil crane
#

Delay it by a tick

obtuse gale
#

Well okay I never had a problem opening it like this on older versions but got it

jovial warren
#

I might go digging through CraftBukkit an NMS code to find out why that causes a StackOverflowError

tranquil crane
#

I think opening an inventory causes it to fire the close event for the players crafting inventory

jovial warren
#

also from what I can see, the docs say nothing about not opening an inventory in the close event

tranquil crane
#

Yeah I can't find it either anymore but I swear I read something with a warning somewhere

#

If I ever find it I'll link it

jovial warren
#

I'd be surprised if it was actually documented since md_5 and the old Bukkit team are/were lazy shitbags when it came to documentation

obtuse gale
#

Well let me test it with a tick delay

hot heron
#

The warning is in inventoryclickevent

jovial warren
#

ah okay

#

yeah I see it

#

I do still wonder why that runs out of stack space though

tranquil crane
#

Ok phew knew I wasn't crazy

obtuse gale
#

Yeah anyway it works delaying it by 1 tick thanks

jovial warren
#

@tranquil crane lol

obtuse gale
#

Strange I didn't get that error ever before

tranquil crane
#

Weird that the warning would be in that spot

jovial warren
#

yeah

#

but as I said, documentation isn't one of Spigot's strong sides

#

neither is performance, or asynchronous computation, or just about anything lol

jovial warren
#

haha

#

I remember seeing once though, there was this @Deprecated method in somewhere, and the docs just said @deprecated Magic Number

#

nothing about why it produces a magic number or what to replace it with

#

because it's your job to figure that out

tranquil crane
#

Just about every getId() that's deprecated says magic number on it

jovial warren
#

yeah

#

and what do we replace them with? fuck knows lol

tranquil crane
#

excuse me discord please parse that link properly