#help-development

1 messages · Page 1211 of 1

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

sage hare
#

@remote swallow can you help me real quick? how do i make the plugin? like run it?

The run button is grey so should i setup something or should i do it as a artifact and how exactly do i do that?

chrome beacon
#

Open the maven tab on the right

#

and select package

echo basalt
#

or gradle and run build

#

depending on the system you're using

#

I assume he's going with intellij's build system based on the questions

sage hare
#

im using maven and intellij

#

but i dont see a package button on maven at the right side

chrome beacon
#

It's under lifecycle

sage hare
#

alr i found it, thanks

smoky oak
#

can you short (string.length == 1 ? 1 : parseInt(string[1])) somehow?

chrome beacon
#

That's an odd length check

short drift
#

Is there any working way to get WorldGuard region enter event?

#

I tried the WorldGuardEvents plugin, but it doesn't give anything to me.

// EventHandler for WorldGuardEvents (plugin) enter region.
@Subscribe public void onPlayerEnterRegion(RegionEnteredEvent event) {
    var player = event.getPlayer();
    var regionName = event.getRegionName();
    System.out.println("Player " + player.getName() + " entered region " + regionName); // Nothing. Event doesn't fire.

    if (regionName.equalsIgnoreCase("magic-circle")) {
        player.sendMessage("Salaperäinen voima täyttää tämän alueen.");
        player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("Salaperäinen voima täyttää tämän alueen."));
    }
}
glad prawn
smoky oak
#

howd that help

#

the match for the string split is this <int>(*int)

slender elbow
#

fucking shitty ass stupid discord

#

@Subscribe

blazing ocean
#

givemeplugine

smoky oak
#

@silent turrete

#

hm

#

this might be difficult

kind hatch
#

@silent turrete

#

Ah

#

I see they are now autoconverting it

#

Dumb af

quaint mantle
blazing ocean
smoky oak
#

@‎subscribe

#

ah

#

that works

short drift
# quaint mantle Make sure register instance on proper handler

Well, I'm not sure if it requires something extra:

private void registerMagicTeleportCircle() {
    System.out.println("CriticalFixes: Loading MagicTeleportCircle.");
    var magicTeleportCircle = new MagicTeleportCircle(this);
    pluginManager.registerEvents(magicTeleportCircle, this);
}

quaint mantle
#

Like register the instance in something that supports @Subscribe annotation.

blazing ocean
#

well you're registering as bukkit listener

short drift
#

I am?

blazing ocean
#

which use @EventHandler

blazing ocean
short drift
#

Oh, hm. What do I need to use instead?

#

The docs didn't mention anything.

blazing ocean
#

do the events extend bukkit Event?

#

if so, @EventHandler

short drift
#

Oh, right. Because I had @Subscribe on it. I didn't realize that I might be able to use @EventHandler. I'll give that a try!

quasi gulch
#

Is there an Event that fires when an Item is added to a Players Inventory with /give?

sage hare
#

?paste

undone axleBOT
sage hare
noble lantern
#

sorry only just saw this

Its personal patches for a server, I know exactly what the code does and interacts with, and I needed its functionaly totally changed (its the mojang ping packet data builder)

blazing ocean
#

mixins my beloved

noble lantern
#

I normally use inject, but in this case Overwrite was needed as the entire method was just shite

blazing ocean
#

but cmon just redirect

undone axleBOT
noble lantern
# blazing ocean but cmon just redirect

all my others inject, I think one might redirect iirc cant remember theres a bunch of useless patches in here now that dont matter bc its 1.19 xD

A lot of the mixins are just re-writing mojangs code

Overwriting mixins is only a problem if you dont know if something needs that method 😄

#

Thats the main reason people say not not overwrite is because of parity with other mods/plugins/softwares

#

But for this its private

kind hatch
#
commands:
    command:
        description: "This is a command"
        usage: "/command <arg>"
        aliases: [cmd, command]
        permission: permission.node
        permission-message: "You do not have permission to use this command"
short drift
#

Oh, wow. I didn't even know you can do that.

#

I've just always defined several commands.

sage hare
# kind hatch ```yml commands: command: description: "This is a command" u...

Oh, i think its because i removed it after it didnt work ingame (/gm) but should i add /gm in the onEnable? also
getCommand("gamemode").setExecutor(new GamemodeCommand()); getCommand("gm").setExecutor(new GamemodeCommand());
Because before gm was in the aliases but didnt work

And my permission and permission message are in the plugin, is that better or the same?

wet breach
kind hatch
#

Personal opinion, but I think permission messages are better handled by the plugin instead of in the plugin.yml

eternal oxide
#

permission messages are no longer used in the plugin.yml

wet breach
eternal oxide
#

since the command map is sent to the client for tab complete, you now just get an unknown command

sage hare
# kind hatch No, you only need to set the alias in the plugin.yml.

okay thanks

I have a question about config files if you could please help me with that?
I have tried to follow this guide: https://www.spigotmc.org/wiki/config-files/

But it dosent work for me i feel, i have asked some other people but it seems like they dont know too much about it

But when should i save the config? and when i added all of this in the main class i couldnt do the code for adding anything to the config file andhow do i do so it cant be removed, so if its being removed it will "spawn" again after the next server refresh
and should i add the values manual?`since i couldnt add them though code earlier today

eternal oxide
#

any changes you make to a config (in memory) you should save

#

a config is supposed to be for fairly static data so shoudl not need to be changed often

wet breach
#

they probaby weren't keeping the same instance

#

therefore it wasn't saving or loading properly lol

sage hare
kind hatch
#

Yea, instances. :p

#

When working with multiple config files, it's best to avoid the main #getConfig() method.

sage hare
#

But i didnt build the plugin before, i didnt work at the end

#

Ok, i just have 1 config but i have plans to get more, if i get more configs what should i do insted

kind hatch
#

You'll need to create a system for managing multiple config files.

wet breach
#

well the class I sent, just needs removal of some duplicate methods as it pertains specifically to that plugin, however you are free to use it and is designed to be accessed with Static too if you are so inclined

kind hatch
#

It's not too complicated, but there are many different approaches.

sage hare
wet breach
#

and ensures a single instance

#

so you can't double load the same files/class

sage hare
wet breach
#

If you want more configs, make a method to accept a string for config names

#

and this way you can dynamically load files 🙂

#

and only have a single method and class

#

you can easily modify that class for that purpose too

#

I could probably load it up in my IDE and make a modified version to be dynamic

#

probably will save it in my gist too

kind hatch
#

The simple approach is actually covered in the wiki link you sent earlier.
Making a separate config file is as simple as using a File instance and a FileConfiguration instance.

Everything related to setting data is contained within the FileConfiguration class.

wet breach
#

yep

#

the only thing people get stuck on is using new

#

and creating a bunch of instances which is why my loading/saving class disallows that

smoky oak
#

ok why do i need to paste soul fire twice

sage hare
wet breach
sage hare
wet breach
#

you need to make sure you import

#

as well as create the necessary objects

sage hare
# wet breach you need to make sure you import

i am importing the class but what do you mean wit hcreate thbe necessary object? everything i need is in the cooldownmanager class (on the webiste) but it just dosent work in the other class

wet breach
#

so since your main class won't just unload, you can create objects there safely without duplicating them. Anytime a class is created everything in it gets created.

#

so, in your main class you will need to do

private CoolDownManager manager = new CoolDownManager();
#

if this is done outside of a method in the class and at the top you should be able to use it everywhere in the class

#

objects created in methods only exist inside said method and go away once that method is done

worthy yarrow
#

unless explicitly cached somewhere else before the method is done

sage hare
#

@wet breach Thx but it still dosent work

            Duration cooldown = cooldownManager.getRemainingCooldown(playerId);
            if(args.length == 0){
                if(cooldown.isZero() || cooldown.isNegative()){

its giving an error at .getRemainingCooldown

private cooldownManager manager = new cooldownManager();

    public Duration getRemainingCooldown(UUID key) {
        Instant cooldown = map.get(key);
        Instant now = Instant.now();
        if (cooldown != null && now.isBefore(cooldown)) {
            return Duration.between(now, cooldown);
        } else {
            return Duration.ZERO;
        }
    }
worthy yarrow
#

could you format that pls

#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
worthy yarrow
#

What's the error it gives?

#

?paste put it in here

undone axleBOT
worthy yarrow
#

and then send the link after saving

sage hare
#

does it do anything bad its static?

#

some places it requestes that i change it to static (the method) and then the problem is gone

worthy yarrow
#

The error / stacktrace you get in console is what I wanted to see

sage hare
#

ikn the console?

#

where is the console

worthy yarrow
#

Like where you host the server

sage hare
#

but t he problem isnt on the server yet

worthy yarrow
#

Oh this is a syntax problem?

sage hare
#

yes

worthy yarrow
remote swallow
#

where does it show the error?

sage hare
remote swallow
#

your trying to call a method as if its static when you need an isntance

worthy yarrow
#

^

remote swallow
#

create an instance of cooldownManager and store it as a field

sage hare
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

worthy yarrow
#

Make a new object at the top of the suicide command class... something like cooldownManager manager; then use DI

#

?di

undone axleBOT
sage hare
remote swallow
#

i recommend learning java first

worthy yarrow
#

?learnjava before attempting plugin dev

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

smoky oak
#

i have the feeling this message's gotten bigger since i last saaw it

sage hare
#

look at the photo, are you sure i should make it not static

worthy yarrow
#

It's not static right now

remote swallow
#

its not static but you are trying to use it as static

sage hare
#

the error says i can add "static" in front of the method, why shouldnt i do that?

worthy yarrow
#

You need an instance of the cooldownManager in the suicideCommand class

worthy yarrow
blazing ocean
undone axleBOT
sage hare
worthy yarrow
#

Yep

#

You shouldn't be doing developer work with no developing experience

#

Put a solid 3 months into java then try making plugins

sage hare
worthy yarrow
#

Would be good

sage hare
#

because im only home at the weekends...

worthy yarrow
#

You can code on a piece of paper to be fair

remote swallow
#

learn when you can and practise when you can

#

its better to learn and take it slow than jump in the deep end

worthy yarrow
#

Get a book or find online sources and just practice the base of java

blazing ocean
worthy yarrow
#

I used to so

sage hare
#

But its working now
Just to be sure, i just want to know if its correct or no becuase i dont want any more errors from it

    private final cooldownManager cooldownManager;

    public suicideCommand(cooldownManager cooldownManager){
        this.cooldownManager = cooldownManager;
    }
worthy yarrow
#

Looks good

blazing ocean
#

your spoon dropping cult

worthy yarrow
#

I was dealing with brain damage thank you

worthy yarrow
sage hare
#

uhmm.. just another question

on the website their using cooldown.toSeconds()
but toSecnds() is giving me an error
player.sendMessage(cooldown.toSeconds()

blazing ocean
worthy yarrow
sage hare
worthy yarrow
#

Like what you have written prior to using DI for the cooldownManager instance looked fine to me

#

I mean fine for your skill level anyway

#

There's always ways to improve tho

#

Also for your command, you don't have to check the "label" ie:

label.equalsIgnoreCase("someString");
When you register the command in your main class, you already define a string that's directly correlated with said command object

sage hare
#

aah okay thanks

worthy yarrow
#

dont forget to put it in your plugin.yml under commands: section tho

#

Unless you use the command map/some command framework, you always have to do this for every command

sage hare
#

I probably avent told but the whole part of this plugin is making a mini version of essentials but my problem is just i cant figure out how the custom config part works, i cant get that to work and this cooldown thing dosent work as i want either

worthy yarrow
#
public class InviteService {

    private final Map<UUID, Set<Invite>> invites;

    public InviteService() {
        this.invites = new ConcurrentHashMap<>();
    }

    public void createInvite(UUID inviter, UUID invitee, Duration duration) {
        Instant expiryTime = Instant.now().plus(duration);
        Invite invite = new Invite(inviter, invitee, expiryTime);

        this.invites.computeIfAbsent(invitee, uuid ->
                ConcurrentHashMap.newKeySet()).add(invite);
    }

    public boolean acceptInvite(UUID invitee) {
        Set<Invite> inviteSet = this.invites.get(invitee);
        if (inviteSet == null) {
            return false;
        }
        Optional<Invite> inviteOpt = inviteSet.stream().findFirst();
        if (inviteOpt.isEmpty() || inviteOpt.get().isExpired()) {
            return false;
        }
        inviteSet.remove(inviteOpt.get());
        if (inviteSet.isEmpty()) {
            this.invites.remove(invitee);
        }
        return true;
    }

    public boolean rejectInvite(UUID invitee) {
        return this.invites.remove(invitee) != null;
    }

    public boolean hasInvite(UUID invitee) {
        Set<Invite> inviteSet = this.invites.get(invitee);
        return inviteSet != null && inviteSet.stream().anyMatch(invite -> !invite.isExpired());
    }

    public void removeExpiredInvites() {
        for (Set<Invite> inviteSet : this.invites.values()) {
            inviteSet.removeIf(Invite::isExpired);
        }
    }

    public void clearInvitesMap(){
        this.invites.clear();
    }

}

...

public record Invite(UUID invitee, UUID inviter, Instant expiryTime) {

    public boolean isExpired() {
        return Instant.now().isAfter(expiryTime);
    }

}

Don't copy/paste this it will not work for your system

You can try to look at this invite service I made a while ago and adapt the expiration logic to your cooldown logic

#

The main parts you want to look at the are the create/accept invite methods as well as the Invite record

silent turret
worthy yarrow
sage hare
worthy yarrow
#

What does the error say?

#

Cuz it might just be deprecated

sage hare
#

it says rename refrence

worthy yarrow
#

send the snippet of code

#

?paste

undone axleBOT
worthy yarrow
#

Your code I mean

worthy yarrow
#

one sec

#

send me cooldownManager

worthy yarrow
#

line 49, remove that

#

Otherwise I don't see an issue here

sage hare
#

but it stills gives the error

#

it says "toSeconds() has private acces in java.time.Duration

worthy yarrow
#

what java version are you using?

sage hare
#

8

worthy yarrow
#

Hmm I'm using 21 and it's fine for me

sage hare
#

...

#

yea

#

probably because of that

#

everytime its because it dosent work for 1.8

#

So the only other way to make a cooldown is with timestamps?

worthy yarrow
#

I think it becomes public in j9

sage hare
#

yeah but i cant use java 9 in 1.8 thats the problem

worthy yarrow
#

Well most times you're gonna get a "we don't support outdated versions" and rightfully so... you can see an issue here already

#

?howoldis 1.8

#

?howoldis1.8

#

wtf is the command

#

?1.8

undone axleBOT
sage hare
#

yeah i understand but i just like 1.8 more and where im from people are only playing on 1.8, its only 1.8 servers people dont quit

worthy yarrow
#

That's not true

sage hare
#

so i dont want to make a server on a newer version

sage hare
worthy yarrow
#

It's really not

smoky oak
#

every time i see that link i go has it been a decade yet

worthy yarrow
#

Most people's only excuse for 1.8 is the pvp yet in higher version you can easily mimic 1.8 pvp

blazing ocean
undone axleBOT
worthy yarrow
#

?1.8

undone axleBOT
blazing ocean
#

that doesn't say the exact time in the embed

worthy yarrow
#

oh well

sage hare
smoky oak
#

?8

#

darn

wet breach
nova notch
worthy yarrow
#

Well yeah but now there's a major roadblock in me helping this guy

#

I figure updating is your best bet

nova notch
#

yeah i really dont understand why anyone would make new 1.8 servers/plugins in the modern age

#

why would you shoot yourself in the foot like that

worthy yarrow
#

It's just the fact that updated software is exactly that... updated, there's a lot more you get from spigot api especially and that only makes things easier so...

nova notch
#

the biggest thing is probably that most players do not want to play 1.8 tho

#

growing a new server is already hard enough with tons of competition, and limiting it to such an old version does not help in the slightest

wet breach
sage hare
#

@worthy yarrow This way wasnt posible right? do you know if i can get it publkic any other way

eternal oxide
sage hare
eternal oxide
#

its not changed since 1.8

sage hare
eternal oxide
#

I'm using it in a 1.8 plugin

worthy yarrow
#

🤷

worldly ingot
#

You've either got some fucked up JDK or your IDE is having a stroke, because Duration#toSeconds() is not, and has never been, private

eternal oxide
#

Are all your cooldowns the same for all commands?

#

or shoudl I say for each command for all players

#

?paste

undone axleBOT
eternal oxide
#

for me

mortal hare
#

is it possible to reference static method in java without typing out the class name like this:

#

map(Foo::bar)

eternal oxide
worthy yarrow
#

^ do all that for sure but please learn some more java before trying some more complex plugins

worldly ingot
#

::method would be convenient, but whatever :p

mortal hare
#

ok

#

i give up on static imports

#

and var

#

i admit, it was a mistake for me to think like that

#

i wanted to use it just to cleanup the syntax

#

but then you can't do

var foo = <Bar> buzz();

if you have method:

public static <T> T buzz() {} 
#

the only workaround for this is use class path:

var bar = Foo.<Bar>buzz();

or just use simple type instead:

Bar bar = Foo.buzz();

which is way cleaner

#

you might as well just use full static class path instead and full types, just for the sake of consistency of codebase because then you have things like this and syntax differs

slender elbow
#

i mean you can also just do Bar bar = buzz() if it's being static imported anyway

mortal hare
#

also you can't statically reference static imported method via this::buzz or just ::buzz

mortal hare
#

i just dont like to use workaround syntax which is inconsistent to the style you do most of the time

mortal hare
mortal hare
#

i believe consistency is better in this case because when reading between codebase you know that everything is written in such style, you know it behaves exactly as it does in other fragment of the code, without some kind weird syntax which was being used to workaround java syntax issues with your code style

#

im probably overthinking this, but i just want to find the perfect recipe for readable code

sage hare
eternal oxide
#

change nothign in teh Cooldown command class

#

unless you want to modify the messaging is all

#

its an abstract class

#

all yoru code goes in your version of the TestCommand

sage hare
#

okay thanks

#

should i care about this?
/**
* Set a Duration.ZERO to disable command Cooldowns.
*
* @param duration time period
* @return T typed instance.
*/

#

what do you mean with duration.zero

#

?

eternal oxide
#

its just a comment so you know how to disable cooldowns on any commands

#

look in the TestCommand class

#

it has a comment to show you how to init a new command

#

if you add that line to your onEnable you would be creating a TestCommand with a cooldown of 10 seconds

#

all your code for the command goes in the processCommand method

sage hare
#

okay thanks

#

@eternal oxide in line 38 at the last word "player"
if (!cooldown.isZero() && sender instanceof Player player) {
its giving an error: Patterns in 'instanceof' are not supported at language level '8'

eternal oxide
#

ah yeah thats not java 8

warm musk
#

guys how can i make a basic npc system? i cant find any new or nearly date tutorials.

worthy yarrow
#

look at citizens

warm musk
smoky oak
#

yea goooooood luck then

rough ibex
#

What do you mean then

wet breach
#

you will not always find a tutorial on everything that is up to date

mortal hare
chrome beacon
chrome beacon
mortal hare
quaint mantle
chrome beacon
#

No more string templates for now

mortal hare
quaint mantle
mortal hare
proper cobalt
mortal hare
nova notch
#

can u stop spamming ur shitty memes pls

chrome beacon
mortal hare
mortal hare
chrome beacon
#

no 🔫

mortal hare
chrome beacon
#

no 🔫

short drift
#

Any tips on how to capture an item burning in lava cauldron (getting destroyed)? I've tried DestroyEntityEvent, EntityCombustEvent, and ItemDespawnEvent , but I'm not getting anything through.
It seems to work with regular fire, but I'm not getting anything out of lava cauldron.

autumn ingot
chrome beacon
#

It will trigger EntityCombustByBlockEvent for living entities? but not for non-living ones?

young knoll
#

Death event?

#

Or is that living entities only

chrome beacon
#

tbh I feel like this shouldn't be living entity only

#

The event takes a regular entity and not a living one

#

ig if you wanted to you could make a JIRA ticket and see what MD says about it

sullen marlin
young knoll
#

?protocol

young knoll
#

Wonder if that’ll ever become a main wiki page

sullen marlin
#

?jira

undone axleBOT
slender elbow
#

they just offered a place to host it

young knoll
#

I see

marsh sluice
#

can somone help

#

my server keeps crashing and saying this in console

#

and this is the error report

#

@ivory sleet and @wet breach does this help with anything?

#

its the same issue as before

smoky oak
#

im assuming youre on some linux distro

#

uninstall and reinstall your java

#

no guarentees tho

#

(its saying it cant find java-related, apparantly important, libraries)

marsh sluice
#

and will that reset any data?

marsh sluice
smoky oak
#

well since this most likely is a issue with java, contact your host.

#

it shouldnt erase any data if done properly

worldly ingot
vocal cloud
#

plugins/.paper-remapped/LuckPerms-Velocity-5.4.145.jar' does not contain a paper-plugin.yml or plugin.yml! Could not determine plugin type, cannot load a plugin from it!

worldly ingot
#

That's a different issue. They installed the Velocity version of LuckPerms on the server

#

The problem they're having is that they installed this plugin from Modrinth but didn't install its dependency, KotlinPlugins, by the same author

worldly ingot
loud goblet
low crow
#

Hey all, im slowly getting back to plugin coding, rn im in 1.20.1 and I just learned that they splitted the Material enum into two distinct objects types : ItemMaterial and BlockMaterial and im a bit confused because im trying to place a block from a blockstate i saved earlier and the getMaterial() method for blocktypes returns a BlockMaterial while the setType method in World still requires a Material (as it was before) :

```npc.getEntity().getWorld().setType(targetBlock.getLocation(), blockInfo.getBlock().getBlockType().getMaterial());````

Now i looked it up on google and apparently its an experimental feature (or at least it was until recently idk if it still is) is there a build of spigot 1.20.1 that perhaps doesnt use this new system ?

smoky oak
loud goblet
sullen marlin
glossy laurel
#

Does Bukkit.getPlayer work if I pass it stringified uuid?

quaint mantle
#

No it will lookup by name

#

You have to serialize string back to uuid

loud goblet
#

Is it usual for intellij to just hang while decompiling classes for buildtools?

pliant topaz
#

It's there to easier distinguish between blocks and items for later versions

chrome beacon
#

But no it doesn't usually happen

loud goblet
#

Its at the item part

chrome beacon
#

As for your maven issue the remapping is wrong

#

Version mismatch and not using the remapped artifact

#

?nms

loud goblet
chrome beacon
#

Yes

#

Run it with the remapped flag and the versions it needs

#

After that you can compile

#

Do fix that pom though

loud goblet
#

i can just get the remapped jars through the buildtools jar gui version and put it in the project folder yes?

loud goblet
chrome beacon
loud goblet
vast ledge
#

Yes

#

Then fix ur pom

#

And then you can use

loud goblet
#

so is this part i need to change?

summer scroll
loud goblet
#

i still have the error and nowhere to figure out whats happening

#

oh wait

#

right now im trying to focus on this

blazing ocean
loud goblet
#

really confused on whats happening since the other poms are identical and just differ in the version but still work

sullen marlin
#

What's the issue ?

loud goblet
#

I'm trying to compile a plugin that relies on NMS but when i compile it and get to the part of the 1.20 module it just says invalid csrg file line

loud goblet
summer scroll
loud goblet
#

I ran them using the gui version instead since the command line version lags intellij

#

dont know why picking the 1.20 version gives 1.20.1

summer scroll
#

Well, not sure about why it's giving you 1.20.1

loud goblet
#

same with 1.21 and giving me 1.21.1

sullen marlin
#

Because those versions have been entirely obsoleted

#

Generally means the versions are compatible and have important changes which means for no reason the older one should be used

#

So you need to update your plugin to 1.20.1/1.21.1

loud goblet
#

ty

zenith anchor
#

getLoadedChunks() on world seems slow, is there any faster alternatives? I'm simulating my own crop growth so i have to modify every loaded check every tick

eternal oxide
#

every loaded chunk every tick seems a little overboard for growing crops

zenith anchor
#

because these are non-vanilla crops so

#

additional growth simulation is required

hybrid spoke
quasi gulch
smoky anchor
#

no, that can be spoofed most likely
if you don't want the player to jump, use different techniques
if you're on newer versions, just use the attribute

quasi gulch
#

What Attribute?

#

Jump_Strenght?

smoky anchor
#

I believe so, yes

sage hare
#

?paste

undone axleBOT
sage hare
#

(its for 1.8.8)

loud goblet
#

is there any reason why it throws out this error with this code im trying to modify at?

#

let me just send

eternal oxide
#

First "paper"

#

?nms second not remapped

loud goblet
#

I swear it was remapped

eternal oxide
#

Doesn't ook remapped net.minecraft.core.RegistryAccess$Frozen.registryOrThrow(net.minecraft.resources.ResourceKey)

loud goblet
#

I see okay wait let me send the pom for this

sage hare
eternal oxide
#

looks fine

loud goblet
#

thanks og towny guy, didnt realise i wasnt using the remapped on the pom @eternal oxide

echo basalt
sage hare
dry thistle
#

Hi all, i was wondering if the YamlConfiguration Framework with is used in SpigotAPI is possible to use outside of the minecraft context. Do you guys know if the libary is useably outside or if there is a similar libary ?

pseudo hazel
#

technically sure

#

i dont know if anything would prevent you from doing it

chrome beacon
#

I can highly recommend using Configurate uwu

dry thistle
#

Thank for the reply, i will take a look at configurate

chrome beacon
#

Use comments PR branch if you need that

young knoll
#

Olivo is a paid spokesperson!

chrome beacon
#

I wish :sadge:

broken bridge
slender elbow
#

jackson my beloved

upper jackal
#

Hey,

can someone help me with my java code? for a plugin, for permissions

chrome beacon
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

upper jackal
#

With my plugin only one of the 3 permissions works.

can I send the code here?

or can someone help me via dm

smoky anchor
#

?paste

undone axleBOT
upper jackal
#

Does anyone know why the permission deluxeskulls.reload works here but the other two deluxeskulls.bypass and deluxeskulls.use don't work?

viral widget
#

Hi! does anyone have a recommendation for a library to send messages to discord through a webhook?

smoky oak
#

is there api in spigot to make dealing with sql easier?

remote swallow
#

a lot of people use hikari for connection management

#

otherwise most orms should™️ work with spigot

smoky oak
#

i meant more along the lines of the connection and creation of the db

drowsy helm
#

Hikari helps with connections and pooling

chrome beacon
#

Yeah Hikari

smoky oak
#

i dont need high throughput i need something simple lol

drowsy helm
#

And you wont really have anything for db creations unless you use an orm with db creation

chrome beacon
#

If you just want something simple just use Javas SQL api

#

It doesn't do any connection pooling for you so keep that in mind

smoky oak
#

i only need one anyway

#

my goal is to sidestep chunk pdc so my plugin doesnt bloat world size

chrome beacon
#

The connection will close itself after a while

#

30min or so irrc

#

iirc*

drowsy helm
#

You definitely want connection pooling for that

remote swallow
#

unless your storing a hell of a lot stuff you wont bloat world size with pdc

viral widget
#

i saw it, but thoguht it was kinda abandoned

drowsy helm
#

Yeah agreed, pdc will take up a few kilobytes per chunk. At most

amber fjord
#

Im trying to spawn an arrow that deals a set amount of damage and effects the hit target with something. I also need to summon particles behind the arrow. Is it possilbe to use the spawnArrow() method to do this or do I have to create a new arrow instance with the 5000000 methods

drowsy helm
#

Then you can check the pdc and accordingly apply your stuff on hit

amber fjord
#

oh alr

amber fjord
#

would it work if i use the arrow method inside a variable like UUID arrowId = world.spawnArrow().getUniqueId;

#

like would the arrow spanw

#

actuallly one way to find out

#

it does

#

ty for the help

sinful kiln
#

Is there a way to register custom sounds?
Cause I'm would like to use a custom sound for the EquippableComponent which should in theory work but there is no method to put just a NamespacedKey or just path
I'm working on the 1.21.4 api

worldly ingot
#

Oh, sorry, EquippableComponent

#

I just totally skipped over that part

sinful kiln
#

x)

#

I guess if I wanted a custom sound it seems like I need to do it manually right?

worldly ingot
#

There is a Sound registry which should work though

#

Registry.SOUNDS.get(NamespacedKey)

sinful kiln
#

Yeah but how would I register a sound?
Does that already do that?

worldly ingot
#

You have to do it with a resource pack

eternal night
#

that would still not register it on the server side

sinful kiln
#

Exactly

worldly ingot
#

I suppose not

sinful kiln
#

And the Equippable component requires a SoundEvent internally which needs to exist in the registry

eternal night
#

Technically the API could expose a NamespacedKey setter tho

#

but then the getter starts having issues

worldly ingot
#

Not necessarily. We have registry aware content now so things don't have to exist in registries

sinful kiln
#

You sure?
As I said it requires a SoundEvent directly (the nms part)

remote swallow
#

did paper not pull that

eternal night
#

No lol

#

RegistryAware is too funny omegaroll

remote swallow
#

what are you gonna do when miles ports the poi pr

sinful kiln
#

Is that why lots of my objects that use getKey are saying that getKey is deprecated?

eternal night
#

Yea

sinful kiln
#

What would I use instead now?

eternal night
#

I guess spigots registry aware thing?

#

I'd hope it has some maybeKey()

eternal night
remote swallow
sinful kiln
#

I found it

#

thanks

remote swallow
#

or null or or throw

eternal night
#

but like, you should just not rely on the key

remote swallow
#

im too used to kotlin i went to look for a NamespacedKey! as the return type

sinful kiln
# eternal night org.bukkit.Sound is SoundEvent

Yeah I know but the main issue I see with exposing the NamespacedKey would be that the Equippable component requires a Holder<SoundEvent> which in turn should mean it requires to be registered or am I wrong?

eternal night
#

no?

#

Sound is the Holder<SoundEvent>

#

hence getKey is deprecated

eternal night
sinful kiln
#

Yeah but how does that relate to what I said?
If I can't register a custom sound how would bukkit get a Holder<SoundEvent> so that it can create the Equippable record?

eternal night
slender elbow
sinful kiln
eternal night
#

Yea, those are the reason getKey is deprecated

#

because inlined values that are not in the registry can exist in some places

sinful kiln
#

So for now I need to go the NMS way here

#

With an direct holder I guess

eternal night
#

or poke choco to PR it

#

but yea for now NMS it is

#

|| or paper API, don't ban me choco ||

sinful kiln
#

I also encoutered another issue with the new data components, fully removing a component doesn't really seem to work

eternal night
#

Yea, rather certain item meta just doesn't do that

sinful kiln
#

Cause I tried removing the JukeboxComponent of a music disc by setting it to null

#

And it didn't remove it

eternal night
#

Yea, pretty sure ItemMeta doesn't allow for that

sinful kiln
#

The setter is Nullable so that's fine but instead the component is just empty

#

Which in turn isn't the expected result

slender elbow
#

setting to null in itemmeta will remove the component from the patch so it'll get the component from the prototype

#

itemmeta does not allow for marking a component as removed

sinful kiln
#

So that's just not possible using the Bukkit api rn

slender elbow
#

correct

eternal night
#

|| spigot API* ||

slender elbow
#

legend says that ItemMeta is a highly flexible system

#

I have yet to experience that

eternal night
#

must mean you are not part of the legendary squad then

sinful kiln
#

okay thanks you all for your help

proud badge
#

hi, any1 know what could be causing this error? the class is right here (this error only started occuring after updating to 1.21)

java.lang.NoClassDefFoundError: Could not initialize class mc.ajneb97.lib.fastboard.FastBoard
        at MineChess.jar/mc.ajneb97.managers.ScoreboardAdmin.actualizarScoreboard(ScoreboardAdmin.java:50) ~[MineChess.jar:?]
        at MineChess.jar/mc.ajneb97.managers.ScoreboardAdmin$1.run(ScoreboardAdmin.java:38) ~[MineChess.jar:?]
        at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:78) ~[pufferfish-1.21.3.jar:1.21.3-27-04bc249]
        at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:474) ~[pufferfish-1.21.3.jar:1.21.3-27-04bc249]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1811) ~[pufferfish-1.21.3.jar:1.21.3-27-04bc249]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1672) ~[pufferfish-1.21.3.jar:1.21.3-27-04bc249]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1331) ~[pufferfish-1.21.3.jar:1.21.3-27-04bc249]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:341) ~[pufferfish-1.21.3.jar:1.21.3-27-04bc249]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.ExceptionInInitializerError [in thread "Server thread"]
        at MineChess.jar/mc.ajneb97.lib.fastboard.FastBoardBase.<clinit>(FastBoardBase.java:185) ~[MineChess.jar:?]
        ... 9 more```
eternal night
#

?paste

undone axleBOT
proud badge
echo basalt
#

pufferfish

eternal night
#

paste the class

proud badge
echo basalt
#

bet 5 bucks it's either a shade issue or paper-plugin classloader reloaded

proud badge
#

its not my plugin btw, but the owner is inactive

#

so ill have to fix it myself

eternal night
#

imllusion unable to read Sadge

echo basalt
#

nvm it's a static block error smh

eternal night
#

Yea xD

echo basalt
#

I didn't open the stacktrace

#

mb

#

"open" my ass, I only read the first 2 lines

#

mbmb

eternal night
#

omegaroll dude went to paper-dev too, love it

proud badge
#

you mentioned "paper-plugin classloader reloaded"

eternal night
#

The sub 1 minute response time wasn't enough dies

#

it wasn't, ImIllusion just had a bit of a brain fart, happens to the best

#

paste the entire class

proud badge
#

ye I sent the wrong thing

#

I deleted the message

#

ignore this one

eternal night
#

Is there more of the stacktrace then?

#

that line is just the rethrow

proud badge
#

or is this another issue, unrelated

fluid river
#

what's going on

proud badge
fluid river
#

java.lang.NoSuchMethodError: 'org.bukkit.inventory.meta.ItemMeta$Spigot org.bukkit.inventory.meta.ItemMeta.spigot()'

#

it's either version mismatch or incompatible core and plugin

proud badge
#

yeah ik, the plugin is old and im trying to get it to work for 1.21 and im trying to figure out the problem

proud badge
proud badge
fluid river
#

java.lang.NoClassDefFoundError: Could not initialize class mc.ajneb97.lib.fastboard.FastBoard

#

your minechess either depends on FastBoard lib which is not installed or having version mismatch, or lib is shaded but outdated

clever lantern
#

how do i remove this, i add all flags to the meta and its still there

mortal hare
#

writing javafx UI is such a cancer

#
@NullMarked
public static final class Column {
    private Column() {}

    public static <T> TableColumn<T, CheckBox> checkbox(final BiConsumer<? super Boolean, ? super T> changed) {
        return Table.column((final TableColumn.CellDataFeatures<T, CheckBox> features) -> {
            final CheckBox checkbox = new CheckBox();
            checkbox.selectedProperty().addListener((observable, old, current) -> {
                changed.accept(current, features.getValue());
            });

            return new SimpleObjectProperty<>(checkbox);
        });
    }

    public static <T> TableColumn<T, Button> button(final String label, final Consumer<? super T> clicked) {
        return Table.column((final TableColumn.CellDataFeatures<T, Button> features) -> {
            final Button button = new Button(label);
            button.setStyle("-fx-max-width: " + Integer.MAX_VALUE);
            button.setOnMouseClicked(event -> clicked.accept(features.getValue()));

            return new SimpleObjectProperty<>(button);
        });
    }
}
#

why so much code just to add table column with a button

#

or checkbox

lilac dagger
#

isn't swing the superseeder?

mortal hare
#

i miss web dev

mortal hare
lilac dagger
#

hmm

#

ah wait, is this web?

#

i see -fx-max-width

#

i mean i like swing

mortal hare
#

that's css in javafx

#

javafx supports CSS layout

lilac dagger
#

i see

mortal hare
#

basically i use it here because setting it programatically is a cancer to deal with as its not being controlled by the same layout manager

#

basically if you set anything through methods you need to write your layout managers to deal with font sizes etc

#

im not doing that

lilac dagger
#

this is what i made in swing

#

and this is how the connect button works

hazy parrot
#

javafx scene builder my beloved

mortal hare
#

this is what i have rn

#

basically im trying to make shit ton of factory methods to make it so i can reuse the nodes across the app, so FXML is out of question here

lilac dagger
#

it shouldn't be that hard in swing

#

i'm not sure how to create the table tho

#

probably there's some jElement for it

mortal hare
#

JavaFX does have kinda Reactivity built in with its bindings system

lilac dagger
#

but you need javafx separately

mortal hare
#

you can basically listen for collection and element property changes

lilac dagger
#

that's cool

twilit coral
mortal hare
#

basically im trying to build component level declarations at the app runtime, esentially bypassing IO FXML loading, which is useless really and more clunky than just to build components in the FXML format

#
    public static Scene scene(final Stage stage, final SceneManager scene, final UserInformationService service) {
        final TextField username = FormInput.text();
        final PasswordField password = FormInput.password();

        return new Scene(
            Form.root(
                Login.HEADING,
                Form.inputs(
                    FormInput.labeled("Prisijungimo vardas", username),
                    FormInput.labeled("Slaptažodis", password)
                ),
                Form.buttons(
                    FormButton.primary("Prisijungti", event -> {
                        final UserInformation<UserCredentials> user = service.authenticate(new UserSensitiveCredentials(username.getText(), password.getText()));
                        if (user == null) {
                            Login.FAILURE.show();
                        } else {
                            stage.setScene(scene.getAdministrator());
                        }
                    }),
                    FormButton.secondary("Registracija", event -> stage.setScene(scene.getRegister()))
                )
            )
        );
    }

something like this

#

I declare static factory methods and then those methods in combination builds me nodes for a scene

#

essentially a component system, but a static one

grim hound
#

does anyone suspect why this might be?

#

made sure to include those in the settings file

eternal night
#

include("src") soudns dangerous/wrong

ivory sleet
mortal hare
#

Foo::bar

#

i've decided to skip those for the sake of consistency

ivory sleet
#

i mean u can write inlined functions to monomorphize generic arguments if needed

mortal hare
#

wdym inlined functions, java doesnt have inline functions

ivory sleet
#

like say u have a static factory method with some generic signature

mortal hare
#

right

ivory sleet
#

then u can write a function that just passes the type arg

#

and then use that given func

#

ofc its more verbose in other places

#

but the structure itself doesnt get affected

mortal hare
#

eh then you litter your codebase just to make a workaround for your style

ivory sleet
#

well its against the boilerplate that is caused due to the semantics of java itself

mortal hare
#

anyways, is there any hotkey which autofixes all problems without having to manually select each of the warning?

#

im sick and tired of hovering for each warning

#

something like ALT+ENTER

#

but for all warnings

#

or at least with a dropdown selection with grouped warnings to autofix

#

im tired of qualifying each static method manually by pressing alt enter on each method call and pressing qualify static method

ivory sleet
#

otherwise u can just bind it

mortal hare
#

that's like saying on stack overflow after a question, "solved it" without providing a solution 😄

ivory sleet
#

ctrl alt l

mortal hare
#

tbh i should probably use static method imports, as i dont use var anymore

ivory sleet
#

u need to fix inspections tho if u wna use ctrl alt l to format it acordingly

mortal hare
#

i just need to split up the code into multiple clases

#

so that i wouldnt get collisions

mortal hare
#

Code cleanup menu seems a way to go

ivory sleet
mortal hare
#

but you need to define your own hotkey

ivory sleet
#

type inference is neat, but eeeeh

ivory sleet
#

kinda depends on what u're after

blazing ocean
#

tbh just spotless + qodana

grim hound
#

but still

remote swallow
#

what does ur project dir look like and what do the build.gradles look like

grim hound
#

I don't get the A dependency was declared on configuration 'default' which is not declared in the descriptor for project :AlixSystemLoader.

remote swallow
#

wtfhttps://mvnrepository.com/artifact/com.velocitypowered/velocity-native

#

oop

#

use repositories

eternal night
#

that loks very wrong

#

the sub modules do not have settings.gradle.kts (should not, they have)

remote swallow
#

and it cant find it because you dont have the velocity repo

eternal night
#

nor should they have a gradle wrapper

grim hound
#

do not question it, I'm just tryna migrate it from my 2 year old mistake of doing this project with intellij artifacts

remote swallow
#

what does the parent build.gradle.kts look like

grim hound
remote swallow
#

no

grim hound
remote swallow
remote swallow
grim hound
eternal night
#

velo natives are 100% in our repo

grim hound
eternal night
#

With whatever scuffed af layout you have, I am not surprised

#

tho, I won't question that run gl

remote swallow
#

it is very scuffed

grim hound
#

I already am more than aware

remote swallow
eternal night
#

Yea but if you are migrating then why aer you migrating it wrong

grim hound
#

rn just trying to get it to work, will do the pretty stuff later on

eternal night
#

no like, what you are doing is not just not pretty, it is dangerous and potentially wrong/breaking

grim hound
#

doing my best man

#

it ain't easy if you got void up there

remote swallow
#

is that stuff up to date, if it is ill pr the correct gradle impl of it

eternal night
#

EpicEbic the offline mode plugin contributor

remote swallow
#

wait

#

is that actually offline mode

eternal night
#

This is the source code of the spigot antibot & authentication plugin

grim hound
grim hound
#

nonono

#

absolutely not

#

um

#

this is uh

#

a music

remote swallow
#

hmmmmmmm

grim hound
#

uh

remote swallow
#

maybe i wont be pring the gradle impl kekw

grim hound
remote swallow
#

but yeah, submodules shouldnt have settings.gradle.kts

grim hound
#

hmm, well intellij auto-generated em for me

remote swallow
#

you shouldnt EVER need to use file dependences too

remote swallow
#

99% of things are on repos and should be used from them

grim hound
#

alright

remote swallow
blazing ocean
#

IJ build...

eternal night
#

We listen and we don't judge

grim hound
#

I feel judged enough

remote swallow
#

rad is judging you, fight him

grim hound
#

he a fish tho

#

(and it's not like I don't agree with him)

blazing ocean
#

why am i applying dokka twice

dry hazel
#

why tho

#

gradle generates the dsl accessors so why not use them

blazing ocean
#

for some reason that doesn't work in a subprojects/allprojects block for me

#

dunno if that's intended but yea

#

it just configures it for the root, not the target project

grim hound
#

this seems so nice

#

please teach me

#

the tutorials - they're too boilerplate

young knoll
#

You just create environment variables with those names

grim hound
#

I get that part-

#

I meant the whole

#

publishing

blazing ocean
#

for most gradle google searches i get ancient stackoverflow answers which are groovy and using the shittiest practices ever

remote swallow
#

it just configures the maven-publish plugin

blazing ocean
#

so I just learn from other projects

grim hound
#

thus, this is but elegant mastery in those eyes of mine

blazing ocean
#

that's just kotlin

grim hound
#

...yeah but all of the tutorials for this plugin had way too much stuff

#

if I include something in the general build.gradle.kts

#

will it be reflected on each module?

#

okay let me ask the Y question

#

does anyone know how I can inherit some dependencies from the parent project?

idle ether
#

Is there an easy way to see item names and id's to use for Spigot? I'm trying to do a recipe that creates leads and another one for enchanted books

drowsy helm
#

the best way to do it is manually import the ones they have. or inherit ALL

drowsy helm
grim hound
#

how can I inherit all?

remote swallow
drowsy helm
#

with kotlin you just use the "api" instead of "implementation" not sure in groovy

young knoll
#

Same thing

grim hound
remote swallow
#

you can choose some

young knoll
#

You need java-library tho

#

Not just java

grim hound
#

oh

young knoll
#

(The gradle plugin I mean)

#

And yeah you can pick and choose

remote swallow
#

what jishlib version are we on now

young knoll
#

compileOnly/compileOnlyApi and api/implementation

grim hound
#

so is api more like implementation or more like compileOnly?

young knoll
#

implementation

remote swallow
#

when jishlib 5.0

bold nebula
#

It's possible to send a bow animation packet now that they added food component on 1.21.4?

drowsy helm
#

that is clientside

bold nebula
#

When the player is not holding bow

#

I dont want the pulling animation you get when using the bow

slender elbow
#

yeah it's one of the item use animations

bold nebula
#

Just the animation

slender elbow
#

whjat

#

I dont want the pulling animation you get when using the bow
Just the animation

young knoll
#

Peanut free peanuts

remote swallow
#

my favourite

#

air

bold nebula
#

Show this animation for other players

grim hound
#

so yes, it MUST be possible

#

gl searching 👍

bold nebula
#

And yes, ik you can with food components but it's not great for what in trying to do

drowsy helm
#

It's in the player state iirc

#

let me find my code

#
    public void setInteracting(boolean value){
        CustomEntityData entityData = getCustomEntityData();
        if (!entityData.isSpawned())
            return;

        //8 is interact accessor
        EntityDataAccessor<Byte> accessor = getAccessor(8);
        asEntity().getEntityData().set(accessor, (byte) (value ? 1 : 0 ));

        updateEntityData();
    }


    private <T> EntityDataAccessor<T> getAccessor(int id){
        SynchedEntityData synchedData = asEntity().getEntityData();
        SynchedEntityData.DataItem<?>[] dataItems = DataItemReflectionUtil.getDataItems(synchedData);

        //add to list
        for (SynchedEntityData.DataItem<?> dataItem : dataItems) {
            if(dataItem.getAccessor().id() == id)
                return (EntityDataAccessor<T>) dataItem.getAccessor();
        }

        return null;
    }
#

yeah so you need to get the synched entity data, set the value of the corrcet accessor and send the entity update packet

young knoll
#

Can you not use playEffect

drowsy helm
young knoll
#

Yeah

drowsy helm
#

isn't that for sound

grim hound
drowsy helm
#

this is a list of the effects, all of them are to do with sounds or particles

young knoll
#

You silly

drowsy helm
#

that is what the method takes

young knoll
#

That’s deprecated

grim hound
drowsy helm
#

oh its on entity

young knoll
#

Yes both methods are called playEffect

#

Shhh

#

Don’t question it

drowsy helm
#

either way don't really see a use item one

bold nebula
#

Same

drowsy helm
#

I'm happy to provide the code I used, but if you can just use playEffect that would be a million times easier

young knoll
#

Mmm

#

You probably need packet shenanigans then

grim hound
#

how

grim hound
#

thanks intellij

#

and it just appeared back again

#

wtf

#

is the 2024 version buggy or smthg?

pseudo hazel
#

works on my machine

grim hound
smoky oak
#

is {} no longer an empty constructor when extending another class that has more than one constructor?

#

it says 'unreachable code'

grim hound
smoky oak
urban cloak
#

it works for me

drowsy helm
urban cloak
#

what if you make it static?

smoky oak
#

well yea then it works

#

my question is why doesnt it work like this

drowsy helm
smoky oak
#

like aint this the same thing

drowsy helm
#

its 99% your IDE being fucky

drowsy helm
#

initializer and constructor are different things

grim hound
#

how do I tell intellij to stop seeing this invisible literally fucking not existing module?

smoky oak
#

!

#

right that was a thing

#

i know whats going on here now

#

mostly

grim hound
drowsy helm
#

I've had issues with gradle before where submodules just wouldn't dissapear no matter what i tried

grim hound
#

Gradle

remote swallow
#

that is most likely an intellij issue

drowsy helm
#

try invalidate caches

grim hound
#

Already did

#

I deleted it

#

Like a fucking year ago

#

And now it says: a, right, there was thta

remote swallow
#

delete .idea and reopen ¯_(ツ)_/¯

grim hound
#

Tomorrow I'll remove everything

#

Fuck it

#

Project stays

drowsy helm
#

or try Project Structure > Modules

#

and delte from there

grim hound
#

All idea gone

grim hound
#

It still doesn't care

#

Gn

smoky oak
#

ive been told earlier sql connections terminate after 30 minutes. is this true for mysql?

#

im assuming not but i really dont want to waste the next half hour staring at a clock

idle ether
# drowsy helm like a list of all materials?

long term, that would be useful, or at least a way to look them up. For now, trying to figure out why three custom recipes I have aren't working. The recipes use vanilla items. Also, is it possible to do a recipe with custom items?

smoky oak
#

think so

#

theres an event when stuff gets put into the crafting grid iirc

urban cloak
smoky oak
#

yea but i dont see the point when access is done via main thread anyway

#

like, whats the point in pools

urban cloak
#

that it handles reconnecting automatically

#

you can even use javas built in pool

smoky oak
#

which really, really shouldnt be an issue when pointing at a local file

urban cloak
#

oh

#

how can a connection termite after 30 minutes then

smoky oak
#

idk someone said sql does that in here like 4 hours ago

smoky oak
#

so i was like does sql do that too

drowsy helm
#

and yes, use ExactREcipeChoice

smoky oak
#

*mysql

drowsy helm
drowsy helm
#

just use connection pooling

#

it does it all automatically for you

urban cloak
#

yeah thats what i told him

smoky oak
#

qq, can the server crashing cause issues with the connection?

#

examples im looking at close the connection after the statement was executed

urban cloak
#

when the mc server crashes then the connection probably timeouts in mysql and is discarded

urban cloak
idle ether
timid berry
#

chat

#

how would i check if a user is in a portal and are still in it after 20 secs?
(portal trap detection)

fast jasper
#

hello. I am trying to use Spigot to change the text on a sign. I am currently using "sign.setLine" and "sign.update" methods to update my sign, and visually, it is working as I'm intending. however, my sign also has a command built in when right clicked usually. and when I use the "sign.update" method to update my sign, it strips my command out of it, making it a regular sign. does anyone know how to either keep this command as part of my sign, or add the command back into the sign's data somehow? thanks in advance

#

in short, I want to update a sign in my world, without removing the command it has

drowsy helm
fast jasper
#

my own

#

oh plugin setting the command?

#

the sign was already placed in the world previously without use of a plugin. I'm just modifying it with Spigot

#

I used vanilla features to create the sign

drowsy helm
#

signs don't inherently have executable commands. a plugin has to be doing that

fast jasper
#

that's not true

#

signs support commands. I've been doing command blocks and map making for years and you can do it fully in singleplayer even

drowsy helm
#

oh interesting

#

it will be in it's blockstate that

#

you should be able to copy the state over

fast jasper
#

got it. only problem is by modifying the text, I believe I'm throwing away the old state

#

if I copy the state. I'd be grabbing the exact text and facing direction etc. I presume. what I'd want is to be able to modify one aspect of this block (the sign's text), without affecting the other aspects (such as my command)

drowsy helm
#

yeah correct

#

I'm trying to find where the command is stored, can't seem to see anything pertaining to it

fast jasper
#

yeah , that's why I asked here in fact. it's suprisingly difficult to figure out

#

it's quite easy to do this with commands and command blocks themself, so Spigot should be even easier (at least usually from what I've seen)

drowsy helm
#

If it's not in it's blockstate I'd assume it would be in it's NBT

fast jasper
#

yeah I think it's probably that.

#

NBT isn't really something I've interacted with yet on Spigot before either

drowsy helm
#

Spigot has an NBT wrapper called PDC

#

?pdc

fast jasper
#

oh sweet

drowsy helm
#

you'll just have to figure out which key its stored under

fast jasper
#

I assume this is for 1.13.2 and later?

drowsy helm
#

1.14 i believe

fast jasper
#

aww I see. yeah I am actually working in 1.8.8...

#

I might just dispatch commands or use get block and set block to clone some signs I manually place. unless I'm missing something

#

thanks for sharing this resource though

drowsy helm
#

pretty sure NBT API works with 1.8

fast jasper
#

oh alright, guess I could take a look

#

ok, seeing "without NMS" reminds me actually. I actually have NMS setup on my Spigot project for some of the other stuff I've done with my plugin. anything in that I could use that you know of?

drowsy helm
fast jasper
#

hmm, I'll most likely just do something with commands then

#

dispatching commands I guess

#

there is a "blockdata" command that basically does exactly what I want. pick a block coordinate, and edit a signs text, while also setting the command. exists all the way back to 1.8. I'm surprised Spigot doesn't have that type of method

smoky oak
#

if you run buildtools with javadocs, does it generate a local javadoc you can open in the browser?

#

rather, whats the keybind for that? im pretty sure ive seen that done b4

drowsy helm
smoky oak
#

so i have a final value and this in the constructor

try{
  value = expression;
} catch(Exception e){
  value = null;
}

but it says that value might have been initialized already

but i do not know of a way to check if value has been initialized yet in the catch

wet breach
eternal oxide
#

if you run BT withthe javadoc flag it creates a folder with all the javadocs

echo basalt
#

Does anyone have any nice data structures I can use for custom item logic?

#

if not I'll make my own but I'm trying to open my mind to different approaches

#

I'm thinking like

BackpackData data = CustomItemTypes.BACKPACK.tryLoadData(item);

CustomItemType<?> type = CustomItemTypes.getType(item);
...
#

but then again there's nothing stopping me from having multiple types associated with an item and whatever