#help-development

1 messages · Page 1137 of 1

hybrid spoke
#

imma test this out

grim hound
#

What if I wanna support 1.8+?

chrome beacon
#

There are 3rd party libs that can do that for you

#

let me find one

hybrid spoke
#

useful, thanks!

grim hound
chrome beacon
grim hound
#

Ah okay

chrome beacon
grim hound
#

Will it download it each time tho?

chrome beacon
#

should be cached

#

iirc

#

can check

#

Yeah looks like it

proper cobalt
#

How do I get the entity that an entity is mounted onto

#

I have an Interaction as a passenger of an ItemDisplay and I want to check if the Interaction is mounted on the ItemDisplay

chrome beacon
proper cobalt
chrome beacon
#

hm

pure dagger
#

if i make permissions in 2 different plugins, but with the same name, for example name of the permission is "plugin.command.ban", is it treated as the same premission?

chrome beacon
#

Sounds like a bad idea

#

but probably

#

Try it and see ig

pure dagger
#

thats not an idea im just curious

#

imma test it anyway

#

so there should never be 2 plugins with the same name in plugin.yml right?

chrome beacon
#

Yeah

#

That results in a warning

hybrid spoke
#

?services

undone axleBOT
topaz marten
#

Oh thanks

#

MB GUYS

hybrid spoke
#

NO PROBLEM

river oracle
#

For some reason when I'm writing JSON back to a config file the gt and lt symbols < and > get encoded to unicode? \u003c and \u003e

#

I'm not really doing anything extrordinary to save?

           val content = saveContent(key)
            if (content.isJsonNull || (content.isJsonObject && content.asJsonObject.isEmpty)) {
                plugin.logger.warning("Unable to save empty ${serializable.key}.json is this intended?")
                return
            }

            val savePath = saveDirectory.resolve("${serializable.key}.json")
            savePath.writeText(jsonHelper.gson.toJson(content), Charsets.UTF_8)```
chrome beacon
#

Sounds like they're getting escaped

#

Try disableHtmlEscaping on your gson instance

river oracle
#

alright

#

oh that's probably it

#

the struggle of minimessage like

eternal night
river oracle
#

@chrome beacon that was it thank you much

#

🙏

chrome beacon
#

nice :)

slender elbow
#

gson 😡 🤬 💢

glossy laurel
#

people

#

how do I save itemstack to sql

#

and then retrieve the itemstack in question back from it

river oracle
#

get the bytes from NBT

#

make sure you use DFU when loading them!

glossy laurel
#

okay

#

now in english?

chrome beacon
#

You can use the bukkit object output stream

eternal night
#

(no)

river oracle
#

very naive

eternal night
#

some would even call it dumb

river oracle
chrome beacon
#

never used it myself 🤷‍♂️

river oracle
#

if only someone made a Byte serialization API that's sitting in PR right now

#

🙏

eternal night
#

iirc the PR is

-org.spigotmc.spigot-api
+io.papermc.paper
river oracle
#

those methods afaik are decently well implemented

#

ofc things get tricky and annoying with AIR but we'll just ignore that 👍

#

if you serialize AIR outside of containers anyways you're a monster

glossy laurel
#

I serialize air

#

😃

#

now what

#

null?

river oracle
#

uhm well NMS doesn't have null item stacks

river oracle
#

its all like empty

#

its the code to serialize item stacks to bytes

glossy laurel
river oracle
#

yes

#

that's how you serialize ItemStacks to bytes

glossy laurel
#

;-;

river oracle
#

you'll want to do extra steps though since you have a container

#

you can probably put stuff in a TagList

glossy laurel
#

what?!

river oracle
#

or you could use BukkitObjectOutputStream which is like like 3 or 4 times less storage efficent

#

probably more than that tbh

#

benefits no NMS

#

cons literally everything else

worldly ingot
#

Well, okay, (a) it's not NMS, it's OBC. (b) It's exposed (albeit unsafe) API, so you can access it through Bukkit.getUnsafe()

river oracle
#

that's a link to my PR

#

Bukkit exposes no such methods yet

worldly ingot
#

Oh, weird. Stash gives zero indication of that

#

Just a commit hash, but that could be on master for all I know lol

river oracle
#

yeah I'm surprised it only gives commit hash 🤷‍♂️

#

and doesn't even link to my fork

river oracle
#
        val size = configuration.loot.size() / 9 + 1
        return if (size - 1 % 9 == 0) size - 1 else size

Am I missing something why does intellij think size -1 will always be zero 👀

slender elbow
#

remainder takes precedence

river oracle
#

ah

slender elbow
#

ROYGBV or something

river oracle
#

I wasn't sure where remainder was in the operation priority

#

that makes sense tho

slender elbow
#

it's on the same level as division because it's basically the same operation

river oracle
#

makes sense 🤦‍♂️ its always the stupid stuff

robust jolt
#

Hi, i'm spawning this item bug I don't get the colors, anyone know how to fix? Thanks

cunning bane
#

Hey can someone maybe help me how to add custom fonts?

robust jolt
# hybrid spoke yes, `&` is not a natural colorcode

Ok, thanks. Another question. There is any way for detect when it's a crafting inv or the player inv? Because when i try to use InventoryClickEvent and do Economy.instance.getLogger().info(e.getInventory().getType().toString()); and click an item in my inv i get CRAFTING

hybrid spoke
cunning bane
#

i put the picture in resource pack

#

still doesn't work either

hybrid spoke
hybrid spoke
zenith bobcat
#

Hey I am searching for a way to change the Playername with nms in the version 1.20.6 but all recommended Packets doesn´t seem to work. Does anyone know how to tackle this problem?

restive mango
#

If a rogue process takes my SQL database connection, while I have it in auto-commit disabled mode and am in the process for executing statements, and it executes a statement, will the statements I had already executed by the time it executes the statement also be executed?

hybrid spoke
# restive mango If a rogue process takes my SQL database connection, while I have it in auto-com...

If you have your SQL database connection in auto-commit disabled mode and are executing statements, those statements will not be committed to the database until you explicitly call a COMMIT command. In this mode, any changes made by the statements you've executed are part of the current transaction, but they are not yet permanent.

Now, if a rogue process somehow gains access to the same connection and executes a statement, this introduces several potential issues:

Transaction Interference: If the rogue process executes a statement on the same connection, it could potentially interfere with your current transaction. This means the rogue process's statement might be executed in the context of your uncommitted transaction.

Impact on Your Statements: The statements you've already executed are still part of the same uncommitted transaction. If the rogue process's statement completes successfully, your previously executed statements are still in the transaction but will not be visible to others unless a COMMIT happens.

Commit or Rollback: If you subsequently issue a COMMIT, both your statements and the rogue process’s statement will be committed together. If you issue a ROLLBACK, both your and the rogue process's statements will be undone, as the transaction is treated as a whole.

In summary:

Your statements will not be immediately executed or visible to others until a COMMIT occurs.
The rogue process could interfere with the current transaction, and its statement will either be committed or rolled back with your uncommitted changes, depending on what happens with the transaction.
If the rogue process has executed statements before you commit or roll back, those changes will be tied to the fate of the transaction as a whole.

hazy parrot
hybrid spoke
#

oooo best model

restive mango
#

I mean I believe you

#

But you are truly of the omnissiah’s blessed

hybrid spoke
#

chatgpt a devs best friend

slender elbow
#

i love bullshit generator chatgpt

hybrid spoke
proper cobalt
#

guys im tryna create a gui with Inventory framework by stvanfschie
I just wanna add a bunch of items thats it, if theres more than the inventory can hold then page it

#

How can i do this

hybrid spoke
#

can you link the framework?

proper cobalt
hybrid spoke
#

just for the entire inventory

hybrid spoke
#

so that your GUI just persists of a really big PaginatedPane

restive mango
#

Will the rogue process’s statements become part of the uncommitted transaction

hybrid spoke
#

short answer: yes

#

long answer:
Yes, if the rogue process somehow gains access to your database connection while you're in the middle of an uncommitted transaction (with auto-commit disabled), its statements will become part of that same uncommitted transaction.

Here’s why:

Single Transaction Context: When auto-commit is disabled, every statement executed on the connection becomes part of a single transaction, until you explicitly commit or roll back that transaction. Since the rogue process is using the same connection, its statements are executed within the same transactional context.

No Isolation Between Statements on the Same Connection: SQL transactions work on the connection level. As long as the connection is active and the transaction is not committed or rolled back, any statements executed on that connection—whether by your process or the rogue process—will be added to the same uncommitted transaction.

Outcome Depends on COMMIT or ROLLBACK:

If you (or the rogue process) issue a COMMIT, all changes made by both your statements and the rogue process’s statements will be saved to the database.
If you (or the rogue process) issue a ROLLBACK, all changes made by both your statements and the rogue process’s statements will be undone.
Therefore, the rogue process’s statements will indeed become part of your uncommitted transaction, and their fate will be tied to whether the transaction is committed or rolled back.

proper cobalt
#

Why is x and y a parameter

#

What even is a pane

hybrid spoke
hybrid spoke
proper cobalt
#

How do I make the main like gui just the page with all the items

hybrid spoke
#

look up the wiki, there is everything explained

proper cobalt
#

ive been looking

hybrid spoke
#

you create a GUI, give it a PaginatedPane which covers the entire inventory, put your items in there

restive mango
hybrid spoke
proper cobalt
restive mango
#

Like if you have access to the connection object, wouldn’t any executed statement become part of the same set of changes regardless of whether the transaction is exclusive or not?

restive mango
#

Sry I’m on my phone

hybrid spoke
#

tf you mean you are on your phone

#

you are typing in lightning speed

restive mango
#

???

#

I type quickly idk

hybrid spoke
#

In database systems, exclusive transactions (or exclusive locks) are a mechanism to ensure that only one process can access or modify certain data within a transaction at a time. When a transaction is made exclusive, it effectively locks resources (like rows, tables, or even the entire database, depending on the isolation level and lock type) in a way that prevents other processes from accessing or modifying them until the transaction is completed (committed or rolled back).

restive mango
#

I would post a picture but can’t

#

No picture access

hybrid spoke
#

?verify

restive mango
#

🤬😣☹️😍😒😌🤩🤩😎🥰😒😍

hybrid spoke
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

hybrid spoke
#

ah

restive mango
#

See

hybrid spoke
#

then you can send pictures

restive mango
#

No

#

Those are emojis

#

In my phone

proper cobalt
hybrid spoke
#

and a populateWithItemStacks method

proper cobalt
#

bro theres only addPane and addPage

proper cobalt
#

populate thing is there so thx

#

yeah that worked thanks unc

slate siren
#

.

#

I wrote a simple little thing to get the player name color from the player prefix with Vault

#

But this is not possible when the player is offline.

#

For example, there is a list of players, the colors are drawn correctly when online, but this does not happen when offline.

opaque cove
#

Hi I have a question 😄 How can i get the Death Location and send it to the player who died?
My code so far

public class OnDeathListener implements Listener {
@EventHandler
public void onDeath(PlayerDeathEvent e) {
e.getPlayer().getLocation();
e.getPlayer().sendMessage("");
}
}

fallow violet
opaque cove
#

and how do i send it to the player then? 😄

fallow violet
#

with ```java
Location location = e.getLocation();
Player player = e.getPlayer();
player.sendMessage("X: " + location.getBlockX() + " Y: " + location.getBlockY() + " Z: " + location.getBlockZ());

opaque cove
#

it tells me that it cannot resolve Location and Player 😄

#

ahh now it should work

fallow violet
#

Location#getBlockX() just means the method from Location. In your case you have to use your variable with location.getBlockX()

opaque cove
#

What? It says Cannot resolve method 'getLocation' in 'PlayerDeathEvent'

fallow violet
#

Could you send your current code please?

opaque cove
#

public class OnDeathListener implements Listener {
@EventHandler
public void onDeath(PlayerDeathEvent e) {
Location location = e.getLocation();
Player player = e.getPlayer();
player.sendMessage("X: " + location.getBlockX() + " Y: " + location.getBlockY() + " Z: " + location.getBlockZ());
}
}

fallow violet
#

aah my bad

opaque cove
#

maybe e.getPLayer.getlocation

fallow violet
#

There is no PlayerDeathEvent#getLocation() but Player#getLocation() so write this instead please:

Player player = e.getPlayer();
Location location = player.getLocation();
opaque cove
#

Thank u ❤️

fallow violet
#

Your welcome

opaque cove
#

or Danke dir 😄

fallow violet
#

hahahaha

eternal skiff
#

How can i import craftplayer with different version in one plugin to make plugin compability with different versions and use craftplayer?

blazing ocean
#

Reflection or modules

opaque cove
#

how can i use this = with slash like 0 is not 1? Intellij doesnt accept this symbol

#

Like = but in reverse

young knoll
#

Not equal?

#

!=

opaque cove
#

Yep thanks xD ❤️

ancient plank
#

:)

pure dagger
#

i need to do a list of ranks, and every rank has list of players - in config, how do i do it? do i do list of lists or like this?

im new to using configs so i have no idea

opaque cove
#

is there a way to highlight the block through the world where a player dies to find his stuff easier? my code by far:

public class OnDeathListener implements Listener {
@EventHandler
public void onDeath(PlayerDeathEvent e) {
Player player = e.getPlayer();
Location location = player.getLocation();
player.sendMessage("X: " + location.getBlockX() + " Y: " + location.getBlockY() + " Z: " + location.getBlockZ());
}
}

pseudo hazel
#

I would not do a list of lists

#

assuming you have a set amount of ranks

pure dagger
#

umm.. and how do i get these indented ranks? (rank, rank2)

pure dagger
#

i dont

pseudo hazel
#

or well

#

you dont need it

blazing ocean
undone axleBOT
#

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

}

}```
Becomes:

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

    }
}```
pure dagger
#

what do i not need

pseudo hazel
#

you can just use getList("ranks.rank1")

pure dagger
#

i dont know all the ranks that are gonna be in "ranks"

pseudo hazel
#

as long as you know the names the ranks should be you can put it in there

#

well you can get all the keys under ranks

pure dagger
#

yeah thats the problem

#

yeah, how

opaque cove
pseudo hazel
#

getSection("ranks").getKeys(false)

pure dagger
#

whats false

pseudo hazel
#

deep

blazing ocean
pseudo hazel
#

if you want to go deeper when looking for keys

pure dagger
#

i guess

opaque cove
#

how can i put this code into this black box

pure dagger
opaque cove
#

´´´java hi´´´

pseudo hazel
#

backticks

blazing ocean
#

Need to be backticks

pseudo hazel
#

for me its the key below esc

opaque cove
#

how do i type those?

#

ah i got it xD

pure dagger
blazing ocean
#

On a german keyboard, next to Backspace

#

shift with that one

pure dagger
#

i mean new lines

#

add them

#

as i did

pseudo hazel
#

yeah that key is like somewhere else on every different keyboards

blazing ocean
opaque cove
#

okay so how do i get the death position highlighted? my code by far

public class OnDeathListener implements Listener {
    @EventHandler
    public void onDeath(PlayerDeathEvent e) {
        Player player = e.getPlayer();
        Location location = player.getLocation();
        player.sendMessage("X: " + location.getBlockX() + " Y: " + location.getBlockY() + " Z: " + location.getBlockZ());
    }
}
pseudo hazel
#

qwerty

blazing ocean
#

qwertz fte

opaque cove
#

qwertz

blazing ocean
#

ftw

chrome beacon
#

qwerty uwu

pseudo hazel
#

lmao

#

cant even type on your keyboard

chrome beacon
#

Also I have the § key easily accessible uwu

pseudo hazel
#

yeah I dont

#

thats the only thing I hate

pseudo hazel
#

but im not using legacy stuff anymore so it dont matter

blazing ocean
#

based

opaque cove
#

why doesnt it turn into these colors?

pure dagger
#

you probably didnt typed java

#

type*

pseudo hazel
#

they did

#

you blind

opaque cove
#

i typed it as u can see 😄

pure dagger
#

what?

#

oh haha

pseudo hazel
#

but you need to put the lang on the same line as the opening ticks

pure dagger
#

but you did it too low

pseudo hazel
#

and then hit enter

pure dagger
#

look at this

pseudo hazel
#

then it should color for you befor you hit send already

#

yeah you got it

pure dagger
#

bravo yayaayyay

pseudo hazel
#

discord magician

opaque cove
#

i got it now 😄 after java shouldnt be a space

pure dagger
#
public class OnDeathListener implements Listener {
    @EventHandler
    public void onDeath(PlayerDeathEvent e) {
        Player player = e.getPlayer();
        Location location = player.getLocation();
        player.sendMessage("X: " + location.getBlockX() + " Y: " + location.getBlockY() + " Z: " + location.getBlockZ());
    }
}
opaque cove
#

so can u help me? 😄 how can i get the death position highlighted?

pure dagger
#

what does highlighted mean?

opaque cove
#

like if u get hit by a spectral arrow veryone can see u through blocks

pure dagger
#

@pseudo hazel why not list of lists? (config file)

pure dagger
#

glowing

#

thats what u mean?

opaque cove
#

thats what i want to do with the block un which u died

pseudo hazel
#

well you can I guess

pure dagger
#

oh.. apply effect to a block ?

pseudo hazel
#

esp if you dont know the ranks you will have a list of lists might be nice

#

but the parsing is just a little bit more annoying

pure dagger
#

so.. which one would you choose

pseudo hazel
#

well idk what you are making

young knoll
#

Spawn a block display and make that glow

pseudo hazel
#

whats the purpose of this config

opaque cove
pure dagger
pseudo hazel
#

the goal is to make it as clear as possible for the one editing it later

pure dagger
#

no one is gonna be editing it later probably

pseudo hazel
#

then how do you get stuff in it

pure dagger
#

oh

#

you mean

#

okay nevermind

pseudo hazel
#

well

#

I mean you have this config to be .. configurable right?

pure dagger
#

i also have another question, how to store players in config becasue... um player nickname can change and uuid is not good for the one editing config

pure dagger
#

i understand what you ment now

pseudo hazel
#

so you should design starting with that in mind

pure dagger
#

yes

pseudo hazel
pure dagger
#

oh

pseudo hazel
#

for the sake of having correct data always, use uuid

pure dagger
#

i mean, i could use uuid

pseudo hazel
#

but for the sane, use player names

pure dagger
#

ill maybe ask

pseudo hazel
#

but this is usually the reason why plugins like this should have configs in game

pure dagger
#

the guy that wants the plugin

pseudo hazel
#

so you arent concerned with typing in the data manually

#

yeah

pseudo hazel
#

that could be good to

pure dagger
#

i could do that

#

i forgot

pseudo hazel
#

asking what their actual requirements are..

#

that should be before your first step

pure dagger
#

ill add a command

#

that will be the best solution

#

but yeah imma ask

opaque cove
#

Does someone know how to spawn a block display and make it glow? 🙂

pseudo hazel
#

esp when working for a specific client, just ask them as soon as you have to make a decision regarding usability (reasonably)

chrome beacon
opaque cove
#

I dont even know how to spawn a block display so i cannot set it to glowing...

chrome beacon
#

world#spawn

#
world.spawn(location, BlockDisplay.class, blockDisplay -> {
  blockDisplay.setGlowing(true);
});
#

smth like that

#

wrote by hand and off memory so 🤷‍♂️

opaque cove
#

world cannot be resolved...

chrome beacon
#

well yeah

#

you need to give it a world

#

Don't just blindly copy paste

pure dagger
#

because i can make a command for adding players, but it also should display players added

#

or something like that

opaque cove
#

i have to defy a new world for this entity or what? i dont understand anything xD

pseudo hazel
#

im not sure

#

I think offline player has ways to know the name

chrome beacon
pseudo hazel
#

but im not sure

#

yeah you need to implement the World class

#

and then add the entity to it

#

\s

opaque cove
#

just a very little bit but im trying to learn

#

and all these tutorials i found just type things but doesnt explain why

pure dagger
#

umm.. what? i do what?

chrome beacon
opaque cove
#
Player player = e.getPlayer();
        Location location = player.getLocation();
        player.sendMessage("X: " + location.getBlockX() + " Y: " + location.getBlockY() + " Z: " + location.getBlockZ());
chrome beacon
#

Start with Java first

#

?learnjava

undone axleBOT
#

For Beginners:

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

For Intermediate to Advanced Learners:

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

Practice and Hands-on Learning:

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

Free Resources and Documentation:

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

Community and Support:

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

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

opaque cove
#

and this is my code from before

pure dagger
#

oh.. you were not talking to me @pseudo hazel

pseudo hazel
pseudo hazel
#

or well kinda, I just use the name they joined last with

pure dagger
chrome beacon
#

Use the UUID

pseudo hazel
#

but I have a minigame plugin, so I only have that info for like a few hours at most from every player

pure dagger
#

but i need also the names

chrome beacon
#

Why?

pure dagger
#

just to display them

chrome beacon
#

the server does store the last name the player had

#

so you can use that

pure dagger
#

oh, where

#

how

chrome beacon
#

try OfflinePlayer#getName

#

unclear if the Spigot api uses the stored value or not

pure dagger
#

okay

#

thans

quaint mantle
#

yo, Player.isJumping() returns when just jumped and it's on mid-air?

chrome beacon
quaint mantle
#

oh

#

i'm using paper maybe that's why

chrome beacon
#

You should ask Paper

blazing ocean
#

Jumping is completely client side now

chrome beacon
#

wdym now

#

Always has been 🔫

quaint mantle
blazing ocean
quaint mantle
#

then how do i check if player is mid-air

pure dagger
#

there was a method

quaint mantle
#

which metod

chrome beacon
#

Check if the player isn't on ground and not in water

#

Do note the on ground flag is client controlled

quaint mantle
#

player.isOnGround can be bypassed with simple hacks

chrome beacon
#

yes that's what I said

#

you can manually check the players hitbox against the world if you want

quaint mantle
#

ive been using ((LivingEntity) player).isOnground()

chrome beacon
#

That's the exact same thing kekw

#

That cast is redundant

chrome beacon
quaint mantle
#

idk i was js askin if that works

warm musk
#

guys how can i broadcast message with adventure api?

#

?

keen charm
#

Hey there

#

How can I get the IP address in PendingConnection?

river oracle
#

cheers 🍷

warm musk
#

how can i broadcast message with adventure api?

quaint mantle
#

how can i get if PlayerToggleSneakEvent is sneaking and not standing

quaint mantle
warm musk
#

sorry

chrome beacon
quaint mantle
#

do i explain myself?

chrome beacon
#

use Javadocs please 🙏

quaint mantle
#

sorry i thought it was the same

#

that's not true

#

isSneaking makes true when not

river oracle
#

how would one go from Chunk coordinates and relative X and Z to a regular location would it just be

(chunkX << 4) + relativeX
(chunkZ << 4) + relativeZ
sullen marlin
#

Sounds about right

young knoll
wide vigil
#

PlaceholderAPI help:

Is it possible to display (%server_online_worldnamehere%) with two different multiverses?

Ex: 72 people are in (Creative Server 1), 53 people are in (Creative Server 2)

Is it possible to add those two numbers together into one text?

Example image of 72 + 53:

glad prawn
#

why don't you ask in their discord server

wide vigil
glad prawn
young knoll
#

There’s a math expansion

#

That can do, well, math

#

Not ideal tho

wide vigil
#

nvm some guy got me lol

#

in the papi dc

young knoll
#

Codeberg looks almost identical to GitHub

#

Just a bit more blue

wide vigil
warm musk
#

guys how can i convert legacy ampersand to minimessage

young knoll
#

Use the legacy serializer to convert it to a component

#

Then mini message to convert the component to a minimessage string

warm musk
#

i use adventure api for minimessage

chrome beacon
#

He just told you how

young knoll
#

Idk if the legacy serializer is part of the base adventure api

#

Might be another dependency

chrome beacon
#

yeah

#

but I'd still call it adventure

warm musk
#

Adventure api supports legacy ampersand

warm musk
#

Component component = LegacyComponentSerializer.legacyAmpersand().deserialize(str);
return MiniMessage.miniMessage().serialize(component);

Incompatible types. Found: 'java.lang.@org.jetbrains.annotations.NotNull String', required: 'net.kyori.adventure.text.Component'

young knoll
#

?ncpse

#

Nailed it

#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

warm musk
#

i solved

#

my fault

#
MiniMessage minimsg= MiniMessage.miniMessage();
return minimsg.deserialize(minimsg.serialize(component));
#

function wants Component type but i return String

#

then it gives error

slender elbow
#

that.. doesn't do anything

young knoll
#

It’s about sending a message

#

To the cpu? I guess

warm musk
#

😔

slender elbow
#

I'm sure it does work

warm musk
#
public Component translateColorCodes(String str) {
        Component component = LegacyComponentSerializer.legacyAmpersand().deserialize(str);
        MiniMessage minimsg= MiniMessage.miniMessage();


        return minimsg.deserialize(minimsg.serialize(component));



    }
#

it works but minimessage not formatting

#

just legacy

#

i dont have clue

slender elbow
#

you can't mix both legacy and mm

warm musk
slender elbow
#

you can't easily pull it off in three lines

warm musk
#

if you know

#

can you help me?

slender elbow
#

I don't

warm musk
#

a little bit

slender elbow
#

and honestly I don't care to support both at the same time lol

#

either one or the other

warm musk
#

i think if i can convert legacy ampersand to minimessage

#

i can achieve

slender elbow
#

the proper way to do that is to go through the serializers, but you can't have both formats in the same string

young knoll
#

Uhh

#

Hang on how tf did I handle it

remote swallow
#

private static final LegacyComponentSerializer SERIALIZER = LegacyComponentSerializer.builder().character('&')
        .hexCharacter('#').hexColors().useUnusualXRepeatedCharacterHexFormat().build();

public static String translate(String toTranslate) {
    return (ChatColor.translateAlternateColorCodes('&', SERIALIZER.serialize(MiniMessage.miniMessage().deserialize(toTranslate))));
}
chrome beacon
#

I'm not sure what happened to OysterMessage

#

It seems to have gone missing

slender elbow
remote swallow
#

smh

#

no legacy for them then

young knoll
#

I mean you could probably deserialize it back to a component

slender elbow
#

sure, still lossy

young knoll
#

Peak efficiency

#

Ur lossy!

slender elbow
#

true

worldly ingot
#

Tell her!

young knoll
#

Maybe if choco updated his PR

#

Oh wait he did, I can’t yell at him for that anymore

#

:/

warm musk
# slender elbow you can't mix both legacy and mm

whoever needs it can use it


public static final Pattern HEX_PATTERN = Pattern.compile("&#[a-fA-F0-9]{6}");
public String legacyToMiniMessage(char Char, String str) {
        Matcher matcher = HEX_PATTERN.matcher(str);
        str = str
                .replaceAll(Char + "0", "<black>")
                .replaceAll(Char + "1", "<dark_blue>")
                .replaceAll(Char + "2", "<dark_green>")
                .replaceAll(Char + "3", "<dark_aqua>")
                .replaceAll(Char + "4", "<dark_red>")
                .replaceAll(Char + "5", "<dark_purple>")
                .replaceAll(Char + "6", "<gold>")
                .replaceAll(Char + "7", "<gray>")
                .replaceAll(Char + "8", "<dark_gray>")
                .replaceAll(Char + "9", "<blue>")
                .replaceAll(Char + "a", "<green>")
                .replaceAll(Char + "b", "<aqua>")
                .replaceAll(Char + "c", "<red>")
                .replaceAll(Char + "d", "<light_purple>")
                .replaceAll(Char + "e", "<yellow>")
                .replaceAll(Char + "f", "<white>")
                .replaceAll(Char + "n", "<u>")
                .replaceAll(Char + "m", "<st>")
                .replaceAll(Char + "k", "<obf>")
                .replaceAll(Char + "o", "<i>")
                .replaceAll(Char + "l", "<b>")
                .replaceAll(Char + "r", "<r>")
                .replaceAll(HEX_PATTERN.toString(), "<#$1>");

        return str;
    }
slender elbow
#

that is not correct

warm musk
#

i use

#

it works perfect

slender elbow
#

and it's wrong

warm musk
#

why

#

maybe regex is wrong

#

i dont test regex

slender elbow
#

§o§4 is not the same as <whatever><red>

#

and §r doesn't act like <reset> either

warm musk
#

what do you recommend for this code

slender elbow
#

just don't support both, or support them separately but not together

warm musk
slender elbow
#

what about that?

#

it does not have the same effect in minimessage as it does in legacy formatting

slender elbow
#

correct, it does not

#

they behave differently

warm musk
slender elbow
#

idk why you're making this so hard and wrong for yourself

warm musk
#

so

#

&r like <white>

#

?

#

in minimessage

slender elbow
#

and <!italic> and <!bold> and .....

warm musk
#

what the hell

slender elbow
#

what

#

I'm telling you, they are completely different formats

#

you are making this difficult for no reason

#

just support one or the other but not both in the same string

warm musk
#

it does not have any way

#

i will put serializer select option to config.yml

sturdy sand
#

How do I upload my plugin to spigotmc?

warm musk
#

idk

sturdy sand
#

thanks

viscid carbon
#

x

young knoll
#

I agree

warm musk
#

guys how can i do multiple return types in java?

young knoll
#

Return an object that holds multiple things

#

Good spot for a record

sturdy sand
#

how edit the resource?

warm musk
#

i dont even upload resource to spigot

sturdy sand
#

a

#

ok thy

warm musk
#

your welcome

sturdy sand
#

how edit the resource?

#

or

#

How to change the file?

#

@vagrant stratus sorry

river oracle
#

Just upload and update

viscid carbon
#

Anyone know why?

worldly ingot
#

Strings are not mutable. Its mutating methods return a new string

#

You need to re-assign your s variable, so just s = s.replace(...) would work

viscid carbon
#

Alright, brain being stupid i guess because i knew that 🤷‍♂️ Thank you @worldly ingot

timid berry
#

im getting the error that plugin.yml is not found

#

do i just make it here

#

?

#

JAR will be empty - no content was marked for inclusion!

#

yikes my jar is empty

quaint mantle
keen charm
glossy laurel
#

How do I clear all arrows that are attatchsed to the player? Cuz seems like they arent entities

quaint mantle
#

realised, lol

timid berry
#

how do i properly compile this?

blazing ocean
#

Use the package task

mellow edge
#

Can I redistibute Connector/J or with maven called mysql-connector-java (same thing?) shaded in my plugin, or is it better to specify it as an external dependency somewhere in my plugins folder?
And are there any differences if I distribute my program payed/free?

tender shard
tender shard
gilded forge
#

Is there any way to play a sound for a player within a min volume?

#

the vanilla command "/playsound" provides an arguement called min volume, but method from spigot api doesn't

sullen marlin
wet breach
robust jolt
#

Hi, there is a way for prevent a custom item from being used in player's crafting inv?

molten hearth
#

has anyone here managed to get hotswapping to work with spigot?

#

im trying and i get hotswap errors lmao

chrome beacon
#

What are you trying to hotswap and what's the error

molten hearth
molten hearth
#

just trying to set up class hotswapping

chrome beacon
#

Never seen that error before

#

How did you setup hotswapping

#

also Paper

molten hearth
#

🤫

#

i dunno man i copied some mfs youtube vid

#

one sec

chrome beacon
#

I believe Paper userdev can do that

molten hearth
#

i basically made this config

#

then

#

okay well i basically did this lol

chrome beacon
#

I'm not sure how well paperclip handles that

chrome beacon
#

^^

molten hearth
#

most stable paper moment

chrome beacon
molten hearth
#

alright thanks ill give that a try

molten hearth
#

alright it works now thanks for the help

kind condor
#

Hi, I want to make a command that all the players can open a container which helps them share items, but I think if I just

Bukkit.createInventory(null, InventoryType.CHEST);

The inventory will disappear after the server reboot and lost every items in there, how can I prevent that?

chrome beacon
kind condor
#

How can I do that?

chrome beacon
#

The easiest way (not the best way) is just to save the items to a yaml file

acoustic pendant
#

Is there a way to change internally all items in the game?

Like mob drops, block drops etc but without changing the drop in the listener, maybe doing it when the server loads change all drops.

Have I explained myself? xd

chrome beacon
#

with the config api

chrome beacon
#

^^ a datapack with loot tables

acoustic pendant
chrome beacon
#

You can do it with nms

#

but it's easier to just make a datapack

kind condor
acoustic pendant
#

But do players will need to install the datapack when joining the server? I really don't know how they work

chrome beacon
undone axleBOT
chrome beacon
#

ItemStacks are already serializable

kind condor
#

it's server side

acoustic pendant
#

Oh

#

I'll look that then

#

Thanks

kind condor
#

I'm new to plugins lol
I use datapacks for the past 5 years

chrome beacon
#

That's good

#

Having a background with datapacks and commands does help a lot

hushed spindle
#

me have question
when you make a Merchant using Bukkit.createMerchant() and add MerchantRecipes to it you can also give the MerchantRecipe some details like how much exp it should reward the villager towards leveling up and how much discount its price should receive based on reputation, but it seems there's no way to actually assign this Merchant to a Villager

#

basically, the Merchant you create has no knowledge of a Villager, but i would still like for it to work with villager mechanics such as discounts or exp

fair rock
#

Some stuff i found out after researching:

Merchant is an interface (package somewhere in inventory)

You are currently using:

Merchant merchant = Bukkit.createMerchant("Inventory title");

If you want to work with Villager:

Villager villager = player.getWorld().spawn(player.getLocation(), Villager.class);
Merchant merchant = (Merchant) villager; // isnt neccessary just showing thats the same Merchant

Villager extends from AbstractVillager, that implements Merchant

chrome beacon
#

Do note if you want to modify that villager do so inside the spawn method consumer

fair rock
#

Thats only a information i found out after looking at Villager class, i dont know if thats works good or is the best option

chrome beacon
#

Discounts and such work on rep which does require an actual villager

#

and it looks like the api wants a villager for the xp to work as well

hushed spindle
#

i want to make a non intrusive custom trade plugin that basically overrides the normal villager interface with a custom one, so that if people want to remove the plugin it will not leave any messed up villagers behind

#

and it would give me more control over what the player can see and trade, like personalized additional trades based on renown or reputation

kind condor
#

and I found

try (ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
     BukkitObjectOutputStream objectStream = new BukkitObjectOutputStream(byteStream);
     FileWriter writer = new FileWriter(fileName)) {
    objectStream.writeInt(inventory.getSize());
    objectStream.writeObject(inventory.getName());
    for (ItemStack item : inventory)
        objectStream.writeObject(item);
    writer.write(Base64.getEncoder().encodeToString(byteStream.toByteArray()));
}

on internet

#

but too bad inventory.getName() doesn't exist anymore

mellow edge
#

Just wanted to ask this because it is licensed under GPL license.

fair rock
kind condor
#

alright, but I still want to know how to get the title of an inventory in case I need it one day

slender elbow
#

inventories don't have a title

#

opened menus/InventoryViews have a title

#

just save the title you use to create the inventory with in some other variable

remote swallow
#

you shouldnt be using the title to determin if its yours so you shouldnt ever need to know the title

slender elbow
#

well that isn't what they're doing

#

they are saving the inventory, title included

remote swallow
#

why not just save the contents then

#

the inventory holds basically no data that you cant get from just the items other than inv name which you probably should know without having to save the inventory

acoustic pendant
#

Hey, could someone send me a link of Ageable blocks? i'm searching which are part of this Interface but can't find

fair rock
acoustic pendant
remote swallow
#

all of these

acoustic pendant
#

Isn't wheat also ageable for example?

#

I saw that but crops like carrots wheat etc doesn't appear there

fair rock
remote swallow
slender elbow
#

Ageable is just.. enough

acoustic pendant
#

Yeah, but I was looking the blocks that were ageable and couldn't find them in the javadocs

#

I just want to be sure

#

Maybe in minecraft wiki? let me search

#

Nope

slender elbow
#

the wiki is very useful

acoustic pendant
#

thanks

robust jolt
#

Hi, I have a problem. I'd created a new inventory and I want to remove the option to close the inventory clicking the ESC Button.

    @EventHandler
    public void onInventoryClose(InventoryCloseEvent e)
    {
        if (!e.getView().getTitle().equals(ChatColor.RED + "Bank Menu"))
            return;

        Player player = (Player) e.getPlayer();
        if (player == null)
            return;

        if (exitPlayers.contains(player)) {
            exitPlayers.remove(player);
            return;
        }

        Economy.instance.getLogger().info("CALLED");
        new BankMenu(player);
    }

This is the code, but i get a stack overflow and my CALLED log is spaming

slender elbow
#

delay by one tick

robust jolt
#

Ok, in java how can I delay?

slender elbow
#

?scheduling

undone axleBOT
river oracle
# robust jolt Hi, I have a problem. I'd created a new inventory and I want to remove the optio...

Couple things I see here alreadyt

  1. Do NOT compare views using the title please instead reference the ideas of https://www.spigotmc.org/threads/a-modern-approach-to-inventory-guis.594005/
  2. The InventoryCloseEvent player can never be null (Ensure you check for instanceof Player instead of a blind cast, this could cause issues down the road
  3. You don't need to track with (exitPlayers) if you follow #1
  4. Menus need to be re-opened after 1 tick and not immediately after see https://www.spigotmc.org/wiki/scheduler-programming/
robust jolt
#

Ok, thanks

inner mulch
#

im trying to check whether an object is a primitve wrapper or not, im iterating over all base wrapper classes (that i put in a set) and check if my class is assignable from them.

Would it be smarter to recursively check for the superclass of an object until its a base wrapper class of the set?

#

I'm not sure what's smarter, iterating over all of them and checking for isAssingableFrom seems quite inefficient, altough the other method would be bad with lots of superclasses

eternal night
#

Primitives from Google commons has checks for this

inner mulch
#

do i need to add that library?

#

or is it in java?

eternal night
#

Spigot ships it

inner mulch
#

what do i need to type?

slender elbow
slender elbow
#

that is not a primitive

#

and it can represent numbers that can't be represented by primitives

inner mulch
#

hmm

slender elbow
#

like 10000000000000000000000000000000000

eternal night
#

What about -10000000000000000000000000000000000

remote swallow
#

thats a small big int

eternal night
#

Makes sense

worldly ingot
#

BigInt can also be 69 if you want

worldly ingot
#

That class actually encompasses BigDecimal, BigInteger, the primitives, and a few others

magic raptor
#

Guys i have a weird issue with a plugin, those are the screenshots:

as you can see, the reason is "reconnect" at first, but somehow it manages to still ignore the if that checks the reconnect reason, on second time works pretty much fine.

using bungeecord, serverkickevent

warm musk
#

guys how can i configure templates on intellij idea

#

onCommand etc.

remote swallow
#

wdym by templates

chrome beacon
#

You mean live templates?

#

or something else

warm musk
chrome beacon
#

That's not really a template

#

That's just an auto completion

warm musk
#

whatever

#

is it configurable?

chrome beacon
#

What do you want to change

warm musk
#

arguments

chrome beacon
#

arg names?

warm musk
#

yes

chrome beacon
#

You can probably add a live template

#

The auto completion uses the arg names of the method you're overriding

slender elbow
#

if you have dependency sources downloaded, it'll use the names from the sources rather than the inferred names from decompilation

remote swallow
#

^^

obsidian blaze
#

Hello

#

i need help with my broadcast message

#

could someone help me change it from the server to Ops/ admins on the server

#

?paste

undone axleBOT
obsidian blaze
orchid trout
#

loop through the online players and send the message to people with a certain permission

obsidian blaze
#

OK

orchid trout
#

nvm

obsidian blaze
#

hm?

orchid trout
#

Bukkit.getServer().broadcast("message", "permission");

obsidian blaze
#

oh ok

rugged plover
brazen badge
sly flint
#

hahah

river oracle
cedar saffron
#

Mf used chatGPT 😭

#

ChatGPT is fine, but atleast learn some of the stuff your tryna make 💀

quaint mantle
hybrid spoke
dapper flower
quaint mantle
#

Cool but chatgpt literally killed junior positions in job market.

dapper flower
#

but if you go tell chatgpt "do magic and do the project for me" the guy is gonna smoke a whole 50$ of weed and trip like a grandma

dapper flower
#

you might need to use some NMS

river oracle
#

It's not even close to a junior developer

#

The idea that ChatGPT is taking developer jobs is literally preposterous and almost certainly propaganda from companies who stand to gain by shilling AI products

#

I think with a little critical thinking you'd beable to find good reasons for software jobs to be hard to find rather than AI BS

river oracle
cedar saffron
#

The earth is flat

river oracle
#

Real now that's something I can get behind

fair rock
#

If you think ChatGPT is killing Jr Position you didnt understand Jr Positions in the first place💀

wraith delta
fair rock
fair rock
#

Earth is a flat world sadge

river oracle
#

They know the only efficient way to get there is ice boats through the nether which is exactly why they don't just let you get meter by meter cubes of obsidian easily

quaint mantle
#

Chat went ai to conspiracy theory real quick

copper spade
#

My EntityDamageByEntityEvent triggers twice per each hoe swing, is that normal behaviour?

sly topaz
#

once you've checked all of these, you can gauge whether it is indeed normal or not

#

chances are it is just your plugin doing a weird thing or another plugin making interactions funny, then there's the 5% chance it is a Spigot bug, then there's a 1% chance it is a vanilla bug

kindred sentinel
#

I have 2 questions, the first one, will Player.spigot() work with other cores like paper or something like that? And the second one, to make constant-live actionbar (with changes) is only by BukkitScheduler.runTaskTimer?

young knoll
#

yes and yes

#

I mean technically I believe you can send action bars async

#

But yeah

kindred sentinel
sly topaz
#

as far I was aware, most of the methods that are there have just been moved up to the general interface instead

kindred sentinel
#

it's not possible without console or Player.spigot

#

Afaik

young knoll
#

Component stuff will be moved to .components() eventually

kindred sentinel
sly topaz
#

I'd wish we all just got along together and decided to implement Adventure on every platform but sadly that's never gonna be the case

kindred sentinel
#

and others

#

and why would I use adventure from paper instead of player.spigot()?

sly topaz
#

Adventure works on Spigot too, you just got to use the bukkit provider

eternal night
#

the eventually be carring coll's statement

#

when choco when

kindred sentinel
sly topaz
#

so, anything that uses components, Adventure will handle

kindred sentinel
sly topaz
#

well, it is practically standardized given most of the other platforms also use it, and it's fully featured

#

i.e., you can do components in display name of items, things that Spigot hasn't gotten to implement yet

eternal night
#

Well you can't do those things on spigot even if you use the bukkit platform tho

sly topaz
eternal night
#

the only upside you'd get from using them is the completeness and the other frameworks around adventure like mini message

#

I'd argue you also get a lot nicer API over bungeee chat components, but that is subjective

kindred sentinel
#

Well, I would like to use Player.spigot

#

,_,

eternal night
#

then just do yea

#

works on paper just fine

sly topaz
#

I mean, you can use whatever you want

#

just know it is there if you end up needing an alternative

#

the one issue that you might find is that unlike bungee chat, it'll completely ditch the legacy system and if you ultimately want to use it you have to go through serializers

worldly ingot
eternal night
#

so do we need to peer pressure md into merging it

#

or are we waiting for 1.21.2

sly topaz
#

it being Something#components() doesn't quite feel right to me

eternal night
#

Well, its the alternative to the paper way

#

but also, going the paper way would be a declaration of war omegaroll

sly topaz
#

one could completely confuse that with the data components tho

eternal night
#

data components weren't a thing when that format/idea was developed

worldly ingot
#

It's also way better than spigot() or sendComponentMessage()

#

So pick your poison, I guess

sly topaz
#

not merged yet so could still be changed

#

but not my PR so ¯_(ツ)_/¯

eternal night
#

yea but into what xD

worldly ingot
#

I could make it textComponents() lol

eternal night
#

Yea omegaroll

#

but is it a text component? What if its a translatable component

worldly ingot
#

I'd honestly just rather have ItemStack have a getDataComponents() instead

eternal night
#

Yea

#

Given that data components are presumably not coming to spigot anyway ™️

#

its w/e

sly topaz
#

everything is text components, since ultimately it does end up in a text representation

worldly ingot
#

On my list of todos but

#

¯_(ツ)_/¯

#

Busy

eternal night
#

ItemMeta is a flexible system

#

0 point in a data component API

sly topaz
#

I mean, the data component API in Paper is kinda eh, not loving it right now

eternal night
#

Well there isn't one?

sly topaz
#

well, the planned one so far

eternal night
#

Ah

sly topaz
#

I don't like to complain without providing actual feedback, but I also can't really come up with anything better lol

eternal night
#

Yea, well it just sadly exposes the reality that we are abstracting an ever changing system

#

but people wanna use highly specific things in each version

sly topaz
#

well, since it closely resembles the internal implementation, I'm sure some third-parties are going to take advantage of it and build up from that

kindred sentinel
#

I don't really know much about MySQL but I would like to learn it.. Soo.. What's the name of using .db files instead of full MySQL databases with connections etc.

eternal night
#

like, the BasicCommand of brigadier API

#

for now, that is just gonna stay ItemMeta

kindred sentinel
#

I need brigadier in spigot

kindred sentinel
#

Yes!

#

Thanks

#

I forgot

eternal night
#

👍

sly topaz
worldly ingot
#

(which is distinct from MySQL, mind you)

kindred sentinel
#

Really?

worldly ingot
#

Yes

dapper flower
worldly ingot
#

Different syntax

#

Similar syntax, but there are differences

kindred sentinel
#

Hmm... Ok! Thanks

#

I guess it's not normal to save player's data into the configs so I would like to learn SQLite xd

worldly ingot
#

It's small things like (columnName INTEGER PRIMARY KEY AUTO_INCREMENT) in MySQL vs (columnName INTEGER PRIMARY KEY ASC) in SQLite

#

But they'll bite you in the ass lol

kindred sentinel
#

:(

#

Well, I started from learning javascript

#

so... it's not that bad

worldly ingot
#

It's just something to be mindful of. When Googling online for help with queries, make sure you specify SQLite instead of MySQL because you might get different answers and be frustrated as to why your MySQL query isn't working in SQLite

kindred sentinel
hazy parrot
#

almost

worldly ingot
#

MariaDB has its own features/syntax as well despite being a "successor" to MySQL

#

For the same reason Canada English differs from US English, there are different flavours of SQL :p

young knoll
#

SQL comes in all sorts of shapes and colours

#

Just like humans

sly topaz
young knoll
#

And melons

kindred sentinel
kindred sentinel
sly topaz
#

while SQLite only implements a subset of 2003 or something like that (bigger subset than MySQL's but still a subset)

eternal night
#

sqlite also obviously has the sanest code of conduct

young knoll
#

Satanist?

eternal night
#

one could say that

sly topaz
#

the developers are very religious iirc, yeah

kindred sentinel
#

There were a lot of circles..

#

Strange.. circles..

pseudo hazel
#

does anyone happen to know the structure of an empty nbt list

#

like I cant give it a proper type

#

all the wiki says is "[TAG_END] may also be the type of empty List tags"

#

but idk if that means that an empty list is just a random end tag (doubt it) or if it means that the type of an empty list should be TAG_END (0)

#

im guessing the latter but hoping someone knows for certain

#

in which case an empty nbt list would be [9, 0, 0, 0, 0, 0] as byte array

young knoll
#

Yes

#

TAG_LIST TAG_END (0 length)

#

However I assume the tag end could be any valid list tag

pseudo hazel
#

right, well lists have a size so they dont use the end tag to denote the end

young knoll
#

Correct

pseudo hazel
#

so I guess they just decided to use 0 for an empty list, which happens to be an end tag, thus making the description a little weird

young knoll
#

You can use any valid tag there

#

Like I said

pseudo hazel
#

ah

#

since the list is empty it shouldnt matter I suppose

young knoll
#

It just denotes what type of tags the list contains

#

But it’s empty so it doesn’t matter

pseudo hazel
#

yeah okay,

#

thanks

young knoll
#

I think that would be part of their pathfinding

#

So NMS

slate siren
#

guys

#

I coded it to open the sign editor screen with a command using Minecraft.net.server and Packet.

#

But there is a problem, I want to have text on the sign when the editor opens and I can't do that

carmine oracle
#

does PlayerResourcePackStatusEvent trigger before PlayerJoinEvent?
I mean, I'm testing it and it seems to be like that, but is that always the case?

#

also, has that changed through versions? if someone joins my server using a lower version, is it going to workd differently for them?

young knoll
#

Depends on how fast the client downloads it

#

And what stage you are looking for

carmine oracle
#

anything final (i.e. loaded, declined, discarded and idk if there's another like that)

young knoll
#

I think everything but downloaded and accepted are final

#

Also idk if the client waits for the download for packs sent on join

carmine oracle
#

nah, I just checked, it does depend on the client's speed to make the connection vs downloading the pack

#

at least that's what it looks like according to my tests xd

sleek creek
#

From my experience it will download after you have joined the server

cedar saffron
#

yes, it will ask as a prompt

river oracle
#

I'm embracing my true values

viscid carbon
#

Y'all ever sitting there having problems adding something and then your like wait... thats stupid. you can just add the rewards manually in the yml xD

#

Context: I was making a placeholder for my task reward system. in the gui i was trying to add %ITEMS% and over complicate this lol

hybrid spoke
carmine oracle
hybrid spoke
#

"lib"

#

looks like this in the aftermath

# Config version: 3.0
# Configuration settings:

# Stores the last x CPS internally to process
cps-storage-limit: 30

# What click types should AntiAC track? [ATTACK]
allowed-clicktypes: [INTERACT, ATTACK, BLOCK_PLACEMENT, BLOCK_BREAK]

# Enable modern feedback
modern-feedback: false

# Whether to log flagged players
logging: true

# Database URL
database-url: jdbc:mysql://localhost:3306/antiac

# Database username
database-username: root

# Database password
database-password:

# [MYSQL, POSTGRESQL, H2, ORACLE, SQLSERVER, SQLITE]
database-driver: MYSQL

# [MYSQL, POSTGRESQL, H2, ORACLE, SQLSERVER, SQLITE]
database-dialect: MYSQL

# Commands to execute when a player gets flagged
commands: [kick %player%, say %player% got flagged by %check% check!]

# Lowest allowed TPS until the TPS protection kicks in
tps-protection: 15

# Enable violation-based actions
violations: false

# Maximum amount of violations allowed until the player gets flagged
max-allowed-violations: 8

# Whether the server allows bedrock players
bedrock-players: false
carmine oracle
#

Props for making it, but I'd rather use a fully supported lib made and supported by someone else so I don't have to maintain it xd

hybrid spoke
#

fair enough

orchid brook
#

Hello everyone it's not a spigot related question but i don't realy know where to ask

I have a quick question regarding the use of shadowJar. I've configured my task like this:

def pluginJarName = "MyPluginName-1.0.0-all"

// Task to copy the shaded jar into the plugins folder
tasks.register('copyPluginToServer', Copy) {
    dependsOn build
    from("$buildDir/libs/${pluginJarName}.jar") // Generated jar file
    into(serverPluginsDir) // The plugins folder of my server
}

// Run the copy task after shadowJar
shadowJar.finalizedBy(copyPluginToServer)

In my IDE, I've created a Run/Debug configuration to start the server with the Gradle task shadowJar before launching it. This allows me to use Ctrl + Shift + B (the build shortcut) to inject changes and debug without restarting the server.

My question is: should I use the ${plugin-name}-1.0.0-all.jar or the ${plugin-name}-1.0.0.jar? If I'm not mistaken, I should be using the one with the -all suffix, right?

pliant topaz
fading drift
#

can I create a world with the directory for example worlds/nether

eternal oxide
#

yes

fading drift
#

just change name to such?

eternal oxide
#

you have to create/load it with WorldCreator

fading drift
#

new WorldCreator("worlds/nether"); would this work?

eternal oxide
#

yes, with .createWorld()

fading drift
#

thank you

#

how would I teleport a player to a different world

#

cus player.teleport didnt work

eternal oxide
#

world has to be loaded to be able to teleport to it

fading drift
#

printing Bukkit.getWorlds shows my world does that mean its loaded or do I have to do another step

eternal oxide
#

no other steps

#

you likely can;t teleport to the world in the same tick you load it

fading drift
#

how should I add delay?

#

create a runnable?

agile anvil
#

sure

glossy laurel
#

What are the pros and cons of using packet events instead of nms

eternal oxide
#

Pro: You don;t have to understant nms nor update your plugin everytime it changes.
Cons: You have to wait the the plugin to be updated if it breaks

hushed spindle
#

when you say packet events do you mean protocollib

eternal oxide
#

he means PacketEvents. Its a lib/plugin to replace PLib

hushed spindle
#

oh cool

#

its also worth noting you're adding a dependency to your plugin which, if you plan to publish the plugin, will put off some people

#

EntityShootBowEvent#setConsumeItem() is deprecated, is there a replacement to this?

eternal oxide
#

the deprecation would say if there was

orchid brook
#

spigot use snakeyaml so why people use boostedyaml that is also a derivated of snake??? i don’t get the point

eternal oxide
#

there is no point. They are misguided by someone who once used it and liked it

orchid brook
#

Someone tell me that because we can update the config and keep comments good

eternal oxide
#

so can snake

#

and using any other yaml implementation breaks Bukkit serialization

chrome beacon
#

BoostedYaml supported comments when Spigot did not

#

and now Spigot does

#

Boosted does have some other features that can be useful

chrome beacon
#

PacketEvents performance should be good enough

fading drift
#

is there a easy way to completely clear a players inventory

drowsy helm
fading drift
#

perfect

#

this includes armor slots correct

drowsy helm
#

yeah i believe so

glossy laurel
#

It does

fading drift
#

does player.teleport return false if failed