#help-development

1 messages · Page 553 of 1

steep wave
#

Which is how we do things now anyways.

#

It just gets confusing

livid dove
#

Do any of them use inventory.get holder

eternal oxide
#

depends on what each of those is doing

livid dove
#

Yeah... real talk my friend... do any of them use inventory.getHolder

tardy delta
#

we already discussed this

eternal oxide
#

Have you make a ticket about getHolder?

steep wave
livid dove
#

I've asked around and @sullen marlin , the guy who added the snapshot functionality to getHolder can explain why it can't be fixed now

eternal oxide
#

Then it's probably time to stop bring it it up

hazy parrot
#

What's problem with it?

livid dove
#

Nope. Other way around. Its up to us as devs to avoid it

hazy parrot
#

I mean with holder

eternal oxide
#

You've been bring it up for two days now, in unrelated context. It's becoming annoying.

livid dove
#

This future I do not accept it. As an error only becomes a mistake when you refuse to correct it

hybrid spoke
#

didnt we already had this

pseudo hazel
#

i just use null for the holder xD

hybrid spoke
#

now out of context for what

livid dove
#

In investigation it is quite literally the reason custom.items are laggy so, if we as devs collectively strive to remove them from on click events and other very highly called events, the performance gains will be big.

pseudo hazel
#

thats not a realistic expectation

echo basalt
#

you've been talking about it for the past 12 hours straight

hybrid spoke
#

me who uses it do identify his menu

livid dove
#

Oops lol

eternal oxide
#

== is the correct way to identify

hybrid spoke
#

thought the title

pseudo hazel
#

not the title xD

hybrid spoke
#

i love abusing the title

livid dove
#

... this is why we can't have nice things

hybrid spoke
#

to titles?

livid dove
#

Moment ur using getHolder uve done the bad thing. Don't matter what u used it for

hybrid spoke
#

just use the title as identifier and fake another title with packets

#

they'll never know

pseudo hazel
#

it work up to the point where you change the title

hybrid spoke
#

now you made him mad

livid dove
#

Since when did spigot dev help become toxic?

hybrid spoke
#

🤯

pseudo hazel
#

since you keep hammering the same thing

hybrid spoke
#

you make yourself more important than you are

eternal oxide
#

Only when someone is annoying enough to piss enough of the devs off

pseudo hazel
#

we know what you were trying to say and we understand, but repeating it is not going to solve anything

eternal oxide
#

You've stated what the issue is, you even discussed it with md5, it's time to give up

echo basalt
#

I went to bed hearing about this

#

I woke up and you're still here

eternal oxide
#

same

echo basalt
#

🤫

hybrid spoke
#

cant we just patch inventories out of the game

livid dove
#

Let me ask you this.

If you saw someone not using getters and setters. You'd tell em straight yeah?

See someone doing 50 if statements in a row.. ur gonna give em the heads up.

I've seen something spiggot ain't gonna fix in house and have legit said it's up to devs to fix their end.

So if I see someone walking it into their events... why am I the bad guy for telling em?

livid dove
#

It was someone new...

hybrid spoke
#

yeah everyone blames on that

#

but no one really cares

#

its like a make fun of them and move on thing

livid dove
#

Oh and you lot don't don't good practigcs in someone's code if they ask another question yeah?

echo basalt
#

one thing is java basics

hybrid spoke
#

nothing more nothing less

echo basalt
#

another thing is this obscure api that no one knows better about

eternal oxide
#

We tell them once, posibly twice if they ignore us. We do not keep going on for two days

echo basalt
#

what if I'm using holders for inventories with 2 random items that don't have enough metadata to kill an elephant?

livid dove
#

That seems ass backwards

eternal oxide
#

If you actually SEE someone using the getHolder method, you are more than welcome to advise them

pseudo hazel
#

you arent listening, besides they didnt even mention any holder nor did they show code using it

#

thats like if I started to list every single thing you shouldnt do in your program

livid dove
#

Look ur probably right, I saw a guy talking about using 9 listeners of the same type in a code with no losses, I jumped the gun.

eternal oxide
#

We should start reminding people to stop and have a drink

echo basalt
#

you literally had a 2 hour discussion about cloning itemstacks

#

just chill out and realize it's not the end of the world

hybrid spoke
#

overcompensating

livid dove
echo basalt
#

yeah but that was like

#

yesterday

pseudo hazel
#

and take a drink

eternal oxide
#

thanks

livid dove
echo basalt
#

butthurt

livid dove
#

At least everyone else is telling me why I'm an idiot

hybrid spoke
#

damn i hit a nerve

eternal oxide
#

he hates GodCipher 🙂

river oracle
#

I love GodCipher don't worry you are loved friend

livid dove
#

At this point yeah.

His very first comments to me were "ur sever is shit, profilers can be inaccurate, you don't know what ur talking about"

Been using this channel for what? 6 months, discussed stuff with a lot of yall.

And I'll say rn never had someone be so rude.

Maybe they are a nice guy but I personally feel he has jumped down my throat last few days

#

Aye its fair

#

I guess it's the shock of finding it an realising how much of a resource drain jt is. Sorry guys.

Raz did a goof

livid dove
#

No long term grudge or anything, life's to short but imo, I just feel he has jumped down my throat hard last 2 days

quaint mantle
#

Real

livid dove
#

Yup

hybrid spoke
#

🙌

quaint mantle
#

My honest reaction

echo basalt
#

uh

#

yeah

#

my honest reaction

quaint mantle
livid dove
#

Sorry md_5 please don't hurt me 🤣

quaint mantle
#

Ok

mortal hare
#
template<typename t_element>
template<bool t_is_axis_const, typename t_iterator, typename t_const_iterator>
typename nonogram::Table<t_element>::Axis<t_is_axis_const, t_iterator, t_const_iterator>::iterator
nonogram::Table<t_element>::Axis<t_is_axis_const, t_iterator, t_const_iterator>::begin() const {
    return {m_table, 0};
}

template<typename t_element>
template<bool t_is_axis_const, typename t_iterator, typename t_const_iterator>
typename nonogram::Table<t_element>::Axis<t_is_axis_const, t_iterator, t_const_iterator>::iterator
nonogram::Table<t_element>::Axis<t_is_axis_const, t_iterator, t_const_iterator>::end() const {
    return {m_table, getSize()};
}

ah yes, very readable

tardy delta
#

ye

#

if you start removing the t_ everywhere

mortal hare
#

EntitySpawnEvent maybe

#

or you can register one via NMS

#

iirc

#

back in the days you needed to open up NMS entity registries

#

to register your own custom mob with modified mob class

#

afaik

livid dove
#

I'd suggest looking into mythic mobs as it's legit a sorta "someone else has already made a cracking api, might aswell use it"

#

...

#

Oh

mortal hare
#

then use EntitySpawnEvent

#

and implement your own external handling

tardy delta
#

pdc

#

fuck you

mortal hare
#

create EntityRegistry class where you store entries of mobs you've spawned

#

if the registry contains one with that uuid

#

bam

#

its yours

quaint mantle
#

EntitySpawnEvent or net.Minecraft.server

mortal hare
#

then do NMS

#

thats way more work

eternal oxide
#

add an NBT tag

quaint mantle
#

Just do EntitySpawnEvent then a switch case and make it a chance that it’s your custom mob

mortal hare
#

NBT api doesnt exist on 1.12

#

but you can

#

yeah

eternal oxide
#

there is an NBT APi library

mortal hare
#

just use NBT lib

mortal hare
#

NBT is stored on the mob

#

if you get the entity of the same mob

#

no matter the event

#

nbt tag still persists

quaint mantle
#

No

eternal oxide
#

read its page

quaint mantle
#

You can create an object of the mob

mortal hare
quaint mantle
#

Then access it@later

mortal hare
mortal hare
#

idk that's just a gif

hybrid spoke
#

huh

mortal hare
#

sounds like some kind of blockchain shit

eternal oxide
#

modules

hybrid spoke
#

depends on what you are doing

#

if you do nothing specific and only api related its enough to use a lower spigot-api version

eternal oxide
#

its fairly complex and you don;t seem too interested in learning

#

take the simpler route, check if the method you want to use exists

#

create your own utils method to see if the method you want is supported before using it

#
public class Supported {

    /**
     * Does Spigot support library loading (1.16.5+)
     * 
     * @return true if supported.
     */
    public static boolean hasLibraries() {

        try {
            // Doesn't exist before 1.16.5
            PluginDescriptionFile.class.getMethod("getLibraries");
            return true;
        } catch (Exception ex) {
            // Server too old to support getLibraries.
            return false;
        }
    }
    
    /**
     * Does Spigot support Player.updateCommand() (1.14+?).
     * 
     * @return true if supported.
     */
    public static boolean hasUpdateCommand() {
        
        try {
            // Method only available post 1.14
            Player.class.getMethod("updateCommands");
            return true;
        } catch (Exception ex) {
            // Server too old to support updateCommands.
            return false;
        }
    }
}```
tardy delta
#

switch :C

flint coyote
#

why no -> syntax?

tardy delta
#

ye

hybrid spoke
eternal oxide
#

I don;t think lambdas in switches is supported in java 8

tardy delta
#

java 8 meh

hybrid spoke
#

we support 1.8(ass)-1.20

#

so we are kinda bound to java 8

tardy delta
#

im wondering, isnt it possible to have a java 19 source file and compile it to java 8?

#

ye

eternal oxide
#

depends

pseudo hazel
#

i feel so free only having to support versions that I decide are cool 😄

flint coyote
#

How do you guys go with versioning your config.yml?

E.g. version 1.0.0 only has

Config:
  example: true

And then with 1.1.0 you have

Config:
  no-longer-example: false
  something-else: 14
hybrid spoke
#

yeah java is backwards compatible

tardy delta
#

hmye forgot about that

hybrid spoke
pseudo hazel
#

i dont, I just tell users to save a backup and wipe the config

tardy delta
#

but ye doesnt work with nested data

flint coyote
eternal oxide
hybrid spoke
#

i mean you could migrate the current config to the newer design

#

but for what

#

not your problem

pseudo hazel
#

because if I change the config its for a reason

#

yeah that will only add more 1 time use code

#

which is meh

flint coyote
#

Well mostly you would just add more keys to it

#

So you could have a config-version in the file and then add new keys based on the version

hybrid spoke
#

no thanks

tardy delta
#

users messing with config version 🙏

pseudo hazel
#

i cant be bothered to redo the comments though

tardy delta
#

straight to hell

flint coyote
hybrid spoke
#

just count your config up and use the newer one

#

config2.yml

flint coyote
#

config17.yml

#

lmao

hybrid spoke
#

thats essentially the "just delete your config" automated

flint coyote
#

and make them lose all their configuration 💀

pseudo hazel
#

that wont warn users for config wipes though

#

wdym load it first

hybrid spoke
#

nah they can also do somehting

#

im doing that for free so they can also go through hell to use it

flint coyote
#

I guess for my current project I'll still need some config versioning. Not for the config.yml itself but for some custom configs

hybrid spoke
pseudo hazel
#

I nuke my custom configs since they arent supposed to be user editable directly

#

but only if I have breaking changes

#

which is pretty rare

flint coyote
pseudo hazel
#

yeah same

flint coyote
#

So I kinda have to migrate instead of nuking

hybrid spoke
#

have fun with that

#

what if they skip a version

pseudo hazel
#

you should have come up with the perfect solution from the start

#

thats on you

hybrid spoke
#

you gotta make sure to support migration from every version before

flint coyote
steep wave
flint coyote
#

I mean it's easy to achieve theoretically. I was just wondering if there's some best practice in spigot I'm not aware of

steep wave
#

and then migrate1to2, migrate 2to3, migrate 3to4. If user uses an old version it runs through everything.

tardy delta
#

i somehow read that as transformations and vibrations

flint coyote
#

time to vibrate everyones configs

flint coyote
river oracle
#

how do I turn off the weird ass looking symbols in intellij

mortal hare
#

++i vs i++

river oracle
#

yeah no

mortal hare
#

i prefer ++i

river oracle
mortal hare
#

how

flint coyote
#

yes

river oracle
#

idk I don't prefer ++i

#

my professor used ++i and it drove me mad

mortal hare
#

idk ++i is technically easier to compute. But it doesnt matter these days

river oracle
#

yeah they are nice, but uhhh how to turn off

#

😭 so mean

flint coyote
#

requires a dlc

river oracle
#

thanks mr googler

flint coyote
#

Might aswell start writing some code then

river oracle
#

also is their a way to do auto imports in intellij

#

its kinda annoying having to do ctrl+f1 to import

#

when i use vsc I just press ctrl + shift + o which organized imports and imported un imported classes

#

bet im in my keymap

#

oh

#

its in settings

#

I don't see I blind

#

nvm

#

I unblind

#

oh now that I'm switching to idea I can finally use Kotshit

#

i mean Kotlin

hybrid spoke
#

"kotlin" is fine. the word shit is already in it if you read it in german

river oracle
#

@quaint mantle doesn't this look so much better

flint coyote
#

lmao zacken on a hating spree

mortal hare
#

i hate theme too

flint coyote
mortal hare
#

Monokai for the win

tardy delta
#

i started using ++i too now because of c++ iterators

river oracle
#

no this is a nice theme

hybrid spoke
zealous osprey
#

they mean the keywords I think

hybrid spoke
#

but the blue is nice

flint coyote
#

I use that one. Which is the default dark theme of the new UI

hybrid spoke
#

im looking for a new theme anyways

#

so show me what you got

flint coyote
#

I said I do

river oracle
#

I'm so used to github copilot I decided to stop using it so I actually use my brain more

tardy delta
#

thats exactly the reason i stopped using it

livid dove
#

Lmao
There are pros and cons to stuff like that. Personally didn't like it.

hybrid spoke
#

its weird that the variables are blue and not the types

livid dove
#

Yeah that I'd a bit odd. How many options are there?

tardy delta
#

imagine usin an ide

river oracle
#

uhm how do you generate hashcode and equals methods in IntelliDumb

#

google

tardy delta
#

@see this#method or :: i forgot

river oracle
#

?google

undone axleBOT
pseudo hazel
#

make a record xD

tardy delta
#

alt + enter uwu

#

wait no its alt + insert

river oracle
tardy delta
#

ah yes

river oracle
tardy delta
#

go to the java internals and disable reader mode 💀

#

go find out there

#

we sound like noobs that never write docs

river oracle
#

uhm guys I really am starting to hate intellij rn

Execution failed for task ':test'.
> No tests found for given includes: [sh.miles.domainsiege.internal.TestLightChunk.testInRange](--tests filter)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

``` I can't do anything 😭
hybrid spoke
#

this looks okay

river oracle
#

wtf why why won't it test

tardy delta
#

hating gradle yes

wise mesa
#

How is that intellijs fault

flint coyote
wise mesa
#

If you’re using maven or gradle then that’s the thing causing the issue

river oracle
wise mesa
#

Huh

tardy delta
wise mesa
#

Did you try just running the command in a terminal

#

I’m curious if that would work

river oracle
#

idk lemme try

tardy delta
#

is it supposed to work like that 🤔

#

atleast use Arrays.asList instead of a stream, cmon

river oracle
tardy delta
#

straight to hell

fluid finch
#

was looking at mapping changes for nms 1.17.1 aaand

wise mesa
#

That’s really weird

fluid finch
#

seems to be the case for all versions

wise mesa
#

While I do love streams, if you don’t need to map or filter and just need to foreach then Arrays.forEach will be faster

tardy delta
#

i dont believe, Arrays.asList simply assigns the array to a field

wise mesa
#

Oh nvm

pseudo hazel
#

write a for loop 💀

wise mesa
#

I’m wrong

#

Ignore everything I say

wise mesa
#

Look good more important

tardy delta
#

they will especially introduce Arrays.forEach for you

hybrid spoke
wise mesa
#

I’m stupid

#

Ignore what I said

#

I just woke up

#

My bad

#

Got hacked

rough drift
#

for(CustomItem item : items) this.registerCustomItem(item);

#

Also custom item lib?

flint coyote
pseudo hazel
#

imagine using this outside the constrcuctor

river oracle
# wise mesa That’s so weird

okay even weirder it fails again if I specifically target the class

Execution failed for task ':test'.
> No tests found for given includes: [sh.miles.domainsiege.internal.TestLightChunk](--tests filter)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

gradle test --tests sh.miles.domainsiege.internal.TestLightChunk

wise mesa
#

It’s slightly different but super helpful

rough drift
#

nice nice

#

can I see the usage of it, kinda curious now

wise mesa
#

Oh wow apparently there’s a new website linked right at the top

#

Tragic

hybrid spoke
#

but nah everyone tells me that

rough drift
#

no like code usage

hybrid spoke
#

screenshare "ohh there is so much wrong in your code"

errant narwhal
#

please someone help, i've created a customZombie using NMSv1_16_R3 i added PathfinderGoalNearestAttackableTarget to attack nearby LivingEntity. Everything working normally until when i restart server the old zombie not attack other mob only the new i spawn still have this pathfinder, how to fix it?

rough drift
#

That's not too bad

tardy delta
rough drift
#

I would condense the enchant/enchantments into just enchant(Enchantment...)

hybrid spoke
#

?paste

undone axleBOT
tardy delta
#
In the new design document released by the Valhalla team on 31/05/2023, it seems like they've finally found a way to get rid of that .val and .ref syntax that wasn't that great. They also talk about non-nullable types, with the current idea to use ! to indicate non-nullable, e.g. Object! means non-null. They're also looking at explicitly nullable types, those required in generics, being represented with ?, e.g. Object?. They're also adding implicit constructors for primitive classes, so you'll be able to initialize them without specifying a value, and it'll use a zero default representation, just like how integers do.```
#

not my conclusion

smoky anchor
#

Oh that sounds like a big progress!

hybrid spoke
#

later negative only ints: int:(
positive only int: int:)

tardy delta
#

unsigned int when

warped zephyr
#

anyone know how to blind the "social interaction screen" that comes out when you "press p" with Minecraft plugin? I can't find this code

smoky anchor
#

What do you mean "blind"
Like not show any players in there ?

hybrid spoke
#

what social interaction screen

smoky anchor
#

I would guess it's the one where you can block players and also report them.

hybrid spoke
#

wait you can block players

quaint mantle
#

can i prevent this block particles ?

mortal hare
#

those probably are clientside

#

since theres no reason to send them serverside

#

but i may be wrong

smoky anchor
#

I do think you are correct

quaint mantle
mortal hare
#

maybe lightning block

#

would interact with this?

quaint mantle
#

no only 1 time

#

i tried block damage event

#

sounds only play 1 time

mortal hare
#

because event gets called probably once a time

#

try using interact event

#

playing sounds like this is possible im pretty sure

quaint mantle
#

i tried

mortal hare
#

but i dont remember how

quaint mantle
#

do u mean playinterect event and leftclick block ?

mortal hare
#

yea

quaint mantle
#

i tried only worked 1 time

#

;-;

mortal hare
#

maybe this?

quaint mantle
#

works like interactevent

mortal hare
#

this should call when player swings his hand

quaint mantle
#

oh good idea

#

i will try this

mortal hare
#

but you need to somehow track the block breaking state

eternal oxide
#

start when the player begins mining (interact/damage), and repeat at a set interval. Stop if it breaks or you get a BlockDamageAbortEvent

#

or on animation

quaint mantle
#

i try anim

river oracle
#

it took a few hours of setup but this is the first time i've coded with intellij and not uninstalled it within an hour

tardy delta
#

with what were you coding before

river oracle
tardy delta
#

no vim

river oracle
#

I don't like vim

#

I use nano for command line editing

#

run gotta go before the vim users get here

quaint mantle
#

can i control enchanting table with spigotapi ? i mean lapis slot and enchant slots item slots

daring lark
#
@EventHandler
    private void onEvent(PrepareAnvilEvent event) {
        AnvilInventory inventory = event.getInventory();

        if (inventory.getItem(1) == null || inventory.getItem(0) == null) {
            return;
        }
        if (!plugin.getBackpackManager().isBackpack(inventory.getItem(0))) {
            return;
        }

        ItemStack backpack = inventory.getItem(0);
        int size = plugin.getBackpackManager().getBackpackSize(backpack);
        int modelData = getCustomModelDataForSmallBackpack(inventory.getItem(1).getType());

        if (modelData == -1) {
            return;
        }

        ItemStack newBackpack = ItemStackEditor.of(backpack.clone())
                .setCustomModelData(modelData)
                .finish();

        event.setResult(newBackpack);
        inventory.setRepairCost(1);
    }```
Why item is created and set to the slot but i can't taki it. When i click i just can't grab it.
tardy delta
#

i got something against that contains/ get idiom

rigid otter
#

When I unload a world or some chunks, the JVM doesn't garbage collect the memory. That means I see it is used yet trash. However, is it okay that we can safely use that memory whenever we need?

lost matrix
tardy delta
#

this isnt C

rigid otter
#

But in case it reaches the full memory

tardy delta
#

should probably figure out why the stuff isnt gced

hybrid spoke
#

then you have enough memory again because it crashed

hybrid spoke
lost matrix
tardy delta
#

i love how aikars flag nearly let my raspberry pi start smoking

rigid otter
#

Why don't after unload a world or some chunks it releases the memory?

lost matrix
#

If you have a ton of memory then the jvm wont collect garbage as often
to save on cpu time

ember estuary
#

How can i place a fake item in the players inventory?
I tried

ServerPlayer craftPlayer = ((CraftPlayer) player).getHandle();
Packet<ClientGamePacketListener> itemPacket = new ClientboundContainerSetSlotPacket(craftPlayer.inventoryMenu.containerId, craftPlayer.inventoryMenu.incrementStateId(), defaultSlot, CraftItemStack.asNMSCopy(item));
sendPacket(player, itemPacket);

But no item appears. What am I doing wrong / how can you do it instead?

(The item is just a normal item like new ItemStack(Material.DIAMOND_BLOCK, 1), defaultSlot is just the integer 4 and sendPacket is my own packet sending function which works perfectly fine.)

warped zephyr
daring lark
#

in other plugin of course

rigid otter
#

That's the point, why isn't Bukkit designed to ignore all references to that unloaded world/chunks?

tardy delta
#

a lot of stuff uses a weakref to the world

rigid otter
#

Do you have methods to accomplish this job? Or other way?

tardy delta
#

what are you even trying to say

quaint mantle
#

why i can't use blockdamageabort event ?

#

im in 1.16.5

eternal night
#

that event was added after 1.16.5

severe folio
#
        int particleCount = 20;
        double increment = (2 * Math.PI) / particleCount;
        double radius = 1d;
        double particleY = loc.getY() + 0.5d;
        
        for (int i = 0; i < 20; i++) {
            double angle = i * increment;
            double x = loc.getX() + radius * Math.cos(angle);
            double z = loc.getZ() + radius * Math.sin(angle);
            
            Location pLoc = new Location(world, x, particleY, z);
            world.spawnParticle(Particle.FLAME, pLoc, 1);
        }
        

why are the particles flying off in random directions..?

mortal hare
#

its a clientside feature

eternal oxide
#

pass zeros as it's a random vector

severe folio
#

i tried that

#

unless i did it wrong

#

1 sec

eternal oxide
#

you did it wrong

severe folio
#
world.spawnParticle(Particle.FLAME, pLoc, 1, 0d, 0d, 0d);

that?? cause it still happens

#

i may just be stupid lol

eternal oxide
#

player.spawnParticle(Particle.FLAME, loc, 1, 0, 0, 0, 0)

severe folio
#

oh PLAYER

eternal oxide
#

4 zeros

warped zephyr
severe folio
tardy delta
#

i should find shorts

#

its 30°C

worldly ingot
#

Yeah, world is fine, it's just the 4th zero you need. That zero is the "extra" value, which for fire is speed

severe folio
#

oh right

#

omg i clearly dont read it literally says that

pseudo hazel
worldly ingot
#

Hey man, reading can be hard sometimes

eternal oxide
#

a neet in shorts. Horrifying image.

hybrid spoke
ember estuary
#

I tried using getStateId() instead of incrementState(), but that didnt help either

quaint mantle
#

@eternal oxide how can i check block abort event in 1.16.5 ? bcs blockabort added after 1.16.5

eternal oxide
#

you can't

quaint mantle
#

oke but how can i add slow-digging effect when player block mining ?

#

or can i loop block damage ?

#

bcs block damage only works 1 time

eternal oxide
#

not possible with the API without the abort event

quaint mantle
eternal oxide
#

no idea

quaint mantle
#

i try

#

Hello, is it possible to remove zombie's attacking speed? like I removed damage tick delay, so I can take damage each 1 ticks, but zombies doesn't attack once per tick. so i wanna change zombie to attack every 1 ticks

hybrid spoke
#

or just upgrade to latest ¯_(ツ)_/¯

tardy delta
#

myes i love manual memory management

#

bruh all that stuff just to achieve this

#

meanwhile java: setWindowTitle("Zoom: " + camera.zoom) 😢

quaint mantle
#

i need do with runnable ?

tardy delta
#

go back to the main thread with the scheduler

dusk lake
#

Does anyone know how to modify the item in suspisous Sand and Gravel?
I´ve tried this code, but it does not work:

public class modifyArchaeology implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        
        if(!(sender instanceof Player)) return false;
        Player p = (Player) sender;
        ItemStack sand = new ItemStack(Material.SUSPICIOUS_GRAVEL);
        BlockStateMeta sandMeta = (BlockStateMeta) sand.getItemMeta();
        BrushableBlock blockState = (BrushableBlock) sandMeta.getBlockState();
        blockState.setItem(p.getInventory().getItemInMainHand());
        sandMeta.setBlockState(blockState);
        sand.setItemMeta(sandMeta);
        p.getInventory().addItem(sand);
        Bukkit.getLogger().info(blockState.getItem().getType().toString());
        
        return true;
    }
}

quaint mantle
zealous osprey
#

I think you are casting it to the wrong item meta

dusk lake
#

it does not throw an exception

zealous osprey
#

nvm, looks like it's correct

tardy delta
worldly ingot
#

Oh, wait, this is meta

#

This code works perfectly fine for me

#

Copy/pasted it into my test plugin and it works as expected

tender pond
#

Anyone know how i can fix this?

[INFO] Building Spigot-API 1.20-R0.1-SNAPSHOT                             [1/3]
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.apache.maven.plugins:maven-jar-plugin:jar:3.3.0 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Spigot-API 1.20-R0.1-SNAPSHOT ...................... FAILURE [  0.135 s]
[INFO] Spigot-Parent dev-SNAPSHOT ......................... SKIPPED
[INFO] Spigot 1.20-R0.1-SNAPSHOT .......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.256 s
[INFO] Finished at: 2023-06-09T16:43:04+01:00
[INFO] ------------------------------------------------------------------------
native gale
#

Hello! Is there any way to get a list of all naturally generated block ids out of spigot source code?

tender pond
#

Trying to build the new jar with Build Tools

native gale
#

I mean, there should be

#

I just don't understand where to look

dense falcon
#

There is a way to erase all updates in config file and put the defaultConfig ?

eternal oxide
#

saveResource(path, true)

dense falcon
#

In main file?

#

Of the plugin I mean.

dense falcon
eternal oxide
#

reloadConfig()

dense falcon
#
package fr.program;

import fr.program.cmds.PartieCMD;
import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin {

    @Override
    public void onEnable() {
        System.out.println("[LOUP GAROU] Enabled.");

        this.saveDefaultConfig();
        this.saveResource("compos_jeu.roles", true);
        this.saveResource("compos_jeu.nb_roles", true);

        this.getCommand("partie").setExecutor(new PartieCMD(this));
    }

    @Override
    public void onDisable() {
        System.out.println("[LOUP GAROU] Disabled.");
    }
}

Like this?

eternal oxide
#

no

#

you need to include your plugin directory

dense falcon
#

???

#

Well ignore it, I found a problem :(.

#

Just question, how I add and remove with .set in my config.yml if it's a List<String> ?

dense falcon
agile anvil
#

Question is how often do you update the list

#

To retrieve a list use Config#getStringList with key as parameter

To set the list just use the Config#set method you know

dense falcon
#

Just to start a game, basically players say play it and then it starts and then it doesn't move.

dusk lake
dense falcon
#
            List<String> currentList = plugin.getConfig().getStringList("partie.joueurs");
            if (mode == "add") {
                currentList.add(target.getName());
                plugin.getConfig().set("partie.joueurs", currentList);
            } else if (mode == "remove") {
                currentList.remove(target.getName());
                plugin.getConfig().set("partie.joueurs", currentList);
            }
agile anvil
worldly ingot
agile anvil
#

But careful with String list

#

Players are referred by UID and not Playernames

#

Playernames aren't a key

dense falcon
sour folio
#

how do you guys come up with ideas for projects?

river oracle
#

those are long gone

#

what version are you working with

native gale
#

Material names?

celest sonnet
#

why does my plugin just not work if i try to use it in a different version

#

like it just wont work at all, doesnt even show up

cobalt thorn
#
public final Map<UUID, Collection<PotionEffect>> playerActivePotionEffects = new HashMap<>();

    public void saveData() {
        playerActivePotionEffects.keySet().forEach(uuid -> plugin.getConfig().set("data." + uuid, playerActivePotionEffects.get(uuid)));
    }

    public void loadData() {
       plugin.getConfig().getConfigurationSection("data").getKeys(false).forEach(uuid -> playerActivePotionEffects.put(uuid, plugin.getConfig().get("data." + uuid)));
    }

Something to ask, on the loadData i need to load all the potion effect as Collection<PotionEffect> but i can only pass it as object what can i do to re translate it to collection or how can i change the code to load and save?

river oracle
native gale
river oracle
native gale
dense falcon
#

runTimerTask but if I remember it's deprecated.

native gale
#

I want to get all blocks that the world generator places

#

Not just all blocks

river oracle
native gale
#

For example, a block of diamond never generates naturally, so it shouldn't be on the list

river oracle
#

you could also dig in NMS maybe to see if you could find a list internally in the world generator

native gale
#

I just don't understand where to look

#

And that's what I initially asked

river oracle
#

Anything and Everything WorldGenerator so whatever spigot implements as BiomeProvider, Biomes etc

tardy delta
#

managed to reduce it to 4 lines 💀

#

and even better

cobalt thorn
tardy delta
#

gruvbox_dark_soft

cobalt thorn
tardy delta
#

it looks different in other editors

#

no

#

it has it tho

dense falcon
#

How I give a potion effect for an undetermined duration?

#
PotionEffect effect = new PotionEffect(PotionEffectType.BLINDNESS, 20*300, 10); // 20ticks -> 1s
tardy delta
#

undetermined as in infinite?

dense falcon
tardy delta
#

just set it to Integer.MAX_VALUE or smth

#

just some big num

dense falcon
#

Alr thx.

worldly ingot
#

Yeah, depends on your version

#

Modern versions, use the constant (for the sake of readability). Versions before 1.19.4 you would use the max value

rotund ravine
#

Did you ask a dumb question?

worldly ingot
#

I mean tbf, you did format your post strangely with colours where most would use inline code, created a resource that we see at least once every few months, and didn't open source it.

#

I'd be hard on it too lol

#

Because it's a developer resource. It's meant for developers to use but you failed to provide any Javadocs or source code, two things that developers tend to want to have when using a library

#

Definitely possible to do. Presumably (hopefuly!) you're using submodules for each version. GitHub can handle those. VeinMiner has 4 separate projects in one repo https://github.com/2008Choco/VeinMiner/

#

Submodules are just folders of separate projects nested inside your parent project

#

Perhaps documented, but no hosted/browsable Javadocs

#

Especially if the dependency on the repo doesn't have a Javadoc jar. The docs aren't retained at compile time

#

(I don't know if it doesn't have that, just figured I'd mention it)

#

Ah well there you go. Those should definitely be included in the thread

#

Though that aside, other two points still stand. The formatting is very far from what's expected. Flashy colours are often avoided because they're less readable and more abrupt to the reader. Like I mentioned, [ICODE] blocks are useful in situations where you want to highlight a method, class name, or some other small code snippet.

#

& it is a very common resource for people to make. If you search the forums for "ItemBuilder" you'll find dozens

#

No no, keep the thread up. Alternatives are always a good thing 🙂

#

It's just why you're seeing a little more heat is all

#

Some people may prefer your resource over others. I'm certain of it

#

I would just say try to standardize the colouring a little bit (use ICODE blocks instead), include the Javadocs if possible, and your thread's good

magic rampart
#

how do i set whether a button is clicked or not?

worldly ingot
#

The way it's sectioned off is good though

worldly ingot
#

e.g. [ICODE]ItemBuilder[/ICODE]

#

It's the equivalent of `` inline code in Markdown

#

Well anywhere you have orange can be replaced with an ICODE

#

Your of's for example can just be [ICODE]of(...)[/ICODE]

#

Should clean things up substantially 🙂

magic rampart
worldly ingot
#

Yeah, I lied

#

It's actually called Switch. That's mb

magic rampart
#

oh okay, thanks

remote swallow
#

how could you lie choco

worldly ingot
#

I THOUGHT IT WAS BUTTON!

remote swallow
#

you're a button

pseudo hazel
#

I blame the one who made that api

worldly ingot
#

Well originally buttons weren't switches

pseudo hazel
#

but then again, its probabkly reused for the lever

worldly ingot
#

Also, the method isn't even isPowered(). It's isActivated()

#

I'm just stoopid

#

So really I told you a whole bunch of lies

quaint mantle
#

ineed check blockdamage abort

#

for 1.16.5

pseudo hazel
#

u were close enough

#

dont we all need things

worldly ingot
#

Yeah that's probably fine

quaint mantle
#

bro can u give me a idea ? i wanna give slow diggings effect when block damaging but else i wanna remove potion effect

#

can i do this on 1.16.5 ?

#

bcs blockdamageabort event isnt work 1.16.5

#

blockdamageevent only works for first damage

worldly ingot
#

In 1.20?

#

Because we're not aware of any nonfunctioning methods

quaint mantle
#

how do i this ?

eternal oxide
#

you can't in 1.16

#

you can't tell if a player is still breaking a block

quaint mantle
#

i mean this

#

Elgarl dou have a idea ?

eternal oxide
#

thats why we now have the abort event

quaint mantle
#

😦

eternal oxide
#

Why are you stuck with 1.16.5?

quaint mantle
eternal oxide
#

what?

quaint mantle
eternal oxide
#

You are being paid to write this for 1.16.5?

quaint mantle
#

for server, customers = players

remote swallow
#

cant say ive ever heard that

eternal oxide
#

if its your server there is no reason to stick with 1.16.5

#

because it's the truth

quaint mantle
eternal oxide
#

server owner decides version

#

just update to a version which has a workign API you can use properly

quaint mantle
#

spigot have 1.20 ?

#

oke

#

player move event can check player head moves ?

orchid gazelle
#

Me at 4am: what?

pseudo hazel
#

I mean time and being awake do not have to be corelated

opal carbon
#

yes

fresh timber
#

how do I do text component things for the new .lore() on items and for the Bukkit.createInventory()'s component title? I dont know how to do a component string thing

opal carbon
#

the component lovers are paper

fresh timber
#

paper is a fork of spigot smh

opal carbon
#

completely different api mate

agile anvil
#

Exactly

fresh timber
#

whatever I can still use strings

opal carbon
#

damn Event event

#

i love listening to Event

pseudo hazel
#

I like playerMoveEvent

#

mostly to cancel their movement xD

#

but still

misty current
#

is there an event called when you pick an entity in creative with middle mouse button?

pseudo hazel
#

probably pickblock or someting

fresh timber
#

description: z[idfunbx[dofiggibn[xdf0gigbns[0ifdbs[0gkbn[0girinb||||}{LNBHAS{UNRFBP[FAB

pseudo hazel
misty current
#

ah that's too bad

quaint mantle
#
public void deleteHologramsY(@NotNull Location l) {
        for (int y = 0; y <= 255; y++) {
            for (org.bukkit.entity.Entity entity : l.getWorld().getEntitiesByClass(ArmorStand.class)) {
                if (entity.getLocation().getBlockY() == y) {
                    entity.remove();
                }
            }
        }
    }

Why does this remove entities around it?

pseudo hazel
#

around what

quaint mantle
#

oh

#

Nmv

#

Nvm

pseudo hazel
#

idk what you were trying do to, but looping through y probably wasnt the solution xD

opal carbon
#

looping through y is also a very inefficient way of doing that

#

if that was even what you wanted to do

quaint mantle
#

nah i forgot to check that the x and z values

quaint mantle
opal carbon
#

rn for every block below a y level

#

you get every entity

#

so you are getting every block and looping through them potentially 255 times

#

kinda a problem there

pseudo hazel
#

maybe first explain what you are trying to do

quaint mantle
#

ok i got the solution

opal carbon
#

instead loop through the entities

quaint mantle
#

im gonna get the blocks Y and just check 1 block up per 3 armorstand

opal carbon
#

then check if y < l.getBlockY()

#
public void deleteHologramsY(Location l) {
    for (org.bukkit.entity.Entity entity : l.getWorld().getEntitiesByClass(ArmorStand.class)) {
         if (entity.getLocation().getBlockY() < l.getBlockY()) {
              entity.remove();
         }
    }
}
#

less looping

quaint mantle
#

why does this work

public void deleteHologramsY(@NotNull Location l) {
        for (int y = 0; y <= 255; y++) {
            for (org.bukkit.entity.Entity entity : l.getWorld().getEntitiesByClass(ArmorStand.class)) {
                if (entity.getLocation().getBlockY() == y && entity.getLocation().getX() == l.getX() && entity.getLocation().getZ() == l.getZ()) {
                    entity.remove();
                }
            }
        }
    }

and this doesnt

public void deleteHologramsY(@NotNull Location l) {
        for (int y = 0; y <= 255; y++) {
            for (org.bukkit.entity.Entity entity : l.getWorld().getEntitiesByClass(ArmorStand.class)) {
                if (entity.getLocation().getBlockY() == y) {
                    entity.remove();
                }
            }
        }
    }

it is just checking shit

opal carbon
#

wdym

#

it depends what you are feeding in as parameters

rough drift
#

does getStringList consider [] as a list?

quaint mantle
#

wait i cba to type man

quaint mantle
quaint mantle
#

i will fix it

quaint mantle
wet breach
#

then why are you using annotations?

kind hatch
#

EntitySpawnEvent

quaint mantle
#

Bro that not going to be the final method

#

testing man

#

i need proof of concept

opal carbon
wet breach
#

using those annotations just hides problems and doesn't guarantee something not being null as well XD

#

and most of those are for making API's

#

not implementation details

pseudo hazel
#

if you are going to do holograms, just save all uuids of teh armor stands involved in the hologram

opal carbon
quaint mantle
#

its just a bunch of getters

#

and methods

wet breach
pseudo hazel
#

then remove them when trying to remove the hologram itself

quaint mantle
wet breach
#

show me where in the java standards it says to use annotations

quaint mantle
#

definetaly some extra points if you do

quaint mantle
pseudo hazel
#

show me where in the java standard does is say anything about good practise

opal carbon
#

just never annotate anything

#

ever

wet breach
#

I don't

#

annotations don't prevent anything

#

and tend to hide the real problems

quaint mantle
#

thas just u lil bro

mortal hare
#

cmon

opal carbon
#

then thats your choice

mortal hare
#

ide annotations are not bad

#

they literally warn you when you input something as null

#

if api doesnt want you to

opal carbon
#

other people like having it warn them if they feed a null value into a value that shouldnt be nullable

#

if someone else fucks that up even with warnings then you could say its their fault

#

if its poorly documented its your fault

wet breach
# quaint mantle thas just u lil bro

not sure why you refer to me as lil bro but whatever, you obviously haven't helped here long enough to see how annotations hide the real problems when someone encounters problems and its the annotations preventing certain errors from being thrown

mortal hare
#

also you can exclude runtime checks for all sorts of problems

winged anvil
#

he lil bro'd you

opal carbon
#

@Nonnull @Nullable dont hurt anyone

mortal hare
#

because IDE would warn you before compile time

pine forge
#

How can i switch my spigot project over to paper?

mortal hare
#

i dont see why annotations are wrong

tardy delta
#

_NotNull_

opal carbon
opal carbon
kind hatch
#

Did you check the type? EntitySpawnEvent#getEntityType()?

pine forge
wet breach
quaint mantle
#

exactly how are you arguining annotations are bad

opal carbon
#

change your maven/gradle import then

#

ez

ember estuary
opal carbon
wet breach
quaint mantle
#

error

#

it wouldve errored anyway??

wet breach
#

the annotation hides the fact of what is null or even why because you said it couldn't be

#

there is plenty of objects that you can't guarantee as not null

opal carbon
#

it will still error

wet breach
#

just because you used the annotation to say it isn't doesn't mean it never could be

opal carbon
#

you can still read stacktrace

wet breach
pine forge
opal carbon
#

and if someone feeds a null into a @nonnull its not your fault anymore

wet breach
#

not NPE

wet breach
#

but do tell me though how a trap exception is the same as a null pointer exception 😉

ember estuary
#

can't send it in here ofcourse xD
i'll dm u

opal carbon
kind hatch
#

Does the same hold true for the CreatureSpawnEvent()?

opal carbon
#

and that anyone who goes past that

#

its their fault

wet breach
opal carbon
#

the point of annotations is just to warn devs

#

if a dev decides to send a possibly null value

#

into a nonnull

#

thats their fault

wet breach
#

sometimes it isn't the dev that does it

opal carbon
#

youve done what you can to properly document that it shouldnt be done

pine forge
untold jewel
#

When im setting a UUID into my yml it puts this infront. Could someone tell me why and how I should proceed about fixing it? It kinda breaks my plugin so. (Looking to never get the !!java.util.UUID)

seller: !!java.util.UUID '751a9ab3-2822-48c4-b42c-3a1ab082f971'

opal carbon
wet breach
opal carbon
#

yet again on them

quaint mantle
wet breach
#

you don'tt control the code of what you are depending on

#

or when or how something in there is or is not null

#

so, that being said if you took an object from something you depend on, put it in a method you stated couldn't be null

untold jewel
tardy delta
#

non null types when

opal carbon
#

bad implementations arent the fault of the dependency

wet breach
opal carbon
wet breach
#

no

#

not sure where you got that

#

anyways, when an object is null, and you used the annotations to state that it isn't or can't be

quaint mantle
wet breach
#

the exception thrown is called trap, however trap exception isn't just for null stuff

#

so it isn't the same as NPE

#

also trap exceptions are one of the least informative exceptions as well

tardy delta
#

trap as in failed assertion?

opal carbon
tardy delta
#

im thinking about os interrupts now 🤔

opal carbon
#

thats all im arguing here

#

all im saying is that its better to have it documented then not documented, as long as its documented it well

wet breach
opal carbon
quaint mantle
#

@wet breach you're being a robot

opal carbon
#

but saying you cant pass a null value as a location for a method you literally just wrote

#

this entire argument started

#

with you acting like somehow

#

a obviously valid annotation was bad

#

obviously if that location was null there would be problems

wet breach
#

anyways, if you are not making an api and your plugin isn't public, annotations are actually pointless unless you simply must be reminded to not do something? which a comment might have sufficed for such things

wet breach
quaint mantle
opal carbon
#

there would still be a problem

#

either way

#

the annotation just makes it so if you break it its your fault

wet breach
#

anyways, since you can't objectively see my point I am going to stop trying to educate when you get trap exception its rather useless in telling you the problem

opal carbon
#

thats all im saying

#

no way mr devils advocate here is saying im not objectively seeing his point

quaint mantle
#

public void doSomething(@NotNull String p) {
Bukkit.broadcastMessage(p);
}

so if this is null there will a trap exception?

wet breach
opal carbon
#

as long as its documented well

wet breach
#

annotations is not documentation by itself

quaint mantle
#

this is kinda usefule

opal carbon
#

idk man it shows in ide if you hover over the message

quaint mantle
#

shout out to the ide

opal carbon
#

it shows in javadoc iirc

pseudo hazel
#

wait those @urban grotto things actually do stuff?

#

oof

opal carbon
#

yeah

pseudo hazel
#

thats their fault for naming yourself notnull

tardy delta
#

@NonNull does, injects a null check

wet breach
#

which apparently to everyone else that seems impossible

quaint mantle
tardy delta
#

contracts are the best

opal carbon
#

okay so we agree. if used correctly they can do things

pseudo hazel
#

well yes, thats like any tool ever

wet breach
# quaint mantle <@227800863022907393>

if someone was to use that method and put a null value and ran it yes it would generate a trap exception because the method asserted that it could not be null

quaint mantle
#

well it didnt

pseudo hazel
#

also i just noticed you used the same strategy for your new username frostalf xD

quaint mantle
#

it just told me the regular error

opal carbon
pseudo hazel
#

adding a dot

opal carbon
#

i consider it progress

pseudo hazel
#

likely because the normal name was already in use

wet breach
pseudo hazel
#

yeah

#

exactly

#

its unfair 😢

wet breach
pseudo hazel
#

wdym

wet breach
#

the usernames are also logins

river oracle
#

I want my new username already

wet breach
#

my login name is the username I wanted, but the system counts it as taken

pseudo hazel
#

oh

tardy delta
#

¯_(ツ)_/¯

pseudo hazel
#

hmm

#

thats ass xD

tardy delta
#

whats with hyping for those new usernames

#

i dont get it

pseudo hazel
#

yeah I mean it doesnt really matter

#

cant change my nickname in here anyways

wet breach
#

I preferred the descriminators

river oracle
wet breach
#

their excuses they made for removing them are literally none that I have encountered

tardy delta
#

you only have to remember 4 numbers lol

wet breach
#

so it just seems the idiots of the world again just doing their dumb dumb stuff again

tardy delta
#

discord those lil bastards

wet breach
tardy delta
#

what

wet breach
#

I don't know your discriminator but yet I don't need it to message you right now

#

at what point would I need to know those 4 numbers?

opal carbon
#

wait what non permanent invite

#

hasnt that been a thing forever on discord

tardy delta
#

i mean if you want to chat with people, just ask them for their name and num if thats what your trying to say

wet breach
#

otherwise you just join the server they are part of, and just right click their name XD

tardy delta
#

myes

opal carbon
#

what.

tardy delta
#

still dont get it but whatever

wet breach
#

do you ask for people's discriminators?

#

if not, that is my point

opal carbon
#

source pls?

tardy delta
#

so now you have to remember unique usernames instead :/

wet breach
tardy delta
#

so getting downgraded basically

#

smh

wet breach
#

they will revert this

#

yeah, because not everyone wants their server subject to community server guidelines when their server isn't for the community

#

so there will be a lot of people who won't use it, and just use a bot to refresh their links for them

tardy delta
#

i remember the times discord wasnt that shitty 🥲

pine forge
#

How can i enable/disable the end with the spigot api?

wet breach
#

its not about opinions, its about people using it or not

#

if they don't get the numbers in regards to usage it will be reverted or removed or changed

#

what stuff?

pseudo hazel
tardy delta
#

lemme just write my own discord client 💀

#

without all the bloatware

#

gets banned

pseudo hazel
#

thats what discord thought when skype was dying

#

but it just blew up

wet breach
#

otherwise make your own discord client

tardy delta
#

ye not really informed about that

wet breach
#

mods have already spoken about that they are not seeking out those who use custom clients to ban them

tardy delta
#

i have no idea about their api :C

#

i know nothing about discords internals actually

wet breach
#

they have quite a few pages about it

#

as well as disclosing the limits you have to abide by

fringe yew
#

how do i change the version of my spigotmc plugin? (im stupid lmao)

wet breach
#

plugin.yml

fringe yew
#

on the page itself btw

wet breach
#

oh

fringe yew
#

yeah lmao

wet breach
#

you just put it as part of the plugin file name

fringe yew
#

oh wait just found it

tardy delta
#

every time i see an electron app i want to find an alternative 💀

fringe yew
#

i love electron <3

#

best thing to ever exist

tardy delta
#

its a piece of bloat shit

wet breach
#

I have never seen a single electron app be better then a native one

tardy delta
#

better use webassembly or whatever that stuff is called

wet breach
#

nor have I seen it being more optimal actually quite the opposite

fringe yew
#

isn't discord electron?

#

also

tardy delta
#

yes

fringe yew
#

offtopic lmao

tardy delta
#

nobody cares

fringe yew
#

true

#

just dont wanna get in trouble lmao

shy rock
#

I made custom mob spawns and /kill @e doesnt kill them, they don't count as entities? Is there a way to kill them with a command

wet breach
#

and because of that, it consumes anywhere between 200mb-1gb of ram because why not lmao

tardy delta
#

electron runs on a nodejs runtime right?

#

or a chromium engine or smth

wet breach
#

chromium

#

which has a JS engine

tardy delta
#

js not really a fun thing

chrome beacon
wet breach
#

the only downside of your own client

tardy delta
#

well definitly been worse before

wet breach
#

is that the rate limit is lower then the vanilla discord client

tardy delta
#

ah smh

wet breach
#

that is, vanilla client has preferential treatment in regards to the API

chrome beacon
#

Spoof vanilla client

#

?

tardy delta
#

but what does that concretely mean?

#

you can just send your messages like normal no?

wet breach
#

yes

#

just sometimes you might receive slower

#

because of rate limit

tardy delta
#

even slower

#

those bastards

wet breach
#

the mods have said as long as the client abides by the rules, people who use it are not at risk for being banned

tardy delta
#

is discord just http requests tho?

wet breach
#

yes

tardy delta
#

uh oh

#

so like receiving json objects...

wet breach
#

yep

#

and sending

wet breach
#

that is why the vanilla discord client using upwards of 3GB is quite dumb when its just a bunch of rest api stuff

kind hatch
#

Tell me about it.

tardy delta
#

ye welcome to electron

wet breach
#

also, you are not allowed to implement all features from the vanilla client either

tardy delta
#

node_modules heeheehee

wet breach
#

more specifically, the nitro stuff

tardy delta
#

like those themes and stuff? just use custom css

#

or some other styling if you dont use electron

#

im quite happy with my theme

near valve
#

Hello, I have a problem with config detection. Namely, the issue is that it doesn't seem to read the config from the Main class.


package rpg.drop.main;

import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

import rpg.drop.drop.Drop;
import rpg.drop.drop.Mobsdrop;

public class Main extends JavaPlugin {
    FileConfiguration config = getConfig();
    public static Main main;
    
    public void onEnable() {
        
        main = this;
        config.addDefault("Anivoz", true);
        getConfig().options().copyDefaults(true);
        saveConfig();
        
        getServer().getPluginManager().registerEvents(new Drop(), this);
        getServer().getPluginManager().registerEvents(new Mobsdrop(), this);        
    }
    
    public static Main getMain() {
        return main;
    }

}
#

        if(entity instanceof Zombie) {
            if(entity.getCustomName().equalsIgnoreCase("Test")) {
                if(entity.getKiller() instanceof Player) {
                    Player k = entity.getKiller();
                    e.getDrops().clear();
                    if (executeWithChance(100))
                    {
                        k.sendMessage("§8§l[§e§lDROP§8] §7Cos wypadlo z tego potwora...");
                        if (plugin.getConfig().getBoolean(k.getName(), true))
                        {
                            k.sendMessage("Wpadlo do eq");
                        }
                        else {
                            e.getDrops().add(new ItemStack(Material.DIAMOND_BLOCK, 1));
                        }
                    }
                }
            }
        }```
#

JAVA if (plugin.getConfig().getBoolean(k.getName(), true)) It doesn't detect it for me

quaint mantle
#

Any errors

#

And show the config

near valve
#

I don't have errors, it just sort of doesn't detect the player's nickname in the config.

#

Config yml

quaint mantle
#

could it be that the players name is not in the config?

tardy delta
#

does it actually trigger

near valve
#

Not possible, I have my nickname in the configuration and it does not activate this event, also it does not activate this event e.getdrops

near valve
zenith gate
#

is there a way to add to an attribute? Like the item would already be set, have all the attributes, but if the item were to be upgraded, how could I add 5 to the damage attribute?

I was looking into the getAttribute, and its just kind of confusing me.

agile anvil
#

if you want to set the attack damage of a certain item, you could write a listener for EntityDamageByEntityEvent, then check that the entity doing the damage is a player, and that the item they are holding is the item you want to modify, then use event.setDamage() to set the damage

zenith gate
#

I'm thinking more of like actually modifying the weapon. Like I have this sword, that has a movement speed increase, and a smalled damage, only 3 hearts. I have an upgrade slate, that the player can drop on any weapon or armor piece, that will increase damage, by 5, and movement speed, by 2%. I just dont know how to add onto an attribute, instead of it creating a whole new one. becase right now, it just

+3 Attack damage

  • 12 Attack damage

takes the original attack damage from the weapon which is an iron sword that has 7 attack damage, it adds 5 onto that, and makes a new attribute so it looks like that above. I think I was just creating a new attribute and adding it again, isntead of editing the one that was already made.

dry forum
#

is there not a way to get a bukkit color using a string?

marsh burrow
celest sonnet
#

how do i use my plugin with a different version of a spigot server?

remote swallow
#

does it use nms

celest sonnet
#

no

chrome beacon
#

Then depend on the oldest version you want to support

remote swallow
#

you just develop for the lowest version you want to support

celest sonnet
#

i see

chrome beacon
#

oh and set api-version to 1.13 in plugin.yml

sour folio
#

how do you come up with project ideas?

river oracle
#

walk around and write shit down on a notepad

#

their is an entire spigot thread on this

#

lemme see if I can find it

chrome beacon
#

I have a giant txt file

sour folio
chrome beacon
#

I haven't used a single idea on it though

#

I generally find a new idea before finishing the old project

remote swallow
#

i just ask chatgpt

#

or coll

#

depends how im feeling

river oracle
#

How do you commit git stuff on intellij with the buttons

#

this UI is too different from VSC i'm panicking guys

chrome beacon
#

I just use commands or Github desktop