#help-development

1 messages · Page 870 of 1

lost matrix
#

I see. Packets are honestly not much different than just loading data from disk. Just that the data is sent by someone else.

shadow night
#

with basic knowledge of programming you could probably remake the minecraft packet system in like 30 minutes

lost matrix
twilit creek
#

Yea the theroy behind it is nothing "really" new for me. I'm doing it also at work but the practicle thing behind it (java) is a bit interesting for me as im working also with Java as programmer.

shadow night
#

why is this not named "CraftBukkitScheduler"

chrome beacon
#

Craft is just the implementation prefix

shadow night
#

damn, I'm depressed now

twilit creek
lost matrix
#

Just realized that im already 4y into programming now o.O
Time flies PES2_SadGeRain

shadow night
#

hmm, I'm wondering rn, what would be better, an async timer task that schedules stuff to the main thread whenever needed or just a normal timer

chrome beacon
#

Java edition just uses TCP connections to the server

lost matrix
twilit creek
shadow night
#

it started out as a meme, basically, so don't ask any stupid questions cuz this project is stupid in general, okay?

hybrid turret
#

Just out of interest bc I'm meaning to implement a SQLite database into the plugin eventually. Would it make sense to store a json string in a database?
It sounds stupid, but I don't know how else I could store ItemStack-Arrays in a database.

hazy parrot
#

Would it make sense to store a json string in a database?
It wouldn't

#

that is why relations exist

eternal oxide
shadow night
lost matrix
hazy parrot
eternal oxide
#

I'd keep it all seperate. You never know when someone will spam your external interface.

shadow night
hybrid turret
#

Like an item vault

eternal oxide
lost matrix
#

I mean a single ItemStack as json in a DB sounds reasonable. But the rest should be done through relations.

hazy parrot
#

yeah that is why i asked again

hybrid turret
#

ohhhhhhhhhh

#

Yeah then that

hybrid turret
#

Storing the whole inventory is only the final goal

#

So I then basically use a combination of SQL-statements and GSON?

summer gale
#
name: WoolWars5118
version: '${project.version}'
main: org.bingogames.woolwars5118.WoolWars5118
api-version: '1.8.8'
commands:
   woolwars5118:
     description: "WoolWars5118 main command."
     usage: /woolwars5118
     aliases:
      - WW

The alias isnt working

#

In 1.8.8

chrome beacon
#

Remove api-version

#

Not related to your issue, but you've set it to an invalid version

summer gale
#

ok

terse pumice
#

I'm trying to use ProtocolLib to make players partly invisible (i want their armour to be seen - like with an invisibility potion) - I've sent invisibility potion packets to the players and it seems like the client knows they have the effect however the player is just not appearing invisible, does anyone know if there is a different packet for making a player actually become invisible?

young knoll
#

Appearing invisible for themself or for others?

#

If you want them to be invisible for others you need to send that packet to the other players too

terse pumice
#

To others (currently I am also sending it to themselves just because I am trying to understand why it's not working haha)

#

Even with the effect I am still fully visible aha

shadow night
#

the ininvisibility effect

terse pumice
latent summit
#

anyone know any servers i can use to commision a plugin dev?

chrome beacon
#

?services

undone axleBOT
latent summit
icy monolith
#

Would it be fine for the server to handle me looping thru a large ammount of blocks and doing checks with each.

I have a big stone cube and i need to loop thru it and find a random location that isbinside the cave to spawn a block. I tought about checking if the block has air next to it in any dirrection then add it to the list. After its done looping it generates a random number from 0 to list lenght and selects that block.

Basicly i have a cube and inside of it i have caves carved out.

valid burrow
#

depends

#

on many things

#

how strong is the server

#

how many blocks

#

are the blocks already loaded

young knoll
#

How often

#

That’s a big one

valid burrow
#

all of these mattee

#

?tas i guess

undone axleBOT
young knoll
#

I once looped over every block in a chunk to look for caves

#

When the chunk first generated

icy monolith
#

I can also generate the list before and save it and then just pull a random block out of that

forest pumice
#

I have a file for my custom yml files inside "resources" of my plugin folder. When I load my configuration files, do I need to do something specific because it is in the resources folder? Or can I just do something like:

plugin.getDataFolder().getAbsolutePath() + File.separator + "YamlFiles";
eternal oxide
#

new File(plugin.getDataFolder(), "yamlFile")

#

so long as you saved it first

forest pumice
#

thats it?

eternal oxide
#

plugin.saveResource("yamlFile")

forest pumice
#

yeah I do have a save check method if it doesn't exist on onEnable

#

but like it doesn't matter what folder its in?

eternal oxide
#

it defaults to the plugins data folder

forest pumice
#

which is resources?

eternal oxide
#

or are you talking about a folder inside your resources?

forest pumice
#

yeah

#

a folder inside resources

eternal oxide
#

those are paths, but ok

forest pumice
#

what

eternal oxide
#

a saveResource call will extract it maintaining the structure

#

you need to read it with that same structure, once its saved

forest pumice
#

does that mean when using saveResource I need to also specify the folder inside resources? this is a bit confusing cause its my first time doing it

eternal oxide
#

so your path would be...java folder = new File(plugin.getDataFolder(), "YamlFolder"); file = new File(folder, "fileName");

forest pumice
#

aha

icy monolith
#

Anyone knows how to deal with SQLite exceptions? I use SQLite and ORMLite to simplify the sql syntax.
And i get an error when i try to get the databases value. And i have no idea how i can find where the issue is.
Its eather that the player is not being generated in the data base or that for skme reason it errors in the return function.

#

If i fix this then i can fix all of my database issues

eternal oxide
#

?nocode no error, nothing to work with

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

icy monolith
#

Bc it is something that has to be asked in DMs

eternal oxide
#

?ask

undone axleBOT
#

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

eternal oxide
#

No reason it has to be in DMs

icy monolith
#

Ok ill ask later

#

when i have the error or code ready

quaint mantle
#

Hi , if mod send a message will can minecraft servers like spigot read the message ?
for example a mod say "Hello I am Mod " and in the console of server be log the "Hello I am Mod"
or be read the message on server

shadow night
#

what?

molten hearth
#

I think he's talking about is a mc mod (e.g.a forge mod) sends a custom packet will spigot be able to handle the packet

molten hearth
quaint mantle
eternal oxide
#

if the mod uses PMC then yes

quaint mantle
#

do you mean player.sendmessage(); ?

molten hearth
#

Plugin Messaging Channel

quaint mantle
molten hearth
quaint mantle
eternal oxide
#

Server does nothing with it, unless it's in a specific channel

quaint mantle
#

ok

icy monolith
#

It lead me back all the way to the onEnable function

#

Anyways, still one thing related to this. To represent true or false in the data should i just use 0 and 1. bc from what i see, you cant use booleans

eternal oxide
#

you can use Boolean IF your driver is new enough

#

older use Int

minor jetty
#

How in InventoryClickEvent check for inventory?

inner mulch
#

does somebody know if redis is as fast as having data in server memory?

echo basalt
#

It isn't

#

Average operation latency is ~1ms

#

If on a local machine

inner mulch
#

whats the in memory latency then?

echo basalt
#

IO

inner mulch
#

~1ms seems pretty fast

echo basalt
#

1-3ms

inner mulch
#

doesnt that mean its on the same level?

echo basalt
#

no

#

it means that if you want to fetch data for 100 players

inner mulch
echo basalt
#

no

#

if you do separate requests it takes 300ms

#

use it like any other database

#

async

inner mulch
#

i dont want to use it as a database, i want to use it to cache data from a real database and im not sure if its worth it as im currently caching the data myself already

echo basalt
#

You can use it as a caching layer

#

For example, when a player joins you fetch its data (redis first then your database )and store it on ram

#

When a player quits you store that data back on redis for ~30 minutes

#

So that if a player rejoins you have less latency

#

Basically you want to define a lifetime for your data

#

And match it to something else's lifecycle

inner mulch
#

so redis fetches from database, server fetches from redis

#

and redis keeps it for a period of time to reduce latency

echo basalt
#

server fetches from redis, if fails fetches from database and puts on redis

inner mulch
#

okay, may i ask are you using redis yourself and which database do you use?

echo basalt
#

I'm not workin on any projects that use redis as a cache layer as of right now

#

But last time I did it was mongo + redis

#

And it was a classroom system similar to discord servers

inner mulch
# echo basalt I'm not workin on any projects that use redis as a cache layer as of right now

do you think i should just fetch from redis all the time instead of caching it on my own too. It would be much easier and solve a few issues i currently have. The reason for redis is that i created a proxy with a few servers and with my old data system i encountered issues because the joinevent is called before the quitevent.(when a player switches servers in the proxy) When reading and writing to redis all the time there wouldnt be this issue as the data would be saved on disconnecting from the proxy or joining

quaint mantle
#

someone give me example for #TabCompleteEvent ?

i wanna disable all tabcompleters

    public void tabComp(TabCompleteEvent e) {
        e.setCancelled(true);
    }```
and i tried to change tab-complete in spigot.yml
ivory sleet
#

and then redis be the second layer

inner mulch
inner mulch
quaint mantle
#

it looks ugly

inner mulch
# quaint mantle yes

in this case you can just set a permission for the commands that shouldnt be seen

#

cancelling all the tabcompletion is a not so nice way in my opinion

quaint mantle
#

well can i use bukkit permissions or i need plugin ?

inner mulch
#

you are going to need a permission manager like luckperms to get the permission to see the command, but setting the permission doesnt need any plugin

quaint mantle
#

i did this

inner mulch
#

getCommand("blabla").setPermission(string permission);

inner mulch
inner mulch
young knoll
#

You can also just put it in the plugin.yml

shadow night
#

true

quaint mantle
#

i did this

remote swallow
#

send namespaced

quaint mantle
#

wdym

south mason
#

how can you track the transfer of an item from 1 slot to another in your inventory\chest?

remote swallow
icy monolith
#

In my SQLite data base when i set players value from false to true it some how still returns false when using the get function for that data.

The .db files are successfully created, my player id is visible and there are no errors.

The get function returns it as false even after changed to true. I even made it print out the value right after setting it and it showed it as true.

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

icy monolith
# hazy parrot ?nocode

Which part do you want exactly? The command that excecutes, the data class, the dataservice class?

Note i use ORMLite with SQLite

river oracle
#

ORM man imagine not going raw on the SQL goodness

river oracle
#

?paste

undone axleBOT
icy monolith
#

hello?

tribal quarry
#

Hello there

river oracle
undone axleBOT
tribal quarry
#

I wanted to ask a question about bukkit velocity

icy monolith
river oracle
#

We don't support velocity

river oracle
#

A link

#

Velocity is maintained by a fork of spigot thus we can't guarentee it works or any features or compatability

icy monolith
tribal quarry
river oracle
#

Oh that kind of velocity xD

eternal night
river oracle
river oracle
#

It's been 6 minutes be patient

winter galleon
#

whats the knockback event?

eternal night
#

Well ehm, share some code I guess. How are you fetching the velocity ? When are you fetching it

river oracle
#

Let's see

#

?jds

#

?jd-s

undone axleBOT
river oracle
#

There is no such thing as a knock back event currently

eternal night
#

I mean, what would that even entail

#

like, from an attack ?

river oracle
eternal night
#

or entity collision

winter galleon
#

and how could i cancel the knockback?

river oracle
#

Set velocity to 0 I suppose

#

That cancels all momentum

#

@young knoll work faster we need knockback event for this mans

young knoll
#

Last I checked it's just waiting on merge

river oracle
winter galleon
#
        Player p = (Player) event.getDamager();
        Player e = (Player) event.getEntity();
        if (taserati.contains(e)){
            Vector v = e.getVelocity();
            v.setX(0);
            v.setY(0);
            v.setZ(0);
            e.setVelocity(v);
        }
    }```
#

like that?

river oracle
#

Code lgtm getting an error or anything?

quaint mantle
#

how do i make this ?

#

is this client side ?

icy monolith
# tribal quarry no help?

Don't be surprised. This is SpigotMC, most of the time its disrespect and not help. I come here with a 10% chance that there is some one acualy willing to help online.

#

They have a history

#

Every dev i know relates to the same issues with this dc

eternal night
pure hazel
#

Can someone help me. my znpcs skin is not fetching my own skin
error: cant fetch skin with name "N8han40"

lost matrix
trim lake
#

What shoudl be best way to dettect if player equip armor with rightlcick? I had this, but code gets triggret if player clicked on crafting, bed or something like that, but armor wont be equipped so my code would run and it should not.

@EventHandler
    public void onInteractEvent(PlayerInteractEvent event) {
        ItemStack handItem = event.getItem();
        Player player = event.getPlayer();
        ItemStack helmet = player.getInventory().getHelmet();
        if (event.getHand().equals(EquipmentSlot.OFF_HAND)) return;
        System.out.println("INTERACT " + player.getName() + " item: " + handItem);
        if (event.getAction().equals(Action.RIGHT_CLICK_AIR) || event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
            if (handItem == null) return;
            if (handItem.getItemMeta() == null) return;
            if (!HelmetManager.isHelmet(handItem)) return;
            if (helmet != null) {
                if (HelmetManager.hasMaskApplied(helmet)) {
                    MaskEffect healthEffect = MaskEffect.HEALTH;
                    if (HelmetManager.haveEffect(helmet, healthEffect)) {
                        double effectValue = HelmetManager.getEffectValue(helmet, healthEffect) * 2;
                        removeHealthModifier(player, effectValue);
                    }
                }
            }
            if (HelmetManager.hasMaskApplied(handItem)) {
                MaskEffect healthEffect = MaskEffect.HEALTH;
                System.out.println("EFFECT? " + HelmetManager.haveEffect(handItem, healthEffect));
                if (HelmetManager.haveEffect(handItem, healthEffect)) {
                    double effectValue = HelmetManager.getEffectValue(handItem, healthEffect) * 2;
                    addHealthModifier(player, effectValue);
                }
            }
        }
    }
pure hazel
lost matrix
lost matrix
pure hazel
#

i will send you the znpcs file

#

thats the one you need ig

trim lake
tardy flame
tender shard
#

also from randomly looking at your previous messages, it seems like any of your questions got a reasonable answer lol

icy monolith
icy monolith
tender shard
#

hm my experience is the opposite. most of the times people are here to answer questions all the time, even when looking at the javadocs for 3 seconds would have answered most questions

shadow night
#

I'm here to teach people to follow the fucking conventions

minor junco
#

¯_(ツ)_/¯

tender shard
#

or maybe I'm mixing things up rn

eternal oxide
#

He asked the SQL one three hours ago but had no code or error so I couldn't help him then

icy monolith
icy monolith
tender shard
#

and it seems like you're just executing a query and changing some values in the result instead of doing any changes to the database

#

you're not changing anything in the database

tribal quarry
# icy monolith I asked for help 1h ago. They asked for code and ignored it.

I'm not here to cause argument, but, this is not the problem with spigotmc, there are different people, different solutions and the difficulty of questions vary in different ways. but Y2K's response was not a 100% correct way to deal with stuff, reading mistakes happens, especially when you are trying to answer someone else (or doing something else) but I rather do more research on more communities, code to get my answer

tender shard
eternal oxide
#

yeah I see no update issued

icy monolith
#

Isn't that used to set the data

eternal oxide
#

it doesn;t pass it back to the db though

tender shard
eternal night
#

Why are you using ORMLite in the first place

zealous osprey
#

I want some code review.
I got this function which distributes some tasks to a ThreadPool and I want to check when all tasks were complete.
Moreover, I call this function every tick, and I want to make sure that casts which are batched in a tick also return the appropriate future and when it completes.
But it kinda feels weird to do it like this; I would love a second opinion.

eternal night
#

like, I don't wanna be rude but I presume you are not basing this on 10 years of SQL experience ?
It might be better to (at least for now) stick to doing SQL yourself

eternal night
#

ORMs are magically little unicorns that look great from far away but when you have to get close they'll bite your head off while you have to workaround some dumb restriction in their design

#

I would certainly not suggest them if you are trying to learn/are learning SQL

tender shard
icy monolith
# tender shard

So i should do daoSettingsData.update() after is what im getting?

eternal oxide
#

yes

tender shard
eternal night
#

I wonder how efficient that thing is with the update() call kekwhyper

tender shard
#

and as I said, chatgpt also thinks that you need to call update, as I guessed

zealous osprey
tender shard
#

well you're supposed to return the future that allOf generates, instead of creating your own future and completing that when the allOf future is complete

eternal night
#

any point in not just draining your queue initially ?

zealous osprey
#

fair, idk why I didn't do that

eternal night
#

this draining and adding it to both a list and the executor seems weird

zealous osprey
#

Sorry I didn't really understand that, could you phrase it differently?

icy monolith
#

Then i found out about ORM

eternal oxide
#

I like the look of ORM and it's tidy to use, but best to know the basics first.

shadow night
#

SQL is english in caps

zealous osprey
eternal oxide
#

ORM is for when you already know how it works and want to avoid writing your own queries

eternal night
#

like, why not just

public CompletableFuture<Void> processQ() {
  final List<CF<CResult>> drainedQ = new ArrayList<>();
  while(!q.isEmpty()) drainedQ.add(q.poll());

  return CF.allOf(
    Lists.transform(source, input -> {
        executor.submit(() -> {
            processCast(input)
            input.fut.complete(....)
        });
        return input.fut;        
    })
  )
}
eternal night
#

if you are smacking stuff into it off thread its a valid thing

#

I mean, it realistically does not make a difference

#

don't mind me xD I'll go now. My suggestion is not smart

#

like, you already have a CF that wants to be completed and an executor. I don't understand the point of a queue that needs all of its abitrarily pulled "requests" to finish simultaniously. Or well, that wants to await those

#

but I digress, probably fine. I would not suggest a LinkedList

#

they are notoriously terrible

#

especially as you are not removing from said list

zealous osprey
upper hazel
#

in bukkit api exists event be like - "hopperEvent"?

#

interact block with hopper

remote swallow
#

when a player interacts with a hopper?

#

that would be normal interact event

lost matrix
upper hazel
#

prevent the stove from being refilled with resources from the hopper

upper hazel
#

thenks

terse ore
#

Does someone know if it's possible to code fishing on lava? If so, would you mind linking a resource, i've been unable to find one

pliant topaz
#

It certainly is, but i don't know how

cobalt thorn
#

How can i use a sort of setblock with nbt data like in the command a sort setblock ~ ~ ~ minecraft:mob_spawner 0 replace {nbt} the example is from 1.12 but the 0 is the blockstate

young knoll
#

Numeric block states don't exist after 1.13

sullen canyon
#

my god (my personal not the jesus) java is great

sterile token
terse ore
#

I want to make some special fish that can only be fished from lava

sterile token
#

oh okay, perfect. Hmn i havent really worked with fishing but now you explained better someone can read it and try to help

#

sorry tho

terse ore
#

no problem

winter galleon
#

how can i check if a player has an inventory open?

river oracle
#

?jd-s

undone axleBOT
eternal oxide
#

you can't

#

getOpenInventory will always return an Inventory instance, even if you have none open

tender shard
#

shouldnt kotlin know that it.value is a string here? I'm literally checking it the line before

waxen plinth
#

why don't you just call .toString()

#

won't a String simply return itself anyways

tender shard
waxen plinth
#

just do val value = it.value.toString()

tender shard
#

I'm just wondering why kotlin thinks that a cast is neccessary

waxen plinth
#

no if needed

#

idk

eternal night
#

cooler kids would use the when syntax here obvs

waxen plinth
#

kotlin does that with some weird compiler checks I think

tender shard
waxen plinth
#

rather than like pattern matching

waxen plinth
#

because you call toString if it's not a string

tender shard
#

yeah true

waxen plinth
#

so it'd just be value?.toString() wouldn't it?

tender shard
#

anyway the question is why is it needed

waxen plinth
#

¯_(ツ)_/¯

tender shard
#

because kotlin usually supports these auto casting stuff or however its called

waxen plinth
#

probably a case where the kotlin compiler just fails to pick it up because it's an expression rather than a scope?

#

not sure

#

a match can probably do what you want anyways can't it

eternal night
#

I mean

waxen plinth
#

is it map or switch in kotlin I forget

eternal night
#

it is calling a method there

waxen plinth
#

a field

eternal night
#

no

#

a method

dry hazel
#

it's needed because it's probably a property where the mutability cannot be confirmed

eternal night
#

yea

waxen plinth
#

it.value is a getter?

#

ohh

#

yeah

eternal night
#

given that is a Map.Entry yes

waxen plinth
#

you'd have to store it in a local ig

eternal night
#

or just when() that shit

waxen plinth
#

this is why sum types are better than oop

tender shard
eternal night
#

what

tender shard
eternal night
#

you are iterating a Map.Entry

tender shard
#

I am iterating a kotlin.collections.Map.Entry

eternal night
#

is that backed by a java type ?

waxen plinth
#

.value is definitely just calling .getValue() on the entry

eternal night
#

I don't see you converting it into some mystical kotlin type

tender shard
waxen plinth
#

oh, huh

#

it must be because it's a field rather than a local, then

dry hazel
#

show what the IJ error is

eternal night
#

it is literally an abstract val kekwhyper

dry hazel
#

anyways it.value as? String ?: it.value.toString()

waxen plinth
#

I'm guessing the scoped downcasting only works on locals

eternal night
#

its an abstract property

#

kotlin is such a useful and great language kekwhyper

waxen plinth
dry hazel
#

that's not the same thing

waxen plinth
eternal night
#

Well and this shit

waxen plinth
eternal night
#

abstract properties OMEGALUL

tender shard
#

yeah why not?

eternal night
#

well, at least I hope you understand why it is failing

dry hazel
#

it.value.toString() yes

waxen plinth
#

I guess you end up with an NPE if there's no value :)

tender shard
eternal night
#

indeed

waxen plinth
#

oh wait I see

#

value is not nullable

#

yeah then there's no issue

eternal night
#

good language design NODDERS

waxen plinth
#

if value is not nullable then it's just it.value.toString()

young knoll
#

I can never tell if sarcasm from Lynx

waxen plinth
#

definitely sarcasm

#

kotlin has very mid language design

#

if you wanna see good lang design look at rust 🙏

eternal night
#

kotlin syntax makes rust lifetimes look sane

waxen plinth
#

lol

#

rust lifetimes are scary but you never really need to tango with them if you use the right tools

#

just throw a couple smart pointers in and you'll never need to bother with lifetimes

dry hazel
eternal night
#

Yea I mean, its a thing you don'T ever wanna touch given how leaky that shit is

tender shard
waxen plinth
#

mm

eternal night
#

lifetimes kekwhyper

waxen plinth
#

how's it leaky

eternal night
#

like, leaky as in it forces itself up the chain

waxen plinth
#

ahh

eternal night
#

same shit with like, async in js

waxen plinth
#

yeah it has a tendency to get everywhere if you're not careful

eternal night
#

Yeaaa

waxen plinth
#

but you can cut off the chain with a smart pointer anywhere

eternal night
#

But again, sane compared to kotlin

#

so I take it

waxen plinth
#

kotlin has too much syntax

#

rust has a lot more syntax I think, but it doesn't feel like it does

summer sandal
#

i need some help

waxen plinth
#

because it's all so consistent that I've almost never looked at new syntax and been genuinely clueless as to what it's doing

waxen plinth
eternal night
#

throw your question in here ^

waxen plinth
#
  • code and any relevant errors
#

I wonder why this channel still hasn't been converted to forums

summer sandal
#

[21:21:29 ERROR]: Could not load 'plugins/swordprogressionplugin-1.4.1-BETA.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: Plugin cannot be null
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:157) ~[purpur-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:417) ~[purpur-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:325) ~[purpur-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.loadPlugins(CraftServer.java:451) ~[purpur-1.19.jar:git-Purpur-1735]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:313) ~[purpur-1.19.jar:git-Purpur-1735]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1138) ~[purpur-1.19.jar:git-Purpur-1735]
at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:308) ~[purpur-1.19.jar:git-Purpur-1735]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.IllegalArgumentException: Plugin cannot be null
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-31.0.1-jre.jar:?]
at org.bukkit.NamespacedKey.<init>(NamespacedKey.java:74) ~[purpur-api-1.19-R0.1-SNAPSHOT.jar:?]
...

waxen plinth
#

code?

summer sandal
#

It wont fit in a msg lmao

sullen marlin
#

?whereami

waxen plinth
#

looks like you're passing null to a NamespacedKey you're initializing

dry hazel
#

purpur

young knoll
#

?paste

undone axleBOT
young knoll
#

Ope md smelled the purpur

eternal night
#

the purpur.yml is pretty easy to smell given its size

summer sandal
#

public class SwordProgressionPlugin extends JavaPlugin implements Listener {

private NamespacedKey swordProgressionKey;

public SwordProgressionPlugin() {
    // This is where you initialize your plugin
    swordProgressionKey = new NamespacedKey(this, "sword_material");
}
protected static SwordProgressionPlugin instance;

public void onEnable() {
    getLogger().info("SwordSMP - Plugin has been successfully enabled.");
    getServer().getPluginManager().registerEvents(this, this);
}
private final NamespacedKey materialKey = new NamespacedKey(SwordProgressionPlugin.getInstance(), "sword_material");


public static SwordProgressionPlugin getInstance() {
    return instance;
}


@EventHandler
public void onCraftItem(CraftItemEvent event) {
    // Check if the crafted item is a sword
    Material craftedMaterial = event.getCurrentItem().getType();
    if (isSword(craftedMaterial)) {
        // Prevent crafting any sword (or other logic)
        event.setCancelled(true);
        event.getWhoClicked().sendMessage("You cannot craft swords!");
    }

getting no errors in intelij idea
Ik some java not spigot api tho

#

i kinda made my plugin with chatgpt

tender shard
#

?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() {

    }
}```
eternal night
#

You are supposed to head to the purpur discord pretty much 😅

#

given you are not using spigot

#

they can offer better support for their API

summer sandal
#

Im using spigot api tho

eternal night
#

Ah

summer sandal
#

i declared spigot api in pom.xml

#

so i came here cuz its a spigot plugin

eternal night
#

Well, you never set the instance

tender shard
summer sandal
#

what do i change?

tender shard
summer sandal
#

server softwares purpur, the plugin is spigot (Can you even make a purpur plugin)

summer sandal
#

Im too dumb

#

all ik is some jsva

tender shard
#

null ^

summer sandal
#

that i learned from a youtube tutoril

#

remove that?

#

or wat

#

remove the red thing ?

tender shard
#

?

summer sandal
#

What do i change

#

to make it finally work havent slept in forever

tender shard
#

either create that key the same way you create the other key, or properly set your instance in the constructor

summer sandal
#

Ok ty ima ask chatgpt for more help

#

💀

tender shard
#

there should be 0 need to call your static getInstance() method if you already have an instance

#

you can simply use this because materialKey is an instance field

#
private final NamespacedKey materialKey = new NamespacedKey(this, "asd");
#

same for your other namespacedkey - there is little point in setting one in the constructor and initializing the other one directly

#

just create both using this right where you declare the field

mental moon
#

Hey all. Trying to construct Suspicious Stew via the SuspiciousStewMeta. I can build the ItemStack just fine, and the data is on there, however when eaten it does no effect.
When I looked at the data made by Spigot compared to a vanilla stew taken from the creative menu it was a little different.
Top: Spigot created
Bottom: Vanilla
Anyone know of a fix?
I wouldn't mind writing the metadata manually if someone could show me how to do that.
Thanks

eternal night
#

by opening a bug report on spigot for the incorrect behaviour

#

beyond that, the API does not offer a way to edit that manually

#

you'd have to look into things like NBT-API

mental moon
#

Understood. Wanted to ask first just in case
Thanks

tender shard
eternal night
#

it is

#

and name of duration

young knoll
#

Did Mojang change that at some point

tender shard
#

so spigot creates a sus sus stew

eternal night
#

indeed

young knoll
#

Or did spigot just implement it wrong

#

Ah okay

eternal night
#

lets see when paper fixed that

#

I wonder when they changed it

young knoll
#

Thanks Obama Jeb

tender shard
#

in germany we thank merkel for stuff that doesnt work

eternal night
#

Merkel bring 3.50 Döner abi

young knoll
#

Paper doing fixes and never letting us know smh

eternal night
#

23w32a

young knoll
#

Yeah just make a jira ticket and it’ll get fixed

#

Or maybe MD is lurking already 👀

mental moon
#

Making the ticket rn

tender shard
#
        val resolvers = tagResolverFactory?.getTagResolvers(concerns)?.toTypedArray() ?: emptyArray()
        lines.forEach { receiver.sendMessage(mini.deserialize(it, *resolvers)) }

is ?: emptyArray() the proper solution to be able to call a varargs method with a nullable array?

dry hazel
#

yeah sure

obsidian drift
#

Anyone know a way to damage an entity as a player? Entity.damage doesn't account for the item the player is holding and stuff like that

tender shard
#

omg it works

young knoll
#

Player.attack(target)

obsidian drift
torn shuttle
#

hey, is it currently possible to do modded armor models in mc?

#

like not just a texture swap

#

for java edition

#

I think bedrock has it

sterile token
lost matrix
torn shuttle
#

I have a worse solution than shaders for what it's worth

#

but I didn't want to do it

#

well shit

young knoll
sterile token
#

Atleast on the skyblock with the minions im totally sure they are modded armor stands

torn shuttle
#

yeah armor stands

#

the trick is player armor

young knoll
#

The minions have vanilla armor and a custom skull

torn shuttle
#

like I could maybe coerce a client into believing they are wearing horse armor with a custom model maybe

young knoll
#

Well if you glue some display entities to them

torn shuttle
#

desync

young knoll
#

Make them passengers

torn shuttle
#

if it's not worn by players it will look like garbage

#

lol

#

I am pretty sure that would be a war crime

#

holy shit I can't type today

young knoll
#

Well then your only option is shaders

torn shuttle
#

I mean not really

#

hrm

lost matrix
torn shuttle
#

actually nvm

#

player armor isn't a discrete entity from the player right

#

so at best you could retexture, right

young knoll
#

Correct

torn shuttle
#

damn

young knoll
#

Mhm

#

Models are hardcoded for everything but the head slot

torn shuttle
#

mojang where is that modding api we were promised over a decade ago

#

or modding tools

quaint mantle
#

whats your opinions on the ytber code aesthetic

lost matrix
#

I liked those the most

eternal night
#

rip the obviously most based take on the channel

#

delegation babyyyy

torn shuttle
young knoll
#

I believe so, yeah

torn shuttle
#

ok I've never done it before, how hard would it be to send a packet telling a client they are wearing horse leather armor on their head every time they equip some other helmet

young knoll
#

Well there is a library for an armor equip event

lost matrix
quaint mantle
#

I saw that

torn shuttle
#

there isn't a way to send that kind of fake behavior packet via the spigot api right

#

I think it's possible for blocks but not for armor?

young knoll
#

There is

torn shuttle
#

really now

young knoll
#

sendEquipmentChange

torn shuttle
#

hol' up, wait a minute

lost matrix
#

But this will only work for replacing the helmet. Not the entire armor.

torn shuttle
#

well that's 1/4

#

aka a passing grade

young knoll
#

Now I’m no math expert but…

thin wind
#

Hello, i'm detecting an ItemDisplay with a raycast, this is working but is there a way to reduce the detecting box from the ItemDisplay ? I know there are no hitbox on ItemDisplays and TextDisplay but with this raycast the Displays box are way too large : ``` RayTraceResult rayTraceResult = player.getWorld().rayTrace(player.getEyeLocation(),player.getEyeLocation().getDirection(),20,FluidCollisionMode.ALWAYS,true,1,null);

young knoll
#

Low the ray size argument

#

I believe it’s the 1

eternal oxide
#

it is

inner mulch
#

does somebody know how i can turn of the auto uuid assigned by mongodb to every object (I'd like to set it to a uuid)

noble lantern
#

typically you can just override it with a mongo predicat iirc, i find it easier to do that one line of code

Though, why change _id? Couldnt you just add a uuid field? Typically changing the mongo _id isnt very favored and could cause issues, mainly just cause the entry to me re-indexed but thats about it

inner mulch
thin wind
noble lantern
#

the space it takes up is also extremely negligable, its a line of JSON essentially no more than a few bytes

inner mulch
#

why shouldnt mongo be able to index it with a uuid of a player?

noble lantern
#

It does, if you add it as a field 😄

#

you can index by fields, but mongo by default uses _id to sort things out and index entries

inner mulch
#

bruchard on the topic of mongodb, is there a tut on how i can structure my database like a professional?

young knoll
#

It’s stored as bson

#

So it should be just about 16 bytes

inner mulch
#

ok

noble lantern
#

yeah not that bad for storage at all even with thousands

noble lantern
#

i find that the easiest solution when working with MongoDB

inner mulch
#

so you have 1 humongous class with all the data?

noble lantern
#

Well, i have a would different classes but essentially yeah

For example I would have mongo db for all these seperate types of objects:

PlayerData
ServerData
EventData

Etc. etc.

white root
#

Is there some built in way to get how close to being broken a block is?
e.g. when youre digging a piece of obsidian, if I had that Block as a vairable, how would I get what percentage broken it is?

noble lantern
#

sadly IIRC you just have to monitor it with packets, might be wrong here havent done something like that since 1.18, dunno what new stuff they added to the API

white root
#

damn, alright

young knoll
#

You can get how much progress the player makes per tick

#

But I don’t think you can get the overall progress

#

You could manually count tho

#

Via BlockDamageEvent and a scheduler

vapid grove
#

Which one is better
A:

PatternUi patt = this.newPattern(
    "pmpmempmp",
    "mwwwwwwwm",
    "pw wrwxwp",
    "mwnwbwwwm",
    "ampmpmpmp"
);

B:

PatternUi patt = this.newPattern(
    "p m p m e m p m p",
    "m w w w w w w w m",
    "p w - w r w x w p",
    "m w n w b w w w m",
    "a m p m p m p m p"
);
white root
#

I think B is more readable, imo. Probably that one if they both function the same

glad prawn
#

but B is more readable

vapid grove
#

yeah i thought so, i was more thinking if compactness or readability is better in this scenario

#

but either way

#
patt.addChar('m', mg);
            patt.addChar('p', pg);
            patt.addChar('w', wg);
            patt.addChar('e', enchant);
            patt.addChar('r', right);
            patt.addChar('x', bg);
            patt.addChar('n', info1);
            patt.addChar('b', book);
            patt.addChar('a', exit);
#

i need to figure out how to make this part better

#

cause this seems excessive

young knoll
#

You could make it chainable

#

Helps a bit ig

vapid grove
#

i thought you can only do that with one

young knoll
#

Just return this for the method

#

patt.addChar().addChar().addChar() etc

vapid grove
#

oh i see what you mean

#

now i just gotta figure out how to get intellij to hide hints for variables

#

its annoying it makes it offset lmao

eternal night
#

Right click kekwhyper

vapid grove
storm scaffold
#

I've asked about this in the geyser server too, but I've gotten no response so far and I was wondering if this "LinkageError" could be a more general issue encountered with plugins - if so what could I be doing wrong that makes this happen?

sterile token
#

why spigot is destryoying the api that used to be?? Starting from the ids of things, api methods, conventions, java versions

remote swallow
#

item ids were removed from vanilla so they got removed

sterile token
remote swallow
#

bukkit uses java 8

#

or 9 idk if a pr for thats been merged yet

sterile token
#

hmn?

#

no

#

are you sure?

remote swallow
#

bukkit uses 8, spigot uses 17

sterile token
remote swallow
#

spigot maintains bukkit

#

or a fork of bukkit

sterile token
#

i mean spigot just destroying their amazin api

storm scaffold
#

sometimes I forget spigot is even a fork of bukkit lol I just forget bukkit exists

sterile token
vapid grove
#

@young knoll ty folr the suggestion btw

PatternUi patt = this.newPattern(
    "p m p m e m p m p",
    "m w w w w w w w m",
    "p w - w r w x w p",
    "m w n w b w w w m",
    "a m p m p m p m p"
);
patt.addChar('m', mg).addChar('p', pg).addChar('w', wg).addChar('e', enchant).addChar('r', right)
    .addChar('x', bg).addChar('n', info1).addChar('b', book).addChar('a', exit).applyPatt();
young knoll
#

Spigot I think is still java 8? Idk

remote swallow
#

spigot is technicalyl a fork of craftbukkit

remote swallow
young knoll
#

The server is java 17 though so that’s what you gotta use

sterile token
remote swallow
#

no

#

everything up to 1.16.4 can use 8 or 11

sterile token
#

then spigot did a fucking mess

young knoll
#

Like I said

sterile token
#

because you need thosens of versions for running the server, with no need

remote swallow
#

i just checked, turns out spigot doesnt care about version it wants 8

young knoll
#

Minecraft moved to java 17

remote swallow
#

its mojang that update to new versions

young knoll
#

So you gotta use 17

sterile token
#

oh lmao i forgot that spigot uses native mojang server code

young knoll
#

You can still develop with 8 but why would you when the server uses 17

tender shard
#

spigot-api is java 8

sterile token
#

thats why i complain

young knoll
#

I think you mean good additions

#

Instanceof pattern matching my beloved

sterile token
#

because most teams do weird things to their products that were okay, without need to change it!!

remote swallow
#

spigot retains compat as much as possible

#

everything you can do in 1.8 you can still do now with much more features

tender shard
#

Yeah literally nothing in the API was ever changed or broken except removing item ids which were already deprecated in 1.8 lmao

sterile token
remote swallow
#

so we shouldnt have added new events, pdc, better api and that

tender shard
#

You are free to use a 8 year old api version

remote swallow
#

it should be up to all 30 plugins you have to shade a library for it?

tender shard
sterile token
#

yeah as i said many times this the reason of being 1.8 dev

#

From 1.13 up all is broken and creappy to use haha

remote swallow
#

its not tho

#

the api now is much easier to use

#

i dont need to remember 20 trillion id magic values

tender shard
#

Sssh he‘s just drunk

remote swallow
#

yeah

#

its been a while since this happened while i was here

sterile token
tender shard
#

Me too

quiet ice
#

You should go to bed

#

It's late and tomorrow is a whole new day

tender shard
#

Give me one example of whats worse in 1.20 api than in 1.8 api verano

#

Just one

sterile token
#

im talking clearly and without saying weird things. Im just complaining about spigot doing weird changes to the api and even the versions

tender shard
#

For example?

young knoll
#

I have an idea

#

Let’s remove all the string methods

quiet ice
#

like?

sterile token
tender shard
#

Nms is not api bro

slender elbow
#

lol

sterile token
young knoll
#

Also we having mappings now

tender shard
#

Not spigot

young knoll
#

Which make NMS way better

tender shard
#

And paper also didnt remove them

sterile token
#

okay, so mappings are the docs that exists on java for a long time

remote swallow
#

no

tender shard
#

What

young knoll
#

NMS doesn’t get docs

#

It’s not api

remote swallow
#

mappings convert a.b.c(xyz) to player.connection.send(value)

sterile token
#

i know NMS are reflections over obfuscated code, isnt that?

quaint mantle
#

guys

#

how do I even name this

#
public final class Level1To9Wrapper implements LevelWrapper {

    @Override
    public @NotNull ChatColor getLevelColor() {
        return ChatColor.GRAY;
    }

    @Override
    public int getRequiredExperience() {
        return 15;
    }

}```
remote swallow
sterile token
tender shard
#

You‘re also not using spigot if you think string methods were removed

young knoll
#

NMS is just the internal server code

sterile token
young knoll
#

Technically the name NMS isn’t accurate anymore but whatever

hallow lion
#

It is impossible to work with anvil inventories via only the spigot api without using nms/packets. Are there plans on having more support for it?

eternal oxide
slender elbow
#

NMS deez nuts

young knoll
sterile token
hallow lion
remote swallow
remote swallow
hallow lion
young knoll
#

Well then you won’t be able to see it

#

But here ya go

remote swallow
#

you can see the actual repo its on

hallow lion
#

and any eta on that?

young knoll
#

It should

#

And no, no eta

#

You can do anvil GUIs with just NMS and no packet wizardry

#

But yeah still not ideal

tender shard
quaint mantle
#

no

#

custom leveling system

young knoll
#

You technically could just use a pair/map.entry/whatever people like to call it

storm scaffold
quaint mantle
#

maybe these levels will have some other

#

attributes

young knoll
#

You could also just have a holder class

quaint mantle
#

wdym

young knoll
#

That holds the stuff as variables

#

new LevelData(ChatColor.GRAY, 15)

#

Etc

quaint mantle
#

idk I thought about that

young knoll
#

Perfect use for records if ur on modern java

quaint mantle
#

yeah ill prob do that

vapid grove
quaint mantle
#

well it's a remake and idrk the actual equation

vapid grove
quaint mantle
#

nah its so random lo

young knoll
#

Im sure you could do it as a single equation

#

But it would get messy very quickly

quaint mantle
#

15 to 30 to 50 to 75 to 125 to 300

#

to 600 to 800

vapid grove
quaint mantle
#

to 900

vapid grove
#

thats really strange tbh

young knoll
#

Alternatively have a massive config file for it

#

Kek

quaint mantle
#

lmfao

#

I might make everything configurable last cause that sounds like a pain rn

vapid grove
#

so level 1 starts at 15

#

then for example: 15 x 2^(2-1) (level is 2)
would be 30

quaint mantle
#

well I personally think this is a waste of time cause the gamemode maxes out at level 120

quaint mantle
#

and the prestiges is what continues

vapid grove
#

and in my personal oppinion creating a massive config file for something like that is insanely overkill, but ehh to each their own

noble lantern
#

Level1To9Wrapper?

young knoll
#

You could just have a configurable formula

noble lantern
#

Did you make 120 classes?

young knoll
#

Using something like crunch

vapid grove
noble lantern
#

wellp ive officially seen it all

young knoll
#

No that’s 1 to 9

#

So presumably he made 12 classes

noble lantern
#

even then just math with like a

baseXp & scalePerLevel (% increase from base) would be perfect

vapid grove
noble lantern
#

XDD

vapid grove
#

i was under the assumption of oh maybe he embeded the classes inside his level wrapper?

young knoll
#

Yeah idk why they didn’t do a single record

vapid grove
#

like a static class or smth but

#

jess

vapid grove
noble lantern
#

that oto but i likey the percentage based equation, but that would also work too

young knoll
#

xp = 1000 * 1.01 ^ level

vapid grove
#

thats true

young knoll
#

I think McMMOs default formula is like 1000 + level * 20 or something

vapid grove
#

so it looks like the stupidest thing ever

young knoll
#

Kek

vapid grove
#

also aaaa nobodys been able to fix my verification status

#

im stuck as an unverified for enternity

wet breach
#

What people forget in the order of operations is that both division and multiplication are treated with same priority. That means regardless which is first that is the one that will be operated on. Same goes for addition and subtraction.

#

This is why parenthesis become important or screw your equation all together

young knoll
#

That’s on them for forgetting

wet breach
#

Lol

vapid grove
#

mission failed successfully

torn shuttle
#

day 10 of making a wiki website: I built in a sign system into the website to display exactly 3 signs. This is because I am tired and did not want to have to boot minecraft

#

also manaspace is a really nice pixel font

waxen plinth
torn shuttle
waxen plinth
#

you really don't need to worry about that

#

there is really no additional overhead to the garbage collector for this in most cases

torn shuttle
#

🥲

#

yeah about that

waxen plinth
#

especially because in all likelihood the compiler is going to inline it if it would make a difference

#

all this just reminds me why I don't use java anymore though :)

torn shuttle
#

I do wish java were smarter about early collection of scoped variables or at the very least give me an easy tool to handle that myself

#

we already have boolean and Boolean but have you heard about bBoolean where you can just tell java to bBoolean.kill()

quaint mantle
#

How do I obtain all the net.md_5.bungee.api.connection.Server in the network?

torn shuttle
#

not to confuse with BBoolean which is a thread safe boolean

#

or bBBoolean which is a thread-safe boolean you can manually deallocate from memory

#

or BBBoolean which is a boolean with 4 possible states, true, false, null and maybe

waxen plinth
#

which generally use primitives

#

not subject to gc in the first place

#

and even if you do use objects, storing additional references to the object really doesn't do anything to gc

#

if java uses a reference counting gc then the only cost is decrementing the reference count when it goes out of scope, which is negligible

#

and if not then there is no gc cost to having more variables

#

gc runtime scales with allocations and stack references are about the most irrelevant thing to it

#

because unless the gc pause happens while your function is running, it's just some references that will be dropped almost immediately anyways

#

and if the gc pause happens while your function is running, oh no, it has to count one more reference

#

I really can't think of a situation where this would make any meaningful difference in execution time but I would be happy to see a benchmark showing otherwise

torn shuttle
#

more than anything else at a scale you might be running the gc more and more often

#

and the gc itself is not necessarily to smoothest experience on a live server, it doesn't have to be bad necessarily but it can be

#

even though the tick rate of minecraft is relatively low

slender elbow
#

eh, modern GCs can easily clean up several dozens and hundreds of GBs like it's nothing

#

given appropriate tuning, but even for a Minecraft server the defaults are more than fine

torn shuttle
#

yeah it's not a huge problem, rarely it will run at a particularly bad time and that's when you spot it

slender elbow
#

it's interesting, in some code that I wrote recently the hottest function created a new Interval(min, max) up to 6 times at most, and it was severely impacting the performance of the function, upon profiling nothing seemed out of the ordinary, and GC contention eas not a problem, but the constant "using min/max that are jumping around all over heap" was, which obviously something like that does not show up in a profiler

#

can't wait for Valhalla praying rn

torn shuttle
#

accurately profiling plugins is just not even a thing

slender elbow
#

that single change cut the entire run-time by, like, 60%

torn shuttle
#

there are so many things that just melt into the background noise

slender elbow
wet breach
waxen plinth
#

ok but who is writing Integer i = ... lol

#

I feel like you're next going to say "but it might come from a function returning Integer"

#

at which point I am going to say "but I'm only talking about local variables affecting gc"

#

I swear I can't even give a simple suggestion like "I like to split my complex expressions across multiple lines" without people bikeshedding about the most micro of microoptimizations

young knoll
#

You should talk to Marco

#

He loves micro optimizations

wet breach
# waxen plinth ok but who is writing `Integer i = ...` lol

It depends how your equation is written and whether or not you mix types. So you can end up with things being intrinsically turned into Integer.valueOf(). But the final output still be a primitive. But now we just made objects out of nowhere which can and sometimes hurt gc and cache related things

#

So in regards to splitting your equation. That actually might be more optimal in some cases

quaint mantle
#
    @Override
    public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] strings) {
        if (commandSender instanceof Player) {
            if (strings.length == 1) {
                List<String> completions = new ArrayList<>();
                completions.add("arg1");
                completions.add("arg2");
                completions.add("arg3");
                return completions;
            }
        }
        return null;
    }```
#

is this wrong ?

#

tabcompleters not working

river oracle
#

Did you register it

quaint mantle
#

yes

#

getCommand("test").setTabCompleter(new Komut());

#

plugin.yml:

  test:
    description: My custom command
    usage: /test <arg1>```
river oracle
#

Ahhh I see your mistake switch args to 0 and give it a whirl I'm pretty sure it's 1 less than you expect for the tab completes could be wrong but prey sure that's it

quaint mantle
#

aight

#

nah still not worked 😢

river oracle
#

🤷‍♂️

young knoll
#

Try setting the executor

quaint mantle
#

i will change my spigot version

young knoll
#

Tbh I’ve never used just setTabCompleter

quaint mantle
#

oke

vapid grove
river oracle
#

I'd need to take a look at internals but I wouldn't be surprised

vapid grove
#

i do this personally

public abstract static class CommandBase {
        protected String key;

        /**
         * Generates a CommandBase for a Command.
         *
         * @param key The key/name for the command.
         */
        public CommandBase(String key) {
            this.key = key;
        }

        public abstract boolean onCommandRan(@NotNull CommandSender sender, Command command, @NotNull String alias, @NotNull String[] args);

        public abstract List<String> onTabRan(@NotNull CommandSender sender, Command command, @NotNull String alias, @NotNull String[] args);
    }
#

and then i have a manager for it

river oracle
#

TabExecutor ftw

vapid grove
#

how do you guys do guis btw

#

i feel like mines kinda

#

bad :/

river oracle
#

Check the dev branch in the core module

#

Has my gui stuff

young knoll
#

Your nerd system with slots

#

:p

vapid grove
#

for example heres mine

river oracle
#

Mine maps towards more what internal NMS looks like for inventories barring a few methods that aren't exposed by API

#

I am the inventory pr guy after all @young knoll can vouch

vapid grove
#

I wanna improve as much as possible with creating stuff like this personally so its better for me just to straight up ask

#

right now how my managment of stuff works is:

The manager that manages all the sub-managers < Sub-managers (like custom enchants, items, ect) < The objects inside those sub managers (like the custom item self)

#

Its weird but it works pretty well

river oracle
#

I've always wanted to make an inventory and command framework in Lua

vapid grove
#

I do coding jobs on roblox XD

#

I started on lua when I was 10-11?

river oracle
#

Lua is a gross language but it's a joke to embed

vapid grove
#

I would code rp games n such

vapid grove
young knoll
#

LUA would be an alright scripting language

vapid grove
#

Im trying to do java as my main language cause I love OOP

young knoll
#

Probably still not as accessible as skript tho

river oracle
#

OOP is also disgusting

vapid grove
#

:(

young knoll
#

Man is a functional pleb

river oracle
#

No functional is literally just people who don't want to admit objects can be useful

young knoll
#

What’s the other option

river oracle
#

Don't affiliate fully with one?

young knoll
#

Oh right just punch raw binary into the machine

river oracle
#

And don't code pure oop or pure functional

#

Do what fits the bill

vapid grove
river oracle
#

Well Lua can't actually code OOP as OOP wants you to

young knoll
#

I wonder how much binary it would take to write a basic functional program

vapid grove
#

you can use modules with lua

#

which is kinda like oop

#

but more basic

vapid grove
#

see how long it takes

young knoll
#

Y2k is the embedded systems nerd

river oracle
young knoll
#

😩

river oracle
#

Ofc java is missing quite a few things from functional programming but still going pure OOP kinda sucks also If you were to follow SOLID your code base would end up the size of New York city

#

Don't get me started on those DI nerds

river oracle
young knoll
#

Lol

vapid grove
#

Then again currently I do not have a use for that specifically

river oracle
#

10,000%

vapid grove
#

Any good tutorials online on how to use it?

#

Id love to find some usages for it within my servers plugin

#

Or is it literally just

#

Like coding functional

young knoll
#

It’s an object that can represent a basic function

river oracle
quaint mantle
#

guys i try tabcompleter on 1.18.2 and worked

tab completers not working on 1.16.5 ?

river oracle
#

Guess not legacy problems ftw

young knoll
#

When the out is dated

vapid grove
#

If its deprecated or legacy probably dont use it

#

just perhaps

quaint mantle
#

😦

vapid grove
#

i never even heard of that til a couple mins ago cause ive always used onTabComplete

quaint mantle
#

My market is at 1.16.5

vapid grove
river oracle
#

Hey everyone's gotta have their niche

young knoll
#

They are using onTabComplete

white root
#

Hey, im probably just stupid or something

#

But what does package-private mean, and why does tying to use EntityType#getTranslationKey() make intellij tell me: "Cannot access 'getTranslationKey': it is package-private in 'EntityType'"

vapid grove
#

is onTabComplete outdated?

river oracle
#

?jd-s

undone axleBOT
vapid grove
quaint mantle
#

well i will use new version

young knoll
river oracle
white root
river oracle
#

If you're using paper maybe they removed it

quaint mantle
#

u guys any idea for tabcomplater without command ?

vapid grove
white root
vapid grove
#

like are you creating a searchbar?

river oracle
quaint mantle
young knoll
#

Paper probably has another method for it

vapid grove
#

ok speaking of is there any active forumn staff i can dm about my verification issue lmao

river oracle
young knoll
#

Probably translationKey() or something

undone axleBOT
river oracle
#

Md can probs helps 😌 👌 💯

quaint mantle
vapid grove
#

alr i shall send a email

quaint mantle
#

coll was give me a docs

#

for that

#

but docs didnt explain me

vapid grove
river oracle
#

Isn't there an event to be used for that

young knoll
#

Nah it’s just a method

#

player.setCustomChatCompletions or something

quaint mantle
#

In which event should I use this?

young knoll
#

Player join probably works fine

quaint mantle
#

i will try something

quaint mantle
#

is this for latests version ?

river oracle
#

Most be smh missing out in all that great new api

vapid grove
#

I think thats it?

#

Its deprecated however

quaint mantle
#

omg yes

river oracle
#

It doesn't fire anymore

quaint mantle
#

for 1.20

vapid grove
#

Deprecated.
This event is no longer fired due to client changes

#

it wont work however

worldly ingot
#

I'm unsure if the player's connection is fully ready in the join event just yet

young knoll
#

PlayerJoinedEvent when

dry forum
#

does anyonme know why no particles are being spawned

        double minX = Math.min(location1.getX(), location2.getX());
        double minY = Math.min(location1.getY(), location2.getY());
        double minZ = Math.min(location1.getZ(), location2.getZ());

        double maxX = Math.max(location1.getX(), location2.getX());
        double maxY = Math.max(location1.getY(), location2.getY());
        double maxZ = Math.max(location1.getZ(), location2.getZ());

        for (double x = minX; x <= maxX; x += 0.1) {
            for (double y = minY; y <= maxY; y += 0.1) {
                for (double z = minZ; z <= maxZ; z += 0.1) {
                    spawnParticle(player, x, y, z, 0, 0, 0, 0, particleCount);
                }
            }
        }
    }

    private static void spawnParticle(Player player, double x, double y, double z,
                                      float offsetX, float offsetY, float offsetZ, float speed, int count) {
        PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(Particles.E,
                true, (float) x, (float) y, (float) z, offsetX, offsetY, offsetZ, speed, count);

        ((CraftPlayer) player).getHandle().c.a(packet);
    }```

```        Player player = (Player) commandSender;
        Location location = player.getLocation();


        spawnParticleBox(player, location, location.clone().add(10, 10, 10), 20);```

its supose to spawn particles in a box between 2 points
young knoll
#

What kind of old version are you on