#help-development

1 messages Β· Page 1013 of 1

fossil flax
#

is there a way to get the client brand like fabric, forge, lunar client, badlion?

chrome beacon
#

You can use a packet listener for that

#

ProtocolLib or PacketEvents should help

lilac dagger
#

but not sure if all let you know this

#

i'm sure for forge

chrome beacon
#

They do

#

though anyone with malicious intent would disable it

lilac dagger
#

wait, why?

#

hacks?

alpine urchin
#

basically the brand shouldn't be trusted, it's just what the client claims to be.

lilac dagger
#

yeah i know this

alpine urchin
#

telling imyuvi

fossil flax
#

i need just a way to get the client name, i checked some plugins with api but found nothing

#

i know vulcan anticheat have a client detector in it but can't find the api

alpine urchin
#

unfortunate, but vulcan offers the API as an external jar

#

that you can download

#

it's not properly hosted

fossil flax
#

i don't know how to add external api, im not an expert, just started coding

lilac dagger
#

the impl must be inside the anti cheat

#

but as far as i know its obfuscated

#

maven?

alpine urchin
#

it has an api

#

as a jar

#

that you download in some specific channel

lilac dagger
#

you can add jars as dependencies in maven

alpine urchin
#

are you a customer of vulcan?

fossil flax
#

i have the jar but i don't know how to add it in the pom cause i don't know the artifacts id

fossil flax
alpine urchin
#

then just make a ticket and ask them

#

for help to use it

fossil flax
#

ill try, thanks

sour dragon
#

Hey, i'm facing a issue,
every X time (presave + task) i'm calling setRanCm(bukkitPlayer.getStatistic(Statistic.SPRINT_ONE_CM)); to save the sprinted distance of a player (we calculate stuff with this), upon joining I set the statistic to that value (i have multiple worlds etc.)

But sometimes the statistic is randomly 0, is there in minecraft any way that statistic can get 0 by itself?

#

Its also only the SPRINT_ONE_CM statistic that can get 0, even though i save more stats (swimming, flying etc.) and those dont get reset

eternal oxide
#

Stats are per world

sour dragon
#

Yeah i know, so that why i'm saving them and setting the stat upon the player joining the world, but sometimes i make a getStatistic call and then it is randomly zero

eternal oxide
#

perhaps you get it mid teleport or something?

wet breach
#

or if they never been to that world

#

it would be 0 as well

eternal oxide
#

There is no reason for teh sprint stat to reset unless you, or someone else resets it

wet breach
#

or a plugin is doing something

#

also that reminds me, arn't the number stats ints @eternal oxide ?

eternal oxide
#

Yes

wet breach
#

so technically it can flip

sour dragon
#

hm

#

thats a good one

eternal oxide
#

True, if it gets big enough

sour dragon
#

I'll ask my players if they have any guess how many they approx ran before it resetted

eternal oxide
#

just log the stat values for a bit

drowsy helm
#

Should keep some sort of buffer and if the difference is over some threshold, ignore it

wet breach
#

also idk how mojang does the code, but since the stat can't be negative, that means it can only store half the numbers

#

since Java doesn't have an unsigned int

eternal oxide
#

if you have backups you can check. stats are all in json files

lean pumice
#
[12:18:22 WARN]: java.util.ConcurrentModificationException

[12:18:22 WARN]:        at java.base/java.util.ArrayList$SubList.checkForComodification(ArrayList.java:1415)

[12:18:22 WARN]:        at java.base/java.util.ArrayList$SubList.indexOf(ArrayList.java:1265)

[12:18:22 WARN]:        at java.base/java.util.ArrayList$SubList.contains(ArrayList.java:1276)

hey, i am creating my bw plugin but if you remove from the team the player and then you do at the players the .isEmpty or contain, it get error. The code is in sync so i dont know why i get the error

sour dragon
eternal oxide
#

you can not modify a Collection you are looping

lean pumice
drowsy helm
#

He explained pretty clearly

eternal oxide
#

It looks like you are looping over a Collection and modifying it at teh same time

drowsy helm
#

While you are looping over a collection, you cant modify it

drowsy helm
#

Show your code

tall dragon
#

that dont matter

eternal oxide
#

makes no difference

tall dragon
#

sync or async. u cannot modify a collection you are looping over

lean pumice
#

?paste

undone axleBOT
wet breach
#

use an iterator, or change how you are doing it

eternal oxide
#
for(Element e: collection) {
collection.remove(e); //<- throws CME
}```
lean pumice
tall dragon
#

so we can see which class it comes from

lean pumice
# tall dragon so we can see which class it comes from

[12:18:22 WARN]:        at java.base/java.util.ArrayList$SubList.checkForComodification(ArrayList.java:1415)

[12:18:22 WARN]:        at java.base/java.util.ArrayList$SubList.indexOf(ArrayList.java:1265)

[12:18:22 WARN]:        at java.base/java.util.ArrayList$SubList.contains(ArrayList.java:1276)

[12:18:22 WARN]:        at dev.bsbedwars.it.team.Team.contain(Team.java:66)

[12:18:22 WARN]:        at dev.bsbedwars.it.arena.component.ArenaScoreboard.game(ArenaScoreboard.java:60)

[12:18:22 WARN]:        at dev.bsbedwars.it.arena.component.ArenaScoreboard.update(ArenaScoreboard.java:31)

[12:18:22 WARN]:        at dev.bsbedwars.it.arena.component.ArenaScoreboard.run(ArenaScoreboard.java:128)

[12:18:22 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59)

[12:18:22 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:352)

[12:18:22 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:890)

[12:18:22 WARN]:        at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:412)

[12:18:22 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:815)

[12:18:22 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:648)

[12:18:22 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.lambda$spin$0(MinecraftServer.java:133)

[12:18:22 WARN]:        at java.base/java.lang.Thread.run(Thread.java:842)```
eternal oxide
#

being called from your ArenaScoreboard.java:60

#

That may not be sync by the looks

eternal night
#

✨ async/fast/supersonic ✨

eternal oxide
#

Didn;t provide that code so we can't see

lean pumice
#

is in sync

eternal oxide
#

what do you have that is NOT sync?

lean pumice
#

only async is the generator

eternal oxide
#

Are you sure you are not firing your kill event async?

lean pumice
#

@eternal oxide you can come in genral-1?

eternal oxide
#

Be certain, super(false)

lean pumice
echo basalt
wet breach
#

that works too

lean pumice
eternal night
#

ArenaScoreboard.game is reading while something else is writing to the team's player collection

echo basalt
#

Why does it need to be a list πŸ€”

#

Sets.newConcurrentHashSet πŸ€”

tardy delta
#

thats like moving the issue

eternal oxide
#

Your Scoreboard code or some event is running async

#

you are reading and modifying yoru players List at the same time

#

either your death event is running async or your update of your scoreboard is

eternal oxide
#

no idea, is it?

#

possibly

#

You've not shown us any scoreboard code (even though I told you that was throwing the error), so I've had no reason to look at fastboard

lean pumice
lean pumice
#

but this is sync

#

i am tryng to do syncronized...

eternal oxide
#

yoru error is caused by TWO things, not just one

#

one of them is async

#

I looked though fastboard, it runs sync to whatever is calling it

#

?paste you ArenaScoreboard.java

undone axleBOT
eternal oxide
#

There is nothing in any of your code so far that would even need async

eternal oxide
#

yeah you are calling the update method async

sullen canyon
#

looks quite sync to me

eternal oxide
#

call your runnable sync not async

eternal oxide
eternal oxide
lean pumice
#

where i call it async?

sullen canyon
eternal oxide
#

when you start your ArenaScoreboard task you are doing it async

#

no its not

#

its thrown on a .contains

#

he's modifying the array in one thread and accessing in another

lean pumice
eternal oxide
#

just stop trying to do anything async

#

you do not need it

#

make your kill event sync

lean pumice
#

i have do e.isAstnc

#

and the result is false

eternal oxide
#

the error you posted was passed though your Scoreboard class

#

which is line 128, calling update() in yrou runnable

lean pumice
#

i have find this

#

@echo basalt the removeIf cause the ConcurrentModificationException

echo basalt
#

THat just means you have 2 threads accessing it

eternal oxide
#

Show us where you start your ArenaScoreboard task

#

Either your kill event is async or your ArenaScoreboard task is

lean pumice
eternal oxide
#

Just stop using ANY async. It will fix your error

alpine urchin
#

πŸ˜‚

umbral ridge
fickle mantle
#

Hey, I wanted to know how I can open an Anvil Inventory that can be used by a player.
I used player.openInventory(Bukkit.createInventory(null, InventoryType.ANVIL)); but with that the players can't use the anvil

chrome beacon
#

what version are you on

fickle mantle
#

1.20.4

grizzled cedar
#

Hello guys, is there a method to clear Block Damage (Block Breaking Animation) to a player?

umbral ridge
#

anvil gui class was never finished

fickle mantle
#

and how can I open an Anvil GUI then?

umbral ridge
river oracle
#

It is finished and works as intended

umbral ridge
#

really then why are there wrappers for it

umbral ridge
river oracle
river oracle
#

It can't handle it

fickle mantle
#

btw I just need the vanilla anvil functionality. No User Input or anything

river oracle
#

It's not unfinished it's just a bad system

river oracle
fickle mantle
#

my problem is that i don't have access to NMS because BuildTools won't work on my computer because of my wifi connection

fickle mantle
#

actually not but it isn't able to download everything from git

river oracle
#

Why's that?

#

Sounds like a possible BT issue unless your isp is weird

fickle mantle
#

we don't know. Me and 3 other guys here on the discord tried to fix the issue for like 3 hours and nothing worked

river oracle
#

Interesting

#

Alright well give me like 20 minutes I can write you something

fickle mantle
#

would be very nice, thank you :)

river oracle
fickle mantle
#

it was like last year

river oracle
#

Sorry not at pc rn so can't search

#

Ohh we've updated bt a lot try again quick

#

?bt

undone axleBOT
fickle mantle
#

I can try

river oracle
#

This time there is a maintainer actually knowledgeable about it outside of md

#

Use the gui

#

If your on windows

fickle mantle
#

same error as last time

river oracle
#

Send me a paste I'll post it in a thread quick

fickle mantle
#

wait but it says failed to download but it still does something

river oracle
#

?paste

undone axleBOT
fickle mantle
#

it failed

river oracle
fickle mantle
#

yeah

river oracle
#

Ok thanks

river oracle
fickle mantle
#

windows

river oracle
river oracle
#

@fickle mantle do you have git installed on your local machine?

fickle mantle
#

yeah

river oracle
#

First make sure this link opens in your web browser https://hub.spigotmc.org/stash/scm/spigot/builddata.git
run this separetly git clone https://hub.spigotmc.org/stash/scm/spigot/builddata.git

river oracle
#

does it work or do you get the timeout error?

fickle mantle
#

you mean when I try cloning it manually?

river oracle
#

yeah

fickle mantle
#

wait

river oracle
fickle mantle
#

25mbits

river oracle
#

alr I'm testing something gimme a sec

#

are you trying to build latest? otherwise this might not work

fickle mantle
#

yep

river oracle
#

ok

river oracle
# fickle mantle yep

do me a favor in your terminal run git config --get http.postBuffer if there is an output send it here

fickle mantle
#

nothing

river oracle
#

alr

kind hatch
#

Maybe try git clone --depth 1 https://hub.spigotmc.org/stash/scm/spigot/builddata.git
Just to see if it can even pull anything down.

fickle mantle
#

Okay i'll try

#

same error

#

now it worked xD

river oracle
#

when is the last time you updated git

#

iirc windows doesn't auto update it

chrome beacon
#

it doesn't

#

but you can use winget

fickle mantle
river oracle
#

mm yeah that should be fine

#

you could try increasing your buffer size, but given the error idk if that's for sure to help

fickle mantle
#

how do I install buildtools manually? I downloaded builddata bukkit and spigot

river oracle
#

you need the .git folder for BuildTools to recognize it

fickle mantle
#

ohhh

#

I just want to open an anvil inventory :(

river oracle
#

I can help you with that, but I believe fixing this has benefits :P running BuildTOols in the future would be nice

#

I'll try one last thing here
git config --global http.postBuffer 524288000 try running this than rerunning buildtools

kind hatch
#

What's the output of git --version?

river oracle
#

git config --global --unset http.postBuffer run this if that doesn't work

fickle mantle
#

2.43.0

river oracle
#

latest is 2.45.1 that should be a non issue its 2 minor versions out of date

river oracle
fickle mantle
#

It works

#

no it doesnΓ„t

river oracle
#

πŸ’€

fickle mantle
#

Task exited with error code 1

river oracle
#

same error?

#

send it

#

the log that being

#

?paste

undone axleBOT
fickle mantle
#

Tag mismatch same error as last year

river oracle
#

what the fuck OpenSSL does not like you

#

if you don't mind what country are you from

fickle mantle
#

germany

river oracle
#

okay that should be a non issue

eternal night
#

are you behind some proxy?

fickle mantle
#

no

#

but my connection is really weird

river oracle
#

I smell shitty ISP configuration

eternal night
kind hatch
#

Maybe try the --disable-cert-check?

river oracle
#

could also disable HTTPS to

#

that might help going unencrypted seems to be the way here

fickle mantle
#

same error

river oracle
#

have you tried a VPN

#

before

fickle mantle
#

nope

river oracle
#

idk if you have one, but like I smell so much shitty ISP off of this

fickle mantle
#

dont have one

kind hatch
#

Windscribe is free. 10GB/mo

river oracle
#

well whatever for now your ISP needs to get their act together...

kind hatch
#

Another attempt on another machine or connection would give much more information.

river oracle
#

@fickle mantle I'm going to throw together a library for you :D

fickle mantle
#

I reran it 2 times now it downloaded that mojang thing

kind hatch
#

That seems to be a common issue with really bad connections.

fickle mantle
#

my connection is really bad

#

it crashes almost every 5minutes

eternal night
#

gg

kind hatch
#

What's your speed?

fickle mantle
#

26

eternal night
rough drift
#

Is there a way to get a potion effect by it's actual ID? like "minecraft:nausea" instead of PotionType.CONFUSION

kind hatch
# fickle mantle 26

But do you frequently run into stutters or large hitches in your connection?

fickle mantle
#

No

#

the problem is not the speed my connection is just really unstable

kind hatch
#

You using wifi or ethernet?

fickle mantle
#

wifi

kind hatch
#

And your ISP has a direct line to your house right? Or are you using one of those wireless modems?

fickle mantle
#

yeah i t has a direct line

kind hatch
#

Can you try plugging in ethernet and seeing if there is a difference?

fickle mantle
#

don't have a cable for that

quaint mantle
#

Most of consumer ISPs limit traffic outside of its country so good luck with that.

kind hatch
#

Well then a VPN is the only other option at this point in time.

fickle mantle
#

But actually I don't need BuildTools rn. Could you please help me opening an Anvil Inventory that works? :D

fickle mantle
#

thank yoouuuu

olive lance
#

Does anyone here use startAllBack

brittle geyser
#

Why both ItemMeta#getDisplayName() and ItemMeta#getLocalizedName() returns null? (or empty string)

        ItemMeta itemMeta = item.getItemMeta();
        if (itemMeta != null) {
            this.name = itemMeta.hasDisplayName() ? itemMeta.getDisplayName() : itemMeta.getLocalizedName();
        }

api-version: 1.13

grim hound
#

has anyone ever sent raw data packets?

kind hatch
echo basalt
brittle geyser
echo basalt
#

If the display name isn't set the client defaults to the material's translatable component

brittle geyser
#

Thanks

inner mulch
#

when i create 16 threads, create a method #runTask(Runnable runnable) and the method chooses which thread has the least amount of stress, will this then be peak async programming, or is this idea stupid?

eternal night
#

"thread has the least amount of stress" is not a thing

#

a thread either is working or not

#

what you are describing is just a thread pool tho KEKW

inner mulch
#

yeah but the thread with the least amount of tasks in the queue

eternal night
#

you have a central queue

#

not one you divide up onto threads

wet breach
inner mulch
#

how?

#

what does async mean then

eternal night
#

When you run something asynchronously it means it is non-blocking, you execute it without waiting for it to complete and carry on with other things. Parallelism means to run multiple things at the same time, in parallel. Parallelism works well when you can separate tasks into independent pieces of work.

#

this is what stackoverflow said

wet breach
#

That is pretty accurate there

orchid hinge
inner mulch
#

isnt a thread pool kinda bad, if i have a system and the pool shares the tasks between threads, it willl end in a mess?

eternal night
#

shares the tasks?

wet breach
#

you don't share tasks between threads at least not ideally

inner mulch
#

what does a thread pool do, then :(?

wet breach
#

Each thread has a queue, this is its work queue

inner mulch
#

i thought i was sharing tasks amongst threas

wet breach
#

you would have a master controller that assigns work to a thread. AKA thread pool manager. The manager also has the responsibility to remove threads or add threads as needed

#

your tasks would get assigned to a thread, and that thread will do its best to clear its queue

#

the goal is to never have a thread not doing work, if it doesn't have work ideally you want to remove the thread

#

exception here is to keep a minimum amount of threads open, maybe like 2 or 4 if there really is no work to be done that are idling and waiting

inner mulch
#

okay

wet breach
#

while you can add threads it should be noted that you should have a max amount of threads there can be, otherwise it starts to cause a negative impact as you continue to make threads

fickle mantle
#

Hey, can anybody help me with shading a maven dependency in intellij

river oracle
#

send your pom and the dependency you want to shade please

#

?paste

undone axleBOT
fickle mantle
chrome beacon
#

Don't use system path dependencies

#

if that's your plugin/api use mvn install on the project to add it to your local maven repo

#

also remove createDependencyReducedPom setting and update the shade plugin

river oracle
#

you should probably be setting your java to version 17 too

#

source and target should also be set to 17 once you do so

fickle mantle
#

so thats all I have to do?

chrome beacon
#

Don't forget to relocate the lib

#

or you might create conflicts

fickle mantle
blazing ocean
#

in my plugin.yml, how do I set the version to my plugin version set in my build conf?

chrome beacon
#

maven or gradle?

blazing ocean
#

gradle

chrome beacon
#

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

blazing ocean
#

lol

chrome beacon
#

I know blossom can do it

#

but there's probably a better way

blazing ocean
fickle mantle
blazing ocean
#

nvm it does

river oracle
#

your mistake is using the plugin.yml for commands

blazing ocean
#

i don't tho..??

#

lol

river oracle
#

what do you mean about permission support then

blazing ocean
#

i just have the permissions declared there

river oracle
#

why just do it in code

blazing ocean
#

is that even possible

river oracle
#

yes

blazing ocean
#

oh

#

how

blazing ocean
#

o

#

ok ty

river oracle
#

if you use reflection for commands you can also just use PluginCommand

#

instead of BukkitCommand and it handles registration for you for commands

blazing ocean
#

i use cloud

slender elbow
#

I use clown

river oracle
#

absolutely revoultionary

blazing ocean
#

how do I get the version of a plugin

#

oh nvm got it

copper nymph
#

Good luck, I wanted to ask for help, I want to create a server but I'm looking for spigot 1.8 up to the maximum version 1.20, would anyone have the link to download it or where can I get it.

chrome beacon
#

This channel is for developing plugins

copper nymph
#

thanks

slender elbow
#

I thought it was the "I refuse to learn basic java" channel

chrome beacon
#

that too πŸ’€

remote swallow
fair rock
quaint mantle
#

?paste

undone axleBOT
quaint mantle
fair rock
#

Tbh idk why the error but its the first time im seeing someone putting such a User-Agent, interesting tbh

quaint mantle
#

Could it be something related with character limit?

wet breach
fair rock
worthy yarrow
#

@quaint mantle might I also suggest to condense your ifs πŸ˜›

wet breach
#

error 400 means bad request. That means you are either using the wrong request method, or something is not right with your request

fair rock
#

Can you explain what you are trying to do?

quaint mantle
#

Doesn't post request allow you to send messages without hitting the limit?

quaint mantle
fair rock
#

Does something where?

quaint mantle
#

In-game of course

#

Like a command execution

fair rock
#

Notification on discord?

quaint mantle
#

Right, like a webhook notification

fair rock
#

But yours is spigotmc?

quaint mantle
#

I know

#

I removed the url

brittle geyser
#

How to get files from plugin resources folder?

fair rock
#

MAIN.getResource("languages/en.yml");

brittle geyser
#

i replaced \ into / and it works! Thanks!

fair rock
# quaint mantle I removed the url

To most funny part is, i decompiled a proxy plugin from a friend who cant code and he used the same API as you πŸ’€ And its working
Now im fucking confused

#

?paste

undone axleBOT
fair rock
#

Lmao

quaint mantle
fair rock
#

ik

quaint mantle
#

What have I done wrong? 😭

#

Or is it Discord being weird? πŸ€”

golden turret
#

i have this code to increase the experience of a pickaxe and i have an explosion enchantment which breaks a 3x3x3 area and calls the BlockBreakEvent for each block. The problem is when the pickaxe is not cached yet. When the pickaxe is not cached, i cancel the event and load it from the dao asynchronously. Due to its async nature, i get an race condition, where instead of getting the 27 xp, i can get like 1, because it had 27 completablefutures but only 1 of them was able to store it in the cache

#

how can i fix this race condition?

#

the explosion enchantment

eternal oxide
#

why are you getting it async from teh dao? It's in game and active you should have the data already loaded

quaint mantle
#

Is it me or the does picture not load?

shadow night
golden turret
fair rock
golden turret
quaint mantle
golden turret
#

so there is no way i can all pickaxes at once

eternal oxide
golden turret
#

the client may have an auto miner block that uses the item

#

in all cases, i need to load the pickaxe

eternal oxide
#

its still in game, in an inventory. Data shoudl already be loaded

golden turret
#

but not in my plugin

eternal oxide
#

you shoudl never be requesting data for an item which is in game

golden turret
#

but i am

eternal oxide
#

Yeah

golden turret
#

and how can i fix the race condition?

tardy delta
#

instead of using a simple listener method

golden turret
#

i never faced a race condition, so i really need to know how to fix one

eternal oxide
#

Yours is not really a race condition. Well kinda, you cant predict which will finish first

#

So Don't!

#

actually, delay your explosion event until the next tick

fair rock
#

Gambling addiction on a weird level. Which on finished first. Thread 1 or 2πŸ’€

golden turret
#

i tried to cache the completablefutures for each key like this:

private final Map<K, CompletableFuture<V>> futures = new ConcurrentHashMap<>();

public CompletableFuture<V> readAsync(K key) {
  return futures.computeIfAbsent(key, super.readAsync(key)).whenCompleted((data, throwable) -> futures.remove(key));
}```
It made the amount of xp be close to 27, but not exactly 27
eternal oxide
#

But as Silver said, it's a gamble, you could chain your Futures

inner mulch
eternal oxide
#

^ always

#

If its in game teh data should be too

tardy delta
#

use thenRun btw

golden turret
echo basalt
#

Put your explosion in an "action queue"

eternal oxide
echo basalt
#

Or get your data before letting players break blocks

inner mulch
golden turret
#

but the explosion enchantment spams the blockbreakevent

#

and here i dont let the player break the block while the pickaxe is not loaded

echo basalt
#

your pickaxe cache should be responsible for getting stuff from the DAO let's begin with that

#

fetching data from the DB has no business being in a listener

golden turret
#

ok

#

but would that fix the problem?

eternal oxide
#

if you don't allow breaking until the data is available there is no explosion

#

no explosion, no multiple block break events

#

If your explosion happens it means you must have got the pickaxe data

#

or you are not actually caching it properly and getting it fresh every time

fair rock
#

I saw 4 images and 3 different implementations of a BlockBreakEvent, a new record. Thats fun

grim hound
#

Because they don't require compression as they're already compressed

#

And version data is correct because it was transformed with ViaVersion's api

#

Cuz I get "DataFormatException: invalid header check"

#

And the client disconnects

brittle geyser
#

can i copy paste apache commons code in my project?

tardy delta
#

at the end of the day, who cares

chrome beacon
fair rock
# alpine urchin erm

its that just like a sound effect like "wtf you saying?" or database related xd

tardy delta
#

former

quaint mantle
#

Ehm what the sigma

tardy delta
shut field
#

on PlayerMove I am doing player.stopSound(Sound.BLOCK_WOOD_STEP) but I still hear it

#

how do I make it so that it doesn't play the sound when the player walks on a wood block

quaint mantle
#

Moving sounds are client side

shut field
#

does that mean it needs a resource pack to get them not to play

#

i don't even know how to do that

oak mica
#
        this.target = this.targetType != Player.class && this.targetType != ServerPlayer.class ? this.mob.level().getNearestEntity(this.mob.level().getEntitiesOfClass(this.targetType, this.getTargetSearchArea(this.getFollowDistance()), (entityliving) -> true).stream().filter(entity -> entity.getBukkitEntity().getPersistentDataContainer().getOrDefault(Overcharged.WARDEN, PersistentDataType.STRING, null) == null ? true : !(entity.getBukkitEntity().getPersistentDataContainer().getOrDefault(Overcharged.WARDEN, PersistentDataType.STRING, "").equals(this.mob.getBukkitEntity().getPersistentDataContainer().get(Overcharged.WARDEN, PersistentDataType.STRING)) || Shard.getSummoningMobs(Overcharged.getPlayerShard(Bukkit.getPlayer(UUID.fromString(this.mob.getBukkitEntity().getPersistentDataContainer().get(Overcharged.WARDEN, PersistentDataType.STRING)))).getItemMeta()).contains(entity.getBukkitEntity()))).toList(), this.targetConditions, this.mob, this.mob.getX(), this.mob.getEyeY(), this.mob.getZ()) : this.mob.level().getNearestPlayer(this.targetConditions, this.mob, this.mob.getX(), this.mob.getEyeY(), this.mob.getZ());
``` new n improved btw
pseudo hazel
#

where is the formatting

young knoll
#

The syntax highlighting just gave up

grim hound
oak mica
oak mica
tardy delta
#

needed to see for myself

eternal oxide
#

Someone trying to avoid local variables?

#

or just make it as unreadable as possible

tardy delta
#

torvalds wouldnt be happy with the nesting of that code

tardy delta
alpine urchin
#

richard would, it's ok

#

richard > linus

#

as long as its free

#

its good

tardy delta
#

richard is a legend, linus is a legend of some kind

alpine urchin
#

i appreciate that u think richard is a legend

tardy delta
#

i mean just read his email conversations

alpine urchin
#

man linus seems mean

#

who tells their users

#

things he says

tardy delta
#

tf discord

#

turns out i need a ##

young knoll
#

Do you want to search in verified, verified, verified, or verified

alpine urchin
#

or verified-staff

#

ops]

remote swallow
#

verified staff isnt a thing

alpine urchin
#

how do you know

#

are you admitting to use betterdiscord

remote swallow
#

bc ive seen colls screen

alpine urchin
#

then we dont know

tardy delta
young knoll
#

Didn’t better discord ban those types of plugins

#

Because discord said no

remote swallow
#

ye

alpine urchin
#

oh damn

#

cant discord just

#

prevent it

young knoll
#

Maybe discord should just not send channels you don’t have access to

alpine urchin
#

selectively send the data

#

yea

tardy delta
#

got clients that showed me all staff channels

#

unfortunately without their content

alpine urchin
young knoll
#

They don’t send the content thankfully

tardy delta
#

ah he just yells at people

young knoll
#

But idk why they send the channel at all

alpine urchin
#

he once told a user they were too dumb that they probably were unable to reach their mother's tit to suck on

tardy delta
#

ahahaha classic torvalds

alpine urchin
#

he was confronted on it

#

and he fumbled

#

uhhhhhh uhhhhh i don't care πŸ€“

tardy delta
#

why even would he

#

he got better things to do

alpine urchin
#

well clearly not

#

if he has time to respond to his users like that

#

i mean, i don't have the context

tardy delta
#

i mean..

alpine urchin
#

but if he does it unnecessarily

#

then its just lame

#

like out the blue

#

but yeah id love to lash out on my users time to time

tardy delta
#

elon also got better things to do and does the same thing

alpine urchin
#

as well

#

yeah but in my impression elon doesnt do it

#

out the blue

tardy delta
#

he doesnt yell at them, just replies to random people

alpine urchin
#

if i lash out on someone i'd need a good reason for that

#

so does linus

#

read all the emails

tardy delta
#

love it how he yells at kernel contributors

quaint mantle
#

can anyone help me with znpcs plugin?

tardy delta
#

help in what way?

quaint mantle
#

i want to do /znpcs action 1 add CONSOLE mvtp %player_name% Survival

#

but appears "Hey!, The inserted number/id does not look like a number"

river oracle
oak mica
nova notch
#

now this is efficient line usage

regal scaffold
#

Hey guys, hope you're doing well.

Trying to make a plugin now but seems like it's taking as a paper-plugin and it loads way too early, where is the place so I can change this and make it a normal bukkit plugin

young knoll
#

Don’t use paper-plugin.yml

regal scaffold
#

am not, just plugin.yml

remote swallow
#

holy shit hes back

regal scaffold
#

Hey Ebic! How you been

remote swallow
#

good good, hbu

regal scaffold
#

Very good indeed

#

irl jobs is sick

#

Wanted to have a bit of my own time and do some mc

remote swallow
#

?paste ur plugin.yml

undone axleBOT
regal scaffold
#

I checked the jar and it has a plugin.yml file in it's root, where it should be, this message is showing literally almost at the start of the entire server startup, like it's trying to load all the way before

#

Empty plugin ebic

#

On it

young knoll
#

Does it occur on spigot

regal scaffold
#

Hope i'm not this rusty

#

On spigot server jar?

alpine urchin
#

?whereami

alpine urchin
#

i couldn't wait

regal scaffold
#

lmao Im well aware where we are

#

But i feel this is a me error, not a server jar error

remote swallow
#

remove load postworld and check again

alpine urchin
#

it's equal to postworld

#

by default

young knoll
#

I mean it may be a you error

#

But not one related to our software

regal scaffold
#

I am still using the spigot api to develop

alpine urchin
#

maybe you're exporting your jar wrong

regal scaffold
alpine urchin
#

what are you using as an IDE

regal scaffold
#

I thought about that, but i checked the contents

#

intellij

alpine urchin
#

are u using maven

regal scaffold
#

yes

alpine urchin
#

what task are you using

#

to build

regal scaffold
#

mvn clean install -PexportToServer

#

I also did try maven jar

alpine urchin
#

i use mvn package

regal scaffold
#

What's weird is that if i decompile the plugin it shows perfectly

alpine urchin
#

on my maven projects

regal scaffold
#

Will try

alpine urchin
#

but i dont think it'll make

regal scaffold
#

Oh god here we go again... Invalid signature file digest for Manifest main attributes

alpine urchin
#

a difference

#

hm

remote swallow
#

upload ur jar here

alpine urchin
#

XD

regal scaffold
#

Is using install good?

alpine urchin
#

Nooo guys we will steal his holy code!

regal scaffold
#

I get 2 generated

#

omg yes!!! holy code!!

remote swallow
#

install and package do the same thing

young knoll
#

install also installs it to mavenLocal

#

Iirc

remote swallow
#

use the jar with no prefixs or suffixs

remote swallow
alpine urchin
#

install also calls package

#

according to research

#

so

#

yea

eternal oxide
#

install fills up your maven local with multiple copies

regal scaffold
alpine urchin
#

bro could use this as an opportunity to spread a virus

young knoll
#

I should clear my maven cache

eternal oxide
#

package is correct, unless you want to access it as a local dependency

regal scaffold
#

I did not miss on the opportunity

#

jk

alpine urchin
#

framed

regal scaffold
#

rip

#

What's strange is that the thing complains about no plugin.yml and i can very clearly see a plugin.yml where it should go

#

This error also usually indicates that you're bundling a signed jar inside your plugin jar file

#

What am I even doing here lmao

#

Like why is this a thing

broken nacelle
remote swallow
#

somethings fucked in ur build

alpine urchin
#

oh fr

regal scaffold
#

I can see that LMAO

alpine urchin
#

XD

regal scaffold
#

It's a fking default project

remote swallow
#

ur main class is in files

regal scaffold
#

How did I already fuck up maven already

remote swallow
#

?paste ur pom

undone axleBOT
alpine urchin
#

come to gradle

#

my friend

regal scaffold
#

I was in gradle

#

Before I took a break

alpine urchin
#

but it's more beneficial to understand the issue

#

so you can learn

#

and not run away from your problems

regal scaffold
#

Indeed, I already use gradle on day to day

#

Learning is fun

#

I guess i deserve the error for using @tender shard archetype plugin

remote swallow
#

check the jar thats in /target/

young knoll
#

But I love running from my problems

regal scaffold
#

After running mvn clean install

alpine urchin
regal scaffold
#

Got those

remote swallow
#

use the one with no prefix

alpine urchin
#

it doesn't look like it

regal scaffold
#

That's the one I sent in here

#

Also the one Im using

remote swallow
#

tf fook

regal scaffold
#

Shits 30 kb

#

Like why

#

What the fuck am I even doing

remote swallow
#

remove minimize rq

blazing ocean
regal scaffold
#

Don't even need adventure lmao

#

Why did i even add it

young knoll
regal scaffold
#

@remote swallow

#

The jar without original is now 2mb

#

LMAO

remote swallow
#

maven decided to remove everything

regal scaffold
#

Ok no

#

It's time

#

To remake the pom

remote swallow
#

convert to gradle, all issues solved

regal scaffold
#

Yes but where is the learning bro

young knoll
#

Maven has decided your code is bad

regal scaffold
#

Also btw

remote swallow
#

dont need to learn

regal scaffold
#

What version do you use on machine to compile?

#

Cause i think 21 is not the move

remote swallow
#

lowest you want to support

#

for 1.20.1 use 17

regal scaffold
#

Here we go, now gotta install java 17 on a m3

#

good fucking luck

remote swallow
#

?java17

undone axleBOT
remote swallow
regal scaffold
#

Oh goodness

#

You are a savior

alpine urchin
regal scaffold
#

wait no

#

m3 is arm

#

not x64 or aarch

#

oh wait

#

I forgot arm is the same as aarch64

#

Ok

remote swallow
#

i think ur first issue was mac

regal scaffold
#

You're just upset I can run anything at the same time with 10% cpu usage

#

πŸ™‚

remote swallow
#

couldve got a framework

regal scaffold
#

I have both now, beast windows, beast mac

remote swallow
#

damn

regal scaffold
#

No thanks

remote swallow
#

now its time to linux

regal scaffold
#

mac is linux

#

jk

#

WSL

remote swallow
#

arch linux

regal scaffold
#

Is perfect

#

No thanks

#

I use linux on cloud environments, no need for pc just for that

#

Wanna see my mac setup?

remote swallow
#

sure

regal scaffold
#

what

#

the

#

fuck

#

?

remote swallow
#

nice

#

discord cant render heic its too high qual

regal scaffold
#

Yeah I figured

remote swallow
#

the fact theres a bezel in the center hurts my eyes

regal scaffold
#

Windows setup is 3 of the same monitors but standing desk

young knoll
#

Sad little laptop connected to 2 giant monitors

regal scaffold
#

LMAO the birghtness of the laptop

remote swallow
#

also that laptop is so bright

regal scaffold
#

mac liquid retina

#

Is pretty wild

young knoll
#

It makes your retinas into liquid

regal scaffold
#

100%

remote swallow
#

behind your eyes could be full of eyelashes

regal scaffold
#

12% system usage btw

#

No clue how this is possible

remote swallow
#

bet thats fun

regal scaffold
#

When i do mobile, i can get like 8 emulators at the same time with 20% usage

remote swallow
#

my pc has decided a vm is going to use 90% of my cpu randomly

regal scaffold
#

That's the beauty of vm

young knoll
#

Imagine if it’s just lying

remote swallow
#

no its not

#

my pc dies when it starts doing it

#

i cant do shite

regal scaffold
#

lol

young knoll
#

β€œYeah man your cpu is at 12% usage trust me”

remote swallow
#

maybe its time to reinstall windows

regal scaffold
#

I mean

young knoll
#

Meanwhile the cpu:

regal scaffold
#

It's actually cold

#

Fans are barely on

#

idk how they do it

#

but M chipset is actually insane

#

@remote swallow

#

Help me convert this pom to gradle

#

Empty gradle practically

#

actually nah

#

I will make maven work

storm crystal
#

how can I make my plugin create file in the same folder as it is in? as in, in ./plugins? im trying to create json file but I cant find it anywhere

#

im using jackson for that

young knoll
#

Plugin#getDataFolder

remote swallow
# regal scaffold Help me convert this pom to gradle
plugins {
    id("com.github.johnrengelman.shadow") version "8.1.1"
    id("net.minecrell.plugin-yml.bukkit") version "0.5.3"
}

group = "com.tomisanhues2"
version = "1.0.0"

repositories {
    mavenCentral()
}

dependencies {
    compileOnly("org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT")
    implementation("org.spongepowered:configurate-yaml:4.0.0")
}

tasks.shadowJar {
    this.archiveClassifier = ""
    this.archiveVersion = ""
    archiveFileName = "${project.name}-${project.version}.jar"
}  

bukkit {
    name = "MytherialHealthData"
    version = project.version.toString()
    main = "com.tomisanhues2.mc.HealthData"
    apiVersion = "1.20" // LATEST
}
regal scaffold
#

Ah shit lmao

#

Ok fine, lets hot swap a minecraft plugin project

#

deleting the maven stuff and adding the gradle stuff

#

What could possibily go wrong

remote swallow
#

after its done delete .idea and reopen it otherwise it thinks maven files still exist

regal scaffold
#

Ah ok

#

Just do everything manually?

young knoll
#

Configurate?

remote swallow
#

id say its probably easiest to run gradle init then modify the build file

#

also thats gradle kotlin

young knoll
#

Is spigots config api not good enough for you? Smh

regal scaffold
#

Ok

lilac dagger
#

does netbeans not have project configs?

#

i think eclipse does too

sullen marlin
#

nope, it just uses the pom.xml

lilac dagger
#

altho i don't remember seeing anything maven related while i looked in the idea folder

storm crystal
#

it works...

#

...kinda

#

I forgot the / lmao

remote swallow
#

use Plugin#getDataFolder

young knoll
#

You should use the constructor that takes a file and a string

storm crystal
#

thats what I did

regal scaffold
young knoll
#

new File(Plugin#getDataFolder, β€œfart.txt”)

storm crystal
#

oh

#

so there is a better way to do it

#

okay

regal scaffold
#

Looking good now @remote swallow ?

remote swallow
storm crystal
#

neat

regal scaffold
#

Will try now, empty file

storm crystal
#

how can I remove legacy .yml files that appear in my plugin's jar file?

#

not the plugin.yml ofc

regal scaffold
#

ebic wanna help me with part 2?

remote swallow
regal scaffold
#

Add a step to build.gradle which executes a file called deploy.sh which i already have

remote swallow
#

exec task

regal scaffold
#

yeah

young knoll
#

If it just copies the jar somewhere

remote swallow
#

copy task

young knoll
#

You don’t need an external sh file

regal scaffold
#

It does not

#

sftp

young knoll
#

Ah

regal scaffold
#

Then it enables remote debugging

#

Which is sick

#

It stalls the server but works fantastic

remote swallow
#

hotswapping πŸ‘

regal scaffold
#

Yessir

#

indeed

remote swallow
#

kotlin hotswapping is fun

regal scaffold
#

And it's loaded!!!

#

Lets get it!!

young knoll
#

Can grade just do Runtime#exec

remote swallow
#

prob

young knoll
#

Or whatever the Kotlin syntax is

storm crystal
#

is there a way to get rid of this popup?

regal scaffold
#

Question

#

Gradle/ folder is still gitignore right?>

hazy parrot
#

no

regal scaffold
#

Really?

hazy parrot
#

that should be controlled by version control

remote swallow
#

/gradle no .gradle yes

regal scaffold
#

Interesting

#

Alright

#

Thanks

young knoll
#

You should include the /gradle folder with the wrapper

remote swallow
#

/gradle has wrapper jar in it so everyone who tries to build use the same wrpaper jar

#

means you dont have "works on my machine"

regal scaffold
#

Ah yeah supposed something like that

sullen marlin
#

necessary because gradle breaks every version :>

young knoll
#

So does NMS

#

And yet craftbukkit still uses it? Smh

remote swallow
#

craftbukkit still exists smh

young knoll
#

Clearly craftbukkit should implement an entire custom server

remote swallow
#

clearly craftbukkit shouldnt exist

young knoll
#

Then what will implement the Bukkit api

remote swallow
#

spigot

blazing ocean
#

craftspigot surely

young knoll
#

Ah yes

quiet ice
blazing ocean
#

just use cabernetmc bro

remote swallow
#

fr

quiet ice
#

I can't think of any dot-file besides .gitignore and .gitattributes you'd not want to ignore

#

Anyways, I'm eepy; time to go to bed now

drowsy helm
#

.dotenv

brittle geyser
#

How to split text with \n into several string?
For example:
Input is: "Test\nAboba"
Output: ["Test", "Aboba"]

text.split("\n") and text.split("\\n") not working

drowsy helm
#

.idea

#

String#split(β€œ\n”)

brittle geyser
quiet ice
young knoll
#

TLDR regex jank

#

Try \\\\n

drowsy helm
#

\r

drowsy helm
#

File

quiet ice
#

some CI bs I presume

drowsy helm
#

Nah it’s a standard file for environmental variables

brittle geyser
hazy parrot
young knoll
#

Idk why it’s \\\\n

#

Shouldn’t it be \\n

drowsy helm
young knoll
#

It’ll be covered by .*

hazy parrot
#

and geol said he doesn't know any files besides .gitignore and .gitattributes you shouldn't ignore πŸ˜„

drowsy helm
#

Wait I misreas what geol said

brittle geyser
#

How to get default potion color and potion type?

#

Default potion is potion that from vanilla minecraft

young knoll
#

PotionMeta

brittle geyser
#

PotionMeta not working

#
            if (itemMeta instanceof PotionMeta) {
                PotionMeta potionMeta = (PotionMeta) itemMeta;
                this.RGB = potionMeta.getColor();
                this.potionEffects = potionMeta.getCustomEffects();
            }
#

Here is result

brittle geyser
#

[02:32:19 INFO]: [FastPluginConfigurer] PotionEffects: []
[02:32:19 INFO]: [FastPluginConfigurer] PotionEffects: []
[02:32:19 INFO]: [FastPluginConfigurer] PotionEffects: []
[02:32:19 INFO]: [FastPluginConfigurer] PotionEffects: []
[02:32:19 INFO]: [FastPluginConfigurer] PotionEffects: []

storm crystal
#

I dont understand it, i am not using linked hash map anywhere

remote swallow
#

are you trying to get something from a config

storm crystal
#

from .json file

#

to cache

remote swallow
#

is it gson

storm crystal
#

I mean im trying to get cache entry that is HashMap

#

it's Jackson

remote swallow
#

i have no idea

brittle geyser
storm crystal
#

I am deserializing on server enable

#

and then trying to print a value from json file

#

its weird because it works for another json file

#

but its exact same implementation

regal scaffold
#

@remote swallow

#

Is there a event for pre-quit?

Like, when I show players health on PlayerMoveEvent it can go over 20 no problem, but if i hook into quit event and get players health it resets to 20 so only can see 20

young knoll
brittle geyser
young knoll
#

You don’t specify those for base effects

#

They are basically baked into the effect

brittle geyser
#

idk wum

storm crystal
#

what the fuck

#

when im trying to print class of this object I get error

#

whenever im trying to get entry by #get() it gives me an error

#

its just a hashmap

#

first time im seeing this kind of problem

brittle geyser
#

How i can get effect duration and modifier

if (itemMeta instanceof PotionMeta) {
    PotionMeta potionMeta = (PotionMeta) itemMeta;
    PotionData potionData = potionMeta.getBasePotionData();
    PotionEffectType effectType = potionData.getType().getEffectType();
    this.potionEffects = new ArrayList<>();
    if (effectType == null) {
        this.RGB = potionMeta.getColor();
        this.potionEffects.addAll(potionMeta.getCustomEffects());
    } else {
        this.RGB = effectType.getColor();
        this.potionEffects.add(new PotionEffect(effectType, (int) effectType.getDurationModifier(), potionData.isUpgraded() ? 1 : 0));
    }
}
trail coral
young knoll
#

Seems weird

#

How are you changing max health

regal scaffold
#

Yeah I figured it out

#

It was a different plugin

#

Eco plugin

#

So I just ran my task delayed by 1 second

#

And that guarantees the player data is changed by that plugin

#

Works as a charm

brittle geyser
#

This code returns empty list, how to get main potion effect?

PotionMeta potionMeta = (PotionMeta) itemMeta;
FastPluginConfigurer.getInstance().getLogger().info("Potion effects: " + potionMeta.getCustomEffects());
fair rock
brittle geyser
#

default potion without any change, vanilla potions

#

I need to found a way getting potion effect

#

Or how this potions was creating?

river oracle
#

You could tag them with pdc upon being taken out of a brewing stand

brittle geyser
#

What does this have to do with the brewing stand

#

I dont need to tag anything, i need just get potion effect then store it in the config

river oracle
brittle geyser
young knoll
#

There is

#

PotionType, isExtended, and isUpgraded

brittle geyser
#

i dont want to write parse for potions

#

Is there another way?

young knoll
#

What’s wrong with using that

#

You just need to read and write a few values

brittle geyser
#

i cant get PotionEffect from PotionData

young knoll
#

Correct

#

The duration and level is determined by the base potion type

#

The modern PotionType does have data on the duration and level of each effect though

#

But that’s 1.20.5 api

brittle geyser
#

duration in ticks?

young knoll
#

Yes

wild reef
#

Hey, I wanted to work on a plugin on 1.20.6 and I am using nms. In a older plugin (1.17 I think it was). I used the ServerPlayer class, now I am trying the same but the import doesn't work anymore. Did ServerPlayer got removed / moved or replaced by a different class in 1.20? I couldn't find docs related to that

eternal oxide
#

nope

young knoll
#

Still the same

#

Make sure you are using mojmap

wild reef
#

Oh yeah that must be it, totally forgot about it

#

Thanks Coll

sterile sapphire
#

Gonna make a plugin tmrw, is this the right file lay out?

#

Companies/
β”‚
β”œβ”€β”€ src/
β”‚ └── com/
β”‚ └── yourname/
β”‚ └── companies/
β”‚ β”œβ”€β”€ CompaniesPlugin.java
β”‚ β”œβ”€β”€ CompanyCommandExecutor.java
β”‚ └── CompanyManager.java
β”‚
β”œβ”€β”€ plugin.yml
└── OtherPluginFiles...

worldly ingot
#

You can lay it out however you'd like, really. Though depending on what build system you're using, your plugin.yml and other plugin files may want to be in either the source directory, or maybe a dedicated resources directory,

#

If you're using Maven or Gradle, they're put in src/main/resources by default. Either way, you need to make sure that when you export or build your plugin, the plugin.yml is in the root directory of your plugin binary

sterile sapphire
#

okay

#

thanks

sterile sapphire
eternal oxide
#

maven is simpler

regal scaffold
#

Hey guys, any suggestions for 3x32inch curved monitors layout?

#

Currently use a horizontal layout but it's so wide

#

And i don't think there are any good triple horizontal 32'' monitor stands available

merry cove
#

Is there a way to extend a Mob to PathfinderMob in a class that extends Mob?

young knoll
#

What

merry cove
#
this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0, true));```
requires PathfinderMob.
#

but I'd like to have the class extend Mob, and somehow get PathfinderMob from that rather than having to extend PathfinderMob

young knoll
#

Nope