#help-development

1 messages · Page 958 of 1

chrome beacon
#

records aren't mutable

slender elbow
#

good

hybrid turret
#

Ah right

#

I forgot

#

Lol

#

Thanks

tidal glacier
#

Anyone has minecraft but plugins which youtubers play?

smoky anchor
#

Random question, totally unrelated to anyone here
How annoying does one have to be to get banned ?

tidal glacier
smoky anchor
#

Don't tag random ppl for unrelated stuff
And do not spam this place with your question, read the pinned message from alex
Also, this is not the place to ask for this

slender elbow
#

remember cma

#

fuck

smoky anchor
drowsy helm
#

Wait cmarco is banned?

echo basalt
#

ofc

#

from here, from paper

smoky anchor
#

Even paper ? 🤣

drowsy helm
#

LOL

#

What was the nail in the coffin

echo basalt
#

no clue

#

I remember he once for banned for self-bot removing 20k messages and absolutely nuking the logs channel

drowsy helm
#

He is such a meme

echo basalt
#

Every mod prob just voted in favor of banning him or sumn idk I'm not a mod

#

I'm a plugin swagcircle

drowsy helm
#

B-b-but whos going to make enterprise grade premium plugins for the spigot community???

#

Spigot has gone downhill ever since our best coder, cmarco was banned

echo basalt
#

you should see my ambition

#

to make absolute bangers

drowsy helm
#

Dont be blasphemous

echo basalt
#

It just happens to not be profitable :(

#

or even pay for the cost of making it

#

I am cooking up a tiny tiny plugin

#

with a super overengineered uh

#

thing

drowsy helm
#

I wanna find out why he got banned lmao

tall dragon
drowsy helm
#

He never really did anything nefarious, was just really really annoying

echo basalt
#

Well

#

It depends

#

Where do you cross the line between ignorance and malice

drowsy helm
#

Im sure he was delusional enough to think he was doing good

echo basalt
#

I mean

drowsy helm
#

But he absolutely shat out plugins every week

#

100 line plugins

echo basalt
#

He was leaving 1-2 star reviews on a lot of his competitors

#

Shitting on them for seemlingly arguable reasons

#

But then failing to follow his own standards on his own work

#

And not outlining that

#

It's predatory

tall dragon
#

its so funny u go to resources. sort by most downloaded

#

and 9/10 will have a paragraph from him 😂

echo basalt
#

I'd rather laugh at mfnalex's drunk videos than meme about cmarco's fucked up attitude

drowsy helm
#

I love that he thought most plugins made him the best dev

#

Dont think anyone will ever beat inventive talent though

#

She was fucking amazing

chrome beacon
#

?

#

what happened with them

drowsy helm
#

Works for hypixel now

hybrid turret
#

Does it make sense to chache/persist a player in a db and constrain uuids in the db as a foreign key for the cached/persisted players? Basically OfflinePlayer#hasPlayedBefore ig?

echo basalt
#

P sure she wrote a blog post about using machine learning for prioritizing chat reports

#

Very likely reports get processed first

smoky anchor
#

Wait, who are you all talking about ?

drowsy helm
#

InventiveTalent

#

The developer

#

Made spiget and heaps of massive libs and plugins

smoky anchor
#

Oh that's a name...
That makes sense lol

drowsy helm
#

Some people are just super gifted with programming

echo basalt
#

And also hardworking

#

And with good timing

#

I wish I was a lil older rn

#

Only started actually writing good stuff around 2020/2021

eternal oxide
#

Never wish to be older

echo basalt
#

Well yeah but my timing's a bit late woeisme

eternal oxide
#

time passes slowly when young, but gets faster and faster as you age

echo basalt
#

At the same time things developed at the right time

gleaming grove
#

How can I get the block instacne of the inventory player is closing?

    @EventHandler
    public void onInventoryCloseEvent(InventoryCloseEvent event) {
        var inventory = event.getInventory();
        if (inventory instanceof CraftingInventory craftingInventory)
        {
            Block block = ????
            handleInventoryClose(craftingInventory);
        }
    }
echo basalt
gleaming grove
#

but how to get Block reference?

echo basalt
#

Interesting enough bukkit doesn't track that

#

And it seems like NMS barely does too

gleaming grove
#

ok I got it

      Block block = event.getInventory().getLocation().getBlock();
hybrid turret
#

What block? The crafting table? Lol

#

Oh

gleaming grove
echo basalt
#

o_o since when is Inventory#getLocation a thing

#

Also it might return null

hybrid turret
#

Returns null when it‘s not opened using a block probably

echo basalt
#

Well yeah I'm trying to figure out where it's set in nms

#

the inventory system is messy

gleaming grove
#

hmm, so for example for the Furnace or Anvil I will not get the proper location

echo basalt
#

Furnace or Anvil you might

#

But if it's a virtual crafting menu then you get the player's location

#

I'd still recommend getting the block and checking just in case

#

or seeing if it has decimals or sumn

gleaming grove
#

but what in case player is arounded by Anvils

echo basalt
#

Should still be accurate

gleaming grove
#

or just arounded by blocks that have inventory feature

#

I will try it this case later

echo basalt
#

If the type is crafting then get the block and see if it's a crafting table

#

Also see if the location returned is not null and and all the decimals are floored

#

OR

#

You can just check with nms

#

And see if it's a crafting menu and get the access n stuff

hybrid turret
echo basalt
#

The player is not the crafting table. The view just isn't linked to any block

hybrid turret
#

Metaphorically

#

I mean

echo basalt
#

So the player's location is returned because it's expected that every crafting menu has a location

tall dragon
#

is the view even really "linked" at any point? since the crafting table cannot hold the items

echo basalt
#

Uh

#

Not really no

#

the entire getLocation thing is just api

#

It has no use

#

Pretty sure it just has to do with uh

#

Breaking the table

hybrid turret
#

Makes sense tbh

tall dragon
#

yea ig

echo basalt
#

oh cool I love magic numbers

#

It's prob some sort of mask

hybrid turret
#

Ahhh yes "descriptive" variables

tardy delta
#

something happened to the font and i dont like it

heady pier
gleaming grove
#

nope

heady pier
gleaming grove
#

I've already resolved this issue

heady pier
slender elbow
#

pretty cool aye

sand spire
#

Its too late now...

quiet ice
#

That is why you do it yourself

sand spire
#

idk where to start

#

Idk if I should put each subcommand in its own method, or in its own class, but if I do that I need to do the same check 30 times

quiet ice
#

Make everything it's own class. That would be the enterprise way.
Or go the geolykt way and chuck everything in a single method and hope you abandon the project before you loose track of how the megamoth works

sand spire
#

Should the class include all the checks or only the code that should be executed if you get past the checks

quiet ice
#

That being said latter approach probably only works well enough for me as I have quite great memory and thus it takes over a year or more until I forget how a 2k+ LoSC method works

sand spire
#

i'm at 699 lines now

quiet ice
quiet ice
sand spire
sand spire
#

I'll see what I can do i guess but I'm lost in the mess

remote swallow
#

the geol method for input command

sand spire
#

i don't even know what it's doing ngl

chrome beacon
#

A lot of ASM

quiet ice
#

I like my ASM; okay

slender elbow
#

this looks like the groovy runtime except that groovy is worse

tardy delta
gleaming grove
#

Yeah, I thought the same, but holder in case of CraftingTable was Player, not the Block

wet breach
#

well crafting table doesn't have an inventory

#

the inventory that is opened is technically the player

#

therefore the holder being player

gleaming grove
#

anyway solution was event.getInventory().getLocation().getBlock()

wet breach
#

well as long as that works

gleaming grove
#

yes, there might be case when location is null

tardy delta
#

wait inventory has a location?

gleaming grove
#

😄

wet breach
#

or the event really

#

if you tried to do it from some generic event, you would need to grab the holder

tardy delta
#

hmm

wet breach
#

or attempt to cast to some appropriate inventory type

wet breach
gleaming grove
#

yes

inner mulch
#

when i have a list with 3 items and i remove index 1, will the third item then go into index 1 or is index 1 simply null?

remote swallow
#

if you have item1 item2 and item3, if you remove item1 item2 becomes 1 and 3 becomes 2

inner mulch
#

so it collapses?

#

there a no nulls allowed in lists?

#

unless indexoutofbounds

remote swallow
#

if you want nulls u'd need ur own list impl iirc

inner mulch
#

ok

lost matrix
inner mulch
#

okay thanks

young knoll
#

But when you remove something, by default the list will shrink

inner mulch
#

why is there no containsindex method :(

lost matrix
#

Because all indices in a list are 0 to N-1 with N being the amount of elements in that list.
Thats the whole definition of an index

#

So if a number is bigger or equal to 0 and smaller than N, then its an index of that list.

tall dragon
#

idk what hes tryna do. but it would work with a plain old array

lost matrix
#

idk

inner mulch
#

im working with lists

smoky anchor
inner mulch
#

they should've made it a method 😔

lost matrix
#

No def not. If you need this method then you are abusing lists.

echo basalt
#

= looks like a sad face :(

inner mulch
#

im not abusive

lost matrix
#

Because you are using them for a purpose they where not designed for.

inner mulch
#

i just dont want to get an indexoutofboundsexception

#

without always having to write this if statement

lost matrix
#

No idea what you are doing. Maybe a Map<Integer, X> is more suitable for you?

#

Wait, did discord change the font for codeblocks?

inner mulch
#

yes

tall dragon
#

ye they did

lost matrix
#

🤨

inner mulch
lost matrix
#

@echo basalt You got some time? I need someone to throw an idea against for a skill system.

echo basalt
#

uh

#

I'm going out in 15 mins

#

But I feel honored for the offer

tardy delta
#

i need to vomit

#

what is this damn font

echo basalt
#

some monospaced variant

lost matrix
#

You mean what is this damn code...

tardy delta
#

lemme just override --font-code

echo basalt
#

lemme just hack the webserver and override the font for everyone

young knoll
#

Make it comic sans

tardy delta
#

havent looked at code but it looks awful too

#

they shouldve used firacode for code snippets

#
public class Test extends A {}
lost matrix
tardy delta
#

what font even is it

young knoll
#

Source code pro

tardy delta
lost matrix
#

Are you... using discord from within your browser?

tardy delta
#

yes

echo basalt
#

just f12 isn't discord a web app in disguise

lost matrix
#

Electron

young knoll
#

You need to enable it

tardy delta
#

electron

young knoll
#

But yes

tardy delta
#

stupid electron nonsense, thats why i use web

#

only uses unnessecary ram

lost matrix
#

Coll you are on the move, right?

wet breach
young knoll
#

Im I’m bed

#

Kinda the opposite :p

tardy delta
lost matrix
#

I just need someone to criticize my approach to a skill system.

tardy delta
#

ahh way better with monospace, i doubt that overriding css sheets is permanent

young knoll
#

There’s probably an addon for that

#

Or plugin or whatever your browser calls them

tardy delta
#

extension, chromium based browser

wet breach
tardy delta
#

cant forget the gateway socket

#

its just a websocket wrapper in disguise

young knoll
#

Rust discord app when?

tardy delta
#

i tried making my own discord but that didnt end well

lost matrix
#

Lets see how it looks with highlighting

public class SkillHolderManager<C> {

  private final Map<C, SkillHolder<C>> skillHolders;

  public SkillHolderManager() {
    this.skillHolders = new HashMap<>();
  }

  public void addSkillHolder(C caster) {
    this.skillHolders.put(caster, new SkillHolder<>());
  }

  public void removeSkillHolder(C caster) {
    this.skillHolders.remove(caster);
  }

  public SkillHolder<C> getSkillHolder(C caster) {
    return this.skillHolders.get(caster);
  }

  public <T extends SkillTrigger<C>> void triggerSkills(T trigger) {
    SkillHolder<C> skillHolder = this.skillHolders.get(trigger.getCaster());
    if (skillHolder == null) {
      return;
    }
    skillHolder.triggerSkills(trigger);
  }

}
tardy delta
#

too much reverse engineering

wet breach
#

o.O

#

why would you need to reverse engineer?

lost matrix
#

Meh, i whish the generics would be better highlighted

young knoll
#

Can’t believe mobile still doesn’t do highlighting

wet breach
#

they pretty much publish all the end points in their dev section

tardy delta
wet breach
#

I will have to look at it during the weekend

tardy delta
#

theres also an api endpoint but i didnt use that

#

hmm yes

remote swallow
#

what the fuck is that font

tardy delta
#

C059

blazing ocean
#

how does it look on desktop

tardy delta
#

this one is nice

remote swallow
valid burrow
#

id rather write in russian than this

tardy delta
#

ive seen people in college code in such fonts

valid burrow
#

college aint real

#

havent been there yet

#

the chunks still need to be generated

tardy delta
#

college mostly teaches you nonsense

#

only thing they do is oop and they even praise it

ivory sleet
tardy delta
#

oh god conclure joined, now ill get critcism on that

ivory sleet
remote swallow
#

whos this conclure your talking about

remote swallow
#

conclube do you know who this conclure is

valid burrow
#

i love oop

ivory sleet
#

blud stole my entire identity

remote swallow
#

how could he steal your name if you are the conclube

valid burrow
#

ill always call you doodle bud alex from now on

ivory sleet
# valid burrow i love oop

I dont think you love oop, i think you love structural programming and procedural programming, but not the classic oop programming

ivory sleet
#

:(

remote swallow
#

nah

#

ur conclube

ivory sleet
#

ok lol

remote swallow
#

you completely missed what i was going for there

valid burrow
ivory sleet
ivory sleet
valid burrow
#

i actually think ingeritance isnt that horrible anymore

ivory sleet
#

It is

valid burrow
#

i looked at it a bit

remote swallow
ivory sleet
#

I dc’d

tardy delta
remote swallow
#

are you in sweeden now

ivory sleet
#

Yea

valid burrow
remote swallow
ivory sleet
#

The only time inheritance is good is when u dont have to inherit no state and not a lot of behavior

valid burrow
#

i think hes scared

tardy delta
#

swedish people on stream always seem to have an amusing voice \👀

ivory sleet
#

Which is like, well you’re at type inheritance at that point

ivory sleet
#

:)

remote swallow
#

going home?

ivory sleet
ivory sleet
tardy delta
#

plot twist: he drives the taxi

remote swallow
blazing ocean
#

CaskaydiaCove kinda goated ngl

ivory sleet
ivory sleet
#

but I cant buy ones on phone

#

:/

remote swallow
#

sweedish people saiyng i am the winner in english but with the like sweede accent is funny

#

bc it sounds like i am de vinner

ivory sleet
#

lol

#

thought u meant anita max wynn

blazing ocean
tardy delta
remote swallow
#

or i am de wiener

blazing ocean
#

jdh has the best voice ever

tardy delta
#

could listen hours to it

#

he always keeps using c tho 😧

tall dragon
#

it doesnt top PirateSoftware

blazing ocean
#

and the fact that he uses c + vim makes it like 10x better

blazing ocean
tall dragon
#

he really does

blazing ocean
tardy delta
#

i mean when looking at code, the first thing i look at is the theme

ivory sleet
#

Do you any of you guys use vim?

tardy delta
#

nvim

ivory sleet
#

Like religiously

blazing ocean
valid burrow
blazing ocean
tardy delta
#

wdym regiously

blazing ocean
ivory sleet
#

always* I mean

tardy delta
#

yes except for when i can use jetbrains ides in some times

#

like java and c# are the only exceptions

blazing ocean
valid burrow
#

i dont see a reason to use vim honestly

tardy delta
#

and kotlin

ivory sleet
blazing ocean
ivory sleet
#

kotlin suspend fun

valid burrow
#

like getters and setters

#

for example

tardy delta
#

minestom people dont seem to like kotlin

blazing ocean
#

intellij has great tooling

blazing ocean
valid burrow
blazing ocean
#

"K*TLIN"?

icy beacon
tardy delta
#

that also looks like i clicked java but i didnt

icy beacon
#

mostly those who have not tried it

valid burrow
blazing ocean
#

yes

tardy delta
#

correct

blazing ocean
ivory sleet
#

Wait rad, have u tried kotlin + lombok?

#

lol

icy beacon
tardy delta
#

thats like pointless :/

blazing ocean
ivory sleet
#

lmao

icy beacon
#

do you hate joy as a concept

valid burrow
#

id rather die than touch kotlin again

ivory sleet
#

wasnt it mfnalex who combined those?

icy beacon
#

what of lombok would be ever necessary in kotlin

quaint mantle
valid burrow
#

oh god i remeber having to do kotlin for spigot basics

ivory sleet
tardy delta
#

all those kotlin haters because they've never used it properly

#

kotlin has delegate as language construct

valid burrow
blazing ocean
#

what even is lombok

ivory sleet
valid burrow
#

i prefer vanilla stuff its too kinky

icy beacon
#

e.g. @getter to generate getters

blazing ocean
tall dragon
#

ive been looking into it past few days. i find it looks quite nice actually. lots of small things to reduce boilerplate

icy beacon
tardy delta
#

operator overloading hehe

icy beacon
tall dragon
#

like if (i in 1..30)

ivory sleet
#

The problem with kotlin is that its somewhat too bloated, I mean the language itself isnt bad, but its easily used wrongly, more so often than Java

tall dragon
#

stuff like that so nice

icy beacon
#

they make code pretty

tardy delta
#

return@coroutineScope 🫢

icy beacon
icy beacon
tall dragon
#

pretty sure u can also do this in kotlin if (foo and bar == "Hi") thats rlly cool too

tardy delta
#

looks like my font is even more fucked up

icy beacon
blazing ocean
icy beacon
#

wait they changed the discord code font

#

what the shit fuck

tall dragon
#

ye its agly now

icy beacon
#

oh my ghod

tardy delta
#

that return@ is always a bit cheeky

ivory sleet
tardy delta
#

just dont overruse it 🤓 could say that for every language

ivory sleet
icy beacon
#

style choice?

tardy delta
#

uh dunno most code did intellij convert

icy beacon
#

oh

#

ocp call

valid burrow
#

@ivory sleet can you learn how to do setup adsense for me

ivory sleet
#

lol

tardy delta
#

just an old plugin that i converted to kotlin

#

havent touched the api in probably more than a year

ivory sleet
icy beacon
#

google api docs make me feel extra stupid

tardy delta
#

they are just stupid

icy beacon
#

the indexed google link for the docs is outdated and there's a banner leading to a new version

#

the new version is documented very excessively except for the thing i need

#

there's some 39 step oauth required

#

and shit like that

blazing ocean
#

microsoft & hp support pages are worse
only 404s

valid burrow
ivory sleet
#

pain

tardy delta
#

average experience with google documentation

#

firebase was also poorly documented

valid burrow
#

i also tried places api before

#

horrible

tardy delta
#

what the

valid burrow
#

reversing google maps api was easier

tardy delta
#

google maps api is nice, openstreetmap isnt

valid burrow
#

i didnt even want images

#

just needed places

#

hence places api

#

but for some unknown reason

#

it refuses to give you any results outside your IP‘s area

#

the worst part is

#

you cant experiment with them

#

cause its so goddamn expensive

#

1 loop to many

#

and you gotta sell your house

tardy delta
#

i once got into an infinite loop and used all my daily quota

#

team got angry at me

valid burrow
#

xd

icy beacon
#

google apis are ass

#

docs*

#

docs are ass

#

when i was developing for android and trying to actually make a proper app with good code design philipp lackner saved my ass

#

their docs say so much and convey so little

tardy delta
#

jetpack compose?

icy beacon
#

yes

tardy delta
#

its quite nice, heard it also has a native version now

icy beacon
#

it is rly nice and quite intuitive

tardy delta
#

until your async stuff doesnt cause a re-render

icy beacon
#

when i was trying to understand stuff like dagger hilt and retrofit and mvvm, that's when philipp lackner helped me a lot

#

and to get the initial hang of jc

tardy delta
#

used Room?

icy beacon
#

nope

#

heard of it but do not know what it is

valid burrow
#

ill just look for another ad api

tardy delta
#

sql server thing for android like hibernate

valid burrow
#

but im scared theyll put porn on my sites

#

lolz

icy beacon
icy beacon
tardy delta
#

could send you the code i wrote in college but its owned by the college team on gh, could see if i can fork it

valid burrow
icy beacon
icy beacon
tardy delta
#

its just for working with a db without typing sql manually

icy beacon
#

bookmarked

icy beacon
#

bc you wouldn't like directly call sql for external stuff you'd use an api?

valid burrow
tardy delta
#

well actually you kinda had to write sql manually, but there are more checks on it autogenerates code for your statements

icy beacon
tardy delta
#

its like this stuff

#

and it automatically generates sql statements for your dao

icy beacon
#

this seems useful to store like flatfile h2 esque stuff

tardy delta
#

damn the repo with my code is private, i dont have any rights on it and i cant transfer it to my main account

slender elbow
#

clone, add remote, push

#

:kappa:

tardy delta
#

i mean ye

next iron
#

i have this listener class that cancels the item drop event but i can still drop items

package me.lars.factoryplugin.Listeners;

import me.lars.factoryplugin.Classes.TemporaryStuff;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDropItemEvent;

public class DropListener implements Listener {

    @EventHandler
    private void onItemDrop(EntityDropItemEvent e){
        e.setCancelled(true);
        if (e.getEntityType().equals(EntityType.PLAYER)){
            Player p = (Player)e.getEntity();
            if(e.getItemDrop().getItemStack().getItemMeta() == null || e.getItemDrop().getItemStack().getItemMeta().getLore() == null) { return;}

            if(e.getItemDrop().getItemStack().getItemMeta().getLore().contains("Factory Machine")){
                e.setCancelled(true);
                TemporaryStuff.rotate(p);

            }
        }
    }
}

does anyone know why?

getServer().getPluginManager().registerEvents(new DropListener(), this);```
i did register it in my main class
tardy delta
#

why are you cancelling twice

#

print something to see if it gets called

next iron
earnest forum
#

try PlayerDropItemEvent

icy beacon
valid burrow
icy beacon
next iron
icy beacon
valid burrow
next iron
#

that one worked awesome

#

thanks alot

tardy delta
earnest lark
#

i'm trying to use nms in my plugin and using buildtools to get a jar to depend on. first I managed to import the classes etc I need, but when I try to compile, I get a cannot access com.mojang.serialization.MapCodec. i tried adding/depending on a few other different things, tried depending on the Spigot/Spigot-API/target/spigot-api-<MC-VERSION>-SNAPSHOT-shaded.jar, and nothing really works. is there a clear thing that I should look for to depend on for everything to work smoothly?

lost matrix
#

?nms

valid burrow
tardy delta
#

yes

echo basalt
#

I hate mobile autocomplete

#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

quaint mantle
#

i how to change splash potion tick delay

inner mulch
#

wdym?

lost matrix
#

@echo basalt Thanks, my system almost go easier with that...

echo basalt
#

Ow

#

Sounds like you need to wrap stuff

shadow night
echo basalt
#

That function can be a dedicated class

shadow night
lost matrix
echo basalt
#

I'm attending a 3d printing workshop rn

lost matrix
echo basalt
#

Me every 19 seconds because my glasses are loose

#

Map of a map just noticed

#

You can't possibly be serious

young knoll
#

Needs more maps

lost matrix
#

You think this needs concrete implementations?

icy beacon
#

4 closing square brackets

#

I have no idea what you are doing but I think it's not the best way

echo basalt
#

Yes

#

I got a free participation medal for visiting my fav teacher this week

#

Damn just noticed I never added mr smiley face as a friend o_o I'm giving free tech support to strangers

zealous osprey
lost matrix
#

Already split it up ofc

gleaming grove
icy beacon
fierce swan
#

So say I have a class here:

abstract class AbstractAchievement<T: PlayerEvent> : Listener {
  ...
  @EventHandler
  fun handleEvent(e: T) {
    ...
}

And I try to make an implementation of the class

class ExampleAchievement : AbstractAchievement<PlayerInteractEvent>() {
  ...
}

And I try to put it into a registry list, and register them on plugin startup

object AchievementManager {
  val achievements: ArrayList<AbstractAchievement<out PlayerEvent>> = arrayListOf(
    ExampleAchievement
  )

  fun registerAchievements() {
    for (achievement in achievements) {
      Bukkit.getPluginManager().registerEvents(achievement, BasePlugin.instance)
    }
  }
}

When the server starts up, it claims it can't register the achievements as PlayerEvent doesn't have the static getHandlerList method, which makes sense given the ArrayList the achievements are stored in
That being said, I'm not entirely sure how else to go about this, as I'd rather not have the boilerplate init { Bukkit.getPluginManager().registerEvents(this, BasePlugin.instance) } in every single one of the classes.

wide coyote
#

did they change the code boxes font

remote swallow
#

yes

icy beacon
#

Yeah...

wide coyote
#

or am i just insane

#

bad thing i wish i were insane

icy beacon
#

same

remote swallow
#

same

river oracle
#

same

lilac dagger
#

they did change it

#

weird

river oracle
#

I didn't notice 😉 I wonder why that could be

lilac dagger
#

it's not looking bad tho

#

because you're probably using the font

river oracle
#

wow they just added shiki code blocks to regular dicsord

#

I can turn this off now

#

oh wait nvm epic lied to me

lilac dagger
#

was it just the font or the coloring too?

#

for some reason i remember it looking different

lost matrix
river oracle
tardy delta
tardy delta
# river oracle

is that discord, i used to have that before they changed all the css class names

fierce swan
tardy delta
#

ah a listener for the event, gotcha

fierce swan
#

Just not entirely sure how I’ll propagate an event to achievements with different event types for each one of them

#

For example if I have an achievement that wants to listen for PlayerInteractEvent and an achievement that wants to listen for a custom event in my plugin, how would I propagate those out?

tardy delta
#

map<class, something>? if i think one sec about it

#

like dispatch behaviour per event class or something

#

sounds like a pub/sub problem to me

mighty gazelle
#

How can I connect with a plugin to a MySQL Databank?

lilac dagger
#

actually i don't think this is the best way

mighty gazelle
lilac dagger
#
Connection connection = DriverManager.getConnection("jdbc:mysql://" + data.getHost() + ":" + data.getPort() + "/" + data.getDatabase(), properties)```
#

where at properties

#
Properties properties = new Properties();
                properties.setProperty("user", data.getUser());
                properties.setProperty("password", data.getPassword());```
#

and to execute a query you can

#
try (PreparedStatement statement = connection.prepareStatement(query)) {
                request.accept(statement);
            } catch (SQLException e) {
                e.printStackTrace();
            }```
#

wait how do i use the code blocks?

icy beacon
#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
lilac dagger
#

oh it's 3

tardy delta
# tardy delta sounds like a pub/sub problem to me

i would do something like this, please note that i havent used the api in months and my response might not be very accurate ```kt
object EventQueue : Listener {
private val registeredHandlers = mutableMapOf<Klass<out PlayerEvent>, List<AchievementHandler>>

fun register() {
for (subscriberClass, handlers) in registeredHandlers.keys {
Bukkit.getPluginManager().registerEvent(/* i forgot params, something is a Class */) {
handlers.forEach(AchievementHandler::invoke)
}
}
}
}```

And in your achievement::init, call into the subscribe method of the eventbus

#

and please do this with di rather than BasePlugin.instance

#

damn downloading Consolas makes the font really look good again

icy beacon
#

with kotlin i do my database handling like this

fun <R> fetch(query: String, vararg args: String, block: ResultSet.() -> R): R = coroutineScope {
  dataSource.connection.use { conn ->
    conn.prepareStatement(query).use { statement ->
      params.forEachIndexed { index, param -> statement.setObject(index + 1, param) }
      return@coroutineScope statement.executeQuery().use { rs -> block(rs) }
    }
  }
}

which automatically closes everything you need to close and is fancy

#

thoughts

#

?

tardy delta
#

.use(block)

icy beacon
mighty gazelle
ivory sleet
tardy delta
#

and if using jetbrains annotations kt fun <T> fetch(@Language("SQL") query: String)

icy beacon
icy beacon
#

but i mostly store all queries in a separate file like Queries.kt so idk if that would properly do the check

tardy delta
#

so many cool jetbrains annotations exist that youve never heard of

icy beacon
#

gimme your top 3

tardy delta
#

@ApiStatus.Experimental
@Language
@VisibleForTesting

icy beacon
#

well the first one is well known i believe

#

what is that last one?

tardy delta
#

first and third dont actually do anything

#

latter tells readers that the access modifier is higher than normal because of testing purposes

icy beacon
#

i use like 3 annotations ever which are @NotNull, @Nullable and @Contract if I'm felling fancy while documenting

tardy delta
#

no need for the first two in kotlin

icy beacon
#

ik

tardy delta
#

and i barely use contracts, as ij as able to infer most of them

icy beacon
#

i sometimes do stuff in java because some people that commission me want source code in java

icy beacon
#

anyway i'll go back to doing my hw i've been procrastinating in the middle of it for a long time

#

hf

tardy delta
#

i only use @Nullable and assume not mentioning it implicitly means @NotNull

#

anyways

#

im scared of setObject due to auto wrapping or whatever its called again

ivory sleet
tardy delta
#

oh i forgot @ImmutableView and @Blocking

#

and @Debug.Renderer

ivory sleet
#

MustBeInvokedByChildren or sth is also nice

#

but its very specific

tardy delta
#

is that like InvokeSuper?

tardy delta
ivory sleet
worthy yarrow
icy beacon
echo basalt
#

few weeks

icy beacon
#

Holy fucking fucking shit

#

Can you possibly find the "done that felt good" cafebabe message that was the ban

#

I want to read what was happening then

tardy delta
#

poor dude wanted to show off his ugh ugh coding skills

icy beacon
lost matrix
#

roh

tardy delta
# icy beacon Elaborate plz

int -> Integer, i forgot how that stuff is called, once looked into a drivers src and i did a switch on the actual type but ye

#

its a thing you might want to consider

lost matrix
icy beacon
#

Just the cross section of a cube

lost matrix
#

Find the plane defined by MPK

icy beacon
#

Or plane

#

Idk what this is called in english lmao

#

This is just the basics in this stereometry webinar series

lilac dagger
#

have you guys found a way to handle this warning?

lost matrix
lilac dagger
#

so suppressing is the only way, thanks

icy beacon
#

Looks about right

icy beacon
#

Is that bad though?

eternal oxide
#

depends

#

boxing/autoboxing is not "bad" if you have a need

#

ie, you need to support null

ocean hollow
#

what should i do if I see for 1 tick not transformated blockdisplay?

eternal oxide
#

use the spawn method that accepts a consumer

wide coyote
#

that looks cool ngl

#

i liked the idea

tardy delta
# icy beacon Is that bad though?

i wanted to make a point that some drivers have a more efficient implementation when you the appropriate setX method directly, but one might argue about that

icy beacon
#

Isn't it negligible?

ivory sleet
#

it can build up

#

esp since for instance some Integer instances are cached, so a lot of lookups, and otherwise unnecessary instance method invocations may be present uk underhood

icy beacon
#

Fair point

proper cosmos
#

Hello, guys. I want to spawn particles that does not shoot out.

player.getWorld().spawnParticle(Particle.END_ROD, player.getLocation(), 10, 0, 0 ,0);```
this one doesnt work
proven musk
#

whats like

#

the easiest workaround for adding custom blocks

#

is it an itemdisplay? wont that render weird?

fluid river
#

yo guys

sand spire
fluid river
#

Isn't there a thing for disabling a plugin at runtime?

proven musk
#

I can't replace any blocks

#

at least id rather not

fluid river
#

like getPluginManager().disablePlugin() or smth

echo basalt
#

tHere is yeah

#

just try and see

sand spire
#

can't you give textures based on the items pdc?

echo basalt
#

Not on PDC but on model data

fluid river
#

what would happen to all registered listeners and command executors when you disable the thing?

sand spire
#

ah, yeah that

fluid river
#

They are now parts of plugin manager, aren't they?

echo basalt
#

Commands throw an error

#

listeners die

fluid river
#

hmm

grim hound
#

is there any way to put many ByteBufs into one (basically sending a lot of minecraft packets as one)?

proven musk
grim hound
echo basalt
#

It ensures everything runs on the same tick

grim hound
echo basalt
#

It also helps due to compression

grim hound
fluid river
#

i kinda don't get how they die basically

grim hound
#

that's the whole pe class

echo basalt
#

Wrapper

grim hound
#

same with nms

echo basalt
#

ProtocolLib o_o

fluid river
#

i mean when event is fired, plugin manager just sends a notification to all listeners which are registered, doesn't it?

echo basalt
#

Yeah p sure you send that packet

#

And then you send uh

grim hound
echo basalt
#

your packets followed by delimiters

grim hound
#

packet events

fluid river
fluid river
#

well, ig it has some good way to store which listener belongs to which plugin

#

so when you disable it, listeners are not dying cuz of errors, but just get disabled

grim hound
hollow vessel
#

hi! I have problem with player interact event, because it calls twice, but not always.

@EventHandler
    public void onPlayerInteract(PlayerInteractEvent event) {
        Block block = event.getClickedBlock();
        if (event.getHand() != EquipmentSlot.HAND) {
            return;
        }

        if (event.getAction() != Action.RIGHT_CLICK_BLOCK) {
            return;
        }

        if (block == null) {
            return;
        }

        Location clickedBlockLocation = block.getLocation();
        Material blockMaterial = block.getType();

        if (!chests.contains(blockMaterial)) {
            return;
        }

        for (ProtectedRegion locationRegion : this.protectionService.getLocationRegions(clickedBlockLocation)) {
            Option<House> houseOption = this.houseService.getHouse(locationRegion);

            if (houseOption.isEmpty()) {
                return;
            }

            House house = houseOption.get();
            Owner owner = house.getOwner().get();

            if (owner.getUuid().equals(uuid)) {
                return;
            }

            Option<HouseMember> houseMemberOption = this.houseMemberService.getHouseMember(house, uuid);

            if (houseMemberOption.isEmpty()) {
                this.notificationAnnouncer.sendMessage(player, this.messageConfiguration.house.permissionToOpenChests); <-- there, message is sending once (good)
                event.setUseInteractedBlock(Event.Result.DENY);

                return;
            }

            HouseMember houseMember = houseMemberOption.get();

            if (this.houseMemberService.hasPermission(houseMember, HouseMemberPermission.OPEN_CHESTS)) {
                return;
            }

            this.notificationAnnouncer.sendMessage(player, this.messageConfiguration.house.permissionToOpenChests); <-- there, message is sending twice (bad)
            event.setUseInteractedBlock(Event.Result.DENY);
        }
    }

can someone pls help me?

grim hound
#

shows no implementations

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
echo basalt
#

You already check that uh

#

Another thing I usually do is uh

#

add a little 200ms cooldown :)

fluid river
#

big uhh

hollow vessel
echo basalt
#

Whenever

fluid river
#

sure why not

hollow vessel
#

hmm, i will check it

hollow vessel
echo basalt
#

I'd add it above the hand check

fluid river
#

lez go baby

echo basalt
#

Basically players by default when hold-clicking an item send a packet every 200ms

echo basalt
grim hound
tranquil badger
#

I might just cave and use protocollib

grim hound
#

I'm doing it on ByteBufs

#

so serialized packets

echo basalt
#

Yeah so you build the packet from every bytebuf

#

just call the bytebuf constructor

grim hound
echo basalt
#

or whatever

#

mf

grim hound
#

I create a ByteBuf from packets

#

and send that

#

since they need to be transformed later anyway by the server

grim hound
grim hound
#

this is the transforming

#

but I don't seem to have it for some reason

echo basalt
grim hound
grim hound
#

does it show you any implementations?

echo basalt
#

nO because it's an interface

#

and paperweight is bad

grim hound
#

hmm

#

I'd need to know how it's done in order to write it into a ByteBuf

#

like what's it's syntax?

clear elm
#

Hi

grim hound
#

is it packet id packet 1 <delimiter> packet 2

#

and what even is the delimiter here?

echo basalt
grim hound
echo basalt
#

are you sure

grim hound
#

I think

#

anyway it's the same thing

echo basalt
#

Sometimes mojang leaves some code like this around in interfaces with no impl

grim hound
#

encoder and decoder are almost identical

echo basalt
#

And this is an interface with no impl

#

I believe prob responsible for handling incoming Clientbound packets

grim hound
#

otherwise it wouldn't work

echo basalt
#

The impl is on the client not on the server

#

The server has an interface of this style too

#

And an impl for it which handles all the received packets

#

I'm confident that method is leftover client code

grim hound
#

what the f-

grim hound
#

it needs to have an implementation

#

in order to be written into a bytebuf

echo basalt
#

Bundle packets sound pretty special to me

#

Solid chance that when you queue up a packet it just gets written to a bundle at the end

#

I need to look into the protocol 1s

#

The delimiter for a bundle of packets. When received, the client should store every subsequent packet it receives, and wait until another delimiter is received. Once that happens, the client is guaranteed to process every packet in the bundle on the same tick, and the client should stop storing packets. For example, this is used to ensure Spawn Entity and Set Entity Metadata happen on the same tick.

#

So you send a bundle delimiter

#

And then you send a shit ton of packets

#

And then you send another bundle delimiter

grim hound
#

braaah

#

so I need to send them seperately anyways?

echo basalt
#

Yeah

grim hound
#

bullshit

echo basalt
#

And yeah this bundle packet thing is just a list that's built on the client

#

And then processed as one packet

river oracle
#

The implementation you are looking for is not on the server 💯

echo basalt
#

which is prob just a for loop in the client impl

#

Behind the interface

#

Minecraft does some wacky shit

grim hound
#

so there is no way to write many packets into a single bytebuf?

echo basalt
#

if you spectate the entity you're riding your camera's frozen but you send look packets

echo basalt
#

Stop trying to be network perfect

#

micro optimizing for you and your 3 players

grim hound
echo basalt
#

Cull the particles

grim hound
echo basalt
#

I've had issues where uh

grim hound
#

it's a public plugin

echo basalt
#

We were sending like 100mbps to each player

#

solid 16k particles per tick

#

don't ask

grim hound
echo basalt
#

The fix was to cull particles

#

Basically the whole concept is

#

If the particle is too far or too close to another particle

hollow vessel
# echo basalt Basically players by default when hold-clicking an item send a packet every 200m...
@EventHandler
    public void onPlayerInteract(PlayerInteractEvent event) {
        Block block = event.getClickedBlock();
        List<Material> chests = this.pluginConfiguration.chests;

        if (event.getHand() != EquipmentSlot.HAND) {
            return;
        }

        this.scheduler.laterSync(() -> {
            if (event.getAction() != Action.RIGHT_CLICK_BLOCK) {
                return;
            }

            if (block == null) {
                return;
            }

            player.sendMessage("a");

            Location clickedBlockLocation = block.getLocation();
            Material blockMaterial = block.getType();

            if (!chests.contains(blockMaterial)) {
                return;
            }

            for (ProtectedRegion locationRegion : this.protectionService.getLocationRegions(clickedBlockLocation)) {
                Option<House> houseOption = this.houseService.getHouse(locationRegion);

                if (houseOption.isEmpty()) {
                    return;
                }

                House house = houseOption.get();
                Owner owner = house.getOwner().get();

                if (owner.getUuid().equals(uuid)) {
                    return;
                }

                Option<HouseMember> houseMemberOption = this.houseMemberService.getHouseMember(house, uuid);

                if (houseMemberOption.isEmpty()) {
                    event.setUseInteractedBlock(Event.Result.DENY);

                    return;
                }

                HouseMember houseMember = houseMemberOption.get();

                if (this.houseMemberService.hasPermission(houseMember, HouseMemberPermission.OPEN_CHESTS)) {
                    return;
                }

this.notificationAnnouncer.sendMessage(player, this.messageConfiguration.house.permissionToOpenChests);
                event.setUseInteractedBlock(Event.Result.DENY);
            }
        }, Duration.ofMillis(200));
    }

now It is not working

echo basalt
#

Does it really need to exist?

echo basalt
#

I said a cooldown not a delay

#

I've been awake for like 19 hours the caffeine is starting to wear off o_o

grim hound
#

like this

echo basalt
#

Anyways the neat solution I came up with to cull particles was to basically segment a block into 16x16x16 or 8x8x8

grim hound
#

so I can't remove much

hollow vessel
echo basalt
#

When generating a hashcode for a given particle location

grim hound
#

and yes, otherwise it becomes unreadable

echo basalt
#

A long is 64 bit, 4 for X decimal, 4 for Y decimal, 4 for Z decimal

#

You have 52 bits left over to lossily encode your X,Y,Z for that given player

#

iirc it was uh

#

20 bit for x, 20 bit for z 12 bit for y

#

You convert your location into that hash for each particle sent to a player and if the hash matches then the particle is too close and shouldn't exist

grim hound
#

I don't do the encoding myself

echo basalt
#

Try it out it has no visual difference

echo basalt
#

1s I can find this

echo basalt
#

Yeah it's a hash that downgrades the accuracy of the decimals to a specific offset

grim hound
#

I don't get the concept

echo basalt
#

wonky ass algorithm but you could convert your position to a Long and if 2 longs matched then the locations were within 1/16th of each other

hollow vessel
worthy yarrow
#

@echo basalt sorry for the ping, could you send me an example of a display entity created with model engine?

echo basalt
echo basalt
#

What you need to do is create an entity (or a modelengine dummy) and apply your model on top of it

worthy yarrow
echo basalt
#

Correct

worthy yarrow
#

Do you have an example of some sort of blueprint bone impl

echo basalt
#

Nope

worthy yarrow
#

Erm that’s gonna take a while to figure out

worthy yarrow
echo basalt
grim hound
#

no idea what bit magic you do

quiet ice
# grim hound

probably not an issue right now, but you might want to test it with a colorblindness filter if you intend on squashing the characters together more

grim hound
#

but my sending looks like this

echo basalt
#
private static final Object DUMMY = new Object();
private final Cache<UUID, Object> cooldown = CacheBuilder.newBuilder()
  .expireAfterWrite(200, TimeUnit.MILLISECONDS)
  .build();

@EventHandler
public void onWhatever(PlayerEvent whatever) {
  Player player = whatever.getPlayer();
  UUID playerId = player.getUniqueId();

  if(cooldown.getIfPresent(playerId) != null) {
    return;
  }

  cooldown.put(playerId, DUMMY);

  ...
}
worthy yarrow
grim hound
echo basalt
#

This code is ass if you want to hook with it and stuff

#

You need to do this filtering before you write the buffer

#

Basically just remove particles that aren't XYZ blocks away from each other

echo basalt
grim hound
#

I don't send any unncessary packets

#

all of them are really near

#

I know since it's an image to location transformation

echo basalt
echo basalt
#

The highest number you can represent with 4 bits is 16

#

So you store the decimal points for each axis in 4 bits

#

So your decimal gets squashed into a range of 0-15

#

So your X is 0-15, your Y is 0-15, your Z is 0-15

#

And if they all match up then they're "close enough"

worthy yarrow
#

Illusion did you learn Meg through docs / messing around with impl?

echo basalt
#

You can store 3 bits instead of 4 and it's 0-7 now. Your precision is half which means the "distance between particles" required doubles

echo basalt
#

They're just hard to find

#

as always

worthy yarrow
#

Ok I hadn’t had a chance to look through meg4

#

Thank you!

echo basalt
#

It's a neat thing I thought of while sleep deprived in class

#

like 2 years ago

#

And it works well enough

echo basalt
#

Weirdly enough there are 8 vertices in a cube

#

The maximum number of particles you can render in a block depends on how many bits you allocate but it ends up as 8 ^ bits

#

So if you have 3 bits it's 8^3 or 512

#

If you have 4 bits of precision per axis it's 8^4 or 4096

#

neato

#

But whatever more bits for precision means you end up with a smaller range to represent your block's xyz coordinates

#

If you have too few bits you risk culling the wrong stuff

#

This is fine as-is

worldly ingot
#

A little nicer to read imo

echo basalt
#

It's awful yuck

worldly ingot
#

You'll get used to it. Just like how you got used to Discord's new font that everyone thought was so unbearably bad and they'll never get used to it

echo basalt
#

It's still awful

worldly ingot
#

You didn't even give it a second thought until I mentioned it :p

echo basalt
#

I hadn't updated discord yet

worldly ingot
#

Humans really are just adverse to any and all change huh?

echo basalt
#

No we just get used to good things and then they turn sour

#

I'm going to bed for a bit

grim hound
#

it got rid of like

#

10 buffers

echo basalt
#

Ez

grim hound
echo basalt
#

Lower the bits to 3 instead of 4

grim hound
#
    private static long hash(double x, double y, double z) {
        int xPos = (int) x;
        int yPos = (int) y;
        int zPos = (int) z;

        int xIndex = (int) ((x - xPos) * 0xF);
        int yIndex = (int) ((y - yPos) * 0xF);
        int zIndex = (int) ((z - zPos) * 0xF);

        // 22 bits for xPos, zPos
        // 8 bits for yPos
        // 4 bits for xIndex
        // 4 bits for zIndex
        // 4 bits for yIndex

        long hash = 0;

        hash |= xPos & 0x3FFFFF;
        hash |= (long) (zPos & 0x3FFFFF) << 22;
        hash |= (long) (yPos & 0xFF) << 44;
        hash |= (long) (xIndex & 0xF) << 52;
        hash |= (long) (zIndex & 0xF) << 56;
        hash |= (long) (yIndex & 0xF) << 60;

        return hash;
    }
#

what is

#

wait discord chanegd how code looks

#

nice

#

anyways

grim hound
#

the shifting?

#

is that what I should change?

echo basalt
#

Yea ask gpt

quiet ice
#

* 0xF? That is a bit unusual

echo basalt
#

Issa feature

proven musk
#

what the hell is going on

#

its like

echo basalt
#

== for strings

quiet ice
proven musk
#

wdym

echo basalt
#

I wrote it 2 years ago

grim hound
proven musk
#

goddamnit

echo basalt
#

Dw

proven musk
#

damn you java

echo basalt
#

It's just an intentionally lossy hash

#

It's deliberate

#

Anyways we want to replace all the 0xF 4 bit thing with 3 bit

#

And realign the shifts

#

I can't bother because I'm in bed

grim hound
#

0xf is 15

#

so 2^4 - 1

echo basalt
#

Yeah that's the highest number represented in 4 bits

grim hound
#

so I guess 2^3 - 1, being 7?

echo basalt
#

Yuh

grim hound
#

and which

#

0xF

#

should I replace?

echo basalt
#

All

grim hound
#

got it

echo basalt
#

Should be enough for half the precision

grim hound
#

I mean

#

it did reduce like 120

echo basalt
#

Try it out it should cull more

grim hound
#

but it doesn't look as clear

#

it can be hard to read now

echo basalt
#

Yeah that's the whole dance with culling

#

If it's not clear just revert

grim hound
#

is there any other way?

#

like 4 bits is reducing of em

#

and 3 bits makes it harder to read

echo basalt
#

There's no 3.5 bits

grim hound
#

dam

echo basalt
#

You'd need something like uh

#

4 bits but the last 2 are zeroed

#

Which is annoying

grim hound
# grim hound

like I said, I have no idea what is happening here

echo basalt
#

Magic

#

Try setting the shift to 12

#

Might work

quiet ice
echo basalt
#

Quantum spooky

echo basalt
#

That represents the number of "sections" per axis in a given block

#

More sections = more particles

#

12 is a good attempt

grim hound
agile hollow
#

how can i get like the prestation of the server with a command?

echo basalt
#

Wut

agile hollow
#

like i want to see the usage of the cpu the ram etc

quiet ice
#

well that makes more sense

echo basalt
#

Spark?

brittle geyser
#

Hello, who want help

agile hollow
#

i want make it and i want only 1 command

proper cosmos
#

When I set EntityExplodeEvent yeld to 100, explosion is as it should by default...

grim hound
echo basalt
#

Rip

grim hound
#

it's now 1/4th and there's barely anything

echo basalt
#

Make a command and test em all