#help-development

1 messages · Page 1056 of 1

sand spire
#

Ah i finally understand cause all minecraft recipes are with 1 item

finite edge
#

yeah

eternal oxide
#

if I were you I'd make a custom recipe with a custom item instead of trying to require multiple pearls

#

you will have issues with Shift clicking to craft etc

finite edge
#

good idea

#

ill try doing it like that

#

thanks

sand spire
#

You can compare event.getRecipe().getResult() with your enderpearl itemstack. your other check won't work because Recipe and ShapedRecipe are totally different

#

And if you listen to CraftItemEvent you can use event.setcancelled(true) which will glitch the items back if it's wrong

finite edge
#

i change the check to this:
if (event.getRecipe().getResult().equals(ItemManager.getTeleportationWandRecipe().getResult()))

sand spire
#

yes but be careful cause event.getRecipe is nullable

finite edge
#

already did this:
if (event.getRecipe().equals(null)) {
return;
}

sand spire
#

oh wait nvm getresult will obviously return the wand not the enderpearl

#

i'd do what elgarl said it's way easier

finite edge
#

ok ill do that

#

thanks

sand spire
#

gl

finite edge
#

thanks

cinder abyss
#

Hello, what is the lightweight type for a PDC ?

eternal night
#

hm?

ocean hollow
#

how can I get which player group (permission)? Do I need to add the lp/another plugin?

eternal oxide
#

your question seems incomplete

ocean hollow
#

In my understanding, each player has a group (admin, default, player, ...), this can be easily configured in any plugin for controlling permissions.

#

so how can I find out which group a player belongs to?

eternal oxide
#

why? Groups are not really any use to a plugin other than for applying chat modification

#

a Group is simply a collection of permissions

ocean hollow
#

I just need the group name

#

and the config already contains, for example, the values ​​of the multiplier, etc.

eternal oxide
#

it depends on what perm plugin and how you are accessing it

molten hearth
#

does anyone know if acf is still supported for 1.20.6

chrome beacon
#

Should work fine

molten hearth
#

alr ty

#

im having weird java versioning issues with it atm but i guess its a skill issue

chrome beacon
#

What's the error?

hollow vessel
#

hi, how can I check if player took specific item from chest?

pseudo hazel
#

how specific

molten hearth
pseudo hazel
#

thats java

molten hearth
#

my build.gradle is ```gradle
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}

group = 'me.paradise'
version = '1.0-SNAPSHOT'

repositories {
mavenCentral()
maven {
name = "papermc-repo"
url = "https://repo.papermc.io/repository/maven-public/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/groups/public/"
}
maven { url = "https://repo.aikar.co/content/groups/aikar/" }
}

dependencies {
compileOnly "io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT"

compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'

testCompileOnly 'org.projectlombok:lombok:1.18.34'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'

implementation "co.aikar:acf-paper:0.5.1-SNAPSHOT"

}

def targetJavaVersion = 21
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'

if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
    options.release.set(targetJavaVersion)
}

}

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

shadowJar {
relocate 'co.aikar.commands', 'me.paradise.community.acf'
relocate 'co.aikar.locales', 'me.paradise.community.locales'
}```

molten hearth
dry hazel
#

use goooler's shadow fork

#

the original one doesn't support java 21

molten hearth
#

oh bro

shadow night
#

Interesting stuff here

molten hearth
#

yea i got it tx

#

yea now it seems to work

#

good shit

pseudo hazel
#

goooler back at it again

young knoll
#

Goober

worthy yarrow
#

What am I working on today

blazing ocean
worthy yarrow
blazing ocean
#

idk probably?

#

netcat >>>>

worthy yarrow
#

Perhaps I will

#

Whats the difference though?

blazing ocean
#

idk it works OOTB

mellow edge
#

does anyone by chance know how to push to origin in intellij, because my gitlab uses self-signed ceritificate and intellij doesn't allow it, where can I change it to allow non-trusted certificates?

blazing ocean
#

like you just nc -l 9999 and then just nc 1.2.3.4 9999 < file.txt

#

iirc ^

worthy yarrow
#

I think I just need to learn a bit more about tcp first

mellow edge
#

nvm just set sslVerify to false

young knoll
#

There’s api for it now

#

Player#add/remove/setCustomChatCompletions

wintry elk
undone axleBOT
undone axleBOT
#
CafeBabe Help Menu
*Red V3*
__**Admin:**__

selfrole Add or remove a selfrole from yourself.

__**Cleanup:**__

cleanup Base command for deleting messages.

__**Core:**__

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

__**Downloader:**__

findcog Find which cog a command comes from.

__**Mod:**__

names Show previous usernames, global display names, and server...
userinfo Show information about a member.

__**ModLog:**__

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

__**Permissions:**__

permissions Command permission management tools.

chrome bone
#

i cloned my own intellij project from github on another pc but i cant run it

#

the run button is greyed out saying the file in the editor is not runnable

hazy parrot
#

If not, it's not runnable

#

It has to have the main method

#

If you want to compile a spigot plugin, you have to run the Gradle task or maven goal from the right side

chrome bone
#

thx anyway

#

on my other pc i was compiling fine using the run button though

grim hound
#

Is it possible to add my own native methods to my plugin?

drowsy helm
young knoll
#

Smells like jni to me

slender elbow
#

I mean, sure?

drowsy helm
#

Dont see much reason for jni in a spigot plugin

young knoll
#

Maximum speeeeeeed

grim hound
#

I am the master optimizer

#

And I've reached the physical limits of java

#

I must ascend

#

I do not speak cpp or any language that isn't java

#

But I mean, how hard can it be?

grim hound
worthy yarrow
#

Love the mineimator watermark

drowsy helm
#

:((((

#

But yes it’s possible

#

Just a pain

young knoll
#

If you’ve reached the physical limits of java

#

And it’s still too slow

#

I have to wonder wtf you are doing

worthy yarrow
#

Coll creative enough to give me plugin ideas?

#

Anyone else is welcome to join too 😄

young knoll
#

Nuclear missile

worthy yarrow
#

I feel like that violates some policy

drowsy helm
#

Plus nuclear missle

humble lynx
# worthy yarrow Anyone else is welcome to join too 😄

https://youtu.be/i-tZhrTjkEI?si=_W3YoE_aNR4akVhC
I was about to recreate this, looks fun 🥳 the original code looks... Not good though

Hey there, in this video I'm showing you my prototype for a spell casting system in minecraft that doesn't require you to run a command. I've decided to go with this pattern-based drawing system since I thought this is an intuitive yet "realistic" (in the context of magic spells) way to cast a spell and I realy like the way how it turned out.
Th...

▶ Play video
worthy yarrow
# drowsy helm North Korea in minecraft

So basically any time a player's balance goes above 5000, it gets set back to 100 because yk support the country, 5% of the time they are stuck in their small little house with 7 different people, and 95% of the time they get to work, ie: mine iron, coal, diamonds, all the ores really and more. Finally when it's election time, we get to do nothing... because there is no election, this is dictatorship and I am the dictator. Everyone remains poor (.)

young knoll
worthy yarrow
#

ah

worthy yarrow
humble lynx
young knoll
#

Hex casting is a mod

#

It’s pretty cool but my brain might be a bit too smol for it

humble lynx
#

I'm not a huge fan of the complex spells, but I plan on doing simple shapes for some spells, and allow the player to select which spells for which shapes

worthy yarrow
#

Is it possible to display fonts in books?

humble lynx
#

I've already got a mana system which I'll hook into

young knoll
drowsy helm
#

Thought that was obvious

young knoll
#

No not that

#

I mean my brain is too smol to use the mod effectively

#

You gotta like combo a bunch of shapes and then things go brrr

drowsy helm
young knoll
#

I enjoy ars nouveau

#

Simple spell system but still quite powerful

young knoll
#

It’s also not very nuclear

worthy yarrow
#

I can make it bigger...

#

100F you think?

golden turret
#

how do i hide these buttons?

nova notch
#

make radiation

drowsy helm
#

do you guys reckon the text should be left or right aligned

river oracle
drowsy helm
#

will do ty ty

blazing robin
#

Hey guys, im creating freindship plugin, and I wanna create telpeort between cross server so I do my test code like this :

 public FriendCommand(JavaPlugin plugin) {
        PluginCommand command = plugin.getCommand("friendship");

        this.plugin = plugin;
        if (command != null) {
            command.setExecutor(this);
        }
    }

    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        if (args.length == 0) {
            if (sender instanceof Player player) {
                RelationRepository relationRepository = ShibaRing.getInstance().getRelationRepository();

                RelationShip relationShip = relationRepository.getRelationShip(RingType.FRIENDSHIP, player.getUniqueId());

                if (relationShip == null) {
                    player.sendMessage("§cYou have no friends");
                    return false;
                }
               ByteArrayDataOutput out = ByteStreams.newDataOutput();
                out.writeUTF("Subchannel");
                out.writeUTF("Argument");
                player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());

}
}
}
}
#

main :

 @Override
    protected void onRegister() {
        instance = this;
        relationRepository = new RelationRepositoryImpl();

        this.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", this);
        this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
        new FriendCommand(this);
        registerEventListener(new RelationListener());
        setupEconomy();
    }


    @Override
    protected void onUnregister() {
        this.getServer().getMessenger().unregisterIncomingPluginChannel(this, "BungeeCord", this);
        this.getServer().getMessenger().unregisterOutgoingPluginChannel(this, "BungeeCord");
    }

    private void setupEconomy() {
        if (getServer().getPluginManager().getPlugin("Vault") == null) {
            return;
        }

        RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
        if (rsp == null) {
            return;
        }
        economy = rsp.getProvider();
    }

    @Override
    public void onPluginMessageReceived(String channel, Player player, byte[] message) {
        if (!channel.equals("BungeeCord")) {
            return;
        }
        ByteArrayDataInput in = ByteStreams.newDataInput(message);

        System.out.println(in);
        String subchannel = in.readUTF();
        if (subchannel.equals("SomeSubChannel")) {
            // Use the code sample in the 'Response' sections below to read
            // the data.
        }
    }

but every log in pluginMessageReceived event not work

swift dagger
#

hey, im trying to use an angry wolf to be a mob on my mmorpg but the wolf stops attacking after 4 hits, is this a spigot bug?

blazing robin
#

how can I changed player server with plugin Message?

drowsy helm
swift dagger
#

no it's literally just a wolf with the angry flag set to true

#

it attacks for 4 hits then stops attacking

drowsy helm
#

oh strange

#

and you're setting the target right?

swift dagger
#

yeah

drowsy helm
#

yeah might be a bug, but I don't recall spigot overriding any default behaviour like that

#

you can always just occasionally set the target again

swift dagger
#

the wolf starts attacking again if the player moves

#

but it stops if you just stand still

drowsy helm
#

just tested and it works fine for me

#

what version

swift dagger
#

1.20.4

#

it seems to be all mobs

drowsy helm
#

might just be a 1.20.4 thing

#

it's not getting any more updates so you're better off moving to a newer version

swift dagger
#

is there even a stable version of anything beyond 20.4

frail willow
#

Is there a way to obtain the TabComplete of a specific command before the player inputs the command?

drowsy helm
lost sequoia
#

I may be lost, but for some reason intelliJ does not seem to think org.bukkit.Material exists and I cannot figure out why

#

has this been an issue others have ran into?

#

I see it in my dependencies and the decompiler can read it fine

agile anvil
#

Do you use maven or graddle?

lost sequoia
#

maven

#

I did try making a project with gradle and had the same problem

#

Used the minecraft plugin for intelliJ to generate the project and was working on it fine until I needed to use Material for something lol

wintry elk
#

did you make a mod or a plugin

lost sequoia
#

spigot plugin

wintry elk
#

are you sure its a plugin?

lost sequoia
#

pretty confident I tried remaking the project 3 times, I can double check once I finish reinstalling the IDE lol

agile anvil
#

Can you please show your pom.xml

#

And how do you build your plugin?

lost sequoia
#

its fine I fixed it lol, reinstalling IDE worked

#

I was using a pretty old version of intelliJ and I was like 80% sure it was an IDE problem

agile anvil
lost sequoia
#

ty

wintry elk
sterile breach
#

Hi what is a packet warpper?

worthy yarrow
#

It's something we use to make packet manipulation easier

#

It's an abstraction of the packet to give you methods in order to do such manipulation

agile anvil
#

Packets are the way softwares communicate over the network. A wrapper is basically something that put a ear and a mouth in the middle of the pipeline Client <-> Server.

Principle and usage is described by NuclearKat

sterile breach
#

What is the best api packet ? Packetevents? Protocollib? (Nms is not necessary for my case)

worthy yarrow
#

Both of those are the common ones unless you wanted to put the time into making your own lib

#

Better is rather just preference

agile anvil
#

Read the doc of both and select the one that feels the more logical for you

sterile breach
#

I have heard that packet event have a packet warrper, protocole l no

worthy yarrow
#

Packet events uses packet wrappers for your manipulations, haven't messed with plib before so I am not sure how you use their api

sterile breach
#

I will take Plib I think

blazing ocean
#

i find packetevent's api a lot more user friendly and a lot better designed than plib, but you do you

worthy yarrow
#

The wrappers do really help

blazing ocean
#

with PE you have actual classes for each packet, with plib you just set a type and write payload onto the buffer

agile anvil
worthy yarrow
#

Crazy how I'm getting netty lessons as well as an overview of his lib... from the man himself

agile anvil
worthy yarrow
blazing ocean
sterile breach
#

For my case I need to manage packet to change commands packet (commands list sended when a player join)

With that https://wiki.vg/Command_Data
I have already try with PLib but de need an array paf node and we should make a new structure node it seum complexe, with packetevent should I also make myslef structure ?

worthy yarrow
echo basalt
#

dyslexia much?

worthy yarrow
#

I accidently leaked the first bit of his book kek

echo basalt
#

anyways what ProtocolLib does is just create field wrappers for the nms classes

#

It's kinda like bukkit but for nms instead of aiming at a friendly developer interface

blazing ocean
echo basalt
#

So what you do.. is look at the nms packet class, look at its fields and find the protocollib wrapper

worthy yarrow
#

well that was first draft soooo no harm

echo basalt
#

Then create an instance of that wrapper (or create the nms fields and set handle)

worthy yarrow
#

Man I don't even know what to do with packets but I need practice

echo basalt
#

I'd start with fake entities

rare rover
#

what would the best way of creating a custom player nametag using a text display?

#

instead of teleporting it every tick

blazing ocean
#

set it as a passenger

worthy yarrow
echo basalt
#

My packet routine went a little like
Block cracking (no spigot wrapper) -> Fake entities -> Fake blocks -> Fake interactable blocks -> Hiding real entities -> making real collide with fake blocks

#

I did implement some misc features here and there

#

Like being able to click on a fake entity

#

Or moving fake entities somewhere

#

If you want to learn about nms you can also mess with entities and entity goals

#

and it's a fucking mkv

blazing ocean
#

ffmpeg my beloved

worthy yarrow
#

To be fair I just wanted to play around with packetevents before I have this next lesson

blazing ocean
#

ffmpeg -i video.mkv video.mp4 my beloved

worthy yarrow
echo basalt
#

Yeah

#

that isn't registered anywhere

#

o_o this is some atrocious stuff

worthy yarrow
#

That z is atrocious

echo basalt
rare rover
#

since i want it to be a bit higher

blazing ocean
#

translation on the transform

drowsy helm
echo basalt
drowsy helm
worthy yarrow
echo basalt
#

pretty sure I implemented it all in class

#

over the period of like 3 days

worthy yarrow
#

Oops sorry for the ping

drowsy helm
#

is it possible to get the skin signature and value from an online player or do I have to query the url again?

echo basalt
#

Sometimes the teachers would yell but they were all aware that I was pretty much self-employed and didn't give two shits

drowsy helm
#

oh its in property map i dumb nvm

worthy yarrow
#

The times I got yelled at were when I brought my own laptop and started working on it lol

twilit nexus
#

Would anyone be able to help me?
I am trying to set up a discord bot running through a spigot plugin and every time I load up the bot, I get the error:

[01:01:41 ERROR]: Error occurred while enabling Survival v1.0-SNAPSHOT (Is it up to date?)
java.lang.NoClassDefFoundError: net/dv8tion/jda/api/JDABuilder
        at Survival-1.0-SNAPSHOT-all.jar/lynxtrakker.survival.Survival.onEnable(Survival.java:54) ~[Survival-1.0-SNAPSHOT-all.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:288) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202) ~[purpur-1.21.jar:1.21-2250-797ce6b]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[purpur-1.21.jar:1.21-2250-797ce6b]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:520) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:643) ~[purpur-1.21.jar:1.21-2250-797ce6b]
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:592) ~[purpur-1.21.jar:1.21-2250-797ce6b]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:693) ~[purpur-1.21.jar:1.21-2250-797ce6b]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:455) ~[purpur-1.21.jar:1.21-2250-797ce6b]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:361) ~[purpur-1.21.jar:1.21-2250-797ce6b]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1171) ~[purpur-1.21.jar:1.21-2250-797ce6b]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:332) ~[purpur-1.21.jar:1.21-2250-797ce6b]
        at java.base/java.lang.Thread.run(Thread.java:1570) ~[?:?]
Caused by: java.lang.ClassNotFoundException: net.dv8tion.jda.api.JDABuilder
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:197) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:164) ~[paper-mojangapi-1.21-R0.1-SNAPSHOT.jar:?]
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
        ... 13 more
#

the main file that starts the discord bot up is:

public final class Survival extends JavaPlugin {

    private Database database;

    @Override
    public void onEnable() {
        // Plugin startup logic
        Plugin plugin = this;

        this.getConfig().options().copyDefaults(true); // Setting the config file to be correct
        this.saveDefaultConfig(); // Setting the config file as the default config file

        try {
            this.database = new Database();
            database.initializeDatabase();
        } catch (SQLException e) {
            System.out.println("URGENT: Unable to connect to database and create tables.");
            throw new RuntimeException(e);
        }

        getServer().getPluginManager().registerEvents(new databaseListeners(this), this);

        Objects.requireNonNull(this.getCommand("fly")).setExecutor(new fly());
        Objects.requireNonNull(this.getCommand("show")).setExecutor(new show());

        BukkitTask MySQLKeepAlive = new keepAlive(this).runTaskTimer(this, 20L, 12000L);

        String discordToken = getConfig().getString("Discord.Token");

        if (discordToken == null) {
            getServer().getPluginManager().disablePlugin(this);
            getLogger().severe("Discord token could not be found. Disabling plugin");
            return;
        }

        JDABuilder jda = JDABuilder.createDefault(discordToken);
        jda.enableIntents(
                GatewayIntent.GUILD_PRESENCES,
                GatewayIntent.MESSAGE_CONTENT
        ).enableCache(CacheFlag.ONLINE_STATUS);

    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
        this.database.closeConnection();

    }

    public static Survival getPlugin() {
        return Survival.getPlugin(Survival.class);
    }

    public Database getDatabase() {
        return database;
    }
}
twilit nexus
#

also idk if this helps but this is the build.gradle.kts file:

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
    id("com.github.johnrengelman.shadow") version "8.1.1"
    id 'java'
}

group = 'lynxtrakker'
version = '1.0-SNAPSHOT'

repositories {
    mavenCentral()
    maven {
        name = "sonatype"
        url = "https://oss.sonatype.org/content/groups/public/"
    }
    maven {
        name = "placeholderapi"
        url = "https://repo.extendedclip.com/content/repositories/placeholderapi"
    }
    maven {
        url = "https://repo.purpurmc.org/snapshots"
    }
}

dependencies {
    shadow localGroovy()
    shadow gradleApi()

    compileOnly "me.clip:placeholderapi:2.11.6"
    compileOnly "org.purpurmc.purpur:purpur-api:1.21-R0.1-SNAPSHOT"
    compileOnly("net.dv8tion:JDA:5.0.0")
    compileOnly("com.google.code.gson:gson:2.11.0")
    compileOnly("com.squareup.okhttp3:okhttp:4.12.0")
    compileOnly("com.fasterxml.jackson.core:jackson-databind:2.17.0")

}

def targetJavaVersion = 21
java {
    def javaVersion = JavaVersion.toVersion(targetJavaVersion)
    sourceCompatibility = javaVersion
    targetCompatibility = javaVersion
    if (JavaVersion.current() < javaVersion) {
        toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
    }
}

tasks.withType(JavaCompile).configureEach {
    options.encoding = 'UTF-8'

    if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
        options.release.set(targetJavaVersion)
    }
}

tasks.named('shadowJar', ShadowJar) {
    enableRelocation true
}

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

"Caused by: java.lang.ClassNotFoundException". You have the shadow plugin but you are not shadowing JDA into your plugin. Change "compileOnly" jda to "shadowJar"

drowsy helm
#

All of a sudden packet events isn't receiving my advancements open packet but it doesn on close

#

thmm

#

oh its an actual minecraft bug

twilit rivet
grim oak
#

Im making a plugin and im trying to work out how i can listen for votes, and then respond to the event. I tried to see if it was possible with the nuvotifier API but i dont think it is

agile anvil
wet breach
#

or you wanting to listen for votes within the server?

grim oak
#

within the server

#

maybe i need to use the api voting plugin the server uses?

cinder abyss
#

Hello, should I better use PDC to do a boolean check on a lot of blocks or use a list then save it to a file ?

#

(I want to implement custom blocks using mushroom blockstates, and I need to identify the custom blocks and the natural mushroom blocks)

umbral ridge
#

Hmm hmm

#

☕️🚬

#

I think yes

#

PDC would be better

#

you dont want too many IO operations

drowsy helm
#

does anyone have a good tutorial on how to use the Brain AI stuff for pathfinding?

umbral ridge
#

AI

#

😿

cinder abyss
umbral ridge
#

XD

drowsy helm
umbral ridge
#

mega thread damn

drowsy helm
#

supposedly brain is better than the old pathfinding system

umbral ridge
#

what are you working on 😂

drowsy helm
#

just a generic entity system

#

got pathfinding working, but the old system fucking sucks balls

umbral ridge
#

sounds complicated

#

too advanced for my brain

drowsy helm
#

same tbh

undone axleBOT
grim hound
grim hound
sullen marlin
#

Thats spigot not spigot-api

#

If you want NMS you need to run buildtools locally

icy beacon
#

yeah change spigot to spigot-api

#

if you want spigot (aka spigot-api + nms) you need to use buildtools to locally build it

cinder abyss
#

Hello, if I do a BlockPhysicsEvent when placing a mushroom block next to another mushroom block of the same type, which one will be BlockEvent#getBlock ?

cinder abyss
drowsy helm
#

Wait I might be wrong

cinder abyss
#

okay

drowsy helm
#

Just print it out n see

cinder abyss
#

pretty difficult on a BlockPhysicsEvent...

drowsy helm
#

How so

#

Just print the location and see which it is

cinder abyss
#

well

#

I've done that

#

but wait

#

it's a bit difficult 🤓

drowsy helm
#

Plugins should also note that where possible this event may only called for the "root" block of physics updates in order to limit event spam. Physics updates that cause other blocks to change their state may not result in an event for each of those blocks (usually adjacent).

#

So just base block

chrome beacon
#

What version is the server

drowsy helm
#

Just sounds like you havent run bt

chrome beacon
#

It's either not 1.20.6 or it's outdated

drowsy helm
#

You need to run bt to have the maven artifacts

chrome beacon
drowsy helm
chrome beacon
#

it's a runtime error

#

yes

drowsy helm
#

Yes

eternal night
#

yea

cinder abyss
#

what the hell is this return 💀

icy beacon
#

the first "block" is probably a typo

cinder abyss
#

I think

remote swallow
#

thats just javadoc

#

returns [what] [description]

eternal oxide
#

When you place a Block it has to be placed on/against another Block

cinder abyss
acoustic pendant
#

I'm trying to use adventure in spigot but this error is happening, can someone help me?

#
private BukkitAudiences adventure;

    public BukkitAudiences adventure() {
        if (this.adventure == null) {
            throw new IllegalStateException("Tried to access Adventure when the plugin was disabled!");
        }
        return this.adventure;
    }

    @Override
    public void onEnable() {
        // Plugin startup logic
        this.adventure = BukkitAudiences.create(this);
eternal oxide
#

you need to package adventure. it does not exist in spigot

acoustic pendant
eternal oxide
#

shade

acoustic pendant
#

oh

#

Let me search how to do it xd

eternal oxide
#

add it to the plugin.yml libraries section

#

keeps your jar smaller

acoustic pendant
eternal oxide
#

no, you need to add it correctly,

#

its a 3 element entry

clear igloo
#

hii does anyone know whats wrong with the args in my code? my commands only work when i add double arguments like /friend block block

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (command.getName().equalsIgnoreCase("friend")) {
            if (sender instanceof Player) {
                Player player = (Player) sender;
                UUID playerUUID = player.getUniqueId();

                if (args.length < 2) {
                    player.sendMessage(ChatColor.AQUA + "[Friends] " + "Please specify a player to block.");
                    return true;
                }

                String action = args[0];

                if (action.equalsIgnoreCase("block")) {
                    String playerToBlockName = args[1];
                    Player playerToBlock = Bukkit.getPlayer(playerToBlockName);

                    if (playerToBlock == null) {
                        player.sendMessage("Player does not exist or is not online.");
                    } else {
                        UUID playerToBlockUUID = playerToBlock.getUniqueId();
                        if (blockPlayer(player, playerToBlockUUID)) {
                            player.sendMessage(ChatColor.AQUA + "[Friends] " + "You have blocked friend requests from " + playerToBlockName + ".");
                            return true;
                        } else {
                            player.sendMessage(ChatColor.AQUA + "[Friends] " + "You have already blocked friend requests from " + playerToBlockName + ".");
                            return false;
                        }
                    }
                }
            }
        }
        return false;
    }```
acoustic pendant
eternal oxide
#

Using player#chat will cause the async event to trigger again. You are causing an infinite loop

#

cancel the message and send it yourself

#

Bukkit.getOnlinePlayers().forEach(

#

yes

acoustic pendant
chrome beacon
#

The library loader doesn't exist in 1.16.5

#

you need to shade adventure

acoustic pendant
#

oh, let me try

eternal oxide
#

or add your own loader for pre

acoustic pendant
#

or I'm just drunk xd

#

well, it worked

molten hearth
#

in java is the best practice to make a connection then close it after you're done with a statement or is it better to have a connection thats always open

#

chatgpt says java's best practice is to grab a connection and close it after use

drowsy helm
molten hearth
#

alr

young knoll
#

HikariCP ftw

molten hearth
#

i mean with hikari i still need to do ds.getConn

#

and i can still ds.close

#

so much extra effort

young knoll
#

I mean

#

Try with resources

slender elbow
#

^

#

you only call ds.close() onDisable really

#

the HikariDataSource is not a connection in itself; you use the connections as normal (in a try-with-resources, closing them when you're done using them)

ocean hollow
#

what's the best way to send a title when a player looks at a certain block?

#

I thought about sending it via PlayerMoveEvent, but the player needs to move to send it again.

young knoll
#

Probably a scheduler

drowsy helm
#

anyone know how to make the default pathfinding block jump not shit

alpine urchin
#

bababooe

#

@drowsy helm

drowsy helm
#

bababooe

quaint mantle
#

Quick question, how do I make .setTarget() ignore players?

iron night
#

Im trying to check whether or not player can go straight from loc A to loc B. Created BoundingBox with player's hitbox sizes, uses its rayTrace method. For some reason it been giving me hit position +-0.1 at loc A even though there was nothing even close to loc A. Went to read its code. Found out that it doesnt have any loop and doesnt call any methods that do. How is that even possible?

neat maple
#

Hi, can anyone tell me why these are no longer in the 1.21 api or what they are called now?

Enchantment.LOOT_BONUS_MOBS
Enchantment.DIG_SPEED
Enchantment.DURABILITY

iron night
remote swallow
iron night
#

thanks god

neat maple
remote swallow
#

looting efficiency and unbreaking

quaint mantle
neat maple
iron night
quaint mantle
#
 public static void targetSelect(Entity entity, Zombie target) {
        if (entity instanceof Zombie) {
            ((Creature) entity).setTarget(target);
        }
    }```
#

?

neat maple
remote swallow
#

iirc it should automatically handle if you use LOOT_BONUS_MOBS in an old plugin

icy beacon
iron night
remote swallow
iron night
icy beacon
#

and just do XEnchantment.LOOTING.getEnchant() iirc

iron night
icy beacon
remote swallow
#

no clue tbh

neat maple
#

i can't combine it like this, i need both in one plugin because i want to support 1.8 - 1.21

remote swallow
#

your api version should be 1.8 then

#

use Enchantment.LOOT_BONUS_MOBS with it

neat maple
#

i can't downgrade the api to 1.8 because i use some other things from 1.13 and 1.16 as well

remote swallow
#

so you cant support 1.8

#

if you use nms its an extra step that can be avoided by just not supporting that version

iron night
# iron night Im trying to check whether or not player can go straight from loc A to loc B. Cr...
World world = pos1.getWorld();
Location vertex1 = vertexes.get(i);
Location vertex2 = vertexes.get(j);

BoundingBox hitbox = BoundingBox.of(
        vertex1.clone().add(-0.2, -0.4, -0.2),
        vertex1.clone().add(0.2, 1.2, 0.2)
);
Vector dir = vertex2.clone().subtract(vertex1.clone()).toVector().normalize();
RayTraceResult result = hitbox.rayTrace(
        vertex1.clone().add(0, 0.5f, 0).toVector(),
        dir, vertex1.distance(vertex2)
);
if(result != null) continue;

the code in case somebody decides to help

neat maple
remote swallow
#

you should be able to its just very pointless

iron night
#

well, in that case its not very pointless

remote swallow
#

its pointless becuse you can just update and not have to do that

icy beacon
tardy delta
small hawk
#

Hi,

I want to confirm if my solution is correct.

I am creating a plugin for guilds, and I want players to have tags like [GUILD_SHORTCUT] NICKNAME, where GUILD_SHORTCUT is 4 or 5 characters long. For players in the same guild, the entire tag should be green. For players from different guilds or without a guild, the tag should be red.

I am already using Teams with the API to display ranks as prefixes in tags. My idea is to use packets to handle the guild-specific colors and tags without registering a team on the server.

Does this make sense? I don't think I can achieve this without using packets since players in the same guild can have different ranks, resulting in different teams and colors.

chrome beacon
#

You don't really need packets

#

Spigot allows for multiple scoreboards

neat maple
chrome beacon
#

You can include it in your plugin

neat maple
#

ok, nice thx

molten hearth
#

does Bukkit#getPlayer do lookups for player UUIDs if they've never played before

#

or does it just return null

chrome beacon
#

getPlayer cannot return a player that's never played before

#

Since the player has to be online for the method to work?

molten hearth
#

hm interesting

tardy delta
#

my memory was leaving me and olivo ninjad me

molten hearth
#

well getofflineplayer also didnt work

remote swallow
#

getOfflinePlayer will return a player if they joined or not

molten hearth
#

even though im quite sure you can obtain player skins/data like username off of the UUID

chrome beacon
#

You can

molten hearth
#

so i thought one of the two methods did such

#

is there another api feature for this-

chrome beacon
#

yes

#

1 sec let me get the javadocs

molten hearth
#

oh is it playerprofile or smth

#

alr

molten hearth
#

yeah rn ive got java PlayerProfile player = Bukkit.createProfile(community.getOwnerUuid()); and it returns null

#

good shit

#

does it not auto update

#

lol

#

no actually its just null

#

sigh

humble lynx
#

Is it for a head or for a skin that you're looking for?

molten hearth
#
        PlayerProfile player = Bukkit.createProfile(community.getOwnerUuid());
        player.update();

        System.out.println("name" + player.getName()); // null``` with UUID `d0f9a8dd-4050-416a-a5f5-3750269f92f6`
molten hearth
#

idk how ima even do that if setOwningPlayer is not gonna work on a playerprofile but i figured the first step would be to get a playerprofile

slender elbow
#

update returns a future with the new profile

remote swallow
#
public ItemBuilder skullTexture(String texture) {
    return modify(SkullMeta.class, meta -> {
        PlayerProfile profile = Bukkit.createPlayerProfile(UUID.nameUUIDFromBytes(texture.getBytes()));
        PlayerTextures textures = profile.getTextures();
        try {
            textures.setSkin(new URL(TEXTURE_URL + texture));
        } catch (MalformedURLException ignored) {
            return;
        }

        profile.setTextures(textures);
        ((SkullMeta) this.meta).setOwnerProfile(profile);
    });
molten hearth
#

of course it does

slender elbow
#

profile name/ids are effectively immutable

humble lynx
#

If I recall with one of my plugins, it uses the name of the player and not a uuid

molten hearth
#

oh wait

#

i didnt think shit like getSkin would be an url

#

interesting

#

so what smth like this? java PlayerProfile profile = Bukkit.createPlayerProfile(community.getOwnerUuid()); PlayerTextures textures = profile.getTextures(); try { textures.setSkin(new URL(textures.getSkin() + texture)); } catch (MalformedURLException ignored) { Bukkit.getLogger().severe("Failed to set texture"); }

humble lynx
molten hearth
#

oh

molten hearth
# humble lynx https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/SkullMeta.htm...

well earlier I had ```java
public static ItemStack getCommunityItem(PlayerCommunity community) {
ItemStack item = new ItemStack(Material.PLAYER_HEAD, 1);

    PlayerProfile player = Bukkit.createProfile(community.getOwnerUuid());

    System.out.println("name" + player.getName());

    SkullMeta skull = (SkullMeta) item.getItemMeta();
    skull.setDisplayName(community.getName());

    //skull.setOwningPlayer(player); <-- impossible?

    item.setItemMeta(skull);
    return item;
}```
#

but like everything about player was null so

humble lynx
#

I think I was just lazy and did offline player = Bukkit.getofflineplayer(name)

molten hearth
#

oh

#

but i dont have the player name

#

lol

#

so i need the profile for the name

humble lynx
#

What do you have then?

molten hearth
#

a uuid

humble lynx
#

How do you have a uuid but not a name?

remote swallow
#

Bukkit.getOfflinePlayer(uuid)

humble lynx
#

Try the same thing anyway

#

^

molten hearth
#

its from a database

humble lynx
#

I was only using the heads for the MHF skins

molten hearth
#

yeah well basically

#

didnt work 💀

#

1 sec

#

wait i think

#

i forgot to update my jar

#

rofl

#

java moment

remote swallow
#

🤣

humble lynx
#

Is the database players that have played on your server?

molten hearth
#
OfflinePlayer player = Bukkit.getOfflinePlayer(community.getOwnerUuid());
System.out.println("name" + player.getName()); //null```
#

😈

molten hearth
#

well technically yes however i have 1 uuid that has never played

humble lynx
#

I was thinking of a paper method anyway dw

elder dune
#

!past

molten hearth
#

i mean that would work too ill use any method 💀

merry cove
#

anyone know if its possible to get a resource pack image into a url from the resource pack? just want it for an embed in discord from my plugin.

#

so for example, if item has model data 1, I want that image in the url somehow >.<

tardy delta
#

an url from the resourcepack?

icy beacon
undone axleBOT
elder dune
#

Thanks my Discord was having a hissy fit

ashen ferry
#

Hi, Does anyone know how to set the NPC to have a nickname above their head as an icon and have the NPC walk around and not just have the icon? Please disc message. https://ibb.co/vQTKBNT

hybrid spoke
#

the only lookup being done is when entering the name

hybrid spoke
#

or am i understanding something wrong?

ashen ferry
humble lynx
#

Is the icon a display entity?

ashen ferry
hybrid spoke
humble lynx
#

Then make it a passenger for the npc

#

It shouldn't be that difficult

ashen ferry
humble lynx
#

Is this a plugin you're making?

ashen ferry
humble lynx
elder dune
#

So im having a weird issue.

So im making it so when player mines it puts it straight in their invin but when they mine a block with say
a torch on top it breaks the torch and dont drop it but when I add Nature break it drops it but wont put the blocks in
the players invin anymore. so Basicly breaks it.

any one got anyidea how to fix it so it drops the torch.

Code: https://paste.md-5.net/umunafocon.java

hybrid spoke
molten hearth
#

thanks guys i figured it out (im no longer supporting uuids of players that never played before)

hybrid spoke
#

ah nvm there isnt even a droplist cool

#

then you would have to check each blockface if there is anything on it

#

or you use the blockphysicsevent

drowsy helm
#

Fellers got a darn tootin' fancy hat

elder dune
midnight remnant
#

Hello, I'm trying to solve a problem I have, the falling block and get despawn after a while or become invisible, I'm trying to create a plugin that needs fallingsblocks and to test it I use spigot 1.16.5, anyone know why it is?

hybrid spoke
small hawk
torn shuttle
#

I'm not even disappointed, this seems about right

drowsy helm
torn shuttle
#

quick q is there a way for world generators to provide a custom biome string to other plugins via the spigot api? I know custom biomes just fall under CUSTOM in the api, just wondering if there's some kind of metadata that can be obtained somehow

young knoll
#

Sadly not via the api

#

They are all CUSTOM and have the key minecraft:custom

torn shuttle
#

yeah that's what I thought

#

cool iris' discord invite is dead

#

which are the biggest world generation plugins again

#

iris was one of them right

pseudo hazel
#

not sure I know what you mean, a world generates differently on any update with a change to terrain generation

#

if you have a server generating a world on a different version, the world will be different right?

slender elbow
#

also the chunk gen api did change a few years ago

pseudo hazel
#

1.16 was a few years ago so it could have been on the edge

#

i think 1.17 drastically changed overworld terrain gen iirc

#

or 1.18 not sure

ashen ferry
#

Please, how to change to username spigotMC? Because of discord, I have a different name, so I can't put a verify account on itemsadder LoneDevs.

chrome beacon
#

?changename

undone axleBOT
#

Name changes on the forums are granted to those who have donated to the project. Donations are processed manually and generally take up to 24 hours. The donation widget can be found on the home page of SpigotMC at: https://www.spigotmc.org/.

chrome beacon
#

10$

#

tbh there has to be a better way of verifying than just having the same discord name as spigot name??

#

You should ask them about that

limber owl
#

hello, how can I check if block is interactable?

#

Material #isInteractable() is deprecated

nova notch
#

shit you're telling me I gotta pay $10 to not be BananaRobot?

slender elbow
#

didn't it use to be $5? 💀

remote swallow
#

as long as ive been here its been 10

chrome beacon
#

Also read the deprecation note as to why it's been deprecated

slender elbow
#

.. reading?

#

huh

vague dawn
#

hey, i am coding in Intellij Idea and have multiple commandexecutors, but now when i want to create new one, it doesnt know what CommandExecutor is...? whats the problem?

#

here it knows it normal

hybrid spoke
vague dawn
#

yes

#

these two are in the same package

hybrid spoke
#

try to manually import it

eternal oxide
#

Intelij, clear caches

hybrid spoke
#

or invalidate caches

vague dawn
#

it is just like Thanos snap... it was okey the whole time, now when i want to create new command, i cant xd

hybrid spoke
#

yeah intellij can be trolling sometimes

vague dawn
#

same package

pseudo hazel
#

restart ide

hybrid spoke
hybrid spoke
pseudo hazel
#

and copy import from other file where it is working

vague dawn
vague dawn
hybrid spoke
vague dawn
#

xd just ignore it lol :d

hybrid spoke
vague dawn
#

yeah, the copy is working just fine

hybrid spoke
#

and to keep it working do this

#

tick all and restart

vague dawn
hybrid spoke
#

what build tool are you using

vague dawn
#

maven? if u mean this

hybrid spoke
#

yeah, then try to run mvn clean install -U

remote swallow
#

update intellij

vague dawn
vague dawn
hybrid spoke
#

you need to set it as an environment variable

#

but you can also create a new maven configuration and run it there

vague dawn
#

like it doesnt even know the CommandExecutor lol 😄

hybrid spoke
#

could be that your maven cache is fucked, so clean install and it should be working

remote swallow
#

check your intellij version, im guessing its outdated still

#

its most likely a java 21 class it cant recognize

vague dawn
pseudo hazel
#

commandexecutor aint java 21

remote swallow
#

spigot is

#

theres nothin 21 in it its just how its compiled

vague dawn
hybrid spoke
#

otherwise it wouldnt work in the other classes as well

remote swallow
#

it literally is an issue

#

its here every few days

hybrid spoke
#

looks like intellij got its periodt again to me

vague dawn
#

lol update doesnt work, is it possible then i push some keybuttons that run something?

pseudo hazel
#

the weird part is that it stopped working in only 1 place

remote swallow
pseudo hazel
#

just delete the file and remake it again

vague dawn
hybrid spoke
pseudo hazel
#

maybe try repair IDe

vague dawn
pseudo hazel
#

that was fast xD

#

or did you try before

vague dawn
#

no, now 😄

hybrid spoke
#

-U

eternal oxide
#

I doubt you have tried everything you have been told. You've not had time to reindex or anything

hybrid spoke
#

maybe he's on a NASA computer

vague dawn
hybrid spoke
#

clean install -U

vague dawn
#

oh, forgot the space

#

sorry, big U

warm mica
vague dawn
#

but it doesnt solve the problem

hybrid spoke
#

then you're fucked

#

try to delete your maven caches, invalidate caches of intellij again, otherwise try to checkout your workspace again in a different directory and last but not least, if nothing of that worked, reinstall intellij

vague dawn
#

i even try to create new project and still RIP

pseudo hazel
#

what api version

vague dawn
hybrid spoke
#

so even the java version he's using is fine

vague dawn
hybrid spoke
#

restart computer ¯_(ツ)_/¯

vague dawn
#

i will try it.. see u soon 😄

hybrid spoke
#

its probably something stupidly simple we just cant think of

vague dawn
#

haha, restart the computer doesnt help :d

#

and no, its not NASA Computer

hybrid spoke
#

1 min to restart and start intellij

#

def a NASA computer

vague dawn
#

😶‍🌫️

#

i do not want to reinstall intellij

pseudo hazel
#

can you show the imports for both a ile that works and that doesnt?

vague dawn
#

isnt problem with bukkit?

#

working in this picture

#

if i import it manually, it is working

#

the org.bukkit.command.CommandExecutor

cold sierra
#

has spigot 1.21 released yet

remote swallow
#

yes

pseudo hazel
#

yes like 2 weeks ago

#

the same day 1.21 got released

cold sierra
#

no like

remote swallow
#

almost a month

pseudo hazel
#

but there are still changes planned

cold sierra
#

release not unstable

remote swallow
#

month in 3 days

pseudo hazel
#

what isnt stable about it

cold sierra
#

like it would be considered latest on buildtools

remote swallow
#

its not set as latest yet

pseudo hazel
#

yeah thats cuz its missing some new api things

cold sierra
#

well if there are new builds pumping out then its not released

pseudo hazel
#

well

#

then you have your answer

remote swallow
#

there is always new builds pumping out

pseudo hazel
#

and also then nothing is ever released

remote swallow
#

even after its stable

cold sierra
#

oh

vague dawn
#

it only doesnt know CommandExecutor..

cold sierra
#

damn

#

ok then

pseudo hazel
cold sierra
#

where can I find buildtools latest

vague dawn
pseudo hazel
#

wdym buildtools latest

#

?buildtools

undone axleBOT
cold sierra
#

ok

#

thanks

vague dawn
#

okey, time to uninstall and install again

#

okey, reinstall helped

pseudo hazel
#

can someone help me with a good structure for my plugin? I am making menus but I am working on a custom resource pack, but I want this to be optional. I need some way to separate my menu logic from what it looks like (and from the inventory I am changing ig), like changing items etc if i have a textured version. would anyone have ideas as to how to structure that?

#

like right now my menu manager knows what kind of menus it should use, but for every menu that has a textured variant idk how to exactly do it without literally copy-pasting the code from the normal menu and changing a few things to make it work for the textured version, but this is very much undesired

clear elm
#

how can i upload a ressorce on spigot

pseudo hazel
quaint mantle
#

im inspecting the spigot source code (at least i think it is the correct repo) and i cant figure out how and where the events are emitted

#

im trying to figure out when and how the PlayerMoveEvent is instantiated but i cant

river oracle
#

Of CraftBukkit

hybrid spoke
#

you probably want to look at the craftbukkit source

river oracle
#

It's honestly much easier to run BuildTools then apply patches from work

#

Then you can just loonat the NMS

quaint mantle
#

im trying to recreate it in fabric but nobody on there knows how to do that

#

and i have experience with spigot and now for a fact that event exists and it works

hybrid spoke
#

i mean, an event system is nothing spigot related

#

if you want to implement one

quaint mantle
#

im not talking about an event system

#

i mean firing the event

#

i already made the event system

pseudo hazel
#

well do you mean how the events work in general or just when the player move event is fired in particular

quaint mantle
#

the player move event

#

ive made a lot of events but this one is giving me a headache

pseudo hazel
#

I think its on packets probably

#

but like idk

young knoll
#

Pretty much

quaint mantle
#

i found this lol

young knoll
#

With a bit of filtering

pseudo hazel
#

what is the issue you are running into

quaint mantle
#

i tried a few of them but i couldnt cancel the event

pseudo hazel
#

mixins sound like th true final boss of pain in java

quaint mantle
#

i dont dislike it tbh

#

but this event is giving me a headache fr

young knoll
#

What cursed thing are you trying to do

quaint mantle
#

so it feels a bit more bukkit-like

#

ive made a few so far

#

and the implementation looks very much like bukkit

lilac dagger
#

good job there

quaint mantle
#

thanks ^^

remote swallow
#

which part are you stuck on

#

is it actually calling the methods

quaint mantle
quaint mantle
#

also Entity#onMove

remote swallow
#

craftbukkit does math in PlayerConnection#tick

#

i think anyway

quaint mantle
#

it looks like it has a lot to do with vehicle motion

pliant topaz
#

When working with 1.21, is there really no way of having something else like locaizedname? Because, when the displayname changes, that would cause it to no longer be detected as that item right?

chrome beacon
#

Don't detect items by their name

#

Attach a PDC tag as an identifier

pliant topaz
#

true, thats a good idea

#

i was just reeeally wondering if we were forced to do it by displayname now

#

but i forgot about pdc

grim hound
#

how do I store API keys in my code?

brittle geyser
grim hound
#

how do I store my API keys so that they can't be reverse-engineered

grim hound
pseudo hazel
#

wdym

#

its called secret for a reason

grim hound
#

and the API key can be found somewhere

#

even if I encrypt it

pseudo hazel
#

I mean thats kind of everything in the world

acoustic pendant
#

Is it possible that with PersistentDataContainer I can store a custom object value?

grim hound
#

serialize that bitch

#

and store as string

acoustic pendant
#

oh, can do that

#

thanks

hazy parrot
grim hound
grim hound
hazy parrot
grim hound
pseudo hazel
#

such as?

grim hound
#

can't expect the user of my plugin to make an account on every single website

grim hound
pseudo hazel
#

well then you would need to make your own user login probably, and save api keys on a server somewhere

hazy parrot
pseudo hazel
#

or something

hazy parrot
#

There is also a way to use oauth2 if your provider support that

grim hound
hazy parrot
#

For example if your provider is Paypal, you would redirect then first time to Paypal login page and when they login save oauth token

fresh flax
#

Hi, i have found a bug in the spigot api, where do i report it?

hazy parrot
#

But imo the best way is to just let the user enter the API key

undone axleBOT
tardy delta
torn shuttle
vague dawn
#

lol? why the API doesnt change? yes, i have reload maven

chrome beacon
vague dawn
#

yeah, thx

fresh flax
molten hearth
#

https://blog.jeff-media.com/creating-custom-heads-in-spigot-1-18-1/

does anyone know why the same random UUID is reused?

Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...

eternal oxide
#

to save flooding the player cache

molten hearth
#

oh alright

#

because i converted my code to get a skull by the uuid so i wasnt sure if i should instead use that uuid or the random one

analog lantern
#

i need a spigot test server but i cant run spigot 1.16.5 because my java version is too high

#

any way to still run it?

chrome beacon
#

Get an older java version?

analog lantern
#

i need my current java version to run 1.21

eternal oxide
#

you can have multiple java versions installed. just use teh full path to javaw.exe

analog lantern
#

oh ok

eternal oxide
#

yep

river oracle
#
        override fun isFactoryResultant(item: ItemStack): Boolean {
            val meta = TileUtils.getMetaNoClone(item) ?: return false
            return meta.persistentDataContainer.has(KEY, PersistentDataType.BOOLEAN)
        }```
remote swallow
#

fuck yeah i love code with no context

river oracle
#

@young knoll like my getMetaNoClone method??

#
    private static final MethodHandle ITEM_META = ReflectionUtils.getFieldAsGetter(ItemStack.class, "meta");

    @Nullable
    public static ItemMeta getMetaNoClone(@NotNull final ItemStack stack) {
        return (ItemMeta) ReflectionUtils.safeInvoke(ITEM_META.bindTo(stack));
    }```
young knoll
#

Oof ow my reflection

river oracle
river oracle
vast raven
#

What could be the reason why a plugin can't call custom events

river oracle
#

you're going to need to give an actual error

vast raven
#

0

river oracle
#

plus you've given 0 code

vast raven
#

wait a sec

river oracle
#

if you're going to post either use paste

#

?paste

undone axleBOT
slender elbow
river oracle
slender elbow
#

just don't get an itemstack from an inventory

#

ez

river oracle
#

facts!

#

now you're onto something

young knoll
#

Now benchmark it!

river oracle
young knoll
#

Now benchmark it!

river oracle
#

that's a lotta work

#

idk how you'd even use JMH with minecraft

vast raven
#

Literally it's a plugin relation problem

#

Skidded class from other plugins, the problem is that the event dispatch isn't working or else a plugin can't listen somehow to this event

#

Either make no sense

river oracle
#

did you have a HandlerList

vast raven
river oracle
#

hey... perchance are you using paper

vast raven
#

I've tried many ways and I've started doubting of stupid things

vast raven
remote swallow
#

why is it cancellable but doesnt check if its cancelled

river oracle
#

I don't think its a spigot bug, custom events work fine for everyone else

#

If it was a spigot bug it would have been reported by now, especially with such a commonly used feature

vast raven
#

As I said it's a relation plugin problem

river oracle
#

i don't know what a relation plugin is so I can't tell you

vast raven
#

That's why I'm asking if there could be a reason why a custom event isn't fired

river oracle
#

the code that its called within is not running

vast raven
#

Nope, the prints are called

remote swallow
#

does the other plugin load after yours and subsribe to the event like a normal bukkit listener

vast raven
#

I'm firing my own plugin event

#

And that make no sense for several reasons

remote swallow
#

do you listen to the event in your own plugin

vast raven
#

No I did an addon

remote swallow
#

does the addon load after your plugin

vast raven
#

Of course

#

And even if the problem whas related on my plugin that fires event, what could be the problem

river oracle
#

is the command listener registered

#

does it have the @EventHandler annotation

vast raven
#

Yep

#

Event is registered too

#

No ideas

#

(The problem is the custom event plugin that somehow "can't fire events")

river oracle
#

The only case is if your listener is not registered

#

the internal code pretty much just runs a loop over all registered listeners

vast raven
river oracle
#

well I'm looking at the internals, and I don't know what to tell you

#

it seems to not be a spigot bug

vast raven
#

I did too

eternal oxide
#

custom events work fine

vast raven
#

I wasn't sure at that naggable check

#

But the dispatch part works

remote swallow
#

check your jars are updated, and check they load in the correct order

vast raven
#

I mean it should

vast raven
#

At least it's a positive thing

#

But at this point the solution should be ricreating the project and adding class by class

#

Since as I said, the problem is on my plugin that fires the event

eternal oxide
#

why do you have a lombok getter annotation on your event class?

river oracle
#

smart look

vast raven
#

I've removed that too doubting it

#

Imma send the original one

vast raven
#

but only for this specific plugin that creates the custom event

remote swallow
#

@eternal night @river oracle says he hates ur pdc api

wintry elk
analog lantern
#

i need to use NMS, how do i go about building a mojang mapped build of spigot NMS with build tools so i can toss that into my dependancies?

#

do i literally just click "Generate Remapped Jars" under options?

young knoll
#

Yes

#

?nms will help

rancid mauve
#

anyone have an issue with maven throwing "cannot access net.minecraft.core.component.DataComponents" even after following the nms pom file example?

kind hatch
rancid mauve
#

it works for the 1.18->1.20.4 but once the data components are involved it's like nah

drowsy helm
rancid mauve
#

lemme try the other one

drowsy helm
#

Use the spigot repo

drowsy helm
#

Yeah

rancid mauve
#

same result

#

I'll retry the build tools running again

wintry elk
rancid mauve
#

hmm yeah rerunning buildtools also gives same output

kind hatch
#

What's up with BuildTools?

kind hatch
#

Is this an error with BuildTools or with your project compilation?

rancid mauve
#

project compilation stated above

#

was rerunning buildtools to attempt to resolve it without luck

kind hatch
#

Then it's likely an issue with your pom.
Is the link you sent earlier still up to date?

rancid mauve
#

minus the fact I switched to the spigot repo as recommended, yes

kind hatch
#

What is this for?
I've never seen it before.

#

Also, concerning

rancid mauve
rancid mauve
#

since I had to move the spigot stuff into a different directory to keep it organized away from the main code that supports translations/components(i.e. paper)

kind hatch
#

Did you replace both repositories or just the codemc one?

rancid mauve
#

would be easier to not have to use NMS, but alas no way to set JSON text for signs in spigot

#

xD

kind hatch
#

Is this a valid packaging format? Or are you using some maven plugin that does this?

rancid mauve
#

the weird thing is, same setup for pre-data component NMS works fine

kind hatch
#

Can you paste your current pom?

rancid mauve
kind hatch
#

And, just to confirm, you ran BuildTools for 1.21 with the --remapped flag?

rancid mauve
#

correct

kind hatch
#
<repository>
  <id>spigot-repo</id>
  <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>

Repository needs to be spigot-repo not just spigot

drowsy helm
#

Which pose is using a telescope?

#

or is it an animation

rancid mauve
#

changed repo to spigot-repo and same issue

kind hatch
#

Can you provide more info around the error message?

#

Also, can you confirm that ~/.m2/repository/org/spigotmc/spigot/1.21-R0.1-SNAPSHOT exists?

rancid mauve
#

that's the error it gives, anything with NMS is "cannot access" when code inspection is fine with it

#

"cannot find symbol
symbol: variable DataComponents"

kind hatch
#

Maybe try removing the <optional> tag and see if it recognizes it then?

rancid mauve
#

hmm, removed and still same

kind hatch
#

What if you run the maven command again with -v?
There's gotta be more to the error than just that.

river oracle
#

sometimes the NMS errors occur if spigot is patching incorrectly

#

I don't think this is really a BT issue

rancid mauve
#

hmm alright

#

I'll just remove it for now, the paper stuff has translation component support which is good enough

#

only 107/1335 servers are not on paper anyways

exotic obsidian
#

hello

agile anvil
#

hello

final wharf
#

gradle jdk configuration invalid, its set to java 21?

agile anvil
#

In case everything is setup correctly try to delete those files:

.idea/gradle.xml
.idea/workspace.xml
final wharf
drowsy helm
drowsy helm
#

click gradle then

final wharf
drowsy helm
#

oh you want java config

#

itll be in project structure

agile anvil
#

Settings > Project Structure > Project

final wharf
#

its correct right?

#

i deleted those files

#

i cant build at all now

agile anvil
#

Is there an error ?

#

You have to resync gradle

final wharf
#

how?

agile anvil
#

Little sync button just above your mouse

final wharf
#

it just gives the same error

agile anvil
#

Can you show the build.gradle file?

final wharf
#

(where am i)

agile anvil
#

Did you create the project directly on IDEA ? Or did you import some existing project?

final wharf
#

on idea

#

its just that i made it almost from scratch

agile anvil
#

wdym?

#

Did you create a project and then added gradle?

final wharf
#

ussually its gradle groovy, but i have it gradle kotlin

agile anvil
#

That shouldn,t pose such issue

final wharf
#

yeah

#

i have a build of the plugin

#

thats working

#

but that error came out of nowhere

agile anvil
#

Unfortunately I cannot help you more in here, I'm not a big user of gradle :/

sterile breach
#

how work packets on server switch? For the client is just a world change? Handshake is initalized with the new server?

agile anvil
#

For the client it's a world change.
The client itself will not do another handshake.

However I don't really know what do the backend servers get once a player switch

sterile breach
#

Yes because on the new server playerjoin are called

#

Maybe when you enable bungeecord in seetings, the server don't wait handshake/serverconnection

agile anvil
#

Yeah maybe bungee transfer some internal data between the server

sterile breach
#

Yes maybe bungee initialize himself the hankdhake (but server can't send connection packet to proxy because it make it also sended to the client and generate an unknow packets I think)

agile anvil
#

Maybe the proxy keeps the first handshake packet of the player and send it to the switched server

#

That's why you need to turn the server offline