#help-development

1 messages · Page 1203 of 1

glossy laurel
#

Wait... 💀

mortal hare
#

i wonder if there's any fast way to construct static proxy classes in intellij

#

like have one private field of proxied object

#

and then it implements every method whic forwards the method by calling this.proxied.foo() to proxied object

#

something like:

public class FooProxy implements Foo {
  private final Foo foo;

  public FooProxy(Foo foo) {
    this.foo = foo;
  }

  @Override
  public void bar() {
    this.foo.bar();
  }
  
  @Override
  ...
}
slender elbow
#

alt insert, delegate

mortal hare
#

bruh

#

thanks

#

just what i needed

warm mica
#

Certainly. Mods already proof the significant potential if Mojang would care about optimization

mortal hare
#

I wouldnt trade chunk loads speeds for bugginess of bedrock edition

#

it should be called: Minecraft: Bugrock

#

Also marketplace

novel knoll
#

Hi guys, I wrote a Economy Plugin for Minecraft 1.21 with the dependency of vaultapi but did a huge mistake… yes, there is no VaultAPI on 1.21….. Im curious if there is another api like vault or do I need to write another plugin for it?

slender elbow
#

vault doesn't really depend on any specific Minecraft version

#

it will work everywhere

novel knoll
#

I get this problem on Pelican, that my server cant start my plugin, also the vault

slender elbow
#

vault doesn't do anything

#

so it will work

#

the issue is somewhere else

#

look at the logs for errors during startup or something

novel knoll
#

And I‘ve got 1 more problem with luckperms/ my db

#

Do you have Knowledge abt it? I cant paste pics here

slender elbow
#

you can use imgur

novel knoll
#

True

#

There is this problem

mortal hare
#

Vault is so mainstream that i believe it should be included in main software package of spigot or paper

#

80% of plugins requires or softdepends on it

novel knoll
#

vault problem fixed ! thanks, just got a bad version of it I guess

#

vault is working

#

but my plugin not

gilded granite
#

why is getItemInHand deprecated?

quaint mantle
#

Wait

novel knoll
#

for the vault api dependency in pom.xlm, I have vault 1.7.3, but I cant change it to 1.7.3 from 1.7

#

is the groupID right? its com.github.MilkBowl

#

and should the artifact id be Vaultapi or just Vault

mortal hare
#

that's just a guess

gilded granite
#

ok

novel knoll
#

<groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</artifactId>
<version>${api.version}.3</version>
source code of vault 1.7.3 says this, should I just copy it?

weary blade
#

Why you don't use just an vault api?

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>com.github.MilkBowl</groupId>
        <artifactId>VaultAPI</artifactId>
        <version>1.7</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
#

and yes, 1.7 is the latest version of vault api, which is compatible with vault 1.7.3 (latest vault plugin) which is compatible with all mc versions

novel knoll
#

okay, my plugin loaded but there are new issues

barren sapphire
#

Is it possible to control server-side which villager trades get autofilled when clicked in the GUI?

chrome beacon
#

hm? why would you want a different one than the player clicked

barren sapphire
#

Don't want a different one, I want to potentially cancel it

#

Let's say there's a trade that takes 4 diamonds, if those diamonds have different NBT they still fill into the trade

chrome beacon
barren sapphire
#

Yep that looks like it

#

Thanks

stiff violet
#

does anybody ever have problems with plugins using config.yml tht is in project file structure under resources instead of the dynamically generated one upon plugin startup on the server?

chrome beacon
#

No

stiff violet
#

my plugins doing this but still reads and uses the dynamically generated config file and works but im left with a consistent error in terminal window where i can see its still attempting to use the values in non dynamically gen config.yml

chrome beacon
#

Wait why are you mixing the two?

stiff violet
#

it doesnt generate the config file on startup if im not including it in /resources as well for some reason

chrome beacon
#

Are you telling it to save anywhere

#

if not that would be why it's not

stiff violet
#

im wondering if the logic in main plugin code is using that file as a template to generate it because ive not got the template for what i want it to generate as in my main plugin code

#

do uj think thats the issue?

chrome beacon
#

Could be? If I'm understanding you correctly

#

but don't mix the two

#

Have a dynamic or a static one

stiff violet
#

sorry english second language so makes it more difficult. this is in my static config.yml for example

supabase:
url: "https://your-supabase-url.supabase.co/rest/v1/" # Replace with your actual Supabase API URL
key: "your-supabase-api-key" # Replace with your Supabase API key
table: "tablename" # Replace with your Supabase table name

i think it is using this static config.yml file as a template for how it should generate the dynamic config file, as i dont have the template within my main plugin code

#

and without this it doesnt know what format to generate the config file as

chrome beacon
#

So you don't have a dynamic config?

#

tbh I don't really understand your issue

stiff violet
#

i do but its only generating when ive included config.yml and that template within my project file structure

#

then when the plugin runs

chrome beacon
#

You appear to be speculating about the issue instead of just describing what the issue actually is 🤷‍♂️

stiff violet
#

bro im trying to tell u in the best way i can

#

biting my tongue

chrome beacon
#

What do you want your code to do

#

and what does it do

stiff violet
#

its only generating the dynamic config.yml file when its template is present as a static config.yml included in the file structure under /resources before compiling the plugin.

the plugin runs fine, but i see errors in the terminal where it is trying to use the default values specified in the static config.yml file, not the dynamically generated one with actual values in (api endpoint, key + tablename). but it also does use this dynamically generated config file as it is writing data to the db table just fine

chrome beacon
#

What is your "dynamic" config

stiff violet
#

supabase:
url: "https://your-supabase-url.supabase.co/rest/v1/" # Replace with your actual Supabase API URL
key: "your-supabase-api-key" # Replace with your Supabase API key
table: "tablename" # Replace with your Supabase table name

but with the actual values (obv not gonna put them in here)

#

that is the contents of my static config.yml as i pasted it just now

#

the error i get in terminal shows its trying to reference the placeholder values from the static config file

[17:37:55 ERROR]: [VerifyWalletPlugin] Failed to monitor Supabase: No such host is known (your-supabase-url.supabase.co)
[17:37:57 ERROR]: [VerifyWalletPlugin] Failed to monitor Supabase: your-supabase-url.supabase.co

but its also referencing the true values i have added in the dynamically generated config.yml file as it is successfully writing the relevant data to the correct table

chrome beacon
#

So what is it

#

not the content of it

#

Might be easier if you just put the plugin on GitHub or smth

stiff violet
#

plan on doing that soon but yhh no worries thanks for help regardless ill try figure it out on my own

eternal oxide
#

The config resource in the jar is not accessed if you programatically create a config, OR save/load a config from file.

stiff violet
eternal oxide
#

No, the first time you call getConfig() is tries to read from file, then tries to read from resource if the file does not exist

#

So to programatically create your memory config if you first call getConfig() you are telling it to load the defaults

stiff violet
#

Ahh i see i think that helps me undertsand it a bit more ty, sorry im just very novice programmer using this as a project to help me learn more

eternal oxide
#

If you want a completely empty config you must create a new FileConfiguration (or subset) and fill it. you can't use teh getConfig() call in the API

mortal hare
#

?paste

undone axleBOT
mortal hare
#

rate my UniqueSubIterator which takes any Iterator and iterates only unique values

pseudo hazel
#

looks overcomplicated

rough drift
#

no need for the else

pseudo hazel
#

just keep a set of values you already got and call next until you are done or until you find an element that isnt there

pseudo hazel
#

wdym

#

slower than what

#

a map?

rough drift
#

checking and maintaining a set is slower than what they wrote

#

oh wait I didn't see the map

#

my bad chief

pseudo hazel
#

you need a way to keep track of items you already iterated and a fast way to access that

#

there would be no way around it

rough drift
#

hm yeah

pseudo hazel
#

so then this solution is overcomplicated imo

mortal hare
#

what about remove() method

#

i need to somehow inform that duplicate values should removed

#

if iterator already reached the first element

#

if i used the Set<> i would remove the values by default without calling remove() before next()

#

the main point of Boolean inside map is so that remove() can set its candidate map value to true so that any other duplicate values would get removed when iterating over

oblique tangle
#

I keep getting this damn error:

Unable to resolve table 'kingdoms'

can someone help me figure it out

blazing ocean
#

how about you share some code

oblique tangle
#

sure

#

this is the file the error is located in lmk if you need additional info

blazing ocean
#

well you need that table to exist

oblique tangle
#

i am using IntelIJ to setup my sql database

remote swallow
#

i dont see the table creation

blazing ocean
oblique tangle
#

I made it with the console it opened

code:

-- Create the database if it doesn't already exist
CREATE DATABASE IF NOT EXISTS kingdom_invites;

-- Use the database
USE kingdom_invites;

-- Create the kingdoms table if it doesn't already exist
CREATE TABLE IF NOT EXISTS kingdoms (
id INT AUTO_INCREMENT PRIMARY KEY, -- Auto-increment ID
name VARCHAR(255) NOT NULL, -- Name of the kingdom (required)
leader_uuid CHAR(36) NOT NULL, -- UUID of the leader (required)
description TEXT NULL, -- Optional kingdom description
banner_link VARCHAR(512) NULL, -- Optional banner URL
UNIQUE (leader_uuid) -- Ensure unique leader_uuid
);

-- Optional: Clear existing data before inserting sample data (only for testing/development)
TRUNCATE TABLE kingdoms;

-- Insert sample test data, avoiding duplicates
INSERT IGNORE INTO kingdoms (name, leader_uuid, description, banner_link)
VALUES
('Kingdom Alpha', '123e4567-e89b-12d3-a456-426614174000', 'A peaceful kingdom.', NULL),
('Kingdom Beta', '223e4567-e89b-12d3-a456-426614174001', 'A kingdom of warriors.', 'https://example.com/banner_beta.png');

-- Verify inserted data to ensure everything works properly
SELECT * FROM kingdoms;

slender elbow
blazing ocean
#

SHOW tables;

mortal hare
mortal hare
#

i cant use streams there

oblique tangle
slender elbow
#

idk what you mean by that but sure you can?

blazing ocean
oblique tangle
#

I think I am:

config.yml

database:
jdbcUrl: "jdbc:mysql://localhost:3306/kingdom_invites?allowPublicKeyRetrieval=true&useSSL=false"
username: "root"
password: "removed"

blazing ocean
mortal hare
blazing ocean
#

no idea why you'd be getting that error tho

oblique tangle
#

im using kotlin but I didn't convert it yet

mortal hare
#

so that i can do

for (Foo foo : bar.foo()) {

}
#

without duplicates

slender elbow
#

i don't see the problem

oblique tangle
mint wraith
#

Can I install a Multiverse Portals Plugin on Spigot 1.21.3? If yes, which one? I can't find it..

pseudo hazel
#

why do you need to remove antthing in your iterator

mortal hare
# slender elbow i don't see the problem

stream.filter() will work only for processed elements before. If i add something via add() method on veiw, iterator will have it on next(), meanwhile if i do filter() before adding something, Filtered stream will not include that element

pseudo hazel
#

you are just moving over items

slender elbow
#

i didn't say anything about filter?

#

Stream#distinct() is a thing

mortal hare
#

yes but the same thing applies

#

it will only work with the snapshot of the data

#

not the current data

slender elbow
#

streams work on iterators

#

they don't work on snapshots or copied data

pseudo hazel
#

I guess there is a decision to make for duplicate values

slender elbow
#

not that you should be mutating a collection while iterating it anyway, regardless of how you do it

pseudo hazel
#

say you have a filter on an iterator of your type, then you have to decide to remove all instances of the value or only the first one since after that the value is not unique

mortal hare
pseudo hazel
#

like I assume you wanna filter out all the values if there are duplicates, not just the one that happens to be first

slender elbow
#

never said you can't

#

it's just bad practice

#

not that you should

#

iterators are just as ephemeral as streams too

mortal hare
#

well streams are lazy in java. They only do operations when the values are being collected. So in any way you will capture the snapshot of the filtered data.

pseudo hazel
#

it will skip anything that would be filtered out

pseudo hazel
#

and the collection is probably the only thing that does any work

slender elbow
#

each element is individually evaluated at a time at every step in the iterator chain

mortal hare
#

yes but they do not copy the data

slender elbow
#

neither do streams

mortal hare
#

meanwhile streams collect the data

#

by copying it

pseudo hazel
#

nothing copies data, only collect it

#

yeah

slender elbow
#

streams do not copy any data

pseudo hazel
#

by moving through the chain for each element

slender elbow
#

i have no clue what you are talking about

mortal hare
#

you have to allocate a new list

#

or set

slender elbow
#

no?

#

wat

mortal hare
#

in order to collect from a stream

#

they're lazily evaluated

slender elbow
#

and how would you collect values from an iterator without a new collection 🤨

mortal hare
#

well that's the thing, you don't

#

i can just iterate them

slender elbow
#

you can also just iterate values in a stream

mortal hare
#

meanwhile in streams i have to collect it first

slender elbow
#

you don't have to collect them

#

no

#

my dude

#

streams are literally implemented as a chain of iterators

#

like, actually

rough ibex
slender elbow
#

you don't have to put them into a collection to operate on the elements or anything

mortal hare
#

if you decide to iterate them using forEach without collecting them you're essentially just evaluating them still, but internally

slender elbow
#

yeah?

#

and?

#

same thing with iterators?

#

if you do forEach you will evaluate them

#

streams are actually just iterators under the hood

mortal hare
#

i guess. Streams can also be used for this, but what I wanted is just a way to implement iterable for my view for nicer enhanced for syntax

#

Streams wouldn't allow me to do this, unless i dont know something

slender elbow
#

🤨

#

for (T t : s::iterator) { }

mortal hare
#

that's not a nicer syntax

slender elbow
#

you can just make your iterator method return the stream's iterator

#

Iterator<T> iterator() { return source.stream.distinct.iterator }

mortal hare
#

ok, you got me. I didn't knew earlier before that Stream api provides iterator() publicly

#

well that's lot of time wasted

#

implementing this

#

🥲

#

welp at least i learned something new

dry hazel
#

congrats emily you got them

slender elbow
#

Stream#distinct also makes for some fun optimisation, if you're using a sorted source like a treemap it does not use a set/map to know for distinctness

slender elbow
mortal hare
#

so i guess streams api in java can be thought of as a custom iterator builder in a sense

#

kind of

#

my iteration impl is something what you had to do pre java 8 like without any libs. I'm switching my custom iterators inside view classes for stream api ones. Thanks @slender elbow

slender elbow
#

sick

mortal hare
#

this will get rid of 5 custom iterators

#

😄

#

return this.data.values().stream().flatMap(map -> map.values().stream()).distinct().iterator(); returns distinct nested map values

#

i should probably cache the stream object somewhere as a private field so that i wouldnt have to construct stream object all over

#

i guess if i dont return stream object

#

i should be fine

#

since iterators cannot close streams, right

slender elbow
#

streams are single use, but so are iterators

worldly ingot
#

If you're doing something terminal, you can't reuse a stream

mortal hare
#

oh

worldly ingot
#

A terminal operation is basically anything that doesn't return the same stream

#

At that point it just cuts it off and says "No more operating on me >:("

#

So yeah, Stream#iterator() returns the contents of the stream as a new Iterator

mortal hare
#

but why don't we have reusable streams. At this point it would quite handy to store the state of the stream inside some kind of field

worldly ingot
#

That's just not what streams were designed for

#

You could use a collection for that

slender elbow
#

the source of the stream might be stateful

#

and backed by resources like files or something

#

any solution to "reuse streams" would involve rebuilding the entire pipeline anyway, but like, it's a handful of objects we're talking about here

ivory sleet
glad prawn
#
  v: 3700
  type: DIAMOND
  meta: !!org.bukkit.craftbukkit.v1_20_R3.inventory.CraftMetaItem
...```
I wonder if this global tag is serialized with an item or it was created by dumper
sullen marlin
#

Looks strange, there shouldn't be any CraftMetaItem if done from the API

glad prawn
#
        @Override
        public Object represent(AnnotatedType type, Object obj) throws Throwable {
            Method method = obj.getClass().getDeclaredMethod("serialize");
            return method.invoke(obj);
        }
    }```
I use the serialize method so I'm not sure what's causing it
sullen marlin
#

It's not that simple to serialise

#

You need to recursively serialise setializable types and also expand aliases

#

That looks like yaml so why not just use the yaml config API?

glad prawn
#

I'm using config annotation based so it looks quite weird

sullen marlin
#

That's the representer spigot uses (see RepresentConfigurationSerializable)

#

But you'll also need to implement recursive representation if your yaml API doesn't automatically

glad prawn
#

Ok thank you santa_5

faint meadow
#

Can someone tell me what I'm doing wrong?
I'm starting to create my first plugin, and when I try to import some classes like (import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.NamespacedKey;
import org.bukkit.Java.util.UUID
)I get an error, I try to change the libraries (in file pom.xml) from spigot-api to spigot server, but I get an error, I don't know what I should do

blazing ocean
#

you need to run buildtools

#

?bt

undone axleBOT
faint meadow
quaint mantle
#

when i deop myself i dont have access to warp command why is that wtf do i do idk man

faint meadow
#

I'm very new and have little knowledge. Can you explain a little more? Should I download it from the link and install it?

kind hatch
#

BuildTools is a necessity for developing spigot plugins.

Download it.
Run it for the version you are developing against.
Refresh/reload your project.

chrome beacon
#

Don't forget the remapped flag

faint meadow
faint meadow
buoyant viper
#

for testing... yes

faint meadow
#

nop, it´s same, i can´t import the classes

#

what happend

#

What are the dependencies and repositories that I need to import classes as (import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.NamespacedKey;
import org.bukkit.Java.util.UUID;)

chrome beacon
#

You don't need the full server dependency unless you're working with internals

#

Which you should avoid especially since you're a beginner

faint meadow
#

i need to creat a new project, or change some think in pom.xml, how i can update intellij? idk

buoyant viper
#

What

#

to make a new project in intellij u do it either from the project select menu by hiting new project

#

or if u have a project loaded, do File -> New Project

#

and as far as modifying ur POM.xml, intellij has a handy little button to refresh the project when it detects changes made

faint meadow
#

yeah, but still it doesn´t work

tardy iron
#

Hey I’m looking for someone as I have no developer for my new Minecraft server and I’m in desperate need of one.

inner mulch
#

?services

undone axleBOT
rough ibex
faint meadow
#

yeah, download from link, execute, after click on compile, (version 1.21.3)

#

In which directory or folder should I save it?

pseudo hazel
#

save what

faint meadow
#

buidtools before compile

pseudo hazel
#

doesnt matter

#

its just the exe or terminal version of buildtools, compile it in some folder

#

and then the resulting spigot.jar is the server

novel knoll
#

could someone help me with my plugin? I've got an issue with the connection with my mariadb

#

if possible pm

chrome beacon
#

Just ask here

novel knoll
#

its a bit longer thing

chrome beacon
#

You can make a thread if you want

#

Or if you plan on sending a massive message use paste

#

?paste

undone axleBOT
novel knoll
#

still, I would like to ask sb private, but thanks

#

but another question for here, how to fix this issue

#

?paste

undone axleBOT
novel knoll
eternal oxide
#

no maria driver, and paper

#

you didn;t package a driver

#

if you are not usign any mariadb specific funtionality just use teh standard packaged MySQL driver

novel knoll
#

I got the mariadb on my server, what do you mean by packaging a driver? where do I do it and how do I do it?

eternal oxide
#

you include it in your plugin when you build it

novel knoll
#

would it be possible, that you explain it to me like for an idiot? xD

#

Wait

eternal oxide
#

if you are compiling with maven you include it as a dependency in your pom

novel knoll
eternal oxide
#

or add it to your plugins libaries section of the plugin.yml

novel knoll
#

thats how my pom looks like

eternal oxide
#

are you running mvn package, or are you building with Artifacts in your IDE?

novel knoll
#

Artifacts

#

wanna see it?

eternal oxide
#

thats not maven then

#

your pom will be ignored

novel knoll
#

lol xD

#

good to know tho

eternal oxide
#

If InteliJ the maven tab is on teh right of yoru screen

#

under lifecycles double click package

novel knoll
#

do I use the original-plugin or just plugin name

eternal oxide
#

just plugin name

novel knoll
#

let me try

eternal oxide
#

shortest jar name

novel knoll
#

ahh its still not working

#

?paste

undone axleBOT
novel knoll
eternal oxide
#

same error. Check your jar does include the driver

#

rename jar to zip and browse through it

novel knoll
eternal oxide
#

look in the org folder

novel knoll
#

apache, checkerframework, mariadb and slf4j

eternal oxide
#

you may need to init it then in your code before using it

#

Class.forName("org.mariadb.jdbc.Driver");

novel knoll
#

in which file do I init it and where exactly

eternal oxide
#

in your code before you attempt any db access

#

just once during startup

novel knoll
#

so I think in databaseManager

#

private void initializeDatabase() {
try {
// Laden Sie hier Ihre Datenbankeinstellungen aus der Konfiguration
String url = "jdbc:mariadb://localhost:3307/kieremeconomy";
String user = "server";

#

before this one?

eternal oxide
#

yes, I guess. Too little code to tell

novel knoll
#

thats my code from beginning

eternal oxide
#

before the connection = DriverManager. code

novel knoll
#

after string password?

eternal oxide
#

yes

#

also, 3307? default for maria is 3306 I believe

novel knoll
#

got an error

#

I changed it to 3307

#

thats the error

eternal oxide
#

add to the enclosing try/catch

novel knoll
#

thats that

#

whats

#

**

eternal oxide
#

look at teh advice box Intelij is showing you

novel knoll
#

perfect, fixed

#

I was curious, if it wont destroy anything

eternal oxide
#

simplest fix is to change SQLException to Exception

novel knoll
#

let me try

#

throw new RuntimeException(e);

eternal oxide
#

no

novel knoll
#

I thing it did this

#

intellij did it

eternal oxide
#

just change teh catch clause

novel knoll
#

oh man im so dumb sorry but I dont understand how inflatable

eternal oxide
novel knoll
#

brooo tf now

#

its working

#

im so dumb sorry man

#

Let me try

#

there is a shaded version added now

#

but still use the shortest jar right?

eternal oxide
#

always shortest named jar

novel knoll
#

well there is a new problem

#

[01:48:14 ERROR]: [KieremEconomy] Fehler beim Verbinden zur Datenbank: Socket fail to connect to host:address=(host=localhost)(port=3307)(type=primary). Connection refused

#

you need the whole text?

#

or is it okay

eternal oxide
#

refused = wrong port/db/password

#

socket fail, so port is wrong

#

3306 is teh default port for maria. Unless you changed it

novel knoll
#

but hooow I've changed it on pelican

eternal oxide
#

the error seems to say its not on 3307

novel knoll
#

maybe it can help

#

2025-01-01 1:38:57 106 [Warning] Aborted connection 106 to db: 'minecraft' user: 'server' host: '172.18.0.1' (Got timeout reading communication packets)

#

thats what my db says

#

on pelican console

eternal oxide
#

ah

novel knoll
#

its important right?

#

but my db for this plugin is not minecraft

#

its kieremeconomy

eternal oxide
#

I'd fix the credentials then

novel knoll
#

is it hard for an idiot like me?

eternal oxide
#

in yoru connection string you are passing minecraft

novel knoll
#

the plugin or db?

eternal oxide
#

plugin

#

in the init code

novel knoll
#

is it the string user?

#

or where

eternal oxide
#

um your eco code says its using kieremeconomy

novel knoll
#

yes

eternal oxide
#

but your pelican log says it tried to connect to a db of minecraft?

novel knoll
#

ive got the database minecraft for backups I guess and kieremeconomy for this plugin

#

and I looked in my db

#

and there is my plugin

eternal oxide
#

then its workign. the pelican error is a backup error

novel knoll
#

opt

eternal oxide
#

however it was refused the connection

novel knoll
#

you have an idea what Can I do ?

eternal oxide
#

which is usually a user/password error

#

check that user has right to access the correct db

novel knoll
#

I think I added all permissions for this user today

#

in db

eternal oxide
#

user:kieremeconomy

#

and teh password is correct?

novel knoll
#

ahh should it be the user?

#

kieremeconomy

#

or server

eternal oxide
#

err user:server

novel knoll
#

how do I check it again

#

if its right

eternal oxide
#

no clue

novel knoll
#

i just copied the password from luckperms

eternal oxide
#

the password is on the user. but you also have to grant the user access to the db

novel knoll
#

SELECT User, Host FROM mysql.user;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'mysql -u root -p
mysql -u root -p
mysql -u root -p
mysql -u root -p
mysql -u ...' at line 1

eternal oxide
#

cant help with the SQL bit. Its been so long since I did any SQL syntax

novel knoll
#

alright

#

so the issue is because of the username and password?

#

in my plugin

eternal oxide
#

your driver is workign now though. You just have to get your db setup properly

novel knoll
#

I thank you a lot man, you helped me a lot

#

if someone has db knowledge, please let me know

inner mulch
novel knoll
#

I've asked perplexity

#

but it didnt help

drowsy helm
#

wait am i stupid or have chunks always had pdc?

young knoll
#

Not always

#

But they have for a while

#

I think it was like 1.16

chrome beacon
#

1.16.3 it looks like

fast jasper
#

hey does anyone know what servers like Hypixel might be modifying for their fireball explosions?
(also, I'm still quite new to Spigot so aplogies if I have any misunderstanding or ask about something silly by accident)

in a 1.8.8 server I'm trying to make throwable fireballs, that can be used for knocking off players or using them on your own player to perform a "fireball jump". similarly to what you'd see on Hypixel Bedwars and Minemen Fireball Fight

I've got the basic feature working, right clicking shoots a fireball, and it explodes on impact, but the physics seem off. with the vanilla fireball explosions I seem to not be able to perform the jumps and get the KB height I am looking for when shooting the ground.

does anyone know what changes most of these servers make to these fireball explosions? I'm unsure as to whether it's the explosion being changed itself, or the knockback, or if velocity is being set manually to the player during explosion damage events

inner mulch
barren trail
#

hypixel and minemen are both based off 1.7.10 iirc, perhaps it is just as simple as there (maybe) being a change in fireball explosions between 1.7 and 1.8

fast jasper
wet breach
#

just that is where they started as a basis

#

as long as you implement the protocol, you can essentially do whatever you want

marsh sluice
#

how can i change the recipe of crafts from a crafter?

#

im trying to make only 1 mace craftable and the crafting table works but the crafter keeps the mac recipe

pseudo hazel
#

like in the whole world?

#

or do you mean 1 mace per player

#

thats gonna be hard

#

as crafters can be automated

marsh sluice
marsh sluice
barren trail
#

couldn't you just remove the recipe entirely

marsh sluice
#

i just want to make it so the mace cant be crafted by the crafter

marsh sluice
#

unless i did it wrong

barren trail
#

with that?

#

like, once it's been crafted once, get rid of it

marsh sluice
#

ill give it a go

#

thanks

potent atlas
#

Can anyone tell me what external jar I need to import to be able to use CraftEntity? I have Spigot 1.21.4 API right now and it's not working. I also tried the shaded API as well as the server jar and the remapped one.

sullen marlin
#

?xy

undone axleBOT
sullen marlin
#

That class isn't api

#

You need spigot jar

potent atlas
#

k

#

nope, doesn't work

#

ok I'm just trying to make a custom entity

#

specifically want to ride and control it

#

using the spigot jar breaks everything

mortal vortex
#

Wanna show us what u got maybe?

#

Show your maven or gradle.

potent atlas
#

I don't know what those are

mortal vortex
#

Are you just like using Eclipse or whatever and specifying the jar file or something???

potent atlas
#

well I have eclipse and I clicked on add external jars and I put the API from build tools in...

mortal vortex
#

I dont know if this is your issue, but it would be better for the long run if you used a Build Tool

rough ibex
#

they mean to say a build system

potent atlas
#

nvm, I have no idea what I'm doing >_<

rough ibex
#

you will need to either use maven or gradle

#

and add dependencies in through that build system

potent atlas
#

it used to be easier XD

mortal vortex
#

Don't want to offend you or anyone else here, but maybe try using intelliJ, it makes using a build system easier 😭

potent atlas
#

I have that

mortal vortex
#

okay sooo use it

#

and install the plugin called "Minecraft Development" it will auto-do whatever Spigot u need

#

trust

#

its gud

#

its the bomb

#

its the shit

potent atlas
#

couldn't figure out intellij

rough ibex
#

you don't need the mcdev plugin

#

you really don't

#

intellij is not difficult to figure out

mortal vortex
rough ibex
#

i really recommend you use maven

#

because the configuration format (pom.xml) will likely be a lot easier for you to work with than the DSL that gradle uses

#

and it's also just XML

#

a format that has existed for 30 years

potent atlas
#

dang it I spent like an hour trying gradle

rough ibex
#

you're welcome to do that

#

you can use any build system

potent atlas
#

couldn't even get past "extends JavaPlugin"

mortal vortex
#

Thats not a part of gradle....?

#

you mean when a class extends a class?

rough ibex
#

I think they mean dependency resolution failed

#

JavaPlugin not in classpath

mortal vortex
#

ah gotchu

potent atlas
#

when you have the main class and it needs to say extends JavaPlugin so your plugin can have onenable and stuff but I can't get "JavaPlugin" to resolve

rough ibex
#

did you import it

potent atlas
#

yes I did

rough ibex
#

show gradle

potent atlas
#

oh that was when I was trying to use paper...

rough ibex
#

what do you have now

potent atlas
#

hang on let me change to spigot...

#

ok that's a lot of fireworks in a city that banned them -.-

rough ibex
#

always happens

potent atlas
#

so should I do maven?

#

which is easier

rough ibex
#

it's up to you.

graceful meadow
#

I'd say gradle is much easier

rough ibex
#

I'll fight you on that

#

but you are free to use any build system

#

if you already have gradle, use that

graceful meadow
#

Yeah if it doesn't work then show us, we'll figure it out

wet breach
# potent atlas which is easier

Maven is typically easier and there is plenty of documentation and guids/tutorials for just about anything in regards to it

potent atlas
#

can I stick with eclipse? XD

rough ibex
#

you can

potent atlas
#

change is hard

wet breach
potent atlas
#

oh look it's 2025 😄 Happy new year guys

potent atlas
#

ok. I think I just need the pom.xml

#

ugh I made it worse

rough ibex
#

pom is for maven

#

are you using maven or gradle

#

you cant use both

potent atlas
#

no idea

#

I have the spigot jar in referenced libraries

#

I'm just trying to figure out what else I need to do

rough ibex
#

you havent shown any code or configs

potent atlas
#

I don't have any yet because JavaPlugin won't resolve

#

someone probably already told me what to do. I suffer from memory loss

rough ibex
#

your gradle file?

potent atlas
#

isn't that not maven?

rough ibex
#

it is not maven

#

i'm asking for yours

potent atlas
#

I don't have one, still not sure what it is

rough ibex
#

okay what build system are you using

potent atlas
#

uhh

#

I wanna use maven

rough ibex
#

are you using eclipse or intellij

potent atlas
#

eclipse

quaint mantle
#

HEY GUYSSS! xd

potent atlas
#

hello

potent atlas
#

sounds a bit sinister lol

ebon topaz
#
ItemStack item = e.getPlayer().getInventory().getItemInMainHand();

how do i check if the itemstack they are holding is my custom itemstack?

#

do i just check if the item name is the same as my itemstack like this?

item.getItemMeta().getItemName().equals(HAMMER_ITEM.getItemMeta().getItemName())
ebon topaz
#

and how can i slow down the mining speed of a itemstack pickaxe with attributes in 1.21?

sonic goblet
#

Give your itemstack a custom persistent data holder and check if the item meta of that item has it

ebon topaz
#

what would a usual data value be for this sort of thing? a string? or?

young knoll
#

I use a string that is then used as a map lookup

sonic goblet
#

If it’s just something that you need to check for one specific behavior (an egg that hatches 2 chickens for example) I just use a Boolean, if it’s something that’s has a variable such as an egg that spawns x number of chickens I store that as an integer, depends on your use case

ebon topaz
#

its just a custom item "hammer" that i want to check if the hammer is being used when a block is broken

sonic goblet
#

Then I’d just store a Boolean on it and check if that pdc exists on the item

ebon topaz
#

what happens if i have another item with a boolean set then how would it tell the difference?

sonic goblet
#

You go by the identifier of the pdc, you’re not checking if the item has any Boolean you’re checking if the item has a pdc entry with your identifier

young knoll
#

This is where the string and map lookup comes in when you have a bunch of custom items

#

Rather than a bunch of if statements

ebon topaz
#

so this is what i had made

public ItemBuilder setPersistentData(String persistentData){
    NamespacedKey key = new NamespacedKey(getServer().getPluginManager().getPlugin("Hammer"), "plugin");
    meta.getPersistentDataContainer().set(key, PersistentDataType.STRING, persistentData);
    return this;
}
young knoll
#

You should name the key something other than plugin

#

Like item_type or custom_item

glad prawn
pseudo hazel
#

my items can get an optional compare_key string tag that I use for comparison of custom item types

ebon topaz
#
if (item.getItemMeta().getPersistentDataContainer().has(new NamespacedKey(getServer().getPluginManager().getPlugin("Hammer"), "custom_item"), PersistentDataType.STRING)) {
  // Code for hammer
}
``` so checking the item would look like this?
pseudo hazel
#

yeah pretty much

ebon topaz
#

so really the name space key is telling me if its the correct item or not and not the persistent data itself

young knoll
#

The data should be telling you ideally

ebon topaz
young knoll
#

Ideally you use the same key for every custom item

#

And then use the data to determine which item it is

ebon topaz
#

right but i still need to check if it has data first tho right? then check if the data is correct?

young knoll
#

Yes

ebon topaz
# young knoll Yes
if (item.getItemMeta().getPersistentDataContainer().has(new NamespacedKey(getServer().getPluginManager().getPlugin("Hammer"), "custom_item"))) {
  if (!Objects.equals(item.getItemMeta().getPersistentDataContainer().get(new NamespacedKey(getServer().getPluginManager().getPlugin("Hammer"), "custom_item"), PersistentDataType.STRING), "Hammer")) {
      return;
  }

  // Code for hammer
}

would this seem right?

young knoll
#

You can compact that, but yes that should work

ebon topaz
#

compact it by turning the namespace into a variable so its not used two times there?

young knoll
#

Yes

#

And removing the has check and just using get

#

Then checking for null

ebon topaz
#
NamespacedKey key = new NamespacedKey(getServer().getPluginManager().getPlugin("Hammer"), "custom_item");
                
if (item.getItemMeta().getPersistentDataContainer().get(key, PersistentDataType.STRING) != null) {}

so like that for the first if statement?

glad prawn
#

Assign it to a variable

#

Then check

ebon topaz
# glad prawn Then check
NamespacedKey key = new NamespacedKey(getServer().getPluginManager().getPlugin("Hammer"), "custom_item");
String data = item.getItemMeta().getPersistentDataContainer().get(key, PersistentDataType.STRING);

if (data != null) {}

you mean like this?

glad prawn
#

Yeah so you won't have to get it twice.

#

If it's just to verify it's a custom item then you don't need to do that just check it like before

ebon topaz
#
NamespacedKey key = new NamespacedKey(getServer().getPluginManager().getPlugin("Hammer"), "custom_item");
String data = item.getItemMeta().getPersistentDataContainer().get(key, PersistentDataType.STRING);

if (data != null) {
    if (!data.equals("Hammer")) {
        return;
    }

    // Hammer code
}
NamespacedKey key = new NamespacedKey(getServer().getPluginManager().getPlugin("Hammer"), "custom_item");
String data = item.getItemMeta().getPersistentDataContainer().get(key, PersistentDataType.STRING);

if (data != null) {
    // Hammer code
}

so your saying just do the second option instead?

pseudo hazel
#

I mean it depends on your goal

ebon topaz
#

i mean for at least this moment im just having a singular custom item

pseudo hazel
#

but do you wanna know if its that item or do you wanna know if its an item from your plugin

#

logic wise

ebon topaz
#

well would need to know if its that item because it does stuff that only that item should be able to do but there is also only that item in the plugin so either way would work fine from the sounds of it, but may as well make sure its that specific item and not just one from my plugin

pseudo hazel
#

yeah

#

that wya you dont have to look back when you add another item

ebon topaz
#

so am i correct in saying the namespace key would be useful for if i had tools and armor in my plugin then i could have a namespace for tools then one for armor? or am i just misinterpreting namespacekey?

pseudo hazel
#

well thats another way to use it

#

namespacekey is used to tell something apart, minecraft uses it for a bunch of things, like item types or advancements, so you can do it similarly, but for pdc the namespacekey is just the key of the item data you want to have

#

i.e. you can have a second key called item_type or whatever that could be tool, armor, or whatever

#

kind of a bad example but yeah

ebon topaz
#

makes sense

#

thank you for explaining it

graceful meadow
#

You can also do "Hammer".equals(data) and skip checking if data is not null

#

Because equals will return false anyway if data is null

ebon topaz
pseudo hazel
#

yes except that data.equals("Hammer") will throw nullpointer exception if data is null

graceful meadow
#

if ("Hammer".equals(data))

pseudo hazel
#

and "Hammer".equals(data) will not because "Hammer" is not null

remote swallow
#

id just null check and return

oblique tangle
#

Dependency error I cant seem to resolve :?

manic canopy
#

Hello, is anyone here good with models, using the mythicmobs, modelengine and oraxen plugins?

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!

manic canopy
#

i'm looking for someone because i can't send picture or smth here

blazing ocean
#

?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

viscid carbon
#

I like lightshot imo

#

havent used it in years tho because prntsc

glossy laurel
#

Guys, how can ItemStack's ItemMeta be null??

eternal night
#

air yields null

viscid carbon
#

did you assign the itemStack itemMeta?

true mural
#

so about this text description in spigot when submitting premium resources, can I put the text description in a spoiler that says text description and put image description about it?

glossy laurel
eternal night
#

no

quaint mantle
#

eyyy

#

@eternal oxide hi broo !! ^^

#

how r u?

eternal oxide
#

Hi

azure vault
#

how can i get the width of a textdisplay?

chrome beacon
#

You can't really

azure vault
#

oh

chrome beacon
#

Text size is font dependend

azure vault
#

ok so the issue im having is the following:

chrome beacon
#

and the font can be changed via resourcepacks and such

azure vault
#

looks bad

#

one solution i had in mind is to offset the text on the left by -width of a single digit

smoky anchor
#

One fun solution is to force a resourcepack, have that RP supply a specific font, use that font (requires papre or nms tho) for your numbers.
That means you know what font the player sees and you can be sure you know the width.

azure vault
#

meh

worldly ice
azure vault
#

damn

worldly ice
#

ye

azure vault
#

why didnt i think of that 😭

#

i will still have issues with the item on the right though

worldly ice
#

yeah that's the only problem i see with it

#

you could just add extra padding on the one on the right and keep it center aligned so the text doesn't overlap

cosmic elk
#

would anyone know of anyway I could make a custom smithing table recipe like I could with a normal crafting recipe without using prepare events?

azure vault
#

its 0.04 with my transformation

#

but ill use text alignment on the ones on the left

#

thanks!

worldly ice
cosmic elk
azure vault
worldly ice
#

code?

azure vault
# worldly ice code?
public static TextDisplay showText(String text, Vector translation, Direction direction, Location baseLoc, TextDisplay.TextAlignment alignment) {
    Location loc = baseLoc.clone().add(swapSign(swapXZ(translation, direction), direction));

    return loc.getWorld().spawn(loc, TextDisplay.class, display -> {
        display.setText(text);
        display.setSeeThrough(false);
        display.setBillboard(Display.Billboard.FIXED);
        display.setShadowed(false);
        display.setRotation((float) directionToAngle(direction), 0);
        display.setDefaultBackground(false);
        display.setAlignment(alignment);
        display.setTransformation(new Transformation(new Vector3f(), new AxisAngle4f(), new Vector3f(0.5f, 0.5f, 0.5f), new AxisAngle4f()));
    });
}
``````java
textLeftA = SpigotHover.showText(leftText, new Vector(-0.3625, 0.545, 0), direction, baseLoc, TextDisplay.TextAlignment.RIGHT);
worldly ice
#

might be a thing with the transformation?

#

as in the transformation might be causing the alignment to look centered

azure vault
#

hm

#

and not the kind of alignment we want

worldly ice
#

hmm that's annoying

#

i dont believe there is a way to do that then without being hacky

azure vault
#

ill just go with 0.04 then lol

#

seems to look okish

smoky anchor
#

(for you, as stated before, if someone has RP that changes font, it may be broken for them)

azure vault
#

thats a them issue

#

not a me issue

chrome beacon
#

Could just hardcode the widths of the default font then

smoky anchor
#

It will become a you issue the second someone reports a bug

azure vault
#

every digit is 6 pixels

cosmic elk
young knoll
#

Depends on the scale of your text

#

Idk what scale signs use

cosmic elk
sullen marlin
#

can you share your code?

#

if it's just addRecipe then its probably a bug

#

in which case

#

?jira

undone axleBOT
cosmic elk
#
        ItemStack result = dagger.returnDagger(5);

        RecipeChoice template = new RecipeChoice.MaterialChoice(Material.NETHERITE_UPGRADE_SMITHING_TEMPLATE);
        RecipeChoice addition = new RecipeChoice.MaterialChoice(Material.NETHERITE_INGOT);
        RecipeChoice base = new RecipeChoice.ExactChoice(dagger.returnDagger(4));

        NamespacedKey key = new NamespacedKey(DynastSMP.getPlugin(), "netheriteDagger");
        SmithingTransformRecipe daggerRecipe = new SmithingTransformRecipe(key, result, template, base, addition);

        Bukkit.addRecipe(daggerRecipe);
    }```
#

the 'dagger's are just custom swords

#

5 is netherite and 4 is diamond

#

it works just fine as long as the base item isnt diamond

#

if it is it'll just output what it normally would

smoky anchor
#

Your key is invalid
"Namespaces may only contain lowercase alphanumeric characters, periods, underscores, and hyphens."

cosmic elk
#

changing it to "netherite_dagger" didnt fix my issue

eternal oxide
cosmic elk
#

i believe so, the recipe works just fine as long as the base item isnt diamond

sullen marlin
#

Is diamond the only one that has a vanilla recipe too

cosmic elk
#

what do you mean?

sullen marlin
#

Is the issue w conflict with a vanilla recipe?

#

Isn't that what you were saying earlier

#

Or is nothing happening

cosmic elk
#

yeah im pretty sure its just conflicting with the vanilla recipe, it just outputs the same sword as before just now netherite

#

not the new item it is suppose to be

sullen marlin
#

I'd open a bug report

#

?jira

undone axleBOT
cosmic elk
#

will do 👍

#

anything i can do about this in the mean time though?

sullen marlin
#

Remove the vanilla recipe

#

Or fix the bug

cosmic elk
viscid carbon
chrome beacon
#

sus link

rough ibex
#

lol

viscid carbon
#

the real link is to sus

remote swallow
#

i trust lmgtfy/search more than gprivate/magic

viscid carbon
#

lmgtfy is too revealing tho...

rough drift
#

no

#

who even knows that

rough ibex
#

okay so what if its revealing

#

it gets the point across

cosmic elk
#

i was looking for docs

chrome beacon
#

so it shouldn't be too hard to find in the javadoc

cosmic elk
#

ill take another look

#

google doesnt give much info but the docs directly are really helpful 😭

chrome beacon
#

?

cosmic elk
#

just googling what im looking for doesnt show much but this does

#

i gotta start using it more :/

chrome beacon
#

?jd-s

undone axleBOT
chrome beacon
#

That link is Papers javadoc

#

not the Spigot one

cosmic elk
#

ohh i see, well thank you i almost missed that

flint bane
#

uhm

#

I'm trying to push an update for a plugin on a github repo via IntelliJ but whenever I commit and push the update it does not update the github repo

chrome beacon
#

Any error messages

flint bane
#

nope

#

I tried 12 times in a row

opaque scarab
#

I always forget if world#getBiome takes world coordinates or biome coordinates….

viscid carbon
median tusk
#

hi, i want the spigot 1.20.6 maven, how i get?

kind hatch
#

Run BuildTools

#

?bt

undone axleBOT
median tusk
#

thanks

potent atlas
#

Hi guys! Speaking of maven, I'm trying to set mine up for a project that needs spigot and craftbukkit together. I finally got spigot working but I don't know what to do for craftbukkit. I think I need the craftbukkit-1.21.4-R0.1-SNAPSHOT jar? I added that but I don't know how to add it in the pom.xml

kind hatch
#

You just need to depend on the spigot artifact instead of spigot-api

potent atlas
potent atlas
#

could I show my pom.xml?

#

I'm pretty sure the problem is in there

remote swallow
#

?paste it

undone axleBOT
potent atlas
fierce salmon
#

When I create an armor stand and then set it to invisible, there is a split second where the armor stand is still visible. How can I make it so the armor stand instantly becomes invisible as it is created?

torn shuttle
#
        LivingEntity livingEntity = (LivingEntity) spawnLocation.getWorld().spawn(spawnLocation,
                customBossesConfigFields.getEntityType().getEntityClass(),
                entity -> applyBossFeatures((LivingEntity) entity));

that's what i use, the generic would be

 LivingEntity livingEntity = (LivingEntity) spawnLocation.getWorld().spawn(spawnLocation,
                entityClass,
                entity -> myCoolMethodThatRunsBefore((LivingEntity) entity));

private void myCoolMethodThatRunsBefore(LivingEntity livingEntity){
...
}
#

or whatever

fierce salmon
#

okay thanks

#

how do I do another consumer for doing setMarker(true);

#

for the same object

torn shuttle
#

you just do everything you need to do in the one method

#

or have that method call other methods if you need to

fierce salmon
#

ohhhh ok

stark sedge
#

Hi, does anyone know how to use Spigot 1.8x?

fierce salmon
torn shuttle
potent atlas
#

Did anyone have time to look at my pom.xml? I've been experimenting with it and narrowed down the issue. The dependencies can't find their software in the repository. No idea what that means but maybe someone here does ^-^

#

While waiting I made sure I was using remapped jars

fierce salmon
sullen marlin
#

No

drowsy helm
potent atlas
#

my pom.xml is a mess and getting worse while I try to fix it XD

upper hazel
#

does the Player class use different logic objects like registry factory etc. inside it? Or is it a data class?

#

I'm making a plugin for statistics and I'm thinking about whether to stick to the Player example from the bukkit api or create a manager class?

kind hatch
#

Reload your Pom afterwards

potent atlas
pliant topaz
kind hatch
potent atlas
#

I am trying to add craftbukkit because it wasn't letting me with just spigot

glad prawn
#

it's not as simple as just changing spigot-api to spigot, it takes more steps than that

potent atlas
#

ok

#

well idk what to do then

glad prawn
#

?nms

potent atlas
#

I can't use that, it gives me an error at the "[...]" about... being well formed?

smoky anchor
#

That's meant to show "other stuff you put here"
You're not meant to copy that part...

potent atlas
#

removing it doesn't help either though

smoky anchor
#

well it ought to show a different error now then

potent atlas
#

yes it has a different error for each way

glad prawn
#

Have you run BuildTools guy

potent atlas
#

Yeah I got my spigot jar out of it

smoky anchor
#
  1. send your pom again
  2. did you run bt with the same command as in the article (obv. change version)
  3. send what errors it shows
potent atlas
smoky anchor
#

Is that your full pom ?

#

You're not meant to just copy and paste it from the article, you're meant to add those things to your existing pom.

potent atlas
#

yes but people keep linking me to that without telling me how to start 😛

#

buildtools is running

smoky anchor
#

Ig ppl usually assume you know what maven is and some basics
And that you would know to not mindlessly copy paste stuff without knowing what it is/does

potent atlas
#

the thing is I need to depend on spigot AND craftbukkit. is that even possible?

smoky anchor
#

You don't

#

spigot already includes craftbukkit

#

spigot-api does not

potent atlas
#

with just spigot(remapped, not api) I can't make a CraftEntity

smoky anchor
#

Sure you can (well I think at least)

potent atlas
#

nope I've tried everything but I can't get it to import

smoky anchor
#

So far your pom was not correct and you probably never built the correct dependencies either

potent atlas
#

probably not

smoky anchor
#

If you fixed all that, you should have access to all nms and craftbukkit

potent atlas
#

well buildtools finished. going from there let me set up a maven project

mortal vortex
#

@potent atlas still???

#

dude for the love of God use intelliJ

#

I'll even call you and show you, if u find it confusing

smoky anchor
#

-# what, what are they using

potent atlas
#

eclipse ;-;

smoky anchor
#

oh, that's not that bad

potent atlas
#

intellij doesn't show me the errors

smoky anchor
#

If someone is offering as much as to call with you to show you IntelliJ, I would accept.
It really is an upgrade.

potent atlas
#

if I can't get this to work I'll switch.

#

what's a... explicit coding set?

smoky anchor
#

imo you should attempt the switch anyways. there is a plugin for intellij that makes setting up any MC modding/plugin project very simple, just few clicks.

potent atlas
#

oh I don't have money for intellij

smoky anchor
#

There is Community Edition

#

scroll down if you're on the website, that one is free

potent atlas
#

well I have that but I figured it doesn't do the highlighting errors and stuff because it's not paid for

#

anyways eclipse says my plugin doesn't have an explicit coding set so as promised, over to intellij

smoky anchor
#

You have something incorrectly setup.

#

Well then, I guess feel free to message/call that other guy if you have problems, he'll surely be more help in this case.

potent atlas
#

I hate change but here we go

#

this is actually ok so far

potent atlas
#

mmk got set up finally... and got the same error eclipse gave me
Project 'Taxi' has no explicit encoding set

smoky anchor
#

StackOverflow is saying that

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Is missing from your pom

vocal cloud
#

intellij community has all the features the premium version does except features that are really only necessary for commerical products anyways.

eternal oxide
#

Eclipse Project encoding setting is an IDE warning not a Maven thing. There is a default setting, which if nto set, all projects will give this warning

#

Setting it in Maven can stop the error when you update the project. It just applies to the workspace

potent atlas
#

Still can't get the craftentity to import

#

Cannot resolve symbol

eternal oxide
#

CraftEntity is not API

#

?nms

smoky anchor
#

show your pom again...

potent atlas
#

I was told I could use CraftEntities with just spigot

eternal oxide
#

no

#

Nothign Craft is in the API

smoky anchor
#

just to clarify
it is included in spigot but not spigot-api ?

eternal oxide
#

correct

potent atlas
smoky anchor
smoky anchor
#

change the spigot-api to spigot
then go to the article again and copy the part starting with <plugin> and ending in </plugin>
paste it into the corret place, change versions
it should work then

#

Right
<classifier>remapped-mojang</classifier> <!-- Important! -->

eternal oxide
#

If he needs remapped, yes

#

if he ONLY wants craft he can just change the artifactId and run buildtools normally

#

anythign below that be needs remapped

smoky anchor
#

right, thank you for that info

potent atlas
#

I think I got it o:

smoky anchor
#

Congratz!
I do apologize for my incorrect help, I tried to get you to do more than you really had to.

potent atlas
#

No worries

#

I gtg now. I'll hopefully be able to test it tomorrow

heavy fulcrum
#

Hello! I'm trying to make a plugin which behaves somewhat like DiscordSRV. However, I'm stuck on the console integration part. Could someone please guide me in setting up the console logging in Discord?

eternal oxide
#

?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!

eternal oxide
#

ask specific questions so people have a better idea on whether they can help

sharp bough
#

would it be possible to find / replicate the logic behind scaffoldings falling? i.e. "will i fall at this location because im too far away from the base or im not connecting to any scaffold thats close enough to a base"

chrome beacon
#

Yes

sharp bough
#

yes im looking at that

#

but both get max distance and distance are returning 7

#

just quick testing

#

for the max distance i assume its hardcoded, but the distance one i dont fully get

heavy fulcrum
# undone axle If you have a question, please just ask it. Don't look for staff or topic expert...

Basically, I have a Handler class which essentially just sends any log message provided by JavaPlugin.getServer().getLogger() in the publish() method. I initialise all information needed by Discord in a separate Manager class and call functions from it in the plugin's Main class. However, inspite of correct initialisation, the console integration doesn't seem to work. Also, when I try to use /reload confirm on the server, the console integration briefly logs 2 messages and stops.

sharp bough
# sharp bough

ah nvm its stupid mc, i had to delay the getDistance..

eternal oxide
#

yeah, waiting for the update.

#

eventws often fire before changes are made

sharp bough
#

💀

zinc iris
#

just wanted to confirm this, servers dont have like a unique ID right or like some way to tell its unique besides obv IP

heavy fulcrum
smoky anchor
#

Don't call you Main class "Main"

#

?main

smoky anchor
#

You should not be using /reload, it is not supported

heavy fulcrum
#

I just used it randomly, and for some reason it worked briefly

sharp bough
heavy fulcrum
#

I can send them, sure..

#

ignore the first two messages... I had accidentally linked the chat channel to the console channel

sharp bough
#

so if you fully stop the server and start it, the message manager will still not work, until you restart the server, the plugin works briefly and then stops working again?

heavy fulcrum
#

No... when I use the command reload confirm in my server, it works for a brief period. Not an actual restart.

eternal oxide
#

With no code its hard to tell where your issue lays

sharp bough
#

right but what happens if you fully stop the server

sharp bough
eternal oxide
#

If it works from a normal startup but not in your reload its likely an object initialization issue

heavy fulcrum
#

The Bot instance is shut down correctly... nothing erroneous there

eternal oxide
#

ah I'll take a look

#

the plugin has no reload command

heavy fulcrum
#

I did get the chat linkage to work correctly, though. It's (hopefully) correct.

heavy fulcrum
eternal oxide
#

um, it seems you never call initJDA

heavy fulcrum
#

I do... in the main class

#

If I didn't, the bot shouldn't even be online, right?

zinc iris
#

where do you call the constructor for ConsoleDiscordHandler

eternal oxide
#

There is no call reference for initJDA in that Git repo

zinc iris
#

im just blind ik you do

heavy fulcrum
eternal oxide
#

ah I see it

#

line 13 of Main

heavy fulcrum
#

My main class is pretty short, so it shouldnt be a problem to look up

zinc iris
heavy fulcrum
#

The Manager class did get clogged up a bit, I guess

smoky anchor
#

initGuildChannels() is borderline unreadable for me, look up guard clauses (also called early return)

heavy fulcrum
#

Should i call initGuildChannels() inside of initJDA() instead?

sharp bough
#

why do you queue ie channel.sendMessage(msg).queue(); and are you not supposed to dequeue it

heavy fulcrum
#

Because I did do it, but to no avail

heavy fulcrum
smoky anchor
sharp bough
#

if only works on restart it could be flushing it out

heavy fulcrum
#

Possibly, yes... because the chat messages show up relatively slowly than any logs

zinc iris
#

add a error method for the queue and see if theres an error thats being thrown too

heavy fulcrum
#

I'm relatively new to using logging... could I get a bit more help here? I'm extremely sorry

sharp bough
#

it has a consumer, use it to see the response of the request

heavy fulcrum
#

Alright, hold on

zinc iris
#
,queue(
success -> {sout("Sent to discord")},
error -> {sout("error sending to discord");error.printStackTrace();}
)
#

smth like that

sharp bough
heavy fulcrum
#

I did use shutdownNow() earlier, but it only caused errors when stopping the server.

sharp bough
#

will remove any enqueued requests

#

what errors

heavy fulcrum
heavy fulcrum
sharp bough
#

yea, we got to that part, but why isint it able to complete

heavy fulcrum
#

lemme do it again and show you the error (if it still occurs)

zinc iris
heavy fulcrum
zinc iris
#

add an sout("Got console msg") at the top of the public method
lowk just doin debug stuff 💀

heavy fulcrum
sharp bough
#

idk

heavy fulcrum
sharp bough
heavy fulcrum
#

Alright.

sharp bough
#

send the error you get

heavy fulcrum
#

oh boy this will clog the chat

sharp bough
#

?paste

undone axleBOT
heavy fulcrum
zinc iris
heavy fulcrum
#

Yeah.

sharp bough
#

await shut down

heavy fulcrum
#

yeah, it did fix it

#

I'll make a separate method for the console initialization

zinc iris
#

add a logger line so sout("constructor loaded") or smth in the constructor for ConsoleDiscordHandler, if that works then its just due to the loggers level i think if it doesnt log then its due to the guildinit function

heavy fulcrum
#

Sure.

heavy fulcrum
#

So the handler does load up correctly.

zinc iris
#

so then its a level issue most likely

heavy fulcrum
#

alright... lemme setup some kind of level check

zinc iris
#

here