#help-development

1 messages Β· Page 163 of 1

fluid river
#

i'm not sure what you can do with advancement

#

use packets if that's the only solution

#

basically google achievement packet

#

for your version

orchid portal
#

hello again, another problem appeared, how to work with NBT tags?

hollow pelican
#

Does anyone know how to fix this error?
java.lang.NullPointerException: Cannot invoke "me.GROUP_ID.plugin_name.PLUGIN_NAME.getDatabase()" because the return value of "me.GROUP_ID.plugin_name.PLUGIN_NAME.getPlugin()" is null

hollow pelican
#

(NMS is short for net.minecraft.server btw)

#

There's some good tutorials online for figuring out how to use NMS with the right obfuscation mappings.

orchid portal
fluid river
#

what mc version

orchid portal
orchid portal
fluid river
#

why not pdc

#

lol

hollow pelican
#

PersistentDataContainer (pdc) is plugin related.

fluid river
#

he needs a tag on entity

hollow pelican
#

If they want to interact with vanilla NBT data, they'll most likely need NMS.

fluid river
#

this can mean literally any tag

mellow pebble
#

that is what i am thinking too

hollow pelican
#

They might want to do what I did with interacting with vanilla tags so that it's easier to work with in-game using commands.

fluid river
#

i used to work with old NBT tags on items

#

but never used it since

#

also with old playerdata in world folder

hollow pelican
#

PDC is more towards custom plugin NBT-style tags.

#

The way I interact with vanilla NBT tags is through NMS.

orchid portal
#

I need to change the villager's profession and biome

fluid river
hollow pelican
#

NMS is probably your best bet.

#

idk though but that's what I'd do personally.

#

Just get the CompoundTag/NBTTagCompound and get the profession and biome tags and then set the values using code.

fluid river
#

you can literally spawn own villager with what you need on old villager location

orchid portal
fluid river
#

and remove old villager

#

Villager v = (Villager) entity;

#

v.set

#

smth like this

hollow pelican
#

Example from my own code:

fluid river
#

type is biome

orchid portal
fluid river
#

or change profession of existing villager

hollow pelican
#

That works too.

orchid portal
#

ok thanks i will try

eternal night
#

I mean, general rule of thumb is "Is it a minecraft nbt tag? Try to use the API. Is it not, just custom data? Use PDC"

#

obvs exceptions exist as they do anywhere

hollow pelican
#

πŸ‘

sterile token
#

about what?

remote swallow
#

the folders being combined

sterile token
#

oh

#

its called herintechcal represention

#

or something like that

echo basalt
#

ok I'm back home time to debug shitty code

tardy delta
#

try to check and uncheck these things

#

flatten packages ig

echo basalt
#

it only does it for nested folders within your java package, yes

tardy delta
#

check flatten packages and uncheck compact middle ones

sterile token
#

your welcome

tardy delta
sterile token
#

just use catch (exceptions ex) {}

tardy delta
#

im talking about catching outofmemory errors

sterile token
#

I mean you have the same message that why

vocal cloud
#

Da heck is wrong with your JSON that you get a stack overflow

#

Nevermind an OOM

tardy delta
#

once had a stackoverflow cuz my typeadapter sucked

#

and it was doing some circular stuff idk why

vocal cloud
#

?jd-s

undone axleBOT
vocal cloud
tardy delta
#

anyways can a stackoverflow lead to an oom?

#

stackframes mem cannot occupy all of the jvm mem right?

vocal cloud
#

Maybe? Idk I'd fix the reason, not catching it to "fix" it

tardy delta
#

ye lol

hollow pelican
#

I'm trying to get an SQLite table with my UUID but it keeps trying to search with just the first part of my UUID.

vocal cloud
#

What

twin venture
#

Hello , so i have this method when player die , spawn him , set health , etc , but there is a bug with the firetick

tardy delta
#

sqlite doesnt support uuid, so i guess youre using a blob?

hollow pelican
#

I'm using a string value

twin venture
#

i tried it and nothing happens , i killed the player with a fire aspect sword , and fire still there after he respawned .

tardy delta
#

dont save an uuid as string to a db

vocal cloud
#

Isn't that a visual bug on the client?

hollow pelican
#

But it's only searching with the first part of that string

sterile token
#

?not working

vocal cloud
#

Are you making a table per player?

hollow pelican
#

The table contains specific info such as ban information

#

And the primary key is meant to be the player's UUID as a string. (Key type is varchar(36) )

tardy delta
#

as i said dont use a varchar

hollow pelican
#

Is there any specific reason not to?

#

I also looked into using a char

tardy delta
#

is your uuid a primary key?

hollow pelican
#

Yes.

tardy delta
#

you shouldnt rely on strings as a pk

#

its just bad..

vocal cloud
#

Always use int

#

Like always

hollow pelican
#

I've barely even touched SQLite/SQL.

#

I'm quite new to it.

vocal cloud
#

That's okay. You're learning

hollow pelican
#

πŸ™‚

echo basalt
#

yo Fourteen

#

I managed to fix the issue

vocal cloud
#

Anyways seeing the code/SQL code would help

hollow pelican
#

Is there a way to convert a UUID into a long or an int?

sterile token
#

Oh nooo for me sql is hsit

#

I dont like losting time doing relations neither joinings

#

πŸ˜‚

tardy delta
echo basalt
#

class com.google.gson.internal.LinkedTreeMap cannot be cast to class me.illusion.university.module.impl.school.data.data.MemberData

thanks gson

echo basalt
#

I like how I have nested data packages

tardy delta
#

gson usually gives me errors in the way of that it doesnt know what to do with certain types

#

stopped using gson lol

echo basalt
#

I mean

#

gson is useful because I really don't want to make my own impl to store stuff into mongo

#

so I just let gson do its thing

tardy delta
#

i needed three typeadapters to seriliaze my player wrapper πŸ’€

echo basalt
#

but deserializing with gson is... odd..

tardy delta
#

mye

echo basalt
#

Because I also don't know my own structure

hollow pelican
#

The problem I have is that it's searching with the first part of the UUID string and nothing else.

echo basalt
#

but yeah

#

I had to use thenCompose instead of thenRun(join())

tardy delta
#

dunno what thenCompose does

echo basalt
#

it allows easy future nesting

tardy delta
#

hmm

echo basalt
#

So like

knotty gale
#

how do I set a permisson on luck perms

echo basalt
#
future1.thenCompose(returnedValue -> somethingThatReturnsAnotherFuture(returnedValue)).thenApply((secondValue) -> {
  ...
});
knotty gale
#

like /lp group (group) permssion set?

echo basalt
hollow pelican
#

It's meant to take the UUID in as a string and it should work but it's not, it's just searching with the first part.

#

[INFO]: getPlayerDataByUUID: uuid string: 846e2b9e-46d9-4c90-b78f-a85038c779df

#

[ERROR]: Failed to get player data by UUID: [SQLITE_ERROR] SQL error or missing database (unrecognized token: "*846e2b9e*")

vocal cloud
#

Mmmm non sanitized db queries

#

Use a prepared statement

hollow pelican
#

And I don't know how that's meant to fix my issue.

sterile token
hollow pelican
#

How does that fix my problem?

#

That's what I'm confused about.

sterile token
vocal cloud
#

Because if it's not working as intended and it's only searching with a part of it you can assume you're quite literally injecting wrong code

#

Oh

#

You're not wrapping the UUID in quotes

hollow pelican
#

Ahh

vocal cloud
#

That's why

solid cargo
#

is there a method that tells your exception in a nutshell not blast out a 100 line message about that the 1953th line at String.java is at a small fault?

tardy delta
#

just use a byte array instead of uuid

vocal cloud
#

It's unrecognized token meaning that you're attempting to use the UUID as a variable

tender anvil
#

fore some reason when i mention "craftPlayer.handle" it gives me an error. i'm literally checking if it's not null and it's giving me an error when i run it.

hollow pelican
#

ty

#

I'll try to use a prepared statement later on too.

#

Yeah, that's fixed it.

#

Thanks @vocal cloud and @tardy delta. πŸ™‚

sterile token
# hollow pelican
UUID uuid;
PreparedStatatement statement = getConnection().getPreparedStatement();
statement.setString(0, uuid.toString());
ResultSet result = statement.executeQuery("SELECT * FROM playerData WHERE uuid=?");
tardy delta
#

nobody listening to me.. anyways

sterile token
sterile token
#

Just a simple google research

#

I've taken more time copying pasting the code that looking for the solution

#

πŸ˜‚ πŸ˜‚ πŸ˜‚ πŸ˜‚

hollow pelican
tardy delta
#

i sent you a github link above ^^

#

instead of setString just call setBytes with the return value of that method

hollow pelican
sterile token
hollow pelican
sterile token
hollow pelican
#

I just used statement by default, Definitely switching to PreparedStatement later.

sterile token
#

Because its the worst thing you can do

hollow pelican
#

I've never had a reason to look into byte arrays in general.

#

Definitely going to look at it in the future though.

sterile token
#

Oh no

#

Just figured learnt java before coding

#

That is not how the things works

#

But i dont care do what your a** signs

#

what more i can say - hahahahaah

hollow pelican
#

I'm kind of learning as I go atm

sterile token
#

that why

#

First learn the vanilla lang

#

Then touch libraries

#

what?

#

Oh ok i catch it

#

why?

eternal oxide
#

stringify it

sterile token
#

oh yeah you cannot save values which includes the .

#

because its only mean for path/s

vocal cloud
#

What's the point of this?

sterile token
#

oh no

#

You can

vocal cloud
sterile token
#

Sfraino why are you over complicating your self

#

Users:
uuid-1:
alts: ["184.181.14.1", "182.15.155.1"]

List<String> address = getConfig().getStringList("Users.<uuid>.alts");
vocal cloud
#

Just use an anti VPN tool

#

Lots of plugins that do that

echo basalt
#

just make government-issued ID verification

hollow pelican
#

lol

vocal cloud
#

Plus people's IPs change

sterile token
#

LOOK what i writen

#

Bruh

vocal cloud
#

But why? If it changes then you ban them?

sterile token
#

LMFAO i have spoofed full code

vocal cloud
#

Why would you need to save it since IPs can change?

echo basalt
#

grr I'm struggling with gson

sterile token
vocal cloud
#

I just don't think what you're doing is a solution to the problem

remote swallow
#

minimessages?

tardy delta
remote swallow
#

i thought spigot or bungee chat color implemented a way to send hex codes

eternal night
#

you just colour the component ?

tardy delta
#

Chatcolor.of hex

eternal night
#
Component.text("This is in like a lime green", TextColor.color(32, 221, 65));
chrome beacon
#

or just use MiniMessage

eternal night
#

or that

#

Β―_(ツ)_/Β―

#

but like, you'd have to shade that on spigot

chrome beacon
#

You can use the Library loader feature

#

I think?

eternal night
#

on spigot you need to use the platform

chrome beacon
eternal night
#

πŸ₯·

remote swallow
#

Anyone know if theres a way for me to change the default group name on luckperms, while it still being the default group

chrome beacon
#

For this reason, we made it so that the default group is not configurable. It makes things much easier for everyone, honestly! However, we understand this can sometimes be annoying to work with.

You can however change the display name:
/lp group default setdisplayname <name>
Source:
https://luckperms.net/wiki/Default-Groups

#

Yeah

remote swallow
sterile token
chrome beacon
sterile token
chrome beacon
#

You did

sterile token
#

where

sterile token
#

I cannot see the "@oliv"

#

πŸ€”

#

oh

#

that why

#

that is really annoying to disable on each replying

#

its not possible to disable it globally? so i dont need to disavle it everytime

#

sit discord

#

sometimes discord sucks a lot

young knoll
#

You don’t need components just for hex

remote swallow
eternal night
#

yes

remote swallow
#

Theirs no point if you just need it for hex

eternal night
#

^

sterile token
#

discord text component sucks a lot too

eternal night
#

it is a lot of baggage for just hex

#

its pretty damn nice if you develop against paper-api only

#

but a lot of peeps cannot afford that

sterile token
eternal night
#

people

earnest lark
#

I want to make a creeper spawn on a player and have it be charged as a command but i dont know how to get the creeper as a entity any help
Creeper creeper = (Creeper) EntityType.CREEPER;

eternal night
#

πŸ‘€

#

World#spawn

tender anvil
#

for some reason when i call getHandle() from a craft player it gives me a null error (it also gie my friend one so i think it's a problem with nms or craftbukkit)

eternal night
#

grab the world from the player using player.getWorld

#

and then on the world you can call player.getWorld().spawn(player.getLocation(), Creeper.class)

#

to spawn a creeper

#

the method returns you the creeper

earnest lark
#

yea but i want to spawn the creeper charged

eternal night
#

you can set the creeper to charged

#

^

earnest lark
#

yea i know that

eternal night
#

so what is the issue

earnest lark
#

i think im missing something

#

wa going to use that as well

eternal night
#

player.getWorld().spawn(player.getLocation(), Creeper.class) returns you a creeper

#

so store it in a variable

#

and then call the setPowered method on it

earnest lark
#

iaght

#

got it to work like this Creeper creeper = (Creeper) player.getWorld().spawn(locationp,Creeper.class);

eternal night
#

you don't need to cast it ^

#

but yea

earnest lark
#

ok i really did not understand

eternal night
#

you only need to cast when you use the EntityType

earnest lark
#

oh so i dont need the (Creeper) part

eternal night
#

not if you use the Creeper.class

#

EntityType.CREEPER, you would have

earnest lark
#

iaght

#

gocha

tender anvil
#

does getHandle() work?

#

because for some reason it gives me and my friend an error

earnest lark
#

wait i need the creeper variable to be Entity type

#

im using world.SpawnEntity()

#

nvm

#

didnt see the boolean at the end

sterile token
tender anvil
earnest lark
#

w.spawnEntity(locationp,creeper,false);when i do this it gives me a error 'spawnEntity(org.bukkit.Location, org.bukkit.entity.EntityType, boolean)' in 'org.bukkit.RegionAccessor' cannot be applied to '(org.bukkit.Location, org.bukkit.entity.Creeper, boolean)'

#

                Creeper creeper = player.getWorld().spawn(locationp,Creeper.class);
                creeper.setPowered(true);
                creeper.setFuseTicks(0);
                creeper.setExplosionRadius(25);

                locationp.add(0,5,0);

                w.spawnEntity(locationp,creeper,false);

            }

        return true;
    }

}```
#

what? im not

#

ohhhhhhh

#
                
                Creeper creeper = w.spawn(locationp,Creeper.class);
                creeper.setPowered(true);
                creeper.setFuseTicks(0);
                creeper.setExplosionRadius(25);```
#

this would work tho

#

iaght

#

another problem i have is

#

im trying to make a custom enchantment and

#

public static final CustomEnchantment BOW = new bowEnchant();

#

this no work because

#

'bowEnchant(org.bukkit.NamespacedKey)' in 'me.adeptvail.idrk.bowEnchant' cannot be applied to '()'

#

import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.enchantments.EnchantmentTarget;
import org.bukkit.inventory.ItemStack;

public class bowEnchant extends CustomEnchantment {

    public bowEnchant(NamespacedKey key) {
        super(key);
    }

    @Override
    public String getName() {
        return "Bow";
    }

    @Override
    public int getMaxLevel() {
        return 1;
    }

    @Override
    public int getStartLevel() {
        return 1;
    }

    @Override
    public EnchantmentTarget getItemTarget() {
        return EnchantmentTarget.BOW;
    }

    @Override
    public boolean isTreasure() {
        return false;
    }

    @Override
    public boolean isCursed() {
        return false;
    }

    @Override
    public boolean conflictsWith(Enchantment other) {
        return false;
    }

    @Override
    public boolean canEnchantItem(ItemStack item) {
        return item.getType().equals(Material.BOW);
    }
}
#

import org.bukkit.NamespacedKey;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.enchantments.EnchantmentTarget;
import org.bukkit.inventory.ItemStack;

public class CustomEnchantment extends Enchantment {


    public CustomEnchantment(NamespacedKey key) {
        super(key);
    }

    @Override
    public String getName() {
        return null;
    }

    @Override
    public int getMaxLevel() {
        return 0;
    }

    @Override
    public int getStartLevel() {
        return 0;
    }

    @Override
    public EnchantmentTarget getItemTarget() {
        return null;
    }

    @Override
    public boolean isTreasure() {
        return false;
    }

    @Override
    public boolean isCursed() {
        return false;
    }

    @Override
    public boolean conflictsWith(Enchantment other) {
        return false;
    }

    @Override
    public boolean canEnchantItem(ItemStack item) {
        return false;
    }


}
vocal cloud
#

😭 use a pastebin for code

earnest lark
#

srry

#

what the command for it again

vocal cloud
#

?paste

earnest lark
#

haven't been on this server in ages

undone axleBOT
earnest lark
#

do i just make a variable in the class for a key

crisp forum
#

I'm doing a plugin that is a little bit like SilkSpawners, if someone breaks a spawner with some special item it should give the spawner to the player but when I give event.getBlock().getType() it gives normal spawner (Pig) what can I do to give the exact type of spawner

quaint mantle
#

how would i fix this?

#

com.mongodb.MongoWriteException: Write operation error on server ac-itkzscn-shard-00-02.gdgktnz.mongodb.net:27017. Write error: WriteError{code=66, message='After applying the update, the (immutable) field '_id' was found to have been altered to _id: ObjectId('6337dc3a6671b225ff494f59')', details={}}.

#

was working earlier

vocal cloud
#

Well, without code we can't really help.

echo basalt
#

you made a document value with the name of _id

#

just don't

quaint mantle
#
                var document = collection.find(new Document(plr.getUniqueId().toString(), plr.getName())).first();
                if (document == null) return;
                if (map == null) return;
                for (Map.Entry<String, Object> entry : map.entrySet()) {
                    var key = entry.getKey();
                    var value = entry.getValue();
                    document.put(key, value);
                }

                collection.replaceOne(Filters.empty(), document);```
quaint mantle
reef acorn
#

Hello, I have a question: Do I always have to rebuild the project before packaging for the api to work?

remote swallow
#

Is PlayerAdvancementDoneEvent the only advancement related event?

reef acorn
quaint mantle
#

Shift + F10

#

sorry

tranquil dome
#

Does a server have a total tick count (like system millis)? I want to store that to a hashmap and later check if the time difference is more than a certain amount of ticks.

#

I don't really want to use millis, because tps can fluctuate

quaint mantle
reef acorn
untold jewel
#

So I have a config with 12 different locations saved. How would I teleport 1 player to every location?

tranquil dome
#

I know, but I need to do something if something happens exactly one tick after the other

undone axleBOT
torn oyster
tranquil dome
#

How much would this impact performance if I am creating a new scheduler frequently

#

I would prefer to just have a method like getCurrentTickCount() or something along the lines of that

quaint mantle
#

only if the runnable is running something intensive

tranquil dome
#

It will be adding/removing a key from a hashmap

quaint mantle
#

should be fine

tranquil dome
#

Should I define the scheduler outside of my event handler?

#

or inside the event

quaint mantle
#

no

#

inside

reef acorn
cedar turtle
chrome beacon
#

?services

undone axleBOT
eternal night
#

wtf is that

quaint mantle
#

how do i get a blockvector3

#

stupid api

#

i can get blockvector

#

not blockvector3

eternal night
quaint mantle
#

idfk

#

these apis are gay

eternal night
#

a) what is a blockvector3

ivory sleet
eternal night
#

b) why homophobic insults

quaint mantle
#

sorry

eternal night
#

c) best conclure

tranquil dome
#

Not really spigot related but I pulled my code from github and in the gitignore I added my target folder. Now I can't compile with maven because of this:
java.io.FileNotFoundException: C:\Users\wdrot\IdeaProjects\PvPMechanics\target\classes (Access is denied)
What should I do?

chrome beacon
#

Run it again

quaint mantle
tranquil dome
#

I ran mvn install multiple times

quaint mantle
#
Location location = new Location(clicked.getWorld(), new BlockVector(), 0, 0);```
#

i need a blockvector3

eternal night
#

a location does not take a block vector πŸ€”

quaint mantle
#

because bad

eternal night
#

yes then you need to convert it to the plot squared one

#

usually through the adapter

quaint mantle
#

i am

eternal night
torn oyster
quaint mantle
#

:/

eternal night
#

exclude that I guess ?

quaint mantle
#

i need it :/

#

i need BukkitUtils

#

i truly hate IntellectualSites' apis

eternal night
#

you did not specify the version btw

quaint mantle
#

i just copied it πŸ€·β€β™‚οΈ

eternal night
#

I'd highly suggest doing that

#

did you add the bom

#

in dependency management

quaint mantle
#

no?

eternal night
#

you need to

#

that is where your versions come from

quaint mantle
#

oh

#

yes i did

#

sorry im blind

eternal night
#

you also added all the repos ye ?

quaint mantle
#

i did all this

quaint mantle
eternal night
#

Welp I guess, add their repo too ?

quaint mantle
#

the core works, but the bukkit doesn't

earnest lark
#

in one class i have a namespacedkey and when it asksfor it in another class i do not know what to put for it

eternal night
#

like the engine hub repo

quaint mantle
torn oyster
eternal night
#
<repository>
        <id>enginehub-repo</id>
        <url>https://maven.enginehub.org/repo/</url>
    </repository>
#

das the repo

quaint mantle
#

ty

#

that worked

#

thanks

eternal night
#

sweet

eternal night
tranquil dome
eternal night
#

you need to use dependency injection to pass your namespaced keys around

#

?di

undone axleBOT
chrome beacon
torn oyster
#

well how?

earnest lark
eternal night
#

hence why I linked you the docs

#

?di

undone axleBOT
torn oyster
#

either x or z

#

for whatever reasosn

#

i've found

#

but it prints that it is spawning there

#

and the location that it will spawn at

quaint mantle
#

one more question

#

this time about mongo

#

how would i fix this?

#

com.mongodb.MongoWriteException: Write operation error on server ac-itkzscn-shard-00-02.gdgktnz.mongodb.net:27017. Write error: WriteError{code=66, message='After applying the update, the (immutable) field '_id' was found to have been altered to _id: ObjectId('6337dc3a6671b225ff494f59')', details={}}.

#

im so confused

#

ik the error

#

but how would i fix it

earnest lark
quaint mantle
#

tried append and put

#

and updateOne instead of replaceOne

bitter dust
torn oyster
chrome beacon
#

Start by not abusing streams

#

Stop copy pasting code

#

and structure the code so it's clear what each part is doing

torn oyster
earnest lark
#

                locationp.add(0,5,0);

                Creeper creeper = w.spawn(locationp,Creeper.class);
                creeper.setPowered(true);
                creeper.setFuseTicks(1);
                creeper.setExplosionRadius(25);



            }```
when i use the command i get unexpected error and for some reason it returns null. anyone know why?
chrome beacon
torn oyster
#

.get(int)

#
Arrays.stream(EntityType.values()).anyMatch(m -> m.toString().equalsIgnoreCase(type))```
#

and how else am i meant to do that?

#

arrays.aslist().contains() won't work

#

can't convert a String to EntityType

chrome beacon
#

EntityType.valueOf(String)

torn oyster
#

that doesn't check if it is a thing

chrome beacon
#

...

torn oyster
#

does it not?

chrome beacon
#

That will get the value if it exists

torn oyster
#

yes but

#

Throws:
IllegalArgumentException - if this enum type has no constant with the specified name

chrome beacon
#

Yeah

torn oyster
#

error if it doesn't

#

are you suggesting a try/catch thingy

chrome beacon
#

That would be one way to do it yes

#

Make sure to cache your values somewhere so you don't end up wasting resources checking things over and over again

worldly ingot
#

You could also make use of Guava's Enums class

#

Or, the better option (imo), Registry.ENTITY_TYPE.get(NamespacedKey.fromString("zombie"))

chrome beacon
worldly ingot
#

That way you could do things like minecraft:zombie, or zombie based on in-game ids

torn oyster
chrome beacon
#

You don't need to use a for i loop

torn oyster
#

so they are all equal

#

oh wait

#

yeah

#

i'm stupid

#

wait

#

yes i do

#

lol

#

i don't iterate over them

#

every fori thingy i do selectedspawn++ but if it's over the max i set it back to 0

#

it selects the spawns fine and in order

#

the entities just do not spawn on negative axis

chrome beacon
#

So you're modifying something you cannot

torn oyster
#

it's probably some despawn thing

#

like it's too far

#

even tho it's not

quaint mantle
#
var document = collection.find(new Document(plr.getUniqueId().toString(), plr.getName())).first();
                if (document == null) return;
                if (map == null) return;
                for (Map.Entry<String, Object> entry : map.entrySet()) {
                    var key = entry.getKey();
                    var value = entry.getValue();
                    document.put(key, value);
                }

                collection.replaceOne(Filters.empty(), document);```
#

which should only be the multi

#

i dont have anything in the map

#

except multi atm

chrome beacon
torn oyster
#

i set it super close

#

and it worked

torn oyster
#

but why??

quaint mantle
#

i rlly wanna get this fixed

chrome beacon
torn oyster
quaint mantle
#

i shouldn't be?

#

is it because im replacing it?

chrome beacon
#

Yeah

quaint mantle
#

how would i do update?

#

its all weird

chrome beacon
#

Create a new entry

earnest lark
#

?paste

undone axleBOT
torn oyster
#

how do i increase despawn distance?

quaint mantle
earnest lark
#

thats the error i get

chrome beacon
earnest lark
#
                //locationp.add(0,5,0);
                
                Creeper creeper = w.spawn(locationp,Creeper.class);
                creeper.setPowered(true);
                //creeper.setFuseTicks(1);
                creeper.setExplosionRadius(25);



            }```
chrome beacon
#

That error has nothing to do with the code you sent

earnest lark
#

its set to 1

quaint mantle
#

java.lang.IllegalArgumentException: Invalid BSON field name _id got this now

earnest lark
#

oh

quaint mantle
#

with just updateOne(filter, doc)

chrome beacon
#

It's better to send too much than too little

earnest lark
#

?paste

undone axleBOT
earnest lark
#

thats my command and main class

chrome beacon
#

String t = args[0];

#

There you go

echo basalt
chrome beacon
#

Check if the arg exists before using it

echo basalt
#

only took me like 9 hours

earnest lark
chrome beacon
#

Is this your first Java project?

earnest lark
#

in a bit yes

#

ever not at all

chrome beacon
#

?learnjava You really should go through basics so you know how arrays work

undone axleBOT
quaint mantle
#

Olivo 😒

#

Invalid BSON field name _id how do i fix this :/

chrome beacon
#

What did you do

quaint mantle
#

everything

#

this hurts my brain

chrome beacon
#

I've never used MongoDB

#

How are you trying to get the id

quaint mantle
#

mysql better?

quaint mantle
#

this is everything

#
var map = data.get(plr);
                var collection = CharmGenz.getCollection();
                var document = collection.find(new Document(plr.getUniqueId().toString(), plr.getName())).first();
                if (document == null) return;
                if (map == null) return;
                for (Map.Entry<String, Object> entry : map.entrySet()) {
                    var key = entry.getKey();
                    var value = entry.getValue();
                    document.append(key, value);
                }

                collection.updateOne(Filters.empty(), document);
                if (delete) map.remove(plr);```
chrome beacon
#

What line of code causes your error

echo basalt
#

what does your map look like

quaint mantle
#

im guessing

#

collection.updateOne(Filters.empty(), document);

echo basalt
#

just print stack traces

#

and add souts

quaint mantle
#

this is the json

#

{"_id": {"$oid": "6337dc3a6671b225ff494f59"}, "ed24a190-c1f2-41ab-948d-80a42104914d": "Outspending", "multi": "1"}

#

the id of the document inside of mongo is 6337dc3a6671b225ff494f59

#

which is the same

#

this is after i edit it

chrome beacon
#

So what exactly are you trying to do with your code

earnest lark
#

i got it

#

im just dumb

quaint mantle
#

just update the document

#

so i can retrieve the data later

#

which it was working fine earlier and now it doesn't

chrome beacon
#

We don't really have enough information to help you

quaint mantle
#

all im doing is looping through a map, which contains all the player's variables Map<Player, Map<String, Object>>. Then putting the values into the document then saving them to the database

#

but for some reason its editing the _id too.

#

which it wasn't earlier

earnest lark
#

is there something that immediatly makes a creeper explode on spawn

radiant umbra
#

Is there like a snippet or smth out there to automatically get a jar file from github and put it in the plugins folder and delete the old one, kinda like an auto plugin updater

chrome beacon
#

Use the update folder

#

Spigot will then replace your old plugin jar for you

radiant umbra
#

wdym with update folder?

chrome beacon
#

Create a directory called "update" in your plugins directory.
Download the plugin that you wish to update.
Place ONLY the .JAR file into the update directory.

#

As for downloading files there are guides online

radiant umbra
#

alr, gonna search then

#

ty

chrome beacon
#

Make sure to do it safely so you don't cause a security problem with your plugin

torn oyster
#

what's a good blood particle?

echo basalt
#

cracked redstone block

earnest lark
#

restone

torn oyster
#

ok cool

#

however Particle.REDSTONE seems to throw an error

#

says it needs data

#

what data does it need

earnest lark
#

w.spawnParticle(Particle.REDSTONE, locationp, 2003);

radiant umbra
earnest lark
#

this works

radiant umbra
earnest lark
#

orplayer.getWorld().spawnParticle(Particle.REDSTONE,locationp,1);

onyx fjord
#

whenever i see one letter variable i wanna cry

earnest lark
#

if you are using the spawnParticle thingymabober

earnest lark
torn oyster
#

figured it out

#

it needs DustOptions

earnest lark
#

that worksas well

torn oyster
#

all good tho it should work now

#

killed.getWorld().spawnParticle(Particle.REDSTONE, killed.getLocation(), 200, options);

onyx fjord
#

i have my little util for redstone i think

#

redstone and barrier*

earnest lark
#

World world = Bukkit.getWorld("world");happy now

radiant umbra
chrome beacon
#

That's a real bad idea if you want to publish your plugin

torn oyster
#

bro this ugly ass particle πŸ’€

#

what am i meant to do

#

to make it look like blood

radiant umbra
torn oyster
#

what to do

#

to make it look like blood

#

i feel like redstone isn't the right particle either

chrome beacon
earnest lark
#

ive seen people make it look amazing

#

you though

radiant umbra
chrome beacon
torn oyster
#

olivo

#

how do i make good blood particles

#

settings-wise

chrome beacon
#

From the the repository you can get the releases

echo basalt
#

you blind mf

torn oyster
#

oh

#

lol yeah i am blind

torn oyster
echo basalt
torn oyster
#

ah

echo basalt
#

It's... a cracked... redstone... block

torn oyster
#

i didn't understand what u meant

river oracle
#

please

#

I'm interested

echo basalt
#

playing apex wait a bit

eternal oxide
torn oyster
#

or am i stupid

eternal oxide
#

use single ' to wrap

torn oyster
#

okay

#

'1':, then?

eternal oxide
#

yes

radiant umbra
chrome beacon
#

πŸ€·β€β™‚οΈ

torn oyster
#

oh yeah, i have my void chunk generator

#

but how do i ensure the biome is always plains

#
public class VoidChunkGenerator extends ChunkGenerator {

    @Override
    @NotNull
    public ChunkData generateChunkData(@NotNull World world, @NotNull Random random, int x, int z, @NotNull BiomeGrid biome) {
        return createChunkData(world);
    }
    
}
#

also it's deprecated

#

so if anyone has a better way then pls let me know

radiant umbra
river oracle
echo basalt
#

Here's the full code for that vid

tranquil dome
#

Is there a way to get the player's movement velocity that they had before the PlayerVelocityEvent was called?

earnest lark
#

how would i so that if i put something like /time adpetvail 10 make 10 into a variable

chrome beacon
#

Which means you can just get it directly from the player

chrome beacon
tranquil dome
worldly ingot
chrome beacon
#

You're going to need to include that lib in your plugin

tranquil dome
chrome beacon
#

No

#

1st index

#

args[1]

earnest lark
#

yea srry that said 3

#

i still get a errorforit tho

radiant umbra
chrome beacon
#

You need to shade it

#

Look up the maven shade plugin

earnest lark
#

i dont have that

torn oyster
#

what's a good sound for collecting a coin/gold

#

or something like that

earnest lark
#

amythyst_block.hit

#

ok so i cant do this int idk = args[1]; because it has to be a string but i want it to be a int so that i can use it elsewhere

hazy parrot
#

?learnjava tbh

undone axleBOT
hazy parrot
#

You have to parse it

earnest lark
#

i tried but the creeper does not spawn

hazy parrot
#

Your question rn have nothing to do with creeper spawning

#

It's about parsing string into integer

earnest lark
#

yes it does

#
                      int idk = Integer.parseInt(args[1]);

                        locationp.add(0, 5, 0);

                        Creeper creeper = world.spawn(locationt, Creeper.class);
                        creeper.setPowered(true);
                        creeper.setFuseTicks(0);
                        creeper.setExplosionRadius(idk);
                        creeper.setVisualFire(true);
tranquil dome
#

How can I get the original player's movement velocity that they had before the player has taken velocity inside the PlayerVelocityEvent?

#

both player and event velocity are the same for me

boreal python
#

Using player.getWorld().getBlockAt(player.getLocation().clone().add(1, 0, 0)).equals(Material.AIR):
How would I check for multiple materials at the same block at once? I need to check for 16 different materials for the 9 blocks that directly surround the player. I really don't want to have to copy/paste this 144 times, so could I instead just do 9 different statements for each blocks where each statement checks for all 16 materials at once?

tranquil dome
boreal python
#

Alrighty.
What I need to do is to test if only 4 of the 9 blocks are one of those materials

drowsy helm
#

Iterate over each block with a for loop, store material, match it to an immutable set, done

#

And if needed keep a list of the matching locations

tall dragon
#

hey fellas. so have this "proccessor" that is behaving very weirdly.

private final Deque<ProcessingPacket> deque = new ArrayDeque<>();

    @Override
    public void run() {
        while (running) {
            if (deque.peek() == null) continue;

            ProcessingPacket pp = deque.poll();
            byte[] decoded = Base64.getDecoder().decode(pp.getRaw());
            Packet packet = consume(decoded);
            server.getPacketReceiver().receive(pp.getChannelIn(), packet);
        }
    }

this is the setup. but for some reason the deque fills up. and they are not getting proccessed, now the weird part: when i add a break point at deque.poll(); and send another packet through the system it will proccess packets as long as my breakpoint is there and i click "resume program"

any1 any ideas?

#

also got a method to queue packets

    public void queue(String channel, String raw) {
        queue(new ProcessingPacket(channel, raw));
    }

when i put a breakpoint in there you can see that its building up and that deque#peek() is in fact not null

im really stumped here...

main dew
#

hi I want edit blocks in PacketPlayOutMapChunk with palette but I have problem with understand how palette work. Anyone can send links what can help me understand it? πŸ˜…

undone axleBOT
river oracle
main dew
echo basalt
#

I'd just say to remove the scope

tender shard
#

compile using mvn package

echo basalt
#

If you're still struggling

river oracle
#

^ ayeee its the NMS guy

echo basalt
#

Is it though

river oracle
tender shard
#

wdym "still"? did you compile it differently before?

hazy parrot
#

Is there a way I can get all NamespacedKey associated with my plugin ?

tender shard
#

no

hazy parrot
#

ty

echo basalt
#

No, they're just objects

#

You could make an extending class with a static registry

hazy parrot
#

yap, will make kind of map

tender shard
#

you run mvn package to compile your .jar. it will be at <project folder>/target/YourPluginName-1.0.jar

#

and that will include all the shaded classes

echo basalt
tender shard
#

Do you use intellij?

#

In the top right corner, theres a maven tab

#

Go to β€žlifecycleβ€œ there, then double click on β€žpackageβ€œ

#

Then your compiled jar is in the β€žtargetβ€œ folder

tender shard
#

Thats maven πŸ˜„

tender shard
#

If you have a pom.xml, you should always use the maven tab to compile

#

If you use intellij build artifacts to build, it ignores your pom

#

So yeah, β€žpackageβ€œ is the way to go

#

In 99% of cases at least πŸ™‚

#

Np!

west scarab
#

why am i getting this error?

quaint mantle
#

omg mfnalex

#

So cool

waxen plinth
#

If you're developing for an older version

#

Which I'm guessing you are

west scarab
#

im usin 1.18.2

waxen plinth
#

Then you need to compile against java 8

#

Ok then what version is your server running on

west scarab
#

same

waxen plinth
#

What java version

west scarab
west scarab
waxen plinth
#

Yeah you should be using java 17

#

For the server and your plugins

west scarab
#

got it

#

thanks

#

any clue?

Unsupported class file major version 61

@waxen plinth

quaint mantle
shadow zinc
#

why is set defaults not working for my config manager?

quaint mantle
#

And make sure source and project are 17 too

shadow zinc
#

by not working I mean not updating the config file

west scarab
#

my JAVA version is set to 17

#

and so is source & target.

quaint mantle
#

What version is your maven compiler set to?

west scarab
#

where is that at? lol

quaint mantle
#

In your pom.xml

west scarab
#

these are the lines producing the error:

                        <goals>
                            <goal>shade</goal>
                        </goals>
quaint mantle
#

Unsupported class isn't that

west scarab
#

if i remove it, it fixes

quaint mantle
#

Whats the maven compiler version?

west scarab
#

3.2.4 i believe

#
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>```
quaint mantle
#

Change it too 3.4.0, 3.2.4 doesn't support 17

west scarab
#

dont exist screenshare @quaint mantle

#

join the call rq

quaint mantle
#

Reload maven

#

It'll download it

shadow zinc
#

I know that line of code gets executed

#

line 47

west scarab
#

any clue anyone?

spring hull
#

How do I turn on economy mode

river oracle
#

there are no modes for spigot outside of I guess gamemode but thats a minecraft thing

shadow zinc
#

wtf is economy mode?

river oracle
#

also nvm I'm not going to help you broski you really felt the need to ask that in every damn channel

#

jesus christ

spring hull
river oracle
#

do you even know where you are

#

lmao

#

this aint the plugins help discord

#

this is the official spigot discord

shadow zinc
#

how to turn on baby mode for xql v4 sx9?

river oracle
#

if that doesn't fix it just ping me

river oracle
shadow zinc
#

ah yes thx

quaint mantle
#

Man literally said it in every channel

torn oyster
#

how do I turn off cave gen?

quaint mantle
#

What is |?

#

Am i super dumb or

#

Just ()?

river oracle
quaint mantle
#

Ty

vital sandal
#

can someone explain how multi version plugin work ?

river oracle
#

and ur done

#

if you want to use features from newer versions you just need to use reflection and make sure there is proper abstraction in place

quaint mantle
#

Trying to do taxicab distance

iron glade
#

?tas

undone axleBOT
river oracle
latent bone
quaint mantle
#

Ew skript

tardy delta
#

?di

undone axleBOT
pearl zephyr
#

how do i add an api?

chrome beacon
#

Depends on what api and which build system you're using

pearl zephyr
#

actually its fine

warm flume
#

Hello why people prefer to use particle packets over World#Playeffect?

#

I know using packets i would be able to sent it to who ever i want and as well its not gonna be server sided(not sure about this) any other benefits in packets over playeffect

drowsy helm
#

its the same thing pretty much

#

as you said, only upside is making certain players see certain particles but thats about it

warm flume
#

gonna be fun

wet breach
#

since the server would be unaware of the particles since you send the packet yourself as opposed to having the server do it

drowsy helm
#

is there even serverside processing for particles

warm flume
drowsy helm
#

uuh its either radius or just blind send

#

you can check the src on spigot hub, i cbf rn lol

warm flume
#

cbf.equals(?)

drowsy helm
#

cant be fucked

#

cant be bothered

warm flume
#

oh thanks no its okay you not begin fucked

drowsy helm
#

in non australian

#

but theres no harm in sending a packet to hte player if they're not in the radius

#

the client just doesn't act upon it

#

but at the same time, you don't want to be sending useless packets

warm flume
#

i dont want to flood user connection with many useless packets, so i guess i will use packets and send it to radius like X blocks! thanks.

drowsy helm
#

nws

warm flume
#

ig

tall dragon
glossy venture
#

i assume you are running it on different threads

#

run and push

#

put a

synchronized (deque) {

}
``` around the code using it
manic furnace
#

Some of you may remember that I write a little library which includes nms. I use mojang-mapping and the reobfuscating works perfectly. But I also work on an plugin which uses nms, and ther, my code just doesn't get reobfuscated!

#

My pom

#

Stacktrace

#

Bruh work sdk

#

*wrong

ivory sleet
tender shard
#

you should never change the output file in the shade plugin

#

remove that and itll work

manic furnace
#

It works

#

Wrong jdk

tender shard
#

wdym wrong jdk? if that would have been the problem, then the log would have shown BUILD FAILURE instead of SUCCESS

manic furnace
#

It doesn't remap with jdk 8 for some reason

#

Probably because 1.19.2 needs jdk 17

tender shard
#

but it doesnt access any 1.19 files

#

all it does is read your own .jar file

manic furnace
#

Yeah but with 17 it worked

warm flume
#

1.19 requres jdk 17

tender shard
#

no

warm flume
#

java 16+

tender shard
#

spigot-api is compiled against java 8

warm flume
#

it cant run on older versions

#

if its not fork

tender shard
#

1.19 requires java 17+ to run, but you can compile stuff against bukkit 1.19 just fine using java 8

warm flume
tender shard
#

if you couldnt use java 8 for 1.19 plugins, then there'd be no way to have a .jar working on 1.16-1.19

warm flume
#

i was thinking he tries to run 1.19 on java<17

tender shard
#

oh no

#

πŸ™‚

cedar turtle
echo basalt
#

we're not your personal slaves

#

Either commission it off of someone or make your own improvements

radiant umbra
cedar turtle
ivory sleet
#

Yes asking such a thing here is still off topic

#

?services would be your place in this case

undone axleBOT
obsidian lynx
#

Hi don't someone what is the issue?

Loading libraries, please wait...
[11:45:35 WARN]: [oshi.util.platform.windows.PerfDataUtil] Failed to add PDH Counter: \Paging File(_Total)\% Usage, Error code: 0xC0000BB8
[11:45:35 WARN]: [oshi.util.platform.windows.PerfCounterQueryHandler] Failed to add counter for PDH counter: \Paging File(_Total)\% Usage
[11:45:35 WARN]: [oshi.util.platform.windows.PerfCounterQuery] Disabling further attempts to query Paging File.
[11:45:38 WARN]: [oshi.util.platform.windows.WmiQueryHandler] COM exception: Invalid Query: SELECT PERCENTUSAGE FROM Win32_PerfRawData_PerfOS_PagingFile
obsidian lynx
#

1.19.2

#

currently fixed, the error was inside a Windows 10/11 performance monitor, in

"Unable to add these counters:

\Memory\Available MBytes
\Memory\% Committed Bytes In Use
\Memory\Cache Faults/sec
\Memory\Cache Faults/sec
\PhysicalDisk(*)\%Idle Time
\PhysicalDisk(*)\Avg. Disk Queue Length
\Network Interface(*)\Bytes Total/sec"

** FIX: https://social.technet.microsoft.com/wiki/contents/articles/19374.windows-performance-monitor-unable-to-add-these-counters.aspx **
if the you got Error: Unable to rebuild performance counter setting from system backup store, error code is 2
change the cwd to SysWOW64 and run the command lodctr /R again

warm flume
#

not even an plugin

cedar turtle
cedar turtle
#

32-47 has just racially insulted me (in a private message)

echo basalt
#

block em

cedar turtle
#

I have, just wanted to write it here so that he might be banned

chrome beacon
#

This is the wrong channel use #general

molten hearth
#

@warm flume based

dark wasp
#

Hi, does anybody know how CafeBabe actually sends private messages via SpigotMc? I already saw the cloud bot repo (https://github.com/CloudBotIRC/CloudBot) which was mentioned once here (https://www.spigotmc.org/threads/cafebabe-source.27783/) in 2014 but I'm a bit confused how IRC actually work for private messaging.

don't know if this is the correct channel tho

GitHub

CloudBot - The simple, fast, expandable, open-source Python IRC Bot! - GitHub - CloudBotIRC/CloudBot: CloudBot - The simple, fast, expandable, open-source Python IRC Bot!

echo basalt
#

You gotta use the xenforo rest api

dark wasp
#

So you mean I can start a conversation with a simple HTTP request?

drowsy helm
#

Think you need api priveleges

#

It’s how discord verification works

dark wasp
drowsy helm
#

uuuh not that I know of

#

maybe message support but I really really doubt it

dark wasp
#

yeah... that would be so nice. I wanna write a discord bot that can verify spigot resource purchases and give those users a premium role to access premium dev builds but it's just hard to accomplish without using selenium πŸ‘€

drowsy helm
#

yeah would be nice if spigot had an api for that

echo basalt
#

but then it breaks spigot <-> discord linkin

noble lantern
#

"hi yes pls send a screenshot of the resource page download button so ik you own it" - 2022

#

we in 2022 and this is a standard thing for purchase verification, spigot add something already

dark wasp
dark wasp
#

But I won't start and train a machine learning classifier to detect those images to verify users xD

radiant umbra
drowsy helm
#

decompile and see if its there

noble lantern
#

ngl would be pretty bitchin if spigot allowed did something similar to google oauths callback in a sense; where when you buy something from x page; the owner of x page can set a REST Redirect URL to theyre own servers from spigots when someone buys theyre plugin; so the Keys stay between you and spigot

Can allow some simple things like when someone purchases my plugin "SuperStars" i get a request to https://supercoolwebsiiiiiiiiiite.com/purchaseRequest?api_token=blah&purchased=SpigotUserID

Ofc more complex that that; but basic functionality is there

From there for linking you can just have them upload a code to theyre status and then Scrape theyre HTML page for that code (probably sent by a discord bot)

#

that way you can simply verify who owns your stuff by having theyre user id (last digits at the end of theyre spigot url), and youll have those saved with your linking system from the scraper

drowsy helm
#

yeah seconded

radiant umbra
drowsy helm
#

rn premium plugins are in a shitty spot tbh

drowsy helm
noble lantern
#

And overall most of that is rly simple

#

all spigot has to do is save an API key and a URL

#

and send a requesto your own servers on purchase

#

if it fails; manual verification is your fallback or there could be some kind of re-verify option

#

but; thats all in a dream

drowsy helm
#

oauth2 is fucking great

#

i love oauth

noble lantern
#

if that ever gets added ill shit myself

#

same

#

googles is quite difficult to setup; but once its up its sooo nice

#

prolly done google oauth 5ish times now and its rly nice once you get it working

radiant umbra
dark wasp
drowsy helm
#

but at the same time im not sure what limitations md faces with xenforo

#

does he have full source control?

noble lantern
#

but

#

they change very x hours

#

and api isnt rly publicly documented

drowsy helm
#

just use a decompiler and see if the class is in the jar

dark wasp
noble lantern
#

this is just a few

#

bunch of others

drowsy helm
#

alotta sites do that

noble lantern
#

one of them double as your key

#

^

drowsy helm
#

not uncommon

noble lantern
#

i think user is what can double as the key; but like said it will reset on you in 5 minutes, 5 hours, or 5 days

#

not sure on that time

#

i was helping someone a while back with an auto updater or something like that; and this was aboutas far as we got with the XF API on spigot

radiant umbra
drowsy helm
#

yes

radiant umbra
#

no it isnt there

#

where should i put it then

drowsy helm
#

you arent shading it properly then

#

can we see your pom

placid pivot
#

The question is what version of XenForo does Spigot use?

noble lantern
#

lord

#

who knows

#

2012

drowsy helm
#

outdated im pre sure

#

md changed the source so i doubt he updates it

radiant umbra
noble lantern
#

im sure theres a way to check for a user

drowsy helm
noble lantern
#

pom?

drowsy helm
#

pom if anyone else wants to see

noble lantern
#

pog