#help-development

1 messages ¡ Page 486 of 1

hazy parrot
#

Package name

young knoll
#

They used to all be in a package called net.minecraft.server

visual laurel
#

Im probably being an idiot here but I'm using config.yml to store a balance for each player but the number doesnt go down in the config when i change the value

#
public void removeAugmentCount(Player player){
        int oldValue = config.getInt(player.getUniqueId() + ".augments-left");
        if (oldValue == 1){
            config.addDefault(player.getUniqueId() + ".augments-left", 0);
            config.options().copyDefaults(true);
            saveConfig();
        } else {
            int value = oldValue - 1;
            config.addDefault(player.getUniqueId() + ".augments-left", value);
            config.options().copyDefaults(true);
            saveConfig();
        }
    }```
young knoll
#

Use set

remote swallow
#

that adds a default you need to use config.set

young knoll
#

Not addDefault

visual laurel
#

oh right..

remote swallow
#

you can also remove " config.options().copyDefaults(true);"

nocturne gale
#

Hello, I'm looking for help with prefixes. I would need, for example, if I put in LuckPerms: prefix.1.<g:FFFFF> Test </FFFFF> so that one more color runs through the text. Does anyone know please ? Thank you for your willingness.

remote swallow
#

you can use &#rrggbb with luckperms iirc

nocturne gale
#

Okay, but that's only the first color of the text

remote swallow
#

you want gradients?

nocturne gale
#

I would need the second color to "run" over the first color

nocturne gale
remote swallow
#

oh it copied with an extra slash

#

fixed it

nocturne gale
#

Thank you very much, only I would need animated text 😅

#

Animated text as a prefix 😅

vale veldt
#

Does anyone who knows about the bungeecord api know how to do this? Thx

lost matrix
#

What does that mean? String is from general Java...

young knoll
#

If event priority on bungee is similar to spigot then it’s an enum

#

So you use valueOf

echo basalt
#

he wants to assign a priority to a listener dynamically from a string

#

you can't do that with an annotation because they don't work like that

young knoll
#

Can’t do that with annotations

vale veldt
young knoll
#

Looks like they are just static fields that correspond to bytes

#

You can always just recreate them

vale veldt
#

Yes, but bungee doesn't have other methods to register events like spigot which gives you more customisation in that aspect, you can't set a priority on bungee events as the user sets in the config, as it only accepts final fields in the annotation

main dew
#

how I can disable saving world (no only autosave)

tender shard
#

if you disable autosave, and noone calls save(), it won't get saved

main dew
tender shard
#

can you please try to rephrase that into a normal sentence

main dew
#

how to disable chunk saving?

main dew
shrewd solstice
#

how can I summon 2 item frame in the same place? because I'm getting this,
Caused by: java.lang.IllegalArgumentException: Cannot spawn hanging entity for org.bukkit.entity.ItemFrame at Location{world=CraftWorld{name=world},x=0.0,y=0.0,z=0.0,pitch=0.0,yaw=0.0} (no free face)

worldly ingot
#

You'd have to make it sit on a different block face

#
world.spawn(location, ItemFrame.class, itemFrame -> {
    itemFrame.setFacingDirection(BlockFace.NORTH);
}```
shrewd solstice
#

but if im in the air and i want them both in the safe rotation...

worldly ingot
#

You can't have them in the same rotation

shrewd solstice
#

hmmm

young knoll
#

Is that an mc limitation

#

Or spigot

worldly ingot
#

There can only be one item frame at any given location & face

#

Yes

#

Vanilla

shrewd solstice
#

no, when they are Fixed:1 you can put both of them in the same place

worldly ingot
#

If that's the case in vanilla, I suppose you can try spawning two item frames next to one another and teleport one of them

shrewd solstice
#

how can I do that?

worldly ingot
shrewd solstice
#

but how can I teleport it?

worldly ingot
#

itemFrame.teleport()

#

;p

shrewd solstice
#

ok thx x)

worldly ingot
#

Can't guarantee that would work but that would be my only guess

echo basalt
#

from my experiments

#

they snap directly on the vanilla client so you can spawn them with a decimal offset iirc

#

you can also play with yaw/pitch to have weird issues

young knoll
#

Yay weird issues

tender shard
young knoll
#

I feel attacked

shrewd solstice
frosty relic
#

Hi i'm using PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER in 1.19.2 to remove a player from another player's tab but the player is not only being removed from the tab the player also becomes invisible in the game

worldly ingot
#

Well, yeah. You're removing the player

tender shard
worldly ingot
#

Player#hidePlayer() does this by the way

tender shard
#

^

#

no slughorn needed for that

worldly ingot
#

but yeah, the player entity and the tab list is pretty much linked

tender shard
#

almost 95% that requires slughorn in 1.8 can be done without slughorn in 1.19

worldly ingot
#

wtf is slughorn

young knoll
#

Iirc the tab list and entity are no longer linked

ancient plank
#

A slug with horns

frosty relic
frosty relic
young knoll
#

Protocol
The network protocol now supports adding player entities to the world without being added to the 'tab' player list.

#

As of 1.19.3 ^

frosty relic
#

i just realized, that players become invisible to each other when they are teleported to another location

paper trout
#

is there a way to get the path to the world folder?

frosty relic
paper trout
#

you mean the world name?

frosty relic
#

I mean if you have the world name probably you can do smth like this new File(plugin.getDataFolder().getAbsoluthPath() + "/../../" + world.getName())

#

i doubt that the bukkit World have a method to return the folder

paper trout
#

ah, i didn't even know getDataFolder() was a thing

#

i'm still new to plugin dev '3'

young knoll
#

Or if you want the folder of one world

#

You shouldn’t hardcode it to your plugin folder as the world container can be changed

paper trout
#

so what is the difference between Folder and Container?

#

is container the parent directory?

frosty relic
young knoll
#

Container is the parent directory that holds all the world folders

paper trout
#

and uh... i hate to ask but how do you import it? cause clearly i'm doing it wrong

#

cause all i can access are the Nested Classes says by the documenation

#

wait i think i'm being dumb
is it just <player>.getWorld().getWorldFolder()?
or is there like a globally main world object?

young knoll
#

Mhm

#

If you want the main world use Bukkit.getWorlds().get(0)

worldly ingot
#

I don't think that's guaranteed, is it?

young knoll
#

Technically no

#

But I can’t think of any situation that the main world would not load first

paper trout
#

i mean in ideaIC you can set a plugin to start before world loading

#

but most plugins like mine are set to load after world

young knoll
#

You can’t load a world that early anyway

#

Spigot will yell at you

regal scaffold
#

Hey

#

I'm trying to make a indexer based on a percentage block

#

Example,

percentage is divided into 5 blocks. So the max for each percentage block is 20%.

I want to get the equivalent number for the block between 1 and max

glad prawn
regal scaffold
#

If the percentage is 0% return 1
If the percentage is 20% return max

If the percentage is 21% return 1
If the percentage is 40% return max
...
...
If the percentage is 80% return max
If the percentage is 90% return max / 2
If the percentage is 100% return max

#

Is this possible just with math or do I need to spam ifs...

worldly ingot
#

% is your friend here

#

(value % max + 1) + 1

regal scaffold
#

value is percentage?

#

So from 1-100?

worldly ingot
#

Yeah whatever your input % is

regal scaffold
#

Ohhhh

#

And then just put (value % max) + 1

#

In a normal min-max range number

#
        int index = (int) ((percentage % max) / 100.0D * (max) + 1);
#

No way it's as simple as just int index = (value % max) + 1

oak notch
#

plugins {
id 'java'
}

group = 'de.degurne'
version = '1.0-SNAPSHOT'

repositories {
mavenCentral()
maven {
name = "spigotmc-repo"
url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/groups/public/"
}
}

dependencies {
compileOnly "org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT"
}

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

tasks.withType(JavaCompile).configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
}
}

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

tender shard
#

ah yes

#

thanks

oak notch
#

plugins { id 'java' } group = 'de.degurne' version = '1.0-SNAPSHOT' repositories { mavenCentral() maven { name = "spigotmc-repo" url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/groups/public/" } } dependencies { compileOnly "org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT" } def targetJavaVersion = 17 java { def javaVersion = JavaVersion.toVersion(targetJavaVersion) sourceCompatibility = javaVersion targetCompatibility = javaVersion if (JavaVersion.current() < javaVersion) { toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) } } tasks.withType(JavaCompile).configureEach { if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { options.release = targetJavaVersion } } processResources { def props = [version: version] inputs.properties props

tender shard
#

isn't the artifact id missing?

#

nvm it's gradle lmao

#

normal there

#

gradle ¯_(ツ)_/¯

#

@remote swallow does gradle allow you to set group id and version without any artiract id?

#

i doubt so?

oak notch
#

what

tender shard
#

you did not declare the artifact id

#

artifactId 'myShit';

oak notch
#

where I addings that in pom? left or right?

tender shard
#

you're using gradle, you don't use any pom.xml

#

are you trolling or sth? ;'=

regal scaffold
#

Does integer division with return as float round to lowest int?

#

50 / 20 = 2.5 -> 2?

wise mesa
#

What do you mean return as float

#

Integer division always rounds down because it’s doing remainder division

regal scaffold
#

Ok yeah thought so

#

Ty

wise mesa
#

Integer divide to get big number and then modulo to get remainder

#

That’s the idea at least

regal scaffold
#

Ok the way that choco told me doesn't work

#

I'm trying to make a indexer based on a percentage block
Example,

percentage is divided into 5 blocks. So the max for each percentage block is 20%.

I want to get the equivalent number for the block between 1 and max

If the percentage is 0% return 1
If the percentage is 20% return max

If the percentage is 21% return 1
If the percentage is 40% return max
...
...
If the percentage is 80% return max
If the percentage is 90% return max / 2
If the percentage is 100% return max

#

the range of the return should be between 1 and max. example. 1 - 17

#

if percentage is 10% it should return 17/2
if the percentage is 20% it should return 17
If the percentage is 21% it should return 1
So on

rare rover
#

better way of doing this?

    @Override
    public void load() {
        JavaPlugin plugin = MobCore.getPlugin();
        YamlConfiguration config = ConfigUtils.check(new File(plugin.getDataFolder(), "config.yml"), "config.yml");

        /*
        * Loading the config
         */
        final String prefix = checkType(config.getString("prefix"));
        final String noPermission = checkType(config.getString("no-permission"));

        ConfigImpl.prefix = ColorUtils.colorizeHex(prefix);
        ConfigImpl.noPermission = ColorUtils.colorizeHex(noPermission);
    }

    @Override
    public <T> T checkType(T type) {
        if (type == null)
            throw new IllegalArgumentException("There was an issue loading config file!");
        return type;
    }```
#

i dont like bloat so

#

and the interface:

public interface Config {

    /**
     * Loading function for the config
     * @return
     */
    @Contract(pure = true)
    void load();

    /**
     * Checks if the config contains a key
     * @param key
     * @return
     */
    @Contract("null -> fail")
    <T> T checkType(T type);
}```
ivory sleet
rare rover
#

i was just wondering if there was an easier way of doing this?

ivory sleet
#

Define easier

#

Like less lines?

rare rover
#

yeah, i dont like copy and pasting

#

seems very counter intuitive

ivory sleet
#

Yea DRY and KISS are 2 programming principles one should consider

#

I mean if you always want those config values to not be null, I’d write another config class that extracts values from a FileConfiguration instance and asserts non-nullability eagerly

#

That makes it less “line-y” on the spot but does stretch the system’s amount of classes

rare rover
#

i see

sullen marlin
ivory sleet
#

Oh that too ^

rare rover
#

yeah 😓

sullen marlin
#

new asynchatformatter++++ annotation just dropped

ivory sleet
#

Void methods are by definition never pure

rare rover
#

ong

#

my bad

sullen marlin
ivory sleet
#

Since it’d be no use calling them if they do not have a side effect

rare rover
ivory sleet
#

When is a void method pure?

sullen marlin
#

public void wrong() {// Pure}

rare rover
#

heh

ivory sleet
#

Yeah but that’s pointless md_5 :3

tender shard
#

you are pointless

ivory sleet
#

Rude

tender shard
#

Life's like a road that Conclure travel on
When there's one day here and the next day gone
Sometimes Conclure bend,s sometimes you stand
Sometimes Conclure turn your back to the wind

#

you know

#

I replaced "you" with "Conclure"

#

🧠

ivory sleet
#

Lol

tender shard
#

lmao I really have nohting to do

ivory sleet
#

Lol dw same, well maybe im pointless now

tender shard
#

haha

#

yes maybe someday(tm)

#

until then, we can write lyrics about choco

slow arrow
#

does getDataFolder() return like, the folder at ./plugins/MyPluginName/?

ivory sleet
#

yea

slow arrow
#

ok cool

ivory sleet
#

99% in cases it does

tender shard
#

100%

slow arrow
#

99%..??

frail gale
#

Does someone knows how can I change the InventoryHolder of an already existing inventory?

tender shard
#

100

ivory sleet
#

but some servers configure a different name or path than ./plugins/%plugin_name%

#

so then it can differ

slow arrow
#

but this is spigot

tender shard
ivory sleet
#

which is why u always wna use getDataFolder and not sth else

slow arrow
#

ok cool thx

tender shard
frail gale
tender shard
slow arrow
tender shard
#

^

frail gale
tender shard
#

you could easily change it with reflection

#

but everyone will hate you, if you do

frail gale
#

Yeah, but I don’t know where is the field located

tender shard
#

getClass().getDeclaredField()

#

do not do it

frail gale
slow arrow
#

Ngl reflection feels like cheating

tender shard
#

because others might cast it to CraftInventory

frail gale
tender shard
frail gale
rotund ravine
#

Reflection is made to cheat

tender shard
#

^

rotund ravine
#

Plus some other stuff obv

tender shard
#

the acutal question is - why do you wanna do that in the first place

#

inventories are Namespaced, aren't they?

frail gale
#

Very strange because when I get all the declared fields I still don’t see an InventoryHolder one

rotund ravine
#

What class are you calling it on

frail gale
tender shard
#

that is because getDeclaredFields() only returns the fields of THAT class

#

not of superclasses

frail gale
frail gale
tender shard
#

iirc inventories iplements Keyed

slow arrow
#

I use reflection for custom enchants
That's about it lol

frail gale
slow arrow
#

nbt data scares me lmao

rotund ravine
#

?stash

undone axleBOT
frail gale
vocal cloud
#

It's just JSON with extra steps

slow arrow
#

I'll leave dealing with raw nbt to the fancy shmancy peeps

tender shard
#

my bad, Inventories do NOT implement Keyed

slow arrow
tender shard
#

?xy

undone axleBOT
frail gale
rotund ravine
#

Don’t use inventory holders for that

vocal cloud
slow arrow
#

😮

tender shard
slow arrow
rotund ravine
#

?pdc

tender shard
#

but yeah, rather use a Set or whatever

sullen marlin
#

"API interface with 1 easy to implement method"

#

"plugin developers: It's free real estate"

frail gale
vocal cloud
#

Disgusting

tender shard
#

md, everyone's been using InventoyHolders since 10 years

#

it even only declares one method

#

but yes, dont do it

#

store the inventories you create in some kinda collection

#

that's the proper way ^

sterile cove
#

Ngl seeing all of you talk ab programming things I do not understand makes me want to start coding

frail gale
tender shard
#

kinda, yes

frail gale
tender shard
#

not the view, just store the inv directly - not its view

undone axleBOT
tender shard
#

coding is fun

#

check it out ^

sterile cove
frail gale
#

But again is there still a way to change the InventoryHolder of an existing inventory? Just for curiosity

orchid gazelle
#

Maybe some nms way or reflection lol

frail gale
orchid gazelle
#

Damn good idea, kinda would be good having that one

frail gale
tender shard
#

get the field, set it accessible, change it, done

orchid gazelle
#

Can it update while in Inventory?

tender shard
#

you should NOT do it

#

it's pointlesss

orchid gazelle
#

should <:

frail gale
#

Messing with NMS is so fun sometimes haha

tender shard
orchid gazelle
#

why not? It's gonna look cool animating that one n shit

tender shard
#

if they already caught any InventoryClickEvent or whatevever

#

I can only repeat myself:

#

?xy

undone axleBOT
tender shard
#

even md told you it's a shitty idea

sullen marlin
#

the question doesnt make sense

#

an inventory holder represents something that holds an inventory

#

ie, a chest or mob

tender shard
#

^

#

exactly, what would you replace it with?

frail gale
sullen marlin
#

you cant just reassign a chest inventory to another random chest or mob in the world

orchid gazelle
#

Oh nvm I actually mean the title

tender shard
#

you should, if at all, create the inv with a custom invholder, in the first place

orchid gazelle
#

the title can be changed on creation, but can it be changed while in the inventory?

tender shard
nocturne gale
#

Hello, I'm looking for help on how to make an animated prefix using rgb colors, would anyone know please?

frail gale
nocturne gale
tender shard
#

HAST DU ETWAS ZEIT FÜR MICH

vocal cloud
#

angry German noises

tender shard
#

people think that the german language is funy

#

meanwhile english has words like "snorkel"

#

like wtf

#

snorkel wtf lmao

sterile cove
#

As a Bulgarian I agree

vocal cloud
#

Moist

tender shard
#

MoistBukkit when?

#

i mean

#

makes sense

#

buckets are usually moist

#

moist-y

#

moisty?

#

idk

#

fuck off

vocal cloud
tender shard
#

by now, you should've somehow realized what you're gonna do

sterile cove
#

Btw does this server help w fabric development bc I wanna do a fabric mod

tender shard
#

@slate mortar

#

also

#

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

tender shard
#

just ask

#

TL;DR not many people here use fabric - but some do. you won'T get any answers if you don'T ask your specific question, though

sterile cove
#

Ok ty

tender shard
#

so what's your question though lol

#

no question, no answer

indigo frost
#

ok so i need help with something. Let's say I make my plugin run an ingame command that returns text that gives a bunch of info on the player, and one of the infos is money: 1000 Is there a way to get this number? Ill give an example. Let's say I run a command from another plugin called /player <player> and it returns something like this in chat or console:
Player: <name>
Money: <value>
Time Played: <value>
etc...

I want to be able to get the money value by the return statement even if it's not in my plugin already

kind hatch
#

If I'm following correctly, you're wanting to parse info from the server log into a usable piece of data?

sterile cove
vocal cloud
indigo frost
slate mortar
#

getting 50 pings again when waking up is fun

slate mortar
slim wigeon
#

Hey there. How can I loop thru inventory.addItem(new ItemStack(Material.CHEST,10)) list?

slate mortar
#

uhh

#

loop through what? lol

slim wigeon
#
                    amount = (amount - overflowItem.getAmount()); invItem.setAmount(amount);
                }```
slate mortar
#

oh it just returns the items that couldnt be added, i remember

#

yea that seems fine to me

slim wigeon
#

Well, it always remove 1 item when it adds 64 items to my inventory

slate mortar
#

no idea

slim wigeon
#

Like I multiplying items from my farming rod. That is not normal at all. 64 seeds = 512 seeds, need a fix

jagged monolith
#

Use some debug messages to see what it's giving the overflow item and the amounts

slim wigeon
#

I see, its the addItem(). The loop is not functioning right for this purpose

#

Removed ".values()" and got this error```
Can only iterate over an array or an instance of java.lang.Iterable

hazy parrot
#

Error is pretty self explanatory

#

You can't iterate over something that doesn't implement Iterable interface

hazy parrot
#

What do you want to achieve

slim wigeon
#

I just want to get the first overflow item of the addItem() so I can remove the amount from the inventory of my farming rod that went into my inventory

#

First ItemStack in addItem()?

slim wigeon
regal scaffold
#

Hey

#

If I want to allow a specific block to be broken

#

From blockBreakEvent

#
            for (Block block : blocks) {
                if (block == e.getBlock()) {
}}
#

Is it getState?

#

Otherwise as soon as I start mining technically it cahnges

flint coyote
#

don't compare objects with ==

regal scaffold
#

It is the same object tho

#

But sure

#

I'll use equals

flint coyote
#

Did you store it? It isn't guaranteed that spigot will return you the same block instance

regal scaffold
#

Logs

#
[09:09:50 INFO]: Event block: CraftBlock{pos=BlockPosition{x=590, y=65, z=78},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=hat,note=7,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@7cb73050}
[09:09:50 INFO]:Block: CraftBlock{pos=BlockPosition{x=590, y=66, z=78},type=NOTE_BLOCK,data=Block{minecraft:note_block}[instrument=hat,note=24,powered=false],fluid=net.minecraft.world.level.material.FluidTypeEmpty@7cb73050}

#

The note...

#

That is... lol

#

How should I compare them? To allow just the specific block to be broken

#

Location?

flint coyote
#

Why do you loop them instead of using contains tho?

regal scaffold
#

I know it will contain it

#

It's a Block[]

flint coyote
#

BlockBreakEvent has 1 block. So just go with blocks.contains(e.getBlock())

#

oh

regal scaffold
#

But still

flint coyote
#

Well if it's the same instance your code should work. Does it get past the if?

regal scaffold
#

I know something happens when a block starts getting broken

#

So idk if I need to to getState

#

Or what was it

flint coyote
#

I'm not sure what you're asking here. You want to loop over your array and then cancel the event if your block is the same as the broken block. Did you ask about the cancel event part or is it not going inside your if statement?

regal scaffold
#

I'm just asking what's the correct way to check if the block being broken

#

Is a block in my block[]

#

Since I know blocks have states

#

And no, instances aren't the same

flint coyote
#

Well if you wanna be sure you could use locations.
Especially for noteblocks I suppose the state would change when someone right clicks it

regal scaffold
#

Indeed

#

Testing rn

#

Worked like a charm

#

But for some reason, it's calling the event before the block is broken at all

ivory sleet
#

Ofc

#

To make it cancellable easily

regal scaffold
#

So if I want to check the after break

#

I use

#

Drop event

#

Whatever it ius

ivory sleet
#

It’s generally a pain to implement restoration logic

regal scaffold
#

Hmmm

flint coyote
#

What are you trying to achieve by doing it after it was broken?

regal scaffold
#

Make it not spammable by starting to mine

#

But instead

#

I implemented a cooldown system

chrome beacon
#

Listen to the BlockBreakEvent with Monitor priority

#

And see if the event was cancelled

flint coyote
regal scaffold
#

It is

chrome beacon
#

No

flint coyote
#

Huh. No it's called the second (or tick to be exact) the block breaks (or would break, if cancelled)

regal scaffold
#

We just talked about this. I tested it

chrome beacon
#

It's called before the block is removed from the world

#

But not before the player has fully broken it

regal scaffold
#

Not what I just tested

flint coyote
regal scaffold
#

I am very sure

#

BlockBreakEvent

#

Conclure even said

#

It's how it works

chrome beacon
#

It's called after a player has broken a block but before it's removed from the world

flint coyote
#

I guess he misunderstood. He meant to say that the internal logic is something like

onBlockBreak {
  event = callEvent(block);
    if(!event.isCancelled) {
      removeBlock(block);
    }
}
chrome beacon
#

^^

regal scaffold
#

Hmmm

#

Alright

#

ty

flint coyote
#

Obviously in creative it will trigger instantly on left click

regal scaffold
#

Well yeah

flint coyote
#

I would go into a deeper dive with you but I don't know your code, neither the way you tested

sick epoch
#

Hello ! I'll make a Jobs plugin and today i program the datasave part but i got some errors and i don't know how to solve them ^^ Somebody can help me ? I speak french sorry for my bad english 🙂

#

How can i join a file

#

or the error code

#

?

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!

flint coyote
#

No it doesn't. It kept recommending me to use the ?? operator in java (which is only available in c#). Even after asking it whether it's available it said "yes"

quaint mantle
#

ChatGPT will always say that it is right and never makes mistakes

#

That being said if you call it out it will come forward with a preprogrammed response

flint coyote
#

Well this time it didn't at my first attempt lol

quaint mantle
#

AI is like the dumbest thing ever

flint coyote
#

Instead it decided randomly that it was added in java 14

#

Could be. But yeah that shows it can't code, unless you can verify what it did - don't trust it

hardy trout
#

whats the plug in

#

?

flint coyote
#

wdym?

hardy trout
#

for the server

flint coyote
#

there's thousands of plugins

hardy trout
#

like the ip to this serer

chrome beacon
flint coyote
#

I really don't know what you're asking for. The invitation link to this discord server?

hardy trout
sick epoch
#

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

sick epoch
#

Dev problem

young knoll
#

I wish java had ??

#

Tbh I wish java had several C# features

hazy parrot
#

Default args, coroutines, higher order functions without funct interface

#

Operator overloading

steady wasp
#

why World.Environment.getId() is deprecated?

young knoll
#

It does say

#

Magic value

steady wasp
#

what it means?

young knoll
#

It means the id is just a meaningless number and shouldn’t really be used for anything

#

A "magic value" is a string or number used in a program that is essential to its proper function but provides no context or explanation for why it is what it is.

rotund ravine
#

?jd-s

undone axleBOT
rotund ravine
steady wasp
#

i mean dimensions that mods adds

rotund ravine
#

Spigot does not support mods.

young knoll
#

Cries in janky hybrids

eternal oxide
#

?basics

undone axleBOT
eternal oxide
#

?di

undone axleBOT
rich inlet
#

How do I send an Action Bar title to a player?

        `player.sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("String"));`

doesnt work anymore with 1.19.4

oak notch
#

how to use NMS on maven on 1.19.4? I dont want to use gradle

tender shard
#

?nms

tender shard
#

it's Player.Spigot#sendMessage(...)

#
player.spigot().sendMessage(...)
rich inlet
#

Oh, thanks :D

#

Yup, works, thanks a lot!

tender shard
#

np

lost matrix
#

Need someone with bytecode manipulation experience.
Given the following example method:

public boolean check(String variable) {
  if("Example".equals(variable)) {
    return true;
  }
  return false;
}

My goal is to change the anonymous variable "Example" to something else.
What would be the an appropriate tool do this? Ive tried using ByteBuddy but i fked up
the class beyond repair on runtime.

chrome beacon
flint coyote
#

I'd probably use something to hold all those slots. Be it a different class, a map, an array of pairs - your choice. Just not that many parameters

lost matrix
#

Yes ofc. Changing some classes in a jar is not something i would fail on.
I need runtime manipulation

tender shard
#

or all occurances of that

flint coyote
#

Why do you have to hand them over as single elements then?

ivory sleet
tender shard
lost matrix
#

There is only one occurrence of this this String

lost matrix
flint coyote
#

I never registered a custom recipe but if that's a function that you created and not an internal one, you should swap from 9 times itemstack as a parameter to a list or array or whatever you prefer

flint coyote
#

yes that looks cleaner

tender shard
#

from what I know, it requires an enchantment

lost matrix
remote swallow
#

you have to enchant it then hide the enchatments

pulsar veldt
#

is it possible to get the world seed in the getDefaultWorldGenerator function? When I do getWorld(worldName) it says the result is null. I'm not sure what else I could do.

flint coyote
tender shard
#

why would it not be there

remote swallow
#

addItemFlag(ItemFlag.HIDE_ENCHANT) iirc

tender shard
#

otherwise, ping @quiet ice

#

geol knows stuff about bytecode etc

tender shard
quiet ice
#

Whomst dared to ping me?

flint coyote
tender shard
lost matrix
tender shard
#

7smile wants to replace some strings in a .jar

#

he also wants to cuddle with you

#

#yeshomo

lost matrix
tender shard
quiet ice
tender shard
#

oh wait, you don't have the .jar, but wanna replace things in already loaded classes, now I understand what you're trying to do

lost matrix
#

To my understanding i can use instrumentations to intercept method invocations

tender shard
#

usually you can just construct a "same" string, then just change the char array

quiet ice
tender shard
#

the better question is, why do you even need that

lost matrix
quiet ice
#

i.e.

for (AbstractInsnNode insn = method.instructions.getFirst(); insn != null; insn = insn.getNext()) {
  if (insn.getOpode() != Opcodes.LDC) {
    continue;
  }
  LdcInsnNode ldcInsn = (LdcInsnNode) insn;
  if (!ldcInsn.cst.equals("example")) {
    continue;
  }
  ldcInsn.cst = "Replaced constant";
}
#

then write the file back

#

For such a change I recommend to not recompute frames and maxs and make the class reader read debug info

tender shard
#

but I thought they wanted to change stuff in "loaded" classes, not just change the .jar file

lost matrix
#

Ok im not sure how a "file" looks like during runtime.
Changing a class inside a jar which was already loaded seems kind of pointless to me.

quiet ice
#

For a already loaded class you need to register javaagents

lost matrix
#

Bukkit plugin loader is not needed ^^

#

But thanks

quiet ice
#

I think you might be able to register javaagents at runtime via dynamic agents but there is JEP 8306275 that plans to remove them

lost matrix
#

I can start one via jvm params

pulsar veldt
quiet ice
#

Well if you have that option it is the best ofc

#

If you have the option it is adviseable to use the jetbrains runtime

#

It implements DCEVM and thus has the -XX:+AllowEnhancedClassRedefinition option that allows improved class redefinition capabilities

lost matrix
#

Let me check that out. Im starting the jvm through my IDE anyways.

tender shard
#

or are you on 1.8 or sth?

lost matrix
pulsar veldt
tender shard
#

WorldInfo#getSeed()

#

the WorldInfo object gets passed into every world generation method

pulsar veldt
#

I know but I want the worldinfo in the constructor of the chunkgenerator

#

or just the seed, I don't need the world info even

limber acorn
#

Hey,
is it possible to create a new world in which the bioms are smaller?

tender shard
#

with a custom chunk provider thingy, sure

tender shard
limber acorn
tender shard
#

wdym? no, it's just there to load recipes from a yml file, so people can declare custom recipes, etc

#

what are you trying to do @quaint mantle ?

pulsar veldt
#

and because the block populator is only constructed once, I can't really retroactively change the fields very easily unless I use a bunch of hacky static fields

#

is it possible to grab the "seed" setting from server.properties?

quiet ice
#

For newer JDK versions that is.
For JDK 8 it probably isn't available but in that case TravaOpenJDK might work but I doubt they list it there given that that project is dead

tender shard
#

but ofc you could just "reuse" it for your world

#

you could ofc also just generate a random seed, then store it in your custom world's spawn chunk's PDC

quiet ice
#

Also note that paper might allow the option to use different seeds

#

Since there are 7 or so seeds in total iirc

#

However I am not too sure whether it is paper or another fork that allowed to change the seeds individually

lost matrix
#

Just trying to figure out which startup params i need for my run configuration to start
the agent. Usually -javaagent:agent.jar is appended to define an agent. But in this
case im a bit lost on where to the the IJ agent from.

quiet ice
#

Should be added as a jvm option

tender shard
#

can't you just use maven lol

quiet ice
#

so I guess the upper field?

quiet ice
young knoll
#

You can use <section>.getKeys(false)

#

Recursive

#

If you want to get all the children keys too

quiet ice
#

If I had to guess? Hell no

remote swallow
#

you normally want to handle each config section seperately

young knoll
#

Do you also want all the subkeys of Item1

#

Then no

remote swallow
#

here, ```yaml
key:
key2:
key3: true
key4:
key5: true
key6:
key7: true

steady wasp
#

how minecraft block coordinates is centered?

#

i thought on block middle

#

but it not

eternal oxide
#

always corner of a Block

lost matrix
#

middle is +0.5 on each x, y and z

eternal oxide
#

+0.5 to all axis to get the center

steady wasp
#

but why?

eternal oxide
#

kinda

steady wasp
#

but ok

#

thanks

ocean hollow
#

after destroying block, block continues working. The breaking event passes, and if you repeat it, it gives an error

tender shard
#

blocks don't work

#

they don't implement Employee

#

what's "OpenBlock" line 36?

ocean hollow
tender shard
#

"furnace" is null

#

your stacktrace doesnt match the code you've given

#

oh wait

#

or furnace.getInventory() is null

#

what even is "furnace"?

#

a spigot blockstate furnace?

ocean hollow
#

custom block

tender shard
#

and what does getInventory() return? null?

ocean hollow
#

but when the block breaks, it is removed from the data. then why does this occur? Furnace must be null, and then there will be no error.

#

I delete Furnace itself, so the inventory in it should go with it.

tender shard
#

furnace is not null, furnace.getInventory() is null

ocean hollow
#

but how can it be null if I don't have a remove method.

eternal oxide
#

a block.getType() will never be null

ocean hollow
#

it's "broken", but it still works

daring musk
#

Hello everyone, how can I hide the health bar of the horse I'm sitting on?

rotund ravine
#

Press Left shift

young knoll
#

Big brain

#

The health bar is client side so you would need a mod/resource pack

misty ingot
#

is there a way to change the messages from acf? It says to enter one of (1,2,3,4,5,6...) but i want it to say "between 1 and ...")

#

in custom command completion contexts

#

i want it to say "Please specify a number between x and y"

#

cuz the list may get too long

rotund ravine
#

There probably is

misty ingot
#

i cant find anything on the wiki

young knoll
#

Yes

#

And?

indigo frost
#

jordan6131 — Today at 2:33 AM
ok so i need help with something. Let's say I make my plugin run an ingame command that returns text that gives a bunch of info on the player, and one of the infos is money: 1000 Is there a way to get this number? Ill give an example. Let's say I run a command from another plugin called /player <player> and it returns something like this in chat or console:
Player: <name>
Money: <value>
Time Played: <value>
etc...

I want to be able to get the money value by the return statement even if it's not in my plugin already. Essentially I want to parse info from the server log into a usable piece of data

eternal oxide
#

whatever plugin is providing that data likely has an API

vocal cloud
indigo frost
indigo frost
paper viper
#

In this episode, I give you a brief overview of what you can expect in this MC Plugin coding series. #Spigot #MCPlugins #PluginTutorial

Java Tutorial: https://www.youtube.com/playlist?list=PLfu_Bpi_zcDPNy6qznvbkGZi7eP_0EL77
How to Setup a Test Server: https://www.youtube.com/watch?v=58MZ4THF73g&ab_channel=KodySimpson

Discord: https://rebrand.l...

▶ Play video
vocal cloud
#

You literally say in your message "let's say I run a command from another plugin"

indigo frost
#

that was an example

#

to make what im asking for help with more clear

#

the first sentence doesn't say that

paper viper
#

@indigo frost the link i provided should be very helpfull

indigo frost
#

lol

hazy parrot
#

Your best bet is that another plugin is providing api, parsing data that yo don't know what would look like is bad idea

indigo frost
#

it's not a plugin

vocal cloud
#

What is it

indigo frost
#

it's cause it's a mod

hazy parrot
#

???

indigo frost
#

that's what makes it tricky

vocal cloud
#

Lmfao

indigo frost
#

so I want to parse from the console log

vocal cloud
#

No you don't

eternal oxide
#

What mod?

indigo frost
#

mine mine no mi

hazy parrot
#

Also don't know if it's possible to get result of command event, there always might be another message between you executing cmd and message appearing

#

So it would be pure guess

paper viper
#

he maybe could read the log

vocal cloud
#

No bad thestick

hazy parrot
vocal cloud
#

How about instead of trying to read the logs or whatever nonsense realize that the data has to be written to somewhere (probably the players NBT) and you can just read it yourself without needing the log

hazy parrot
indigo frost
#

I think it is in the player's nbt data actually

tardy delta
indigo frost
#

i didn't even think of that

vocal cloud
indigo frost
#

ur a genius ty

daring lark
#
        ItemMeta meta = item.getItemMeta();

        meta.addEnchant(enchantment, level, true);

        List<String> lore;

        if(meta.hasLore()) {
            Logger.log("ma");
            lore = meta.getLore();
        } else {
            Logger.log("nie ma");
            lore = new ArrayList<>();
        }

        lore.add(TextFormatter.color("&7".concat(loreDisplay)));
        meta.setLore(lore);

        item.setItemMeta(meta);
    }
    ```
why my lore is null even when it has some lines?
daring musk
sinful kiln
#

How would I write a comment for a CraftBukkit contribution that fixes a decompile and changes the access level of a field from private to public?
Currently I only have // CraftBukkit - decompile error there so instead should I use something like this: // CraftBukkit - decompile error / PAIL private -> public
Or how should I comment on that?

tardy delta
quiet ice
#

I'm impressed with them being able to generate a heapdump of that size

vocal cloud
#

Whoever wrote that code should be ashamed of themselves

tardy delta
#

is that 1.8GB of cfs lol

hazy parrot
#

its 16gb lol

twin venture
#

what would be the best way to handle saving itemstacks in config file?

#

yml , json, sql??

tardy delta
#

there is no best way

#

dunno how you would save sql in a config file but whatever

eternal oxide
#

also confusing question

tardy delta
#

geol would probably just make a binary file and throw them in

#

some people use base64, theres no best way

pure dagger
#

Im doing anty-logout plugin and i use BukkitRunnable to do a timer from 30 to 0, but i don't know how to cancel the Runnable from another class when player leaves or punches another player again or something. How am i even supposted to do it

#

i never used BukkitRunnable before

crude cobalt
#

Hello there, can I put a player on the armor rack and make it so that hp isn't visible?

orchid gazelle
vocal cloud
pure dagger
#

but i want to display the seconds left

vocal cloud
#

Again, using a HashMap

pure dagger
#

isnt it going to work like a player has from 30 to 29 seconds?

#

i mean that

vocal cloud
#

?

pure dagger
#

wait

vocal cloud
#

Every second you iterate through all the players, if they are within the HashMap you update w/e (scoreboard, message, etc).

#

You can schedule a bunch of runnables but that's 30 runnables/player

#

that you'd have to cancel

pure dagger
#

because they get it in the same second

vocal cloud
#

No? The runnable runs forever and all it does is checks their time in the map

limber acorn
#

How can i add a Worldborder to a world?

quaint mantle
limber acorn
pure dagger
#

i mean that player doesnt end his antylogout in exact 30 seconds but 30 runnables later

#

if i understand

quaint mantle
vocal cloud
pure dagger
#

yeah

#

that is what im talking about

quaint mantle
pure dagger
#

but isnt it gonna be laggy?

quaint mantle
vocal cloud
#

Compared to having hundreds if not thousands of runnables constantly queuing/de-queuing?

pure dagger
#

1/20ticks compared to 1/1ticks

vocal cloud
#

I mean you can do some mock tests. Just run it on the same player 100 times/t. Emulate it with fake data

#

most servers start to degrade around 200-300 players. So test it with that

pure dagger
#

yeah

#

what is actually a tick?

vocal cloud
#

50ms

pure dagger
#

i know that it lasts

#

50ms

#

but what is this

vocal cloud
#

It's how the entire game operates. Everything occurs at 50ms intervals

round finch
vocal cloud
pure dagger
#

oh

oak notch
#

why is there no boolean persistent data type?

tender shard
#

?morepdc

undone axleBOT
pure dagger
#

minecraft uses bytes

#

0b false 1b true

tender shard
#

yeah but couldn't hurt to have a native PDC type I guess

#

I talked to choco about it a few months ago

bold vessel
#

?paste

undone axleBOT
young knoll
#

What did chocolate say

tender shard
#

the crack cocaine smoker said that a boolean data type would be fine to add

#

then I said I'll pull request it and then I never did

#

I also wanted to pull request maps, collections etc, but people told me it wouldnt get merged anyway

#

so I instead bugged conclure to add ?morepdc instead

#

and here it is

#

?morepdc

undone axleBOT
twin venture
#

idk why this does not work (it should but its not.)

so i made a Storage system for players (Insted of normal EnderChest and only 27 slot , now there are 5 (can add more) types of storage)

so what a player can do is click on the one he have permission to access and add the items there
but here is the problem it does not save it

#

no erros and the class with the close event is registered.

#

and the file is created :

worn tundra
twin venture
worn tundra
twin venture
#

hmm?

worn tundra
#

That's the first tip

twin venture
#

alright

limber acorn
#

I am trying to create a new world, but the server keeps crashing.
Here is the code:
WorldCreator wc = new WorldCreator("BingoWorld" + worldNumber); wc.environment(World.Environment.NORMAL); wc.type(WorldType.NORMAL); world = wc.createWorld(); assert world != null; WorldBorder wb = world.getWorldBorder(); wb.setCenter(0,0); wb.setSize(2000);
Here is the error:
https://hastebin.com/share/jofokuzula.makefile

I would be thankful if somebody could help me.

tardy delta
#

cuz its done sync

orchid gazelle
dire marsh
#

pretty sure that's just delay between server and client?

dawn ledge
#

Hi, I have coded some plugin in 1.16 and lower with eclipse, but today i'm trying to code a plugin in 1.19.4 with eclipse but I failed to import org.bukkit.java.JavaPlugin can somebody know why i get The package org.bukkit is not accessible ?

orchid gazelle
#

I mean it looks pretty ugly and is not normal

remote swallow
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

dawn ledge
dire marsh
#

maven/gradle is a build tool

#

you can use eclipse just fine

remote swallow
#

you can, you just have to depend on a different jar

dawn ledge
#

ho ok, and how can i use gradle on eclipse ? 😅

remote swallow
#

@young knoll how do peopole gradle on eclipse

chrome beacon
#

You don't really need an IDE at all to use Gradle

dawn ledge
#

ok, i'll try to solve that ty and see you later

quiet ice
#

Using kotlin gradle as a build tool of yours is the best way to get rid of me

remote swallow
#

fuck kotlin gradle

#

that shit sucks

quiet ice
#

It probably is a lot nicer to groovy (especially decompiled groovy-compiled buildscripts are instant death), but eclipse doesn't recognise kotlin buildscripts

#

I guess we could use the gradle eclipse plugin but I think they got rid of it

orchid gazelle
#

use maven.

quiet ice
#

unfortunately maven is rather lackluster for more specialised tasks

vivid skiff
#

In witch cases is more optimal to use CompletableFeature in MySQL?

remote swallow
#

anytime you query or update the database

vivid skiff
# remote swallow anytime you query or update the database

But, is this what i should do for void methods?


        return CompletableFuture.supplyAsync(() -> {

            try (PreparedStatement statement = getConnection().prepareStatement("UPDATE " + SUBWAYDATA_TABLE + " SET subwayEnterButtonLoc = ? WHERE subwayName = ?")) {

                statement.setString(1, BasicFunctions.locationToString(location));
                statement.setString(2, subWay.getName());

                return statement.executeUpdate();

            } catch (SQLException | ClassNotFoundException e) {
                throw new RuntimeException(e);
            }

        }, MetroSubway.getInstance().getCustomLoader().getDatabaseExecutor());

    }```
remote swallow
#

CompletableFuture<Void>

#

and then you dont need to return anything

vivid skiff
# remote swallow CompletableFuture<Void>

And when i call it is correct to do this

                if (throwable != null) throwable.printStackTrace();
            }).thenAccept(integer -> {
                MetroSubWayData.reloadSubWayInCache(StationCreateCommand.getStationCreator().get(player.getUniqueId()).getName(),  StationCreateCommand.getStationCreator().get(player.getUniqueId()));
            });```
remote swallow
#

idk why you have a whenComplete then a thenAccept

#

handle both in the whenComplete

vivid skiff
# remote swallow idk why you have a whenComplete then a thenAccept

Its correct like this?

public CompletableFuture<Void> setSubWayEnterButtonLoc(SubWay subWay, Location location) {

        return CompletableFuture.supplyAsync(() -> {

            try (PreparedStatement statement = getConnection().prepareStatement("UPDATE " + SUBWAYDATA_TABLE + " SET subwayEnterButtonLoc = ? WHERE subwayName = ?")) {

                statement.setString(1, BasicFunctions.locationToString(location));
                statement.setString(2, subWay.getName());

                statement.executeUpdate();

            } catch (SQLException | ClassNotFoundException e) {
                throw new RuntimeException(e);
            }

            return null;
        }, MetroSubway.getInstance().getCustomLoader().getDatabaseExecutor());```
remote swallow
#

yeah

#

then you only have to handle exceptions

vivid skiff
remote swallow
#

if its async the server shouldnt crash

grim oak
#

Hi, I'm looking at developing a boss plugin, is anyone able to suggest a few open source boss plugins or plugins with custom enemies that are well made which I can look at for inspiration. I wanna see particular uses, like where developers have given mobs or bosses particular attacks that are unique, and uses of particle effects.

quaint mantle
mossy gazelle
#
public void saveElection() {
        try {
            // Serialize election ArrayList to JSON
            String electionJson = gson.toJson(election);

            // Write the JSON to file
            Writer writer = Files.newBufferedWriter(electionFile);
            writer.write(electionJson);
            writer.close();
        } catch (IOException e) {
            // Log the exception
            logger.warning("Error saving election: " + e.getMessage());
            e.printStackTrace();
        }
    }

Error: Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private java.lang.Object java.lang.ref.Reference.referent accessible: module java.base does not "opens java.lang.ref" to unnamed module @30e85cb1

#

Tryed updating java

chrome beacon
vocal cloud
#

?paste it

undone axleBOT
vivid skiff
#

Should i use CompletableFeature for INSERT to?

chrome beacon
remote swallow
#

anything that interacts with the db should get a async future

chrome beacon
#

Or any web requests

mossy gazelle
quiet ice
#

For INSERT I'd not use CF if possible

chrome beacon
tardy delta
#

elaborate

quiet ice
#

At best a non-blocking void method should be used but chances are it is going to use a CF under the hood

chrome beacon
#

wait nvm

#

That's a list of players

mossy gazelle
#
package Me.Sebbe.President.Commands;

import java.util.ArrayList;
import java.util.List;

public class Election {
    private List<String> players = new ArrayList<>();

    public List<String> getPlayers() {
        return players;
    }

    public void addPlayer(String player) {
        players.add(player);
    }

    public void removePlayer(String player) {
        players.remove(player);
    }
}

chrome beacon
#

It's not going to work

tardy delta
#

i use a cf for inserts to just notify the user the operation succeeded

chrome beacon
#

You'll need to serialize the players on your own

vocal cloud
#

Oh my it's literally a giant file

#

😭

chrome beacon
#

For example store their uuids

tardy delta
#

removing a string player hmm

vivid skiff
chrome beacon
#

Don't store the entire player

vocal cloud
#

sqlite rolling in it's grave

mossy gazelle
#

So insted of cheking for name I should check for there uuid?

vocal cloud
#

request timed out after 30003ms 👀

vivid skiff
eternal night
#

are you properly returning your sql connections to the pool ?

#

e.g. closing them after using them

tender shard
#

are you not using hikari or similar?

vivid skiff
vivid skiff
eternal night
#

not statement, the connection

vivid skiff
eternal night
#

you have to close a connection you grab from the hikari pool

#

that is what releases them back into the pool

remote swallow
#

you do?

tender shard
eternal night
#

yes

tender shard
#

if you keep using futures for everything, you don't have to worry

#

(well unless you need that data "right now", ofc lol)

vivid skiff
eternal night
#

also call #close

#

but on the connection

tender shard
#

you are not supposed to close anything yourself, EVER

#

use try-with-resources

eternal night
#

that only works with auto closable

#

you can certainly close things

tender shard
#

try(MyAutoClosable ...)

#

^

keen berry
#

hello when i connect the hub to proxy chat ''goes off'' when its not connected it works someone knows how to fix?

tardy delta
#

id abstract the futures away from the actual impl but whatever nobody listens anyway

tender shard
#

looks ok to me

vivid skiff
#

Ok, thank u 🙂

#

Is all day im tring to fix it

mossy gazelle
#

Sorry, still pretty new to this

vivid skiff
#

But it is a good idea to save a list has id1,id2,id3 in a database to after split it and put in a List?

quaint mantle
vivid skiff
eternal night
#

you don't want to be splitting data in your DB

#

that kinda goes against the concept of having a proper DB

keen berry
dreamy mulch
#

Hello. Where I can find bukkit libs?

keen berry
#

what is bro writing

mint nova
#

and click first link

dreamy mulch
#

Is the Spigot API now a Bukkit API?

vocal cloud
#

The spigot API contains the Bukkit API

keen berry
#

im scared what mfnalex is writing..

dreamy mulch
#

Is there a clean Bukkit somewhere?

vocal cloud
#

I'm sure at your local Home Depot

mossy gazelle
vocal cloud
mossy gazelle
#

I get that

keen berry
#

hello when i connect the hub to proxy chat ''goes off'' when its not connected it works someone knows how to fix?
its bungee 100% cuz it works with bungee off

dreamy mulch
echo basalt
#

uhh

echo basalt
#

there was a command for this

#

?spigot

#

maybe

#

idfk

#

?dmca

undone axleBOT
dreamy mulch
vocal cloud
#

😭

#

You really don't want to do that

remote swallow
#

you most likely cant do that without serverside access

dreamy mulch
#

Any problems? I already did it on 1.7.10 and 1.12.2, now I'm only stopped by the lack of pure Bukkit on 1.16

remote swallow
#

pure bukkit exists

#

just no impl

mossy gazelle
remote swallow
#

its all on stash now

dreamy mulch
echo basalt
#

mans got no idea

dreamy mulch
# worldly ingot https://tenor.com/view/cat_what-gif-24016535
    static {
        Method getBukkitEntityMethod = null;
        try {
            getBukkitEntityMethod = Entity.class.getDeclaredMethod("getBukkitEntity", (Class<?>[])new Class[0]);
            getBukkitEntityMethod.setAccessible(true);
        }
        catch (Throwable throwable) {
            throw new RuntimeException(throwable);
        }
        getBukkitEntity = getBukkitEntityMethod;
    }```

```java
    @Nonnull
    public static org.bukkit.entity.Entity getEntity(@Nonnull final Entity entity) {
        try {
            return Objects.requireNonNull(BukkitUtils.getBukkitEntity.invoke(entity, new Object[0]), "Entity.getBukkitEntity() result must not be null");
        }
        catch (IllegalAccessException | InvocationTargetException e) {
            throw new RuntimeException(e);
        }
    }```
U can use reflection to convert Forge entity to Bukkit entity. That function from CraftBukkit. Nothing limits you to call bukkit events in the same WorldGuard, if you need to make compatibility with it
#

Questions?

quiet ice
#

Also there is no "clean" bukkit anymore

dreamy mulch
#

I don't need any additional library to call reflection

#

On the ForgeBukkit Server that method is available

quiet ice
#

That bukkit died alongside with the bukkit project and is a relic of a past long bygone. While spigot continued to ship them until 1.16 or something I wouldn't use it in the first place.

The next best thing is the spigot-api

quiet ice
dreamy mulch
#

No, but I am the technical administrator of the project

shrewd solstice
#

itemFrame.teleport() does not work

tawny remnant
#

Problem with creating unique ItemStacks. I'm trying to create a backpack system but I can't figure out how to get the ItemStack unique every time. Can anyone please help?
https://paste.md-5.net/ekavecuxiy.cs

quiet ice
#

Because chances are a checkcast works just as well

dreamy mulch
#

I don't integrate it into the core. Its modification

#

The modification just allows you to use the full Bukkit from Forge

quiet ice
#

I'd still do it as a coremod

#

Sure, perhaps not full MCP style like other projects do it - but also not as a plain mod

young knoll
#

All the mixins

quiet ice
#

Runtime class generation too!

dreamy mulch
#
        @Override
        public boolean cantBreak(@Nonnull PlayerEntity player, @Nonnull BlockPos pos) {
            Player bukkitPlayer = BukkitUtils.getPlayer(player);
            Block block = bukkitPlayer.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ());
            BlockBreakEvent event = new BlockBreakEvent(block, bukkitPlayer);
            Bukkit.getPluginManager().callEvent(event);
            return event.isCancelled();
        }```Usage example for WorldGuard (or other) compatibility. If some mod can break blocks in region - this method will help
quiet ice
#

That reminds me: Have fun with the material enum!

echo basalt
#

I'd just implement the bukkit interfaces and redo all the logic myself honestly

chrome beacon
dreamy mulch
#

Yes, it is possible, but practice has not yet shown any problems

chrome beacon
#

That code is just a bad idea

#

It's fine if you know how every installed plugin works

#

but if you don't then don't use that code

dreamy mulch
#

We have been creating servers for over ten years, we know where we are going

chrome beacon
#

That was a warning. I'm not here to argue

#

You do you

dreamy mulch
#

I`m not trying to be aggressive, discussion in similar topics is normal

shrewd solstice
chrome beacon
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.

shrewd solstice
#
i2.setItem(new ItemStack(Material.STONE));
i2.teleport(new Location(i2.getWorld(), 0, 0, 0));```
shrewd solstice
#

so%

#

?

river oracle
#

I have an API I'm providing multiple database support to, however it seems Class#forName is a bad way to load them this is my structure I say Class#forName is bad because of the easy possibility of injection. If its not a huge deal I suppose I could throw caution to the wind and just go with my current setup
Raven
|-> api
|-> core
|-> database-providers
|-> MongoDB
|-> MySQL

Each database-provider has an entry class

young knoll
#

Hwoev

round finch
#

hwoey

river oracle
#

dw guys

sullen marlin
#

injecting what lol

#

are players choosing their database driver lol

young knoll
#

You shouldn’t need to inject anything

river oracle
#

tbf though it is java you can inject code anywhere

#

so probably not a huge deal

keen berry
#

he y how do ifix chat off in the hub?

river oracle
#

I already told you its likely a plugin interfering bungee doesn't natively fuck with your chat like that

#

if it still occurs with all plugins gone make a report on the jira

keen berry
#

i tryed with no plugins on

keen berry
river oracle
#

thats your job not mine

#

did your spigot server have no plugins as well?

remote swallow
#

u forgot

#

ur pink, now ur staff

river oracle
#

because both would need no plugins to verify its actually a spigot/bungee issue

keen berry
#

all servers work exept the hub

river oracle
#

both hub and bungee had 0 plugins? and chat was broken?

#

if so make a report

#

?jira

undone axleBOT
keen berry
#

ooh wait 1min the hub ye proxy no ill try

river oracle
#

wait

#

bungee is on github

keen berry
#

if it aint work ig ill make it

river oracle
#

I forget