#help-development

1 messages · Page 676 of 1

smoky anchor
#

open client console, there will be an error telling you what is wrong

tender shard
#

yes

smoky anchor
#

ok it may not be called client console, I forgot what it's actually called lol

grim oak
#

Ah i was missing a bracket in the file lol

#

I found it using the logs but how can i access the client console

smoky anchor
#

If you're using vanilla launcher, there is some setting in it.

orchid trout
#

/home/minecraft/signal/start_cmd: line 1: 12282 Killed /opt/java/17/bin/java -Xmx${SERVER_RAM} -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -DIReallyKnowWhatIAmDoingISwear -Djline.terminal=jline.UnsupportedTerminal -jar server.jar what does this error mean?

chrome beacon
#

Looks like you ran out of memory

#

so it had to kill the server

orchid trout
#

its not my server

wet breach
#

It typically means there is an issue with your argument most likely it didnt specify the ram amount

orchid trout
#

someone in minehut chat posted it

chrome beacon
#

Don't allocate 100% of the systems ram to the server

orchid trout
#

he said it was full log

chrome beacon
#

Leave some ram for the OS and java overhead

orchid trout
#

you cant change the arguments on minehut

wet breach
chrome beacon
orchid trout
#

i was just curious so i asked

chrome beacon
#

it could be caused by a plugin using native memory but I doubt that would be the case

orchid trout
#

the guy probably bought a lot of ram

#

and the server didnt have that much

wet breach
#

Plugin wouldnt cause the script to complain about a line

wet breach
#

Well i never experienced such things then nor ever heard of a plugin causing such things. But if its a possibility i suppose check for weird plugins

orchid trout
#

when do the plugins start loading?

#

before the recipes load?

severe folio
#

depends, you have 2 options

load: STARTUP
load: POSTWORLD

they're kind of self explanatory. The default is POSTWORLD iirc

orchid trout
#

where can you change them?

smoky anchor
#

in plugin.yml
or whatever it's called

orchid trout
#

ok

steady rapids
#

Hi, do you know what's a good way to test my plugin performance? I cant get many players online at the same time, is there something good for botting my testserver?

young knoll
#

The load setting actually changes when the plugin is enabled

#

They are all loaded at the same time

elder wren
#

Hello, I would like to be able to cancel this Bukkit task after a certain number of uses

                            BukkitTask routineTask = Bukkit.getScheduler().runTaskTimer(main, (Runnable) () -> {
                                if (i[0]+1==playersRoutine.size()) {
                                    return;

                                } else if(!playersRoutine.get(i[0]).isOnline()) {
                                    i[0]++;
                                }

                                player.sendMessage(ChatColor.GOLD + "Téléportation sur " + playersRoutine.get(i[0]).getDisplayName() + ChatColor.GRAY + " (" + i[0] +1 + "/" + playersRoutine.size() + ")" );

                            }, 10, timeInTick);

How could I implement this?
Thanks in advance

tender shard
#

(or an actual class)

elder wren
#

How can I set this up from another class ?

tender shard
#

easiest way is to use an anonymous class with the consumer

#
        Bukkit.getScheduler().runTaskTimer(myPlugin, new Consumer<BukkitTask>() {
            private final int maxRuns = 10;
            private int currentRun = 0;

            @Override
            public void accept(BukkitTask task) {
                // here's your code that runs every tick:
                // ...

                // Now we cancel ourselves after 10 runs:
                currentRun++;
                if(currentRun >= maxRuns) {
                    task.cancel();
                }

            }
        }, 1, 10);
#

to do this from another class, you just move the whole thing into its own file, e.g. like this:

public class MyTask implements Consumer<BukkitTask> {
    private static final int maxRuns = 10;
    private int currentRun = 0;

    @Override
    public void accept(BukkitTask task) {
        // here's your code that runs every tick:
        // ...

        // Now we cancel ourselves after 10 runs:
        currentRun++;
        if(currentRun >= maxRuns) {
            task.cancel();
        }

    }
}

and in onEnable:

Bukkit.getScheduler().runTaskTimer(myPlugin, new MyTask(), 1, 10);
young knoll
#

You can just have the currentrun++ as part of the if

tender shard
#

ofc, but that's not the point

#

it also confuses people, especially if they don't know how to declare an anon class

young knoll
#

Shh

tender shard
#

but yeah sure, that would work

young knoll
#

Every extra line of code means a kitten gets sad

tender shard
#

I'd rephrase it to "every extra line of code and frostalf starts to discuss with Emily about the implementation of java's FileSystem class"

#

coll have you seen my ultra fance buildtools PR

young knoll
#

Lol

tender shard
#

"does it look correct?"

young knoll
#

Oh the one that lets it run from the ide

#

Ye

opal carbon
#

has buildtools always had a gui

tender shard
opal carbon
#

would it be a seperate utility or smthn?

young knoll
#

It’s built in to the jar

tender shard
#

double click = GUI, run from console = same as before

opal carbon
#

seems legit

young knoll
#

Run from console with any args*

tender shard
#

I still pledge to add a --gui option

opal carbon
#

cause how else would you tell the difference ig

tender shard
#

or not

opal carbon
#

well yeah

#

but this is funnier

#

probably makes sense that way for the most people anyways

chrome ferry
#

does anyone know why i cannot create an injector?

[14:22:50] [Server thread/ERROR]: Error occurred while enabling NightMarket v1.4.5 (Is it up to date?)
java.lang.NoSuchMethodError: 'com.google.common.collect.ImmutableMap com.google.common.collect.ImmutableMap$Builder.buildOrThrow()'
    at com.google.inject.internal.MoreTypes.<clinit>(MoreTypes.java:61) ~[?:?]
    at com.google.inject.TypeLiteral.<init>(TypeLiteral.java:83) ~[?:?]
    at com.google.inject.TypeLiteral.get(TypeLiteral.java:150) ~[?:?]
    at com.google.inject.internal.ProviderMethodsModule.<init>(ProviderMethodsModule.java:60) ~[?:?]
    at com.google.inject.internal.ProviderMethodsModule.forObject(ProviderMethodsModule.java:93) ~[?:?]
    at com.google.inject.internal.ProviderMethodsModule.forModule(ProviderMethodsModule.java:67) ~[?:?]
    at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:435) ~[?:?]
    at com.google.inject.spi.Elements.getElements(Elements.java:113) ~[?:?]
    at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:160) ~[?:?]
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107) ~[?:?]
    at com.google.inject.Guice.createInjector(Guice.java:87) ~[?:?]
    at com.google.inject.Guice.createInjector(Guice.java:69) ~[?:?]
    at com.google.inject.Guice.createInjector(Guice.java:59) ~[?:?]

For some reason it works on loads of other servers, this exact plugin. But for some reason its not working on this specific server.
In the plugin.yml, i do have the guice library specified and it does download it correctly on this server.

https://haste.olziedev.com/huqipedaxu.less downloads for the working server.
https://haste.olziedev.com/etiqumizor.css downloads from the not working server

tender shard
#

guice?

chrome ferry
#

I just have one dependency, guice

#

so im not sure, i assume so?

tender shard
#

paste the full stacktrace

chrome ferry
#

its guava 31 thats being used

tender shard
#

The full strace would be helpful

chrome ferry
#

thats the fullstacktrace

#

1 hang on

tender shard
#

Huh but where does it come from

chrome ferry
#

what i dont get is that it works perfectly fine for one server, but not the other

tender shard
#

Whats line 30 in onEnable

chrome ferry
#

creating my injector

tender shard
#

How did you include guice? Shaded?

chrome ferry
#

plugin.yml libraries

#

otherwise i cannot upload the jar on spigot it will be too big

tender shard
#

Is the version in plugin.yml the same as in your pom?

chrome ferry
#

yes

#

like i said, its inconsistent. works just fine for all these servers, apart from one server

tender shard
#

Then paper 1.17 included an outdated version maybe?

chrome ferry
#

ouch, thats a bit stupid if thats the case

young knoll
#

Does the library loaded message appear

chrome ferry
#

yes

tender shard
#

Is it still too big if you shade guice, relocate it and use minimizeJar?

young knoll
#

Doesn’t show the library loaded message

chrome ferry
#

check the haste links

young knoll
#

Ah I didn’t see those

chrome ferry
#

i would of thought the bukkit class loader will always make the libraries take priority over itself

#

so maybe perhaps paper has an older version of guava?

tender shard
#

in your main class, add a static init block that does Guice.class (or whatever class) and print out getProtectionDomain().getSource() or what's it called

#

and see if it actually uses the library-loader .jar or whether it's coming from somewhere else

#

have you tried whether you can just shade it using minimizeJar though?

#

idk if paper does (or did, in 1.17) any funny class loader things

#

might have to ask there although they'll probably just tell you to update to latest

chrome ferry
#

yeah im not the actual server owner ahah

#

im just the developer and only one of my clients is having this issue out of all my clients and myself, found it very inconsistent

#

for now, i'll try running it with 1.17 on my local machine see if there is any similarites .I just found it incredibily weird

tender shard
#

print out the resultof this Builder.class.getProtectionDomain().getCodeSource().getLocation().toString() where Builder.class is any class from guice

chrome ferry
#

guava*

tender shard
#

yeah guava, guive, whatever

chrome ferry
#

but yeah ty

tender shard
#

you know what I mean 😄

chrome ferry
#

sorry im being cheeky ty for the idea

tender shard
#

if it does not point to the libraries/ .jar then there's sth wrong

chrome ferry
#

ah yeah well, news is its only doing it with 1.17

#

ouch,....

#

its coming from the inbuilt dependencies from paper

tender shard
#

yeah apparently paper issue

#

did they patch the class loader?

#

anyway this is probably time to ask on paper's discord. The class loader should "prefer" classes from the libraries instead of builtin ones

chrome ferry
#

Well its an outdated build and wont provide any support

#

i know 1.19 and higher works just fine

tender shard
#

although as said, you can easily fix this by shading guava yourself - have you tried whether minimizeJar gets the file size below the upload limit?

chrome ferry
#

i'll try that now

tender shard
#

don't forget to relocate it!

chrome ferry
#

yess

#

i guess this will also add support for 1.15 and below

#

as 1.16 and higher added library downloading i believe

tender shard
#

maybe but nobody uses 1.15 and below (except 1.12.2 and 1.8.8)

sullen marlin
#

?whereami

tender shard
#

would be funny if ?whereami would suddenly dox people and tell them "You're in <city>, duh"

chrome ferry
#

im sorry md_5 🙏

tender shard
#

your profile looks like choco's pfp

chrome ferry
#

im unaware of who that is

sullen marlin
#

Legit

chrome ferry
#

bro the pictures look nowhere alike

tender shard
#

can I get imajin's discord roles, now that he deleted his account? /s

sullen marlin
#

Chocos old one

chrome ferry
#

ouch with minimize jar its now 3mb big

tender shard
#

but 3mb is fine

#

the upload limit is 6mb or sth like that

chrome ferry
#

oh i thought spigot was 2mb

tender shard
#

no

#

it's definitely > 5 mb

chrome ferry
#

now it cannot find gson bruhh

#

lemme shade in gson

onyx fjord
#

Hi, yesterday i was looking for a small standalone solution to find classes in a package

#

i found an answer on stackoverflow but it doesnt seem to work

#

ill link it in a moment

chrome ferry
#

org.reflections is always a last resort

onyx fjord
#

yeah i dont want that tho

#

so basically the issue is from my debugging

#

File.isDirectory doesnt work correctly

#

it returns false even if path is a directory

tender shard
#

print out the absolute path of that directory

#

is it correct?

onyx fjord
#

this is the answer

onyx fjord
#

jar:file:/home/kaspian/Documents/Minecraft/Server/plugins/AxolotlEnchants-1.jar!/com/github/kaspiandev/axolotlenchants/enchantment/impl/hand

#

hand is a package

#

it has 2 classes inside

tender shard
#

obviously that is not a directory

#

you're looking at a .jar

#

that is not a directory

onyx fjord
#

i found something rly similar to yours

tender shard
#

show code

onyx fjord
tender shard
#

are you sure you wanna Class.forName them? o0

#

that seems like a very bad idea

onyx fjord
#

why

#

ill worry about it when that code part is even reached lol

tender shard
#

because it inits the class

#
public abstract class $ {

    public static void main(String[] args) throws IOException {
        try {
            Class.forName("com.jeff_media.ursus.TestClass");
        } catch (Throwable ignored) {
            
        }
    }
}
public class TestClass {
    static {
        System.out.println("test");
    }
}
#

this DOES print "test"

#

you don't want that to happen

#

what do you even need this for?

onyx fjord
#

to dynamically load an initialize classes in a package

tender shard
#

and why do you need to do that? seems like flawed design in the first place

#

you should never Class.forName() anything you don't really want to initialize

onyx fjord
#

i am initializing them tho

#

so not big deal

tender shard
#

but you'll init every class

#

idk this seems like a huge design flaw

#

why can't you use contracts instead of reflection

#

is that for a plugin btw?

#

because you'll also get a ton of CDNFE if you init classes like that that depend on other plugins that aren't installed

#

TL;DR bad idea, don't do it pls

onyx fjord
#

its fine i dont have any dependencies

#

especially in those classes

tender shard
#

do what you gotta do, I still think this is a very bad idea

onyx fjord
#

ik how to deal with this now at least

#

i found a library that does similar thing to what im doing

chrome ferry
#

ah its mainly for parent classes i assume

slender elbow
#

that's a recipe for disaster

tender shard
#

what eh hell is that for

#

that looks disgusting

slender elbow
#

closes classloader
returns live classes

#

big skull emoji

chrome ferry
#

i have no idea if it works lmao 😂

tender shard
#

I still wonder why anyone would ever need such a thing

chrome ferry
#

i still think org.reflections library >>>

tender shard
#

I'm also a champion in doing weird thigns but never would I randomly use Class.forName() or classLoader.loadClass without a very good reason

lilac dagger
#

I made my own addon system

slender elbow
#

ServiceLoader my beloved

lilac dagger
#

Kinda required

chrome ferry
#

?

tender shard
chrome ferry
#

some apis uses it to

slender elbow
#

no, jdk serviceloader

tender shard
#

ah I never heard of that tbh

#

still looking for a not-totally-out-date book about gradle btw, hmu if anybody knows a good one rubberduck

icy bone
#

Is there a way to remove the name of an item and also the NBT information? I want like an Gray Glass Pane but when the player hovers over it, nothing appears (its for a menu)?

tender shard
#

new ItemStack(myOldItem.getType())

icy bone
#

I got rid of the name but cant get rid of the NBT information aka the "minecraft:gray_stained_glass_pane"

smoky anchor
tender shard
smoky anchor
tender shard
#

that's not arbitrary NBT info but "the least an itemstack must have"

icy bone
#

Ohh i see

#

I forgot the advanced tooltip was still on

lilac dagger
#

That's shown if you use f1+ h i think

icy bone
#

Isnt it F3 + G?

lilac dagger
#

I don't remember

smoky anchor
#

F3+H

icy bone
#

F3 + H

smoky anchor
#

F3+G is chunks

icy bone
#

yeah

#

Alright then everything is fixed. Thank you!

smoky anchor
#

you can press F3+Q to list all shortcuts

lilac dagger
#

Cool

icy bone
#

Found another interesting issue. I made an inventory menu so i can click on custom items and then the item will be put in my inventory. I made it so people cant take items out and also cant put items in but for some reason when hold an item, press on an empty slot, keep holding the mouse down and dragging down, i am still able to place items into it. Is there a way to block this?

#

I do want to keep the interaction that when a person clicks on an item, I can link it to a piece of code I would like to run

smoky anchor
#

probably something to do with InventoryDragEvent

icy bone
#

Oh there is an event for that, ill check it

smoky anchor
#

Whenever you move cursor even a pixel, it uses this event instead

icy bone
#

Ahh i see

clear panther
#
@EventHandler
public void ORC(PlayerInteractEvent event) {
if(event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.LEFT_CLICK_AIR) {
if(event.getItem() != null) {
if(Objects.equals(event.getItem().getItemMeta(), EK.getItemMeta())) {
Player player = event.getPlayer();
if(player.isSneaking()) 
if(player.getInventory().getItemInOffHand().getType().equals(EMERALD_BLOCK))
player.getInventory().getItemInOffHand().setAmount(0);
event.getItem().addEnchantment(Enchantment.DAMAGE_ALL, player.getInventory().getItemInOffHand().getAmount());
Bukkit.getScheduler().runTaskLater(_plugin, () -> {
event.getItem().removeEnchantment(Enchantment.DAMAGE_ALL);
}, 100);
}
}
}
}
}```
#
@EventHandler 
    public void ORC(PlayerInteractEvent event) {
        if(event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.LEFT_CLICK_AIR) {
            if(event.getItem() != null) {
                if(Objects.equals(event.getItem().getItemMeta(), EK.getItemMeta())) {
                    Player player = event.getPlayer();
                    if(player.isSneaking()) 
                        if(player.getInventory().getItemInOffHand().getType().equals(EMERALD_BLOCK)) 
                            player.getInventory().getItemInOffHand().setAmount(0);
                    event.getItem().addEnchantment(Enchantment.DAMAGE_ALL, player.getInventory().getItemInOffHand().getAmount());
                    Bukkit.getScheduler().runTaskLater(_plugin, () -> {
                        event.getItem().removeEnchantment(Enchantment.DAMAGE_ALL);
                        }, 100);}
            }
        }
    }
}```
#

which looks better?

smoky anchor
#

There is a special place for you in hell

#

To actually answer: neither
Both are trash
you have annotations on the same indentation level
you do not do

if (something)
    if (something different)

}, 100);}
Literally what is this

lilac dagger
#

does anyone know their way around proguard?

#

i want to use libraries per certain packages

ivory sleet
orchid trout
#

is there any advantage of having a database interface and having database classes implement it?

ivory sleet
#

Yes

orchid trout
#

standardization?

ivory sleet
#

Ugh well, whats the advantage if you dont have it?

orchid trout
#

1 less class

ivory sleet
#

I can think of 7 reasons why you would want to decouple it

orchid trout
#

please tell me

#

or i wont do it thanks

ivory sleet
#

Unit testing, reusability, mockability and modifiability/extendability are the four main ones that probably matter to you

eternal night
#

You said seven

orchid trout
#

fadusoihjnifobdnsjjcxkhx

#

asdoljgoiuxchzn

eternal night
#

But yea, for the love of god abstract your dB logic

#

It's like the easiest thing to abstract as well XD

ivory sleet
orchid trout
#

how obvious is it that i dont understand generics

ivory sleet
#

those arguments need names

#

T1 func(T2 arg)

orchid trout
#

yes

#

i did that

ivory sleet
#

No you disnt

#

You only wrote the type T2

#

Not the parameter name

orchid trout
#

yeah i did that now

#

i fixe id

ivory sleet
#

Ok then it ought to work (:

orchid trout
#

yes

#

dothe generics mean anything by themselves? or does it only matter how i use them

ivory sleet
#

I mean generics are just higher level types in principle

#

And partially yes they mean something by themselves

#

But ofc its how you use them that actually impacts you

orchid trout
#

oh ok

#

so its for show

#

thanks

ivory sleet
#

Yeah nw (;

orchid trout
#

what do i do if my methods are like this

ivory sleet
#

You probably wanna go with an adapter class/interface

#

Look at for instance I think ChatChat (maybe) or LuckPerms

orchid trout
#

ok

#

actually only my get() method would be different

ivory sleet
#

basically they have sth like
interface StorageFacade {
void sinkUser(User user);
void sourceUser(User user);
}
interface AsyncStorageFacade {
CompletableFuture<Void> sinkUser(User user);
… etc
}

#

so a combined adapter where you also make the storage facade a humble object

#

(Humble object principle & adapter design pattern are the canonical names of these things)

orchid trout
#

i dont understand

#

can you explain in layman's terms?

tardy delta
#

hi conclure

ivory sleet
#

Hola or I mean hi ofc

silent slate
#

hi, is it possible to create webdisplays using a plugin? and if yes are there any available, i havent found any options

silent slate
#

yes

elder wren
#

The following code returns the error "java.lang.IllegalStateException: Not scheduled yet" in my console.

        if (currentRun>maxRun){
            player.sendMessage(ChatColor.GREEN + "Routine terminée");
            cancel();
            return;
        }

Does anyone know why?

upper hazel
#

how can you solve the problem that there are 4 classes inheriting the interface and all these classes need to be called, but if done in the usual way, there will be code repetition

#

call under different conditions

calm robin
#

Looking to patch out health indicator cheat on my server, this seems like a fairly simple process with some simple packet modification but haven't had any luck, I want to do this myself and not with someone else's plugin but I can't seem to find any source code examples of this online

upper hazel
#

what will happen if I post a plugin with a similar name on popular servers in spigotMC

onyx fjord
#

kinda reminds me of

#

Now, some people will claim that having 8-character indentations makes
the code move too far to the right, and makes it hard to read on a
80-character terminal screen. The answer to that is that if you need
more than 3 levels of indentation, you're screwed anyway, and should fix
your program.

#

on level 4 you go to hell

clear panther
smoky anchor
#

was my answer really that harsh ?
Sorry for that.

clear panther
#

do u really have to tell people go to hell

#

do u have autisim

#

or u get bullied at school

onyx fjord
#

you go to the programming hell

#

not the hell

clear panther
#

what is a

#

"programming hell"

onyx fjord
#

the place where you go when you commit programming crimes

clear panther
#

what the heck?

#

are you serious rn?

onyx fjord
clear panther
#

i gotta be honest i didnt get the joke so :/

upper hazel
#

what will happen if I post a plugin with a similar name on popular spigotMC servers

#

and with similar functionality

smoky oak
#

if you make it clear it's different probably nothing

upper hazel
#

I’ll write I dreamed of similar functionality and made it not exactly similar in logic

#

there are minor differences

smoky oak
#

mm. To be more on topic for the channel, is there a way to treat PotionEffectType as an enum? I want to declare two equal-length lists of effects and duration, but discovered it's apparantly an abstract class for some reason
Do i have to declare a list of PotionEffectType objects, or is there a workaround, or would it be better to press a string list through PotionEffectType#getByName() ?

smoky oak
#

a list of effects to apply, different for a bunch of 'castes'

#

i'm setting up an constructor and deconstructor and thought it'd be probably smart to not just be like 'PotionEffectType.NIGHT_VISION' etc everywhere

clear panther
#

ure trying to delete "PotionEffectType"
and just do NIGHT_VISION instead?

upper hazel
#

valueOf?

smoky oak
#

its not an enum

#

and im not trying to delete it

#

it just feels wrong to be like
List.of(...)

clear panther
#

well

#

u can try to figure it out yourself

#

and

#

?tryandsee

undone axleBOT
upper hazel
#

lol

#

good tutorial

#

very informative

smoky oak
#

i know it would work

#

im asking if there's a better way

upper hazel
#

i can valueOf this

smoky oak
#

that got nothing to do with potions

upper hazel
#

do you want to make a list of effects like this?

north nova
#

why do you want to treat it as an enum

smoky oak
#

to

#

well

#

Enum.of

smoky oak
north nova
#

PotionEffectType#values() returns an array of PotionEffectType

#

what else do u need

#

just like an enum but it just isn't an enum

upper hazel
north nova
#

cause it's not an enum

upper hazel
#

but this work lol

#

a wait

north nova
#

??

upper hazel
#

do YOU have an array?

north nova
#

?????

upper hazel
#

did you make an array with effects?

north nova
#

i have no idea wha you're saying

#

its a method

#

in PotionEffectType

#

PotionEffectType#values()

upper hazel
#

values get all enum object

north nova
#

what the fuck are you saying

upper hazel
#

idk wat you want

patent quarry
#

Hello, I'm curious someone know why TrimMaterial is an interface and not an Enum class ?

carmine mica
#

cause you can add new ones. enums are bad for this stuff, tons of stuff that is an enum currently in the API won't be hopefully in short order

#

Material, Particle, Sound, PotionType, Attribute, tons of sub enums for entity variants, and some more won't be enums at some point in the future

#

well actually Material will be, it'll just be deprecated, but ItemType and BlockType aren't

patent quarry
#

I see, but it's more boring to go through all the values, no ?

carmine mica
#

no?

#
for (TrimMaterial mat : Registry.TRIM_MATERIAL) {
}
patent quarry
#

Uh I never saw this Registry

#

Thank you very much !

smoky oak
#

Is there a way to one-line collect player names as strings and add something? the List#add returns if addition was successful
Bukkit.getOnlinePlayers().stream().map(e -> e.getName()).collect(Collectors.toList())

scenic valve
#

Should be I imagine, set it equal to List<String> and it might work. I remember doing something similar for CreatureSpawnEvent

smoky oak
#

I'm not entirely sure what you mean

carmine mica
#

why do you need 1 line?

#

write a function that does it, and call that function, there 1 line

smoky oak
#

cuz i dont want to assign it to a variable

#

also it helps doing things i dont know how to do to understand the language better

carmine mica
#

you can probably do it with a custom collector, create a new array list with guava's Lists and pass in what you wnat to add, then the rest of the stream will be added by the collector

smoky oak
#

Streams.concat seems easier

carmine mica
#

that works too

#

don't think i'd do that tho

#

this is really micro optimization territory, but just creating a stream instance for no reason

smoky oak
#

i mean i need to convert players into strings anyways

#

so its either stream or a for loop

carmine mica
#

a stream is fine, using concat with stream means you have to create another stream just for whatever you want to add

#

if you use a custom collector, no second stream needed

smoky oak
#

I really doubt i can make a collector good enough i should use it over just two streams tbh

carmine mica
#

Collectors.toCollection(() -> Lists.newArrayList("whatever"))

#

its pretty simple, just creating and returning a mutable list with what you want already added

smoky oak
#

...so I'm temporarily inserting some test code and my plugin refuses to compile cuz of 'unreachable statement' being a syntax error

#

is there some kind of flag i can use that it ignores that

eternal oxide
#

correct the code

smoky oak
#

test code

eternal oxide
#

you have unreachable code, fix it

#

there is no reason, even with test code to have unreachable code

#

or just comment it out if you don;t use it

carmine mica
#

if (true) return is your friend there probably

tame bay
#
                            "",
                            "§fSpielzeit:",
                            "§e" + PlaytimeUtil.formatTime(playtimeMap.get(board.getPlayer().getUniqueId())),
                            "",
                            "§fTop Spieler:",
                            ChatColor.of("#FFD700") + "Dofaking",
                            ChatColor.of("#C0C0C0") + "PidoubleZa",
                            ChatColor.of("#bf8970 ") + "BlockSeinBuster",
                            ""
[18:51:28] [Craft Scheduler Thread - 0/WARN]: [Playtime] Plugin Playtime v1.0-SNAPSHOT generated an exception while executing task 2
java.lang.IllegalArgumentException: Could not parse ChatColor #bf8970
        at net.md_5.bungee.api.ChatColor.of(ChatColor.java:273) ~[bungeecord-chat-1.20-R0.1.jar:?]
        at de.doppelbemme.playtime.Playtime$1.run(Playtime.java:58) ~[?:?]
        at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:82) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3856-Spigot-94e187b-b76ceb4]
        at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3856-Spigot-94e187b-b76ceb4]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
#

I want to use the ChatColor.of from bungee code, which takes a hexcode. Why do I get the error, that it cant parse the chatcolor then?

hasty prawn
#

There's a space at the end

#

It probably doesnt like that

tame bay
hasty prawn
tame bay
#

oh

#

xd

#

Didnt saw that. my bad thanks xD

smoky oak
#

Given user input for enums, which of those would be better? Doing a try/catch with IllegalArgumentException, or checking if values.stream.map.tostring contains the input, then converting?

#

I do remember people saying to avoid try/catch

worldly ingot
#

?

#

Who tf says "avoid try/catch"? They're stupid

smoky oak
#

like its been something really old

#

ill just do that then

worldly ingot
#

Yeah. You can use a utility method if you'd like. Guava's Enums class helps you do it and get an Optional

smoky oak
#

thats the secomd time i hear Guava enums today

#

what's that anyway?

worldly ingot
#

Enums

#

It's a utility class

smoky oak
#

im looking at it right now, i can see how that'd be useful

#

do you by chance know why google is using an internal version of Optional?

eternal night
#

use try-catch for OutOfMemoryError stonks

smoky oak
#

I'm just realizing the google optionals dont have javadoc for me

#

can i assume it's the same as for normal optionals?

carmine mica
#

aren't guava optionals effectively deprecated? I think the javadocs say to use the java util one

#

oh ok

There are no plans to deprecate this class in the foreseeable future. However, we do gently recommend that you prefer the new, standard Java class whenever possible

smoky oak
#

what i meant is that the Enums utility class throws the google optionals at me

worldly ingot
#

If you don't wanna use Guava you can use Apache's EnumUtil or whatever it's called lol

#

But yes, like many of the Guava-duplicate classes (their functional interfaces included), prefer the stdlib ones

lilac dagger
#

C namings in a java context

#

Someone's been studying too much c/c++ recently

upper hazel
#

tell me, let's say there is a class that stores 4 objects with a common interface, and as the classes expand, it becomes more what to do in this case so as not to write a bunch of code and at the same time store these objects

hazy parrot
#

Collection<CommonInterface>?

upper hazel
#

but how to create them so that there is no duplication (the parameters are different)

hazy parrot
upper hazel
#

these classes are used to get data from the config and store it. They have common methods and variables so they have an abstract common class. Each class is each section of config.yml. I wanted to ask how to get rid of code duplication

#

where exactly is hash use

#

in all class or abstract

lilac dagger
north nova
#

?

#

ur checking if connectionPool is empty

#

if it's empty size is always 0

#

so unless max_size is 0, intellij is right

tall dragon
#

:d

upper hazel
#

ahah

tall dragon
#

intellij smort

north nova
#

also

#

u can return usedConnections.put

upper hazel
#

I was once told that I need to come to terms with the fact that I make mistakes and not intelji is stupid

north nova
#

put(K, V) returns V

#

no need to put then return get

#

u can also just use Map#compute to simplify all that but up to u

upper hazel
#

were se

#

need

#

idk

teal kindle
#

How does one make a custom entity with modified goals persistent across chunk unloads and server restarts? I've looked into registering the entity using the registry, but that hasn't really helped.

rare rover
#

would there be a way to set a tab completer for the Command class?

#

since i ain't using PluginCommand

glossy venture
#

it has an abstract method tabComplete i think

#

which you need to override

rare rover
#

oh i see it

#

mb

#

thanks

slender elbow
#

not necessarily?

slender elbow
#

it returns the old value, not the value you just put

worldly ingot
#
Map<String, Integer> map = new HashMap<>();
map.put("foo", 1); // Emily smells
int value = map.put("foo", 2); // value = 1
int value2 = map.get("foo"); // value2 = 2```
slender elbow
#

more like

Map<String, Integer> map = Map.of("foo", 1);
int value = map.put("foo", 2); // throws UnsupportedOperationException
worldly ingot
#

okay...

#

shutup 😦

slender elbow
#

oh,, but..

worldly ingot
#

I HAD IT RIGHT THE FIRST TIME

slender elbow
#

i thought we had something

worldly ingot
#

Fixed my mistake by reverting to the original

#

With an extra comment just to be sure

slender elbow
#

😤

hasty prawn
#

oh that is not very nice

slender elbow
#

immutable map

upper hazel
#

?whereami

slender elbow
#

👍

upper hazel
#

how many here mems?

orchid trout
valid burrow
#

whats the easiest way to sort players in the tablist by rank? i tried with color code prefix but that doesnt seem to work

orchid trout
#

team name

#

if you create a team A and a team B then the players on the A team will be above the players on the B team

#

(on the playerlist)

valid burrow
#

ohh so it sorts by the name of the team

#

oaky thx

#

can a player be in multible teams

orchid trout
lunar wigeon
#

?nms

echo basalt
#

Uhhw what issue

#

Ah

#

Just call a setter

teal kindle
#

How do you make a custom entity with modified goals persistent across chunk unloads and server restarts? I've looked into registering the entity using the registry, but that hasn't really helped.

young knoll
#

You can register it using the registry

#

Or you can stick a pdc tag on it so you can identify it and add the goals back

#

When a chunk loads

sage patio
#

does save and restoring items using serializer keep nbt tags?

#

good point

teal kindle
young knoll
#

They can be modified whenever

smoky oak
#

shouldn't break; split the scope?

switch(something){
  case a: Player player; ... break;
  case b: Player player; // <- syntax error here
}
#

also, can i redefine player in case b, or does that also not work?

#

i am getting an error

#

yea that does it lol

remote swallow
#

lambda switch 😍

smoky oak
#

wouldnt work here

vast ledge
#
case 1,2 -> {
Player player;
break
}
remote swallow
#

no break

#

lambda auto breaks

smoky oak
#

nah i was just like 'i should be able to do this with switch so why am i getting an error'

#

its some data manip

#

brackets create scopes so imma agree on that one

#

i wasn't aware the switch would be different

#

i thought it just added the brackets in the background

vast ledge
#
if (true) return true;
#

return string.toLowerCase() != "yeet" ? "yeet" : "s";

#

yyes it is...

#

gone

#

i ate it

ivory sleet
#

whats wrong with that?

vast ledge
#

mine_level = mineLevel

#

ohhh

#

yea

#

cus theyre not the same name

#

no reason to use this

ivory sleet
#

because u dont have the inspection set on it prob

vast ledge
ivory sleet
#

I mean I like to always use this or super if possible to show where the field or method invocation is coming from

vast ledge
#
mine_level != mineLevel;
ivory sleet
#

but I know a lot of devs who dont share that same preference

vast ledge
#

doesnt

#

or does

#

Did it rename it to dif name?

#

Oh

#

intellij doesnt like _

sonic cosmos
#

Why balance etc are final? I think player balance, mana and mine level can change value

quaint mantle
#

Because this isn’t C

#

Look up the standard naming convention

tranquil dome
#

Is there a way to see how the spigot API does certain things?

I am working on a 1.8 plugin but would like to implement some methods from higher versions with NMS.

echo basalt
#

ew

sullen marlin
#

?source

young knoll
#

uuid varchar(64)

young knoll
#

Coreprotect wack

young knoll
undone axleBOT
sullen marlin
#

?Coll1234567

remote swallow
#

md doesnt know his own commands

remote swallow
ivory sleet
#

my intellij does that lol just tested

warm mica
#

If that's the case, then you shouldn't ask others for tips on improving yourself. Hate to break it to you

sullen wharf
#

You told Intellij was being dumb but guess what, he was not the one being dumb

#

🤔

tranquil dome
#

I'm looking in CraftLivingEntity

sullen marlin
#

its in craftentity

tranquil dome
#

I see, ty

warm mica
# tranquil dome I see, ty

Just note that its implementation greatly varies between 1.8 and 1.20 and that there's a chance that it won't be helpful

young knoll
#

Did the silent tag even exist in 1.8

tranquil dome
#

Well, it appears this also exists in 1.8 so I hope it works

lilac dagger
#

is there a reason why you're looking in craftliving entity and not in living entity?

#

as far as i know it's in the interface

tranquil dome
#

this being EntityBat

young knoll
#

Huh I guess the tag did exist in 1.8 then

tranquil dome
#

wait

#

nvm

#

thats a recursive call

ivory sleet
#

it may not be

#

there might be some class that overrides it

tranquil dome
#

So would it even be possible to achieve this?

lilac dagger
#

to silence a mob?

tranquil dome
#

yes

lilac dagger
#

from which version?

warm mica
tranquil dome
#

I am using nms

#

What does #getHandle() return?

warm mica
ivory sleet
#

always returns the delegate

#

has always done that and will always do

lilac dagger
#

i'm pretty good at finding these these

#

usually nbttag is a giveaway

pulsar parcel
#

Hi. I'm making plugin that have some cutscenes in it. It will set player gamemode to spectator and than teleport them by small steps. But it is teleporting them like 100 000 times with 1 tick delay witch is kinda laggy. So beside making bigger steps and making longer delay, is there any way how to optimize it so it will not lag to much? Thx for any help.

young knoll
#

Use velocity

tranquil dome
#

Ill see if b() works

pulsar parcel
lilac dagger
#

ah yes

#

it's R()

#

and b to set it

young knoll
#

Mmm obfuscation

tranquil dome
#

yea obfuscation is fun

lilac dagger
#

yeah, it fails badly when nbttag is involved

tranquil dome
#

public void e(NBTTagCompound nbttagcompound) has a lot of strings which help

flint coyote
#

How do people even find out what a,b,c etc. is? Try and error after updating?

lilac dagger
#

patterns

lilac dagger
#

or mappings

flint coyote
#

Are there official mappings from mojang?

remote swallow
#

?mappings

undone axleBOT
lilac dagger
#

but before mappings patterns were your friends

remote swallow
#

it probably got backported

young knoll
#

For spigot*

flint coyote
#

Why do they even obfuscate if they release mappings?

tranquil dome
#

wait are there any for 1.8?

kind hatch
#

Nope

young knoll
#

Mojang started releasing mappings in 1.14

kind hatch
#

1.14+

tranquil dome
#

:(

remote swallow
#

oh

#

that was 1.14?

ivory sleet
#

its actually rather easy to start mapping obfuscation if u can use stuff like strings, magic values etc

young knoll
#

Yes

#

They updated the license in 1.17

lilac dagger
#

ohh

young knoll
#

Which is when spigot started using them

lilac dagger
#

but based on how buildtools operated, i assume they couldn't use them without the license update

flint coyote
#

Why do they still obfuscate their code if they release mappings for it?

#

Doesn't that pretty much reverse the obfuscation?

opal carbon
young knoll
#

Makes it a bit smaller too

opal carbon
#

its not open source

ivory sleet
opal carbon
#

that too

#

they still control their mappings

ivory sleet
#

^

flint coyote
#

I mean I also have to stick to their license when not using mappings

lilac dagger
#

you were in the wrong actually

#

it was all copyright reserved or something

#

you couldn't do anything with it

opal carbon
#

its just to basically say this isnt open source this is still proprietary software

flint coyote
lilac dagger
#

i mean we use buildtools for a reason

ivory sleet
#

freestyler knows that, theyve been here far too long arguably lol

flint coyote
opal carbon
flint coyote
opal carbon
#

wow thats what the mappings have

#

crazy

flint coyote
#

Yeah why obfuscate and license mappings instead of not obfuscating and putting a license on the code?

#

crazy

opal carbon
#

on the mappings

young knoll
#

I mean they have a license on the code too

flint coyote
#

And they also have a license on their code I'd assume? So obfuscation wouldn't be necessary

opal carbon
#

well duh

young knoll
#

It’s called all rights reserved

opal carbon
young knoll
#

And again

#

Makes the jar smaller

opal carbon
#

like why are u complaining abt this so much they are unique for releasing mappings at all

#

that too though

#

most proprietary games wouldnt give you a way to see the code exactly as they wrote it

flint coyote
#

I'm not complaining. I was just asking. You were making me sound dumb

opal carbon
#

its kinda a dumb question

#

you were already given the answer

lilac dagger
#

i don't care how they did it, i'm just happy they helped the community with the mappings

opal carbon
#

and asking again you arent gonna get a different response

#

its like how you have to agree to the eula before starting a server

flint coyote
opal carbon
#

asking again after the answer was given

#

idk

grim hound
#

When's the PlayerSpawnLocationEvent fired and when was it added?

flint coyote
#

I was given an answer without any reasoning behind it.

#

I wanted to understand the reasoning

#

So yes, I asked again

undone axleBOT
opal carbon
#

Called when player is about to spawn in a world after joining the server.

smoky oak
#

is there a way to debug your plugin in your IDE? I'm getting some weird behaviour i could probably easily dissolve if i could peek at values

#

using intelliJ

opal carbon
#

its like how you have to agree to the eula before starting a server, its a relatively small roadblock just to prove its still their game, not yours just because you have the code

#

and it also ensures you actually agreed to their terms

lilac dagger
young knoll
#

You can remote attach to the server

lilac dagger
#

right when the location is set

young knoll
#

Google spigot debug IntelliJ

#

(Or eclipse)

lilac dagger
grim hound
smoky oak
#

thx

grim hound
#

which packet is that? OutPosition? OutRespawn?

lilac dagger
#

i support 1.8.8 and i see it in there

grim hound
#

the event I mean

lilac dagger
#

for the event?

grim hound
#

ye

lilac dagger
#

no it's just when the location is originally given to the joining player

#

it is called

flint coyote
lilac dagger
#

and you can change it with yours

#

it's better to use this event than doing it in playerjoin event

grim hound
grim hound
lilac dagger
#

most events i know are triggered in the server logic and not from packets

lilac dagger
#

and in fact spawn location is taken from the userdata and not a packet

grim hound
#

but the server has to tell the player where he is

lilac dagger
#

the unaltered one

#

well, you have to look elsewhere

#

metadata maybe?

#

the metadata packet

grim hound
grim hound
lilac dagger
#

i can follow the code for you, give me a second

grim hound
#

But that's for other players

tranquil dome
#

What do you guys name your module with interfaces for all NMS specific classes? I already have an api module so I cannot use that.

lilac dagger
#

PacketPlayOutSpawnPosition it might be this

#

but it seems to be unaltered by what PlayerSpawnLocationEvent does

tranquil dome
#

but need one for the interfaces

lilac dagger
tranquil dome
#

or abstract classes

lilac dagger
#

not sure if it's an oversight in the 1.8.8 server

tranquil dome
#

just common?

chrome beacon
#

Yeah

grim hound
tranquil dome
#

So far I've only made a custom bat class

#

that extends BatEntity

grim hound
#

You plan on adding them all?

tranquil dome
#

no

#

possibly adding an arrow class depending on if i need nms for my purposes

#

it's mainly to copy api methods from newer versions into 1.8

grim hound
#

and you're adding them using ByteBuddy as interfaces for efficiency?

tranquil dome
#

i am not using bytebuddy afaik

#

i have a maven module for each version and one with abstract classes and interfaces

grim hound
# lilac dagger

isn't this modified in the event fire call before being sent as a packet?

lilac dagger
#

no

grim hound
grim hound
tranquil dome
#

but thusfar only 1.8

#

my project structure as of now

#

named it common because someone here suggested it

#

ignore discordo-api, removed that

lilac dagger
#

wait, you can have your own icons?

tranquil dome
#

idk intellij does that for me

grim hound
hazy parrot
#

minecraft dev

lilac dagger
#

might be the bukkit plugin that i've seen somewhere

#

ah yes

tranquil dome
lilac dagger
#

i think it suggested it to me at some time

tranquil dome
#

if so, I plan to do that eventually

grim hound
young knoll
#

Like minestom

grim hound
#

That was just an example

young knoll
#

Or fabric

tranquil dome
#

oh

#

like that

grim hound
#

for multi-version support it can be the same thing

tranquil dome
#

i see

smoky oak
#

anyone know why this doesnt have the variable

grim hound
#

Like you have Player on bukkit and ProxiedPlayer on bungeecord but the classes have the same code, so you just leave as an customziable class parameter in the common package

grim hound
#

or at least the relevant part

smoky oak
#

that IS the relevant part

#

i'm initializing the list and stopping right after

grim hound
#

I can't really tell from this

smoky oak
#

no variable

#

wtf

tranquil dome
chrome beacon
#

That can happen when the code ran doesn't match the visible code

#

Try restarting

smoky oak
#

ah thats a good point

grim hound
tranquil dome
#

alright cool

grim hound
smoky oak
#

so that i can debug it?

lilac dagger
grim hound
ivory sleet
grim hound
warm mica
ivory sleet
#

i agree

smoky oak
#

nah Olivio was right

#

i had to restart

grim hound
#

with the IntelliJ highlighting it's even worse

warm mica
#

Interesting, I never had that

tranquil dome
#

Wait how do you use the intellij debugger with minecraft plugins?

smoky oak
#

was linked like three minutes ago

grim hound
smoky oak
#

something something port 5005

hybrid spoke
#

just dont debug

grim hound
#

Anyways I'm going to sleep now. Goodnight y'all

tranquil dome
#

ive been using printlns

hybrid spoke
#

you dont have to debug if you have no bugs

tranquil dome
#

gn

#

thanks for helping

grim hound
#

👍

hybrid spoke
tranquil dome
flint coyote
hybrid spoke
flint coyote
#

true, just delete the whole repo and start over

hybrid spoke
#

nah

warm mica
hybrid spoke
#

declare it as "coming soon..."

smoky oak
#

you have a silverfish infestation somewhere i can tell

flint coyote
#

Gotta release a roadmap that's delayed from the start

hybrid spoke
smoky oak
#

also i figured out that you can build and reaload without screwing the debugger

#

so at least simple things can be looked through quickly

warm mica
hybrid spoke
#

we are the slaves

#

they force us to work at them

flint coyote
#

True and they don't even pay rent. You pay their rent

#

And even feed them

hybrid spoke
#

and worst thing is

#

if you caused them you dont get paid for the removal

smoky oak
#

on a completely unrelated note, how do you cut off the parts of a return list that don't match the possible command arguments?

#

like /set type black|blue|red -> /set type black|blue

hybrid spoke
#

no clue what you mean

flint coyote
#

He's talking about the command recommendations

hybrid spoke
#

yeah i got that

#

but what is he asking specifically

smoky oak
#

i mean if i type 'b' how do i manipulate the List<String> i throw back to remove everything not starting with the character sequence already typed

young knoll
#

StringUtil.copyPartialMatches

remote swallow
#

^^

hybrid spoke
#

ah thats what you mean

hybrid spoke
remote swallow
#

StringUtil.copyPartialMatches(args[num], entries, new ArrayList<>())

smoky oak
#

its annoying how you cant just flag a command to do that

ivory sleet
#

u technically do have commodore (the file format), or even so I may mention brigadier as well (which is shipped)

smoky oak
#

...ykw im just going to make a helper method and not bother with external libraries

ivory sleet
#

brig is not an external lib

smoky oak
#

and brig looks horrid

ivory sleet
#

its what mc uses and has used for years

#

yeah its not beginner friendly lol

smoky oak
#

i mean i want the command to be more readable

#

idc about its colors lol

ivory sleet
#

oh u can write readable code with brig

smoky oak
#

ah i meant while typing in the chat

ivory sleet
#

just that its somewhat more effort taking

smoky oak
#

why does getOnlinePlayers return a collection of captures?

sullen marlin
#

Because it's stupid

smoky oak
#

i can just cast it a la (List<Player>) then?

sullen marlin
#

Probably

ivory sleet
#

it returns Collection<extends Player> because the CraftServer of it returns Collection<CraftPlayer>

smoky oak
#

why doesnt this happen with getPlayer tho?

ivory sleet
#

getPlayer?

slender elbow
#

because type theory is fun

ivory sleet
#

^

#

ah I assume you mean OfflinePlayer#getPlayer?

smoky oak
#

nah the Server.getPlayer

#

why would getPlayer be player and getOnlinePlayers be craftPlayer

carmine mica
ivory sleet
#

I mean it could yea

sullen marlin
#

It'd be a source break

slender elbow
#

barely

#

existing code should still compile just fine i believe

#

the other way around would be more catastrophic lol

sullen marlin
#

If you've done List<? extends Player> in your code I don't think it will

ivory sleet
slender elbow
#

it should

carmine mica
#

so does this

#

when you change it just return Collection<Player>

quaint mantle
#

How do I spawn an infinite Area Effect Cloud? In Vanilla you have to set its Duration to int limit (it's not really inifnite but it's ok), but it doesn't work when I do it with my plugin.
Also, how do I delete the particle effect?

smoky oak
#

if it works like a potionEffect, duration = -1, and there's a constructor signature that gives a boolean to toggle visibility of particles

#

oh yea it takes a potionEffect

surreal grail
tight roost
#

this may be a very silly question, but I'm developing my first Spigot plugin. is there any compelling reason to use one of Java or Kotlin over the other and why? I'm not too worried about docs because I'm fairly familiar with both languages - I'm just wondering if either language specifically offers anything that makes plugin development easier.

hazy parrot
#

Does anyone know why "profiles" propertry in spring-boot-maven-plugin does nothing. I set it to

<plugin>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-maven-plugin</artifactId>
  <configuration>
    <profiles>prod</profiles>
  </configuration>
</plugin>

But still, both spring-boot.run.profiles and spring.profiles.active env vars are empty.

surreal grail
echo basalt
#

Mostly because 95% of spigot devs can help you or work on your code if it's in java

#

but only about 5% ish can work on it if it's kotlin

#

Only one or two networks are looking specifically for kotlin devs

tight roost
#

oh true i hadn't thought about the network thing

#

i'm not sure how much that'll matter because i don't know if i'll ever actually end up trying to work for one of them ? but that is a very good point

#

thanks for the input !

echo basalt
#

It's the kind of question like

#

Should I follow an industry trend or go with a minority

tight roost
#

yeah that's fair

#

idk i'll probably go with java just to be one of the Cool Kids

#

follow up question: gradle or maven and why

echo basalt
#

personal preference

#

Some people use gradle, some people use maven

flint coyote
#

I'd say it's pretty much the same discussion. Maven is more popular and therefore you'll receive more support

#

But gradle is probably a little more popular than kotlin. Still a long way to go to overtake maven though

echo basalt
#

your dependency management system doesn't influence your code maintainability though

#

So it's a lot more personal

quaint mantle
#

Does anyone know if there is a way to send Packets to players via velocity?

sullen marlin
#

?whereami

quaint mantle
#

Im banned from the paper discord

sullen marlin
#

This is our problem how?

young knoll
#

F

quaint mantle
#

idk I was just wondering if someone knew

shy finch
#

I'm trying to set non-naturally generated shriekers so they can spawn wardens (only natural ones can by default)

Spigot provides this isCanSummon method, but it doesn't seem to change the actual block. Is it supposed to change the block? Source code looks like it should.

#

(the tryShriek method is something I'm adding... working on a PR)

worldly ingot
#

idk how Kotlin's setters work, they look stupid, but isCanSummon() != setCanSummon()

shy finch
#

kotlin handles that.. so they are equal in this case. To prove it, you can see the debugger is on line 58 and can_summon=true in the blockdata there

#

kotlin code usually doesn't look so stupid but it doesn't really look good in bukkit code 😆

worldly ingot
#

Oh I missed the debugger. Don't see those often for plugins

shy finch
#

nah I get it

#

honestly don't know how some people code plugins without it

quaint mantle
shy finch
#

use remote jvm debug.

shy finch
quaint mantle
shy finch
#

I mean it's a useful tool, but without a debugger, you're playing whackamole with earplugs and a blindfold.

rare rover
#

how would one replace a block breaking sound?

#

would i have to make a packet listener or something?

#

i want stone breaking sound to be a different block

echo basalt
#

packets yeah

rare rover
#

would i have to modify the incoming packet?

echo basalt
#

uhh it's outgoing

#

but yeah

#

easiest way is just protocollib and change a single value

#

Thing is

rare rover
#

protocol ew doe

echo basalt
#

You can't exactly figure out what block it's coming from

rare rover
#

oh idc, its for a prison server. I can make it for every block really

#

i dont think it'll matter

echo basalt
#

Sure whatever

rare rover
#

is there a way to do this with NMS?

echo basalt
#

uhh

rare rover
#

instead of protocol

echo basalt
#

You can inject into the packet handler yeah

rare rover
#

hmm

young knoll
#

I wonder how plugins like ItemsAdder replace the sounds for their custom blocks

#

If they can’t tell what block it’s coming from

echo basalt
#

their custom blocks are note blocks

young knoll
#

Yes

echo basalt
#

So they just fire whatever

rare rover
#

netty?

young knoll
#

?

rare rover
#

would that work

echo basalt
#

they listen to the animation packets and fire it?

young knoll
#

Oh right they don’t actually get broken client side because of the custom breaking system

#

Forgot about that

echo basalt
#

nothing stopping them from just setting an empty sound on the client

#

for the real block

young knoll
#

True

rare rover
#

welp

#

seems like im using protocol

#

😦

dense geyser
#

omg nvm

rare rover
#

what's the packet for block breaking sound lol

#
       manager.addPacketListener(new PacketAdapter(javaPlugin, ListenerPriority.HIGH, PacketType.Play.Server.NAMED_SOUND_EFFECT) {
            @Override
            public void onPacketReceiving(PacketEvent event) {
                PacketContainer container = event.getPacket();
                Bukkit.broadcastMessage(String.valueOf(container));
            }
        });```
young knoll
#

Shouldn’t you be using onPacketSending

rare rover
#

ig

#

but what's the packet lol

young knoll
#

Looks like both naked and Id based sounds use the same packet

#

So I imagine that’s correct

rare rover
#

it ain't broadcasting anything

#

so idk