#help-development

1 messages · Page 1191 of 1

fair rock
#

Is there an other way to add custom biomes to minecraft without datapacks instead of injecting them?

chrome beacon
#

no

quaint mantle
#

can i prevent block particles like cherry tree leaves

worldly ingot
#

Like when breaking blocks? No. Those are spawned on the client. The amount of bandwidth that would be required for the server to send those particles to the client is crazy

slender elbow
#

I have enough

worldly ingot
#

Send more packets burn

#

Also just realized you gave a specific example of cherry tree leaves. I assume you mean the ambient ones. Similar to the spore blossom. Those also are client-sided for the same reason. Lots of bandwidth (and really the server doesn't need to know about that tbh)

fair rock
#

That would be crazy

wooden dove
#

do you guys know why this isn't working?

    public void onShootArrow(EntityShootBowEvent event) {

        if (event.getProjectile() instanceof Arrow) {
            event.getEntity().sendMessage("Shot an arrow");
            event.getProjectile().setMetadata("pickup", new FixedMetadataValue(SiegePlugin.plugin, 2));
        }
    }```
#

It seems to set the data properly if I get it right after that, so maybe it's being reset? but how?

chrome beacon
wooden dove
#

1.20.4

chrome beacon
#

Don't use the metadata api

#

It's leak prone

#

?pdc

chrome beacon
#

Attach PDC tags instead

wooden dove
#

does this let you change nbt on the item?

eternal night
#

no

wooden dove
#

thats what I need to do

eternal night
#

no?

#

you just need to attach data

#

which is exactly what the PDC does

#

it just doesn't allow you to edit NBT directly

chrome beacon
#

The metadata API does not change the nbt tag

eternal night
#

e.g. you cannot use this to edit like the display name

chrome beacon
wooden dove
#

oh cool, I will just use that thanks

wraith delta
#

Question; I am making /msg and /reply to chat in private messages. I am able to do /msg but i cant do /reply, it always says theres no one to reply to. I have my classes here, maybe its backwards?? https://paste.md-5.net/zezewudobe.java

chrome beacon
wraith delta
chrome beacon
#

Actually might no be very relevant if all you want is commands

worldly ingot
#

Yeah the conversations API is for something completely different 😅

chrome beacon
#

Yeah I missremembered 😓

chrome beacon
chrome beacon
#

Sounds like more of a bug that it didn't before

#

Not sure about cancelling it though

quick shoal
wraith delta
chrome beacon
#

yes

#

also you should update those method names

#

it is not clear what they do

rough ibex
#

allow the user to change the hastebin url

#

I would put it behind a permission

#

also /get is vague and doesn't tell the user what it does

#

If you want something to do, add the reverse: safely get and serialize the item back from pastebins

wraith delta
wide viper
#

is there any way to apply item components like consumable without NMS in 1.21.4?

dusk pewter
#

Hi, why boolean isEmpty() from player.getNearbyEntities() doesn't work? Help me, please.

#

Theoretically player shouldn't be an entity from nearby entities?

chrome beacon
#

Wouldn't suprise me if it was

quaint mantle
#

hi all

summer scroll
quaint mantle
#

i need some help with a slab i made custom slab i want it to grow crops and have snow but i dont know what the code is

dusk pewter
dusk pewter
#

Maybe it's PlayerMoveEvent

thin isle
buoyant viper
thin isle
#

on the same server there is another 1.8.8 spigot server running with java 11

#

idk why it does not work with in this case

short pilot
#

how can i make my custom entity target players of a specific condition, for example, if they are in one of my built in factions?

#

using goals

sly topaz
#

or if a normal entity, you'd just add your condition on the EntityTargetEvent I guess

short pilot
#

do u have any examples

#

also im not sure why but when i try to get the world of said Location to save on server shutdown, it returns as null

#

context is that this location represents the "home" of a faction aka where /f home will take you to, and it works as intended but when i try to debug and print it out when i am saving, it returns as null, not a World UUID

#
public Kingdom(String name, UUID leader, Location home) {
        this.name = name;
        this.description = "";
        this.open = false;
        this.leader = leader;
        this.ID = UUID.randomUUID(); // Change this later when we save kingdoms
        this.members = new HashSet<>();
        this.home = home;

Constructor sample

rough ibex
#

where is this location being created

cerulean oyster
#

i want to watch some one code a coustem item plugin so i could gain knowledge
i want to know when what class to use in spigot class
i have so many doubts any proffetional is hear

#

plz some one make me as a coding friend

short pilot
#

ok so on the actual kingdom creation the player's location is passed in as well to set the default spawnpoint of the kingdom

#

and that's what i save as a variable

#

instance variable per kingdom

#

but when i try to save that location to the DB, the coordinates save but the world UID does not it returns null

short pilot
# rough ibex where is this location being created

i do have a theory, could it be that by the time i'm saving (on plugin shutdown) you cant access the world UID anymore? That would make a bit more sense but it's weird because I can still access the X Y Z coords

ie

            statement.setString(9, Objects.requireNonNull(kingdom.getHome().getWorld()).getUID().toString());
            statement.setInt(10, kingdom.getHome().getBlockX());
            statement.setInt(11, kingdom.getHome().getBlockY());
            statement.setInt(12, kingdom.getHome().getBlockZ());
cerulean oyster
#

are you trying to set spawn location

#

@short pilot

short pilot
#

well at this point i'm trying to save it to db

cerulean oyster
#

oh ok

#

i think you missed a comma

smoky anchor
#

on plugin shutdown
You mean onDisable ?

cerulean oyster
#

between the ,getUID().toString());

smoky anchor
#

no, they got it right

cerulean oyster
#

hmm

short pilot
#

@smoky anchor it's not an async thing since it blocks before server shutdown is complete and everything else saves

cerulean oyster
#

@smoky anchor can we chat in personal i have some doubts about this code

short pilot
#

i was debugging in game and when i print the world UID of the kingdom home while the server is loaded, it returns the intended UID

smoky anchor
short pilot
#

thoughts? i think it's litearlly just cuz it happens on shutdown logic

#
@Override
    public void onDisable() {
        // Plugin shutdown logic
        Bukkit.getLogger().info(ChatColor.RED + "Disabled " + this.getName());
        DatabaseUtils.saveAll();
        if (databaseManager != null) {
            databaseManager.disconnect();
        }
        Bukkit.getScheduler().cancelTasks(this);
    }
smoky anchor
# smoky anchor I don't do DMs We can chat here

Objects.requireNonNull simply throws null if the argument is null
otherwise it returns the argument
so we can basically ignore it, in which case that line of code is kingdom.getHome().getWorld().getUID().toString()
Which is correct

short pilot
cerulean oyster
#

my mind is blowing i am new to spigot boooom

short pilot
#

is the onDisable event happening too late, ie after the world is gone already?

smoky anchor
#

Ye, I don't think I can help with this
My only thought is that the world unloads before you save the location
Which you can get around by just storing the raw data of the location, xyz & world uuid

short pilot
#

then i suppose i could just fix this by storing the UID as its own variable for the home world

#

so we wont be getting it directly from the Location

smoky anchor
#

Is it a vanilla world, like overworld/nether ?
Do you use multiverse or manage the world yourself ?

short pilot
#

it just gets the world ID of the kingdom's home, it could be anywhere

smoky anchor
#

ok, but where is it now

#

in your testing

short pilot
#

overworld

smoky anchor
#

based on your probided information, that should not be happening
so

#

¯_(ツ)_/¯

short pilot
#

probably just out of order with the world being unloaded

#

testing my new logic now

cerulean oyster
#

by the way where can i learn spigot plz can anyone tell me i wanna learn i watch several youtube videos but they dont tell me when to use a specfic class and its function in spigot i have some trouble with this

short pilot
#

yup fixed

short pilot
#

and use chatgpt too if you want, it helps with common questions. Take care in using it to generate entire code but using it to generate snippets for examples is fine

cerulean oyster
#

ok thanks

drowsy helm
pseudo hazel
#

or reading the docs

cerulean oyster
#

i am asking some one to code and i will watch their code and learn something is it usefull

#

like some one building a project

#

like a coustem item plugine

#

the thing is i know java i am expert in it but i need alll the classes list

short pilot
#

ok i feel like something's off in my actual constructor for my Location

#

Provided x y z and world UUID, how do you make a new Location object?

#

oh shoot i got it

#

i get it now

eternal oxide
#

Location requires a World Object so Bukkit.getWorld(id) and pass to Location constructor

short pilot
#

the getWorld I was referencing was taking in a String because I never casted my home_world_id back to a UUID that it's supposed to be

#

it all makes sense now omg

#

what a debugging victory

#
Location home = new Location(
    Bukkit.getWorld(UUID.fromString(resultSet.getString("home_world_id"))),
    resultSet.getInt("home_x"),
    resultSet.getInt("home_y"),
    resultSet.getInt("home_z")
);
#

this works now

woeful crown
#

How come I get a cannot find symbol error for getString in this context, I am trying to update a plugin from 1.20.1 to 1.21.1
public static String getItemName(ItemStack head){ try{ Object refItemStack = MinecraftReflection.getMinecraftItemStack(head); return LocaleLanguage.a().a(((net.minecraft.world.item.ItemStack) refItemStack).y().getString()); } catch (ClassCastException e) { e.printStackTrace(); return ""; } }

quaint mantle
#

Update nms version in your pom or gradle build script

short pilot
#

^

drowsy helm
#

why not use mapped?

short pilot
#

Can I make my primary key a group of things to check against? kind of like a custom .equals checking for X Y Z to match

pseudo hazel
#

INSERT OR UPDATE?

drowsy helm
#

interesting, minecraft spells bassdrum wrong

#

what exactly are you trying to do

#

thats an XY issue

sullen marlin
#

Just have a unique composite key

short pilot
#

yeah i did that

#

it's all fixed prob shouldve mentioned

#

all i needed to do was make a composite key bundling the differentiating things together

#

on the other hand

#
        UUID fromKingdomUUID = kingdomManager.getKingdomByChunk(fromChunk);
        UUID toKingdomUUID = kingdomManager.getKingdomByChunk(toChunk);
        Bukkit.getLogger().info("fromKingdomUUID: " + fromKingdomUUID);
        Bukkit.getLogger().info("toKingdomUUID: " + toKingdomUUID);
        if (fromKingdomUUID != toKingdomUUID) {
.............

this isn't correct equality checking for two UUIDS, but what would it actually check for?

drowsy helm
#

use .equals

short pilot
#

yus of course

drowsy helm
#

== checks for reference equality

short pilot
#

so just the same actual object it's pointing to?

#

aka memory location

drowsy helm
#

ye

short pilot
#

neato

pseudo hazel
eternal oxide
drowsy helm
#

Looks like it’s gonna stay that way

pseudo hazel
#

saying its having any impact on gameplay is just wrong

drowsy helm
#

It’s annoying tf outta me because I have to have a random ass if statement in my code for this bs lol

pseudo hazel
#

wdym

#

mc is full of that shit anyways

#

just look at the advancement names, they are all very unintuitive and different from the english translation

drowsy helm
#

More so that the bukkit name is spelled correctly so I cant just do .name() on the enum

pseudo hazel
#

thats more of a bukkit issue then xD

#

i just wish there was like a method that converts it from a namespace or whatever into the enum constant

young knoll
#

They don’t have namespaces for note block instruments iirc

#

It’s also an enum internally

torn shuttle
#

did item#setCustomModelData change with 1.21.4?

#

seems like my model stuff is broken

#

and I see they documented a couple of things about it but I don't see a change in the api

young knoll
#

Idk if the api has been updated

smoky anchor
#

Yes, custom models are now incredibly powerful.
Now you can make them even without any conflicts.
In fact, you don't need CMD if you want only a simple model, just change the item_model component on an item

torn shuttle
#

how do you avoid conflicts and how are yo usupposed to tell clients which model to use in the first place

smoky anchor
#

You just no longer have to override the vanilla model, you can use your own

torn shuttle
#

...huh

#

and that works with custom namespaces then?

young knoll
#

yes

smoky anchor
#

yes!

torn shuttle
#

damn

#

is mojang cooking?

young knoll
#

Item components are neat

smoky anchor
#

Dude, read the changelog for this.

torn shuttle
#

I only got around to the changelog today

smoky anchor
#

You can have different model on item based on real time
Using composite, you can have any angle you want (there is a blockbench plugin by Godlander to auto generate the model definitions)
Custom tinting
Many more.

torn shuttle
#

ok so through the api what sets that item_model field?

young knoll
#

setItemModel

torn shuttle
#

so the old way of having multiple numbers in the resource pack for, say, diamond swords is completely deprecated?

smoky anchor
#

You can still do something similar, but why

torn shuttle
#

just trying to figure out backwards compatibility

smoky anchor
#

that is non-existant

young knoll
#

This is where pack overlays come in

#

And some if statements

smoky anchor
#

just adds pointless complexity, simply update to latest :)

torn shuttle
#

when was this changed, 1.21.4 only?

young knoll
#

Yes

#

tho item model was added earlier

torn shuttle
#

so how do I create my own item, is there a trick to it?

#

in the resource pack

smoky anchor
#

use poisonous potato, remove the food/consumable components
add custom components

#

idk about the RP, I think like this you would need one model file and one item model definition file (which would simply refer to the model, if you don't have any fancy logic/tints/idk)

smoky anchor
summer scroll
#

Damn, mojang really is cooking

blazing ocean
smoky anchor
#

-# read message below

blazing ocean
#

that's an interactable item

smoky anchor
#

You can remove the components and it will not be

blazing ocean
#

pointless work tho

#

use popped chorus fruits

smoky anchor
#

has crafting recipe

blazing ocean
#

and?

#

can't really craft items with custom components in vanilla recipes

smoky anchor
#

you'd have to remove those or make an event to check for your custom item to not craft

blazing ocean
#

?

#

how 2 craft popped chorus fruit with item model of diamond

smoky anchor
#

all it does is check for the item type
recipes don't care about components

#

you can use the popped chorus fruit to craft the blocks

blazing ocean
#

ohh you meant that

smoky anchor
#

ye, my bad, I should have said it better

blazing ocean
#

I mean I usually remove all unneeded vanilla recipes

#

or just check in the event

smoky anchor
smoky anchor
blazing ocean
#

just don't overuse datapacks like that

tiny tangle
#

guys

#

i need some advice

#

doing this Inventory gui = Bukkit.createInventory(null, 36, "test"); player.openInventory(gui); is there a way not to open the player inventory with the gui at same time ? "i want only be server side"

smoky anchor
#

Do you mean you only want the top side ?

tiny tangle
#

yeah, only the top

#

as standalone gui

smoky anchor
#

Then no

tiny tangle
#

its weird

smoky anchor
#

I guess you could have some "workarounds" That would hide "hide" the bottom inventory.

tiny tangle
#

some plugin did it

smoky anchor
#

Show us :)

tiny tangle
#

like for example

#

Kryptonite

#

or RestorerSkin

#

those kind of menu

smoky anchor
#

show some images please

#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

tiny tangle
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

tiny tangle
#

sure

smoky anchor
#

#bot-commands

#

My guess will be a resource pack that uses font magic to hide the bottom inventory.
And clearing the items client-side so no hover thing happens.

tiny tangle
#

i dont have idea, its only a plugin and no resourcepack.rar

#

i will show

#

omg

#

effect mandela

#

yeah, you right

#

i was like I certantly sure it was standalone gui

#

i wanna die

#

☠️

#

although ,sorry for my misbehave :C , could teach me how to import the net.minecraft, please. :3

fierce whale
#

I used setCamera packet in survival mode. but InventoryClickEvent didn't work.
Is it impossible to detect inventory click after camera packet sent?

pseudo hazel
#

how can the camera be moved if you are in an inventory

fierce whale
#

So I made the survival player spectate armorstand.

slender elbow
#

you can also use the API

#

oh idk about in survival

young knoll
#

I'm pretty sure the client just doesn't send inventory packets when in camera mode

high glen
#

hi i make plugin for my private server with friends and i ned help

fierce whale
high glen
#

so someone can help me?

echo basalt
#

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

torn shuttle
# smoky anchor

so wait can this specific command be run on actual custom models because I'm not really getting it to work

smoky anchor
#

Yes, should be

torn shuttle
smoky anchor
#

Your model definition is not correct

torn shuttle
#

ignore typo

#

even not typo'd it doesn't work

smoky anchor
#

you need two files, item model definition and the model file

torn shuttle
#

but the item model definition restricts me to a specific item right

smoky anchor
#

also no

#

the item_model is the reference to item model definition I believe

torn shuttle
#

wait

#

that can't be right

#

let me check

torn shuttle
#

on a mace

#

what would I even need to type to make it spawn with the model

#

because I can do it with a completely different command

#

this one works

smoky anchor
#

Sorry I can't really respond well at this moment, playing coop game :D

#

take a look into your clients console, maybe the RP has some errors

torn shuttle
#

the model works

#

with that specific command

#

but only for the mace

#

hence me asking if this means I can only use these if they have a file in minecraft/items and a json specific to the item type that they are being applied to

smoky anchor
#

you can use any model definition on any item

torn shuttle
#

how would I use that specific model definition on a diamond sword

#

or using the command you posted

blazing ocean
#

the item model tag takes in an item model definition's identifier

blazing ocean
#

it is yeah

pseudo hazel
#

but its always a model

#

wtf mojank

torn shuttle
#

doesn't work either

blazing ocean
pseudo hazel
#

wdym

blazing ocean
pseudo hazel
#

why specify models is what I mean

torn shuttle
blazing ocean
torn shuttle
#

nothing that would really make me think the rsp is wrong

blazing ocean
#

and does it look correct in game?

torn shuttle
#

no

blazing ocean
#

interesting

torn shuttle
#

I mean the docs don't lead me to think it would necessarily be impossible to do this but...

pseudo hazel
#

why would it give missing texture error

torn shuttle
#

I can't even get this command to work with anything other than minecraft defaults

blazing ocean
#

well, is the texture defined correctly?

torn shuttle
#

yes

blazing ocean
#

show your model definition

torn shuttle
#

I mean I showed it earlier

#

it works with the other command

#

I don't see why it would work with one and not the other

blazing ocean
#

well

#

you would need to remove those predicates

#

if you add predicates so it only works if those are fulfilled, you obviously won't get it when they aren't

torn shuttle
#

?paste

undone axleBOT
torn shuttle
#

that's the actual axe file

pseudo hazel
#

also you misspelled bronze to broze

blazing ocean
torn shuttle
#

i'm still not even sure of whether it would even be possible to have a model definition for one item type apply to different item types via commands or api

torn shuttle
torn shuttle
#

a random mace I edited

#

that might be easier

#

I know it's a mess, I was in the middle of trying to figure it out

#

I think I'm going to give up on using item_model, it just doesn't seem to work for non defaults and I guess we'll have to make a model definition per item type we need

smoky anchor
#

you're def doing something wrong, I'll take a look at it once I have time

worldly ingot
#

You're misunderstanding how the model system works now

#

The item model component pulls from assets/<namespace>/items, not from assets/<namespace>/models/item. There's a difference between the two

#

As an example, take the fishing rod. There's a assets/minecraft/items/fishing_rod.json, and that model file points to either assets/minecraft/models/item/fishing_rod.json or assets/minecraft/models/item/fishing_rod_cast.json based on a predicate if the item has its fishing_rod/cast property set to true

blazing ocean
worldly ingot
#

If you want a very simple model without any conditions or anything like that, all you need is a model file to point to your model definition

assets/elitemobs/items/bronze_axe.json

{
  "model": {
    "type": "minecraft:model",
    "model": "elitemobs:item/bronze_axe"
  }
}

assets/elitemobs/models/item/bronze_axe.json

{
  ... your current model definition ... this can honestly stay as you have it currently
}
pseudo hazel
# worldly ingot The item model component pulls from `assets/<namespace>/items`, not from `assets...
Minecraft Wiki

Data components, or simply components, are structured data used to define and store various properties. They are used on items, where they are referred as item components or item stack components, and block entities, partially replacing NBT format.
Data components are used in various places, including the player's inventory, container block enti...

worldly ingot
#

Yes, the wiki is wrong

#

Or at best, poorly phrased

pseudo hazel
#

well it says its based on assets/models/item pretty explicitly

worldly ingot
#

I'll propose an edit

#

Because it's wrong lol

pseudo hazel
#

yeah, alright thanks for clarifying

worldly ingot
#

Wiki should be updated now

#

The best reference you can use is vanilla's assets directory. Look at assets/minecraft/items/fishing_rod.json and its referencing files in assets/minecraft/models/item

#

And then look at a simple model like assets/minecraft/items/apple.json and its companion in assets/minecraft/models/item/apple.json

torn shuttle
worldly ingot
#

elitemobs:bronze_axe, but yes

torn shuttle
#

holy shit

#

it worked

#

thanks bae

#

I knew I called off that hitman when you didn't add the pathfinding api for a reason

worldly ingot
upper hazel
#

this pointless adding redacting object params if they resets after reloading config

#

?

blazing ocean
#

you what

upper hazel
#

Most of the settings depend on the config that the player can reload and reset params. Is it worth adding the ability to change settings via api?

#

I know that you can add some kind of modifications like with attributes in bukkit api but not for all knows

river oracle
upper hazel
#

or i can add smth like reload event?

torn shuttle
#

oh since they changed a bunch of stuff about rsps

#

did they change the fonts file

#

can we now have a different way of doing spacing?

blazing ocean
#

what

#

there's been two ways for a while

torn shuttle
#

I haven't looked at it in years

blazing ocean
torn shuttle
#

seems like negative space font "fixes" things by just coming up with a ton of possible spaces

pseudo hazel
#

shaders

#

but idk why spaces arent compatible with other plugins

river oracle
#

Yeah if it's applied to the server other plugins can use it?

torn shuttle
#

if they apply their own font logic it will break

#

like right now my plugin would probably be breaking that negativespacefont thing

#

and the problem is that if I start using it then every other plugin will break it

#

(potentialy)

high glen
smoky anchor
#

not if we don't have access to it

high glen
#

sr now is public

smoky anchor
#

I forgot the command again, but please tell us what is wrong with it as well
"pls fix" is useless if we don't know what broke

#

?notworking

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.

smoky anchor
#

One thing I don't like is the way you do commands
Just make 3 separate classes

#

You have 3x the same method isInGuildRegion
Make some util class for this instead.

torn shuttle
#

yeah I don't see a good alternative for negative space

#

well

#

not an easy one at least

smoky anchor
#

Q: how exactly can plugin break negativespacefont ?

torn shuttle
#

by having their own default font file with different values that use the same unicode

smoky anchor
#

default ?
As in replacing the vanilla font ?

pseudo hazel
#

yes

young knoll
#

You should use a custom font

torn shuttle
#

yeah I was trying to see how a custom font can be used

#

wasn't really finding much

#

do I just create a font file and name it something else? how do I refrence it later?

pseudo hazel
#

its a bit hard to use a custom font esp for stuff like inventory titles in spigot

young knoll
#

Yeah you’d need some NMS

torn shuttle
young knoll
#

Oh does it

pseudo hazel
#

yeah

torn shuttle
#

why say it isn't

young knoll
#

I thought it used its own namespace

pseudo hazel
#

this overrides the vanilla font

torn shuttle
#

if you haven't seen it

pseudo hazel
#

for characters that arent used

young knoll
#

You can just rename the font file

torn shuttle
#

then back to what I just asked

young knoll
#

And move it to your own namespace ideally

torn shuttle
#

how do I then tell it to use that spacing for, say, an inventory title

#

or a chat message

young knoll
#

For a chat message you can use bungee components

pseudo hazel
#

paper

young knoll
#

And just set the font value to yournamespace:font_name

smoky anchor
#

apparently it's this easy to make a negative space font since some version ?

torn shuttle
#

and menus?

#

rightn ow I only do it for menus

torn shuttle
#

but it still falls prey to the exact same issue I am talking about

pseudo hazel
#

you cant do it in spigot api

#

you either need to use some downstream fork or NMS

torn shuttle
#

well

#

guess it's staying as is then

pseudo hazel
#

which is why this font is probably using the default too xD

young knoll
#

Yeah that’s fair

#

I just use a bit of NMS for it

blazing ocean
quaint mantle
#

what do you mean with negative font?

torn shuttle
#

I'm not that invested in getting this to work right now, was just checkign in on the latest meta since some stuff had to change anyway

quaint mantle
#

like minor spacing?

#

oh space font

pseudo hazel
#

negative spacing

smoky anchor
#

"writing to the left"

quaint mantle
#

didn't read that

pseudo hazel
#

space towards the left

torn shuttle
#

would be nice if spigot got it to work with the namespace

#

sure would be poggies

smoky anchor
#

-# would be nice if spigot got out of the stone age

young knoll
#

Choco’s PR is still open

torn shuttle
#

for this?

young knoll
#

For everything component

torn shuttle
#

why is it still open, is it because he's dum

young knoll
#

Because MD hasn’t merged it yet

torn shuttle
#

how long has it been open for?

pseudo hazel
#

adventure's integration into the api is 99% of the reason im using paper api

#

please dont ban

young knoll
torn shuttle
#

well

#

would be nice if/when it's added

fiery willow
#

Does someone know how i can place red carpet instead of the default white? I'm Developing on java 1.8 so i can't use the RED_CARPET like this it trows an error. So i'm using the legacy item but don't know how to change the color of it....

        Location startLocation = placedBlock.getLocation().clone();

        for (int x = -CARPET_RADIUS; x <= CARPET_RADIUS; x++) {
            for (int z = -CARPET_RADIUS; z <= CARPET_RADIUS; z++) {
                if (x == -CARPET_RADIUS || x == CARPET_RADIUS || z == -CARPET_RADIUS || z == CARPET_RADIUS) {
                    Location loc = startLocation.clone().add(x, 0, z);
                    Block block = loc.getBlock();
                    if (block.getType() != Material.AIR && block.getType() != Material.valueOf("CARPET")) {
                        while (block.getType() != Material.AIR && block.getType() != Material.valueOf("CARPET") && block.getY() < placedBlock.getWorld().getMaxHeight() - 1) {
                            loc.setY(loc.getY() + 1);
                            block = loc.getBlock();
                        }
                    }
                    if (block.getType() == Material.AIR) {
                        block.setType(Material.valueOf("CARPET"));
                    }
                }
            }
        }
    }```
young knoll
#

setTypeAndData iirc

fiery willow
#

i only can use, but idk how i should use this if could:

setblockdata(BlockData blockData) or setblockdata(BlockData blockData, boolean b)

chrome beacon
#

You should get the docs

split tinsel
#

What is the website that has all the information on packets on it?

#

i forgot the link

tall dragon
#

iirc

blazing ocean
#

it's dead

young knoll
tall dragon
#

ah

young knoll
#

It’s on the wiki now

blazing ocean
#

wait no

#

that's the board

#

this one

split tinsel
sullen marlin
#

Jeez, get it right rad

blazing ocean
#

😔

split tinsel
#

I swear the wiki vg website was easier to use than this

#

do i really need to scroll all the way down?

blazing ocean
#

you had to do the same thing on wiki.vg too?

#

lol

pure tiger
#

Does anyone know how can I get the names and values of a preexisting scoreboard objective by name. I already have tried this but it gets all the names and scores from every existing objective

ScoreboardManager manager = Bukkit.getScoreboardManager();
Scoreboard board = manager.getMainScoreboard();
Objective objective = board.getObjective(scoreboard_points);

for (String entry : objective.getScoreboard().getEntries()) {
    Score score = objective.getScore(entry);
    Bukkit.broadcastMessage(entry+" :"+score.getScore());
}
split tinsel
#

What is "ClientInformation"

#

Oh wait its nullable

#

im an idiot

tender void
split tinsel
#

does anyone know what they changed the name of the ClientboundAddPlayerPacket to in 1.21?

blazing ocean
#

are you trying to make NPCs

#

but it's just a ClientboundAddEntityPacket

obtuse hedge
pure tiger
split tinsel
blazing ocean
split tinsel
blazing ocean
#

I mean

#

you are

split tinsel
#

im passing the ServerPlayer object

blazing ocean
#

it doesn't look like you are

split tinsel
blazing ocean
#

and what type is npc

split tinsel
blazing ocean
#

does it compile

split tinsel
# blazing ocean does it compile

No:

incompatible types: net.minecraft.server.level.ServerPlayer cannot be converted to net.minecraft.network.RegistryFriendlyByteBuf

#

idk why its trying to convert to that

blazing ocean
#

its because you're not passing in the rest of the args

#
public ClientboundAddEntityPacket(
        int entityId, UUID uuid, double x, double y, double z, float pitch, float yaw, EntityType<?> entityType, int entityData, Vec3 velocity, double headYaw
    )
split tinsel
blazing ocean
#

sigh

#

ServerPlayer#uuid etc

split tinsel
#

oh ok

#

idk why minecraft devs made it more complicated

eternal night
#

that constructor is not the one usually used lol

blazing ocean
#

i've usually used that one

eternal night
#

yea but just not the one used by mojang

split tinsel
#

I think I figured it out

public void createNPC(MinecraftServer server, ServerLevel level, UUID uuid, String name) {
        ServerPlayer npc = new ServerPlayer(server, level, new GameProfile(uuid, name), null);
        ServerEntity entity = new ServerEntity(npc.serverLevel(), npc, 0, false, packet ->
        {}, Set.of());

        for (Player player : Bukkit.getOnlinePlayers()) {
            ServerGamePacketListenerImpl connection = ((CraftPlayer) player).getHandle().connection;

            connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, npc));
            connection.send(npc.getAddEntityPacket(entity));
        }
    }
sonic goblet
fossil ridge
#

So I am using Bukkit#getOfflinePlayer(UUID) to generate player skulls, however if the player isn't online it generates a steve head. What can I do?

young knoll
#

You should use PlayerProfile instead

fossil ridge
#

can I do that with just uuid?

young knoll
#

Yes

#

I believe OfflinePlayer even has a getPlayerProfile

fossil ridge
#

oh that's good, ty!

young knoll
#

But you’ll probably need to call complete() on it

fossil ridge
#

should I do that async?

#

oh nvm it's async anyway

#

ty!

#

still a steve..

#

so there's times where the player is a steve but then there's times where the head loads (like 1/5)

mortal vortex
#

Usually that never happens with me. What’s your method like?

young knoll
#

Could be a rate limit thing

mortal vortex
young knoll
#

Look sometimes I need to load 10,000 head textures at once

#

Kek

sly topaz
#

you have to call complete in a different thread

#

wha, complete is a paper thing I guess

young knoll
#

Ah it’s update()

proper cobalt
#
    private List<GuiItem> getGraphItems(Duration timeAgo) {
        List<GuiItem> items = new ArrayList<>();
        for (int i = 0; i < this.values.size(); i++) {
            if (i == 0) continue;
            String color = "green";
            float value = this.values.get(i);

            if (value < this.values.get(i - 1)) {
                color = "red";
                if (this.row > 0) {
                    this.row--;
                } else {
                    if (this.startRow < 4) {
                        this.startRow++;
                    }
                }
            } else if (value > this.values.get(i - 1)) {
                color = "green";
                if (this.row < 4) {
                    this.row++;
                } else {
                    if (this.startRow > 0) {
                        this.startRow--;
                    }
                }
            }

            if (i == 1) this.row = 2;
            items.add(this.getGraphItem(color, value, timeAgo));
            timeAgo = timeAgo.minus(CryptoHistory.UPDATE_INTERVAL);
        }
        this.row = this.startRow;
        Bukkit.getLogger().info("Graph items: " + items);
        return items;
    }

This code is meant to make graphs so like the green goes up and the red goes down.
The red works fine it goes down but the green? The green just stays in the same spot

#

Example

#

Is there an ovbvious flaw, Ai wasnt able to figure it out

#

problem Might be here aswell

#
    private void getItemPlaceRow(Material material) {
        if (material.equals(RED_MATERIAL)) {
            if (this.row < 4) this.row++;
        } else if (material.equals(GREEN_MATERIAL)) {
            if (this.row > 0) this.row--;
        }
    }
rough ibex
#
  • is named get
  • doesn't get & return anything
proper cobalt
#

blame bro over here

#

😭

#

We are refactoring an old project

ebon temple
#

Marek getting a 99% salary cut tomorrow

proper cobalt
#

Hes already long gone lmao

ebon temple
#

void is nasty work bro

proper cobalt
#

nah there was worse code in here written by him

ebon temple
#

my man's a magician getting voids out here

ebon temple
proper cobalt
#

let me check git history

rough ibex
#

so the issue is the green never goes up?

proper cobalt
#

idk why

#

red goes down fine

rough ibex
#

you could refactor this so badly

#
        for (int i = 0; i < this.values.size(); i++) {
            if (i == 0) continue;``` 🤮
proper cobalt
#

kk

rough ibex
#

literally start from 1

proper cobalt
#
 private int row = 2;
    private int startRow = 2;
#

starts at 2

rough ibex
#

I meant in the for loop

#

int i = 1

#

you skip i = 0 always anyway

proper cobalt
#

oh yeah cool

rough ibex
#

some comments would be really nice

#

instead of trying to see the implementation in my head

#

is UPDATE_INTERVAL a static field

proper cobalt
#

yeah

#

public static final Duration UPDATE_INTERVAL = Duration.ofSeconds(60);

proper cobalt
rough ibex
#

i'd love for that to be a config value

proper cobalt
rough ibex
#

but for in dev ok

proper cobalt
#

noted that thsx

rough ibex
#

can I have the rest of the implementation

proper cobalt
#

yeah

rough ibex
#

ie. values

proper cobalt
#

like the whole class?

rough ibex
#

yeah sure

#

how... big is it?

proper cobalt
#

?paste

undone axleBOT
proper cobalt
#

most of it is bloat tho

rough ibex
#

oh okay thats fine

proper cobalt
#

so it wont matter

#

aight its 324 lines but istg most of it can be ignored

#

its just for the buttons or whatever

rough ibex
#

i will suggest using jspecify

#

as a small note

proper cobalt
#

is that like annotations for not null n shi

rough ibex
#

yes

proper cobalt
#

im not in control of that but ill suggest it

rough ibex
#

you can just @NullMarked all of it and it's great

proper cobalt
#

is nullmarked = notnull?

rough ibex
#

intellij supports it just fine

#

yes

proper cobalt
#

kk

#

yeah idk i cant figure it out

rough ibex
#

go ahead and refactor it and see if something shakes out

proper cobalt
#

Yeah good plan

#

Nearly fixed it

#

idk why its still slightly messing up

#

actually nah idk wtf is even that result

#

how is red going up

#

🤦‍♂️

worldly ingot
#

I think you have an if statement backwards lol

tough parcel
#

is there a way to make bungeecord send an FML handshake to a player to be able to see the player's forge mods (i am aware this can be spoofed) or just help me understand the documentation

proper cobalt
#

operations were wrong

#

its nearly fine now

sly topaz
tough parcel
#

alr thanks

blazing ocean
#

@ivory sleet hai

grim hound
#

Can HikariConfig be configured to save the db file locally?

chrome beacon
grim hound
#

Yeah

blazing ocean
#

squeal lite

chrome beacon
#

It can

mortal vortex
sly topaz
#

I do wonder how that changes when it comes to wal/wal2 mode

wet breach
#

if you use hikari with sqlite, it just returns a file handle so at least nothing bad happens in that regards but at that point you might as well not use the lib since its just unnecessary dependency lol

wet breach
mortal vortex
#

Thanks, always appreciate a chance to learn @wet breach

wet breach
sly topaz
#

even if it is just a file handle as you say, you save on the setting up and creation of of the connection object, which doesn't only imply instantiating the object, it's a series of system calls that needs to be done each time

#

besides, there's also the aspect of concurrent reads, though I doubt anyone here would care about that so whether it matters for this scenario is questionable

short pilot
#

hows everyone xd

rough drift
#

wc but good

short pilot
#

these are some pretty neat code practices, they teach them in college too and in style guides for jobs (varies)

rough drift
#

@echo basalt

public class MyManager {
   
   private final Map<UUID, PlayerData> playerData = new HashMap<>();

   public void setPlayerData(UUID uuid, PlayerData data) {
        playerData.put(uuid, data);
   }
   
   public Map<UUID, PlayerData> getPlayerData() {
        return Map.copyOf(playerData);
   }
}
```This is unnecessarily slow, you should use

```java
public class MyManager {
   
   private final Map<UUID, PlayerData> playerData = new HashMap<>();
   private final Map<UUID, PlayerData> playerDataView = Collections.unmodifiableMap(this.playerData);

   public void setPlayerData(UUID uuid, PlayerData data) {
        playerData.put(uuid, data);
   }
   
   public Map<UUID, PlayerData> getPlayerData() {
        return playerDataView;
   }
}
echo basalt
#

One's a snapshot and one's a view

rough drift
#

I am way too tired to make suggestions

#

but yeah depends on what you want

grim hound
mortal vortex
#

How is hikari relevant to that.

grim hound
#

They save their info using Hikari

torn shuttle
#

this update is pretty cool and also a pain in the ass

#

I like the new model stuff

#

hate having to update my code

mortal vortex
#

Did you not read what I said? I meant Hikari is kinda fruitless with SQLite.

grim hound
#

👍

mortal vortex
# grim hound 👍

As frost said. There’s literally no reason to just use Hikari on its own. It does nothing but just return the file, so it’s an unnessecary extra step?

How is this relevant to Hikari, when what’s you’re describing is just a factor of SQLite.

#

You can load data from SQLite. Nothing needs to be done at all with Hikari.

mortal vortex
#

Just using SQLite? You don’t need Hikari.

#

What do you want Hikari for exactly? Hikari is a connection pooler for database management. If you’re using SQLite you don’t need Hikari.

grim hound
#

So how do I read a SQLite file?

chrome beacon
#

You open a regular Connection

mortal vortex
chrome beacon
mortal vortex
#

this is the XY problem. You should ask what exactly it is you need, instead about asking for what you think is the potential solution

grim hound
#

I was thinking of adding a db feature anyway

chrome beacon
grim hound
#

It wasn't purely for reading sqllite

chrome beacon
#

Hikari is useful for other databases

mortal vortex
# grim hound I was thinking of adding a db feature anyway

Yes but you don’t need Hikari to just utilize Databases. I think you’re reading too far ahead. Databases don’t require hikariCP innately. Hikari is a useful tool for concurrent connections with other DBs such as Maria or MySQL

#

Most of your plugin users won’t have a dedicated database. And will instead opt to use just plain old SQLite.

#

Handling SQLite as an edge case under hikari is fine. But using hikari for SQLite alone is kinda pointless

fossil ridge
fossil ridge
chrome beacon
fossil ridge
#

I don't want to block since I am loading up to 30 heads each time the menu gets opened

short pilot
#

Is there anywhere you can find the performance of the API calls in spigot? Like checkBlocks being more taxing than .isOp, and so on

chrome beacon
#

Not really

#

You can benchmark yourself

blazing ocean
#

usually it's kind of common sense that e.g. a block check is more expensive, but the JD to tell you if e.g. that method returns a clone (like item meta), otherwise, look at the impl

young knoll
#

Does anyone have experience with lightweight command apis that work with brigadier

#

I’ve been looking at Commodore and CommandAPI

chrome beacon
#

Commodore uwu

#

CommandAPI isn't that bad but it is heavier

young knoll
#

Does it offer any significant advantages?

chrome beacon
#

Which one

young knoll
#

CommandAPI

chrome beacon
#

It's more abstracted from Brigadier

#

if that's an advantage or not depends on how much you like Brigadier

jagged bobcat
#

It supports commodore too

chrome beacon
#

Cloud is not lightweight

jagged bobcat
#

Option still

blazing ocean
#

I love cloud!

young knoll
#

At this point I should just turn my core utils into a plugin like Eco

#

But having that dependency is blah

chrome beacon
#

Yeah not worth

blazing ocean
#

fuck dependencies amirite-

chrome beacon
#

Users can't figure out how to update or download them

young knoll
#

Kek

chrome beacon
#

so you just get a ton of bug reports

blazing ocean
#

Man am I happy I don't do public plugins

chrome beacon
#

If there's one thing you learn by doing plugin support

#

it's that people do not read

#

even if you tell them what to read

blazing ocean
chrome beacon
#

same goes for bot commands with replies

#

Then just ignore the bot replies

blazing ocean
#

yeah

#

classic

jagged bobcat
blazing ocean
#

real and based

chrome beacon
#

or just beg you in dms for a jar

jagged bobcat
#

Blocking exists

blazing ocean
#

and banning >:)

chrome beacon
#

true

blazing ocean
#

spigot doesn't have the brig api

ivory sleet
#

Commodore is basically just the file format thingy for it

blazing ocean
#

and I doubt you wanna be using NMS

ivory sleet
blazing ocean
chrome beacon
#

You can just use the Brigadier wrapping part of Commodore if you don't want the rest

undone summit
#

Hello, i'm trying to create a custom plugin for my server that uses the LuckPerms API. This is how i'm obtaining the api instance in the onEnable(): java RegisteredServiceProvider<LuckPerms> provider = Bukkit.getServicesManager().getRegistration(LuckPerms.class); if (provider != null) { LuckPerms api = provider.getProvider(); } And this is the error that i'm getting trying to get an instance to their API. [14:42:48 ERROR]: Could not pass event AsyncPlayerChatEvent to TWChat v1.0 java.lang.NullPointerException: Cannot invoke "net.luckperms.api.LuckPerms.getPlayerAdapter(java.lang.Class)" because "this.luckPerms" is null I don't really know why its null because the LuckPerms plugin is loaded and works correctly, and i added the dependency on my pom.xml and my plugin.yml

worldly ingot
#

When are you getting it?

high glen
chrome beacon
#

You should tell us what's wrong

undone summit
worldly ingot
#

Also I don't think LuckPerms' API is a service

chrome beacon
#

We won't compile and run your plugin just to find the issue

worldly ingot
#

You should be using LuckPermsProvider.get() instead

undone summit
#

that's the code that is provided by the LuckPerms docs, but i'll try that too thanks

worldly ingot
#

Is it? lol

undone summit
#

yessir

worldly ingot
#

Oh it is. Well it mentions singleton access as well which is honestly a bit nicer

undone summit
#

i'll try the singleton access then thanks!

chrome beacon
#

Singleton is also on the wiki

#

It's just the last example

rotund hawk
#

How to fix

chrome beacon
#

Looks like it can't find a safe location

rotund hawk
chrome beacon
#

Make sure it's configured in a world that exists and within bounds that has safe locations

rotund hawk
#

This lobby are not connected to world

smoky anchor
chrome beacon
#

?notworking

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.

smoky anchor
#

That I did yesterday too
Guy just did not care...

chrome beacon
#

Yeah people don't like to read

high glen
#

Listen, I'm not a programming specialist, I'm 14 and I watched a few videos on YouTube and I'm trying to make a plugin for the server with my friends. I would tell you what exactly isn't working, but I don't know and the only error I get in the console is "cannot find symbol" so I'm just asking for help

young knoll
#

?learnjava

undone axleBOT
#

For Beginners:

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

For Intermediate to Advanced Learners:

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

Practice and Hands-on Learning:

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

Free Resources and Documentation:

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

Community and Support:

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

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

chrome beacon
#

You dont' need to be a specialist to tell us what's wrong

chrome beacon
undone summit
#

I tried using the Singleton Access but i still get this error: [15:01:50 ERROR]: Error occurred while enabling TWChat v1.0 (Is it up to date?) net.luckperms.api.LuckPermsProvider$NotLoadedException: The LuckPerms API isn't loaded yet! This could be because: a) the LuckPerms plugin is not installed or it failed to enable b) the plugin in the stacktrace does not declare a dependency on LuckPerms c) the plugin in the stacktrace is retrieving the API before the plugin 'enable' phase (call the #get method in onEnable, not the constructor!) This is how i'm accessing the API now: ```java
if(!Bukkit.getPluginManager().isPluginEnabled("LuckPerms")){
logger.severe("LuckPerms was not found, disabling...");
this.getPluginLoader().disablePlugin(this);
}
this.luckPerms = LuckPermsProvider.get();
loadListeners();
logger.info("TWChat enabled!");

young knoll
#

Do you declare a dependency on luckperms

undone summit
#

yes, this is my plugin.yml: yml name: TWChat version: '1.0' main: xyz.unhandlederror.TWChat.TWChat api-version: '1.21' depend: [LuckPerms]

#

oops

high glen
chrome beacon
#

Don't know what's not working, proceeds to tell us what's not working

#

That's the wrong word isn't it

#

🤷‍♂️

smoky anchor
#

Well, I have to say that what you wrote so far looks pretty good.
Which is interesting provided your imports are not working?, did you write all of that manually ?

#

I think all the dependencies are correct.
I don't see any mistake (tho I didn't look really that deep)
Did you reload maven ? @high glen

chrome beacon
#

Could also be an outdated Intellij issue

ancient plank
chrome beacon
#

Actually no the imports are just wrong

#

They don't match the plugin did you write them by hand

#

or use GPT to generate the code for you

ancient plank
#

they said they followed a tutorial on YouTube

#

so i imagine they paused it and copied it all

chrome beacon
#

Outdated tutorial then 💀

smoky anchor
#

-# bruh

quasi gulch
#

I used bstats as a Dependecy in my Plugin and its compiled into the plugin jar but i still get an error that the method cant be found even if its there.

smoky anchor
#

Did you shade bstats ?

quasi gulch
#

yes i think. Do you mean relocate? Yes into my package. I switched to the newest API Version 3.1.0 and then the error came up but when i switch back to 3.0.2 it works again

#

Thats my Pom with Shade Plugin

chrome beacon
#

If you’re using maven for your Spigot plugins (which you should do), it’s easy to make maven automatically save your plugin’s .jar in your plugins folder. There’s two ways of doing this: 1. The lazy way (not recommended) If you only work alone on one computer, you can just directly declare the output location in...

quasi gulch
#

Yeah but its not wrong. And thats not the error?

chrome beacon
#

It is wrong to do so

#

And yes it could be the error

quasi gulch
#

Why can it be the error?

chrome beacon
#

Because you might end up with multiple copies of your jar in your plugins folder

#

and some may not contain the shaded deps

quasi gulch
#

Okay i changed it now but i still get the same error.

young knoll
#

I guess I could just libraries feature all my dependencies

#

And deal with the console spam on startup, kek

glossy laurel
#

Would runTaskLater(p, t, 0) run before runTask(p, t)?

chrome beacon
#

Probably not

young knoll
#

No

glossy laurel
#

Same time?

young knoll
#

Yes

#

Start of the next tick

glossy laurel
#

Wb runTaskLater(p, t, 1) and runTask(p, t)?

young knoll
#

Same time

kind coral
#

is there a documentation about what brigadier'sfork and forward methods do? (and how to use them)

young knoll
#

Check brigs GitHub I guess

kind coral
#

if there was a wiki 🤷🏻‍♂️

glossy laurel
blazing ocean
#

you could check fabric's

young knoll
blazing ocean
#

wdym

glossy laurel
blazing ocean
#

it gets scheduled to run in the next tick

quaint mantle
#

is there a bungee eventfor when a server is down?

#

i mean when it stops

blazing ocean
#

no

#

you would need to do your own SLP checks

wet breach
#

all hikari does, is just connects to the sqlite file no differently then accessing a file. As I said earlier the only reason you would use hikari for this is because you want to allow configuring between mysql or sqlite and having the implementation centralized

ivory sleet
chrome beacon
grim hound
#

But I was requested to add db support

grim hound
young knoll
#

A lot of shared hosts offer a MySQL database tbf

chrome beacon
#

^^

pure dagger
#

why is my intellij telling me that the result of mkdirs() is ignored, i dont need the result, if i assign it to a variable it says that its not used

eternal night
#

ignore it

young knoll
#

If it returns false that means it failed iirc

#

Which isn’t ideal

pure dagger
#

wait my image is ... umm sendin

#

im lagging so much

young knoll
#

Crash the JVM for fun idk

pseudo hazel
#

panic

chrome beacon
young knoll
#

That’s annoying

ivory sleet
pure dagger
# eternal night ignore it

but normally it doesnt make warnings if i ignore results, only if the method only returns something, buti this one does something and returns something

#

its stupid

chrome beacon
#

true if and only if the directory was created, along with all necessary parent directories; false otherwise

smoky anchor
ivory sleet
#

yes IFF it was created

#

if its unknown it'll be false

#

if it wasnt created itll also be false

young knoll
#

So it may have failed or it may already exist

#

I mean I guess you could just check if it already exists first

#

But still, clearly we need 3 different return values!

ivory sleet
#

i think the nio path files api reflects this non-binary state better

#

ye

pure dagger
#
if (!file.exists()) {
            file.getParentFile().mkdirs();
            plugin.saveResource(fileName, false);
        }
``` what does this 'false' change if we already know it doesnt exist?
pseudo hazel
#

that it couldnt be created

#

because of permissions or whatever

young knoll
#

Or java is having an off day

pure dagger
#

what

pure dagger
young knoll
thorn crypt
#

Hey, does someone know how to add a Flag in the list of Flags from the Faction plugin by MassiveCraft ? Because I tried this but I get an error :

MFlagColl.get().getAll().add(new MFlag(16_000, "TurretsFriendly", "Are affect by turrets", "Yes, they are affected", "No they are not affected", true, true, true));

because I get this error :

[19:12:35 ERROR]: Error occurred while enabling InvasionBase v1.0-SNAPSHOT (Is it up to date?)
java.lang.UnsupportedOperationException: null
        at java.util.Collections$UnmodifiableCollection.add(Collections.java:1057) ~[?:1.8.0_312]
        at fr.naosisme.invasionbase.InvasionBase.onEnable(InvasionBase.java:85) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[server.jar:git-Spigot-79a30d7-f4830a1]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) [server.jar:git-Spigot-79a30d7-f4830a1]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:403) [server.jar:git-Spigot-79a30d7-f4830a1]
        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:381) [server.jar:git-Spigot-79a30d7-f4830a1]
        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:330) [server.jar:git-Spigot-79a30d7-f4830a1]
        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.reload(CraftServer.java:752) [server.jar:git-Spigot-79a30d7-f4830a1]
        at org.bukkit.Bukkit.reload(Bukkit.java:525) [server.jar:git-Spigot-79a30d7-f4830a1]
        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) [server.jar:git-Spigot-79a30d7-f4830a1]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [server.jar:git-Spigot-79a30d7-f4830a1]
        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:648) [server.jar:git-Spigot-79a30d7-f4830a1]
        at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1401) [server.jar:git-Spigot-79a30d7-f4830a1]
        at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1236) [server.jar:git-Spigot-79a30d7-f4830a1]
        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) [server.jar:git-Spigot-79a30d7-f4830a1]
        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:1) [server.jar:git-Spigot-79a30d7-f4830a1]
        at net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13) [server.jar:git-Spigot-79a30d7-f4830a1]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_312]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_312]
        at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) [server.jar:git-Spigot-79a30d7-f4830a1]
        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:748) [server.jar:git-Spigot-79a30d7-f4830a1]
        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406) [server.jar:git-Spigot-79a30d7-f4830a1]
        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [server.jar:git-Spigot-79a30d7-f4830a1]
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [server.jar:git-Spigot-79a30d7-f4830a1]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_312]
pure dagger
pseudo hazel
#

when the program does not have permission to create folders in your target directory

young knoll
#

Creation can fail if the JVM doesn’t have write access to that directory

pseudo hazel
#

every file and folder on your PC has a list of things that are allowed to read/write it

pure dagger
#

still dont understand why it has to do with overriding a file if we know there is no file

pseudo hazel
#

usually its a free for all

#

wdym

#

this is about creating directories

pure dagger
#

this 'false' says not to override if it exists

#

but i checked if it does exist

pseudo hazel
#

oh

#

wait

pure dagger
#

xD

#

oh no

pseudo hazel
#

you mean the false in your plugin.saveResource(fileName, false);?

#

I thought you meant why makeDirs returned false

pure dagger
#

yes.... umm what did you think

#

oh

pseudo hazel
#

well

#

in that case, it doesnt matter

#

if the dir didnt exist before, there is nothing to overwrite

#

assuming its all the same path you are making/checking

pure dagger
#

okay so its just safer to do false

pseudo hazel
#

well

#

idk

#

in this case it literally does not matter

#

but the reason for the parameter is to not overwrite the existing file every time you call that function

#

i.e. a config file you dont wanna rewrite everytime

#

because people might have made changes in them

#

I dont even know if you need to makedirs in this case

pure dagger
#

why

pseudo hazel
#

because I think saveresource might make the dirs already for you

pure dagger
#

i dont knwo

pseudo hazel
#

?tryandsee

undone axleBOT
pseudo hazel
#

or keep the makedirs and its fine either way

pure dagger
#

umm maybe later

pure dagger
tiny tangle
#

hi

#

is there a way to use a custom texture for mob or item thats only server side?

chrome beacon
#

clientside you mean

grim hound
#

Yes there is

#

Uh

#

Kinda

blazing ocean
#

You can retexture the entire entity

#

but that's all

tiny tangle
#

i mean serverside, not client

#

i was like sort of checking poly

blazing ocean
#

polymer?

tiny tangle
#

but still cannot understand how to use that api, to manage packets?

#

yes

blazing ocean
#

polymer is for fabric

tiny tangle
#

is there a method that mimic that ?

#

im not sure if using protocollib

#

could do the trick

young knoll
#

Polymer probably does some display entity magic?

#

I would guess

blazing ocean
#

It does not

tiny tangle
#

before I step to going further look on and ask for fabric, i want be sure if can be done on bukkit xD haha ,

blazing ocean
#

Polymer doesn't have custom entity textures

#

because it is literally not possible without retexturing an entire entity

#

I love polymer tho <3

tiny tangle
#

im trying to do its, learning how to make a serverside backpack, so I could imitate "attempt" travelersbackpack mod only serverside on bukkit.

blazing ocean
#

if you do not like a huge fucking PITA, use resource packs

#

item models to be specific

tiny tangle
#

so I could like make a resource carpet and put the png there, then use normally org.bukkit, after that wrapping all?

blazing ocean
#

wha-

#

you create an item model

#

and then you use that item model in bukkit using either custom model data, or new in 1.21.4, the item_model component

young knoll
#

I think there is a language barrier here

#

Otherwise idk what a resource carpet is

tiny tangle
#

the resource directory file its where I put the config.yml and the plugin.yml file

young knoll
#

No

#

You need an entire resource pack and a way to send that pack to the client

tiny tangle
#

its my first time approaching resource packs

#

oh

young knoll
#

Yeah but that’s not specifically designed for sending resource packs

#

You have to put in extra effort smh

blazing ocean
young knoll
#

try {
            provider = PackProvider.create(this, "localhost");
            provider.setDebugLogging(true);
            provider.addPack(new File(getDataFolder(), "test.zip").toPath()).setSendOnJoin(true);
            provider.addPack(new File(getDataFolder(), "test2.zip").toPath()).setSendOnJoin(true);
        } catch (PackProviderException e) {
            e.printStackTrace();
        }

When

tiny tangle
blazing ocean
#

yes

tiny tangle
#

then the output of that make it .rar then using the code above?

#

haha, sorry if i sound like not very smart, never did it before.

#

is this still relevant ? :@EventHandler public void onJoin(PlayerJoinEvent event){ event.getPlayer().setResourcePack( path ); }

young knoll
#

Yes but it doesn’t take a path

#

It takes a web url

tiny tangle
#

ouch

chrome beacon
# blazing ocean yes

Right I forgot to tell you but Javalin and Spring uses 2 different Jetty versions shading both could have unexpected consequences

blazing ocean
#

😭

chrome beacon
#

I disabled Javalin when testing

#

So it could be that

blazing ocean
#

did you do any other changes?

chrome beacon
#

Yeah I also forced web servlet mode in the application builder*

#

That wasn't needed in my code but it appears to be in yours

blazing ocean
#

oh where

#

I mean the bean gets called

chrome beacon
#

hm it's not starting anymore

#

:C

blazing ocean
#

damn

chrome beacon
#

There we go

#

Not shading Spring fixed it uwu

#

Will renable javalin and see if it breaks again

#

That does break it due to duplicate dependencies

#

Oh yeah I remember the shading issue now 🤦‍♂️

#

I had this issue before

#

It's because a few of the dependencies ship their own properties files that spring will automatically detect and try to load

#

and since a couple of them ship the same file it breaks

tiny tangle
#

on my custom item.java : public void onPlayerJoin(PlayerJoinEvent event) { try { // Using a local pack provider PackProvider provider = PackProvider.create((JavaPlugin) getPlugin(), "localhost"); provider.setDebugLogging(true); provider.addPack(new File(getDataFolder(), "test.zip").toPath()).setSendOnJoin(true); } catch (PackProviderException e) { e.printStackTrace(); } } after this where do I put the test.zip/rar , since im using like src/main/java/customitem/item.java .

eternal night
#

Semi certain this should not be done on player join