#help-development

1 messages · Page 453 of 1

young knoll
#

You can do it with the event too technically

ivory sleet
#

Server#selectEntities

#

iirc

iron glade
#

that would be awesome ngl

ivory sleet
#

Bukkit.selectEntities(…)

iron glade
#

oh I see

ivory sleet
#

Like its a thing

#

Yk

#

(:

iron glade
#

haha ty

weak kayak
#

pog

iron glade
#

and commandsender instanceof.... commandblock?

ivory sleet
#

Nah not really

young knoll
#

You can just do it for any sender

ivory sleet
#

you have BlockCommandSender

young knoll
#

All senders can technically use @p/e/a/s

weak kayak
#

technically indeed

young knoll
#

Also people should really refer to those as @peas

weak kayak
#

heh peas

young knoll
#

Ah wait I forgot r

#

@pears

iron glade
young knoll
#

True

iron glade
#

like @/p

young knoll
#

What happens if you use that in vanilla commands on console

#

I assume it just yells at you

weak kayak
pseudo hazel
#

it might just pick a random player xD

iron glade
iron glade
young knoll
#

I guess it picks the closest player so… probably closest to 0,0? Idk

iron glade
#

or that

pseudo hazel
#

hard to test on your own

weak kayak
#

probably either closest to 0,0,0; a rando; or it would just make the server crap its pants about it

#

ima test it uno secondo por favor

#

it does not crap its pants

ivory sleet
#

Yes it just resorts to nms

#

Think it uses one of the nms brig argument implementations

young knoll
#

It does

#

But like what does NMS do

ivory sleet
#

As well as resolving the sender’s location through nms command wrapper or sth

#

Yea thats a good question

young knoll
#

What is the location of console

ivory sleet
#

Would assume it points to origo

young knoll
#

Where does he live

weak kayak
#

idk but with one player, minecraft:say works

#

with @p

#

i'll test it with two in a bit

remote swallow
#

use set(path, location) and getLocation

young knoll
#

Doesn’t spigot automatically preserve comments in newer versions?

remote swallow
#

set("path.x", x) isnt set(path, locationVar)

young knoll
#

You’ll need to handle comments yourself then

remote swallow
#

its 1.8 so no idea

weak kayak
#

nani the fuck

tender shard
#

have you not updated discord?

#

it's a "super reaction" lol

#

maybe they don't like you either

young knoll
#

What are super reactions

#

We already had animated reactions

#

So are these just more animated

weak kayak
paper venture
#

Hello I want to reset all attributes of a player to default values, I've got this method

#

But the values are not the player default

tender shard
#

setBaseValue(getBaseValue())?

#

that won't do anything useful

paper venture
#

Ah wait these should be getDefaultValue()

#

So the default values are not for the player

young knoll
#

The default values can be changed

tender shard
#

how?

young knoll
#

Oh wait default vs base

#

That’s wacky

paper venture
#

Default value for movement_speed is 0.699999 when it should be 0.1

weak kayak
paper venture
#

So should I just store all the default values to be able to reset player's attributes? Or there is some method or a field...

young knoll
#

I mean I figured getDefaultValue would get the default

#

Maybe it’s missing overrides for certain entities

#

Or maybe it’s some weird format

tender shard
#

yeah I also wanna kick those fuckers in the shin

weak kayak
#

i wanna steal their kneecaps

#

my kneecaps now

#

like anvils do?

young knoll
#

Does the method not work?

paper venture
young knoll
#

When it lands?

#

Use the event and check for nearby entities

#

I think it’s EntityChangeBlockEvent

weak kayak
#

i'd probably have a task that runs every tick* that checks for nearby entities and hurts them

#
  • doesn't have to be every tick, could also be more than a tick of delay lol
tender shard
# paper venture So should I just store all the default values to be able to reset player's attri...

yeah that's how I do it too

    private final NamespacedKey defaultAttributesKey = new NamespacedKey(this, "default-attribute-values");


    public void saveDefaultAttributes(Player player) {
        EnumMap<Attribute, Double> attributeDefaults = new EnumMap<>(Attribute.class);
        for (Attribute attribute : Attribute.values()) {
            attributeDefaults.put(attribute, player.getAttribute(attribute).getBaseValue());
        }
        player.getPersistentDataContainer().set(defaultAttributesKey, DataType.asEnumMap(Attribute.class, PersistentDataType.DOUBLE), attributeDefaults);
        
    }
    
    public void loadDefaultAttributes(Player player) {
        EnumMap<Attribute, Double> attributeDefaults = player.getPersistentDataContainer().get(defaultAttributesKey, DataType.asEnumMap(Attribute.class, PersistentDataType.DOUBLE));
        if(attributeDefaults == null) return;
        for (Attribute attribute : Attribute.values()) {
            player.getAttribute(attribute).setBaseValue(attributeDefaults.get(attribute));
        }
    }
young knoll
#

Wonder why getDefaultValue doesnt work

#

Or doesn’t give the right values at least

weak kayak
#

yet another potential PR

#

unless it works as intended and we're just dumb or smth

tender shard
#

the code for getDefaultValue is fine

#

it returns the correct default value

#

it just happens that players do not use the default value

young knoll
#

Ah

#

I thought it returned the default for that entity

weak kayak
#

intriguing

tender shard
#

yeah it's a bit weird lol

young knoll
#

I guess it works well for like, knockback resistance

#

Since almost everything uses 0

#

But speed, not so much

paper venture
spiral wharf
#

How can i make a Item Unbreakable in 1.8.9? meta.setUnbreakable doesnt work and meta.spigot() doesnt exist either

small lynx
tender shard
young knoll
#

Is that available for all entities?

tender shard
#

it's the same as LivingEntity.createLivingAttributes(), except that
ATTACK_DAMAGE is 1.0
MOVEMENT_SPEED is 0.10000000149011612
and they have ATTACK_SPEED and LUCK, but no value set

young knoll
#

Hmm

#

Might be good to expose

tender shard
#

at least, it's available for all entity types I checked

young knoll
#

I assume it gives us a list

#

Or some form of collection

paper venture
tender shard
#

?nms

tender shard
young knoll
#

-_-

paper venture
#

Thanks!

tender shard
#

but yeah AttributeSUpplier is also just a Map<Attribute, AttributeInstance>

young knoll
#

Right

small lynx
young knoll
#

Sounds like it’s PR time :p

weak kayak
#

aye aye

#

PR all your problems away

young knoll
#

Exactly

paper venture
tribal quarry
tender shard
paper venture
#

Okay thanks my bad

tender shard
tribal quarry
#

🕳️ 👨‍🦯

lilac nimbus
#

I'm using scriptcraft, everything is fine, it has its engine but it says

"No JavaScript Engine available. ScriptCraft will not work without Javascript."

The server works fine, and scriptcraft loads too, but it doesn't responds to anything.

tender shard
#

what the heck is scriptcraft

tribal quarry
#

bruh

lilac nimbus
#

Instead of making plugins in java, we can create it in js with the help of it.

tender shard
#

yikes, that sounds like a horrible idea

lilac nimbus
#

bruh

tribal quarry
#

js would be pain in minecraft, its not like react or nodejs

lilac nimbus
#

I can handle it

tribal quarry
#

since java 7 i think

#

nashron js was the last engine

#

you should use a forked jre

#

its not a good idea to run js under java

#

its not supported anymore (as well as i know)

weak kayak
#

With the release of Java 11, Nashorn was deprecated citing challenges to maintenance, and has been removed from JDK 15 onwards

tribal quarry
#

whatever

lilac nimbus
tribal quarry
#

java11*

weak kayak
#

last commit was 2 months ago lmao

lilac nimbus
#

ScriptCraft is alternate js engine (as I know)

weak kayak
#

j2v8 is a good one

tribal quarry
weak kayak
#

v8 is what basically every sane javascript engine uses

#

typo

lilac nimbus
#

lol

tender shard
#

scriptcraft is weird

lilac nimbus
tender shard
#

that are the included default scripts ^

lilac nimbus
#

😶

weak kayak
#

a truly philosophical statement

tribal quarry
#

ok, he just asked a question

#

im sorry for being rude, just wanted to help

weak kayak
#

?

tribal quarry
#

after all: try using a nashorn-jdk supported jre

#

@lilac nimbus

weak kayak
#

i don't recall you being rude?

#

what did i miss

small lynx
lilac nimbus
#

So, I just wasted 10 hours of my life? 🥲

tribal quarry
#

you can try writing your plugins in kotlin

lilac nimbus
#

And when I use java I get an error for my plugin.

weak kayak
tribal quarry
lilac nimbus
#

Wait I'll open another folder and use java

icy beacon
#

how do i turn intellisense on

#

i created a new project and for some reason it's not on

weak kayak
#

🤔

#

what ide are you using

icy beacon
#

intellij

tawny remnant
#

This code is supposed to make the armorStand rotate depending on the player's rotation. The armor stand is always supposed to by 2 blocks to the right, 1 block back and 3 blocks high. But this code i have makes the armor stand rotate super fast and not how i described it. Can you correct it?
https://paste.md-5.net/locivubako.cs

weak kayak
icy beacon
#

tried that already

weak kayak
#

ah

tender shard
#

what the heck is IntelliSense lol

weak kayak
#

the auto-complete thing

tender shard
#

isnt that just called auto complete

lilac nimbus
#

hmm, should I use buildtools.jar too?

weak kayak
#

this right here

river oracle
tender shard
#

is Power save mode enabled @icy beacon ?

tender shard
icy beacon
tender shard
#

File -> Power save mode

icy beacon
#

i have 2 projects opened rn

#

one has intellisense on the other doesn

#

t

weak kayak
icy beacon
#

i clicked it and now it says it's on

#

so it was off

tender shard
#

you do not have intellisense if you use intellij

tender shard
weak kayak
#

intellisense is just commonly used as a synonym

river oracle
tender shard
#

can you show a screenshot of the whole window

lilac nimbus
icy beacon
#

perhaps that's the wrong term but i mean the autocomplete & analysis

weak kayak
#

i googled it

icy beacon
weak kayak
#

like a true chad

tender shard
river oracle
icy beacon
#

for some reason there's no "Java Class/Kotlin Class" option?

#

i think intellij doesn't recognize the project

#

or smt

weak kayak
#

i mainly use eclipse and sometimes intellij if i have to work with lombok

tender shard
icy beacon
#

no

tender shard
icy beacon
#

there's a checkmark when it's on

icy beacon
tender shard
#

but that message should go away when you disable it

icy beacon
#

yeah it did go away this time but it was off anyway

weak kayak
#

beautiful music

icy beacon
#

METAMORPHOSIS - INTERWORLD

weak kayak
#

pog thanks

tribal quarry
weak kayak
#

yes

icy beacon
#

also for some reason it has the paper icon even though it's a spigot project

tribal quarry
#

lmao

icy beacon
#

i'm very confused at this rn

weak kayak
#

🤔

tender shard
#

File -> Repair IDE

weak kayak
#

must be brocken

tender shard
#

oh and maybe ?paste your pom

icy beacon
#

good idea

#

sure 1 sec

eternal oxide
#

install -> Eclipse

icy beacon
#

?paste

undone axleBOT
weak kayak
#

(sh)e's b(r)o(ek)n

icy beacon
#

e's bon

weak kayak
#

e's bon

icy beacon
#

pom

tender shard
#

add to your <build> section: <sourceDirectory>src/main/kotlin</sourceDirectory>

icy beacon
#

sure

#

my indentation is all over the place lmao

#

one sec

#

yeah it shows up now, but the analysis is still off

tender shard
#

hm no idea lol. maybe a bug in the "new ui"

icy beacon
#

ok nvm

#

it now works, but says OFF

#

i'll just restart

tribal quarry
#

intellij moment

icy beacon
tribal quarry
icy beacon
#

i'm learning japanese

#

fyi

weak kayak
#

konaaaaaaaaaaaaaaaaa

icy beacon
#

and i've watched like 3-4 animes in my life

terse socket
#

that's how it is in intellij

weak kayak
#

i tried learning japanese once

icy beacon
terse socket
#

o

#

ok

weak kayak
#

but i just forgor

icy beacon
weak kayak
#

yup do you know about marshallyin

icy beacon
#

nope

weak kayak
#

issa good resource

icy beacon
#

i'm using renshuu & kanji study

#

but ty

lilac nimbus
#

The code of the plugin should be in jar right?

weak kayak
#

no prob

icy beacon
#

remove the embed plz

tender shard
#

the class files should be in the jar

icy beacon
#

ty

weak kayak
#

no prob

lilac nimbus
tender shard
#

the class files should be in the .jar

lilac nimbus
#

so it should be in .java

icy beacon
#

ok i fixed the problem by creating a new class cuz it wouldn't analyze the old one

#

hava is new to this server

tribal quarry
weak kayak
#

ayyyyyyyyyyyyyyyyyyyyy

icy beacon
#

xd

tribal quarry
lilac nimbus
#

wait like this?

jar cvf plugin.jar *.class```
icy beacon
#

why aren't you using maven and ide for compilation

#

it'd do the heavy shit for you

tribal quarry
icy beacon
#

or gradle

#

yeah

weak kayak
#

maven/gradle ftw

river oracle
#

At minimum an ide though

icy beacon
#

^

tribal quarry
#

^^^

weak kayak
#

\/\/\/

remote swallow
#

^^^^^^^

weak kayak
#

👀

#

i saw that

weak kayak
#

who reacted with the eggplant

tribal quarry
weak kayak
#

am i seeing eggplants now smh

icy beacon
#

seems epic got a new pfp

weak kayak
#

that's epic

remote swallow
#

no

weak kayak
#

literally

remote swallow
#

i got profile deco

icy beacon
#

oh

lilac nimbus
#

im not using Intellij IDEA

icy beacon
#

exquisite

lilac nimbus
tribal quarry
icy beacon
remote swallow
#

netbeans or eclipse also work

icy beacon
#

but if you are compiling manually you're a deranged psychopath

tribal quarry
tribal quarry
#

just try to mess around with it

#

learn stuff

#

search

lilac nimbus
icy beacon
#

how are you gonna code if a file system looks complicated

#

what

#

i mean just start

tribal quarry
#

bruh

remote swallow
#

eclipse's is more confusing to new people

icy beacon
#

you'll get the hang of it sooner rather than later

lilac nimbus
#

I'll ok

#

I'll open it

weak kayak
#

maybe i'm just weird

icy beacon
#

you've ascended to a higher plane of existence

river oracle
#

If you are afraid of normal ides use vscode tradeoff though is you might have to do some configuring

remote swallow
#

i mean how it shows src/main/java/me/epic/etc
and src/main/test/me/epic/etc seperate

tender shard
#

what I dislike about eclipse is that it always uses this weird "workspace" stuff where you end up with 30 open projects

remote swallow
#

thats what @young knoll likes

river oracle
weak kayak
tender shard
#

I#d much rather have one window or tab per project

weak kayak
#

you can sorta like

#

open each project individually

river oracle
#

Everyone should just switch to vscode you can do whatever the fuck you feel like on there :P

remote swallow
#

im good with idea

weak kayak
#

good idea

#

literally

weak kayak
#

for non-java related stuff

#

but i do use it

#

i prefer gedit though 😎

river oracle
tribal quarry
tender shard
#

I dont like vsc

quaint mantle
weak kayak
tender shard
#

„Ah, thats an interesting movie“

tribal quarry
#

it took me almost 3 hours to get it done, and it just looks like stright c code formatting

river oracle
quaint mantle
#

Only issue is that eclipse has a large (albeit invisible) learning curve (But other IDEs have that too)

weak kayak
#

only thing i hate about vsc is how many plugins there are

#

i have like

tribal quarry
weak kayak
#

a gigabyte of free space

#

i can't afford that much plugins 😔

tender shard
#

I dont have any plugins in IJ lol

tribal quarry
#

same

#

^^^

weak kayak
#

i have a few in eclipse

quaint mantle
#

Eclipse is basically 90% plugins

tender shard
#

Vsc is 100% plugins and IJ zero lol

weak kayak
#

yk just a few just 90% of the app nun' much

weak kayak
river oracle
livid dove
#

Who be chatting shit about ma boy IJ?

quaint mantle
#

You have at least a dozen installed for a standard JDT install

tribal quarry
tender shard
#

Yes the builtin ones, i meant external plugins

weak kayak
eternal oxide
#

the only additional plugins I use in Eclipse is a database one and a themes one

tribal quarry
tender shard
#

1.19.3 ig

river oracle
#

1.19.3 atm iirc

weak kayak
tribal quarry
#

🔥

serene sigil
#

?paste

undone axleBOT
weak kayak
#

still over UNDEFINED!!

river oracle
#

Nothing is more terrifying to a math teacher than this right here
1/0 = infinity

serene sigil
#

any idea why "clicked?" gets printed twice?

river oracle
tribal quarry
weak kayak
#

three hands

weak kayak
#

potato tomato

quaint tapir
#

I put a bukkit runnable after I spawn a mob with runTaskTimer so it repeats every 2 seconds so I can give the mob abilitys n shit but when I relog or die it just stops using the abilitys
any help would be great
thanks

quaint mantle
#

Never forget my boy NEGATIVE_INFINITY

river oracle
weak kayak
wise mesa
#

Why did they go with axis-angle for display entities and not Euler angles?

quaint mantle
#

In b4 there is UNDEFINED_INFINITY (aka NaN)

wise mesa
#

I get quaternions

weak kayak
#

or it doesn't i'm not sure

#

really no clue idk

quaint mantle
young knoll
#

Notch left like

river oracle
#

Spaghetti 🍝 Code

quaint mantle
#

But idk which one it is

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
young knoll
#

9 years ago

river oracle
young knoll
#

Anyway I find it’s best not to question Mojang

wise mesa
#

But don’t the old armor stand rotations use Euler angles?

#

So weird

wise mesa
#

Euler angles are just so much more intuitive to me

#

How do I rotate on all three rotational axis

tender shard
#

I dont even know what an euler angle is lol

wise mesa
#

It’s when you use three angles to describe your rotation

#

One for each axis

tender shard
#

So a Vec3d

wise mesa
#

Yes

tender shard
#

Oh ok lol

wise mesa
#

But using that to describe rotation

#

It’s intuitive because it’s just how far you’re rotated along each axis

tribal quarry
quaint mantle
#

It's pitch/yaw/roll

tribal quarry
#

armorstand hands rotations?

wise mesa
tender shard
wise mesa
wise mesa
#

But I think they used to use pitch yaw roll

tribal quarry
#

yes i think

tender shard
young knoll
#

Uhh actually

#

Floats

quaint mantle
#

But not a vector

wise mesa
#

Lmao

young knoll
#

🤓

wise mesa
#

To be fair in Unity they use a vector to represent an Euler angle

quaint mantle
#

But I guess some people use stuff in a way they should not be used

wise mesa
#

But just because it’s a data type they already have

tribal quarry
#

the last time i used euler is when trying to write a 3d mouse controller on a video game project

wise mesa
#

It’s just easy to reuse the tuple of three floats

quaint mantle
#

(ESPECIALLY because the vector methods would be nonsensical)

tribal quarry
tender shard
wise mesa
#

And .toEuler

tribal quarry
#

its easier in unity, u just need to get delta x and y, and put it in that function

young knoll
#

Gotta have that extra precision I guess

wise mesa
#

Lmao

tribal quarry
#

but its handy when it comes to libgdx

wise mesa
#

What math class do I need to take to understand quaternions

#

Lmao

weak kayak
#

brackeys'(s?) game dev tutorials 😎

wise mesa
#

Apparently no math courses

#

But physics courses

#

Which makes sense I guess

wise mesa
eternal oxide
wise mesa
wise mesa
#

However they are still more intuitive to work with

#

I think quaternions are also more efficient for rendering

#

In some way

#

But I do not know that

quaint mantle
eternal oxide
#

using eulers you get a different result depending on the sequence of rotations

wise mesa
#

I am making up stuff

wise mesa
#

It’s definitely not

#

Idk what to do with 4 numbers though lmao

#

We’ll I do know what to do

eternal oxide
#

then learn matrix math

wise mesa
#

I google Euler angle to quaternions converter

icy beacon
#

hey yall, need your opinion - what's your preferred config lib and why?

tender shard
#

spigot's YamlConfiguration ,because it's straightforward and is builtin

#

and it can do everything I ever needed, and more

eternal oxide
#

^

tender shard
#

for non-spigot stuff like discord bots etc I just use plain snakeyaml and pretend that it's a YamlConfiguration lol

icy beacon
#

xD

#

i also used to use it, but i wonder if there's anything else that you guys use and enjoy

tender shard
#

hm lemme check my maven archetype, IIRC it also has a few config libs

icy beacon
#

oh i should've clarified, i'm looking for something with easy support for upgrading configurations and comment support

icy beacon
#

i use gson for json

#

but anyway

#

alex, do you have anything in jefflib for config management?

#

agree

#

serialization is easier in json

#

actually

#

i might just do my config in json

#

but i still am not sure how to support upgrading

#

for example my users have an old configuration, and my new configuration has extra fields

#

how'd i go around that

#

yeah yaml is better

ivory sleet
icy beacon
#

link plz

#

oh

#

you mean the one that alex sent

ivory sleet
#

Wait yes

icy beacon
#

alrighty i'll take a look

ivory sleet
#

Ohmy

#

Yes

icy beacon
#

sure thing

ivory sleet
#

Okay so its a bit hard to use

#

Well

#

Its not very user friendly

#

But just ask if u wonder anything and we can help ya

#

Been using it for quite some time

icy beacon
#

as long as i can manage my configs easily i'm fine with that

ivory sleet
#

Its extremely powerful, being an abstraction over config formats

icy beacon
#

i've had a bad config system for a long time

ivory sleet
#

Whilst providing a robust design

icy beacon
#

messages & config in one file, no upgrading and shit

#

i hope to revamp my config system as i revamp the rest of the plugin

ivory sleet
#

I usually have 2 different modules/components for langauge and config

icy beacon
#

i will make sure to use something from jefflib in UE just for the sake of it lol

#

but i will look into configurate

#

thx yall

ivory sleet
#

Since language can usually grow somewhat more unstructured and sporadically than your configuration generally speaking

#

Best of luck

#

I may also recommend looking at how LuckPerms deal with config

#

(Raw object mapping)

#

(Its in common module, subpackage configuration iirc)

quaint mantle
tardy delta
#

in rust ofc

quaint mantle
#

how to remove glow enchant?

quaint mantle
chrome beacon
#

You'd want to hide the enchantments from the player and then apply the enchantment names to the lore

green falcon
#

whats the correctest way to set a player's server join location in a non-blocking way? PlayerJoinEvent -> player.teleportAsync? I think that can send the original join location's chunks

ivory sleet
#

i think you can teleport on login

#

Or maybe even prelogin

tender shard
#

there is no teleportAsync in spigot

restive mango
#

Does it cost much to create asynchronous tasks? I have a command which begins creating spots (20/s) around a player, in each spot, many particle effects are played over time (4s), and then a lightning bolt strikes a few moments later. I could (1) have a sync task which creates asynchronous tasks for each spot as they are spawned, or (2) have one asynchronous task for the whole thing. What do you think would be better?

ivory sleet
#

Well assuming you send packets or, use the api then that will get synced anyway

young knoll
#

Isn’t Netty async

ivory sleet
#

But ofc u can make sure the creation of the packets is done async

#

Yes

tender shard
#

why would one use packets for particles

restive mango
#

Lots of complex vector mathematics for the effect.

ivory sleet
#

Maybe they’re on legacy presumptively

restive mango
#

No.

#

It's just that I've found significant performance enhancements when I async the math.

ivory sleet
#

How are you dispatching the async tasks?

#

This sounds like you should take advantage of a fork join pool

#

(Or well first you may wanna try to run it on the server thread)

#

But if its too heavy, then resort to asynchronous computation

restive mango
#

dunno what fork join pools are, but I just use

#
 new BukkitRunnable() {

            @Override
            public void run() {
                //code
            }
        }.runTaskAsynchronously(AesopianProject.getAesopianProject());
ivory sleet
#

If you use that, then go with as few async tasks as possible

copper scaffold
#

is there a way to check a doublechest witch side i clicked left or right?
i tried it with.`
1.

Chest chest = e.getClickedBlock();
if(chest.getType().equals(Type.RIGHT){

2.

Chest chest = e.getClickedBlock();
if(chest.getBlockData().equals(Type.RIGHT){
ivory sleet
#

Since a cached thread pool can’t take advantage of work stealing

restive mango
#

what is work stealing

#

and fork join pools

ivory sleet
#

Okay let me explain in simple terms

restive mango
#

yes i am a simpleton

ivory sleet
#

cached thread pool, what bukkit scheduler uses for its async tasks is a pool with threads, it has a single queue which the tasks are appended to before given to a free thread, where its then executed

work stealing is a concept where every thread has a queue of tasks, we will call this a worker, a worker can steal tasks from another worker, this is quite powerful for certain types of tasks where there might be a parent-child relationship or for smaller tasks generally

restive mango
#

sounds cool

ivory sleet
#

If you wanna know more I suggest doing your own research, but thats the gist of it

restive mango
#

do you know any resources which explains this in Java so i might learn about it

ivory sleet
#

Hmm I have some I think

restive mango
#

i'd love to learn more

analog thicket
#

?paste

undone axleBOT
serene sigil
#

how do you detect if an item entity hits a solid block?

#

for example you drop an item

restive mango
#

hrm

ivory sleet
restive mango
#

conclure you know i think the work stealing concept is actually much better hrm

ivory sleet
#

You can ofc google more about it xD

#

Yea for you it probably is I assume, hopefully you will be able to massively reduce latency

tender shard
#

how can I replace properties in files using gradle? E.g. like ${project.version} in maven

serene sigil
analog thicket
#

like 100 items pr player

ivory sleet
#

Lets say 100players 100 items

#

Thats 10^4 iterations

#

Hmm wouldnt say that’s gonna be that big of a problem

restive mango
#

Conclure, as a follow-up, is it better that the tasks I give to a fork/join pool be long or short? I could, for example, make every single mathematic calculation a 'task', but I feel like that probably isn't its intended use.

#

I could give like 1000 calculations

ivory sleet
#

I mean I feel like you should use a Map Banannus

restive mango
#

Are you making this word up

#

'Map Banannus'

#

oh wait

#

you're responding to that guy

#

i thought it was a real java term for a second

tender shard
echo granite
#

Hello, how can I "force" a player to pay attention to a message? I don't want to freeze him and interrupt his gameplay. I thought about using sounds but I don't know which one is the best

analog thicket
tall dragon
analog thicket
#

So i would have to change the whole structure or what?

echo granite
#

so I have a conflict

ivory sleet
tall dragon
restive mango
#

ah

#

alright

#

thanks so much man

echo granite
restive mango
#

let me know if there are ratings we can give helpers so i can rate u 5 star

echo granite
#

it's regarding real life actions

#

my plugin has to notify everyone online

tall dragon
ivory sleet
#

But its not well like a serious one anyway

echo granite
tall dragon
#

could go for the levelup sound

#

works pretty well for that

echo granite
#

the context is negative - something bad happens in real life and the players need to be notified

serene sigil
#

how do you detect if an item entity hits a solid block?
for example you drop an item

tall dragon
echo granite
ivory sleet
#

If you have kotlin

tender shard
#

i dont understand that

#

I need to set the version in plugin.yml

ivory sleet
#

OH

#

fuck im high

tender shard
#

lol

remote swallow
#
processResources {
    def props = [version: version]
    inputs.properties props
    filteringCharset 'UTF-8'
    filesMatching('plugin.yml') {
        expand props
    }
}
ivory sleet
#

Yeah thats the one

tender shard
#

thx

tender shard
remote swallow
tender shard
#

thx

ivory sleet
#

Yeah that one or $version

#

Both works

young knoll
#

Alex is learning gradle

ivory sleet
#

Small step in the right direction:>

tender shard
#

I always try from time to time, then I give up and convert it to maven

young knoll
#

Me onw to convert spigot to gradle and then PR it

#

(real)

remote swallow
#

do it

young knoll
#

You do it

#

Frog boy

remote swallow
#

no

tender shard
#

shouldnt gradle be able to do it automatically?

eternal oxide
#

I've no issue with Spigot supporting Gradle, but if it dropped Maven I'd stop doing plugins with Bukkit as a base

remote swallow
tender shard
#

how can I do this in gradle?

<profiles>
  <profile>
    <id>export-to-test-server</id>
    <build>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <configuration>
            <outputDirectory>/Users/mfnalex/mctest/plugins</outputDirectory>
          </configuration>
        </plugin>
      </plugins>
    </build>
  </profile>
</profiles>
#

does gradle even support profiles or sth similar?

remote swallow
#

apply from: 'file.gradle' is the closest thing

tender shard
#

what's that

remote swallow
#

one sec

#

i could put apply from: 'https://raw.githubusercontent.com/The-Epic/gradle-scripts/main/publishing.gradle' in any of my gradle files to have publishing info applied

tender shard
#

but how would I then enable it only "sometimes"?

#

I want it to work like in maven where I can just enable/disable profiles before running it, e.g. with the IJ gui, or just by specifying it on the cli: mvn -P export-to-test-server package

small lynx
tender shard
remote swallow
split gull
tender shard
#

ok again time to go back to maven

small lynx
ivory sleet
#

But its a bit more advanced

split gull
tender shard
#

I can't believe that gradle doesnt support this, that'd be a joke

remote swallow
#

you could just create ur own task to sometimes enable copy to server

serene sigil
small lynx
#

what i need to do to fix my code

split gull
#

im not the smartest java guy here

#

so you might want to ask a few others first

young knoll
#

Man the heck

#

Why are all these createAttributes methods static

#

Mojaaaaaaang

tender shard
#

because they are not related to any entity instance

remote swallow
#

you put g instead of k btw

young knoll
#

I mean a lot of things aren't related to any instance

#

Like the sounds they make

ivory sleet
#

But

#

Like

echo basalt
ivory sleet
#

Its fully possibly to create a similar system alex

ivory sleet
#

And there’s presumably a plugin for it also

tender shard
ivory sleet
#

So the way I would do it is to have a property

#

And then you have an argument when running build for instance

#

Where it overrides the property value

#

and then you like in ur buildscript check if the property has a value and then import the correct gradle file

#

Well “applying it”

tender shard
#

that sounds overly complicated for a simple thing like this tbh

#

I'll just go back to maven

ivory sleet
#

Yea thats alright

terse lily
#

are there any public scripts for updating spigot mappings to the new version?

young knoll
#

Man AttributeProvider sucks

#

It has no methods to just get all the entries

quaint mantle
#

Is there a way of mods and plugins to communicate?

young knoll
#

Yes

young knoll
#

It basically just uses the special packet Mojang added a long time ago

quaint mantle
#

I was planning to make a custom bar in the hud but I guess you can make that with resource packs too

tender shard
#

why

lost matrix
#

You might need to escape some character...

tender shard
#

but the replacement is no regex

small lynx
tardy delta
#

btw can you put links in a commit message?

worldly ingot
#

You have to escape the closing parenthesis

#

'$1'\),

#

Not sure why IJ wants you to do that but that's the only thing I can think of that would be "invalid"

tender shard
#

but the replacement string is never a regex

#

I mean what would even be the purpose of ( brackets ) in the replacement string

smoky anchor
#

Yo guys
How do I store PersistentDataContainer to item with PersistentDataStorage ?
I have not found any non-version specific way to create instance of it.

lost matrix
#

?pdc

lost matrix
smoky anchor
#

Ye but what if I want to nest the PDC ?

#

I do not want everything in the one NBT tag PublicBukkitValues

lost matrix
#

Then you call pdc.getAdapterContext().newPersistentDataContainer()

lost matrix
#

Because you only have this core container.
You can add new, nested containers to it tho.

smoky anchor
#

Like I understand that with the API I have to store everything in the PublicBukkitValues
I want to add more containers to it
What you just sent is exactly what I needed (I think)
Thank you

quaint mantle
#

Any way I can listen to click events in chat?

young knoll
#

They have to run a command

tender shard
young knoll
#

So you can listen to the command event

tender shard
quaint mantle
#

Oh wait

#

my bad

weak meteor
#

can someone help me importing a .jar API in vscode?

#

fucking difficult

weak meteor
#

im using it

tender shard
#

np

remote swallow
#

any good regexer's in here

warm igloo
#

it it possible to create two teams with the same name that are registered to two different scoreboards like this or will it still throw an IllegalArgumentException?

Scoreboard s1 = Bukkit.getScoreboardManager().getNewScoreboard();
Scoreboard s2 = Bukkit.getScoreboardManager().getNewScoreboard();

Team s1Team = s1.registerNewTeam("test");
Team s2Team = s2.registerNewTeam("test");
ivory sleet
#

(:

remote swallow
#

what would regex look like for finding §x§r§r§g§g§b§b occurances in strings

ivory sleet
#

You wanna be able to get out the x r r g g b and b right?

remote swallow
#

yeah, no need for the x

#

minimessage is just dying at me because theres § in my string so im just gonna reformat it

lost matrix
#

Something something (?:§[0-9a-f]){6}(?=[^§]|$)

#

If you just want to skip the x

young knoll
#

Minimessage moment

tardy delta
#

§x§r§r§g§g§b§b moment bruh

#

id just use regexes

young knoll
#

&#rrggbb is better anyway

ivory sleet
lost matrix
#

Meh you also just skip the first match

tardy delta
#

along with using ^ to denote a pointer, as it is pointy. best explenation ive seen today

ivory sleet
#

like assuming they dont wanna capture §x

#

yea

lost matrix
#

Ah i just realised a mistake. Im also matchin the '§' signs

ivory sleet
#

Wait ur regex doesnt go for §x

lost matrix
#

(?<=§)([0-9a-f]{6})(?=[^§]|$) This would filter them out

ivory sleet
#

Yea

lost matrix
#

But let Conclure maybe come up with something not so janky

ivory sleet
#

Oh I can give a less regexy one if u want lol

remote swallow
#

regex is hard

#
public class Utils {
    private static final Pattern spigotHex = Pattern.compile("(?<=§)([0-9a-f]{6})(?=[^§]|$)");

    public static String convertHexFormat(String input) {
        System.out.println(input);
        Matcher matcher = spigotHex.matcher(input);
        StringBuilder stringBuilder = new StringBuilder();
        while(matcher.find()) {
            String match = matcher.group();
            String value = match.substring(1);
            stringBuilder.append(value);
        }
        System.out.println(stringBuilder);
        return stringBuilder.toString();
    }
}
``` that manages to turn any inputted string to nothing
lost matrix
#

Perfect

#

My regex is rusty...

remote swallow
#

chatgpt cant even make correct regex and then reformat it

ivory sleet
#

Fr?

remote swallow
#

fr

ivory sleet
#

Damn

lost matrix
#

no cap?

remote swallow
#

ive asked in like 4 different chats and it cant even get it correct

#

it either fucks the regex up or manages to fuck the method up

lost matrix
#

I have had decent results with 4 in the past

zenith crescent
remote swallow
lost matrix
young knoll
#

I think that is default minecraft lore

#

And iirc it's only in creative mode

zenith crescent
#

oh

lost matrix
#

Is it? I have never seen that.

zenith crescent
#

i set it to null and it didnt remove it

young knoll
#

It's new

remote swallow
young knoll
#

From like 1.19.3 or something, whenever they redid the creative menu

late sonnet
zenith crescent
#

Ah ok thank you

remote swallow
strong parcel
#

Is anybody else having issues with PDCs in Spigot? I am currently using the CustomBlockData plugin to assign PDCs for blocks to the chunk. The PDCs work while the server is online but wipe when the server stops even when /save-all is used beforehand.

quaint mantle
#

Is it possible to make another namespace for commands that are not intented for player use but rather internal commands?
Something like /plugininternal:veryinternalcommand

lost matrix
strong parcel
#

Yes

lost matrix
#

Do you make sure that chunks get properly saved?

vital sandal
#

How do it get block exploded by tnt or end crystal ?

#

tried BlockExplodeEvent

lost matrix
#

EntityExplodeEvent

#

Those arent blocks

strong parcel
#

Is there anything I need to do to ensure proper saving? I didn’t write anything regarding that because I thought PDCs handled it. On my phone rn, but the only methods I have been using on PDCs are get, set, and has.

#

Also, this problem appeared recently. The saving was working for a while.

young knoll
#

They save automatically

quaint tapir
#

whats the max health I can give to a mob
it lets me give 200 to a spider but not 2500

young knoll
#

There is a config option to increase it in spigot.yml

#

I think the default is 2048

remote swallow
tardy delta
#

why dealing with that weird &

remote swallow
#

because its already formatted

ivory sleet
remote swallow
#

and i need to convert it to minimessage-ify it

tardy delta
#

well idk, i wrote that atleast 2 years ago

ivory sleet
#

2 years ago?

#

Crazy to think time flies so fast

tardy delta
#

indeed

#

ive only been wasting my time

lost matrix
remote swallow
#

damn

ivory sleet
#

😌

tardy delta
#

new api?

ivory sleet
kindred valley
#

Ok

ivory sleet
#

Fourteen do u remember anything special u said? 😅

tardy delta
#

whats that supposed to mean?

ivory sleet
#

Quite clueless actually

vocal cloud
#

most mentally stable birb

tardy delta
#

i have no clue

#

as most of the times

#

or maybe i do

#

nope

tender shard
#

to people who claim gradle is faster: not always true

remote swallow
tardy delta
#

lol

lost matrix
#

But then its often a bit faster

ivory sleet
#

Yea

tender shard
#

yeah but maven is also quite fast, in this case it was even faster

#

0.6 vs 0.9 seconds

charred blaze
#

how do i find url like this for 1.19?
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'

tender shard
#

url?

charred blaze
#

my bad

#

what is it called?

tender shard
#

it's <groupId>:<artifactId>:<version>(:<classifier)

young knoll
#

It's basically always 'org.spigotmc:spigot-api:<minecraft-version>-R0.1-SNAPSHOT'

charred blaze
tender shard
tender shard
charred blaze
#

org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT

ivory sleet
#

Technically u can check the repository if such a version exists

charred blaze
#

like this?

ivory sleet
#

but else that yes

#

Or well 1.19.4 maybe?

charred blaze
#

maybe?

#

how do i check

ivory sleet
#

Depends on what u want

charred blaze
#

want to create 1.19.4 spigot plugin

ivory sleet
#

Then use 1.19.4

#

(:

charred blaze
#

hmm okay

#

test {
useJUnitPlatform()
}
can i remove this?

remote swallow
#

do you have Tests

charred blaze
#

dont know. i just created gradle project

hazy parrot
#

So you don't, you can remove it

remote swallow
#

you dont, you can remove it

charred blaze
#

thanks

tardy delta
#

im confused

charred blaze
#

why

ivory sleet
#

Or you unit test ur plugin

#

🤩🤩

tender shard
#

I unit test my NMS library

ivory sleet
#

Nice

ivory sleet
#

But do you integration test it, mutation test it and system test it? (/s)

tender shard
#

i dont even know what that means lol

young knoll
#

The only mutant here is Conclure

#

THEY DIDN'T HAVE UNIT TESTS IN THE 80s

#

Probably

ivory sleet
#

Well you have system tests that test whether the entire system fulfill its engineering requirements, then integration tests when your module fulfill its engineering requirements when talking to other modules, and mutation tests is a more tiresome process, but it essentially expects your code to fail as it will byte-code inject incorrect data into ur variables, if ur code still runs as fine then the mutation test fails

tardy delta
#

when you only have one module :)

ivory sleet
#

🥲

#

(Additionally) You have acceptance tests that regard the business requirements (not the same as engineering requirements, as they’re more end-client directed)

charred blaze
#

what is unit tests

#

dont drop me whole article please

remote swallow
#

someone drop him an article

tardy delta
#

you test an unit

charred blaze
ivory sleet
#

Well there are tons of other test types also, but those are probably most important

#

A unit is often a class, a unit test is a test (often a function) which tests whether a function from the unit works as expected

charred blaze
#

whats wrong bruh

ivory sleet
#

What does the red say?

charred blaze
ivory sleet
#

Show me ur gradle

charred blaze
tardy delta
#

i think gradle is the issue

charred blaze
#

i think i am issue

#

'org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT'

#

is this correct thing?

round finch
tardy delta
#

i wish i knew how those git commands work

charred blaze
#

i wish i had good pc

ivory sleet
#

Greened

round finch
#

how does people make it easier for updating plugins live

ivory sleet
#

You need to add mavenCentral()

charred blaze
ivory sleet
#

Under repositories {

charred blaze
#

thanks

ivory sleet
round finch
#

i have seen some people debug and maven outpout floder stuff

tardy delta
#

you dont ever want to work with gradle if you have a 450 lines long build.gradle

round finch
#

oh gosh sounds like pain

charred blaze
#

hm its still red

tardy delta
#

and a few other build.gradle, and it complains that lombok generated methods cannot be found

ivory sleet
#

Tbf u were using the poopy groovy dsl

#

I wrote this guide long time ago actually

ivory sleet
#

Maybe ye

ivory sleet
#

Understandable

tardy delta
#

uhh it was like that before

#

its a fork

ivory sleet
#

Ah I see

tardy delta
#

refactored it a bit

#

but its terrible

ivory sleet
#

Fair enough

tardy delta
#

me who never is on the forum

ivory sleet
#

🥲 kind of same

charred blaze
remote swallow
tardy delta
#

dark reader

remote swallow
#

ayo conclure what da dog doin

lost matrix
#

I got only a few because of all the tutorials

tardy delta
#

ya

remote swallow
#

real

ivory sleet
remote swallow
#

i have more total downloads

#

ratio

ivory sleet
#

Well hopefully i can get some cool stuff once my little mod is done

remote swallow
#

you have more ratings though

ivory sleet
#

I do?

#

Oo

remote swallow
#

31 total

#

i have 2

ivory sleet
#

Ah