#help-development

1 messages · Page 2272 of 1

noble lantern
#

that means the status is slow

visual tide
#

welllll

noble lantern
#

because of how many ppl are using it

#

when its yellow it means speeds are slightly faster

visual tide
#

you could get it to compile if you generate classes that have the methods you need

#

it just wont run 🙂

noble lantern
#

copilot can do that for me

visual tide
#

copilot is fun

noble lantern
#

that literally sounds like it was made for copilot to do

#

indeed it is

visual tide
#

like sometimes it does the smartest stuff ever

#

and sometimes it spits out total bs

noble lantern
#

it gave me some whack shit typing that code block above

hybrid spoke
noble lantern
#

it was making a basic window frame

noble lantern
#

fuck connecting anything else

#

only thing is, is how would you mint new coins

#

on block break

#

yes

hybrid spoke
visual tide
#

and for some reason it just suggest stuff i already wrote myself like 2 lines above

visual tide
#

oh god that reminds me of that dreadful film i watched once

#

i quote

#

"i just need root access to hack the blockchain and stop the timer!!!!"

hybrid spoke
#

fake it till you make it

visual tide
visual tide
hybrid spoke
#

"ahh, he's too strong i cant hack him, he's fighting back!!" - "wait i will help you!" 2 people on 1 keyboard

visual tide
#

their firewall is the strongest in the world, i cant hack this!

#

ill have to use y secret weapon

visual tide
#

hammers on keyboard randomly

#

im in!

noble lantern
visual tide
hybrid spoke
#

lets make a firewall where you need to beat it in tetris if you want to access

noble lantern
#

Ban

visual tide
noble lantern
#

I felt so stupid

#

Took 10 times to beat it

hybrid spoke
#

that would be a good movie

#

some hacker parody

#

but a real hacker movie would be interesting too

visual tide
#

tetris theme plays
Oh no! their firewall is impenertable!

daring whale
#

any idea on how to set it so that you can compile the plugin you have made on github

hybrid spoke
#

like a programmer who randomly found a major exploit

hybrid spoke
#

and takes over the world

paper viper
#

People should be able to clone it

visual tide
noble lantern
daring whale
#

like a github action

paper viper
#

Ah

noble lantern
#

Or setup a tag

#

And down load the compiled binary you upload there

paper viper
#

I use CircleCI because I’m weird

noble lantern
#

Circleville isn't too bad

daring whale
#

alright thanks

noble lantern
#

Im old fashioned i just hand do things

paper viper
#

Mainly tho it’s cause I can’t afford

#

Jenkins server

noble lantern
#

Jenkins :(

eternal night
#

Jenkins MonkaChrist

noble lantern
#

I heard its aids to setup

paper viper
#

Sort of

vocal cloud
#

Based?

visual tide
visual tide
hybrid spoke
visual tide
#

how to offend 15 thousand people 🙂

noble lantern
visual tide
visual tide
noble lantern
#

Whos that

#

Is that me

hybrid spoke
#

sadly there is no good action hacker movie

noble lantern
#

Oh he just like me fr

visual tide
#

idk how to spell the guy

noble lantern
visual tide
#

attenboroough?

#

like

#

the british nature documentary guy

#

with the calm af voice

#

the old guy

reef lagoon
#

is there a way to select paper plugin after i selected spigot plugin in intellij

noble lantern
#

How would you program a British accept

noble lantern
reef lagoon
#

no i need paper

noble lantern
#

The maven plugin will detect it

visual tide
#

bo'el 'o wo'ah

reef lagoon
#

I tried but it's red for some reason

noble lantern
#

So switch hto paper maven import then

#

Show pom

#

Or screnshot

hybrid spoke
#

or leave the server

noble lantern
#

?paste

undone axleBOT
noble lantern
#

Hey now

visual tide
noble lantern
#

Get your game on

visual tide
#

go play

noble lantern
#

I forgot the next part

#

99% its "get laid"

#

But ik its not

visual tide
#

same but with rock star

hybrid spoke
#

POKÉMON

visual tide
#

get paid

reef lagoon
#

cant send the pom

noble lantern
#

Same thing

reef lagoon
#

why tf cant i send imges

hybrid spoke
#

?paste

undone axleBOT
noble lantern
visual tide
#

#verify

noble lantern
#

?link

#

Oh

#

That ^

hybrid spoke
#

?verify

visual tide
#

?verify

#

:/

reef lagoon
#

lol?

visual tide
#

?verify in #verify

hybrid spoke
#

?verify wisijs

noble lantern
#

3 developers with a collective iq lower then the room temperature

#

Ggs

hybrid spoke
#

does it only work in the channel

#

?verification

visual tide
reef lagoon
#

there

noble lantern
#

Use

#

?paste

undone axleBOT
noble lantern
#

I dont download files sry

reef lagoon
#

what u can expand it

noble lantern
#

Im on mobile

visual tide
#

change this bit
<dependency> <groupId>io.papermc</groupId> <artifactId>paper-api</artifactId> <version>1.19-R0.1-SNAPSHOT</version> <scope>provided</scope> </dependency>
to
<dependency> <groupId>org.spigotmc</groupId> <artifactId>spigot-api</artifactId> <version>1.19-R0.1-SNAPSHOT</version> <scope>provided</scope> </dependency>

reef lagoon
#

no I need paper

visual tide
#

oh

#

uh

reef lagoon
#

im trying to convert a spigot plugin to paper

noble lantern
#

Ik the issue

#

Its the repo url

#

Go ask in paper discord for that

#

I had same issue a bunch too

reef lagoon
#

oh alright thanks

visual tide
noble lantern
#

A lot of forums online use a old repo url

reef lagoon
visual tide
#

hm

noble lantern
#

Yeh just bad repo url

visual tide
river oracle
#

Paper api gross 😝 😑 😐

noble lantern
#

Unless you didnt try invalidating caches and restarting

reef lagoon
noble lantern
#

As well as reloading maven

noble lantern
reef lagoon
#

no

reef lagoon
#

exact one im using lol

visual tide
#

odd

#

cuz that is the right repo

noble lantern
#

try what i said

noble lantern
#

not the reflection stuff lol

#

or you can

#

look into other tps plugins rq

#

and see how they do it instead of switching for one method

reef lagoon
#

they all use gradle

modest garnet
#

how would yall recommend multi version support, would it be a good idea to just develop the plugin in the lowest version i want?

reef lagoon
#

and im getting fucking ignored on papermc lol

next stratus
noble lantern
#

in fact

#

bam reflection is all done in this file right here

reef lagoon
#

gradle is literally harder and slower

next stratus
#

It's easier and faster

noble lantern
#

gradle is way easier

#

ngl

next stratus
#

One line imports ❤️

reef lagoon
#

2 hour reloads ❤️

next stratus
#

20 line maven imports 🤮

noble lantern
#

2 hours reloads?

next stratus
reef lagoon
#

builds*

noble lantern
#

More like 10 seconds haha

#

first builds is long ill admit

reef lagoon
#

10 seconds

#

bro its fucking 30mins

noble lantern
#

but once gradle daemons running

#

boom

reef lagoon
#

for first build

noble lantern
#

nah, 30 seconds max

next stratus
#

get a better pc

#

you just need to keep your wrapper up to date lol

noble lantern
#

this is how you normally do it

#

unless you want to go through hell

#

of multi versions with different code bases....

modest garnet
noble lantern
#

that what i mean

modest garnet
#

cause realistically the only thing that might change is the blocks etc

noble lantern
#

gradle

next stratus
#

lol

reef lagoon
#

no

noble lantern
#

@reef lagoon

While do prefer maven sometimes

#

only

reef lagoon
#

what the fuck

noble lantern
#

and only for remapped jars

next stratus
next stratus
noble lantern
#

remapped jars is only time i use maven cause no ones converted the special source to gradle 😠

modest garnet
#

is paper api better than spigots?

noble lantern
#

yes and no and yes

#

while also no

#

but also yes?

#

but a lot of no

modest garnet
#

yea nice one

noble lantern
#

depends who you ask honestly

buoyant viper
#

its basically the same thing

#

paper just doesnt like strings

noble lantern
#

it has a few additions

#

like async teleporting

#

^^

#

thats the annoying part

#

i fucking hate that...

modest garnet
#

so stick with spigot?

noble lantern
#
Player.sendMessage(Component.textOf("Hello, world"));
#

like cmon paper

#

really?

modest garnet
#

eww

noble lantern
#

thats not needed

frozen cedar
#

What if my code can't get a chunk? he hangs stupidly
world.getChunkAt(chunk_coord[0], chunk_coord[1]).getChunkSnapshot()

Maybe I need to make a .load() before receiving it?

noble lantern
#

i hate paper forces that

buoyant viper
#

i mean u can still use the spigot api version of the method

noble lantern
#

cant hurt

buoyant viper
#

it just doesnt like when u do

noble lantern
#

if not come back

noble lantern
#

its ugly

#

i like pretty code

buoyant viper
#

xd

noble lantern
#

pretty code :))

#

all async too and then calls back synchronously when completed insert a sfw moan emoji bc i dont have one

buoyant viper
#

String#formatted?

#

oh right new java

noble lantern
#

yeah this is all in java 16

#

still older

#

but newer

buoyant viper
#

ye

#

i still write for jre1.8 compatibility 🫠

noble lantern
#

matches up

buoyant viper
#

LMAO

vocal cloud
noble lantern
vocal cloud
#

imagine using 1.8 anything

buoyant viper
noble lantern
#

LMAO YES

#

i was praying it was an apple emoji

#

makes it 10x funnier

buoyant viper
#

yeaahhhh

noble lantern
#

Ngl this is fucking pinnacle of developer humor

noble lantern
#

this tops it

#

100%

buoyant viper
reef lagoon
#

I just had to reload it @noble lantern

#

💀

noble lantern
#

i did mention that

buoyant viper
noble lantern
noble lantern
buoyant viper
#

i give it google either already has it or will have it in about 3-6 months for android

noble lantern
#

im on pc

#

i switched to pc

buoyant viper
#

itll take windows about 3 years

noble lantern
#

5 mins ago

#

yeah sadly

buoyant viper
#

and 16 security updates later

vocal cloud
#

android doesn't have it

noble lantern
#

i have 4 pending rn

buoyant viper
#

sadly as soon as i see the update button i update

vocal cloud
#

My computer randomly crashes and thats when I get my updates

noble lantern
#

^^

vocal cloud
#

Along with a free Maven reset.

noble lantern
#

exactly mike

vocal cloud
#

Since it corrupts Intellij's caches

noble lantern
#

going strong

vocal cloud
#

Idling with just discord and chrome open

noble lantern
#

im prolly same but i have like

#

5 intellij tabs open

#

sec

#

oh wow

buoyant viper
vocal cloud
#

I have 3 open actually, I just pretend it doesn't exist

noble lantern
#

godhelpme

vocal cloud
#

Gotta love memory usage.

#

I have too much of it anyways. Need more uses for it

buoyant viper
#

im sorry do u have htop on windows

vocal cloud
#

Wish

#

console > de

buoyant viper
#

i love windows 11 idle using almost half my ram

vocal cloud
#

11 👀

buoyant viper
#

sadly

vocal cloud
#

Did windows decide to do that by itself?

eternal oxide
#

7 was the best. all down hill from there

vocal cloud
#

I changed BIOS settings to prevent windows from ever letting me

frozen cedar
buoyant viper
vocal cloud
#

Yesirreee

#

Can't have windows enjoying my company

frozen cedar
#
Caused by: java.lang.IllegalStateException: Asynchronous chunk load!
        at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:15) ~[patched_1.16.5.jar]
        at org.bukkit.craftbukkit.v1_16_R3.CraftWorld.loadChunk(CraftWorld.java:599) ~[patched_1.16.5.jar]
        at org.bukkit.craftbukkit.v1_16_R3.CraftChunk.load(CraftChunk.java:191) ~[patched_1.16.5.jar]```
vocal cloud
#

hes_UwU You're ahead of your time. One day chunk loading will be async

frozen cedar
#

ok i fix it

vocal cloud
#

Just run it sync EZ

frozen cedar
frozen cedar
#

server freezes

vocal cloud
#

Why is this necessary?

noble lantern
#

plus

#

its gonna do that one tick later

#

so its gonna do the same exact thing but honestly your probably loading a lot of chunks at once

#

which is likely the root cause

#

Can you show code outside of that code block there?

modest garnet
#

is this efficient or is it better to read and save the file every time i access?
would it be better to just use the String List?

noble lantern
#

once on server shutdown

#

and once every x amount of minutes in a CompletableFuture

#

any other time is unecesary mostly

modest garnet
#

so i should just add a runnable or something which saves the String List, every x minutes and itll be fine

noble lantern
#

yes but make sure its async

modest garnet
#

as onEnable i place all the data in a Local String List

modest garnet
noble lantern
#

there is times

#

you do not want it to

#

like on shutdown, run it sync (It will block the main thread and write to file)

#

while async, will let other code run while it is also saving

#

which is not ideal for server shutdowns

#

but 100% ideal during runtime

#

on server startup, sync (blocking, main thread) operations are good too

modest garnet
#

so how would i convert my current code to async do i need to?

noble lantern
#

You can simply run a BukkitRunnable and runTaskAsync

#

or

#

the chad

#

the gigachad way

#

CompletableFuture

modest garnet
noble lantern
noble lantern
#

i would reccomend making a different class to handle those though

modest garnet
#

ok thanks youve really helped today haha

noble lantern
#

instead of it being in just your main class

modest garnet
noble lantern
#

yes cleaner code is the main thing

modest garnet
#

ok ty

frozen cedar
#

server freezes

noble lantern
#

and seeing how many times that for loop fires before it crashes

#

i feel like its something else and not just chunks unable to load

#

ive loaded 9x9 chunks before and it was near instantaneous, and it was just in a simple for loop like that nothing complicated either

frozen cedar
#

The generator worked, but stopped abruptly :_) It freezes on the very first chunk

buoyant viper
#

someone should PR a proxy method called getSchedular() for dumbasses who cant type (me)

vocal cloud
#

Make a method in your main called getSchedular and call it instead

green prism
ivory sleet
#

You shouldn’t shade it

#

But you’d have to set the scope to compile

green prism
#

Ah

#

Ouch

green prism
# ivory sleet But you’d have to set the scope to compile

dev.lone.itemsadder.api.NotActuallyItemsAdderException: Error: ItemsAdder does not seem to be installed. This is just the API reference, not the actual implementation.

            <groupId>com.github.LoneDev6</groupId>
            <artifactId>api-itemsadder</artifactId>
            <version>3.2.2-beta5_2</version>
            <scope>compile</scope>
        </dependency>```
chrome beacon
#

Don't shade that

ivory sleet
#

Hence why you shouldn’t shade it as olivo pointed out

#

The dependency only gives you a set of interfaces that explode

tardy delta
#

java moment

ivory sleet
#

Yes

#

Type erasure

opal oasis
#

does anyone know how to make for example /plugins give a custom message?

ivory sleet
#

capture of ? could be anything within the bounds of the wildcard

#

Which disqualifies type Object

#

What if the capture is a type of a function
func(capture<?>)

#

the function might actually be consuming a subtype of Object

tardy delta
#

ugh

ivory sleet
#

And Java doesn’t fully know if that captured type is Object, tho you might be more clever

#

Or well you are more clever

tardy delta
#

maybe include this

@FunctionalInterface
    private interface PlaceholderPlacement {
        void apply(PreparedStatement ps, int i, Object t) throws SQLException;
    }```
#

tried to make a method that removes the boilerplate code

#

but uh that map looks really ugh

ivory sleet
#

Lol

#

Feels like you’re complicating stuff for little reason

tardy delta
#

i was bored and did some stuff

ivory sleet
tardy delta
#

or this

#

hehe

ivory sleet
#

I love the consistency

tardy delta
#

map looks hotter but map slow

chrome beacon
ivory sleet
#

I’m perplexed

opal juniper
#

im thinking there must be a way to do this "nicely"

vale ember
#

reflection?

tardy delta
#

java 17

ivory sleet
#

IdentityHashMap<Class<?>,CoolFunction>

opal juniper
#

^

chrome beacon
opal juniper
#

or that

tardy delta
#

switch (class) doesnt work if you mean that

opal juniper
#

literally anything lol

tardy delta
#

ah wait java 16

chrome beacon
# tardy delta switch (class) doesnt work if you mean that
#

Oh 16 ;/

tardy delta
#

i can switch to 17

warm galleon
#

is there a way to disable the built in ai or pathfinding of an entity but still make it so i can setVelocity?

tardy delta
#

doesnt really matter

chrome beacon
#

Then use what I sent :)

vale ember
#

Reflection is bad and all but i wonder will something like this work?

ps.getClass().gtMethod("get" + o.getClass().getSimpleName().invoke(ps, i, o);
opal juniper
#

u are missing a bracket

chrome beacon
#

?tryitandsee

#

;/

opal juniper
#

and an e

opal juniper
stark wedge
#

does anyone have a recommended Economy Data holder plugin that doesn't have commands for in server, and depends solely on a 3rd party plugin to program and execute commands like /balance?

I Want to use essentials but it has everything, and I want to make my own economy plugin with variations of my liking without allowing players to do /bal or /balancetop and getting essentials response

#

Or is there a way to disable this in server with essentials

#

wait duh

#

this could be fixed with permissions

#

I think I answered my own question lmfao

chrome beacon
#

You did

stark wedge
#

gg

#

sorry lmfao

buoyant viper
#

TIL where to use Map#computeIfAbsent vs Map#putIfAbsent

#

bc apparently putIfAbsent returns null if there wasnt already a key

flint coyote
#

I mean you can parse it yourself but what result do you expect when the color switches in the name?
Like §2Rain§9bow

manic bison
#

Hey, how could I code a custom shop that would take 2 diamonds from inventory (any) and give back 32 custom emeralds (itemstack with itemmeta) ? I'm trying to get it to work but it doesnt work if inventory is full, even if there's a uncompleted slot of emerald

#

here's my code right now, it doesnt work

                        for(int i=0; i < player.getInventory().getSize() ; i++) {
                            ItemStack actit = player.getInventory().getItem(i);
                            if(actit != null && actit.getType() == Material.PRISMARINE_SHARD && actit.hasItemMeta() && actit.getItemMeta().getDisplayName().equalsIgnoreCase("§a90$")); {
                                if(actit.getAmount() == 64) {
                                    
                                }else {
                                    Main.econ.withdrawPlayer(player, 90);
                                    player.getInventory().addItem(getItem(Material.PRISMARINE_SHARD, "§a90$"));
                                    ItemStack ban = new ItemStack(Material.EMERALD, 1);
                                    ItemMeta banM = ban.getItemMeta();
                                    banM.setDisplayName("§aBanque");
                                    String bal = "§7Vous avez §a§l" + String.valueOf(Main.econ.getBalance(player.getName())) + " §a$";
                                    banM.setLore(Arrays.asList(bal));
                                    ban.setItemMeta(banM);
                                    banquee.setItem(31, ban);
                                    break;
                                }
                            }
                        }
                    }
modest garnet
#

YamlConfiguration modifyFile = YamlConfiguration.loadConfiguration(file); modifyFile.getConfigurationSection()

how can i get ALL configuration sections?

modest garnet
#

??

flint coyote
modest garnet
#

not what i asked

flint coyote
#

You iterate over all the sections below one section

#

Obviously it returns a collection. So instead of iterating you can also use it for something else

glossy venture
dry forum
#

how do nms dependencies work? i know the maven and all that but if the nms changes from 1.12 -> 1.19 for example and i want it to support 1.12 -> 1.19 what maven version of spigot would i use? does each version need to be added as a dependency?

glossy venture
#

or did you leave it blank

#

intentionally

flint coyote
#

They both implement the #getKeys method

#

And yes I left it blank since I wouldn't know what his Section is named

daring lark
#
    public void onInventoryClick(InventoryClickEvent e) {
        brewingFix(e);
    }

     private void brewingFix(InventoryClickEvent e) {
        if(!(e.getClickedInventory() instanceof BrewerInventory))
            return;
        if(e.getCursor().getType() == Material.POTION)
            e.setCancelled(true);


    }``` did someone know why my code sometimes cancels event and somtimes not? is it becouse of 20 ticks?
manic bison
glossy venture
#

idk if thats even possible

flint coyote
#

Afaik it is possible. I usually have a root section anyway since it looks cleaner

flint coyote
modest garnet
flint coyote
#

I don't think you can get them directly without looping the strings and calling #getConfigurationSection().
There's only #getParent() and #getRoot() but no direct way down

limpid bronze
#

Hey, I've got a bug or something. For a custom crafting gui and verification, I'm using RecipeChoice#test() to check if a the RecipeChoice contains a ItemStack. But when I do recipeChoice.test(item) where item is equal to air and where the recipeChoice is [OAK_PLANKS, SPRUCE_PLANKS, BIRCH_PLANKS, JUNGLE_PLANKS, ACACIA_PLANKS, DARK_OAK_PLANKS, CRIMSON_PLANKS, WARPED_PLANKS], the function return true while item is not contained in that recipeChoice. Is there an alternative to that?

modest garnet
#

hmm

flint coyote
#

I mean you can probably use another yaml library that has this functionality. But unless you have to reload the sections multiple times per second i doubt you will run into problems by just looping them

#

If they don't get new childs you only have to loop once anyway.

rose aspen
#

Other question: There is no ArmorEquipEvent in Spigot?

flint coyote
# manic bison its an inventory, its the GUI

If you only have full stacks (64) of prismarine your code should not do anything. No matter what other item you have in your inventory. I'm confused why you mentioned that you have another item that is <64 in your inventory

manic bison
flint coyote
#

So what's the problem then? :D

manic bison
#

but if i have 35 stacks of prismarine and 45 planks, and i want to withdraw prismarine, it does withdraw my vault account, but doesnt give me anything

manic bison
flint coyote
#

What's the result and what's your input?

flint coyote
manic bison
flint coyote
#

Because you basically go
loop {
if(isMyPrismarine() && amount<64) {
// do something
else {
// do nothing
}
}

#

So in that case I wouldn't expect anything to happen. And you just said nothing would happen. Now you say it removes items but doesn't give you anything.

manic bison
#

well basically that would mean that it does something, but my inventory is full so i cant receive the item

flint coyote
#

Yeah do what it says. getLastColors only gives you a String. In order to use that as a color you will have to use the function that is mentioned

#

Or actually it depends. What does getLastColors return? Is it BLUE or §0 ?

flint coyote
#

yeah but what string

#

"BLUE", "§0", something else?

#

Because depending on that you will have to decide what you do with it

#

I can read the documentation xD But it doesn't make clear in what form they are represented in the string. That's why I'm asking if you could test it and tell me

#

I would expect them to be §0 but it's better to be sure

#

System.out.println(org.bukkit.ChatColor.getLastColors(name))

flint coyote
#

Huh? Custom color? So another color besides the one that minecraft/spigot has by default?

#

In that case I don't even know if spigot will return it correctly when it's none of the defaults (§0 to §f). But checking the output of #.getLastColors(name) will answer that for you

#

well then there's your answer about the custom colors xD

#

I mean there sure is but when you use custom colors over those that minecraft provides than you will need a custom parser aswell

#

Don't you need some kind of mod anyway to let players see those custom colors?

manic bison
daring lark
#
    public void onInventoryClick(InventoryClickEvent e) {
        brewingFix(e);
    }

     private void brewingFix(InventoryClickEvent e) {
        if(!(e.getClickedInventory() instanceof BrewerInventory))
            return;
        if(e.getCursor().getType() == Material.POTION)
            e.setCancelled(true);


    }``` did someone know why my code sometimes cancels event and sometimes not? is it becouse of 20 ticks?
flint coyote
#

May I see how you set those colors to a string then?

manic bison
flint coyote
#

How do you create the colored string? Like the one you want to receive the colors from

daring lark
#

i'm just want players to not be able to place potions in brewing stand

flint coyote
flint coyote
#

Can you add a debug message that outputs e.getCursor().getType()?

#

and where does the items name receive its colors?

daring lark
#
[20:41:08 INFO]: [RPG] POTION
[20:41:09 INFO]: [RPG] POTION
[20:41:09 INFO]: [RPG] POTION
[20:41:10 INFO]: [RPG] POTION
[20:41:10 INFO]: [RPG] POTION
[20:41:11 INFO]: [RPG] POTION
[20:41:11 INFO]: [RPG] POTION
[20:41:12 INFO]: [RPG] POTION
[20:41:13 INFO]: [RPG] POTION
[20:41:13 INFO]: [RPG] POTION
[20:41:14 INFO]: [RPG] POTION
[20:41:15 INFO]: [RPG] POTION
[20:41:15 INFO]: [RPG] POTION
[20:41:15 INFO]: [RPG] POTION
[20:41:16 INFO]: [RPG] POTION
[20:41:17 INFO]: [RPG] POTION```
it's always potion
flint coyote
#

I'm trying to understand what you mean by "custom colors" to decide on how to parse them

flint coyote
#

And the message was also sent on the click that did not cancel? Or did you have to spamclick to make it work?
If you are sure it was printed on that one, please also print the inventory type

daring lark
flint coyote
#

I would expect it to work as it should unless some packets are messing up

flint coyote
#

And that's what I expected

#

So basically if you click fast enough you pretend that you want to place AIR but you actually have your potion placed. You can prevent this with another check I suppose. Let me try

chrome beacon
#

You need to check the length of the array

limpid bronze
#

You probably confusing index array

#

First element is get with list[0]

#

Second list[1] ect...

limpid bronze
chrome beacon
#

Regex

twilit roost
#

any idea why its always on one side and not in front of the player?

Location spawnAt = p.getEyeLocation().add(p.getLocation().getDirection()).subtract(0,.6,0);
distant basin
modest garnet
distant basin
#

example if arg 1 is null ( player name is null) target is player

#

arg.length == 2?

#

args.length == 2 && args[1] == null

#

um

#

kk

#

hmm

vocal cloud
#

Well where is line 23

distant basin
#

yes

flint coyote
#

@daring lark looks like it actually does completely ignore the event at times. Guess there isn't much you can do in that case. Maybe block players from interacting brewing stands at all

distant basin
#

print args?

modest garnet
distant basin
#

kk

#

maybe its not from tab comp?

flint coyote
# twilit roost bump

Can you print the location? If would guess it gets the block location and so it will always spawn on .0 .0 .0 edge of a block

dry forum
#

why doesnt this work? WorldServer s = ((CraftWorld)p.getWorld()).getHandle(); EntityArmorStand stand = new EntityArmorStand(s); stand.setLocation(loc); PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving(stand); ((CraftPlayer)p).getHandle().playerConnection.sendPacket(packet); Cannot resolve constructor 'EntityArmorStand(WorldServer)' line 2 Cannot resolve method 'setLocation' in 'EntityArmorStand' line 3 Cannot resolve symbol 'playerConnection' last line (1.18)

distant basin
#

[12:14:18 INFO]: [SoulSystem] [STDOUT] get

modest garnet
#

i think its cause he didnt provide a 2nd arg

distant basin
#

nop its subcommand

twilit roost
distant basin
#

example: /soulsystem get playername if playername is null use command sender for player

flint coyote
distant basin
#

i get it target = SoulSystem.plugin.getServer().getPlayer(args[1]);

distant basin
flint coyote
modest garnet
distant basin
#

yes, anything is ok i dont know why i get error

twilit roost
flint coyote
#

But can't u still do
workers.put(s, modifyFile.getConfigurationSection(s).getInt(s + ".workers"));?

modest garnet
distant basin
undone axleBOT
flint coyote
#

Also if you use .getKeys(true) you can probably shorten it to
workers.put(s, modifyFile.getInt(s + ".workers")); however your "putting" s will also change then

final star
#

Hey guys, so I wanted to know if there's a way I can make a percentage scheme by dividing it into X parts, dividing the 100% into

value 1 = 30%
value 2 = 30%
value 3 = 40%

I've tried but I can't

I was doing like in the print, just like, it has a chance of falling into none and I don't want that, I want it to fall into 1

buoyant viper
#

if theres only 1 arg supplied thats bound to error

distant basin
#

error is not for this

#

holy

#

i remove it fixed, i remove it before and not work

#

ty for help 💛

flint coyote
twilit roost
# flint coyote For me that code works perfectly fine and spawns it in front of me
public static List<Location> createCloud(Location at,int amount){
    List<Location> ret = new ArrayList<>();
    Location loc = at.clone();
    int i =0;
    while(i<amount){
        if(at.distance(loc)>=2)
            loc = at.clone();
        Vector random = Vector.getRandom();
        loc.add(random);
        ret.add(loc);
        i++;
    }
    return ret;
}
``` im looping thru these locations to create that cloud
flint coyote
#

I guess your issue is that you are cloning your loc and then only clone from that loc again and again instead of falling back to your default every time you loop

twilit roost
#

well I want it to be randomly
if distance from location is > 2 I reset it at default location

flint coyote
#

I see

twilit roost
#

but I don't see how this would have created cloud at same position every single time

flint coyote
#

on a different topic: Is there a reason you do not use a for loop here?^^

twilit roost
#

didn't work for me for some reason
no clue why tho

soo I sticked with while

flint coyote
#

but what you did there is exactly what for loops are made for.
for(int i=0; i < amount; i++) {
// code
}

twilit roost
#

ye ikr

flint coyote
#

anyway. Lemme try it

twilit roost
#

oh ik y i sticked with while

I was spawning those particles in the for loop but I had some errors in that
soo I thought while would fix it
didn't but I was too lazy to fix it

sterile token
#

Is there an event which allow you to know when you right click on a player?

twilit roost
#

PlayerInteractAtEntityEvent

sterile token
#

Oh ok

#

perfect thank!

#

PlayerInteractAtEntityEvent

unkempt lintel
#

does anyone know if theres a way to code mods and like how to do it

sterile token
twilit roost
#

ye there is a way to code mods

#

using JAVA

flint coyote
#

@twilit roost alright found it. It's the Vector.getRandom()

        return new Vector(random.nextDouble(), random.nextDouble(), random.nextDouble());
    }

since it only returns positive numbers it can only go to one side

sterile token
#

You need to use a specific Api for mods

twilit roost
#

you open ur favorite IDE
select java
import api for mods
start coding

twilit roost
flint coyote
#

Basically you just wanna generate 3 numbers between -1 and 1 or -0.5 and 0.5 depending on your needs

sterile token
#

Itstom do you know if there is another event which allow me to the right clicked entity, the click type and the item?

flint coyote
#

Oh and also I would recommend to create a function "spawnCloud" or something that does not store the values in a list prior to spawning the particles but spawns them directly in a loop. Just for performance reasons :)

twilit roost
distant basin
#

kk

flint coyote
#

as long as you don't call new Random() everytime you create numbers xD

twilit roost
#

works fine

flint coyote
#

It does. It's just that creating a new Random object everytime is very bad performancewise

twilit roost
#

oh you meant it like this
imma change it to one final in main class

flint coyote
#

Technically you could also use the same vector everytime and just change it's values accordingly aswell^^

#

Aight perfect

tardy delta
sterile token
#

You are not paying anyone

#

If you want to persist your message open thread on the chanel

dry forum
#

.... it went up about 20 messages no one is gonna see that

sterile token
#

A thread lmao

#

You open it and wait patiently until someone answer/help

dry forum
#

a thread isnt gonna fix much

sterile token
#

If want instant support pay someone...

#

😂

dry forum
#

replying to my message isnt gonna kill you or anyone else so chill out, who said i needed instant support?

chrome beacon
dry forum
#

literally everyone bumps their messages

sterile token
tardy delta
#

lemme switch to java17

chrome beacon
#

Switches are great

sterile token
#

Yeah i prefer switch

#

But the problem is that you cannot check many conditioons

#

As you will do it with if

#

In the other hand switch are faster than if

tardy delta
#

is openjdk from oracle?

sterile token
tardy delta
#

oh didnt know

sterile token
#

Or not

dusk flicker
#

its a lot

sterile token
#

I i dont know really

dusk flicker
#

not just oracle

tardy delta
sterile token
#

Oracle mantains openjdk

tardy delta
#

wish i was on linux

sterile token
#

What is coretto?

#

I have seen many people using coretto 17

chrome beacon
#

Amazons OpenJDK

sterile token
#

Oh

#

I prefer the original one

#

I prefer JDK

ancient plank
#

I use JSDK to compile my java code (java script development kit!!!)

sterile token
#

Its really a nightmare from that part

tardy delta
#

downloaded it and now i got a fking zip file lol

sterile token
#

🤭

tardy delta
#

im not smh

quaint mantle
#

how do i give a user a potion

tardy delta
#

sudo apt install openjdk-17-headless not working smh

sterile token
quaint mantle
#

what about like the icon for a inventory

sterile token
dusk flicker
#

thats automatic based on the effect

ancient plank
#

potion item

#

is what they want, I'd assume

sterile token
#

What he means?

#

I dont understand

dusk flicker
#

when you open your inventory, where it shows the effect, duration, and the little icon representing it

tardy delta
#

and what happened here

sterile token
dusk flicker
#

i probably have some others floating around

sterile token
#

JDK is the development kit right?

dusk flicker
#

ye

sterile token
#

It also install the JVM

paper viper
#

Yes

sterile token
#

Oh ok

#

And what about compatibilities?

tardy delta
#

im always picking the openjdk

paper viper
#

Also openjdk is better than jdk

#

Lol

tardy delta
#

but windows bruh it needs to move 500 files and it reached 20 now 🙄

dusk flicker
#

no

tardy delta
#

will reset my pc

sterile token
#

Windows == shity || mack == shity

dusk flicker
#

its just mac

tardy delta
#

and dualboot new distro

paper viper
#

we aren’t that sweaty

tardy delta
#

we arent that rich for a mac

paper viper
#

We are gamers too

tardy delta
#

actually idk price

paper viper
#

Lol

sterile token
#

For example which java version and which spigot api would need to use for making a full comatible plugin?

paper viper
#

Just don’t support legacy

sterile token
#

Why?

dusk flicker
#

its stupid

#

thats why

paper viper
#

Heeheehaw

sterile token
#

No i dont weant that answer

dusk flicker
#

too bad

paper viper
#

Go suffer in Java 8

#

Burn in Java 8

#

Lol

sterile token
#

😂

ancient plank
dusk flicker
#

either way, for full compatability would probably end up being J8 API1.8, but even then that will probably break at API1.13

paper viper
#

Java 17 is more optimized lol

#

You need to use OpenJDK

#

Idk what you have been using

#

Probably some version from 4chan lol /s

dusk flicker
#

lmao

sterile token
#

I was told that api 1.13 its the one that have more compatibilities between all the spigots

ancient plank
#

there's 1 spigot

tardy delta
#

finally installed the damn shit

#

windows moment

ancient plank
#

we all share the same bucket 🪣

dusk flicker
#

1.13 and newer are the newer api style

#

1.12 -> 1.13 had some big api changes

#

Could you still make plugins compatible with older versions? Yeah, should you? No.

#

Do the same as Spigot and only support the latest version

paper viper
#

Supporting legacy will literally break your spine. It’s so much workload

sterile token
#

Also changing topic, Map#computeIfAbsent return the map value if the key is already set?

dusk flicker
#

Thats why we should be telling anyone not running 1.19 fuck off

sterile token
#

😂

ancient plank
#

I just compile against lowest and call it a day, if there's a bug on an older version that my dev server isn't running on, skill issue

dusk flicker
#

you arent getting paid enough for doing minecraft development

tardy delta
#

@chrome beacon i thought 1.17 could use a switch on classes?

paper viper
#

I would not take 1.8 commission

dusk flicker
#

unless you are working for like one of the server giants or Mojang

ancient plank
#

I wouldn't take a pre 1.13 plugin commission, pre 1.13 is such a pain in the ass to work with

tardy delta
dusk flicker
#

I'll always be able to do pre 1.13, as I started development with that; but id still rather use latest / post 1.13

sterile token
#

Also changing topic, Map#computeIfAbsent return the map value if the key is already set?

ancient plank
#

I've done 1.12 SC_zero_think it wasn't that bad but I only did it because my favorite server used 1.12

dusk flicker
#

be patient

#

you know this

sterile token
dusk flicker
#

you could also check the Javadocs

sterile token
#

i cannot find them

#

😂

#

Im really dumb today

paper viper
#

What

tardy delta
#

check javadocs when you hover over method

sterile token
#

Dont bully me but i cannot find the javadocs

iron glade
#

Does anyone know if there's a simple way to get an java.awt.Color from a string or would I have to make my own method and return certain colors based on string?

tardy delta
#

dont tell me youre using eclipse

sterile token
#

Eclipse is really bad

dusk flicker
#

a quick google search

tardy delta
#

wasnt this possible in 16 too?

paper viper
#

He doesn’t use eclipse, he uses netbeans

ancient plank
#

sometimes you can get a much easier solution much more quickly just by typing your question in google

dusk flicker
#

for real

tardy delta
#

oh well actually i dunno about the case Type t

worldly ingot
iron glade
paper viper
#

It just means you are being lazy over using inheritance

tardy delta
#

mmh

paper viper
#

Is it cool? Yeah def

#

But I don’t rlly find a good use case for them

#

Only for very specific stuff I guess

flint coyote
# sterile token Eclipse is really bad

I used eclipse for years and recently swapped to intelliJ since I'm using it during my job aswell.
While I like a lot of things about IntelliJ there's still some things from eclipse that I miss in there

dusk flicker
#

I started on Eclipse, good for like 4 years until a friend finally forced me to IntelliJ

#

never looked back

paper viper
#

One of the things that was hard for me was the multiple projects but I like single project setup better now

dusk flicker
#

(I tried IntelliJ in those 4 years but could never figure out how to build the freaking jar and gave up)

chrome beacon
#

I too started with Eclipse and switched to IntelliJ and never looked back

tardy delta
#

still waiting for java to implement generics for primitives smh

tardy delta
#

probably some silly tutorial

flint coyote
#

What bothers me the most is that packages that have uncommitted changes are not highlighted. Only the files inside, once you open it up
Also having multiple projects files open without different windows can be somewhat helpful at times

paper viper
#

We need var arg generics

ancient plank
#

I liked eclipse, I just swapped because I was struggling to get maven to work in eclipse SC_zero_think

tardy delta
#

implements Something<String...> hmmmmm 🤔

paper viper
#

Gradle and eclipse is 🤮

worldly ingot
#

Gradle and eclipse is 🤮

#

FTFY

paper viper
#

😠 how dare you

tardy delta
#

ok looks like olivo has scammed me and you cant use a switch with a class object in java 17

sage patio
tardy delta
#

well i thought you meant that

#

but enhanced switch seems to mean smth else

chrome beacon
#

You can use that

tardy delta
#

waiiit

#

ah nice intellij i just switched to java17 and its still on 16

sage patio
#

why when i use getConfig.set() plugin.saveConfig() every line starts with # disappears?
like its the config.yml

# hmm
hmm2: 3
# well
# is the config.yml

i do getConfig.set("hmm2", 69);
and config.yml converts to this:

# hmm
hmm2: 69
tardy delta
#

snakeyml moment

#

you dont have that issue when only getting stuff

chrome beacon
sage patio
small current
#

addHeaders

tardy delta
small current
#

Idk if spigot works this way but

#

Its a linkedhashmap

#

All the paths and objects

#

When you load a yaml

tardy delta
#

well uhh thnk you olivo for telling me

small current
#

In spigot they might just modify the map

#

And dump

#

So there is no way of comments being there

#

Maybe add a header explaining stuff @sage patio

paper viper
#

lol

tardy delta
#

i shouldve asked md to add a new one when he was online yesterday

#

like this one

dry forum
#

nms issue

sage patio
tardy delta
sage patio
#

better now

paper viper
#

I mean you can already serialize Location

#

Built in yml serializer

tardy delta
#

why is this one giving problems and the other one not?

#

it expects a Object varargs

paper viper
#

Do you have multiple fillPlaceholders methods

tardy delta
#

nope only this one

#

could be ij being weird too

modest garnet
#

why is the s "greyed out"

final star
#

Hey guys, so I wanted to know if there's a way I can make a percentage scheme by dividing it into X parts, dividing the 100% into

value 1 = 30%
value 2 = 30%
value 3 = 40%

I've tried but I can't

I was doing like in the print, just like, it has a chance of falling into none and I don't want that, I want it to fall into 1
Hey guys, so I wanted to know if there's a way I can make a percentage scheme by dividing it into X parts, dividing the 100% into

value 1 = 30%
value 2 = 30%
value 3 = 40%

I've tried but I can't

I was doing like in the print, just like, it has a chance of falling into none and I don't want that, I want it to fall into 1

paper viper
modest garnet
paper viper
#

What does it remove

modest garnet
#

i cant remove it am i doing it wrong

#

the line

waxen plinth
paper viper
#

It removes the line?

#

What

torn oyster
#

how do I use hex codes in item names?

modest garnet
#

List<String> firstLore = plugin.getConfig().getStringList("factories.first.lore"); for (String s : firstLore) { s = s.replace("%efficiency%", plugin.efficiency.get(id).toString()); s = s.replace("%equipment%", plugin.equipment.get(id).toString()); s = s.replace("%workers%", plugin.workers.get(id).toString()); s = s.replace("%id%", id); }

it will remove the s = s.replace("%id%", id); line, then give the same error on the line above it

#

anyone

worldly ice
#

reassigning s doesn't do anything

#

if you're trying to change what that item in the list is

#

you have to replace it with List#set

vocal cloud
#

This is where one needs to learn how to write unit tests

modest garnet
worldly ice
#

yeah it should

modest garnet
#

ok ty

dry forum
#

why doesnt this work?
WorldServer s = ((CraftWorld)p.getWorld()).getHandle(); EntityArmorStand stand = new EntityArmorStand(s); stand.setLocation(loc); PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving(stand); ((CraftPlayer)p).getHandle().playerConnection.sendPacket(packet);
Cannot resolve constructor 'EntityArmorStand(WorldServer)'
line 2
Cannot resolve method 'setLocation' in 'EntityArmorStand'
line 3
Cannot resolve symbol 'playerConnection'
last line (1.18)

modest garnet
#

when was PersistentDataContainer added?

buoyant viper
#

?pdc

buoyant viper
dry forum
#

specialsource?

modest garnet
dry forum
#

ah found it

#

doesnt seem to be updated though so it wouldnt support 1.18?

buoyant viper
#

idk

#

i dont use NMS

dry forum
#

uhh yes?

#

thats just saying how to import nms and stuff not how to fix those cannot resolves

chrome beacon
#

._.

dry forum
#

oh mb

#

didnt see that line

chrome beacon
#

Just copy everything and you're good to go

minor pewter
#

Hey is there someone who can tell me how to create a .yml file that can save args after a command

dry forum
#

umm

#

do i need to have buildtools in my project directory or something then...

chrome beacon
#

No

#

Just run it somewhere

#

Doesn't matter where

dry forum
#

is it normal for it to install portable git in my project

#

java -jar <external location of buildtools.jar> --rev 1.18 --remapped now its just installing 1.18 buildtools...

chrome beacon
#

I hope you didn't run it in your project

dry forum
#

i ran that command in my project

#

how else would it know what to remap

chrome beacon
#

It installs things to your local maven repo

dry forum
#

wdym

chrome beacon
#

When it's done you can delete everything it created

dry forum
#

uhh

#

ok

chrome beacon
#

The required stuff is stored somewhere else

dry forum
#

seems like intellij didnt like me running that command andddd it crashed

#

and the project got deleted

#

lmao

chrome beacon
#

Huh

#

What did you do >.<

dry forum
#

all i did was run that command

#

in intellkij in my project

#

i made a save of the project though :p

#

so uh am i supose to run that command in my intellij project?

chrome beacon
#

No

dry forum
#

where am i supose to run it then i dont get it how would it know to remap my code if it doesnt have acess to my project

chrome beacon
#

Create a new folder. Put BuildTools jar in it. Open cmd in that folder and run the command. When it's done delete the folder and everything in it

dry forum
#

but thats just creating a 1.18.2 build tools

#

i dont need that

#

i just need to fix my code

chrome beacon
#

Step 1 is to get the required things installed

#

So run BuildTools like I said

dry forum
#

i have 1.18 buildtools installed

delicate lynx
#

it installs to your local maven

dry forum
#

i have buildtools.jar installed

#

i have git installed

#

yes i dont need that

#

i need to fix my code...

#

i already have 1.18 installed

chrome beacon
#

You need it in your local maven repo for it to remap

dry forum
#

oh?

chrome beacon
#

Please just stop arguing when we're trying to help you

#

Just run BuildTools like I said and we'll get things setup properly

dry forum
#

im not arguing im just trying to explain my issue

#

ok

chrome beacon
#

I'll be back in a bit

#

Ping me when it's done

dry forum
opal juniper
#

Jerelfa no one wants to help you if you aren’t being cooperative

dry forum
#

i thought they were missunderstanding my problem assuming i didnt have buildtools installed

opal juniper
#

you can’t install buildtools

#

you download it

#

and then run it

dry forum
#

yeah thats what i meant

chrome beacon
#

You can skip the spigot-api dependency since it's included in the spigot one

#

When you're done send your pom in a paste so I can take a look

#

?paste

undone axleBOT
dry forum
#

Cannot resolve symbol 'project.mcversion' is giving me an error

#

<project.cbversion>${project.mcversion}-R0.1-SNAPSHOT</project.cbversion>

chrome beacon
#

Just remove that

#

It's not required for anything

dry forum
#

alright then is the rest correct?

#

also wouldnt i need that for using the right spigot version?

#

like if the server is on version 1.12 etc

chrome beacon
#

Your plugin won't work on 1.12 if you're using 1.18 nms

#

1.18 nms will only work on 1.18

dry forum
#

yeah but i have different nms for each version

#

which i have all that setup

chrome beacon
#

Ok good

#

Anyways the rest looks correct

dry forum
chrome beacon
#

No

dry forum
#

i wouldnt?

#

then how would i get the right version

chrome beacon
#

The pom is compile time only

#

That propery doesn't do anything

#

Also your pom isn't a module if you want to support multiple versions

#

Right now it's 1.18 and 1.18 only

dry forum
#

yeah

#

also what do i do to fix my code now since i added the pom

chrome beacon
#

Reload the project, make sure the code is okay then just package your jar with maven

#

That's it

dry forum
#

i still have errors in intellij though? itd just auto fix it or smthn?

chrome beacon
#

No the code above is outdated

dry forum
#

also i noticed specialsource hasnt been updated since 1.16

chrome beacon
#

It does not work on 1.18

dry forum
#

yeah and i need to fix that

chrome beacon
dry forum
#

ah

chrome beacon
#

Also pretty sure it has

chrome beacon
#

WorldServer is Level

#

As for the packet I don't know

#

It's one of the Clientbound<smth> I'd assume

dry forum
#

sorry still not 100% understanding the point of the maven? what is it supose to do

#

also still dont understand how im supose to use the right version dependency based on the server version

chrome beacon
#

It's a bit complex

dry forum
#

ive asked earlier and someone said i need to do each dependency so idk if thats required

chrome beacon
#

Basically you need one module for each NMS version and all the code there

chrome beacon
#

Then in the parent pom you simply shade everything together in to one jar

#

Then on enable you check what version your server is running and loads the correct classes for later use

dry forum
#

yeah i have that

chrome beacon
#

So what's the problem?

chrome beacon
#

Yeah I told you how to fix them

dry forum
#

you did?

dry forum
#

uhh

#

i dont rly understand how thatd fix it

chrome beacon
#

Class and method named have changed

#

So using the right ones will fix it

dry forum
#

i dont see a net.minecraft import for Level

#

or spigot import