#help-development

1 messages · Page 242 of 1

eager flax
#

I keep getting an error

green prism
#

What's the best way to make an Inventory Builder that assign to the chosen element a predefined click-event (action)?
Always used a line action: {ACTION_ENUM} inside my invbuilder config, I'm looking for new and maybe faster ways

eager flax
#

[20:20:59 ERROR]: Could not load 'plugins/LyuDuels-1.8.8.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.lyu.lyuduels.LyuDuels'

#

does this have to do abt me deleting the on plugin enable and on plugin disable?

tardy delta
#

the path is wrong

eager flax
tardy delta
#

by putting the right path, take care of uppercase and lowercaase characters

#

i dont know your project structure

eager flax
#

is it bc I deleted the code in the LyuDuels.java

tardy delta
#

well does the class still exist?

eager flax
#

which is i think what loads it up

#

ye

#

whats the onenable and ondisable code

#

that you get in every plugin

remote swallow
#

extend JavaPlugin and


@Override
public void onEnable() {
  code
}

@Override
public void onDisable() {
  code
}
``` iirc
green prism
#

my soul can feel it

round finch
#

Next a plugin instance

#

Or di

remote swallow
green prism
#

I created an Inventory Builder, which is a class that, translates a YAML config into elements and actions. In order to be able to assign an element an action, I use ENUMs so when an element within the config has the line action: EXAMPLE_ENUM it means that, when a click occurs, a default action takes place
I'm looking for new ways to do that instead of using ENUMs
Example of what I just said above:

  13:
    material: "PLAYER_HEAD"
    texture: ""
    displayName: "<gold><bold>Set Owner %company_owner%"
    lore:
        - "<gold>Click to set the owner of the company."
    click-event: SET_COMPANY_OWNER```
tardy delta
#

hardcode it 💀

#

smellin like skript

round finch
#

What do you need for automatically update server version

#

What scripts or something

#

For most rev lastest

harsh totem
#

Why when I try to do this: player.getLocation().setYaw(player.getLocation().getYaw()*-1); nothing happens?
I want the player to be rotated and it does nothing

tardy delta
#

mutating it wont do anything to the player

#

dont you have to teleport them to their located with a switched yaw?

harsh totem
#

oh

green prism
vocal cloud
#

Not the only way lol

trim lake
#

Im not suer, if this is best chanel to ask. But, I have problem with importing PAPI in my plugin. I added PAPI jar to project. Someone have some ideas?

tardy delta
#

eclipse kek

#

maven or gradle?

trim lake
#

ye, IntelijjIdea is destroing my shit ntb 😄

#

Just plain Java

#

I have added here. So that cloud work

#

public class SomeExpansion extends PlaceholderExpansion {
    
    @Override
    public String getIdentifier() {
        return null;
    }
    
    @Override
    public String getAuthor() {
        return null;
    }
    
    @Override
    public String getVersion() {
        return null;
    }
}```
Is just wierd.. Im getting blueshit errors.
#

I know Im returning null, I will change that later

quiet ice
#

What is the PlaceholderExpansion class contents?

#

Or better said what methods does it declare?

green prism
quiet ice
#

Also, I advise you to not use Eclipse JDT for dependency management unless you know what you are doing.

green prism
quiet ice
#

huh

trim lake
quiet ice
#

Yeah, do F3 on the "PlayerholderExpansion" part of "me.clip.placeholderapi.expansion.PlaceholderExpansion"

#

Then show the contents of the outline view (should be to the right by default), though depending on your settings it might be easier to just screenshot the main window - should the view change

trim lake
#

I tried IntelliJ Idea and there is no error. Weird. I´m not using that, because my ntb is to low 😄

#

Eeem, There is probably problem..

#

Gona try import that file again

#

Still same

quiet ice
#

That is to be excepted. Do you have that outline view?

trim lake
quiet ice
#

not really what I meant but okay

trim lake
#

Im not sure than, Im sorry. I just not having here some outline view

remote swallow
#

this is what the example is on papi wiki

trim lake
#

my screen looks like this

quiet ice
#

This indicates that something went down the drain. Thus do Project > Clean..., tick Clean All Projects, hit Clean

quiet ice
trim lake
#

Ye, Im just new in Java 😄 I would like to use Intellij, but if I run MC to test and IntelliJ my ntb is too slow

quiet ice
#

Does it now work?

trim lake
#

Folowed some codedred tutorials, to learn basics.

#

Still same

quiet ice
#

if not you might need to right click your project (on the left-hand window) and click refresh

#

If it still does not work, you are in a cursed position

worldly ingot
trim lake
#

Still same, I just tried open procjet in IntelliJ and looks corect.

worldly ingot
#

I use Eclipse and that default viewport still haunts me to this day

quiet ice
#

Yeah, the package view must at least occupy half the screen

round finch
#

Oh no 4j

trim lake
#

But everythink look correct, right? 🤔 Maybe there should be someone else with same problem on spigot forum, or just google. Gona try. Thanks

quiet ice
#

The only thing I could think of is that jar not containing the placeholder api

trim lake
#

Mby, problem could be Im using 1.17 spigot?

quiet ice
#

nah, this is either an eclipse (compiler) issue or an issue with your papi jar

trim lake
quiet ice
#

I insist on that.

green prism
#

@vocal cloud seems like you have a lot of experience behind so... Could you help me?
What do you think is the most optimized and best way to make custom inventories with items that can have (different for each inventory) predefined (Consumer) actions through config?

(I'm sure whatever the answer is, I will have to learn about CompletableFuture or BiFunctions haha)

quiet ice
# quiet ice I insist on that.

If it were an eclipse compiler issue, which is extremely unlikely given that I use PAPI myself, the issue would be easily visible when I have the jar on hand

vocal cloud
quiet ice
#

@trim lake Move PAPI from the module path to the classpath

trim lake
#

Wait... I just tried to move jar from Modulepath to ClassPath and errors are gone... Shoudl that file be in ClassPath?

quiet ice
#

The placeholder API devs are absolute idiots

trim lake
#

You are faster 😄

#

I just tried that 😄

#

Im using NBTApi and that is in Modulepath soo 😄

quiet ice
#

This file is the cause of your trouble for reference

humble tulip
#

@tender shard is PDC for blocks in your lib removed when blocks are broken?

#

Or destroyed

trim lake
green prism
remote swallow
#

hover event of itemstack possibly?

vocal cloud
remote swallow
#

text component i think it was

#

np lol

green prism
#

My masochistic side also tells me that it's cool to make everything more and MORE and MORE and MOrE customizable

#

mORE

vocal cloud
#

Start with everything as simple as possible and grow features where you need to

vocal cloud
sonic goblet
#

Plus you can get feedback from them as to what would be/is actually useful in the real world

green prism
crisp forum
#

I believe there is a better way than shading Kotlin libraries into plugin. I kinda remember sth like I can use libraries: in plugin.yml but not sure how can I do that. Any docs or IDK anything

#

developing with Java 17, 1.19

green prism
#

So, anyway, back to the problem...
What's the best way to associate a Consumer to a desired element?

#

Is the action: {ENUM} the faster way?

vocal cloud
#

Why a consumer?

green prism
hybrid spoke
#

why

vocal cloud
#

So multiple configs or whatever will interact with the same InventoryClickEvent?

#

Why a consumer for this?

green prism
#

Now I am here to tell you, I didn't understand a word of what you said before

#

thank you

hybrid spoke
#

if you want to let people configurate your plugin or whatever, make a config opt for every thing you think "hey, this could be changable" at

hybrid spoke
#

whats the issue

vocal cloud
green prism
hybrid spoke
green prism
hybrid spoke
#

defined

#

ah

#

default

#

so you basically want to make a plugin players can make interactable guis with?

vital yacht
#

And if you want I can dm you a link to an example plugin configuration so it isn't seen as advertising

vocal cloud
hybrid spoke
green prism
# hybrid spoke so you basically want to make a plugin players can make interactable guis with?

I am making a plug-in for companies.
There are 5 commands

  • Promote
  • Create
  • I don't remember
  • I don't remember
  • don't remember

Each command, works through an inventory (Look at the image)
I want to have 5 config files for each inventory and each player change the location of any Item and maybe even create new static ones.
I was looking for the best way to do this and also associate with the items such as "set description" a Consumer<InventoryClickEvent>

hybrid spoke
#

otherwise you either forget about it or you squeeze it between somewhere

green prism
vocal cloud
#

If it's required but if it's fluff then don't waste time on it

hybrid spoke
vocal cloud
#

I'd argue what they're trying to do is very much fluff

hybrid spoke
#

and if you code by hours then add anything you can into the config

vocal cloud
#

Code by hours? You mean paid by the hour?

hybrid spoke
#

yeah if you're getting paid, á work, á code by hours

vocal cloud
#

lol okay with that mentality

hybrid spoke
vocal cloud
#

You want to get a project done write the core first then focus on all the configuration

green prism
crisp forum
#

I have

libraries:
  - "org.jetbrains.kotlin:kotlin-stdlib-common:1.7.20"
  - "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20"
  - "org.jetbrains.kotlin:kotlin-bom:1.7.20"
``` in my plugin.yml

but I get org.bukkit.plugin.InvalidPluginException: java.lang.RuntimeException: Error resolving libraries error
hybrid spoke
#

then dont do it

green prism
vital yacht
#

I would use a GUI library if you aren’t already

#

Triumph-GUI is a good one

hybrid spoke
#

since you are just using keys to determine what happens on the click, i would just store the key with a runnable or, yeah consumer, in a map and recall it everytime

tired mulch
#

.

vital yacht
green prism
green prism
#

SmartInventories need SmartHolders haha

tired mulch
#

does anyone know how to resolve?

vital yacht
#

Why?

#

Not really

hybrid spoke
#

doesnt matter

vital yacht
#

It’s the easiest way to do it

hybrid spoke
#

not really

vital yacht
#

Anything else ends up being a lot more work and more likely to have mistakes

hybrid spoke
#

it doesnt break anything

#

its just not intended to represent an inventory instance for identification

#

wouldnt call it a misuse but a feature

green prism
#

god

midnight shore
#

Hi, how can i get a direction in order to make a point face another point? Let me explain better, we have point A and point B, how can i get a vector in order to make A face B? Also note that it needs to work in 3 dimensions

green prism
humble tulip
#

You want a vector to make A face B

#

Just B-A

#

Gives you thay

green prism
hybrid spoke
midnight shore
humble tulip
#

B-A

#

That's all

midnight shore
#

seriously?

quiet ice
hybrid spoke
#

that gives you the offsets yes

humble tulip
green prism
vital yacht
midnight shore
hybrid spoke
#

toVector is redundant

#

just call toVector on the result

midnight shore
hybrid spoke
#

b.subtract(a).toVector();

midnight shore
#

oh

humble tulip
#

That works

humble tulip
#

If you dont want b being modified, do b.toVector first

midnight shore
#

and to get the distance between the two points?

humble tulip
#

Location.distance(location)

hybrid spoke
#

oh right that shit wasnt immutable

midnight shore
humble tulip
#

What is Content

hybrid spoke
#

to content?

#

upload it to youtube then

remote swallow
#

dafuq is a content

hybrid spoke
#

do you need it?

#

its optional

#

but therefor you dont need content iirc

tired mulch
remote swallow
#

check the config

vital yacht
#

Is this with adventure?

midnight shore
#

How tall is a small armor stand? Like 0.3 blocks?

humble tulip
#

@last temple

#

Yeah ItemTag seems to be the NBT data😂😂

#

Why is this so convoluted

#

This has the solution

remote swallow
#

check out InteractiveChat and how they do it

quiet ice
granite burrow
#

Is there a way to tell how long a player has been drinking a potion? So far all I can do is find out when the player drinks a potion, and when they right click with the potion. But I can't get anything else.

I tried to use logic to determine how long the player was right clicking in the interact event, however, it seems that the event only fires once while drinking a potion

humble tulip
#

Ik how u can use logic to determine

humble tulip
#

Busy rn I'll explain in a bit

tender shard
granite burrow
# humble tulip Ik how u can use logic to determine

okay, the way I tried was saving each time the player right clicked into a map and checking the next time they clicked if enough time had passed, but that doesn't work since theres only one right click.

humble tulip
#

If they are they're drinking

#

If they're not they stopped

#

If the playeritemconsuleevent is called, they actually drank it

ancient plank
humble tulip
tender shard
ancient plank
#

I was struggling to read the documentation for it tbh, so I didn't catch that. gotta hotfix the plugin I just updated today 💀 I hate pushing updates in quick succession

tender shard
ancient plank
#

psh I don't read javadocs

river oracle
tender shard
#

or pushed by a piston, etc

river oracle
tender shard
#

oh then everything's good

river oracle
#

💀 shoulda read the docs

#

I coulda been lazy

tender shard
#

yes haha

#

the listener was only added in 2.0.0 anyway

river oracle
#

also whats the whole thing with relocating it

#

I like never relocate my packages lol

tender shard
#

it's actually not required. it used to be required to avoid stuff when two plugins shade the same classes

#

but now, iirc, they all have their own classloader so it's basically irrelevant now

fresh timber
#

how can I stop the scoreboard from flickering when it refreshes?

river oracle
#

better logic I've never seen flicker when refreshing my scoreboard

fresh timber
#

;-;

#

it happens all of the time

#

ill record it and see if it works

#

just flickers for like a split second

river oracle
#

how are you updating it

fresh timber
#

hold on

#

ide blank xd

#

intellij sometimes just turns grey and nothing happens

river oracle
#

lowkey looks like your clearing the entire scoreboard

fresh timber
#

bruh it wont work

river oracle
#

than readding everything

fresh timber
#

xD

#

ok ima restart my pc lmao

formal bear
#

Main function public static FileConfiguration getInstanceConfig(){ return instance.getConfig(); }
Reload command ```
private FileConfiguration config = bpLobby.getInstanceConfig();

public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

    instance.reloadConfig();

    sender.sendMessage(reloadMessage);

    return true;

}```

How to properly reload config? This does not work

humble tulip
remote swallow
tender shard
fresh timber
undone axleBOT
river oracle
#

regular bukkit api config 😥

fresh timber
#

oop sry for reply

#

xd

river oracle
#

😠 how dare you reply to me

fresh timber
river oracle
#

I'm blocking you

fresh timber
#

lmfao

river oracle
#

ok i'm going to be honest with you. I don't know how to use the spigot scoreboard api

fresh timber
#

🤔

river oracle
#

but don't update every line every time you refresh is my reccomendation

river oracle
fresh timber
#

whats that

#

is it a plugin?

river oracle
#

packet only scoreboard api

fresh timber
#

how do I use it?

#

Ive always just used spigot idk how to get new apis

tender shard
#

do you use maven?

remote swallow
#

deps, repos

fresh timber
#

oh yes

river oracle
fresh timber
#

ive done that

#

I use maven

tender shard
#

usually you just add the repository and the dependency

fresh timber
#

okay

tender shard
#

then you set the scope to "compile" and you also need the maven-shade-plugin, if you don't already have it in your <build><plugins> section

fresh timber
#

ah yes I have maven shade

tender shard
#

then you basically only need to add the <dependency> and maybe <repository> stuff

fresh timber
#

okay

#

then how do I use fastboard after I get it

tender shard
#

that I don't know lol, but Y2K probably knows it

remote swallow
#

they have docs on their github i would guess

fresh timber
#

okay

remote swallow
tender shard
#

yeah looks like it's well explained

fresh timber
#

but how is this better?

tender shard
#

you don't have to worry about objectives and stuff yourself, instead you can just throw some strings at it

fresh timber
#

if I update and it is the same as it is rn will it not update?

fresh timber
#

like I want to remove the flickering scoreboard

#

so annoying lol

remote swallow
#

it would remove the flicker

fresh timber
#

but yes, this does seem faster

tender shard
#

I am pretty sure that this API will take care of this for you

remote swallow
#

as well as making it easier to write

fresh timber
#

okay

#

nice

#

so, do I not need to use the line player.setscoreboard(something) with this?

#

if I use update lines it just does it

remote swallow
#
@EventHandler
    public void onJoin(PlayerJoinEvent e) {
        Player player = e.getPlayer();

        FastBoard board = new FastBoard(player);

        board.updateTitle(ChatColor.RED + "FastBoard");

        this.boards.put(player.getUniqueId(), board);
    }
river oracle
tender shard
#

from what I see, you only have to create a new FastBoard (e.g. new FastBoard(somePlayer)) and then it automatically works

fresh timber
#

hm ok

tender shard
#

in the example, they use a Map<UUID, FastBoard> so you can update it later

fresh timber
#

the scoreboard is for everyone

river oracle
#

no

fresh timber
#

all players

river oracle
#

oh

remote swallow
#

me about to totally not yoink some of this code (i mean most of it):

fresh timber
#

hm?

tender shard
#

you still have to create one for every player

river oracle
#

just make a ScoreboardFormat object

fresh timber
#

how does the hashmap update it for each player im so confused

river oracle
#

the hashmap doesn't do anything but cache the scoreboard

fresh timber
#

okay

tender shard
#

you update it yourself. Basically you do this:

create a FastBoard for every online player
loop over the hashmap every second and update them all

fresh timber
#

ohh I didnt see that u put a player in the new fastboard

river oracle
#

👀 if your updating them that often wouldn't another collection be better

fresh timber
#

so thats who updates for

tender shard
#

but tbh who cares 😄

#

they will never have more than like 200 players on one server

remote swallow
#

the code formatting and naming police

tender shard
#

I'd still use a map because that way you always know which player has which scoreboard

#

even if you don't need it now

#

maybe you'll need it tomorrow

river oracle
#

true you'll always have Map#values()

tender shard
#

chickity china, the chinese chicken

fresh timber
#

does updateLine() start at 0 or 1

#

also does it count down or up

tender shard
#

0

#

and it counts up

river oracle
#

idk I forget I'd assume its the same

fresh timber
#

k

river oracle
#

I hate scoreboard impl by mojang

fresh timber
#

so this would give the player a new scoreboard with the title "hi" and on the 2nd line it would say "t"

tender shard
#

it's basically the same as get(...) in a list

river oracle
#

Fastboard is my best friend

echo basalt
#

yo it's alex

#

my favorite christian

tender shard
river oracle
#

idk try and see

fresh timber
#

hmm

river oracle
#

go for it

fresh timber
#

ok

tender shard
river oracle
#

I believe in you

tender shard
fresh timber
#

me 2

river oracle
#

💀

tender shard
river oracle
#

oh yeah you

#

but it was someone else

tender shard
#

damn, he's a jerk

river oracle
#

its this kelpy guy

#

forgor his discord name

echo basalt
#

I once found mfs I had an NDA with, in a server that I was open about age

tender shard
#

no clue whom you're talking about tbh lol

river oracle
#

he only talks in help dev

#

Just crazy I saw him in a smaller server I played on is all

echo basalt
#

just left instantly

river oracle
#

there are people from the server I used to work for on here

#

but they never talk

#

their last message was 2 years ago xD

tender shard
#

is oliver finally asleep now?

limber mica
#

How would I use a for loop that starts at 1 and ends at the value in the indexed element of the array?

tender shard
fresh timber
limber mica
#

yes

tender shard
#
String[] myArray = { ... };
for(String element : myArray) {
  System.out.println(element);
}
#

or if you need the indexes:

#
for(int i = 0; i < myArray.length(); i++) {
  System.out.println(myArray[i]);
}
#

note that array indexes start at 0, not 1

limber mica
#

so if I wanted what I wanted above I would do ```
for(int i = 1; i < myArray.length(); i++) {
System.out.println(myArray[i]);
}

humble tulip
tender shard
bold gorge
#

How can I override other plugin's commands?

for example: (this uses boostedyaml, but ignore that)

if (!config.getBoolean("should-override-other-plugins")) {
    return false;
}

// This is what I want to figure out, to override every plugin with the same command name as the command I'm trying to create.
...

Thanks a lot :)

glossy venture
#

register your command later in command map or something it will take priority

#

dynamically

#

searxh "register command without plugin.yml" or something

tender shard
#

basically you can get the CommandMap from the SimplePluginManager (just cast Bukkit.getPluginManager()) using reflection

#

and then change it to whatever you like

#

it sounds like a horrible idea though, you shouldnt mess with other plugin's commands

glossy venture
#

or use my shit command engine with fucked completion and half working arguments

humble tulip
#

Sometimes plugins use an alias that you wanna use as ur main command

#

I just unregister it💀

tender shard
#

well the cleaner solution would be to ask the other author to make their commands configurable

#

but yeah sometimes you just have to use dirty hacks lol

glossy venture
#

also the slower solution

tender shard
#

IIRC I haven't used plugin.yml for commands for 2 years or so now

glossy venture
#

same

humble tulip
#

Or in the first place

tender shard
#

I nowadays use ACF for all commands

fresh timber
#

I hate acf

#

cant use args its annoying

tender shard
#

huh ofc you can

fresh timber
#

I tried for like 2 days everyone that answered me said its impossible

tender shard
#

whut

#

no that's bullshit

fresh timber
#

couldnt find it at all

tender shard
#

what kind of args? just a bunch of strings?

fresh timber
#

yea

tender shard
#
public static void myCommand(CommandSender sender, String[] args) { ...
#

works 100% fine

#

I always do it like this

fresh timber
#

thats weird

tender shard
#

lemme double check

fresh timber
#

there was no String[] args when I did it

#

and literally like 10 ppl told me it was impossible

glossy venture
#

i find including shit like ACF too hard so i make my own big mistake

#

failed twice now

tender shard
#

well usually you define every arg separately, like this

#

but it also works 100% fine when just using String[]

#

I just checked it

glossy venture
#

the execution always works but the completion always fucking sucks god damn it

fresh timber
tender shard
tender shard
glossy venture
#

no my own framework

#

acf is goos

tender shard
#

I only switched to ACF because parsing is a hell if you have different commands with exchangeable args

glossy venture
#

goos

tender shard
#

e.g.

glossy venture
#

good

fresh timber
#

yea tru

tender shard
#

/giveitem <item> <amount>
and
/giveitem <amount> <item>

#

in spigot you'd have to manually parse this shit

#

in ACF you just do

public void onGive(Player sender, Material material, int amount)
fresh timber
#

lol I parse all of the time with this

#

just surround it in try/catch incase of error xd

tender shard
#

oh damn

#

that's not good 😛

humble tulip
#

I recently restarted using spigot commands

fresh timber
#

yea...

remote swallow
bold gorge
tender shard
#

np! feel free to ping if you got any question about that

humble tulip
#

Time to document my plugin

glossy venture
#

why not jump off bridges

tender shard
fresh timber
remote swallow
#

how do you know

fresh timber
#

they were

tender shard
glossy venture
#

god will save u if you land on concrete yes i swear if u think you gonna die just phone up god asap and ask yo can i not splash on the floor

glossy venture
tender shard
fresh timber
glossy venture
tender shard
fresh timber
#

wikipedia != real

tender shard
#

tbh I love wikipedia, I have over 400 edits there lol

fresh timber
#

so wikipedia = (f)x = {x | y = 1}

glossy venture
# tender shard

"Bridges are structurally designed to be the primary location of suicide" it says it righ there

tender shard
#

but what I sent is the article about the card game "bridge"

glossy venture
#

lmao

#

ill get banned from wikipedia

tender shard
#

I can approve edits lol

#

if I approve it, I will get banned, not you

glossy venture
tender shard
#

2 am?

#

isnt it only 1.30

glossy venture
#

oh ysah 1:30

tender shard
#

or is my windows clock weird again

glossy venture
#

my xloxk is set incoreect i guess

tender shard
#

maybe lol

glossy venture
#

1:32

#

now that i look back at it the word xloxk looks more like xbox than clock lol

tender shard
#

xclock

#

sounds like a util that every linux distro ships

bold gorge
tender shard
#

but you can only do that if the other plugin was already loaded / enabled

#

usually, if you want to override other plugin's commands, you would delay your whole command registration stuff by one tick or so

bold gorge
#

ah kk

#

tysm

fresh timber
river oracle
#

you didn't shade it

fresh timber
#

hm?

river oracle
#

🥳 maven shade plugin

fresh timber
#

oh I thought I had

river oracle
#

NoClassDefFoundError

fresh timber
#

I have this in my pom.xml what else do I need?

river oracle
#

idk how maven works i just copy paste stuff

#

gimme a second

fresh timber
#

ok xd

tender shard
#

how did you compile @fresh timber

#

did you run "mvn package"?

fresh timber
#

I just reload

tender shard
#

but how did you even compile the jar?

fresh timber
#

oh

tender shard
#

but what did you do to get a .jar?

fresh timber
tender shard
#

Yeah that's wrong

#

1 sec

fresh timber
#

;-;

#

I always use that

#

works fine

tender shard
#

You have to use this, otherwise IntelliJ ignores your pom.xml

fresh timber
#

oh lmao

tender shard
#

it works fine if you dont need to shade anything

fresh timber
#

well its worked fine till now lol

tender shard
fresh timber
#

so will this also make the jar?

tender shard
#

yes

#

it will be inside the "target" folder

fresh timber
#

;-;

#

ok

tender shard
#

but you can check the blog post above to change it to somewhere else

fresh timber
tender shard
#

oh ok, then you don't have to worry about it

#

just double click on "package" and your .jar will be inside <yourProjectFolder>/target

fresh timber
#

I use bitvise cus its on a linux machine

#

ok

#

which one 👀

tender shard
fresh timber
#

there are 2 of that

tender shard
#

one has "-shaded" at the end

fresh timber
#

;-;

#

I cant see that xd

tender shard
#

although they should be the same anyway

#

it actually doesnt matter

#

also you can just drag that GUI so you can see the full name

#

but in your case, both files should be the same anyway

#

I would always use the file that does NOT have "-shaded" in it's name

fresh timber
#

why?

#

is it better

tender shard
#

in your case, they are the same. but I remember that the -shaded one can be different and then it won't be what you're looking for

fresh timber
#

ah ok

tender shard
#

just go for the one that does not start with "original-" and does not end in "-shaded" 😄

fresh timber
#

k xD

#

ayy it worked, thx

humble tulip
#
    public Voucher getByItem(ItemStack itemStack) {
        int amount = itemStack.getAmount();
        itemStack.setAmount(1);
        Voucher voucher = this.itemVoucherMap.get(itemStack);
        itemStack.setAmount(amount);
        return voucher
    }
#

thoughts?

#

since the map only stores items that have an amount of 1

fresh timber
#

what is this supposed to do

humble tulip
#

i have a Map<ItemStack, Voucher> that maps an item to a voucher

#

i wanted to use PDC but this is < 1.14

#

so i'm using a map

fresh timber
#

ok cool what should I think

#

idk what u want xd

humble tulip
#

I want to get a voucher given an itemstack

fresh timber
#

oh so the item is turned into a voucher that can... get the item again?

humble tulip
#

no

#

vouchers are redeemables

#

but they are physical ingame items

#

so i need to map the voucher to the item

#

item to the voucher*

fresh timber
#

ah

#

@tender shard I think earlier u were talking abt chunks having to be loaded to get the entities from them... do they need to be loaded to spawn mobs in them or to check if they die?

ivory sleet
#

feels like you should have a Map<String,Voucher>
Where you first get a String from the ItemStack pdc.

#

so basically a stringed registry

fresh timber
#

so I cannot spawn them if they are not loaded?

tender shard
#

correct

fresh timber
#

ahhhhhhh

#

thats why

#

Ive been trying to fix this for forever xd

#

sooooo

#

uh

#

should I just load all of em before I spawn them

tender shard
#

you can simply call getChunk() on your location to force load it for a few ticks

tender shard
fresh timber
#

ima make a method to load like 20 chunks xd

tender shard
#

20 chunks isn't that much

#

HOWEVER

#

the best idea would be to load until that chunk got loaded, and only spawn the entities then

fresh timber
tender shard
fresh timber
#

how can I do that

tender shard
#

basically you would have a Map<Location, EntityType> or similar. You can add to that everytime you wanna spawn something

#

then listen to ChunkLoadEvent and loop over the map

fresh timber
#

huh

tender shard
#

and if the location happens to be inside this chunk, you would spawn your entity

fresh timber
#

so I would check if the chunk is loaded before I do it?

tender shard
#

oh yeah, sure

#

if the chunk is already loaded, then you spawn the entity directly ofc

fresh timber
#

but... getting the chunk loads it

tender shard
#

I forgot to mention that

tender shard
fresh timber
#

sooo checking if its loaded loads it

tender shard
#

isChunkLoaded

fresh timber
#

okay

tender shard
#

BUT you have to note that it requires chunk coordinates

#

e.g. do not just do location.getX() but location.getX() / 16

fresh timber
#

oh

tender shard
#

(same for Z ofc)

fresh timber
#

so I have to get the chunk location which loads the chunkj

#

ohh

tender shard
fresh timber
#

I didnt read

#

lmao

#

nvm

tender shard
#

if you have a location, you can just / 16 both X and Z, and then those are the chunk coordinates

fresh timber
#

so just all of the x y and z /16

tender shard
#

you can then just toss them into World#isChunkLoaded

fresh timber
#

oh not y?

#

k

tender shard
#

chunks are always "full Y" so you don't need it

#

you only need X and Z

fresh timber
#

yea

tender shard
#

@fresh timber Something like this should do

#
public class Test extends JavaPlugin implements Listener {


    private static final Map<Location, EntityType> ENTITIES_TO_BE_SPAWNED = new HashMap<>();
    
    public static void spawnEntity(Location location, EntityType entityType) {
        if(location.getWorld().isChunkLoaded(location.getBlockX() >> 4, location.getBlockZ() >> 4)) {
            location.getWorld().spawnEntity(location, entityType);
        } else {
            ENTITIES_TO_BE_SPAWNED.put(location, entityType);
        }
    }
    
    @EventHandler
    public void onChunkLoad(ChunkLoadEvent event) {
        Iterator<Map.Entry<Location, EntityType> iterator = ENTITIES_TO_BE_SPAWNED.entrySet().iterator();
        while(iterator.hasNext()) {
            Map.Entry<Location, EntityType> entry = iterator.next();
            if(entry.getKey().getWorld() != event.getWorld()) continue;
            if(entry.getKey().getChunk() != event.getChunk()) continue;
            entry.getKey().getWorld().spawnEntity(entry.getKey(), entry.getValue());
            iterator.remove();
        }
fresh timber
#

im tryin this


public void run() {
        Bukkit.getScheduler().runTaskLater(WildGamesSkyMining.getInstance(), () -> {

            int i = 15 - piglinbrutes.size();
            while (i > 0) {

                int randomX = ThreadLocalRandom.current().nextInt(-44, 1 + 1);
                int randomZ = ThreadLocalRandom.current().nextInt(-90, -47 + 1);

                if (Bukkit.getWorld("nether").isChunkLoaded(((int) (((double) randomX)/16.0d)), ((int) (((double) randomZ)/16.0d)))) {
                    PiglinBrute entity = (PiglinBrute) Bukkit.getWorld("nether").spawnEntity(new Location(Bukkit.getWorld("nether"), randomX, Bukkit.getWorld("nether").getHighestBlockYAt(randomX, randomZ) + 1, randomZ), EntityType.PIGLIN_BRUTE);
                    piglinbrutes.add(entity.getUniqueId());
                }

                i--;
            }

            for (Entity entity : Bukkit.getWorld("nether").getEntities()) {
                if (entity instanceof PiglinBrute) {
                    PiglinBrute piglinBrute = (PiglinBrute) entity;

                    if (piglinbrutes.contains(piglinBrute.getUniqueId())) {

                        if (!Damage.pbhp.containsKey(piglinBrute.getUniqueId())) {
                            Damage.pbhp.put(piglinBrute.getUniqueId(), 1000);
                        }

                        piglinBrute.setCustomNameVisible(true);
                        piglinBrute.setCustomName("§c§lPiglin Brute §c" + Damage.pbhp.get(piglinBrute.getUniqueId()) + "§7/§c1000❤");
                    }
                }
            }
        }, 10);
    }

tender shard
#

I would rather move this into its own method

fresh timber
#

y

tender shard
#

e.g. my example above, so you can just do "spawnEntity()" and then the method itself checks whether the chunk is loaded or not

fresh timber
#

eh yea

#

im lazy ;-; dont wanna type stuff for a method... but it will be helpful if I want to spawn again later xd

tender shard
#

being lazy means that you should have as many methods as possible lol

fresh timber
#

yea but rn its easier to not make a method

#

it will be easier later xd

#

once I need to make another mob slaughter location

tender shard
#

is "piglinbrutes" a map?

fresh timber
#

yes

tender shard
#

it looks like you never remove anything from that map

fresh timber
#

ondeath

tender shard
#

oh ok

fresh timber
#

piglinbrutes.remove(piglinbrute)

tender shard
#

ok good

fresh timber
#

although... it does not work for the void for some reason

#

if tp them to the void and they all die there, they dont respawn xd

#

still workin on that

tender shard
#

it should call the EntityDeathEvent even when they die from void damage

fresh timber
#

yea

#

idk xd

#

and im sure they die too

tender shard
#

I'd just listen for EntityDeathEvent and print it out (entity type + location)

#

and then see if it actually gets called

fresh timber
#

yea ill do that

tender shard
#

oh haha I only read this rn

fresh timber
#

great

tender shard
#

orby, me and a few others today joined a christian discord to discuss stuff haha

fresh timber
#

nice

#

ru a christian?

tender shard
#

my passport says yes, but in reality I don't believe

#

but I still love discussing stuff

fresh timber
#

well we'll prob get banned for talking abt this here

tender shard
#

nope

fresh timber
#

but we could discuss somewhere else if ud like xd

fresh timber
tender shard
#

you really have to fuck up big time here to get banned 😄

fresh timber
#

most discord servers do that

tender shard
#

this discord basically works like this:
Don't be a jerk, then you're fine

fresh timber
#

do you believe in anything?

#

any "higher power"

tender shard
#

I am not sure. I like the idea, but I don't actually believe that there's anything that science cannot explain

fresh timber
#

its so obviously laid out in existence though

tender shard
#

well idk, I've aksed on this other discord whether it's okay to be gay and they were just spamming bible quotes telling me "it's not okay because you cannot have children" and stuff, and I just think that this is all plain bullshit

fresh timber
#

like, how can you describe how everything is perfectly made so that we can survive and not only survive, we are in the perfect spot in the universe to discover so much more about God's world

tender shard
#

but maybe we should move to #general 😄

fresh timber
#

yea xD

fresh timber
#

if I spawn an entity will it despawn? I think my entities may be despawning cus they just disappear out of nothing

fresh timber
#

can I stop this?

tender shard
#

Entity#setPersistent(true) should prevent it

fresh timber
#

okay

#

also, I am using a hashmap of uuids to contain the alive entites and I use a death even to check, I want to just remove it every 20 seconds from the hashmap if the entity is invalid/dead but what happens is i use Bukkit.getEntity(entityuuid) and it gives errors because the mob is dead... can I still check if it is dead with this?

tender shard
fresh timber
#

oh yes

tender shard
#

if it returns null, then this entity is either dead or not loaded anymore (chunks & stuff)

fresh timber
#

oh well thats a problem

#

id remove them from list if its not loaded xd

#

should I load chunks where they should be?

#

or only do if they are loaded

#

or what

tender shard
#

well if you really only have 20 chunks, you can just keep them force loaded

fresh timber
#

yea ig

tender shard
#

but that's a bad idea if you ever have any more chunks later on

fresh timber
#

so on enable, should I use ticket thingy

#

chunkticket

tender shard
#

yeah if you only have 20 chunks or so, that's totally fine

#

but if it becomes 200 chunks, then it's not a good idea lol

fresh timber
#

does ticket keep it loaded until plugin closes?

tender shard
#

yes

fresh timber
#

okay good

tender shard
#

yeah but ofc you wanna do it for every chunk yuo wanna keep loaded, not just a single one

fresh timber
#

yes ik

tender shard
#

oki

dry forum
#
            for(int z = (int) e.getBlockPlaced().getZ() - 11; z <= (int) e.getBlockPlaced().getZ() + 11; z++) {

                if (x == e.getBlockPlaced().getX() - 11 || x == e.getBlockPlaced().getZ() - 11 || x == e.getBlockPlaced().getX() + 11 || x == e.getBlockPlaced().getZ() + 11) {
                    e.getBlock().getWorld().getBlockAt(x, e.getBlock().getY() - 1, z).setType(Material.RED_WOOL);
                }
            }
        }```
 i want to make a border of red wool but this only makes 2 lines
tender shard
#

show a screenshot pls of how it currently looks, and how it should look

dry forum
#

cant upload files..

#

orange = center block
red = blocks that are placed
green = where they should also be

tender shard
#

hm yeah your math is off then

#

usually, you wanna do it something like this:

#

erm

#

one sec, gotta start intellij

#
    public static void createBorder(Location start, Location end) {
        BoundingBox box = BoundingBox.of(start, end);
        int minX = (int) box.getMinX();
        int minY = (int) box.getMinY();
        int minZ = (int) box.getMinZ();
        int maxX = (int) box.getMaxX();
        int maxY = (int) box.getMaxY();
        int maxZ = (int) box.getMaxZ();
        Material mat = Material.RED_WOOL;
        for(int x = minX; x <= maxX; x++) {
            start.getWorld().getBlockAt(x, minY, minZ).setType(mat);
        }
        for(int z = minZ; z <= maxZ; z++) {
            start.getWorld().getBlockAt(maxX, minY, z).setType(mat);
        }
    }
#

might be totally wrong though haha

dry forum
#

ill try it thanks for the help

tender shard
#

but yeah basically you need two for loops, one for minX > x > maxX, and one for z

#

you don't even need the BoundingBox part but I guess it's easier to use it

dry forum
#
                new Location(e.getBlock().getWorld(), e.getBlockPlaced().getX() - 11, e.getBlock().getY() - 1, e.getBlockPlaced().getZ() - 11),
                new Location(e.getBlock().getWorld(), e.getBlockPlaced().getX() + 11, e.getBlock().getY() - 1, e.getBlockPlaced().getZ() + 11)
        );``` not sure if im doing something wrong but this is the result i get https://cdn.discordapp.com/attachments/829796363188830218/1047356560235560970/image.png
tender shard
#

and with Y, I actually meant Z, lol

#

tip: make a drawing on actual paper with the coordinates

#

then you'll see how the loop should work

#

sounds stupid, but it helps

#

what I sent earlier was probably wrong

#

you definitely need 4 for loops

dry forum
#
        BoundingBox box = BoundingBox.of(start, end);
        int minX = (int) box.getMinX();
        int minY = (int) box.getMinY();
        int minZ = (int) box.getMinZ();
        int maxX = (int) box.getMaxX();
        int maxY = (int) box.getMaxY();
        int maxZ = (int) box.getMaxZ();
        Material mat = Material.RED_WOOL;
        for(int x = start.getBlockX(); x <= end.getBlockX(); x++) {
            start.getWorld().getBlockAt(x, minY, minZ).setType(mat);
        }
        for(int z = start.getBlockZ(); z <= end.getBlockZ(); z++) {
            start.getWorld().getBlockAt(maxX, minY, z).setType(mat);
        }
    }``` yeah getting the same result
tender shard
#

sth like this maybe

        for(int x = minX; x <= maxX; x++) {
            start.getWorld().getBlockAt(x, minY, minZ).setType(mat);
        }
        for(int z = minZ; z <= maxZ; z++) {
            start.getWorld().getBlockAt(maxX, minY, z).setType(mat);
        }
        for(int x = minX; x <= maxX; x++) {
            start.getWorld().getBlockAt(x, minY, maxZ).setType(mat);
        }
        for(int z = minZ; z <= maxZ; z++) {
            start.getWorld().getBlockAt(minX, minY, z).setType(mat);
        }
#

idk, you have to try it yourself. you definitely need 4 for loops

#

I really suggest you to make a drawing, it'll help you to understand what's wrong / missing

#

I am too drunk to make a drawing myself rn

wet breach
dry forum
#

ok tysm for the help 😀 ill try some stuff and see if it works

wet breach
#

I get home usually around 7am CST

tender shard
#

real chads use GMT 😛

dry forum
wet breach
#

Alright -6 GMT I think

tender shard
#

you could condense that code into 2 for loops, but tbh, if it works now, I wouldnt touch it again haha

dry forum
#

as long as its not more laggy its fine

tender shard
#

not really, it's totally fine

#

just keep it like it is now

wet breach
#

Well like I said can help with that when at home lol

wet breach
tender shard
#

is there any "prematureoptimization" command?

#

?premature

#

?prematureoptimization

#

we should def have a command like that

wet breach
#

Um

#

?micro

#

Nope we don't lol

tender shard
#

sometimes people are like "WHY DO YOU USE A LIST INSTEAD OF A SET" and I always think "damn tbh you are right, but who cares"

wet breach
#

Lol

tender shard
#

anyway, I'm going to bed now lol. have a nice day everyone

wet breach
#

Cya

fervent panther
#

I'm so confused

public static void calculatePlayerStats(Player player) {
        PlayerStats playerStats = new PlayerStats();
        PlayerInventory inventory = player.getInventory();
        List<ItemStack> items = new ArrayList<>();

        items.add(inventory.getItemInMainHand());
        items.add(inventory.getItemInOffHand());
        items.add(inventory.getBoots());
        items.add(inventory.getLeggings());
        items.add(inventory.getChestplate());
        items.add(inventory.getHelmet());

        player.sendMessage("new PlayerStats() = " + playerStats);

        for (ItemStack item : items) {
            if (item == null || !item.hasItemMeta()) continue;

            Collection<CustomAttributeModifier> attributeModifiers = ItemUtil.getAttributes(item);

            if (attributeModifiers.size() < 1) continue;

            for (CustomAttributeModifier m : attributeModifiers){
                playerStats.applyAttributeModifier(m);
            }
        }

        player.sendMessage("Calculated playerStats = " + playerStats);
        playerData.put(player.getUniqueId(), playerStats);
    }
#

I don't understand why new PlayerStats(); would have any values

#

Here's PlayerStats

public class PlayerStats {
    private static final Map<CustomAttribute, Double> stats = new HashMap<>();

    public double getStat(CustomAttribute a) { return stats.get(a); }
    public void setStat(CustomAttribute a, double v) { stats.put(a, v); }

    public void applyAttributeModifier(CustomAttributeModifier m) {
        double value = m.getValue();
        CustomAttribute a = m.getAttribute();

        double currentValue = stats.getOrDefault(a, 0D);

        switch (m.getOperation()) {
            case ADD_NUMBER:
                stats.put(a, currentValue+value);
                break;
            case MULTIPLY:
                stats.put(a, currentValue*value);
                break;
            case MULTIPLY_SCALAR_1:
                stats.put(a, currentValue*(value+1));
                break;
        }
    }
}
fervent panther
#

Ok looks like adding a constructor and in it setting stats to a new hashmap fixes the problem

public class PlayerStats {
    private static Map<CustomAttribute, Double> stats;

    public PlayerStats() {
        stats = new HashMap<>();
    }
}

is there a better way to do this?

#

I'd also appreciate it if somebody would explain to me why not doing this was causing weird problems

humble tulip
#

Um

#

Why is that static

#

I have a dumb question. If i store a byte[] in a sql db does it take up at most byteArray.length bytes of storage?

river oracle
fervent panther
#

though I have been using statics for stuff like my ItemUtil class, but I'm not sure how to get around that

#

For example I have this to check if a namespaced key is for one of my custom attributes

public class ItemUtil {
    private static final String attributePrefix = "attribute.";

    public static boolean isAttributeKey(NamespacedKey key) {
        return key.getKey().startsWith(attributePrefix);
    }
}

Is this static abuse? Could someone point me to some resources on the topic?

rotund ravine
#

@fervent panther That’s fine

#

Don’t actually think there is a resource on static abuse. But if you could easily handle it with oop and use static instead cause ur lazy that is it.

wet breach
#

?staticabuse

#

?static

#

Guess not

tardy delta
#

^^

formal bear
formal bear
#

Now it looks like this ``` private File pluginConfigFile;

private static YamlConfiguration pluginConfig;

public static FileConfiguration getInstanceConfig(){
    return pluginConfig;
}

public void loadInstanceConfig(){
    pluginConfigFile = new File(getDataFolder(), "config.yml");
    pluginConfig = new YamlConfiguration();
    try {
        pluginConfig.load(pluginConfigFile);
    } catch (IOException | InvalidConfigurationException e) {
        e.printStackTrace();
    }
}```
#

do i need to call loading config everytime in event? i want to just load in when executing reload command

formal bear
#

idk if it was wrong or not, i thought its overloading like for example loading it everytime player joins

hybrid spoke
#

if it never changes you dont have to

#

if you expect it to change within, you would have to load it everytime to have the latest config applied

formal bear
#

so how to handle it? unregister and register events?

hybrid spoke
#

but since you only want to reload on reload, you dont have to load it back every time

formal bear
#
    private FileConfiguration config = bpLobby.getInstanceConfig();
    @EventHandler
    public void OnJoinEvent(PlayerJoinEvent event) {
           config.getString(...)
           ...
    }```
onyx fjord
#

Eyo I think it shouldn't be capitalized

hybrid spoke
#

hold the instance somewhere centralized and update it on reload

onyx fjord
#

Pure style problem

formal bear
onyx fjord
#

OnJoinEvent

formal bear
#

so like onJoinEvent

onyx fjord
#

Ye but that's just style

formal bear
#

okay i understand leave capitalized for classes

onyx fjord
#

Ye

#

Because you'd have stuff like new Someclass.DoSomething()

onyx fjord
#

In main class getServer().getPluginManager()
It'll be there iirc I'm on mobile tho

formal bear
#

something like? i want to reload config inside events, idk how to do it

onyx fjord
#

Oh

#

config.reload() in the library I'm using

#

In spigots idk

#

Why do you need to do it?

formal bear
formal bear
onyx fjord
#

YamlConfiguration#save(file)

#

Something like that

#

No

formal bear
#
        return pluginConfig;
    }

    public void loadInstanceConfig(){
        pluginConfigFile = new File(getDataFolder(), "config.yml");
        pluginConfig = new YamlConfiguration();
        try {
            pluginConfig.load(pluginConfigFile);
        } catch (IOException | InvalidConfigurationException e) {
            e.printStackTrace();
        }
    }``` And then ```    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        instance.loadInstanceConfig();```
onyx fjord
#

Try save maybe instead of load

#

That's what gugl said

formal bear
#

hmm okay

hybrid spoke
onyx fjord
#

I've never used spigot config API

#

So I'm just guessing stuff

formal bear
#

i did this it did not work

hybrid spoke
hybrid spoke
formal bear
hybrid spoke
#

yes it is

formal bear
#

and then how to use it properly in reload command and class with event?

hybrid spoke
#

either you use that singleton or inject your main via DI and call #reloadConfig inside your command class

#

same as for the event just that you then use #getConfig to get your stuff out of it

hybrid spoke
#

but you dont want to read from the file everytime something happens so i would cache your config values somewhere, even tho i believe that #getConfig is a cached instance of the config file

formal bear
#

okay, i was 1 step behind it lol

#

i made it outside the eventhandler

#

so it only loaded on register

hybrid spoke
#

no idea what you're talking about but that sounds wrong

formal bear
#

    public JoinEvent(bpLobby instance) {

        Bukkit.getPluginManager().registerEvents(this, instance);

    }

    private FileConfiguration config = bpLobby.getInstanceConfig();

    @EventHandler
    public void onJoinEvent(PlayerJoinEvent event) {
        String prefix = config.getString("prefix");
        ...
    }

}
#

It loads on registerEvents only right

#

but if i move config to eventhandler it will load every time its called

hybrid spoke
#

no, rn your listener registers itself what it shouldnt do.

formal bear
#

thats what i found on the internet lol 😂

hybrid spoke
hybrid spoke
#

give it a thumb down because thats garbage

#

bpLobby should btw. be uppercase

formal bear
#

so i need to make some other class like RegisterEvents and in it do Bukkit.getPluginManager.registerEvents

formal bear
hybrid spoke
#

store the passed instance of your main class inside your listener and use it in the eventhandler to load the config. thats all. but as it seems you didnt wanted to load it in the eventhandler so screw the loading

hybrid spoke
undone axleBOT
hybrid spoke
#

then use the javadocs to get your stuff done

#

?jd-s

undone axleBOT
formal bear
#

tysm for help

hybrid spoke
#

?configuration

#

?config

#

wasnt there a config command

formal bear
#

idk ;D

hybrid spoke
compact solstice
#

how can I make ranks look like this?

#

thats not really helpful, but thank you anways

#

you maybe could give me an example of these type of "models" for ranks

hybrid spoke
compact solstice
#

so its not possible to have the "normal looking" ranks and these both?

hybrid spoke
#

your customname would look like something like this: \u01234 > GodCipher where \u01234 is changed to an icon in your TP or whatever you like

#

f.e.

green prism
#

What did you want to say before?

green prism
chrome beacon
#

Are you trying to use SQLite?

tender shard
#

there is no default database. usually every plugin has their own, inside the plugin folder

#

whut

hazy parrot
#

Sounds like a pretty vague question

tender shard
#

yeah

#

usually you just add some sqlite thingy to your pom.xml lol

#

and then you use that

chrome beacon
#

tbh It sounds like you're a bit lost on what you're trying to do

#

So try to explain it better

tender shard
#

and eat some schnitzel, it always helps

onyx fjord
#

I think they are looking for some library perhaps to start working in sqlite

tender shard
#

right kacper?

#

schnitzel always helps

#

admit it

onyx fjord
#

What's schnitzel

tender shard
#

wtf

onyx fjord
#

Sounds like schabowy wannabe

tender shard
#

this is a schhnitzel

onyx fjord
#

Yeah schabowy

#

Is it pig meat?

tender shard
#

polish is funny

#

the original version is calf, but usually it's pork, yes

#

it can also be chicken

#

but then it's called chicken schnitzel

onyx fjord
#

That's our national food 😠

tender shard
#

no it's ours!

onyx fjord
#

Ok let's verify that

tender shard
#

let's just share it

#

we can both have it

#

deal?

onyx fjord
#

Also we eat it with mashed potatoes

tender shard
#

this is a proper schnitzel

hybrid spoke
onyx fjord
#

Ketchup oh no

tender shard
hybrid spoke
tender shard
#

haha

onyx fjord
#

Ketchup on schabowy 😭

tender shard
#

I prefer some mushroom sauce but to each their own lol

hazy parrot
tender shard
onyx fjord
#

@tender shard L it's from Austria

tender shard
#

ik

onyx fjord
#

And it doesn't originally use pig

tender shard
#

yeah the original version is made from calf

#

but I dont like that

onyx fjord
#

Cielęcina

#

Haha

#

Cielę is a small 🐮

chrome beacon
#

Which is what mfnalex said

green prism
#
@AllArgsConstructor
@Data
public class Element {
    private Component displayName;
    private List<Component> lore;
    private Material material;
    private @Nullable Enum<?> action;
    private @Nullable Consumer<InventoryClickEvent> event;
    private int slot, customModelData, amount;
}```

Associate a Consumer to an Element or an Element to an Action? 
hmh
hybrid spoke
#

now im hungry, well done guys

chrome beacon
#

Which jbdc are you trying to use

#

MySQL?

tender shard
#

did you do Class.forName("some.random.sqlite.driver") ?

hybrid spoke
green prism
hybrid spoke
#

the action should stay the same

#

just applied on different slots

tender shard
#

i usually just use the itemstack's PDC to define the actions lol

green prism
compact solstice
green prism
#

Actions should start a convo to change values

#

Example:

    private Consumer<InventoryClickEvent> generateNameSetupConsumer() {
        return consumer -> {
            player.closeInventory();

            Component[] messages = new Component[]{
                    Lang.CREATE_COMPANY__CONVO__SET_NAME__CHAT_MESSAGE,
                    Lang.CREATE_COMPANY__CONVO__SET_NAME__TITLE__TITLE,
                    Lang.CREATE_COMPANY__CONVO__SET_NAME__TITLE__SUBTITLE
            };

            Convo convo = new Convo(plugin, player, ConvoType.STRING, messages, Lang.CONVO_EXIT_WORD);
            convo.setOnComplete(event -> {
                String input = event.getMessage();
                if (input.length() > 32) {
                    player.sendMessage(Lang.CREATE_COMPANY__CONVO__SET_NAME__FAIL.replaceText(TextReplacementConfig.builder()
                            .matchLiteral("%s")
                            .replacement(input)
                            .build()));
                    create();
                    return;
                }

                player.sendMessage(Lang.CREATE_COMPANY__CONVO__SET_NAME__SUCCESS.replaceText(TextReplacementConfig.builder()
                        .matchLiteral("%s")
                        .replacement(input)
                        .build()));
                name = input;
                create();
            });

            convo.setOnFail(event -> this.create());
            convo.setOnExit(event -> this.create());
        };
    }
tender shard
#

why do you create a new consumer everytime? just save it in a field

onyx fjord
green prism
bold gorge
tender shard
onyx fjord
#

Chicken for schabowy makes it literally just a big nugget

bold gorge
#

pork is super high in saturated fat

tender shard
#

no, you have to declare the class name, not the dependency name

bold gorge
onyx fjord
tender shard
#

usually it's simply ```java
Class.forName("org.sqlite.JDBC");

gleaming grove
#

Could you recommand any good library for Map GUI?

fierce whale
#

Is there anyway to get entities in radius around Location?

bold gorge
tender shard
bold gorge
#

eat chicken, fish, diary, etc.

#

im also into fitness so i know about these stuff

tender shard
onyx fjord
#

My dad lives for ~50 year's eating schabowy two times a week and he is fine (he is also a long time smoker)

fierce whale
bold gorge
tender shard
# fierce whale circle radius can be okay
    public static Set<Entity> getEntitiesInRadius(Location center, double radius) {
        Set<Entity> entities = new HashSet<>();
        for (Entity entity : center.getWorld().getEntities()) {
            if (entity.getLocation().distanceSquared(center) <= radius * radius) { // distanceSquared is faster than the normal distance() method
                entities.add(entity);
            }
        }
        return entities;
    }
onyx fjord
#

Fish only on Fridays

bold gorge
#

besides, if he lives a lot when eating pork and smoking, he can live a lot more not eating pork and not smoking

fierce whale
tender shard
bold gorge
fierce whale
green prism
tender shard
#

it's a huge mess

fierce whale
#

nms... haha...

tender shard
#

show your code pls

#

this is an example for xaerial