#help-development

1 messages · Page 1185 of 1

nova notch
#

because it has an age?

#

the real question is why is fire Ageable 💀

summer scroll
#

wtff

lilac dagger
#

i think it's because it goes out if it can't keep up?

#

like a getTicksToLive

#

i think this is it

#

just a different naming scheme

sly topaz
#

it affects how it interacts with flammable blocks

nova notch
#

huh, neat

sly topaz
#

embed doesn't take into considerion text selector in url, shame

nova notch
#

you know that just made me realize, someone went through the vanilla code just to find out how age affects fire for the wiki page

sly topaz
#

I recently learned about that being a thing

#

I mean, yeah, that is the case for the majority of the wiki lol

nova notch
#

its just so oddly specific

lilac dagger
#

super cool

sly topaz
#

instead of linking to an anchor, you can link to a specific text fragment by defining a start and end, and it'll automatically jump there as well as highlight the text

#

chrome browsers have the copy link to selected text option in the context menu

grand timber
#

Euh, wtf?

Exception: java.sql.SQLException: Column count doesn't match value count at row 1

Code:

public void createPlayerAchievement(Player p, EAchievements achievements) {
        if (!achievementExists(p, achievements)) {
            try (Connection connection = Database.getConnection()) {
                String query = "INSERT INTO survival_" + p.getName() + "_achievements" +
                        "(achievement_id, " +
                        "achievement_name, " +
                        "achievement_type, " +
                        "achievement_total," +
                        "achievement_achieved) " +
                        " VALUES " +
                        "('" + achievements.getID() + "', " +
                        "'" + achievements.getName() + "', " +
                        "'" + achievements.getAchievementType().getName() + "', " +
                        "'" + achievements.getTotal() + "'" +
                        "'" + 0 + "')";
                try (PreparedStatement insert = connection.prepareStatement(query)) {
                    insert.execute();
                    insert.close();
                    connection.close();
                }
            } catch (SQLException e) {
                Logger.DATABASE.log("PlayerAchievementsData:createPlayerAchievement", e);
            }
        }
    }

What is here wrong?

slender elbow
#

are you doing one table per player? :monkaW:

lilac dagger
#

i think your table creates less or more columns that what your insert attempts to

grand timber
#

Lmfao, found the problem, missed a ','...inflatable

lilac dagger
#

yeah, that could be also

#

but there's a better way to do this

#

use the prepared statement and ?

#

and set positions

grand timber
#

How?

lilac dagger
#

this will clean up your query

#

making it more visible

grand timber
#

Yeah, thats indeed cleaner.

lilac dagger
#

your prepared statement has these

#

you also don't need to specify the columns

grand timber
#

No?

lilac dagger
#

i think you can't have same table name with different column count

#

no as you can see the table name is sufficient

grand timber
#

Oh, thank you for the tips!

lilac dagger
#

no problem

#

happy coding

grand timber
#

Thank you!

young knoll
#

@worldly ingot ur smort, why does loading that first chunk cause the server to suffer

Void world, keep spawn in memory false, fixed spawn location

nocturne jasper
#

How do I display particles in 1.21?

river oracle
#

Outside of particle names which have been aligned with NMS this system has been largely unchanged for years

restive mango
#

Anyone know what might cause a recipe to not work until you've reloaded the plugin?

nocturne jasper
#

player.spawnParticle(Particle.FLAME,player.getLocation(),1);
Why am I getting the error Unable to resolve symbol 'Particle' with this code?
It works in 1.20.1, but in 1.21 I get this error.

buoyant viper
#

?jd-s

undone axleBOT
buoyant viper
#

huh, it exists

#

idk then

restive mango
#

AUGH

#

THIS IS AGONY

river oracle
restive mango
#

EVERY OTHER RECIPE WORKS

#

WHY NOT LEATHER

river oracle
#

Ensure you're on java 21

restive mango
#

i am

#

it's not that

#

it's something else

#

like

#

i have other recipes which work on startup

#

but for some reason these leather ones dont

river oracle
#

you spoke in the middle of me replying to somoene else

restive mango
#

o

ancient plank
#

silly aeso

restive mango
#

@ancient plank ADELE

#

solve my problem

#

idk why it's only an issue now

#

in 1.20 it wasnt

ancient plank
#

I'm in bed

restive mango
#

😦

river oracle
#

@ancient plank fix my life please!

ancient plank
quaint mantle
nocturne jasper
#

How do I display particles in a straight line between two points?

mellow edge
#

Raycast (or even easier cannot you specify the delta coordinates?)

buoyant viper
#

a little sine and cosine never hurt anybody

mellow edge
sullen marlin
#

Lol

#

Google parametric equation of a line

nova notch
#

why on earth would you need trig to get a vector between 2 points

lilac dagger
#

and add the vector to one of the location for one of the point

lucid anchor
#

help me fix it, I don’t understand why they sound at all + there are also these errors, here’s the recordinghttps://drive.google.com/drive/folders/1m5nlADysv9jjDq08MDgF7T6jkuoJvAvM?usp=drive_link

idle condor
#

im trying to restore blocks that have been changed to their original but double chests and stairs etc have problems such as not being a double chest anymore and just 2 seprate chests or stairs not being connected correctly can someone help me

        Location center = player.getLocation();
        World world = center.getWorld();
        List<Block> affectedBlocks = new ArrayList<>();
        int radius = 10;

        for (int x = -radius; x <= radius; x++) {
            for (int z = -radius; z <= radius; z++) {
                double distanceSquared = x * x + z * z;

                if (distanceSquared <= radius * radius) {
                    for (int y = -radius; y <= radius; y++) {
                        Location blockLocation = center.clone().add(x, y, z);
                        Block block = world.getBlockAt(blockLocation);

                        if (block.getType() == Material.AIR || block.getType() == Material.WATER) {
                            continue;
                        }

                        if (!originalBlocks.containsKey(block)) {
                            originalBlocks.put(block, block.getState());
                        }

                        Material newMaterial = new Random().nextBoolean() ? Material.BROWN_CONCRETE : Material.BROWN_WOOL;
                        block.setType(newMaterial);

                        affectedBlocks.add(block);
                    }
                }
            }
        }

        Bukkit.getScheduler().runTaskLater(this, () -> {
            for (Block block : affectedBlocks) {
                if (block != null && originalBlocks.containsKey(block)) {
                    BlockState originalState = originalBlocks.get(block);
                    if (originalState != null) {
                        originalState.update(true, false);
                    }
                }
            }
            originalBlocks.clear();
        }, 140L);
    }```
hushed spindle
#

are you also saving the block data

#

afaik state isnt enough

idle condor
#

no i don't think i am

#

mb thats an old code let me send the new one

idle condor
#

can you upload files here?

drowsy helm
#

if you verify

hushed spindle
#

gotta be verified i think

idle condor
#

where do i verify

drowsy helm
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

idle condor
#

alr i think im verified now

#

alr here is the code that im using to both change the blocks and restore
but unfortunantly it won't work

vast ledge
#

Please use

#

?paste

undone axleBOT
idle condor
idle condor
hushed spindle
#

i recommend getting verified and uploading the video directly or uploading it on youtube

hushed spindle
#

so you should set the block state's material and data instead of the block's

idle condor
#

hmm

#

let me see what i can do

hushed spindle
#

simply edit your restore() method to use the state instead of block

idle condor
#

all fixed ty!

sly topaz
#

if not, can you upload the region data somewhere, I want to try and profile it

#

my assumption is that it is doing some unncessary IO but could be wrong

echo basalt
#

probably has to load the first region into memory

#

and that needs io

#

it also has to decompress it most likely

sly topaz
#

they said they disabled keep spawn in memory tho

echo basalt
#

add jvm warmup

#

exactly so it's not loaded

young knoll
#

I added a counter and can confirm it’s only loading that one chunk

#

Shouldn’t have to do any IO reads since it’s a fresh world

merry cove
#

what is the best way to delete the main world? am making a version system where it will clean up most plugin data for players and worlds selected and backs it up so I can easily just start a new season on the server. just dont' see a good way of deleting the world map and regenerating it by code?

#

I know how to actually remove it, but do I do it when the server shutsdown or pre generation?

sly topaz
#

just onDisable should be fine

echo basalt
#

onDisable gets fired before the chunk system finishes writing

sly topaz
#

you can just force it to be called by calling unloadWorld no?

merry cove
#

how would the server like unloading the "main" world?

echo basalt
#

the IO is still done async

#

even after unloadWorld finishes

#

especially with paper

echo basalt
#

maybe

merry cove
#

Could regenerate a different worlds and keep the "main" world til the end I guess

young knoll
#

You can’t unload the main world on spigot at least

#

It’ll just tell you off

merry cove
#

can I catch it before it loads and regenerate it somehow then?

young knoll
#

Maybe

#

If you use load: STARTUP

#

And the onLoad method

sly topaz
#

does it allow to remove all the world generators at that stage I wonder

#

I imagine you could do it at world init event if anything

young knoll
sly topaz
#

what can I do to reproduce it

#

just load a fresh world and see how much the first chunk load takes?

merry cove
#

I mean in theory is there a way to change the properties settings which won't take affect until server restart? by generating a new world and just changing the world name in the settings file?

young knoll
#

Pretty much

#

I can probably get you some code, one sec

young knoll
sly topaz
#

alright I'll try it out

sly topaz
young knoll
#

ring position is strongholds

sly topaz
#

I didn't change anything from the command you sent, so why is it trying to generate strongholds lol

young knoll
#

No idea

#

Can you /locate one in the world

sly topaz
#

I'd have to join the server, sec

inner mulch
blazing ocean
inner mulch
blazing ocean
#

you would need to run CB main as an application run config

#

and I believe it's only in ultimate

smoky anchor
#

I think JFR can do this too

blazing ocean
#

:shrug: only ever used spark, tracy and IJ

inner mulch
#

okay thank you guys

blazing ocean
sly topaz
#

but you can do most of this with jfr or spark as the others said, jprofiler is just fancier

blazing ocean
#

I like IJs

#

have not used JFR or JProfiler themselves before

sly topaz
#

most profilers have a jfr mode nowadays, since it is more lightweight for general sampling

#

so you're only using it under the hood 😛

inner mulch
#

ok

#

thank you guys

sly topaz
young knoll
#

Tf

#

What kind of magic

dapper flower
#

i am executing a method async, how do i switch to the sync thread, fire an event, and supply the even to continue the async execution?

sly topaz
#

if you don't, then to go back to the main thread you'd have to schedule a task with the bukkit scheduler inside your async task

#

that is BukkitScheduler#runTask

#

now, the issue is that you want to wait for the task to finish before continuing your async task, you'd have to make a completable future and complete it inside your runTask

young knoll
#

There's also callSyncMethod

sly topaz
#

don't those do the same thing

young knoll
#

It returns a future

sly topaz
#

ah, that's convenient

dapper flower
sly topaz
dapper flower
sly topaz
#

it is in BukkitScheduler

dapper flower
sly topaz
#

and you just do Bukkit.getScheduler().callSyncMethod(yourPlugin.instance(), SomeClass::someMethod)

sly topaz
#

?whereami

dapper flower
#

Yeah i wanted to keep compatibility with spigot too that is why am here

#

On paper i just get the executor as there is a method for it and use that but on spigot it doesnt seem as intuitive

sly topaz
#

I mean, you can just create the executor, it is the same

dapper flower
#

I can just create a bukkit main thread executor? Wdym

sly topaz
#
public static final Executor MAIN_THREAD_EXECUTOR = task -> Bukkit.getScheduler().runTask(YourPlugin.instance(), task); 
dapper flower
sly topaz
#

you'd be able to pass that to whenCompleteAsync or thenAcceptAsync so yeah, I guess

dapper flower
#

Ty

worldly ingot
#

Please don't execute the main thread :( we need it

sly topaz
#

too bad choco, I need my futures

grand timber
#

I want to continue my progress where it left off after completing one achievement, but I can't get it done?

Code

public void setOldProgress(int value) {
        try (Connection connection = Database.getConnection()) {
            try (PreparedStatement select = connection.prepareStatement("UPDATE survival_" + player.getName() + "_achievements SET achievement_progress=? WHERE achievement_id=?")) {
                select.setInt(1, getProgress() + value);
                select.setString(2, achievements.getID());

                select.execute();
                select.close();
                connection.close();
            }
        } catch (SQLException e) {
            Logger.DATABASE.log("PlayerData:addOldProgress", e);
        }
    }

Setting progress:

if (pAData.getProgress() < 6 && !pAData.isAchievementAchieved()) {
                pAData.setOldProgress(0);
                killMobManager.progressAchievement(total5, entity.getName());
                if (pAData.getProgress() == 5) {
                    String title = FormatUtil.color("&c&lBEHAALD!");
                    String subTitle = FormatUtil.color("&c&lAchievement '" + pAData.getName() + "' behaald!");
                    int fadeIn = 20; // Tijd in ticks voor fade-in (1 seconde = 20 ticks)
                    int stay = 40;
                    int fadeOut = 20;

                    sendTitle(player, title, subTitle, fadeIn, stay, fadeOut);
                    playFireworkAtLocation(player);
                    pAData.setAchievementAchieved(1);
                }
            }
```these works fine, but when it comes to this code:
#
else if (pAData1.getProgress() < 10 && !pAData1.isAchievementAchieved()) {
                pAData1.setOldProgress(5);
                killMobManager1.progressAchievement(total10, entity.getName());
                if (pAData1.getProgress() == 10) {
                    String title = FormatUtil.color("&c&lBEHAALD!");
                    String subTitle = FormatUtil.color("&c&lAchievement '" + pAData1.getName() + "' behaald!");
                    int fadeIn = 20; // Tijd in ticks voor fade-in (1 seconde = 20 ticks)
                    int stay = 40;
                    int fadeOut = 20;

                    sendTitle(player, title, subTitle, fadeIn, stay, fadeOut);
                    playFireworkAtLocation(player);
                    pAData1.setAchievementAchieved(1);
                }
            }
```it sets the progress instantly on `12`, en then go to then next achievement goal.
sly topaz
grand timber
#

What?

blazing ocean
sly topaz
# grand timber What?

if you are using prepared statements, then you should be using ? for any placeholder there

blazing ocean
#

got it in higher quality

#

nvm

#

it's just discord compressing the previews?

sly topaz
#

it is

blazing ocean
#

smh

#

i even made a lil vencord plugin for xkcd

sly topaz
#

if you click on it, it shows properly, discord hates wide images

sly topaz
#

oh wait you have a table with a player name on it

#

that's crazy

#

well, sorry for derailing without checking properly lol

grand timber
#

Yes, the reason for that is the server will only have 2/3 players, and there are so many achievements that otherwise it would be a mess.

grand timber
sly topaz
#

I'll delay a little more though: you shouldn't be doing database requests on the main thread

#

it'll kill performance

grand timber
#

How then?

chrome beacon
#

If you're on Java 21 use virtual threads

grand timber
#

How? Never used that.

chrome beacon
#

Explains what they are and how to use them

blazing ocean
#

kotlin coroutines :)

#

wrong emoji kek

#

olivo you can't 🔫 me before you finish inject-javalin and -spring 🔫

#

man

sly topaz
#

what virtual threads, just use BukkitScheduler#runTaskAsynchronously smh

chrome beacon
#

That would be blocking for no reason

blazing ocean
#

wow fabrics maven is incredibly slow

sly topaz
#

it wouldn't block anything, it is async lol

grand timber
#

Where am i needed threads for?

chrome beacon
sly topaz
chrome beacon
#

yes

#

Virtual threads are perfect for IO and should be used when possible

sly topaz
#

and the guy said there will be 3 players or so, I don't think we need to worry about that

grand timber
#

Exactly!

#

The performance for this server doesn't matter tbh

chrome beacon
#

if it's 3 users why even bother with a database

sly topaz
#

that's a good point actually lmao

grand timber
#

Soo, can you now help me with my actually problem? uwu

chrome beacon
#

no idea what your problem is

sly topaz
#

does getProgress also do a query to the database to get the current progress, or does it get it from memory?

grand timber
#

Database

lilac dagger
chrome beacon
#

using Java 17 smh

lilac dagger
#

i could use jdk 21

#

but it's a minor need for me right now

sly topaz
chrome beacon
#

Only way to make something well known is to give people the information

sly topaz
#

there isn't much of a difference between a virtual thread and spigot's async scheduler for this kind of usage anyway

chrome beacon
#

Usage isn't much different but the result is

sly topaz
#

the result definitely isn't, these are one-off requests, the spigot's thread pool would suffice for it

lilac dagger
#

yeah, the only difference is that a virtual thread has its own stack and can pause the thread anywhere to give the ticket to another virtual thread no?

chrome beacon
#

not that it's a good idea

sly topaz
#

I agree, hence why run task asynchronously is the better idea

slender elbow
#

also VTs aren't magical, they are still backed by a normal thread that at some point has to block too, you aren't taking advantage of them unless you're doing more than, like, 8 concurrent IO requests

chrome beacon
#

ofc they aren't magical

lilac dagger
#

i saw a gif of memory usage to virtual threads and to me it looks pretty good

sly topaz
#

I'd agree more if the structured concurrency API was out, however without that it is pretty much just a matter of preference

slender elbow
#

what does memory usage have to do with it lol

chrome beacon
lilac dagger
#

it was like 1000 threads vs 1000 virtual threads and there were also other language versions of these were applicable

sly topaz
#

but this won't scale, that's the thing. So why give the user the mental overhead of learning what the heck a virtual thread is

chrome beacon
#

It's like 3 lines of code

harsh ruin
#

how to change scale of display entity in my plugin ?

grand timber
#

This does not solve the problem. 🤣

lilac dagger
#

so far i use normal threads for my sockets

chrome beacon
harsh ruin
lilac dagger
#

there's like a vector 4

chrome beacon
#

It's the 3rd value of the Transformation object

#

and it's a vector3

lilac dagger
#

one of the coords is for scale

#

ah vector 3?

sly topaz
#

multiply the vector by a scalar

lilac dagger
#

why do i know about vector 4?

chrome beacon
smoky anchor
# harsh ruin

look at what argument that method takes..
its Transformation
So you get the transformation from your current display entity, change it and set that

chrome beacon
#

You were thinking of Matrix4

lilac dagger
#

oh, this is why

#

i saw people sharing the quarternion

harsh ruin
#

can you write an example with a scale 10

#

i don't understand this documentation

smoky anchor
#

Then you better learn in

chrome beacon
#

Quite literally give it a vector3f with the values 10 10 and 10

#

(for the scale value in the Transformation constructor)

lilac dagger
#

what does it happen when these 3 vary independently?

chrome beacon
#

They're x y z scale

lilac dagger
#

ohh

#

yeah this makes sense

chrome beacon
#

You can use the link above I sent to visualize it

sly topaz
#
var transformation = itemDisplay.getTransformation();
transformation.getScale().mul(3);
itemDisplay.setTransformation(transformation);
#

it was either mul or multiply

#

@smoky anchor

#

I had connection issues just as I was answering so it took me too long lmao

harsh ruin
#

pls I read the documentation, try lots of ways and it's still an error, can you just write me an example and I will understand much better

sly topaz
#

accidentally mentioned steve instead of you

harsh ruin
sly topaz
#

var is a java 11 keyword

#

are you not using java 11+?

harsh ruin
#

17

#

i mean

sly topaz
#

are you targeting against 8 for the bytecode?

#

well anyway, just change var for the appropriate type

#

but you should be ultimately using and targeting java 21 if you are targeting 1.20.6+

harsh ruin
#

thx it's work

restive mango
#

For some reason

#

Recipes which produce leather armor don’t work

sly topaz
#

they're transmute recipes now aren't they, maybe something changed in that regard

#

still, if you added new recipes at runtime, you gotta do minecraft:reload for the player to recognize them iirc

restive mango
#

Usually they work

#

Just for whatever reason

#

Recipes that produce leather armor don’t

#

It’s fine bc I interrupted craftitemprepare anyway

young knoll
#

Spark doesn't seem to have proper mappings for 1.21.3 :c

blazing ocean
#

paper

#

runs

inner mulch
#

an interfaces method (from reflection) cant ever be not accessible right?

#

as they are forced to be public?

wet breach
#

if they weren't public, kind of defeats the purpose of the interface

chrome beacon
#

No private methods in interfaces

inner mulch
#

okay

lilac dagger
#

it's a contract

#

a contract is visible to any party

#

an abstract class on the other hand is completely different

#

it's a skeleton of sort

#

i can't think of all the ways to use it

young knoll
#

Blah

#

Surely I can just request that the server load/generate a bunch of chunks and have it get back to me when it’s done

#

Without it killing the main thread

glossy laurel
#

I have source code that has all imports from remapped paths(?), how do I compile souch code

glossy laurel
#

Oh no..

blazing ocean
#

what

river oracle
young knoll
#

That’s not helpful

#

You spoon

blazing ocean
#

🥄

river oracle
young knoll
#

I mean vanilla does it

remote swallow
young knoll
#

When you explore the server doesn’t die as it waits for new chunks to generate

#

Mostly

blazing ocean
#

yes it does

#

(on my raspberry pi)

cedar summit
#

How can I set a player attribute for a single Minecraft world?

#

I want the players to have generic.scale set to 0.1 only in one world

young knoll
#

You’ll have to monitor them entering and leaving the world

timid berry
#

for (ItemStack item : player.getInventory().getContents()) {
ArrayList lores = new ArrayList<>();
lores.add("line one lore?");
item.getItemMeta().setLore(lores);

        }

i know for the lore to add, I would have to replace the item with the edited version

#

but im not sure how to do that if im looping through their inventory

chrome beacon
#

No need to replace the item

timid berry
#

so my code is enough?

chrome beacon
#

No

#

getItemMeta returns a copy

#

You need to set it back again

timid berry
#

i see

#

for (ItemStack item : player.getInventory().getContents()) {
ArrayList lores = new ArrayList<>();
lores.add("line one lore?");
ItemStack itemtwo = item;
itemtwo.getItemMeta().setLore(lores);
item.setItemMeta(itemtwo.getItemMeta());
player.getInventory().addItem(item);

        }
#

like this?

chrome beacon
#

No

#

Think about it for a second

timid berry
#

forget about the add item part

#

i create a copy of current item

#

set that lore i want to the copy

#

set items meta to the meta of the copy

#

?

young knoll
#

(And refuse to learn)

timid berry
#

buddy

#

i know java

#

java tutorials dont teach you

#

how itemstacks work

#

🤦

young knoll
#

If you knew java you’d understand you aren’t even creating a copy of the item there

chrome beacon
#

I have them blocked with a note

#

just can't help myself to respond anyway 💀

timid berry
#

bro same

#

well not you blocked

#

but that

#

one

#

bot

#

" ItemStack itemtwo = item;"

#

is this not creating a copy of the item

chrome beacon
#

Bro blocked the tutorial bot

#

instead of learning java 💀

timid berry
#

i know java

#

they dont teach u item stack

#

or spigot

#

🤦

chrome beacon
timid berry
#

yes i do

young knoll
#

They do teach you how references work though

chrome beacon
#

^^

chrome beacon
#

and that's just basic Java

#

(copying part)

timid berry
#

the left side creates a copy of the right

chrome beacon
#

It does not

sly topaz
#

that doesn't create a copy of the object, it creates a reference

#

that means it is just pointing to the same object in memory

pseudo hazel
#

ItemStack itemtwo = item; // the value of itemtwo and item are both the exact same data in the computer

#

iirc this is only not the case for primitive types

shadow night
pseudo hazel
#

but I dont remember if java works that way too

timid berry
shadow night
sly topaz
#

again, this is all very basic programming knowledge, you'd have learnt this by just doing the jetbrains academy course

#

I am unsure why you are so unwilling to just go and learn it instead of struggling through it, it is just a waste of everyone's time

shadow night
timid berry
#

Yah I know how types work but I was not aware that’s not how copying works

#

Thanks for the Info

#

*info

shadow night
#

To copy, you either have it be a cloneable type and .clone() it, otherwise you could for example serialize and deserialize, manually transfer all values or use reflection

#

Tbf this is quite basic java knowledge

timid berry
#

for (ItemStack item : player.getInventory().getContents()) {
ArrayList lores = new ArrayList<>();
lores.add("line one lore?");
ItemStack Itemtwo = item.clone();
Itemtwo.getItemMeta().setLore(lores);
item.setItemMeta(Itemtwo.getItemMeta());
player.getInventory().addItem(item);

        }
#

is this it?

chrome beacon
#

no

sly topaz
#

it'll just keep being the same, some bored person will come and try to explain concepts as best as they can till they get tired of it, and the next person comes

timid berry
#

Aight whatever I’ll stop

pseudo hazel
#

the double getItemMeta kills me on the inside

#

and outside

sly topaz
#

we've all done that at some point tbf lol

pseudo hazel
#

yeah true

#

but seeing this now I know why its bad api

sly topaz
#

it isn't necessarily bad, just not something you'd expect to have a performance penalty I guess

#

the naming could be better, but we're way past the point that could've been changed

pseudo hazel
#

yeah fair xD

#

like 8 years past

timid berry
#

ArrayList lores = new ArrayList<>();
lores.add("line one lore?");
ItemStack Itemtwo = item.clone();
Itemtwo.getItemMeta().setLore(lores);
item = Itemtwo.clone();

#

guys im actually so confused

#

how do i apply it back?

chrome beacon
#

Still no

#

setItemMeta

timid berry
#

item.setItemMeta(Itemtwo.getItemMeta());

#

?

chrome beacon
#

No

sly topaz
#

ItemMeta is a snapshot of the item state

#

just like BlockState is a (somewhat live) snapshot of the block state for blocks, or EntitySnapshot of entities

pseudo hazel
#

Itemtwo.getItemMeta().setLore(lores); // this line just throws away the result from itemTwo.getItemMeta()

#

because its resulting item meta isnt being stored anywhere

sly topaz
#

any modifications you do to the item meta instance will be done to that snapshot, since it has no live reference of the actual item it was captured from

pseudo hazel
#

in other words, a snapshot is a copy of the thing you want to edit, not the original

sly topaz
#

so, for you to apply the changes you've made to the snapshot (i.e., setting the lore), you have to set it to the ItemStack instance, aka doing setItemMeta with your modified meta as parameter

pseudo hazel
chrome beacon
#

I have a feeling that they won't read that

pseudo hazel
#

🤷‍♀️

chrome beacon
#

and will ask the same question in a bit

timid berry
pseudo hazel
#

they are only fooling themselves if thats the case

#

no

#

getItemMeta is a copy

timid berry
#

gets a copy of the modified

#

meta

pseudo hazel
#

you need to take a break probably xD

#

no

blazing ocean
pseudo hazel
#

it gets a copy of the actual meta on itemTwo

blazing ocean
#

I know I'm blocked by a couple people already xD

chrome beacon
#

Yeah I was pretty sure we've had this convo before

timid berry
#

which i modified tho

chrome beacon
#

and I checked the history

pseudo hazel
#

if you dont change the meta beforehand, it will be the same meta as on item

#

where

chrome beacon
#

This is no the first time you have this exact issue

timid berry
#

I did it before

#

but this time

chrome beacon
#

Last time it ended with you being spoonfed

timid berry
#

I dont know

#

how to apply it back

pseudo hazel
#

setItemMeta

#

ItemMeta newMeta = item2.getItemMeta(); newMeta.whatever(); item.setItemMeta(newMeta);

#

it aint rocket science

sly topaz
sly topaz
#

discord way of handling blocked messages is ass though

chrome beacon
#

They'll just be back here again

blazing ocean
#

There's a vencord plugin

chrome beacon
#

They've already shown that to be the case

sly topaz
#

is there a shelter plugin

blazing ocean
#

for hiding messages from blocked peoples

sly topaz
#

I don't wanna install vencord

blazing ocean
#

shelter as in porter robinson and madeon!?!?

sly topaz
#

lmao, I haven't heard that song in years

pseudo hazel
#

they will be back regardless

sly topaz
#

I remember when it blew up

blazing ocean
timid berry
#

Buddy

#

i did it fine last time

pseudo hazel
#

so what changed

timid berry
#

last time I got the cursor item, changed it, then set the cursor item

chrome beacon
timid berry
#

but I have no idea how to set the item when looping through their inv

#

like where do i put it

#

type thing

sly topaz
pseudo hazel
#

why does it matter if its in a loop

pseudo hazel
#

if you extract it into a function, would it be easier to write?

sly topaz
blazing ocean
#

it really is

timid berry
#

like

#

Like im looping through their invs

#

editing the lore

#

but where do i put the item

#

last tiem I took the cursor item, changed it then put it back as cursor item

chrome beacon
#

As I've already told you

timid berry
#

but this time i take the item

chrome beacon
#

You don't need to

timid berry
#

change it

#

but where do i put it

timid berry
#

thats what changed

#

I didnt know i didnt have to

#

put the item

#

like i imagined

pseudo hazel
#

put it where you got it from

#

the player's inventory

timid berry
#

how?

#

i mean

#

i can add it to the inv

pseudo hazel
#

player.getInventory().set(whatever

timid berry
#

but I want to put it exactly where

#

it was

#

for (ItemStack item : player.getInventory().getContents()) {
}

pseudo hazel
#

well iirc looping over the contents is in order of the slots

#

so the first iteration is slot 0 and the 10th one is slot index 9

chrome beacon
#

smth smth for i

timid berry
#

but

#

how do i get that?

#

how do i get what slot its in?

pseudo hazel
#

thats a hard ?learnjava

timid berry
#

command didnt work

chrome beacon
timid berry
#

i know how arrays work

pseudo hazel
#

I thought you blocked the bot

young knoll
#

Yeah you’d have to do a loop over the slot index rather than the fancy loop

timid berry
#

thats why

pseudo hazel
#

if you know how arrays work, you can fix it

young knoll
#

Enhanced for loop I believe is the technical term

timid berry
#

i think i understand it now

#

thanks

pseudo hazel
#

or keep a counter or whatever

timid berry
#

pesudo code
for loop where i is less then inv length

#

then something like item[i] and modify it

#

then set item i

#

something like that

pseudo hazel
#

I feel like even chatgpt can help with these questions perfectly fine

timid berry
#

anyways class breaks over

#

cya guys

timid berry
pseudo hazel
#

well idk whats worse

chrome beacon
#

You're already getting clowned on here

pseudo hazel
#

getting clowned for using chatgpt to solve basic problems or getting clowned for not knowing basic problems

young knoll
#

🤡 ^2

pseudo hazel
#

if you use chatgpt you likely dont have to ask them here too

sly topaz
#

if you just feed it the whole convo, chatgpt can figure out the context and explain the issue perfectly fine

#

that's what I do when I can't be bothered to read a whole convo when someone needs help but I want to understand their issue lol

pseudo hazel
#

chatgpt is able to tell you whats wrong if you just post the code snippet and ask whats wrong

sly topaz
#

"based on this convo, summarize this issue for me"

sly topaz
#

because we clearly can't explain it in a way they do

pseudo hazel
sly topaz
#

I mean, I am not bashing the guy, I'm sure they're struggling enough with the program itself so having people tell you to go learn shit instead is not fun lol

#

that said, I completely do not understand what kind of foundational knowledge they miss, so I can't possibly explain it in a way that it could be interpreted from my explanation

#

one could go the extra mile and do baby steps, but that is with the assumption they even want to understand it and they don't, they want to get the shit done. I respect that and hence I just refuse to help up to this point

pseudo hazel
#

java Optional, yay or nay?

#

(as return values for some things)

shadow silo
#

So I have a sort of programming related question. If you are making a "faction" kind of plugin where players make their own factions, is it a good idea to make a permission node for each faction? Like dynamically making permissions. Or should permissions generally just be set in place

pseudo hazel
#

whats the goal of those dynamic permissions

shadow silo
# pseudo hazel whats the goal of those dynamic permissions

Well the intention would be to be able to check and see what faction someone would be in. I know it's possible and pretty easy to just write a quick API with like sqlite or something, but I was just wondering if it's something advised against.

#

Rather than writing an API and implementing it in plugins that interact, you can just do a quick permission check instead

sullen marlin
#

It's not the worst idea I've heard

#

I'm sure someone has done it before

shadow silo
# sullen marlin It's not the worst idea I've heard

Alrighty. The thing I wanted to check with permissions was something with worldguard. A faction would be able to create a "lock" within a region. The locking system already exists with another plugin on the server and it's built to use permissions, so I just needed a way to connect the factions plugin to it tbh

#

it felt wacky to make permissions dynamic though

sullen marlin
#

If it's stupid and it works it's not stupid

blazing ocean
drowsy helm
pseudo hazel
#

returning from a function

#

like for example I have a value called fromString

#

which returns some data if the string is correct

#

and before it returned null

#

but now I wanna use optional to force the user to handle it

sly topaz
#

not me doing optional.get()

drowsy helm
#

Yeah I would say thats a good usecase for it. But theres a very fine line between utilising it and over using it

pseudo hazel
#

the only thing I hate about optional is how verbose it is to just get the option on the callers side

sly topaz
#

Optional is good if it is truly optional, like it can be either or, not a thing that is most of the time not-null but due to x circumstance that can be avoided by checking other things is

pseudo hazel
#

thats like all null checks

drowsy helm
#

i think thats a very good way of articulating it

sly topaz
#

yes, hence why most possibly null values aren't optional

blazing ocean
#

I still think rust's Result<T, E> type is the best way of handling optionals/results

pseudo hazel
#

if the string value came from a plyer typing it in chat, would that be an optional like you describe

blazing ocean
#

still

#

like

sly topaz
#

Option is equal to Optional

blazing ocean
#

is there a reason to return null?

#

if so

#

use a result

#

if not

#

option

pseudo hazel
#

so is there a Result in java?

blazing ocean
#

idt there is

drowsy helm
sly topaz
#

no, and there shouldn't be

restive mango
#

@ancient plank

sly topaz
#

java is an exception-based langugage, so you should use exceptions

restive mango
#

Adele

blazing ocean
#

because java handles exceptions differently

restive mango
#

How do i

blazing ocean
#

yea

drowsy helm
#

so I would say yes, If the intent is to potentially handle a bad input i would use it

restive mango
#

Make a MaterialChoice as Material.Potion in a recipe

#

because it used to work

#

and now

pseudo hazel
#

not me catching exeptions and returning false

restive mango
#

it just is blank

blazing ocean
#

?staff

undone axleBOT
#

Don't ping staff for development/server help, if you have a question just ask it and someone in the discord will respond when they are capable of helping.

remote swallow
#

i love pinging adele for api questions

restive mango
#

nah adele is my friend

#

i can ping her

pseudo hazel
restive mango
#

but if you can answer my question

#

i would appreciate

pseudo hazel
#

"use it if you think you need to"

remote swallow
#

then add ur ingredient

pseudo hazel
#

but okay

#

ill use it sparingly at points where i want to convey that it should be explicitly either some value or not one, instead of just null

blazing ocean
pseudo hazel
#

and crash later

blazing ocean
#

like ??? you want me to try-catch?

restive mango
#

epic

#

this does not work

#

thats why

blazing ocean
#

(kotlin runCatching {}.getOrNull() :D)

restive mango
#

i am pinging adele

#

when i add a recipe with Material.Potion

blazing ocean
#

(kotlin does actually have results but the error type is just Throwable)

restive mango
#

it is blank in the workbook

#

for example

pseudo hazel
#

getOrCrash()

restive mango
#

the craftbook*

remote swallow
#

is it a specific potion? is it a custom item?

restive mango
#

e.g.

blazing ocean
restive mango
#
 ItemStack starFruit = new ItemStack(Material.CHORUS_FRUIT);
        ItemMeta fruitItemMeta = starFruit.getItemMeta();
        fruitItemMeta.displayName(Component.text("Starfruit").decorate(TextDecoration.BOLD).color(NamedTextColor.LIGHT_PURPLE));
        fruitItemMeta.lore(LoreUtility.buildLore("Fruit that has been charged with celestial power.", false));
        fruitItemMeta.getPersistentDataContainer().set(StarSign.getFruitKey(), PersistentDataType.STRING, "fruit");
        starFruit.setItemMeta(fruitItemMeta);

        ShapelessRecipe starfruit = new ShapelessRecipe(new NamespacedKey(StarSign.get(), "starfruit"), starFruit);
        starfruit.addIngredient(Material.POTION);
        starfruit.addIngredient(Material.APPLE);
        if (Bukkit.getRecipe(new NamespacedKey(StarSign.get(), "starfruit")) != null) {
            Bukkit.removeRecipe(new NamespacedKey(StarSign.get(), "starfruit"));
        }
        Bukkit.addRecipe(starfruit);
blazing ocean
#

rust unwrap be like (it just panics)

drowsy helm
#

my eyes

pseudo hazel
#

yeah but those can be caught

#

we dont want that

restive mango
#

In the craftbook, the recipe for that starfruit item has just a blank spot, and then an apple.

pseudo hazel
#

getOrPanic(!)

blazing ocean
restive mango
#

The craftbook being like the crafting guidebook you get when opening a crafting menu

blazing ocean
#

it panics with a line number

pseudo hazel
#

yes exactly

#

rust is good

#

which makes going back to work on my java plugin feel like a cave man task

blazing ocean
restive mango
#

epicebic

blazing ocean
#

i love panicking

restive mango
#

can thou explain

remote swallow
#

sorry went to see my dog, is it a specific potion or just any

blazing ocean
#

send minnie pics

remote swallow
#

okay brb

blazing ocean
#

shes so cuteee

restive mango
#

using Material.Potion

#

is the issue

#

nvm

#

maybe im an idiot

austere cove
#

bois how do I generate javadocs (im using maven) without duplicating these annotations

#

also unrelated but how do I

  1. generate a javadoc jar on package
  2. generate a javadoc report on site
    without regenerating the javadoc?
    rn I have an
<executions>
  <execution>
    <id>default-jar</id>
    <goals>
      <goal>jar</goal>
    </goals>
  </execution>
</executions>

in build and a

<reportSets>
  <reportSet>
    <reports>
      <report>javadoc</report>
    </reports>
  </reportSet>
</reportSets>

in reporting

sly topaz
#

iirc, if you use java5 annotations, it stops doing that (since they didn't have the type use context)

#

the other option is to use some processing tool and remove them instead

sullen marlin
austere cove
#

what version's that

worldly ingot
#

java5

#

It's a separate artifact :p

slender elbow
#

or they could just remove every other target type that isn't type_use 💤

worldly ingot
#

That would be ridiculous!

austere cove
#

mh? central says it got moved

worldly ingot
#

The latest version of annotations-java5 is 24.1.0

austere cove
#

or is that the non-java5 continuation

sly topaz
austere cove
#

oh yay it worked cheers

#

now the other issue despairge

slender elbow
#

they don't have that issue because they only target type_use

#

instead of method,field,parameter,type_use

sly topaz
#

then jspecify would probably be the better option if you can help it Phoenix

worldly ingot
#

It was a different time in Java 5 - 7

slender elbow
#

yes, it was also a different time last week

#

crazy how time just moves forward

worldly ingot
#

>:( Don't get smart with me, young lady

sly topaz
#

or does it? * insert vsauce song *

worldly ingot
#

That totally would be a vsauce intro line too...

remote swallow
#

java5 annotations are deprecated

sly topaz
#

I'd be surprised if they weren't

#

nowadays the popular standard is jspecify, wonder how long it will last

#

I like that they have package-level nullability definitions like eclipse ones, if anything

worldly ingot
remote swallow
#

who enforces that

worldly ingot
#

idk god or some shit

sly topaz
#

I am restraining myself from saying ur mom to that statement

remote swallow
#

you can say it

remote swallow
sly topaz
#

ur mom does, get rkt

drowsy helm
worldly ingot
remote swallow
#

she a big shitter

#

just felt like you need to know

sly topaz
#

why did you have to say that just as I was taking a bite out of my pizza, dang it

remote swallow
#

im desensitised to it from volunteering at a farm, nothing like that ruins my appetite

young knoll
#

Hey VSauce, Michael here, where are your fingers?

remote swallow
#

is he saying hey to vsauce, hes michael

#

anyway

#

my fingers are holding a cookie

young knoll
#

Idk tbh

#

Idk if he’s meant to be VSauce: Micheal

#

Or if VSauce is how he refers to the audience

river oracle
young knoll
#

Hey, VSCode, Microsoft here, do you spend too much time working with computers?

chrome beacon
#

Let's fix that with AI!
- M$

#

Adds copilot

young knoll
#

Clippy was better

fleet pier
#

I'm currently having the problem that I'm trying to change the text of a score in the scoreboard but instead of replacing it just adds another line spigot 1.8.8

#
    public void updateScore(Player player, String text, int score) {
        player.getScoreboard().resetScores(text);
        player.getScoreboard().getObjective("aaa").getScore(text).setScore(score);
    }
#

is it not possible to update a single line?

wet breach
#

Probably a limitation of 1.8

#

More of a reason to update

young knoll
#

Normally people use prefix and suffix for scoreboards

#

And empty text (via a colour character) for the actual text

warm mica
fleet pier
#

i should stop coding at night

#

i will try it out

#

😭

fossil ridge
#

"This list contains asynch tasks that are being executed by separate threads." somebody was drunk while writing docs

river oracle
#

Or they don't speak English lol

quick shoal
#

can people pls help me fix my gosh darn plugin. it aint loading 😦

fossil ridge
#

It's within BukkitScheduler#getActiveWorkers

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

river oracle
#

I'm glad it's there

quick shoal
#

uh i cant paste the log

#

its too long

river oracle
undone axleBOT
quick shoal
river oracle
#

Kekw running on purpur asking for help on spigot that's somw real shit right there. You're either not shading a dependency you should be

quick shoal
#

ok how do i do that, this is my first plugin

fossil ridge
#

?whereami

quick shoal
#

ok mb

river oracle
quick shoal
#

😦

river oracle
#

Maven has good tutorials

#

Or gradle ig since you're on purpur

wet breach
#

Its fine. Just be aware of the server implementations you are using because most times your issues will be specific to such server types. However your current issue in regards to shading is with maven and fortunately that has nothing to do with server implementations

quick shoal
#

so uh how do I fix it?

river oracle
quick shoal
#

yay

#

my favorite

river oracle
#

If you're using maven you'd use the maven shade plugin

#

If you're using gradle checkout shadowjar by gradleup

#

If you're using neither you're on your own good luck

quick shoal
#

rut roe ragggie

#

i have the maven shade plugin installed tho

river oracle
#

What scope is your dependency at in maven

wet breach
#

I think the question to answer is are you using maven to build or gradle?

quick shoal
#

maven

river oracle
#

Well first I should ask is this dependency another plugin

wet breach
#

Awesome super easy to help

#

I have a pom you can use for reference for shading

quick shoal
#

ok

wet breach
quick shoal
#

should I paste my pom

river oracle
#

Just keep note that this pom is a tad outdated so you might need to adjust the version

quick shoal
#

?paste

undone axleBOT
river oracle
#

You can find the latest on the official maven website

wet breach
#

You need to have the repositories tags and repository for where you are pulling the dependency from. And then you need the plugin tag for the shade plugin. For all the dependencies you specify in the dependencies tag you need to add the scope tag to them. Use provided for it to not be shaded and compile if you want it shaded

quick shoal
#

i love making plugins

wet breach
quick shoal
wet breach
#

And as y2k said my pom there is outdated for the version number on the shade plugin

#

You can visit maven website to find latest version numbers to use

quick shoal
#

ok ill do that

wet breach
#

Also my shade plugin is setup so it doesnt shade the api into my plugin

#

Was having issues with maven wanting to do that so you should be able to exclude the config tags of maven shade

#

But its also safe for you to copy too

quick shoal
wet breach
#

Now we need to resolve your config.yml

#

I am not sure what purpur requires in the yml file but we can resolve it not being included.

#

What does your project structure look like?

#

Just fyi if i dont respond right away its because i am at work and using a phone lol

#

@quick shoal

quick shoal
#

lol the config was in the wrong place

wet breach
quick shoal
#

just gotta get commands working now

wet breach
#

Progress at least

quick shoal
#

SO MANY ERRORSS HOLY GUACAMOLE

quick shoal
#

Can someone help me with commands .W.

sullen marlin
#

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

quick shoal
#

my plugin isnt giving any errors, and yet the plugin command /RKS isnt working/showing up

buoyant viper
quick shoal
#

yep

#

same everything'

#

im gonna paste the command kt and the plugin.yml

#

?paste

undone axleBOT
quick shoal
#

help!

quick shoal
#

in main?

quaint mantle
#

Yup

quick shoal
upper hazel
#

inteliji not can undestand boolean checking method?

soft hound
#

Howdy! A quick question.

Since having all the things in a single plugin is not good because if one thing breaks than it means that it might break the whole plugin, is it smart to make a command handler for all the plugins you'll have in the server? Because it'll just be useless to have the whole thing copy/pasted over and over, and the plugin might just have a couple of commands.

lilac dagger
#

it cannot know without seeing the implementation, configuration section is just an interface, it does now come with a body and even if it did the class could be overriden

#

@upper hazel

upper hazel
#

hm

lilac dagger
upper hazel
#

I was thinking about finding a plugin for a compiler that analyzes code for archetypal errors including improved analysis of null values.

#

someone know examples?

soft hound
lilac dagger
#

it's really up to you

#

it won't make a difference either if it's shaded or not, for the plugins it'll be like a few megabytes on memory extra or less

#

probably won't even make a difference for memory if you're instantiating the whole command handler for the plugin

soft hound
#

I mean the thing is, I just want the plugin to look cleaner, so a custom library is probably a good thing to make, right ?

#

Because look, instead of having org.example.utils.CommandHandler in every project, you can just have it in a custom library and re-use it from there.

#

Or is that a bad practice ?

lilac dagger
#

it won't be cleaner

#

you can as well create a core that you can shade in each plugin

twilit coral
#

even then, if you write a whole core you are planning on shading into all your plugins, depending on the scale, could bloat your plugin

#

could just follow what fr33styler is saying and shade individual modules with your plugin

#

if you are still new, which i assume you may be by the questions; shading is when you package all the dependencies for your plugin to work in one jar or one uber jar

young knoll
#

You can always minimize it when shading

upper hazel
#

CMI has api for create npc?

#

i not can find it

#

i mean CMI API

#

oh i

#

mixed up the name of the plugin

lilac dagger
#

Yup, that's what I was about to say

quaint mantle
#

Why do minigame servers open a separate server for each game?

#

example survival games

#

players are sent to a different server when they start the game

#

what is the advantage of this?

proper cobalt
#

java.lang.IllegalArgumentException: `The found tag instance cannot store Float as it is a NBTTagInt

#

What does this mean

#

LIFETIME("lifetime", DataType.FLOAT)

#

it is a float

proper cobalt
quaint mantle
#

how could this be more performant?

blazing ocean
#

it doesn't have everything running on one server

#

i.e. you should never have all your players on a singular game server, because that will degrade performance for everybody

proper cobalt
#

is float a support data type for PDC

#

or does it just read as int

quaint mantle
#

For example, should I open a special server for each game?

Hub Skywars Lobby
↓ ↓
Server 1 Server 2

Skywars Game 1 Skywars Game 2
↓ ↓
Server 2 Server 2

                  Skywars Lobby 
                                ↓
                         Server 2
                                ↓
  Skywars Game 1         Skywars Game 2
               ↓                                        ↓
           Server 3                        Server 4
#

can i prefer first one?

proper cobalt
#

the stack trace isnt telling me enough dude

upper hazel
#

i need call PlayerLoginEvent for npc player?

#

or only join

#

event

rough drift
#

how much compatibility do you want? ¯_(ツ)_/¯

upper hazel
#

full

#

i need fake player

rough drift
#

then fire it lol

blazing ocean
#

what are you trying to do

upper hazel
#

for others plugins

blazing ocean
#

that could mean anything

#

oh yeah that's just gonna be a huge fucking pain

rough drift
#

squared

blazing ocean
#

cubed

upper hazel
#

even call and spawn npc with citizes not enaugh?

blazing ocean
upper hazel
#

but citizes create entity

blazing ocean
#

they are not registered on the server

upper hazel
#

BRUH

blazing ocean
rough drift
#

you can, you know

#

just like

#

do a connection to localhost

#

and implement the client proto...

#

would be easier

blazing ocean
#

it's just 100x easier if you actually have control over internals you know

blazing ocean
blazing ocean
#

or buy a mc account for every NPC-

rough drift
#

nah just verify the login using a bit of nms

blazing ocean
upper hazel
blazing ocean
#

"core"?

upper hazel
#

"kernel","nucleus"?

blazing ocean
#

???

upper hazel
#

server core

blazing ocean
#

wtf is a server core

upper hazel
#

bruh

#

"server.jar"\

blazing ocean
#

that is

#

what

upper hazel
#

you seriasly

blazing ocean
#

@rough drift any idea what this guy is on about 😭

upper hazel
#

server core

#

paper,

#

spigot

#

purpur

rough drift
#

they are asking if Marionette is a separate server jar

blazing ocean
#

it is

warm mica
blazing ocean
#

just use hetzner ffs

warm mica
blazing ocean
warm mica
echo basalt
#

wasn't there a way to make it so you could consume an item indefinitely

#

like cancelling interact event if you're trying to eat bread type deal

rough drift
#

consume event

#

and ye

echo basalt
#

cancelling consume event just returns the item

#

I wonder how viabackwards plays it

#

basically this guy wants custom consumption lengths but support for 1.19+

#

Yeah it just resets the item

#

sadge

#

only solution might be to fuck with packets

rough drift
#

what about the interact event

echo basalt
#

in 1.20.6 it just prevents the item entirely

#

I think it has to do with an nms change

#

packets might solve

young knoll
#

Does viabackwards actually handle it

quaint mantle
wet breach
#

also, you don't want players waiting around for a game

#

so you spin up another server

#

you keep your lobby servers separate because you can put a bunch of lobbies on the same server instance since they generally don't consume very much resources

#

the thing consuming resources is however many players you got in the lobbie's

young knoll
#

Normally they run a few worlds per server

wet breach
#

yeah normally

twin kiln
#

so im new to making plugins and got into it bc i wana make a small server and wanna know how to change the server icon in code but i have 2 problems:

  • dunno how to load stuff from the resources folder into File var type
  • found event.setServerIcon and Bukkit.loadServerIcon but it takes a File and again i dunno how to do that with the rs folder

and i cant find a solution, can some1 give me a code snippet and explain how this works?

chrome beacon
#

We won't spoonfeed you the code

#

as that doesn't end well

twin kiln
#

well then explain atleast, thats what this channel is for

chrome beacon
#

Sure what do you need explaining

#

To make a File object you use it's constructor

twin kiln
#

yes

#

but how do i do it with loadServerIcon and setServerIcon

chrome beacon
#

Make a file object and pass it to the loadServerIcon

twin kiln
#

basicaly how to load file from resources folder in jar to File vartype

chrome beacon
#

Take the result of that and pass it to setServerIcon

#

I see so you want it from inside the jar