#development

1 messages · Page 124 of 1

lyric gyro
#

No error but the boss bar doesn't show now.

neat pebble
#

BossBarManager#toggleBossBar

#

you have to add the players to the bossbar

#

TABPlayer

dense drift
neat pebble
#

as I said, it's overkill

#

and he doesn't use paper

#

and is running 1.8.8

dense drift
#

adventure is not limited to paper, what do you mean?

#

and runs just fine on 1.8-1.18

neat pebble
#

I mean that adding adventure

#

its overkill

#

if you will only use bossbar

dense drift
#

no its not

lyric gyro
#

TAB has legit everything I need.

#

Yeah.

dense drift
lyric gyro
#

Wait.

lyric gyro
neat pebble
#

I know that adventure its probably better, but you will add a lot of weight to your plugin

lyric gyro
#

everything

#

lmao

neat pebble
#

really? XD

#

I thought it was heavier

lyric gyro
#

@neat pebble What's TabPlayer?

neat pebble
#

getPlayer(UUID)

#

but, yep, you should actually use adventure

lyric gyro
#
            TabAPI.getInstance().getBossBarManager().createBossBar("TEST", 0.1f, BarColor.PURPLE, BarStyle.NOTCHED_20);
            TabAPI.getInstance().getBossBarManager().toggleBossBar(TabAPI.getInstance().getPlayer(player.getName()), true);
neat pebble
#

I thought it was heavier

#

and as they said, its a pretty good library

lyric gyro
#

Lemme check it out.

#

But that code doesn't work for Tab for some reason.

lyric gyro
#

it does have a bit of a learning curve if you aren't familiar with the concept of components (though they have existing for almost a decade.... funny)

#

Installing it now.

#

but once you get a few concepts down which can be easily solved by reading the docs and asking away, it's pretty nice to use

dense drift
#

ngl adventure is 🔥

neat pebble
#

yup

dense drift
#

I dislike that they don't want to add support for other formats for MM placeholders :((

lyric gyro
#

well the format has to follow the rest of the MM format

#

Is there any plugin that I would need to install or nah?

#

it's a library you shade into your plugin, no

#

Ah, perfect.

#

The BossBar doesn't seem to show up...

#

can't help with what I can't see

#

Sending it.

#

what did you even do until now?

#

BossBar bossBar = BossBar.bossBar(Component.text("Cat counter"), 0, BossBar.Color.RED, BossBar.Overlay.PROGRESS);

#

Just copied it from the docs to test.

#

No errors.

#

Did I forget to add a player...

#

What about that exactly isn't working? It's not finding the BossBar class? A method isn't working?

#

It just doesn't show the BossBar.

#

Like, there aren't any errors.

dense drift
neat pebble
#

I don't know how adventure handles bossbar, but probably you have to add a player

#

or audience

lyric gyro
#

I don't see a method for it.

lyric gyro
#

player.showBossBar(bossBar);

#

It just doesn't show up as a valid method.

#

Because it's not

neat pebble
lyric gyro
#

Wait, I'm stupid.

#

Omfg, that's embarrassing.

#

lol

#

don't be, happens more than it should

neat pebble
#

yep XD

lyric gyro
#

Think of an audience as a "viewer", in the case of sending messages the "viewer" could be a player or could be console
Pointers are an abstract way to get data from an audience they may or may not have, e.g. a UUID, console does not have a UUID, but players do

queen plank
#

How do I get the classes from the package with the path "path" that extends Component? ```java
public static Set<Class<? extends Component>> getComponentClassesFromPackage(String path) {
Set<Class<? extends Component>> set = new HashSet<Class<? extends Component>>();
try {
Reflections reflections = new Reflections(path);
for (final Class<? extends Object> clazz : reflections.getSubTypesOf(Object.class)) {
/* Add the class "clazz" to the set if it extends Component */
}
} catch (Exception e) {
}

return set;

}```

lyric gyro
#

😵‍💫

#

what

queen plank
#

Wat :V

lyric gyro
#

Yeah

#

Audience target = Audience.audience().get(player.getUniqueId());

#

It's says that it's an invalid pointer hmm.

#

uhm yeah that's not how you get an audience tho

#

Pointers are irrelevant to your situation right now just to be clear

lyric gyro
#

Or can I just do Audience.audience().showBossBar(bossBar);?

lyric gyro
#

Like these (ignore the filter one)

lyric gyro
#

Let me start from scratch

#

You have a Player

#

Yes.

#

But you need an Audience to send the boss bar

#

Yup.

#

BukkitAudiences is that bridge between Bukkit and.. Audiences

#

lol

lyric gyro
#

what do you mean?

#

Cannot resolve symbol 'BukkitAudiences'.

#

I tried to follow the initialization process on the docs.

#

Did you add the -platform-bukkit dependency?

lyric gyro
lyric gyro
#

😄

queen plank
#

I get this java.lang.NoClassDefFoundError: org/reflections/Reflections error when I run this code in my program. java try { System.out.println("Test"); Reflections reflections = new Reflections(path); set.addAll(reflections.getSubTypesOf(Component.class)); } catch (Exception e) { e.printStackTrace(); } I read I have to shade it, how do I do that? Google isn't very helpful rn...

grim oasis
#

just rename 5555 to 0

#

ez @burnt turret

#

what

#

is all you have to do rename them?

#

because you could just rename 5555 to 0....

#

as I said

#

I am genius

#

nope

sage swan
#

I am trying to use ParticleLib to spawn a custom particle in my plugin (1.7.10)
But I am not sure how to get the net.minecraft.world.World parameter needed.
The error i get currently is:

org.bukkit.craftbukkit.v1_7_R4.CraftWorld cannot be cast to net.minecraft.world.World

and my function for particle lib is:

ParticleLib.proxy.spawnParticle((net.minecraft.world.World)player.getWorld(), ... other args

I've tried this method: ( (CraftWorld) player.getWorld()).getHandle() but it doesn't return the right type.

particle lib function takes these args:

  public void spawnParticle(World world, double x, double y, double z, ResourceLocation texture, int age, float gravity, float scale) {}

How do I get the world if I'm using org.craftbukkit?

night ice
#

@burnt turret Does that thing needed to be shell script itself?

past ibex
#

that's the dm botter guy

#

@burnt turret Imagine scamming kids for a living

sage swan
#

Also I'm not strictly looking for an answer to that question, I'm just looking for a way to spawn an effect with a custom texture in 1.7.10

night ice
sage swan
#

the guy that was asking for a script

thorn cape
#

dumb question alert DinkDonk

How do I tell intelliJ that this is not null if isOnTeam returns true

dusty frost
#

Don't have a separate field for isOnTeam, just have getTeam return null if no, and a team if yes

#

then you have one check for if getTeam == null and otherwise you got the team

thorn cape
dusty frost
#

Yes

#

Null check at the point of usage, less chance for a race condition or whatever

#

And then IJ can see what you're doing and guarantee that it's not null

thorn cape
#

Alright, thanks 👍

nova sequoia
#

plugin noflyzone doesnt work please help me!!!!

left crane
#

?

spark totem
#

So with deluxe tag this is the right format right? "{prefix}{name}&8: &e{message}" '%deluxetags_tag%'

rugged bane
leaden sinew
#

noflyzone obviously

dense drift
#

Does anybody know the equivalent for curl --form on java HttpRequest?

fickle elm
#

Hi how to add js packages in js expansion scripts

upper jasper
pulsar ferry
#

Collections.unmodifiableMap retuns a normal map you can just do entrySet on it, I don't think I understand the issue

queen plank
#

How do I fix Exception in thread "main" java.lang.NoClassDefFoundError: javassist/bytecode/ClassFile? My plugin worked, then I exported it again and it stopped working. I change some souts, that was all.

pulsar ferry
#

I'm assuming you reloaded the server, restart it instead and try again

queen plank
#

No, I restarted it

#

Turned it off completely

hoary scarab
#

Thank you though.

forest jay
#

I used buildtools and got the unobfuscated version of 1.18.1 nms, and added it to my project libraries through my Intellij project structure. How do I let gradle know that I did that, and allow me to compile the plugin?

pulsar ferry
#

To make your life easier use the paperweight gradle plugin

forest jay
#

paperweight?

#

I dont use papermc

#

I use spigot

lyric gyro
#

if you're using gradle and you want to use internals

#

trust me

#

paperweight is the easiest way to go

#

if you don't want to target paper specifically.. just don't use paper specific methods

pulsar ferry
#

You can use spigot for the plugin and paperweight to add nms

forest jay
#

what difference does it make?

lyric gyro
#

the tooling sets up everything for you

#

it's literally plug and play

pulsar ferry
#

You won't be able to compile to obfuscated while using deobfuscated without it

forest jay
#

ah

#

alright

#

how do I install paperweight to mavenLocal()?

pulsar ferry
forest jay
#

I added the entry to plugins {} and not it says it that it is not in the org.gradle namespace and it cannot resolve plugin artifact

#

is there a repo or something I am missing?

pulsar ferry
#

Yeah, check the settings.gradle.kts file, you need the plugin repository

forest jay
#

would that translate over to a non Kotlin setting.gradle file?

pulsar ferry
#

Idk if it works on groovy, I remember seeing a message about it on paper saying it only worked on kts but I am not sure

#

Use kts though, it's not that different

forest jay
#

so just change the ending to .kts?

pulsar ferry
#

Yeah

forest jay
#

k

forest jay
# pulsar ferry Yeah

It says that compileOnly is invalid, would I use implementation instead? I am using a gradle shadowing plugin that uses implementation

pulsar ferry
#

For what? ;o

#

Like which dependency

forest jay
#

all of them

pulsar ferry
#

For nms it'd be paperDevBundle for spigot api it'd be compileOnly anything you want to shade is implementation

forest jay
#

Intellij says compileOnly doesnt exist

pulsar ferry
#

Can you send your gradle?

#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

forest jay
#

the first dependancy should be compileOnly

#

not compile

pulsar ferry
#

It's not letting you do that because you still need to change a few things to refresh it for the first time

#

Also don't use paperweightDevelopmentBundle

forest jay
#

ok

pulsar ferry
forest jay
#

ok, now my gradle looks fine

#

but it still wont compile

#

says that it cant find symbol

pulsar ferry
#

Can you send the logs?

forest jay
#
import net.minecraft.world.entity.EntityTypes;
                                 ^
  symbol:   class EntityTypes
  location: package net.minecraft.world.entity
#

import net.minecraft.world.entity.EntityTypes;

#

it says that msg for each reference

#

of net.minecraft

sand ermine
#

Hey

#

Anyone got an idea on checking the amount of players in a world?
List<Player> players = world.getPlayers();

Integer size = players.size();
And then just do if(size == 2) {
Run code

#

But it only runs when 3 players join

proud pebble
#

run a for loop and have it run over every player and print their displayname to console, it will then tell you who is in that world, its possible that a player is duplicate or a npc is being counted for whatever reason.

#

because it should show just the players

sand ermine
shell moon
#

elaborate a bit more @sand ermine

#

what you wanna do exactly

proud pebble
#

actually thinking about it, why are you using Integer and not int?

#

i said that so you could figure out why and who was actually in the world

#

so you could figure out why its not working with the correct amount

#

you said it ran only if 3 players were in the world even tho you want it to only run if there are 2 players

torpid raft
shell moon
#

or better share the class? thonk

proud pebble
#

the thing that makes no sense is that the code should only function if the size of the list comes back as 2

#

unless list.size starts at 0

shell moon
#

or, share code

proud pebble
#

yeah

#

just do that

twilit delta
#

How can I make a while loop with spigot? When I use normal while it freezes the server.

twilit delta
#

Im trying to repeat a set of code when something is true, if thats not possible I want to repeat something for 15 seconds when I say so.

proud pebble
#

then you should use the bukkitrunnable

twilit delta
#

was dat

#

oh

#

yea im using that for schedual tasks

proud pebble
#

then use that

#

you shouldnt have a while loop that goes on for so long

#

you can schedule a repeating sync task

twilit delta
#

ye im trying that

shell moon
proud pebble
#

yes

shell moon
#

not how

#

what you wanna do exactly

#

example:

#

if you say: i want to repeat a task every 10 seconds

#

you should say: i want to spawn particles in players location

#

we wanna know what you wanna do

twilit delta
#

yea I think I know how

#

thanks guys

proud pebble
#

you wanna know if a player hits the group?

#

like takes damage?

twilit delta
#

No

#

I want to detect when a player hits the ground

proud pebble
#

when they hit the ground could they take damage?

twilit delta
#

No

shell moon
#

question is

#

why

proud pebble
#

cus if they took damage you couldve just listen to entitydamageevent and checked for the damagecause fall

shell moon
#

just tell us!!

twilit delta
#

Ok

#

So

#

I have something that launches a player up

#

And I want to detect when they hit the ground again

shell moon
#

i think the question would be

#

what are you coding

#

lol

twilit delta
#

um

#

idk how to answer that

shell moon
#

jsut say it

proud pebble
#

what would you do when this check is successful?

shell moon
#

no one will steal the idea and make a premium plugin

#

unless i like the idea

twilit delta
shell moon
#

i think he's adding the player to some kind of list

#

and he wants to remove the player on ground

#

ahh lol

#

golem skill

twilit delta
#

I would send a ss

#

but I caNT

shell moon
#

you do can

#

youhave 2 options

twilit delta
#
                                    if (p.isOnGround()){
                                        p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 40, 100));
                                        // p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 40, 0));
                                        Location location = p.getLocation();
                                        World world = p.getWorld();
                                        List<Entity> nearby = p.getNearbyEntities(4, 4, 4);
                                        for (Entity tmp: nearby)
                                            if (tmp instanceof Damageable)
                                                ((Damageable) tmp).damage(15);
                                        world.spawnParticle(Particle.EXPLOSION_LARGE, location, 10, 1, 1, 1, 1);
                                        hitground.remove(p.getUniqueId().toString());
shell moon
#
  1. reach Tier II ( i think)
#
  1. use imgur
neat pierBOT
#
FAQ Answer:

You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.

shell moon
#

is that supposed to be a skill?

twilit delta
#

No its an item

shell moon
#

mmmm

twilit delta
#

Here is the whole code

shell moon
#

easy then

#

right click, run runnable every 10 ticks or something

#

max time = 15 seconds

twilit delta
shell moon
#

check every 10 ticks if player is on ground

#

if so, spawn explosion

#

cancel task, remove from map

#

damn, that indentation

twilit delta
#

:D

shell moon
#

wait, the spaces

twilit delta
#

space?

#

wut

shell moon
#

whyyyyyy

twilit delta
#

i like space

#

i like space 👾

shell moon
#

loool

#

while (i<500) {

#

that will never

#

ever

#

work

twilit delta
#

it was a tesT

shell moon
#

thats run in less than a second

twilit delta
#

I know

shell moon
#

you are still in the air

#

as i said

twilit delta
#

yes YES

shell moon
#

run task timer

#

int time = 0

#

time++ inside the run

#

if time >= 30

#

that means 15 seconds passed and player is still flying

#

we dont care about that, cancel task

twilit delta
#

xd

shell moon
#

and thats it

twilit delta
#

if they didnt hit the ground they are hacking

shell moon
#

easy

twilit delta
#

oki

shell moon
#

or

#

they died

twilit delta
#

il try that

shell moon
#

or

twilit delta
#

imagine dying

shell moon
#

they disconnect

#

or they are in water

twilit delta
#

aight fine

shell moon
#

or they are in the corner of a block

twilit delta
#

you win

#

SHUT

shell moon
#

or they are using a ladder

#

or they have slow falling effect

twilit delta
#

o

#

m

shell moon
#

or a shulker hit them

twilit delta
#

g

#

i love you

shell moon
twilit delta
#

:p

shell moon
#

part of being a dev

#

is considering every possible cases

#

so, good luck lmao

proud pebble
#

there are alot of reason that a player might not have hit the floor

#

tho you could force the position

proud pebble
#

in theory

twilit delta
#

dont need to rub it in

lyric gyro
shell moon
#

loading Searches what "rub" means loading

#

aeUIfeatureupdates new word learned, thanks!

sand ermine
shell moon
#

w h y

#

alonso, i wanna make a speedrun

#

i wanna make a manhunt

#

i wanna make a skywars of 2 players

sand ermine
#

making a bedwars 1v1, everything is working apart from this.
When 2 players join I want it to run specific code (Starting countdown and tping), I want so that when there are already 2 and other people join it doesn’t let them

shell moon
#

you need to start with that

#

if you have a bedwars system

#

then you are using arena manager

#

that means you have a method to

#

joinArena(Player player

#

or something like that

#

make the check there

sand ermine
#

Yes I do

#

The if statment is running though when 3 people join and not 2

shell moon
#

show that class

#

your question is total no sense

sand ermine
#

Okay look

shell moon
#

"i wanna make it when 2 players join the same world"

#

that's totally useless since you already handle

#

games in a way

sand ermine
#

How do I get the amount of players in a world, and if there is 2 players run certain code

shell moon
#

why world?

#

why?

#

if you have an arena system

#

you must have a way to check

#

how many players

#

are in that arena

#

why not simply check that

twilit delta
#

So I have that

#

And nothing happens

#

Everything around it works

shell moon
#

bruh

twilit delta
#

But not that

shell moon
#

if (hitground.containsKey(p.getUniqueId().toString())) {

#

why

#

cant you simply check uuid

twilit delta
#

its a hashmap

#

unrelated

shell moon
#

you should Hashmap<UUID>

#

instead of Hashmap<String>

#

why the hashmap for that?

#

this.counter--;

twilit delta
#

Its so multiple people can do it at once

shell moon
#

totally useless

#

inside the onGround

twilit delta
#

omg

#

i put it there

#

im so dum

#

thanks

#

so

#

much

shell moon
#

suggestions:

  1. use UUID, not toString()
  2. the hashmap should be usingSkillsMap where player is added on right click and removed when (1. hits the ground 2.time expires)
  3. dont use unnecessary line breaks (enter), it makes the code unreadable
twilit delta
#

ive got it working EVERY OTHER activation

#

my brain hurts

#

fixed it

#

thanks

shell moon
fickle elm
#

How can I import javascript packages in javascript expansion's scripts

kind granite
#

depends on what you mean by a javascript package

fickle elm
formal crane
#

I use this for getting data in SQLite but how would i for example get the player from the kills? (the other way arround)

        Connection conn = null;
        PreparedStatement ps = null;
        ResultSet rs = null;
        try {
            conn = getSQLConnection();
            ps = conn.prepareStatement("SELECT * FROM " + table + " WHERE player = '"+string+"';");

            rs = ps.executeQuery();
            while(rs.next()){
                if(rs.getString("player").equalsIgnoreCase(string.toLowerCase())){ // Tell database to search for the player you sent into the method. e.g getTokens(sam) It will look for sam.
                    return rs.getInt("kills"); // Return the players ammount of kills. If you wanted to get total (just a random number for an example for you guys) You would change this to total!
                }
            }
        } catch (SQLException ex) {
            plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), ex);
        } finally {
            try {
                if (ps != null)
                    ps.close();
                if (conn != null)
                    conn.close();
            } catch (SQLException ex) {
                plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), ex);
            }
        }
        return 0;
    }```
formal crane
#

?

#

oh wait i can just loop through the players and see which one has the most kills

shell moon
#

what are you trying to do exactly

#

thats the question

tight junco
#

and please use UUIDs

shell moon
#

x2

#

and prepared statements, please

tight junco
#

you can do SELECT * FROM table WHERE player = ? and use prepared statement to fill the blanks

#

wait can you do SELECT * FROM ? WHERE player = ?

formal crane
shell moon
#

SOLID

formal crane
#

and is it possible to loop through a column?

#

i want to get the player with the most kills for example

shell moon
#

to loop a column

#

if you mean loop all entries

#

i guess a while loop

#

question is why

brittle thunder
formal crane
shell moon
#

then do what Yugi suggested

formal crane
#

i am gonna try 🙂

formal crane
river solstice
#

I think you should learn more about SQL and programming in general, not being aggressive here.
X is the amount of entries (rows) your query will return. If your X is 100 and your table has 10 rows, it will only return 10.

#

If you want to get ALL of them, don't do limit.

worn jasper
#

uhm how can I change the effect, more specifically the color of a potion itemstack?

pulsar ferry
#

d;spigot PotionMeta#setColor

uneven lanternBOT
#
void setColor(@Nullable Color color)```
Description:

Sets the potion color. A custom potion color will alter the display of the potion in an inventory slot.

Parameters:

color - the color to set

shell moon
pulsar ferry
#

Imagine documenting the api with @Since smh
Probably 1.13? But not sure

worn jasper
#

uh I will only support 1.17+ I think

#

with full respect and no offense to anyone.

#

Officially. Fuck legacy versions.

#

(and thanks matt)

shell moon
#

||I felt offended, reported to discord||

worn jasper
#

Also, that allows for custom colors, what if I want colors from actual different potions that already exist?

worn jasper
lyric gyro
#

I hate that there are like 2 or 3 different ways of making potions and defining their color

#

And depending on which method you use you can't do some other stuff

worn jasper
#

(or do they? fuck)

#

I am basically trying to loop all potion effects and give them their respective pot

pulsar ferry
#

I mean would it make sense for it to not work if the color is the one another potion uses?

worn jasper
#

uh I just looped PotionEffectType.values()

#

and then used the #getColor() of it to get the color

#

so suppose we gud

thorn cape
#

I cant seem to get buildtools working is there any other way to get the Spigot 1.17.1-R0.1 sources etc.

forest jay
#

How do I get the NMS Level object from a bukkit world?

#

I try the whole getHandle() thing but that returns WorldServer

twilit delta
#
Vector dir = p.getLocation().getDirection();
p.setVelocity(dir.multiply(2.5));
```Anyone know why when I launch myself upwards its so much more dramatic than when I go forward on an angle?
past ibex
#

normalize your vectors

twilit delta
past ibex
#

.normalize()

#

although getDirection() may already be normalized, I forgot

#

yeah, it's normalized. Nevermind, it wouldn't do anything

pulsar ferry
#

Direction is a vector between -1 and 1 on each axis

past ibex
#

public Vector getDirection()
Gets a unit-vector pointing in the direction that this Location is facing.

#

anyways, you might be talking about how when the player is on the ground, their velocity gets reduced by 0.6 * 0.91 every tick. While if the player is in the air, it is reduced by * 0.91 every tick

past ibex
#

java -Dpaperclip.install=true -jar paperclip.jar

#

for the paper sources at least. anyways, I'd just get buildtools to work instead.

thorn cape
past ibex
#

Did you try deleting everything in that folder except BuildTools.jar?

lyric gyro
past ibex
#

perl filetype

thorn cape
surreal lynx
light ice
#

What is this called?

list:
  'nested1':
    - 'String'
    - 'String2'
  'nested2':
    - 'String'
    - 'String2'
#...

A nested string list?

#

I believe?

#

Anyways, I can't figure out how to get the amount of nested lists there
Like I want to add nested1 and nested2 together

shell moon
#

Get lists, combine both

light ice
#

for (String key : config.getConfig().getConfigurationSection("list").getKeys(false)) {

I've tried creating an ArrayList to add the keys right?

#

But it doesn't return right

shell moon
#

What does

#

It doesnt return right means

light ice
#

Hold on, let me try to recreate it

shell moon
#

Short answer:

#

Create list
For loop
Add to list if not present
Use list

light ice
#

key in the for loop is equal to nested1, nested2 correct?

#

Or, if I do "list." + key

shell moon
#

Its the key

#

Not full path

#

You add the list. To be able to get lists

light ice
#

So yes, "list." + key

#

What do I add to the ArrayList?

#

key, or "list." + key?
And if I add "list." + key I need to do config.getConfig().getString("list." + key)?

lyric gyro
#

list is a configurationsection
list.blah is a list of strings

light ice
#

Right, and I want to get the amount of list.blah

olive dirge
#

Are you trying to get the list from config?

light ice
#

Yes

olive dirge
#

You can use getList()

light ice
#

I want to get the amount of lists

olive dirge
#

oh

light ice
#

In the configurationSection

lyric gyro
#

how many lists are under list

light ice
#

In the example, 2

lyric gyro
#

yeah

olive dirge
#

I think he wants the size of keys under that list

light ice
#

Yes

lyric gyro
#

config.getConfigSection("list").getKeys(false).size() should work ?

light ice
#

I will try that

thorn cape
light ice
#

And thank you Failures and thank you AlonsoAliaga

past ibex
#

Did you follow the buildtools guide exactly?

light ice
#

If that's what you're asking

#

I know that worked for 1.18 for me, before I switched to gradle

lyric gyro
light ice
#

Then I don't know, never tried to mess with that lol

#

Anyways cya'll later

past ibex
#

if you really give up, codemc has a NMS repo

dusky harness
#

wait what-

past ibex
dusky harness
#

👀

#

but isn't that not allowed

past ibex
#

it's not legal

#

getbukkit also does the same thing and hasn't been taken down

dusky harness
#

true

lyric gyro
#

Who cares about that dkim

#

Pretty much nobody unless they are trying to go open source

#

Even then mojang won’t care for half a second

thorn cape
winged pebble
#

artifactid spigot-api doesn't include nms btw

winged pebble
#

Are you using java 16?

flat anchor
#

hello guys! Maybe who knows how to correctly cancel WindowClick packet on 1.17+ versions?

#

i am tried method from PlayerConnection

#
    // Clear carried item
    connection.sendPacket(
        new WrappedOutWindowSetSlotPacket(
            -1,
            -1,
            player.playerInventory().incrementStateId(),
            player.playerInventory().carriedItem())
    );
    // Reset in menu
    connection.sendPacket(
        new WrappedOutWindowSetSlotPacket(
            packet.windowId(),
            packet.clickedSlot(),
            player.incrementStateId(),
            packet.clickedItem())
    );
    // Update current container
    player.updateContainer();
#

but when user is spamming with click it removes item from menu

#

i am not sure is the best solution hold previously clicked item as far as i have animated buttons

warm steppe
#
@EventHandler
public void onInventoryClickEvent(InventoryClickEvent event) {
    event.setCancelled(true);
}
flat anchor
#

i want use bukkit event system

#

i just trying to found another way to handle inventory click and implement it in my gui system

warm steppe
#

?mf

neat pierBOT
flat anchor
#

i guess, that someone also tried to do smth like that

flat anchor
flat anchor
#

Nvm, founded solution

#

simply caching in updatable buttons current stack (if someone will need)

hidden galleon
#

anyone know how to use TimeAPI with maven?

spiral prairie
#

what TimeAPI

hidden galleon
#

the one by PiggyPiglet

spiral prairie
#

jsut like you do with any other dependency

warm steppe
#

maven 🤡

spiral prairie
#

^ that too

hidden galleon
#

;-;

#

you didnt have to do that to me man

spiral prairie
#

we do

warm steppe
#

it doesnt support maven

#

shush

spiral prairie
#

but no one should use it kekw

#

whoops

#

no it doesnt

hidden galleon
#

well on its github repo page

spiral prairie
#

becuase

hidden galleon
#

the instructions are only for gradle

#

not for maven

spiral prairie
#

use your brain

#

and translate it?

#

not hard

#

literally

#

repository

wheat carbon
#

hello

#

please be nice

spiral prairie
#

exactly the same

warm steppe
#

hey piggy

hidden galleon
#

oh hey PiggyPiglet

#

apparently maven users are not treated equally here on this discord server

wheat carbon
#

I think you can just paste the gradle code into your pom and ij will translate it to xml

warm steppe
spiral prairie
#

they are not treated equally by me pepered

wheat carbon
hidden galleon
#

ok that didnt work

wheat carbon
#

that... is unfortunate

#

basically gradle format is super simple

hidden galleon
#

I use IntelliJ

wheat carbon
#

the url is the maven repository url, I'm sure you can convert that to maven format on your own

#

the dependency is groupid:artifactid:version

#

the version being + is equivalent to maven's LATEST

#

"implementation" is equivalent to the COMPILE scope for maven, however that's default, so no need to explicitly declare it

spiral prairie
wheat carbon
#

shading isn't a vanilla feature of gradle, you have to use a third party plugin

spiral prairie
#

because thats a big point for me, at least in Minecraft terms

wheat carbon
#

(mind you, you have to use a plugin in maven too, but that's official)

spiral prairie
wheat carbon
#

that argument is only really based on vanilla features

spiral prairie
#

its just so much bigger with maven, and i think that's important to note

wheat carbon
#

but in saying that

#

to shade with maven you've got what, like 30 lines of plugin configuration

#

it's legit just 1 line in gradle

spiral prairie
#

yep

wheat carbon
#

id 'com.github.johnrengelman.shadow' version '6.0.0'

wheat carbon
#

idk what the latest version is

spiral prairie
#

yea

#

and the configuration

#

with relocations and exclude stuff

#

goals n stuff

#

many less lines, so i think it should be there

wheat carbon
#

relocations are just one line in gradle aswell, excluding the 2 lines for block opening & closing on the shadowjar configuration

spiral prairie
#

yep

pulsar ferry
#

I guess the non third party way for gradle would be the distribution task from the application plugin
But it doesn't shade exactly, it creates a jar with lib jars inside

spiral prairie
#

yea

#

that wouldnt apply to mc plugins

scarlet abyss
#

its works on 1.18.2 ?

kind granite
#

what is "it"

terse belfry
#

Placeholder api

shell moon
#

Should, some people have issues with connection time out or something

hazy nimbus
lyric gyro
#

You win by saying mavens 200 years outdated

hazy nimbus
lyric gyro
#

Recompiles the whole thing

#

And looks like shit

hazy nimbus
#

btw, is it weird that I do not see any improvements with build cache? Can I check that it is really turned on?

#

I have a pretty small codebase tho (about 8k lines)

hazy nimbus
#

I have it enabled

#

At least I should

#

That's what I want to verify

lyric gyro
#

Well gradle already caches and watches input and output files pretty aggressively but you can generate a build scan with ./gradlew build --scan and check in the switches tab if the "Build Cache" is on or off

#

Build scans are godly prayga

#

So are you ems

#

pft if only

#

😘

hazy nimbus
#

I mean it still builds very fast

lyric gyro
#

I mean as far as I know it's working so Shrug

hazy nimbus
#

it just doesn't really change whether I turn it on or off, I guess I have too small codebase

#

it still builds under 2 seconds, so I am very happy with it

lyric gyro
#

You can also check what's taking the most time in the performance tab

#

I stg whoever invented build scans is the greatest person ever

hazy nimbus
#

yuh

#

it's like timings, but for building

#

lol I'm an idiot

#

the difference is 4s -> 1s with build cache

#

so worth it

quasi wigeon
#

Since modifiers does not exist in the Field class in java16. How can I edit a final field?

shell moon
#

Google didnt help?

past ibex
#

Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe");
unsafeField.setAccessible(true);
Unsafe unsafe = (Unsafe) unsafeField.get(null);
unsafe.putObject(connection, unsafe.objectFieldOffset(connectionsList), wrapper);

hazy nimbus
#

"Unsafe.class.getDeclaredField("theUnsafe");" I think this won't work on all JVM's

#

Please take a look at this method from Google's GSON

sudden sand
#

Guys how do I make a loop of all json object of json array in js ?

#

I mean i do myJsonArray#forEach but it returns undefined and when I print my json array everything is fine

#

also I can do myJsonArray[0].id

#

without problem

past ibex
#

it's different on android jvm

atomic trail
#

How do I change the player skin using this? Not sure which property to use, cannot find it in the docs or any tutorial

        protocolManager.addPacketListener(new PacketAdapter(infection, ListenerPriority.HIGH, PacketType.Play.Server.PLAYER_INFO) {
            @Override
            public void onPacketReceiving(PacketEvent event) {
                super.onPacketReceiving(event);

                for (PlayerInfoData playerInfo : event.getPacket().getPlayerInfoDataLists().read(0)) {
                    playerInfo.getProfile().getProperties().put();
                } 
            }
        });

Using Protocollib

hazy nimbus
#

you never know what people are going to attempt to do with your stuff

lyric gyro
proud pebble
#

changing player's skins is very difficult after 1.7.2 i believe

#

visually atleast

#

i remember watching a videa that said that cause people were changing skins too easily

neat pebble
#

Does someone know if its possible to serialize a TextComponent from adventure to String and deserilize it later without losing click events, hovers, etc?

#

I need it to send a redis message

hazy nimbus
#

👍

lyric gyro
proud pebble
#

i thought that it was clamped down on pretty hard by mojang, could be wrong tho

lyric gyro
#

nah i think its just value sig with playerinfo packet

#

wouldnt make much sense for that to change

#

maybe tho

past ibex
#

it's possible

neat pebble
atomic trail
#

Found out that it's not very difficult with Paper, you just need a signature for the skins now and the base64 ofc.

graceful juniper
#

Anyone know the base float for player speed?

past ibex
#

0.1

neat pebble
lyric gyro
#

wdym "it broadcasts the component style"?

#

what does it broadcast exactly? how are you deserializing and how are you broadcasting?

neat pebble
#

Im serializing with gson

#

wait, ill send an image

graceful juniper
neat pebble
past ibex
#

It’s not as simple as a number

lyric gyro
#

.5

graceful juniper
past ibex
#

It also depends on current friction

lyric gyro
#

Lmao idk go look at source

past ibex
#

getFrictionInfluencedSpeed

neat pebble
#
        TextComponent finalMessage = chatFormatSerializer.format(chatFormat, player).append(Component.text(message));

        return GsonComponentSerializer.gson().serialize(finalMessage);

thats how I serialize @lyric gyro

lyric gyro
#

how are you deserializing and how are you broadcasting?

neat pebble
#

Bukkit.getServer().broadcast()

lyric gyro
#

exactly

#

please

#

code

#

I can't help with what I can't see

neat pebble
#
        Bukkit.getServer().broadcast(GsonComponentSerializer.gson().deserialize(chatMessage.getMessage()));

lyric gyro
#

what's chatMessage?

neat pebble
#
public record ChatMessageBroadcaster(String message) {

    @ConstructorProperties({
            "message"
    })
    public ChatMessageBroadcaster {
    }

    public String getMessage() {
        return message;
    }
}
#

redis message

#

message is the serialized string

neat pebble
lyric gyro
#

are you calling toString on a component anywhere?

neat pebble
#

yes

lyric gyro
#

that would be it

neat pebble
#

ill try

graceful juniper
#

isnt speed a float not a double?

winged pebble
graceful juniper
#

Oh, I'm using Player's default setSpeed function

#

I assume attributes and setSpeed() is a bit different

winged pebble
#

It just sets a value. I don't know if it does what you want it to

graceful juniper
#

It does the exact same as the attribute in my experience

winged pebble
#

Well speed gets overwritten by the attribute, so setting it directly doesn't seem wise

graceful juniper
#

I'm currently trying it live and it seems to be working as much as i can expect, though attributes is safer i assume?

hoary scarab
#

Another reason I get annoyed by java...

ConsoleOutput.debug("Location: "+(minion.getLinkedChest("Link_Chest") != null ? minion.getLinkedChest("Link_Chest").toString() : "null")+
            " Current: "+b.getLocation().toString()+" Match: "+
            Boolean.valueOf(minion.getLinkedChest("Link_Chest") != null && minion.getLinkedChest("Link_Chest") == b.getLocation()));

Location: Location{world=CraftWorld{name=world},x=8.0,y=99.0,z=71.0,pitch=0.0,yaw=0.0}
Current: Location{world=CraftWorld{name=world},x=8.0,y=99.0,z=71.0,pitch=0.0,yaw=0.0}
Match: false

(Forgot I need to use .equals() But still annoys me lol)
winged pebble
#

That's a lot of method calls for something that should really just be called once and cached

dusty frost
#

eh, it probably gets inlined

winged pebble
#

I'm a readability snob

#

🙂

hoary scarab
#

Its also just debug lol

dusty frost
#

yeah just to help Yapper remember that Java has referential equality lol

hoary scarab
dusty frost
#

every object 😌

spiral prairie
#

How do I get the direction a player is facing? North, East, South or West

past ibex
#

if player.getYaw() > -45 && player.getYaw < 45 return WHATEVER DIRECTION THIS IS

spiral prairie
#

right

dusty frost
#

don't forget you also might have to add or remove multiple increments of 360 degrees

#

player Yaw is not bound between 0 and 360 lol

past ibex
#

technically, the server does bind it between -360 and 360

#

as it crashes if you get the yaw too high

spiral prairie
dusty frost
#

nope lol

#

apparently it's -360 and 360 lol

#
public static String getCardinalDirection(Player player) {
        double rotation = (player.getLocation().getYaw() - 180) % 360;
        if (rotation < 0) {
            rotation += 360.0;
        }
        if (0 <= rotation && rotation < 22.5) {
            return "N";
        } else if (22.5 <= rotation && rotation < 67.5) {
            return "NE";
        } else if (67.5 <= rotation && rotation < 112.5) {
            return "E";
        } else if (112.5 <= rotation && rotation < 157.5) {
            return "SE";
        } else if (157.5 <= rotation && rotation < 202.5) {
            return "S";
        } else if (202.5 <= rotation && rotation < 247.5) {
            return "SW";
        } else if (247.5 <= rotation && rotation < 292.5) {
            return "W";
        } else if (292.5 <= rotation && rotation < 337.5) {
            return "NW";
        } else if (337.5 <= rotation && rotation < 360.0) {
            return "N";
        } else {
            return null;
        }
    }```
#

oh no it's actually just not bounded

past ibex
#

plugins can set the yaw to anything

dusty frost
#

Spigot api 😌

grim oasis
#

lmao I just tested and it's -180 to 180 in 1.18.1 at least

#

so weird I came over here and the same thing is going on

#

actually trippy

pulsar ferry
#

It's normally between -180 and 180 but it can be more cuz bukkit

spiral prairie
pulsar ferry
#

If you want a simpler version

private static final List<BlockFace> DIRECTIONS = Arrays.asList(
        BlockFace.NORTH,
        BlockFace.NORTH_EAST,
        BlockFace.EAST,
        BlockFace.SOUTH_EAST,
        BlockFace.SOUTH,
        BlockFace.SOUTH_WEST,
        BlockFace.WEST,
        BlockFace.NORTH_WEST
);

public static BlockFace getCardinalDirection(final Location location) {
    return DIRECTIONS.get(Math.round(location.getYaw() / 45f) & 0x7);
}
pulsar ferry
#

Ma'am we do things in a complicated way here okay

#

I guess spigot also has it, smh

lyric gyro
#

since 1.13 yes

spiral prairie
lyric gyro
#

huh?

pulsar ferry
#

Yeah this is all the method returns

spiral prairie
pulsar ferry
#

Looking up or looking down

lyric gyro
#

Though getFacing will never return UP/DOWN/SELF tho but yeah they exist

spiral prairie
#

Hm?

#

Yes i do

grim oasis
#

I just did this

spiral prairie
#

Currently messing around eith that

grim oasis
#
    if (yaw > -45 && yaw <= 45) {
        //positive z
    } else if (yaw > 45 && yaw <= 135) {
       //negative x
    } else if (yaw > 135 || yaw <= -135) {
       //negative z
    } else if (yaw > -135 && yaw <= -45) {
       //positive x
    }
grim oasis
spiral prairie
#

Almost

grim oasis
#

lmao

#

i mean, it makes sense

spiral prairie
#

The 3rd if is the else

junior shard
#

https://pastebin.com/w950Sk51

Im stuck trying to figure out why when a player who tries to appoint another player to someone they have permission to it is sending them the error that they cant appoint any ranks, but their appoint list shows all of those ranks that they should be able to appoint others to

#

but it only does it for all of the groups besides the first one defined in the config

#

If I am op, it obviously works. But when I'm not op and I have the permission for cityrp.appoint.secofstate, it tells me there are no ranks I can appoint.

#

Config

Groups: # // DON'T CHANGE THIS! \\
  President:
    permission: "cityrp.appoint.president"
    track: "executive"
    groupNames:
      - 'speakerofthehouse'
      - 'secofstate'
      - 'secofdefense'
      - 'secofjustice'
  SecOfState:
    permission: "cityrp.appoint.secofstate"
    track: ""
    groupNames:
      - 'firechief'
      - 'fireasstchief'
      - 'firecaptain'
grim oasis
#

it's doing that on the president permission

#

if you sent the message of what the permission was, you'd see

#

instead of return and send error message, try continue

#

continue will skip the rest of the code in the for loop, right to the next item in the iterator (if any)

junior shard
graceful juniper
#

continue pog

pseudo yacht
#

To connect a plugin with another one do I just need to add the jar of that plugin to the libraries?

spiral prairie
lyric gyro
#

You probably need to do the shifting

#

Idk what EntityData is tho

#

Or if it does it for you

spiral prairie
lyric gyro
#

Yea that’s wrong

#

Maybe it’s not go look at src probably

sterile hinge
#

0 is the identity element for bitwise or

spiral prairie
sterile hinge
spiral prairie
#

yea

#

idke what to change there

lyric gyro
sterile hinge
spiral prairie
#

kekw i should try to do that too, but i failed already

spiral prairie
#

why is this so hard

lyric gyro
#

I mean (0.toByte or 0x20) should work

#

Don’t armour stands already have methods to handle meta for you?

icy shadow
#

😌

dense drift
spiral prairie
#

yes

#

packets

#

using packetevents 2.0

lyric gyro
#

Ah I see

spiral prairie
#

no one responding in their discord so i thought id ask there

lyric gyro
#

Wont the servers Meta data just overwrite what you’re sending to the client anyways?

spiral prairie
#

why would the server overwrite anything that doesnt exist on the servers end?

#

i jsut need to know how to do that bitmask shit lol

lyric gyro
#

setflag in client

#

Eh that’s different

spiral prairie
#

what is a datawatcher?

lyric gyro
#

That’s for flags actually

#

My b

spiral prairie
#

anyone? please?

junior shard
#

but would that not spam the error message for every group they dont have perms for?

forest jay
#

does Bukkit.getOfflinePlayers() also return online players? I would think not, but I need to get all players, including online and offline. Would I have to add them together with the Bukkit.getOnlinePlayers() and Bukkit.getOfflinePlayers()?

lyric gyro
#

yes

forest jay
#

yes to which one

lyric gyro
#

yes to the first question

forest jay
#

alright

#

thanks!

lyric gyro
#

there's no point in answering the other one

forest jay
#

What does Bukkit.getOnlinePlayer() return when it cant find anything? It has the annotation @NotNull

lyric gyro
#

which one exactly?

#

ah you mean getOnlinePlayers?

forest jay
#

no

#

Bukkit.getOfflinePlayer(UUID uuid)

lyric gyro
#

..

forest jay
#

I meant offline player

#

sorry

lyric gyro
#

it will create an "empty" OfflinePlayer object for that UUID with no name

forest jay
#

ah

#

so

#

to check for that

#

should I do if (offlinePlayer.getName() == null/"")?

lyric gyro
#

you could check for a null name yeah, I'm not sure if there are any "saner" options tbh

forest jay
#

alright

#

thanks

dusky harness
#

i think u can also check if it's online, and if it isn't, check if it played before

#

although getName check is simpler

lyric gyro
#

oh yeah there's getPlayedBefore or something like that

#

or hasPlayerBefore

dusky harness
#

although iirc it returns false if it's the player's first time

proud pebble
#

unless it returns an empty player

lyric gyro
#

getOfflinePlayer will never return null

proud pebble
#

yeah ive just seen, it returns an object even if it doesnt exist

lyric gyro
#

I was gonna say "it's annotated with notnull" but then I remembered spigot annotates a lot of shit with notnull yet it can return null

winged pebble
#

getName() can return null though

lyric gyro
#

getName totally can?

#

it's annotated with nullable OMEGAWHEELCHAIR

#

ah I read that as "can't" mb

hushed badge
#

:OMEGAWHEELCHAIR:

proud pebble
#

bruh

winged pebble
#

lol

lyric gyro
hushed badge
proud pebble
#

thats kinda scuffed, cant even omegawheelchair

#

i call admin aboos

lyric gyro
proud pebble
#

🍞

junior shard
#
        if (args[0].equalsIgnoreCase("request")) {
            if (args.length >= 3) {
                for (String key : CityRpAppoint.aPlugin().getConfig().getConfigurationSection("Groups").getKeys(false)) {
                    ConfigurationSection configSection = CityRpAppoint.aPlugin().getConfig().getConfigurationSection("Groups." + key);
                    String permission = CityRpAppoint.aPlugin().getConfig().getConfigurationSection("Groups." + key).getString(".permission");
                    List<String> list = CityRpAppoint.aPlugin().getConfig().getConfigurationSection("Groups." + key).getStringList(".groupNames");

                    Player target = (Player) Bukkit.getPlayer(args[1]);
                    String targetRank = args[2];


                    if (!sender.hasPermission(permission)) {
                        sender.sendMessage(ChatColor.translateAlternateColorCodes('&', prefix + " &7There are no ranks you can appoint!"));
                        continue;
                    }
#

CJ told me to make use of continue. This does work, however it sends the error message even though it is still requesting to appoint a player

spiral prairie
junior shard
#

Here I will get a paste of the entire command code

spiral prairie
#

thanks

spiral prairie
#

so if there are 2 groups

#

and the player has the permission for one of them

#

but not the other

junior shard
#

So should I just simply remove the error message

#

since players shouldn't have the permission to use /appoint anyways if there are no ranks they can appoint

spiral prairie
#

probably

junior shard
#

yeah that'd make sense

#

Yep that works lol

#

I was just overthinking

spiral prairie
#

👍

forest jay
#

I am designing a plugin that involves mongodb, and I am expecting large quantities of players. What is the most efficient way of making DB calls? I am caching everything, and should I make it all at once every 5-10 minutes update everything using async. Or do I make it more spread out?

dusty frost
#

Just send off async db updates whenever they happen

#

The cache is the source of truth while the server is running, so just have it update the DB as it needs, doesn't matter if it takes a few seconds or whatever

forest jay
#

alright

#

thanks

grim oasis
#

idk if you fixed it yet, just saw the ping 🤷‍♂️

junior shard
#

Yes I did

#

honestly looked past it ngl

#

ty tho

#

<3 u cj

formal crane
#

How would i get the port of a domain in php?

rn i have gethostbyname('play.hypixel.net'); but that only returns the ip adress without the port but i need the port aswel

dusty frost
#

I have no idea about PHP, but that works with an SRV record in DNS, so maybe you can query the DNS?

dense drift
#

any idea why the text looks like shit? 😅

queen plank
#

Why is this Deprecated cannot be resolved to a type? I'm trying to deprecate a function. I get no suggestion to import it or anything, it works nowhere in my project? I guess I'm just dumb, but I can't get it to work lmao

dense drift
#

it is @Deprecated

#
/**
 *@deprecated Use {@code #newTestMethod)}
 */
@Deprecated
public void test() { }```
edgy wedge
dense drift
#

nah I just installed the scene builder kit

edgy wedge
dense drift
#

1920x1080

edgy wedge
#

Odd. I've used scene builder before but never had that problem

cinder forum
#

hi, what is first event you can cancel to close player connection?

dense drift
#

probably quitevent

cinder forum
#

I mean event when is player connecting

dense drift
#

bruh, what did I read

#

PreLoginEvent or something like that

edgy wedge
#

I'd kick them though instead of cancelling as you can customize the kick message however you'd like

lyric gyro
#

You can also do that in the prelogin event tho

cinder forum
#

oke thx

edgy wedge
wintry grove
lyric gyro
#

Cancel and set the kick message/reason etc

dense drift
#

^

wintry grove
#

^^

lyric gyro
#

APPLE, AsyncPlayerPreLoginEvent

wintry grove
#

that

#

that one

cinder forum
#

🍎

edgy wedge
#

Ah, I guess I learned something today :)

queen plank
# dense drift it is `@Deprecated`
@Deprecated
public static HelixEntity wrap(LivingEntity entity) {
    return new HelixEntity(entity);
}```This is my code. It looks like it works, the function goes grey and has is strikethrough (deprecated functions look like that for me). But I still get `Deprecated cannot be resolved to a type` and it says there is an error?
dense drift
#

hmm, weird

queen plank
#

Yeah, that is why I am so confused. Is there an import I need?

wintry grove
#

sooo I get god damn [09:18:06 ERROR]: Could not pass event PlayerInteractEvent to You Dont Really Care-1.0.0 when I try to use an PLayerInteractEvent getting the item the player used but I dont have any, if(event.getPlayer().getInventory().getItemInMainHand() == null) return; or it on the actual if doesnt work, why

#

tl;dr; if I dont use item in the interact server goes crazy

lyric gyro
#

can't help with what we can't see

wintry grove
#

^^ this is the PlayerInteractEvent

#

when the player right clicks on air or a block it throws the error

#

says its on the if

lyric gyro
#

and what's the full stacktrace?

wintry grove
#

a sec

lyric gyro
#

yeah well

the return value of "org.bukkit.event.player.PlayerInteractEvent.getItem()" is null
and you're checking for the PlayerInventory.getItemInMainHand which...

#

check what for the actual methods you're using

wintry grove
#

Object.requreNonNull would work right?

#

for the if

#

and wait

#

I'm stupid

#

yeah for the check I did it wrong

lyric gyro
#

yeah

wintry grove
#

it works now

#

ty

queen plank
#

Is there a way to get the value of an NBT tag without specifying the PersitentDataType? I want to read a tag and return the value as a string, aka the type does not matter as I will run the tag value through String#valueOf.

high edge
#

Just retrieve it as string then?

queen plank
#

Can you retrieve it as a string if it is stored as something else, like a float or double? This is from the java docs of PersistentDataType Type Parameters:<T> the primary object type that is stored in the given tag<Z> the retrieved object type when applying this tag type, which is what the PersistentDataType when using NBT tags is specifying (in my head).

trail burrow
#

mariadb or oracle jdbc which is better in a plugin?

little surge
# trail burrow mariadb or oracle jdbc which is better in a plugin?

https://www.geeksforgeeks.org/difference-between-oracle-and-mariadb/ although typically mysql based databases are used in plugins as most hosts provide this. But why not allow both!

trail burrow
#

thanks

dusty frost
#

jesus don't use Oracle please

#

licensing fees and bad design decisions alone, there's a reason why every plugin uses MariaDB/MySQL

edgy lintel
#

in entitybreedevent is the breeder the player who helps the animals breed?

hollow arch
#

Is there some kind of Boolean type placeholder so that people can show certain colors if the placeholder is true/false ?

junior shard
#

UserDataHandler.java: https://pastebin.com/P1pWt8Wc
PlayerJoinListener.java: https://pastebin.com/0HYYeu5S
This is in my onEnable():```java
getServer().getPluginManager().registerEvents(new PlayerJoinListener(), this);


Why isn't it creating the file for the player when they are joining the server? (`<uuid>.yml`)
#

It isn't even broadcasting the message defined in the PlayerJoinEvent. Not sure what i've been doing wrong.

#

I assume the problem is in the listener or in the on enable where in initializing the listener, but I can’t seem to figure this out

edgy lintel
#

also when you do constructor of the user data handler,
you want to check if the file exists before loading the configurations in

#
            pDataConfig.addDefault("Bounty", 0);
            pDataConfig.load(pDataF); XXX
          -->pDataConfig.save(pDataF);

you should be saving instead.

edgy lintel
junior shard
#
public void createPlayerConfig() {

        pDataF = new File(p.getDataFolder(), uuid+".yml");

        if (!pDataF.exists()) {
            try {
                pDataF.getParentFile().mkdirs();
                pDataF.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        pDataConfig = new YamlConfiguration();
        try {
            pDataConfig.addDefault("Bounty", 0);
            pDataConfig.save(pDataF);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }```
#

Still not creating the file

#

@edgy lintel

molten wagon
dense drift
#

java.lang.NullPointerException: Cannot invoke "String.startsWith(String)" because the return value of "org.bukkit.command.Command.getLabel()" is null

molten wagon