#help-development

1 messages · Page 466 of 1

twin venture
#

with PlayerMoveEvent it repeat it ..

vocal cloud
#

If you're doing a contains check with a remove doesn't remove return a boolean so you can just do a remove check instead?

young knoll
#

yes

rough drift
#

Imagine using snake_case in java

rotund ravine
#

You did not

tawny pine
remote swallow
#

show the code

rotund ravine
rough drift
#
@EventHandler
public void on(PlayerMoveEvent event) {
  Player player = event.getPlayer();  
  Location to = event.getTo();
  if(to == null) return;

  if(to.getY() <= minYLevel) {
    // Do something
  }
}
``` @twin venture
tawny pine
#

oh sorry i got the wrong line :/

tawny pine
rotund ravine
#

What is put into that map

#

sigh

rough drift
#

Instead of teleporting use setTo btw @twin venture

tawny pine
# rotund ravine What is put into that map

if (!(cooldown.containsKey(p.getName()))) { cooldown.put(p.getName(), String.valueOf(System.currentTimeMillis())); p.sendMessage("§cAdded to cooldown" + cooldown.get(p.getName())); }

young knoll
#

Why are you

rotund ravine
#

use uuids

young knoll
#

Turning the timestamp into a string

rough drift
rotund ravine
#

why not use instants

#

smh

rough drift
#

also for the value you can just use a Long or an Instant

young knoll
#

I mean at the least use a long

rough drift
#

hell even a LocalTime

tawny pine
rough drift
tawny pine
young knoll
#

or Map<UUID, Instant>

rough drift
#

and use cooldown.put(p.getUniqueId(), System.currentTimeMillis());

rough drift
#

Also, @tawny pine, don't run another .get operation

#

just do

tawny pine
rough drift
#
long now = System.currentTimeMillis();
cooldown.put(p.getUniqueId(), now);
p.sendMessage("§cAdded to cooldown" + now);
#

instead of using .get(p.getUniqueId()) in the message

#

just store the value beforehand

young knoll
#

Kinda weird to send the player a raw timestamp

#

But yeah

rough drift
#

I guess yeah

#

also, @tawny pine, you don't need to add () around cooldown.containsKey(p.getUniqueId()), you can just do !cooldown.containsKey(p.getUniqueId())

regal scaffold
#

If I wanted to make a custom API so I could implement something like YAMLConfiguration but... better

#

What should I need to know?

regal scaffold
#

I assume I can look at YAMLConfiguration from stash and get ideas from there

regal scaffold
#

?stash

undone axleBOT
rough drift
#

I don't know what you're going for

regal scaffold
#

I want to make a better File Serializer

rough drift
#

Ah

regal scaffold
#

I think I'm going down the correct path

jovial shadow
#

is there a way i can change the luckyperms font?

jovial shadow
#

you know luckyperms?

#

how do i change the rank font

rotund ravine
# tawny pine oh ok ty 🙂

It's not that refined, but here is a simple cooldownmanager courtesy of bing:

Here's an example implementation of a CooldownManager class in Java that uses UUID and Instant:

import java.time.Instant;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public class CooldownManager {
    private final Map<UUID, Instant> cooldowns = new HashMap<>();
    private final long cooldownMillis;

    public CooldownManager(long cooldownMillis) {
        this.cooldownMillis = cooldownMillis;
    }

    public boolean isOnCooldown(UUID uuid) {
        Instant lastUse = cooldowns.get(uuid);
        if (lastUse == null) {
            return false;
        }
        return lastUse.plusMillis(cooldownMillis).isAfter(Instant.now());
    }

    public void putOnCooldown(UUID uuid) {
        cooldowns.put(uuid, Instant.now());
    }
}

This implementation uses a Map<UUID, Instant> to store the last time a UUID was used. The isOnCooldown method checks if the UUID is currently on cooldown by comparing the last use time with the current time. The putOnCooldown method adds the UUID to the map with the current time.

I hope this helps! Let me know if you have any other questions.

Source: Conversation with Bing, 12/04/2023(1) Guide to UUID in Java | Baeldung. https://www.baeldung.com/java-uuid Accessed 12/04/2023.
(2) Java cooldown system - Stack Overflow. https://stackoverflow.com/questions/44971042/java-cooldown-system Accessed 12/04/2023.
(3) LabAide/CooldownManager.java at master · arcadelabs/LabAide. https://github.com/arcadelabs/LabAide/blob/master/src/main/java/in/arcadelabs/labaide/cooldown/CooldownManager.java Accessed 12/04/2023.
(4) random - Create a GUID / UUID in Java - Stack Overflow. https://stackoverflow.com/questions/2982748/create-a-guid-uuid-in-java Accessed 12/04/2023.
(5) CooldownManager/CooldownManager.java at main - Github. https://github.com/PrinceBunBun981/CooldownManager/blob/main/CooldownManager.java Accessed 12/04/2023.

regal scaffold
#

Jan

jovial shadow
#

wow

regal scaffold
#

Without bing

rotund ravine
#

What? If i can get bing to do why bother doing it myself.

regal scaffold
#

If I wanted to make a better implementation of FileConfiguration/Serializable

#

What do you think would be a good place to start

onyx fjord
#

Bing 💀

jovial shadow
#

can anyone tell me if theres a way to change the luckyperms rank font?

onyx fjord
#

I bet bing scrapes code from random repos

remote swallow
#

?cooldowns

undone axleBOT
onyx fjord
#

And ignores licenses

hazy parrot
regal scaffold
#

Not necessarily fileConfiguration but serializable

rotund ravine
#

oh he asked

#

what do you want to serialize to?

regal scaffold
#

Exactly

#

I want to be able to include in my lib

#

And If I want to serialize something

#

I can add support for it

#

So, anything

rotund ravine
#

Should it be human readable and editable?

young knoll
#

Make it implement ConfigurationSerializable?

regal scaffold
#

Yes and no

#

I know I can do stuff like

#

Set.toArray

#

But what if I want to natively support Set

#

And internally do it

#

Is it even worth?

rotund ravine
#

Implement your own serializer for the TOML config type.

#

for non-human readable you can have some fun with binary.

regal scaffold
#

For efficiency

#

Binary>?

rotund ravine
#

Well anything can be efficient. Reading and writing binary files can be done efficiently easily.

regal scaffold
#

I'm just trying to think of some better ways to store data in multiple plugins

#

Cause SQL

#

idk I feel like the structure can change too much between plugins

young knoll
#

You can’t get any smaller than binary

regal scaffold
#

Files, are a bit annoying to set up

tawny pine
regal scaffold
#

Like... for example

#

Lets say essentials

#

They store PlayerData in individual files

#

What are the alternatives to that

#

SQL
...

young knoll
#

PDC

tardy delta
#

json

regal scaffold
#

json is a interesting alternative

#

But it's file based no?

#

Maybe NoSQL

tardy delta
#

could use an online mongodb db

young knoll
#

json is still storing individual files

tardy delta
#

free cluster

rotund ravine
#

everything is filebased?

#

or well

#

the things mentioned before is filebased

regal scaffold
#

Individual files not the same as 1 big file

young knoll
#

Yeah a database is basically one big file

regal scaffold
#

1 file per playerdata not the same as 1 file for all playerdata

#

Currently my preference is 1 file per data/datagroup or in this example, PlayerData

tawny pine
# rotund ravine It's not that refined, but here is a simple cooldownmanager courtesy of bing: H...

Just to ask though, why does this code not work:
HashMap<UUID, Long> cooldown = new HashMap<UUID, Long>(); if (!(cooldown.containsKey(p.getUniqueId()))) { long now = System.currentTimeMillis(); cooldown.put(p.getUniqueId(), now); p.sendMessage("§cAdded to cooldown" + cooldown.get(p.getUniqueId())); }
After the if statement has run, when it looks for the players unique id it should find it and not run the second time, but it still does.
Why is that?

young knoll
#

If you are going with files I’d stick to one per player

rotund ravine
young knoll
#

Instead of a giant one

regal scaffold
#

Exactly

tardy delta
#

multiple files is better imo cuz you can just load what you want instead of going to search to a whole big file

regal scaffold
#

Yes

soft hound
#

Do I use HTTP to send data from one plugin to another (In different servers), or is there a better way?

regal scaffold
#

I have a good cache system to read individual files

regal scaffold
#

But then, the only alternative of the ones we talked

#

Is SQL

#

What if I want to write a object to SQL, how do I do that? Field by field and populate a table?

young knoll
#

I personally like SQLite

tawny pine
regal scaffold
tardy delta
#

serialize every field in a column, then cry about normalisation

young knoll
#

You can technically serialize the entire object with gson and then shove that in the database

#

But like

#

Maybe don’t

regal scaffold
#

But like

#

No

#

That's terrible

#

What's the point of a database if i'm gonna json string and then save that into the database xd

tardy delta
#

someone in here asked to store json in his db

regal scaffold
#

xd

#

God no

regal scaffold
tawny pine
# rotund ravine ?

It didn't work because I was defining the Hashmap every time, and it needed to be outside of the event handler 🙂

regal scaffold
#

What's the issue with this

tardy delta
young knoll
#

Hey it makes the json available cross server!!!111

regal scaffold
#

lol

#

Solid meme

rotund ravine
# regal scaffold Currently my preference is 1 file per data/datagroup or in this example, PlayerD...

I found a few database types that use one file per database. Here are some of them:

  • SQLite
  • Microsoft Access
  • Microsoft Azure SQL Database
  • MySQL (when using MyISAM storage engine)
  • PostgreSQL (when using plain files)
  • Oracle (when using raw devices)
    ¹²⁵

Is there anything else I can help you with?

Source: Conversation with Bing, 12/04/2023(1) Database Types Explained - Knowledge Base by phoenixNAP. https://phoenixnap.com/kb/database-types Accessed 12/04/2023.
(2) The Different Types of Databases - Overview with Examples. https://www.prisma.io/dataguide/intro/comparing-database-types Accessed 12/04/2023.
(3) Can MySQL have one file per database? - Stack Overflow. https://stackoverflow.com/questions/11488140/can-mysql-have-one-file-per-database Accessed 12/04/2023.
(4) Database Files and Filegroups - SQL Server | Microsoft Learn. https://learn.microsoft.com/en-us/sql/relational-databases/databases/database-files-and-filegroups?view=sql-server-ver16 Accessed 12/04/2023.
(5) Database Files - Sql Server Backup Academy. https://sqlbak.com/academy/database-files Accessed 12/04/2023.

regal scaffold
#

but

#

I meant

tardy delta
hazy parrot
#

Why you don't just use nosql like mongo

regal scaffold
#

What's the issue with serializing in sql

#

I did think of nosql

hazy parrot
#

If you don't want to bother normalisation

regal scaffold
#

It was an alternative

#

Do you think nosql would be better than a per/file system with a good cache?

#

I need it to be versatile

#

I need to be able to adapt this structure we're talking about into many different scenarios

rotund ravine
#

Anything is good.

tardy delta
#

oh man

#

better dont send memes here

hazy parrot
regal scaffold
#

Example:

CustomPlayer.class

UUID uuid;
String name;
int loginCounter;
List<CustomPlayer.class> friends;

Set<Houses.class> houses;

rotund ravine
#

Ye

regal scaffold
#

Lets say you have that and you want to store it in a database of ANY sort

rotund ravine
#

Yes?

regal scaffold
#

What would your aproach be. What's your current aproach

tardy delta
#

oh god im getting flashbacks to sql classes

regal scaffold
#

Ignore sql

rotund ravine
#

I'd look at my userbase.

regal scaffold
#

Edited the question

#

Database of choice

tardy delta
#

you have a Player(uuid, name, logincounter) and a table friends <id, id>

#

iirc

rotund ravine
#

first off, it does not look like it is that big and does not look like it needs any database for the majority of cases + it also does not look like you want some yaml format for easy editing. So json is perfectly fine.

regal scaffold
#

This is an example

#

Scalability

hazy parrot
regal scaffold
#

Alright

#

What's your current SQL database of choice

#

Yes, personal opinion

tardy delta
#

you would be storing a list<uuid> instead of the whole player object anyways

hazy parrot
regal scaffold
#

Yes that is correct, i actually do that I just wrote it on the fly accidentally

#

Alright now

young knoll
#

Just pull a luckperms and implement all of them

regal scaffold
#

How do you deal with saving data like the above into your databases

#

Example:

CustomPlayer.class

UUID uuid;
String name;
int loginCounter;
List<UUID> friends; //CustomPlayer.class UUID field
Set<UUID> houses; //Houses.class UUID field

rotund ravine
#

That's a loaded question haha.

#

Well not really, but it can involve a fair bit of code + caching etc.

regal scaffold
#

I don't need the code rn I just care about the theory behind it, behind people that have a lot of experience like you guys

#

I want to learn

hazy parrot
regal scaffold
#

Alright so you split the data into tables that, well, make sense

tardy delta
#

^^

regal scaffold
#

And have relations

#

Which makes sense

paper viper
#

What was the name of the event when you jump onto a crop and it breaks?

regal scaffold
#

Does this mean that

#

You never bother storing something like a object directly

#

Instead you store a List<UUID> which is supported by sql

rotund ravine
#

?jd-s

undone axleBOT
regal scaffold
#

Instead of List<CustomPlayer.class>

regal scaffold
#

So you try to have a UUID for each object you need to store so then you don't need to store the object but just the UUID and the data

hazy parrot
#

there are kind of relations

#

one-one, one-many, many - many

regal scaffold
#

Yes yes I miss-said that

paper viper
young knoll
#

It’s PlayerInteractEvent

regal scaffold
#

So then you're telling me in this example:

UUID uuid;
String name;
int loginCounter;
List<UUID> friends; //CustomPlayer.class UUID field
Set<UUID> houses; //Houses.class UUID field

all your doing to save the data is a insert and then do name.getName() and so on field by field and correctly distribute it

tardy delta
#

sec

young knoll
#

Specifically with Action.PHYSICAL

hazy parrot
paper viper
tardy delta
regal scaffold
#

Do you have a library of choice/ your own implementation to make the process easier

young knoll
#

The fact that it’s called clicked block even though you don’t always click it hurts

#

:(

regal scaffold
#

I want to see something that most people consider a good SQL implementation without it being 1231312313% complex

#

Do not recommend luckperms please

tardy delta
hazy parrot
tardy delta
regal scaffold
#

So you don't have a actual implementation?

#

You just make a SQLManager class with some basic methods?

hazy parrot
young knoll
#

Unacceptable

regal scaffold
#

Is your data storage interface private or may I see it?

tardy delta
#

kotlin :(

regal scaffold
#

You do kotlin?

regal scaffold
#

Interesting

hazy parrot
regal scaffold
#

Yes of course

regal scaffold
#

I care more about the logic not the code

tardy delta
#

looks pretty clean doesnt it

regal scaffold
#

Wait so

#

If I'm not wrong brush

#

That's a cache + sql system

tardy delta
#

yes

regal scaffold
#

That is clean

tardy delta
#

ill probably do smth with annotations next time and write a compile time annotation processor

regal scaffold
#

I see you use Hikari too

#

What is LazyConnection?

#

Another lib?

tardy delta
#

uhhhh

#

im thinking what it was supposed to do again

regal scaffold
#

Part of hikari

#

nvm

tardy delta
#

i believe some kind of connection wrapper so i could use a try with resources on it without actually closing it in every case

regal scaffold
#

And so it begins xd

tardy delta
#

hmm?

#

thats just cuz sqlite doesnt have a native uuid type

regal scaffold
#

When will we be able to natively add UUID

#

ik

#

I like what you did

#

Seems really efficient

tardy delta
#

idk got some ideas from 7smile

hazy parrot
#

Well I like it too lmao

regal scaffold
#

Is his implementation public too?

#

Damn I really like this brush

#

So looking at your code

#

I can't tell when you save the data

#

If it's per user or every X time

#

Oh yeah

#

Quit

#

That is slick

young knoll
#

All fun and games until the server crashes

regal scaffold
#

Could just implement a 600sec async task that autosaves to database

tardy delta
#

brr

#

i only save to database when the player leaves

regal scaffold
#

Is it possible to make a multi-module project in IntelliJ but that the projects are independant for the most part? Especially separate jars?

tardy delta
#

and cache is always up to date

#

yes

young knoll
#

Smh if you only save on leave you could lose hours of data in a crash

tardy delta
#

just dont crash you noob

regal scaffold
#

Just to make sure I'm asking the same thing:

I need to make 3-4 small plugins but they are unrelated. I will however use the same libs/dependencies on almost all of them, I want to be able to export them separately and not depend on eachother, but I want to stop needing to make a project for each one.

How do I do so

tardy delta
#

and i was the only player on the server so uhh 💀

flint coyote
young knoll
#

A kingdom of 1

tardy delta
#

im now thinking about a runtime hook that saves the data to the database in case of an unexpected crash

#

never finished that plugin 💀

regal scaffold
#

Kingdom of 1

flint coyote
tardy delta
#

id just create one big plugin

#

depends if you want to use them separately too

paper viper
#

How is the event called when i destroy a painting?

flint coyote
#

And name it TheEverything?

tardy delta
#

project X

flint coyote
paper viper
# flint coyote Isn't that just a entity damage by entity event? There might be a more specific ...

I dont think so

@EventHandler
    public void onHit(EntityDamageByEntityEvent event)
    {
        if(event.getEntityType() == EntityType.PLAYER)
        {
            if(!Storage.getInstance().getEventPlayer((Player) event.getEntity()).ableToFight)
            {
                event.setCancelled(true);
            }
        }
        if(event.getDamager().getType() == EntityType.PLAYER)
        {
            if(!Storage.getInstance().getEventPlayer((Player) event.getDamager()).ableToFight)
            {
                event.setCancelled(true);
            }
        }
    }
#

it would get canceld

tardy delta
#

ever heard of &&?

paper viper
#

btw they are not able to fight

flint coyote
#

Is it registered? It works for me

rotund ravine
#

Prolly

paper viper
rotund ravine
tardy delta
#

no my imaginary friend

paper viper
#

what should i &&

rough ibex
#

your nested ifs

flint coyote
paper viper
#

oh that sure

regal scaffold
regal scaffold
#

So I can export them and use them individually

flint coyote
#

Oh so you can build them all at once

tardy delta
#

you can have separate modules that each give you a jar

#

just have a parent pom with all the shared dependencies

#

its pretty much self explanatory in ij

echo granite
#

Should methods that return Collection return a defensive copy or a variation of Collections.unmodifiableX?

I'm in favour of returning a defensive copy in order to avoid wrapping the list if it needs to be changed, but my friend thinks otherwise...

weak meteor
worldly ingot
#

If you want it mutable, make it mutable. If you don't, return a view

#

¯_(ツ)_/¯

#

There's no one answer to that question

buoyant viper
weak meteor
#

loll

young knoll
#

Smh

buoyant viper
#

it worked the first time i swear!

young knoll
#

Do you not stress over things before you upload them?

#

Is that just me

buoyant viper
#

i stress over how im gonna describe what im uploading

echo granite
weak meteor
buoyant viper
#

and will spend 6 years making the README for a project that took me 1 afternoon

young knoll
#

I haven’t uploaded anything in a bit

#

Because I don’t want to make a resource page

buoyant viper
#

i have a plugin ready to upload that im just polishing up

#

announcer plugin #394838

rough ibex
#

me but with logos

young knoll
#

I need an ai to make my resource pages

buoyant viper
#

just enter the prompt into @tender shard

weak meteor
#

eee

#

worked

young knoll
#

I don’t think Alex is an api

buoyant viper
#

also need to make an icon for it

#

craiyon ai, make me a flat 16x16 megaphone icon

young knoll
#

Who still uses craiyon

buoyant viper
#

idfk

worldly ingot
#

We have both mutable and immutable collections in Bukkit

young knoll
#

I thought stable diffusion was the new meta

worldly ingot
#

You're the one designing it so it's ultimately your decision. There's no right or wrong. If you want people to be able to add or remove things from your collection, you have the choice of making it mutable or adding mutator methods

#

How would you use your API? That's the question you need to ask before you write the API

echo granite
#

I have an object that does some actions and then documents them in a List<SomeHistoryObject> and a method to get the history - what would you return?

buoyant viper
#

craiyon, those arent 16 by 16

#

ai has no concept of resolution

hazy parrot
echo granite
#

I want a reliable history, otherwise it's conceptually not history 🤷

hazy parrot
worldly ingot
#

Yeah, you pretty much answered your own question

echo granite
worldly ingot
#

Not sure what you mean

rotund ravine
#

Idk either

worldly ingot
#

Just wrapping it in another collection?

#

Because again, you're coming right down to personal preference again lol

#

How you encapsulate your data is preferential

rotund ravine
#

ImmutableList.of() easy

worldly ingot
#

Well I think he's proposing instead new ArrayList<>(internalList);

rotund ravine
#

Well sure. They might be confused without proper javadocs if they can modify it

worldly ingot
#

That's why we have @Unmodifiable, @UnmodifiableView, and Javadoc comments to state what precisely is returned

young knoll
#

When will spigot get those annotations :p

rotund ravine
#

Hm?

#

On what?

young knoll
#

Anything the returns immutable collections

#

We do have the javadoc comments tho

rotund ravine
#

Ye

paper viper
#

Did i got it right that boat collision is client sided?

rotund ravine
#

Eh?

worldly ingot
rotund ravine
#

What part of it rotz?

paper viper
#

the boat

rose aspen
#

Hi spigot, I switched to Mojang Mappings and got a little problem with a packet.
This packet should open a enderchest for a client:

                        ClientboundBlockEventPacket packet = new ClientboundBlockEventPacket(new BlockPos(getLoc().getBlockX(),
                                getLoc().getBlockY(),
                                getLoc().getBlockZ()),
                                new net.minecraft.world.level.block.Block(BlockBehaviour.Properties.of(Material.DECORATION)),
                                1,
                                1);```

With spigot mappings, it was:

                    PacketPlayOutBlockAction packet = new PacketPlayOutBlockAction(new BlockPosition(getLoc().getBlockX(),
                            getLoc().getBlockY(),
                            getLoc().getBlockZ()),
                            Blocks.ex,
                            1,
                            1);

java.lang.IllegalStateException: This registry can't create intrusive holders
at net.minecraft.core.MappedRegistry.createIntrusiveHolder(MappedRegistry.java:369) ~[?:?]
at net.minecraft.world.level.block.Block.<init>(Block.java:207) ~[paper-1.19.4.jar:git-Paper-510]
at blablabla.......VoteCaseBlock$2.run(VoteCaseBlock.java:157) ~[votecase-1.0.jar:?]```

What did I do wrong here? Is DECORATION the wrong property?

rotund ravine
paper viper
worldly ingot
#

Blocks.ex is a block constant

young knoll
#

I assume it’s the ender chest constant

obsidian plinth
#

would i use PlayerInteractEntityEvent to make a lisner if a player palced a armourstand

rotund ravine
#

Nah

worldly ingot
#

Blocks.ex looks to be Blocks.CHAIN

#

At least in 1.19.4

obsidian plinth
young knoll
#

🤔

worldly ingot
#

Oh I lied, it's BLACK_STAINED_GLASS

#

ex != eX lol

rotund ravine
young knoll
#

Obfuscation is wonderful

obsidian plinth
young knoll
#

Why would that be it

rose aspen
young knoll
#

I don’t think there is an event for when the player causes an entity to spawn

#

But there is always the PlayerInteractEvent and the EntitySpawnEvent

worldly ingot
#

Blocks is the same in Spigot and Mojang mappings

#

You went from an existing block constant to creating your own block

rose aspen
#

Oh noo

worldly ingot
#

So whatever it was your were trying to send with ex is mapped to some existing block constant, and according to the mappings, it should be black stained glass

obsidian plinth
rotund ravine
#

They don’t state it

#

But yah

young knoll
#

CreatureSpawnEgg?

#

That’s not an event

rotund ravine
#

This one*

young knoll
#

Ah

#

It should

obsidian plinth
#

that counts for armourstands?

young knoll
#

Since armorstands are technically living entities

obsidian plinth
#

they are?

#

wtf

young knoll
#

Mojank moment

obsidian plinth
#

well ill try that ig

#

brb

rose aspen
worldly ingot
#

Yeah, was the ex from a version prior to 1.19.4?

young knoll
#

Honestly idk why the block registry isn’t a mutable one

#

Smh Mojang

worldly ingot
#

Because the client would break if it weren't synchronized properly lol

#

It shouldn't be mutable after the pallet has been initialized and synchronized

rotund ravine
#

It’d be funny if two players got different palettes

young knoll
#

Shhh

#

Don’t ruin the fun

rose aspen
young knoll
#

Freezing the registry doesn’t really accomplish much anyway

#

We can unfreeze them

worldly ingot
#

It being ENDER_CHEST instead of BLACK_STAINED_GLASS makes more sense now

obsidian plinth
# young knoll Mojank moment
        if (!event.getEntityType().equals(EntityType.ARMOR_STAND)) {
            ArmorStand armorStand = (ArmorStand) event.getEntity();
            event.getEntity().getWorld().getPlayers().forEach(player -> player.sendMessage("You placed an armor stand at " + armorStand.getLocation().toString()));
            return;
        }
```?
#

i feel like im overlooking something

worldly ingot
#

You're probably looking for EntityPlaceEvent instead

rotund ravine
#

Ah that exists

obsidian plinth
#

ive been told like 4 things what is the best way lol

#

to track who a player places a armourstand

worldly ingot
#

You want to listen for an armour stand being placed by a player. That's the EntityPlaceEvent

rotund ravine
#

Couldn’t find it on my phone

worldly ingot
#

event.getEntity() will be your armor stand, event.getPlayer() will be the player that placed it

young knoll
#

Oh wow it does exist

#

Nice

obsidian plinth
#

ok let me try agian lol

rotund ravine
#

@obsidian plinth are you a bottom?

obsidian plinth
#

switch

rotund ravine
#

Huh?

obsidian plinth
#

I JUST LIKE IT OK

#

LET ME BE

rotund ravine
#

Ahahhaa

bold gorge
#

How can I use hover/click events in an AsyncPlayerChatEvent?

I am replacing certain stuff in messages and formats with others, but I need a click AND a hover event, and I can't figure out how to do that in the format, unless I just don't see the candidate for that.

Optionally with Kyori would be good, but anything works because I don't care about RGB or HEX

obsidian plinth
#

people have told me like 5 differnt docs today for it

worldly ingot
#

We have no way to use components in chat events. On my todo list

rotund ravine
worldly ingot
#

You would have to cancel the chat event and broadcast a new message, but that breaks chat signatures

obsidian plinth
#

so i dont have to rework stuff

rotund ravine
#

I mean

#

You can fire it yourself

worldly ingot
#

but they're entities, not blocks

obsidian plinth
#

ik

#

😭

rotund ravine
#

It’s not that hard

obsidian plinth
#

i have to edit my move interface

bold gorge
obsidian plinth
#

than make a hashmap for it

worldly ingot
#

Well it would be async in the async event listener ;p

obsidian plinth
#

than clear it on turn end

#

and make sure it counts as a move

rotund ravine
#

Fun

rotund ravine
young knoll
#

MD should add some generic waiting music to applyPatches and makePatches

rotund ravine
#

Add it yourself

bold gorge
rotund ravine
#

Shocker right

bold gorge
#

fr

rotund ravine
#

Sending chat messages async is generally safe.

bold gorge
#

kk ty

bold gorge
#

Or is it just looping through players?

rotund ravine
#

Doesn’t support components does it?

#

You’d probably want to loop over recipients.

bold gorge
#

Oh wait

#

How can I get the server name?

#

I just realized I can use kyori this way :D

young knoll
#

Name?

rotund ravine
#

Bukkit.getName or smth

#

?jd-s

undone axleBOT
worldly ingot
#

It does support components. Bukkit#broadcast(BaseComponent...) should exist

#

At least I'm 90% sure it does

rotund ravine
#

He seems to be using paper too

worldly ingot
#

Oh at that point just use Adventure lol

bold gorge
#

Oh no I'm using 1.12.2

rotund ravine
#

Ah i see

bold gorge
#

But I use kyori mainly for events such as hover and click

#

But yes I use paper

rotund ravine
bold gorge
#

I'm literally in my program rn

young knoll
#

Maybe in the paper api it is

rotund ravine
rotund ravine
bold gorge
#

I mean

young knoll
#

Ah I see

bold gorge
#

Maybe it was added in an earlier version in paper ig

rotund ravine
#

It was

#

Well

#

No, but yes

young knoll
#

To be fair though Choco is still wrong then :p

rotund ravine
#

They moved everything

bold gorge
#

Btw there's a method literally called Bukkit#getServerName()

rotund ravine
#

Yes

bold gorge
#

Tbf i expected this to be like 90% of programming communities

I'm surprised there is no toxicity involved, thank you for basically being you

rotund ravine
#

We are toxic

worldly ingot
young knoll
#

Spigot subclass still makes me sadge :c

worldly ingot
#

Don't really have a choice

young knoll
#

Sadly yeah

bold gorge
worldly ingot
#

The only thee options are:

  1. getXComponent() - Gross
  2. x() - Gross, and steps on Paper's toes (less important but still a bit of a dick move tbh)
  3. Spigot subclasses
young knoll
#
  1. Make a custom fork of Java that can understand methods with identical names but different return types
#

Don't question it

rotund ravine
#

Jsut make a cooler language

bold gorge
#

Just make a new compiler

desert loom
#
  1. say screw you and just change the return type anyways
young knoll
#

But then you lose the string methods

#

And break every plugin ever

rotund ravine
#

Sad

worldly ingot
bold gorge
#

Manually configured kyori that is

young knoll
#

Kotlin spotted

desert loom
young knoll
#

MD would not approve

worldly ingot
#

We're coming up on 1.20

#

I say we do it

#

Break everything

young knoll
#

Tbh I can't tell if sarcasm

worldly ingot
#

It's like 60% sarcasm

rotund ravine
#

As if

worldly ingot
#

I definitely PR's a scorched earth change for materials a few years ago

#

Which worked, might I add!

rotund ravine
#

You guys made an extra legacy layer lel

young knoll
#

Using ASM to fix a typo anyone?

#

:p

worldly ingot
#

Best use of ASM ngl

vocal cloud
#

Before breaking everything for the love of God can you add @Since tags

#

😭

worldly ingot
#

BUT BREAKING THINGS IS HALF THE FUN

young knoll
#

That would be so many since tags to write

vocal cloud
#

YES BUT @Since THEM

worldly ingot
#

We wouldn't have to use @since tags if people would just fucking update and write against the latest version of the API, jfc

vocal cloud
#

?1.8 moment

undone axleBOT
young knoll
#

I will add @Since tags to every single method if you PayPal me $100

#

(Real)

#

For legal reasons that's a joke

vocal cloud
#

I'd do it for free

#

For legal reasons that's the truth

young knoll
#

The worst part would be finding when something was added

#

Although there is that one website

#

What was it

vocal cloud
#

Honestly not too difficult since you'd just need to start with 1.8 and work upwards

young knoll
#

What about stuff from before then :p

rotund ravine
young knoll
#

Nah there was an even better one that actually compares versions

vocal cloud
#

Anyone who uses pre 1.8 can be considered deprecated

young knoll
#

I think you mean pre 1.19

#

Ah I found it

#

sadly it stops at 1.17

young knoll
#

Sometimes I get bored

#

And tbf I would also like to have them

worldly ingot
#

We wouldn't have to use @since tags if people would just fucking update and write against the latest version of the API

vocal cloud
#

If md_5 said yes I'd do it for free

worldly ingot
#

They probably wouldn't get approved lol

vocal cloud
#

If I got the go ahead ESANhutaoinsane

worldly ingot
#

since tags would imply that we support older server versions which we don't

#

Not to mention that it would probably be a multi-thousand change PR which would probably conflict a lot of pending PRs lol

#

We tend to avoid sweeping changes like that unless there's actual benefit

vocal cloud
#

So in other words you should ban the disgusting 1.8 users

worldly ingot
#

I'm not saying no 👀

vocal cloud
#

Based?

young knoll
#

Make a bot to ban anyone that mentions 1.8

#

Im sure @undone axle would enjoy it

carmine mica
#

or the git history for a selection. ide's have really nice tools for this. At least good IDEs like IntelliJ 😜

young knoll
#

Shh I forgot about git blame

worldly ingot
#

Eclipse definitely has a Git blame as well lol

#

Yes I'm using light mode. Eat my butt

quaint mantle
#

Does anyone have a tutorial for Sending packets with entity metadata (Using protocollib) For 1.19.3?

young knoll
wise mesa
#

ok

#

in theory

#

could I theoretically

#

open up a webserver that points to my local maven repo

#

and use that as a maven repository

#

theoretically

#

nexus seems like a pain to install

granite owl
#

🔥

worldly ingot
# young knoll Wtf

Can't tell if saying wtf to the light theme, or if you weren't aware of the git blame feature

young knoll
#

The light theme

granite owl
#

🤣

regal scaffold
#

Before I asked if it was posible for me to group unrelated and separate plugins into 1 intelliJ project

#

To be able to generate separate jars but not need to create a new project each time

#

Am I able to push each module to a separate GitHub repo?

worldly ingot
#

Can you? Yeah definitely. Not entirely sure why you would want to do that though

jovial shadow
#

how could i change the fong on lucky perms ranks?

humble tulip
#
  1. Idk what's fong
late sonnet
jovial shadow
jovial shadow
humble tulip
#

It's not a development question

#

Is it?

jovial shadow
#

it is about a plugin so technically

#

yea

#

also theres no font implemented so i have to script it

#

¯_(ツ)_/¯

quaint mantle
#

hi why does this return CraftPlayer{name=richyoungkid} killed an ender dragon i need it to return just the playername

@EventHandler
    public void onDeath(EntityDeathEvent e) {
        if (e.getEntityType() == EntityType.ENDER_DRAGON) {
            String killer = e.getEntity().getKiller().toString();
            Bukkit.getLogger().log(Level.INFO, killer + " killed an ender dragon");
        }
    }
#

do i need to cast it or what

young knoll
#

.getName on the killer

quaint mantle
#

ah yes thank you

young knoll
#

Rather than toString

quaint mantle
#

makes sense

#

do you know any event which occurs when the player respawns the dragon with 4 crystals

#

like a dragonrespawnevent or smth

young knoll
#

I don’t think there is a specific event for that

#

But the normal spawn event should still fire

echo basalt
#

there's no event for that, no

#

just looking at the source

quaint mantle
#

how about this

#

when the player places a block

#

check for

#

DragonBattle#RespawnPhase

echo basalt
#

end crystal is an entity

#

but go on

quaint mantle
#

oh yeah

#

would that work

#

though

echo basalt
#

if you delay it by a few ticks it might

quaint mantle
#

yeah its 4am ill try it tomorrow

echo basalt
#

fuck me I need to migrate all of these

young knoll
#

EntityPlaceEvent

#

For end crystals

quaint mantle
#

yeah got it

quaint mantle
wise mesa
#

so that includes plugins that other people made

#

this channel is for helping people make plugins

echo basalt
#

and I'm standardizing stuff with even more interfaces

#

so that when I update data, all the menus that are rendering such data update network-wide

quaint mantle
#

what app are you creating

echo basalt
#

uhh google why not

quaint mantle
#

?

echo basalt
#

app

#

it's a minecraft plugin

quaint mantle
#

it is?

#

it doesnt look like it

echo basalt
#

yes

quaint mantle
#

CalendarDaySelectionMenu

#

doesnt seem minecrafty

#

what is the plugin for?

echo basalt
#

well it's a bit big

#

there is no singular goal like

#

we're at 1mb right now and we aren't even ready for alpha

#

and we have some classes

quaint mantle
#

classlistmenu classroommainmenu

#

seems interesting

echo basalt
#

oh god these menus are idiotically made

echo basalt
quaint mantle
#

Cool

echo basalt
quaint mantle
#

All that for a Minecraft plug-in?

echo basalt
#

yes

wise mesa
#

what does the plugin do

#

just roughly

echo basalt
#

it has some features

wise mesa
#

if you're allowed to say lol

young knoll
#

It’s actually a join and leave message plugin

wise mesa
#

oh of course

echo basalt
#

like a custom scripting language, in-game script editor

wise mesa
#

that makes a lot of sense

echo basalt
#

custom npc stuff

echo basalt
#

dialogues

#

uhh

#

image boards

wise mesa
young knoll
#

Exactly

echo basalt
#

it can associate a cloudflare subdomain to an email

#

so that when you join through a specific subdomain and play, that e-mail address gets associated with you

wise mesa
echo basalt
#

so I can do stuff like

wise mesa
#

woah

echo basalt
#

and playing n shit

young knoll
#

Is that the best way to associate an email address

echo basalt
#

It's meant for groups and events

young knoll
#

I see

echo basalt
#

So that the host only needs to do basic setup

#

and the other players just need to join through an ip instead of actually typing something in chat

young knoll
#

So it’s not to associate a single email address to a single player

echo basalt
#

yeah it creates a group and associates an email and subdomain to that group

young knoll
#

Neat

echo basalt
#

other stuff is like

#

automatic skin overlays

#

where we have this skin .png that automatically gets parsed and color matched

#

and overlayed on top of your skin

#

so you can apply suits n shit

#

and it like precompiles skins and wipes the skin cache when you change your skin

#

other stuff is like

#

graphs

wise mesa
#

I have

echo basalt
#

so I have this

wise mesa
#

not that many classes

#

lmao

wise mesa
#

sweet

young knoll
#

I remember when wynncraft used skins to apply custom armor

#

It was neat but it worked maybe 5% of the time

echo basalt
#

and this

wise mesa
#

pretty

echo basalt
#

yes

#

and there's a bunch more stupid shit

wise mesa
#

and i thought I had a lot of code

#

wait wait its more than it looks there

#

you have to click on it

#

still not alot

#

oh while im here

#

okay i have a class called resourceapi

#

er rather an interface

#

and its a stupid name

#

it just lets you get all the managers

#

but idk what to call it

#

but having Api in the name makes me feel dumb

young knoll
#

ManagerManager

#

:)

wise mesa
wise mesa
#

i hate how intellij complains about no usages for something that's meant to be a public api

river oracle
#

but you can disable it I think

#

I remember someone mentioning it

wise mesa
#

like I understand it

#

would make sense if this was some internal code

#

but this is public facing

echo basalt
#

first menu done, like 20 others to go

wise mesa
#

wow

#

that took an amount of time

echo basalt
wise mesa
#

oh

#

yea

echo basalt
#

and it had some weird concurrency stuff going on

#

and I had to separate all the logic

wise mesa
#

i just mean

#

you've got like 20 more to do

#

seems like its gonna take a while

echo basalt
#

ehh I charge hourly rates

young knoll
#

Hey if it works who cares how good the code is

#

The world runs on duct tape and prayers

echo basalt
#

I mean yes but instead of updating a temp variable or something

#

the idiot that wrote this decided to put it all on a map

#

and instead of using negative values to say unlimited, for example

#

the idiot does a check every time the value changes

#

I basically need to convert method params to constructor params and replace every single mutable call with an atomic reference

#

and then strip the logic into a "setup" and "update"

regal scaffold
#

Hey

#

Lets say I want to do configurable ChatComponents

#

Like from config.yml be able to change hover actions, colors, text, everything

#

I can't seem to think of a good way to do it that isn't hard to figure out

young knoll
#

You’d have to do json

#

Since that’s how Mojang represents them in a readable way

lost matrix
#

Well, you could also abstract it away and store it in yml

young knoll
#

Or you could use minimessage

regal scaffold
#

Parse json from config to component

#

Minimessage I looked at it a bit

#

Seems interesting

#

So if I did minimessage all I would need in the config is just 1 line for the message

#

And then the entire thing is customizable

young knoll
#

Yes

regal scaffold
#

That is interesting

young knoll
#

Then you parse that into an adventure component

#

Which you can then serialize into a bungee component

regal scaffold
#

Kinda cool

echo basalt
#

adventure parsing minimessage is surprisingly easy

regal scaffold
#

xd

young knoll
#

It’s one line

echo basalt
#

yes

regal scaffold
#

Jesus

#

I'm looking at the docs

#

It supports

#

everything

#

wtf

young knoll
#

Mhm

echo basalt
#

it's also a shithole thumbsup

regal scaffold
#

What do you mean

echo basalt
#

it tries to be all multiplatform and all

lost matrix
#
messages:
  join_message:
    components:
      - text: "Welcome to the server, "
        color: "dark_aqua"
      - text: "%player%"
        color: [200, 160, 134]
        hover:
          text: "Click to view %player%'s profile"
        click:
          action: "/show_profile %player%"
      - text: "!"
        color: "dark_aqua"

Thats what i just made up.
I think you can translate this into components pretty easily

echo basalt
#

but you gotta shade it unless you want to force everyone to use paper

regal scaffold
young knoll
#

I mean what other choice would they have

echo basalt
#

and if you're using paper, it literally deprecates everything that's not adventure

regal scaffold
#

I see what you mean

young knoll
#

To be fair spigot is kind of a black sheep

regal scaffold
#

But if you're making something private

#

For just 1 person

echo basalt
#

this'll be fun

young knoll
#

Paper, sponge, and fabric can all handle adventure

regal scaffold
#

I think minimessage is fantastic

#

Even includes Score and NBT support which is kinda crazy

lost matrix
#

Yeah minimessage is pretty neat when it comes to single String input

regal scaffold
#

I'm also looking at

#

"Inserting"

young knoll
#

At least shading isn’t really an issue now

regal scaffold
#

It feels like aikar context resolver

#

Similar

young knoll
#

You can just use the libraries feature

wise mesa
regal scaffold
#

Don't really get exactly what the use case would be

#

But

river oracle
#

why does spigot do bungee components instead of adopting adventure I've always wondered

#

just easier I assume

young knoll
#

Bungee components were around much earlier

regal scaffold
#

Problem about spigot is

#

It never adapts

lost matrix
regal scaffold
#

Spigot has barely had changes

regal scaffold
#

Yeah definately would just use PAPI

river oracle
regal scaffold
#

I do wonder what part of the message you send to papi

river oracle
#

makes sense I suppose

regal scaffold
#

I assume it's the first thing you do

#

Get string from config -> Parse into PAPI -> Adventure

young knoll
#

I mean it would be fully possible to switch since only a few things support bungee components still

#

But I don’t think MD is interested

regal scaffold
#

They hate change

#

They don't care to upgrade technologies to latest

young knoll
#

Well, yes and no

regal scaffold
#

There hasn't been a major change in too long

young knoll
#

Spigot is designed to maintain as much backwards compatibility as possible

regal scaffold
#

They just add compatibility for next version and call it a day

river oracle
#

hopefully material enum gets an overhaul soonish hear

regal scaffold
#

Just overload methods if you want to keep backwards compat too

lost matrix
#

For the longest time, 1.8 simply held back development of newer features.
Because backwards compatability screwed up quite a bit of the design

regal scaffold
#

But they just don't do anything really

lost matrix
#

Thats also why i hate 1.8 so much

regal scaffold
#

I do feel like spigot is heavily understaffed

river oracle
#

1.8 sucks

young knoll
#

Spigot has uhh

#

Maybe 5 active contributors

regal scaffold
#

Maybe less

#

And the changes are minimal

worldly ingot
#

We always welcome more

young knoll
#

And only MD can commit actual changes

river oracle
#

I hope to be more active of a contributor just tryna take it one step at a time rn

echo basalt
#

thanks copilot

river oracle
#

it knows

#

lmao

regal scaffold
#

Honestly idk, mixed opinions about spigot, website is 2006 at most

#

Feels like only a few people do stuff

lost matrix
young knoll
#

The website is a separate issue

river oracle
young knoll
#

MD doesn’t know PHP to make xenforo addons

echo basalt
#

I just happen to not turn off my pc for weeks

#

unfortunately I gotta turn it off tomorrow

regal scaffold
#

I guess we have to consider that spigot is fully free

#

Can't ask for more

echo basalt
#

as I'm catching a train to 40km away to grab my replacement water cooler

#

and my new power supply also arrived

young knoll
#

Im trying to work through old issues and feature requests

lost matrix
regal scaffold
#

It's easy to say it like that

lost matrix
#

For example: Non-blocking world loading.

echo basalt
#

fully multithreaded block support

regal scaffold
#

Yet you are aware that those type of changes would most likely not get accepted

young knoll
#

That’s not true

regal scaffold
#

Cause it's a big change, and spigot doesn't do big changes

echo basalt
#

guys I had a really cool idea

lost matrix
river oracle
#

Yeah

regal scaffold
#

I read the commits for a few hours

river oracle
#

Clearly

echo basalt
#

what if we deprecated all strings and we just forced everyone to use adventure

young knoll
#

On it

remote swallow
#

md will personally ban you from every spigot relating site

river oracle
#

I hate components especially for simple shit

#

It's so over the top

young knoll
echo basalt
#

nah bro it's intended behavior

remote swallow
#

i wonder how i can randomly generate a nice? math question

echo basalt
#

player.sendMessage(Component.text("debug 1"))

lost matrix
#

When migrating i had 3 lines of code getting bloated into 1 new util method and 1 new builder method with >20 lines each

young knoll
#

Two of the big tasks atm are adding component support to more stuff

#

And replacing various enums

echo basalt
#

guys I just had this idea

#

what if we added component support to action bar messages

#

so that you can like

#

hover over them and click then to run a command or maybe some malware

lost matrix
#

"click it" (lol)

river oracle
#

Can you even do that lol

young knoll
#

Pay no mind to the fact that action bars already have component support

echo basalt
#

no

young knoll
#

No

echo basalt
#

or even guys

#

or even

lost matrix
#

Tell me when you got your cursor on the action bar XD

echo basalt
#

send the words "Raw Chicken" but localized in your language LETSGOOOOO

remote swallow
river oracle
#

True

young knoll
#

Hey

#

Translation components are great

regal scaffold
#

Make a plugin that forces english for the client

echo basalt
#

if I wanted translation I would have opened duolingo

regal scaffold
#

Malware to force language

remote swallow
#

math question

river oracle
remote swallow
#

that isnt trailing hundreds of decimals

young knoll
#

Does it handle every item in minecraft

echo basalt
#

guys

remote swallow
echo basalt
#

component support in mfing zombie nametags

lost matrix
remote swallow
#

something that doesnt have decimals

echo basalt
#

69?

#

bruh

young knoll
#

I assume he doesn’t want 100 / 3

remote swallow
#

would you like to be solving 94*68-284 + 9

regal scaffold
#

Holograms with TextComponents

lost matrix
river oracle
young knoll
#

Because that’s not a nice answer

regal scaffold
#

Hologram minimessages

echo basalt
#

I remember there was something magical about dividing stuff by 9

#

yeah

#

so

young knoll
#

Components will come to everything that supports them

#

Soon™️

echo basalt
#

x / 9 becomes 0.xxxxx

lost matrix
#

You need to define what a nice math question is first

echo basalt
#

like

#

123 / 999 = 0.123123123123123

river oracle