#help-development

1 messages · Page 1063 of 1

umbral ridge
#

EmilyClient

gilded granite
#

how can I convert an mp3 to ogg with java

eternal oxide
#

not easily

gilded granite
#

I tried every way

eternal oxide
#

just use a website to convert before you package it

gilded granite
#

I broke and apis are too expensive

eternal oxide
#

What? There are free websites you can use to convert them

torn shuttle
#

and free software too

gilded granite
#

yes but I need them to be on my plugins

eternal oxide
#

you convert BEFORE you package. You do not distribute mp3

torn shuttle
#

?paste

undone axleBOT
gilded granite
#

Im making a music playing plugins that download a video and convert it to audio then convert it to ogg witch I cant do

eternal oxide
#

ffmpeg

slender elbow
#

ffmpeg is bae

torn shuttle
#

https://paste.md-5.net/butajoxura.java can someone give me a hint as to why sendFile is erroring with

Error: Unexpected end of form
    at Multipart._final (C:\Users\~\Documents\Discord Bots\resourcepackservermanager\node_modules\busboy\lib\types\multipart.js:588:17)
    at callFinal (node:internal/streams/writable:707:12)
    at prefinish (node:internal/streams/writable:719:7)
    at finishMaybe (node:internal/streams/writable:729:5)
    at Writable.end (node:internal/streams/writable:641:5)
    at onend (node:internal/streams/readable:713:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

I know the problem is with the format I'm sending I just don't know what format it wants

#

sorry I mean uploadFile it's line 43

#

sendSHA1 works so does sendStillAlive

gilded granite
#

how do I fix that ?

  - META-INF/LICENSE.txt
  - META-INF/NOTICE.txt
ffmpeg-6.1.1-1.5.10.jar, javacpp-1.5.10.jar define 1 overlapping classes: 
  - META-INF.versions.9.module-info
maven-shade-plugin has detected that some class files are
present in two or more JARs. When this happens, only one
single version of the class is copied to the uber jar.
Usually this is not harmful and you can skip these warnings,
otherwise try to manually exclude artifacts based on
mvn dependency:tree -Ddetail=true and the above output.
See http://maven.apache.org/plugins/maven-shade-plugin/```
torn shuttle
#
[22:32:05 INFO]: [STDOUT] Writer's Content: --190b328f8f0
Content-Disposition: form-data; name="file"; filename="ResourcePackManager_RSP.zip"
Content-Type: application/zip
Content-Transfer-Encoding: binary


--190b328f8f0--

am I being dumb? seems fine (don't have the inputstream in there, I guess that could be it?)

gilded granite
#

what is the codec of ogg?

eternal oxide
#

vorbis

quiet ice
#

To come to the question: You can define the maven-shade-plugin to exclude those files, supressing the warning.
Though regardless chances are you'll be breaking some license unless you manually put a replacement license in there.

night minnow
#
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.20.4-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>

anyone knows why i cant use 1.21-R0.1-SNAPSHOT?

besides having jdk 21 in my project structure, what else should i check?
for context.... im trying to learn and im trying to update a plugin

gilded granite
#

try that
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

#

?paste

undone axleBOT
night minnow
#

i feel so dumb, i tried that like 5 times and never noticed the maven reload project, i mean i know i had to reload the proejct but i didnt even try from the sidebar icon

#

thanks btw

gilded granite
eternal oxide
#

you can't

#

you have to put it in a resource pack and have the client download it

#

it should also be single channel not stereo

gilded granite
#

yeah its in a ressource pack but the game doesnt detect the song

#

single channel?

eternal oxide
#

did you make teh client download it?

#

Mono

gilded granite
#

no I forgot how to sendRessourcePack

#

setRessoucePack

#

also I got this error s.schild.jave.EncoderException: Exit code of ffmpeg encoding run is -13
[00:02:43 WARN]: at ws.schild.jave.Encoder.encode(Encoder.java:647)
[00:02:43 WARN]: at ws.schild.jave.Encoder.encode(Encoder.java:490)
[00:02:43 WARN]: at ws.schild.jave.Encoder.encode(Encoder.java:354)
[00:02:43 WARN]: at ws.schild.jave.Encoder.encode(Encoder.java:321)
[00:02:43 WARN]: at org.liam.liamplugins.PlayMusicCommand.downloadAndPlayMusic(PlayMusicCommand.java:126)
[00:02:43 WARN]: at org.liam.liamplugins.PlayMusicCommand.lambda$onCommand$0(PlayMusicCommand.java:42)
[00:02:43 WARN]: at java.base/java.lang.Thread.run(Thread.java:1583)

mint oar
#

So I'm guessing it'll be the year 20,202,020 when something about an experimental thing for spigot for the server.jar stuff is done? I get it takes time and y'all do this in your free time, but I didn't know it takes an entire month and still not even close to finished.

sand spire
#

it's opensource you can finish it yourself

eternal night
#

"not even close to finished" is also obviously a statement

#

it should be fairly stable, just some plugin compatibility breaking (maybe, if so, open issue) regarding the enum -> interface conversion

young knoll
#

You should also spam lynx to get those patches ported

#

Smh

eternal night
sleek estuary
#

how i get worldmap instance by world name

young knoll
#

Probably display entities

dawn flower
#

wouldnt the client explode trying to render all of that entities

nova notch
#

invisible item frames with maps?

young knoll
#

Also possible

#

Looks to be 32x32, that’s only 1k display entities

gilded granite
#

how can I use local database?

young knoll
#

If you use text displays and some trickery it’s way less

torn shuttle
young knoll
#

Yes but they said it doesn’t use an rp

#

(They believe)

torn shuttle
#

you can also make it with maps potentially but less comfortably

gilded granite
#

how can I code a economy system in my plugin?

young knoll
#

Display entities are pretty performant

#

So it would probably be fine

sleek estuary
#

why returns 0? i copied the code from default renderer map of spigot api

#

i want see how the spigot get a instance. how i use "ctrl shift r " on github?

remote swallow
#

its on stash

#

?stash

undone axleBOT
remote swallow
#

and anything Craft prefixed would be in craftbukkit

gilded granite
#

how can I hot swap code ?

#

like on the server

#

with breakpoints etc

quaint mantle
#

for 1.19.4

#

which jdk i need use ?

#

17 or 18 ?

remote swallow
remote swallow
sleek estuary
hushed relic
#

does anyone know how to make a falling block bounce off of a wall

remote swallow
#

spigot shades and patches it

#

its also on stash

sleek estuary
#

can you help me with this?

remote swallow
#

im not gonna search craftbukkit for you, craftbukkit is a giant project

#

if you want that run buildtools and open spigot in intellij and use searching features there

sleek estuary
remote swallow
remote swallow
# gilded granite ok thx

To hotswap download jbr and hotswap agent put hotswap agent in jbr/lib/hotswap
modify server startup to be jbr/bin/java.exe -XX:+AllowEnhancedClassRedefinition -XX:+AllowRedefinitionToAddDeleteMethods -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -XX:HotswapAgent=fatjar -jar Spigot-whatever.jar
in intellij create a debug run configuration and set the adress to 127.0.0.1
start the server and run the debug configuration
then modify code and press the hotswap keybind, default is nothing so just search for it and add one

sleek estuary
remote swallow
#

sure

sleek estuary
#

right

#

?

remote swallow
#

yes

sleek estuary
#

ok

#

thx

#

this is all because I don't know what WorldMap expects in the string when creating this object

gilded granite
remote swallow
sleek estuary
#

LOLLLLLLL

gilded granite
remote swallow
balmy sonnet
#

How to remove the asterisk?

stone geyser
#

I have a question and a problem that when I try to drag the stacked items, it simply doesn't let me stack more than 1. How can I change this?

@EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        if (event.isCancelled() || !(event.getWhoClicked() instanceof Player)) return;

        Player player = (Player) event.getWhoClicked();
        PlayerInventory inventory = player.getInventory();
        ItemStack clickedItem = event.getCurrentItem();
        InventoryType.SlotType slotType = event.getSlotType();

        if (clickedItem == null || !isArmor(clickedItem) || clickedItem.getAmount() == 1) return;

        if (slotType == InventoryType.SlotType.ARMOR) {
            ItemStack cloneItem = clickedItem.clone();
            cloneItem.setAmount(1);
            switch (event.getSlot()) {
                case 5: 
                    if (inventory.getHelmet() == null || inventory.getHelmet().getType() == Material.AIR) {
                        inventory.setHelmet(cloneItem);
                        clickedItem.setAmount(clickedItem.getAmount() - 1);
                        event.setCancelled(true);
                    }
                    break;
                case 6:
                    if (inventory.getChestplate() == null || inventory.getChestplate().getType() == Material.AIR) {
                        inventory.setChestplate(cloneItem);
                        clickedItem.setAmount(clickedItem.getAmount() - 1);
                        event.setCancelled(true);
                    }
                    break;
                case 7:
                    if (inventory.getLeggings() == null || inventory.getLeggings().getType() == Material.AIR) {
                        inventory.setLeggings(cloneItem);
                        clickedItem.setAmount(clickedItem.getAmount() - 1);
                        event.setCancelled(true);
                    }
                    break;
                case 8:
                    if (inventory.getBoots() == null || inventory.getBoots().getType() == Material.AIR) {
                        inventory.setBoots(cloneItem);
                        clickedItem.setAmount(clickedItem.getAmount() - 1);
                        event.setCancelled(true);
                    }
                    break;
            }
        }
    }
torn shuttle
#

oh god discord is starting to burn into my 4th monitor

#

saved, thanks random 9 hour long yt video for avoiding lcd burn-in

nova notch
#

4 monitors is crazy

torn shuttle
#

used to be 6

#

but then they started making much larger monitors

#

I hope it will be 1 monitor within the next 15 years, and I'll switch to vr goggles

nova notch
#

what the fuck

remote swallow
#

join the meta verse

torn shuttle
#

because the tech isn't there yet

#

there's a really interesting headset coming out in a few months though

#

probably the most interesting in years

remote swallow
#

name?

torn shuttle
#

bigscreen beyond, the name sucks

#

they're tiny

#

and light

remote swallow
#

that seems weirdly small

torn shuttle
#

the dream is having them as large as normal sunglasses or so

remote swallow
#

im guessing its fully pc controlled

torn shuttle
#

yes

#

not even wireless

#

also requires controllers, they don't sell any, and lighthouses from valve

remote swallow
#

kekw

torn shuttle
#

they're not for an avg consumer, really they basically made these just for me

remote swallow
#

just for you

torn shuttle
#

they require a face scan because the face place it 3d printed for your face specifically

#

they require you to basically already own some generation of a previous valve vr headset which I do

#

it's stupid expensive, like nearly 3x more than what meta is doing

#

and it requires a beast of a pc to use

drowsy helm
#

i dont think vr is at a point where it could replace my monitors comfortably

#

hurts my eyes after a few hours

torn shuttle
#

there's two major problems, comfort and resolution

#

in the earlier vr generations the resolution just wasn't good enough to realistically replace a monitor, plus with the distortion it just made text hard to read in general

#

plus it is a heavy and hot thing you strap on your face which after even a single hour can already have you itching to take it off

drowsy helm
#

yeah definitely

torn shuttle
#

I'm not saying this solves it all, I don't think forcing using a cable is realistic plus the resolution is a huge leap from previous generations but still not what it needs to be for actual work imo (though I haven't tested it, on account that it isn't even out yet)

#

but it's the first vr headset that I feel I've seen actually tackle things with actual practical long-term use in mind

drowsy helm
#

damn 127 grams

#

thats pretty good

torn shuttle
#

the vision pro was the complete opposite, they went out of their way to make it huge and used heavy materials just to get a premium look

#

yeah 127g is genuinely starting to get there

drowsy helm
#

yeah the vision pro had the right idea but absolutely wrong execution

#

like it was to be expected from apple, but no third party xr support

#

is dumb

torn shuttle
#

the heaviest standard sunglasses you can buy are at around 50g, for reference

#

just for normal sunglasses

#

I don't think the vision pro had a single good original idea tbh

drowsy helm
#

pass through is amazing

#

picture quality is great

torn shuttle
#

sure, it's an extremely expensive execution of an ill-concieved concept

#

I wish I could try that headset

#

I'd be tempted to buy it if it feels good when in use but I don't feel like dropping that much cash just to try it

drowsy helm
#

its good, but the novelty wares off after a few hours

#

then it's just an expensive movie watching device

torn shuttle
#

not the vision pro

#

the one I was showing

drowsy helm
#

ah

torn shuttle
#

it's about $1400 here

drowsy helm
#

you've tried vr before right

torn shuttle
#

I have an htc vive in the drawer next to me

#

one of the OGs

drowsy helm
#

I'm yet to be compelled enough to use a vr headset for productivity

#

My project for the first half othis year was all vr related and i got really sick of the headset in the first 2 weeks of using it

torn shuttle
#

there's only one thing I liked doing with it which was previewing 3d models I was working on with it but the htc vive is so insanely bulky it's not fun at all to try to keep putting it on and off as you're working on stuff

#

there was a strap concept that was really neat where you could just flip the headset up kinda like the night vision goggles of the army

#

I think if I was to use it consistently for actual work I'd probably want something like that

drowsy helm
#

the vive is waayy to bulky for me to use often

torn shuttle
#

same

drowsy helm
#

quest 3 is pretty good, but still gets heavy after a while

torn shuttle
#

I have every port of my gpu in use since I have 4 monitors so I extra don't feel like redoing wiring just to throw something vr-related on

#

but get me something with the bigscreen beyond format and weight, make it wireless and suddenly I will be very interested

#

you can also do what apple did to cheat battery life, I don't mind having a battery bank in my pocket

#

I'd rather have the battery in my pocket than on my face

echo basalt
#

get a second gpu for the purpose of more monitors

torn shuttle
#

but like I said monitors got bigger

#

there is no longer a point in me doing that

#

I'm sure you've seen pictures of my setup

echo basalt
#

I'm sure I don't care

torn shuttle
#

cope and seethe grease boy

#

do you have a pizza in the oven again

echo basalt
#

nah

torn shuttle
#

what, the chicken place is back from holiday?

echo basalt
#

been back for a month

torn shuttle
#

did you go there on day 1 to eat a month's worth of chicken

echo basalt
#

no

torn shuttle
#

yeah right

worthy yarrow
#

What’s the issue with chicken?

torn shuttle
#

speaking of, smoothie time

dawn flower
#

how do i flip a vector offset from a direction to another direction? so if the vector is facing west and the values were (1, 1, 1) i say make it east it'll return (-1, -1, -1)
idk if that made sense

dawn flower
#

that would work for west -> east only

#

i need the 2 more cases

drowsy helm
#

if it's normalised, it should work

dawn flower
#

it's really precise so i cant really normalize it

agile anvil
#

No need to normalize, just multiply by -1

dawn flower
#

i'm really not sure how that would work, but ok

#

wait

agile anvil
#

Have you done some basic algebra?

dawn flower
#

as i said thats only for west to east

drowsy helm
#

if you just want to flip the cardinality you need to get the identity then multiply by -1

dawn flower
#

i know i can multiply it by -1 to flip it

worthy yarrow
dawn flower
#

multiplying by -1 makes north south, south north, east west, west east

drowsy helm
#

so rotate it

#

not flip?

worthy yarrow
#

I'm having an issue like this right now actually

dawn flower
#

ok

drowsy helm
#

flipping implies it's binary

agile anvil
#

If what you want is get the opposite direction of a given vector by keeping its magnitude, multiply by -1 is enough. If this is not what you mean please be precise

worthy yarrow
#

I mean, it's not very pretty but per messing up geol's suggestion I created that weird 3d visualization thing

dawn flower
agile anvil
drowsy helm
worthy yarrow
drowsy helm
#

correct?

#

if tahts the case just apply a rotation matrix

#

wait Vector comes with a built in rotate around method

worthy yarrow
worthy yarrow
# agile anvil That's why display entity would have been much easier ! Just apply size transfor...

Anyway got the schematic pasting into the correct location now, though I'm still having issues with the visual overlay dependent on players current view (direction), there are cases in the west/north direction where the visual overlay is placed closer to the player than it should be ie:

https://gyazo.com/3e669edde61ab5e72b446f351b617c95

As opposed to what it should look like:

https://gyazo.com/2c5ca0a6ab18b8870444b0351689dc57

https://paste.md-5.net/iqenuwepok.cs

#

Depending on the players current view direction, I either need to add / subtract from my x/z values to display this correctly right?

agile anvil
#

What you could do is just specify target location, and direction vector.

add the direction vector to the location to draw the line going further, and take the orthogonal vector to go to the right.

The direction vector should not be the one of the player, but the axis vector the closer to the one of the player (cosine similarity between (1, 0, 0), (0, 0, 1), (-1, 0, 0) and (0, 0, -1))

#

How to get the orthogonal: just rotate the direction 90d around Y

#

Or maybe more -90d if minecraft uses trigo rotations

worthy yarrow
#

Ok I'll play around rq

agile anvil
#

Recap:

  1. Get the closest axis vector with the player direction. Let's refer to it as V
  2. Rotate V 90 (or -90d) around Y (0, 1, 0), referred as O
  3. Start at the target location and get the lines to draw by adding V and O to it. Just think it as a path to follow (first V, then O. restart from start loc + O, then V. Then do the same with the start loc + Y)
  4. Don't forget to multiply V and O by width and Y by height
worthy yarrow
#

Alrighty got it working!

#

Damn I am being a good math student today

#

Rolyn you're awesome thank you

#

Oops new bug

agile anvil
#

So what's wrong when facing north?

worthy yarrow
#

Uh it seems like the paste location is rotated compared to the visual overlay

#

Rather vice versa tbf

agile anvil
#

Can I see the paste code ?

worthy yarrow
#
public void placeStructure(Player player, String schematicFileName, Location targetLocation, Location oppositeCorner) {
        File schematicFile = new File(plugin.getDataFolder(), "StructureItems/" + schematicFileName + ".schem");
        ClipboardFormat format = ClipboardFormats.findByFile(schematicFile);

        if (format != null) {
            try (FileInputStream fis = new FileInputStream(schematicFile)) {
                Clipboard clipboard = format.getReader(fis).read();
                World world = BukkitAdapter.adapt(player.getWorld());

                BlockVector3 pasteLocation = BlockVector3.at(
                        Math.min(targetLocation.getBlockX(), oppositeCorner.getBlockX()) + 4,
                        Math.min(targetLocation.getBlockY(), oppositeCorner.getBlockY()) + 3,
                        Math.min(targetLocation.getBlockZ(), oppositeCorner.getBlockZ()) + 2
                );

                try (EditSession editSession = WorldEdit.getInstance().newEditSession(world)) {
                    Operation operation = new ClipboardHolder(clipboard)
                            .createPaste(editSession)
                            .to(pasteLocation)
                            .ignoreAirBlocks(true)
                            .build();
                    Operations.complete(operation);
                }
            } catch (IOException | WorldEditException e) {
                e.printStackTrace();
            }
        } else {
            player.sendMessage("Invalid schematic file: " + schematicFileName);
        }
    }```

Lmk if you want this in a paste
agile anvil
#

nah that's fine

worthy yarrow
#

Those little offsets on the vector3 might be the issue too

#

Though I need them, otherwise the paste location is off

agile anvil
#

Yeah what are those offsets lmao ?

worthy yarrow
#

So prior to not having them, it would paste in at the location (obv) but was off by those offset amounts

#

Simplest thing i thought was just add those to the paste location

agile anvil
#

You don't need them

#

You just forgot to clone the eye location when adding the direction * 5

worthy yarrow
#

Oh breh

#

Location targetLocation = eyeLocation.clone().add(closestAxis.clone().multiply(5));

So just this, and remove the offsets?

agile anvil
#

I think so

worthy yarrow
#

lemme try

#

Ah it's doing the thing again

worthy yarrow
#

The paste location is still relative to the visual outline, it's just kinda bugging out

agile anvil
#

Yeah actually the issue might come from:

  • you are manipulating the targetLocation often so somewhere you might unintentionnaly change it (since location are passed by and edited by ref)
  • you need to rotate the schematic when pasting
worthy yarrow
#

It's just odd that it does the weird rotated paste only when viewing north

agile anvil
#

What you should do:
clean a lil your code, and try to make it easier
pass the locations by cloning them, and not directly giving them to methods

#

Also try to do some basic debugging to check the target location, the closest axis vector

worthy yarrow
#

I could pass cloned locations as well as return cloned ones couldn't I?

agile anvil
#

Btw you can get the closest vector by normalizing the direction vector and flooring x z and setting y to 0

agile anvil
worthy yarrow
agile anvil
#

it's hard to evaluate if there is a mistake somewhere

agile anvil
#

not flooring, mb

worthy yarrow
#

Ok gotcha

worthy yarrow
worthy yarrow
#

btw @agile anvil how similar would my structure be given I switched to text displays? I only ever put time into learning them in one project but that was a while ago, so I'm not sure if I still need to do the outline magic

agile anvil
#

You can remove all the drawLines, all the corner computations etc. You just have to spawn a blockdisplay or another display type and apply a transformation to it

worthy yarrow
#

Alright I'll play with it when I get around to doing so

#

Thank you again!

agile anvil
#

Nice !

worthy yarrow
#

Handwriting is truly awful, but it’s really helped writing down structures of systems here

ivory sleet
worthy yarrow
#

Hey man maybe I just appreciate writing and paper

#

One day that's not going to exist anymore and everything will be virtual

#

😦

ivory sleet
#

doesnt sound normal, you sure normal man consented to all of this?

agile anvil
#

Writing on paper sheet is the best tool I have

blazing ocean
#

^

worthy yarrow
#

Writing isn't normal????

blazing ocean
worthy yarrow
#

Man I have a stronger photographic memory than anything so writing things down helps a lot

ivory sleet
agile anvil
#

oops let me fix this

nova notch
#

does everyone here just hate paper or something

ivory sleet
#

No I was just joking about it

#

Paper people are cool

#

But we cooler (i wish at least)

worthy yarrow
agile anvil
worthy yarrow
#

Probably the only reason I even bother tbf

agile anvil
#

But what I like about paper is that there is nothing to block my thoughts

#

computer is taking more time and harder to transcribe all my thoughs. But if I need to organize things clearly I'll also do some other representations using computers

ivory sleet
worthy yarrow
#

I've my little pocket notebook for when I'm out and about and have (what I think to be) a great idea

ivory sleet
#

lol okay

agile anvil
#

Wait you handwrite code?

worthy yarrow
#

It's rather pseudo

agile anvil
#

Or is it just some pipelines etc

#

ahh ok ok fine

#

"Steps"

worthy yarrow
#

Yeah more or less

#

Idk where my pocket book went, but thats where I have my little pseudo code things

#

I take it with me everywhere I go incase I randomly have (what I think to be anyway) a great idea

ivory sleet
#

damn, like I’d only use sheet of paper to draw uml class relations, solve algorithmic problems or math problems but thats that

worthy yarrow
#

I still do this

#

But I use printer paper

#

I design the structure in my (regular) notebook, and keep ideas in the pocket book

worthy yarrow
ivory sleet
#

Ah yea

#

I use a whiteboard for math mostly

worthy yarrow
#

I've always thought people who have whiteboards in their homes to be teachers

#

Maybe not a fridge whiteboard

#

But there's been a couple people with like full classroom whiteboards in their office room kek

ivory sleet
#

I taught math once, will never happen again ever

#

yea lol touché

tepid turret
#

Anyone know easy ways to make my plugin size smaller?

#

its currently 14mb which is huge, so i think im shading things wrong or something

#

Using Maven and IntelliJ

ivory sleet
#

yea I mean u could use the libraries feature

#

To make the server download dependencies of urs at runtime

worthy yarrow
#

14mb dear god

tepid turret
#

and i am getting GIANT shade warnings too

agile anvil
tepid turret
#

I dont know how to fix it though

ivory sleet
#

Ru shading all of spigot or what lol

tepid turret
ivory sleet
tepid turret
agile anvil
#

Show us your pom

tepid turret
#

Technically i am using paper but that shouldnt matter here

ivory sleet
#

Yea no biggie problably

worthy yarrow
#

It's funny I asked for help with essentials one time, and got absolutely shit on there for using spigot kek

blazing ocean
#

mine is 50mb

tepid turret
worthy yarrow
#

He like to make malware

blazing ocean
#
dependencies {
    implementation("org.apache.commons:commons-lang3:3.0")
    implementation("dev.s7a:base64-itemstack:1.0.0")
    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
    implementation("com.noxcrew.interfaces:interfaces:1.2.0-SNAPSHOT") {
        exclude("io.papermc.paper", "paper-api")
    }
    implementation("com.noxcrew.noxesium:api:1.2.0")
    implementation("net.radstevee:radlib:1.0-SNAPSHOT")
    implementation(platform("io.github.jan-tennert.supabase:bom:2.4.2"))
    implementation("io.github.jan-tennert.supabase:postgrest-kt")
    implementation("io.github.jan-tennert.supabase:realtime-kt")
    implementation("io.github.jan-tennert.supabase:storage-kt")
    implementation("io.ktor:ktor-client-apache:2.3.11")
    implementation("org.incendo:cloud-paper:2.0.0-beta.7")
    implementation("org.incendo:cloud-kotlin-extensions:2.0.0-rc.1")
    implementation("org.incendo:cloud-kotlin-coroutines:2.0.0-rc.1")
    implementation("net.radstevee.packed:packed-core:0.3.1")
    implementation("net.radstevee.packed:packed-negative-spaces:0.3.1")
    implementation("com.github.sya-ri:kgit:1.0.6")
    implementation("io.javalin:javalin:6.1.3")
    compileOnly("com.viaversion:viaversion-api:5.0.0-SNAPSHOT")

    paperweight.devBundle("net.mire.palm", "1.20.6-R0.1-SNAPSHOT")
}
``` big
tepid turret
blazing ocean
#

dw about it

worthy yarrow
#

Like I said

#

he likes to make malware

blazing ocean
#

and he can't code in console

worthy yarrow
#

Hey at least I made a cool 3d representation of a cube in minecraft

blazing ocean
#

yea that is pretty cool

tepid turret
worthy yarrow
#

Oh you don't even know

#

It looks goofy cuz particles but I mean

ancient forge
#

how far into java should i learn to start making plugins?

#

like should i learn basics on classes and how to make programs or is there more advanced stuff i should know?

ivory sleet
#

No not really, fundamentals of Java and OOP is most important

#

OOP concepts like polymorphism, inheritance, objects, classes and encapsulation

ancient forge
#

Im taking a course and so far its tought me variables, classes and methods.

ivory sleet
#

Java stuff like local/instance/static variables, classes, instance/static methods, primitive types and class types, new-keyword, understanding the structure of a class, class constructors etc

blazing ocean
#

love how the new keyword is on there

worthy yarrow
#

whats new

#

never heard of that

blazing ocean
#

i genuinely haven't used it in a year

worthy yarrow
#

Buddy is not keen on reinventing the wheel apparently

#

Why create new objects when you can just use provided ones?

blazing ocean
#

never said i wasn't creating them

humble tulip
#

Does kotlin have new?

blazing ocean
#

nope

worthy yarrow
#

oh no wonder

humble tulip
#

Do you use kotlin?

blazing ocean
#

it just gets omitted

#

i do

humble tulip
#

Ha

blazing ocean
#

and i love it

humble tulip
#

I don't like kotlin tho

worthy yarrow
#

beat ya

blazing ocean
#

my phone is slow

worthy yarrow
#

Non apple user smh

humble tulip
#

Much prefer java

#

But

#

Kotlin does have some nice features

blazing ocean
#

my phone was 150€ i told you

#

shitty phone

worthy yarrow
#

And that's why I beat you to the kotlin gif :p

humble tulip
blazing ocean
#

i know

#

my phone is just shit

#

not the software

worthy yarrow
#

Rad's busy making the next hypixel right now

blazing ocean
#

no not the next hypixel™

worthy yarrow
#

Radpixel?

blazing ocean
#

no

#

:son:

#

😭

blazing ocean
blazing ocean
# humble tulip Kotlin does have some nice features

are you talking about this

fun registerEventFonts(vararg offsets: Double): Map<Double, UIFont> = buildMap {
    offsets.forEach {
        val offset = 19 + it
        val backgroundOffset = -10 - it

        put(it, object : UIFont {
            override val packedFont = pack.addFont {
                key = Key("mire", "beaver_offset_$it")
                ttf {
                    key = Key("mire", "beaver_upper.ttf")
                    shift = listOf(0.0, offset)
                    size = 16.0
                    oversample = 17.0
                }

                bitmap {
                    key = Key("mire", "gui/overlay/background/notification.png")
                    ascent = backgroundOffset
                    height = 13.0
                    chars = listOf("\uE000")
                }
            }
            override val glyphWidths = Fonts.BEAVER_UPPER.glyphWidths
            override val registeredSprites = listOf<RegisteredSprite>()
        })
    }
}
#

i should make the shift a pair instead

humble tulip
#

That's exactly what I don't like

#

That syntax is weird

blazing ocean
humble tulip
#

What even is "it"

blazing ocean
#

it's the default variable from a lambda

#

like, map, forEach, etc

#

you can rename it

humble tulip
#

Honestly i have no idea what that code does

#

And how to read it

blazing ocean
#

it is pretty cool once you pair it with the stdlib

        val glyphWidths = fontGlyphs.associate { it.char to it.width }.toMutableMap().apply {
            set(' ', values.first())
        }.filterKeys { it.code > 0 }.toMap()
humble tulip
#

Reason i like java is because of how verbose it is

blazing ocean
#

kotlin can be verbose

humble tulip
#

It's easy to jump in and figure what's going on

blazing ocean
#

if you want it to

blazing ocean
#

i have an even more confusing snippet

#
    override fun run(remainingArgs: List<String>) {
        val fontName = remainingArgs.firstOrNull() ?: run {
            log("No font provided!", LogType.ERROR)
            return
        }
        val dir = File("fonts", fontName.replace("_bold", ""))
        val jsonFile = File(dir, "$fontName.json")
        val json = jsonFile.readText()
        val font = Json.decodeFromString<FontMetadata>(json)
        val fontGlyphs = font.glyphs
        val glyphWidths = fontGlyphs.associate { it.char to it.width }.toMutableMap().apply {
            set(' ', values.first())
        }.filterKeys { it.code > 0 }.toMap()
        log("Found ${glyphWidths.size} glyphs for font $fontName", LogType.INFORMATION)
        log("Glyph widths for $fontName: $glyphWidths", LogType.INFORMATION)
        log("Generating kotlin map code...", LogType.INFORMATION)
        println("buildMap {")
        println(
            glyphWidths.toList().split(4).joinToString(
                separator = "\n    ",
                prefix = "    "
            ) { entries -> entries.joinToString(separator = "; ") {
                "put('${if(it.first in listOf('\'', '\\')) "\\${it.first}" else it.first}', ${it.second})"
            } })
        println("}")
    }
agile anvil
#

How does one even choose Kotlin vs Java?

blazing ocean
blazing ocean
#

so i converted our codebase to kotlin

#

loved it

agile anvil
#

damn

blazing ocean
agile anvil
blazing ocean
#

lmao

wet breach
torn shuttle
#

I'm about to give up on this thing and just go use some actual library for this

tardy delta
#

familiar with what exactly?

torn shuttle
#

HttpUrlConnection, specifically to send large files

tardy delta
#

i mean whats the issue exactly

blazing ocean
#

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

blazing ocean
#

get ?ask'd haha

torn shuttle
#

aaaand the apache httpclient doesn't seem to like my java version

#

well then

#

either that or the shader doesn't hmm

#

oh it is the shader, man I don't remember how pom works after so much time working with gradle

shadow night
#

Lol

silent wave
#

i have problems with my code

#

import org.bukkit.Color;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.projectiles.ProjectileSource;

public class ArcherClassEffect implements Listener {

    @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
    public void onPlayerDamageByArrow(EntityDamageByEntityEvent event) {
        Entity damager = event.getDamager();
        Entity victim = event.getEntity();

        if (damager instanceof Arrow && victim instanceof Player) {
            Arrow arrow = (Arrow) damager;
            ProjectileSource source = arrow.getShooter();

            if (source instanceof Player) {
                Player shooter = (Player) source;
                Player damaged = (Player) victim;

                if (shooter.getInventory().getHelmet() != null &&
                        shooter.getInventory().getChestplate() != null &&
                        shooter.getInventory().getLeggings() != null &&
                        shooter.getInventory().getBoots() != null) {

                    LeatherArmorMeta helmetMeta = (LeatherArmorMeta) shooter.getInventory().getHelmet().getItemMeta();
                    LeatherArmorMeta chestplateMeta = (LeatherArmorMeta) shooter.getInventory().getChestplate().getItemMeta();
                    LeatherArmorMeta leggingsMeta = (LeatherArmorMeta) shooter.getInventory().getLeggings().getItemMeta();
                    LeatherArmorMeta bootsMeta = (LeatherArmorMeta) shooter.getInventory().getBoots().getItemMeta();

                    if (helmetMeta != null && chestplateMeta != null && leggingsMeta != null && bootsMeta != null) {
                        if (helmetMeta.getColor().equals(Color.GREEN) &&
                                chestplateMeta.getColor().equals(Color.GREEN) &&
                                leggingsMeta.getColor().equals(Color.GREEN) &&
                                bootsMeta.getColor().equals(Color.GREEN)) {

                            damaged.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 600, 1));
                        }
                    }
                }
            }
        }
    }
}```
#

the potion effect isst working

blazing ocean
#

?paste

undone axleBOT
tardy delta
#

bruh its not that long

blazing ocean
#

it is on mobile

drowsy helm
#

do a print and see if the if is executing

blazing ocean
#

ok fourteen buddy

tardy delta
#

genuine question

blazing ocean
#

i'm bored wtf do you want

tardy delta
#

||go find them girls||

silent wave
shadow night
tardy delta
#

ah dammit i forgot

#

maybe he enjoys some girls too

shadow night
#

Well, who doesn't enjoy some boob physics

tardy delta
#

wha

torn shuttle
#

?paste

undone axleBOT
shadow night
#

lol

torn shuttle
tardy delta
#

anyways, back to my disassembler

torn shuttle
#

no it fails to compile

silent wave
drowsy helm
#

how can you do a print?

torn shuttle
#

specifically the build part fails

drowsy helm
#

Bukkit.broadcastMessage

hazy parrot
torn shuttle
#

figured it out but I'm still getting the same unexpected end of form this is weird

noble sinew
#

@odd gulch My bounty, Skript, was removed, but it was 100% made by us. And it got huge downloads.

torn shuttle
#

oh heck

#

I finally did it

#

cool

#

we got the, number one victory royale, yeah fornite we about to get down

agile anvil
#

I haven't played with terrain generator since 1.15 so I guess there might be some changes. Is it possible to edit the vanilla world generator easily in 1.21 or is it still a pain that requires so many injections?

wooden zodiac
#
        ShapedRecipe recipe = new ShapedRecipe(new NamespacedKey(this, "diamond_sword"), new ItemStack(Material.DIAMOND_SWORD));
        recipe.shape(
                " D ",
                " D ",
                " D ");
        recipe.setIngredient('D', Material.DIAMOND);
        Bukkit.addRecipe(recipe);
``` why it wont let me craft diamond sword with 3 diamonds in middle
#

tutorial guy did same code and it worked for him

drowsy helm
#

show the entire class

wooden zodiac
#

cant give ss

#

wait let me pase code in pastebin

drowsy helm
#

other then it having the underscore in the shape, it looks fine to me

#

could maybe be the key's name??

wooden zodiac
wooden zodiac
#

empty ones dont work

drowsy helm
#

according to a post in 2015 "It will only work if there is not already a recipe for that type of item. Since you can already craft golden apples, it doesn't allow it."

#

which doesn't sound right

wooden zodiac
#

things changed

#

how's tutorial guy's recipe working then

#

he didnt use any extra code to remove previous recipe

wet breach
#

and why do you need httpurlconnection?

vestal mountain
#

hi

#

someone can help me why the armorstand dont moving? ```java
private void CsulaKardInteract(Player player) {
Location eyeLocation = player.getEyeLocation();
Vector direction = eyeLocation.getDirection();
Location spawnLocation = eyeLocation.add(direction.multiply(1.5));

    ArmorStand armorStand = (ArmorStand) player.getWorld().spawnEntity(spawnLocation, EntityType.ARMOR_STAND);
    armorStand.setInvisible(true);
    armorStand.setSmall(true);
    armorStand.setGravity(false);
    armorStand.setInvulnerable(true);

    ItemStack slimeBlock = new ItemStack(Material.SLIME_BLOCK);
    armorStand.setHelmet(slimeBlock);
#
new BukkitRunnable() {
            @Override
            public void run() {
                if (armorStand.isDead() || !armorStand.isValid()) {
                    this.cancel();
                    return;
                }


                Location location = armorStand.getLocation();
                if (!location.getBlock().getType().isAir()) {
                    armorStand.remove();
                    this.cancel();
                    return;
                }
                
                for (Entity entity : armorStand.getNearbyEntities(0.5, 0.5, 0.5)) {
                    if (entity instanceof LivingEntity && !entity.equals(player)) {
                        LivingEntity target = (LivingEntity) entity;
                        target.damage(20);
                        target.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 100, 1));
                        armorStand.remove();

                        target.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, target.getLocation(), 1);
                        this.cancel();
                        return;
                    }
                }

                armorStand.setVelocity(direction.clone().multiply(1.0));
                player.getWorld().spawnParticle(Particle.SLIME, armorStand.getLocation(), 5);
            }
        }.runTaskTimer(this, 0, 1);

        armorStand.setMetadata("csula_kard_projectile", new FixedMetadataValue(this, true));
    }```
drowsy helm
vestal mountain
#

hm

#

idk waite i test it

torn shuttle
vestal mountain
drowsy helm
#

up to the setVelocity line right

vestal mountain
#

oh

#

waite i test is also

wet breach
vestal mountain
# drowsy helm up to the setVelocity line right

test it like this its okay? player.sendMessage("asd");
armorStand.setVelocity(direction.clone().multiply(1.0));
player.getWorld().spawnParticle(Particle.SLIME, armorStand.getLocation(), 5);

drowsy helm
#

yeah thats fine

#

                    if (entity instanceof LivingEntity && !entity.equals(player)) {
                        LivingEntity target = (LivingEntity) entity;
                        target.damage(20);
                        target.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 100, 1));
                        armorStand.remove();

                        target.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, target.getLocation(), 1);
                        this.cancel();
                        return;
                    }```
this return is intended right?
vestal mountain
#

?

vestal mountain
drowsy helm
vestal mountain
mint nova
#

Can i somehow disable that player needs permision to see some messages? Like not global but from sending message by command

drowsy helm
#

your question doesn't really make sense

vestal mountain
drowsy helm
torn shuttle
hushed spindle
#

anyone got a list of all the predicates that can be used in resource packs for items? like custom_model_data and time

#

to do with item properties maybe

hushed spindle
#

ah there you go thanks

mint nova
drowsy helm
#

so you want to disable chat for a player if they don't have a perm?

burnt current
#

does somebody code with intellij?
I just set up a new Spigot project and added a server file so i can test and debug the plugin faster. This worked well, there is just one big problem if i try to make inputs in "Run" which is the console, like testing commands or op someone, nothing happens. I cant do any inputs in the console with intellij. But if i start the server itself without Intellij, and the normal console starts, everything works fine.
Does someone know how to solve this issue?

tardy delta
smoky anchor
blazing ocean
#

just run it in your terminal

exotic obsidian
#

Hello

#

Guys im trying to find a good Knockback settings for 1.8

#

Anyone can help me?

grim hound
#

how does the placeholder api work?

#

when is the placeholder replaced with the value?

quaint mantle
#

how to fix this

#

failed to verify username

grim hound
#

mc

quaint mantle
#

i use tlaunce

#

tlauncher

grim hound
quaint mantle
#

ANYONE KNOW HOSTING FOR TLAUNCHER MINECRAFT MULTIPLAY

grim hound
pliant topaz
burnt current
torn shuttle
#

it's... beautiful

#

well this works wonderfully, I love that for me

#

how can I get the IP of the server the plugin is running in?

#

ah just bukkit#getip

drowsy helm
torn shuttle
#

yeah I've been thinking about that

#

it's kinda fine

drowsy helm
#

What you using the ip forv

torn shuttle
#

I might just get it from the server, that's what has the data anyway

#

for the autohoster for the rspm

drowsy helm
#

Cant just host from localhost?

torn shuttle
#

no

mint nova
drowsy helm
#

Or re send it just to players with the perm

mint nova
#

Thanks

torn shuttle
#

hm fun question is there a way to get the port a server is running from

#

hmmm

#

or i can just do purely random uuids

#

that probably makes marginally more sense

#

yeah that way I'm really not storing any data

drowsy helm
#

Unless you use some outside server

brittle geyser
torn shuttle
#

yeah way less bothersome if I just randomly assign a uuid when a server connects to my remote

#

and send that back to the server for it to know

drowsy helm
#

The bukkit port can be different to the outside port

#

So bukkit methods are only useful locally

torn shuttle
#

that way I don't have to worry about containers, ports or vps' or anything like that

drowsy helm
#

YeH

torn shuttle
#

pretty sure normal uuids make for valid http links right

#

no character breaking stuff in there

drowsy helm
#

Yep

torn shuttle
#

altough hm

#

eh whatever it's fine for v1

drowsy helm
#

So you’re gonna have a remote dl server?

torn shuttle
#

yeah

drowsy helm
#

Cant the server just host it’s own dl?

#

Then just put the port burden on the user

torn shuttle
#

buddy

#

why can't I just tell people to merge their own resource packs

#

and host their own resource packs

#

and make their own animation software for models

drowsy helm
#

That’s completely different

torn shuttle
#

and make their own boss plugin

#

and make their own base voxel game that people can then modify

#

and make their own programming language that is definitely not fix for a voxel game

#

and make their own cpus from silicone they find at a beach

#

why do anything at all

drowsy helm
#

Just give them a pile of rocks atp

torn shuttle
#

give them? they can walk

drowsy helm
#

Im just worried for ur server lmao

torn shuttle
#

this is just one of the features, if it becomes to expensive I will gate it behind a paywall, if people are going out of their way to try to exploit it I'll just close it and everyone gets another fun lesson about the tragedy of the commons

#

I'm already designing it according to the appropriate EU directives that came to replace the safe harbor laws in europe

#

besides I'm pretty sure if it picks up any steam some vps provider will show up and tank the cost for a deal

#

it's not that demanding

mint nova
drowsy helm
#

Ur so nice to your end user

#

I would absolutely just make them host the dl server themselves

drowsy helm
torn shuttle
#

I want the installation experience of models to be you put the file in your server, reload the plugin and everyone immediately gets the pack with all things already accounted for

#

preferably including bedrock clients though some limitations will apply

mint nova
drowsy helm
#

For what?

#

You can, but you wouldnt be structuring your plugin well

mint nova
wet breach
#

you should make use of the chat channels

#

there is a conversation api that can facilitate this

#

then you don't have to worry about recipients and instead just add the people to the channel instead

torn shuttle
#

sending a post request to a server every minute should be a basically entirely negligeable operation right

#

I don't like how frequent that sounds but on the flip side the problem is if I'm using uuids which I am I'm basically going to get a new rsp every time a server using this restarts

#

and I don't want to have a spare 3000 rsps just because a bunch of servers have been restarting

drowsy helm
torn shuttle
#

yep just a ping

#

if I stop getting that ping I delete the rsp basically

hybrid spoke
wet breach
#

but in your cause its like a few bytes at most

#

so if we assume 1000 requests a minute, that is only 1mb at most

#

if the requests are just 1 byte or whatever, not that they are that small

#

so negligable yes but as long as the request size is small to begin with 🙂

torn shuttle
#

hmmm

#

should be fine, i'll tweak it if it becomes a problem

molten needle
#

Helppp! Some commanda even for ops doesn't work

#

Plugin commands

#

My plugins

#

/spawn /sethome doesn't work!

quiet ice
#

At how does that relate to the topic of this channel?

torn shuttle
#

can you make a plugin for me that will fix this

molten needle
slender elbow
#

and what makes you think the wrong channel is gonna help? 🤔

quiet ice
torn shuttle
#

wow

delicate gust
#

does anyone know how to reduce plugin size? i'm new to coding and for some reason my plugin is 2mb when it has only like 2 commands in it

quiet ice
torn shuttle
#

well since this is only for development and you can't develop a fix I guess I'm doomed to just stay stranded on the floor forever

delicate gust
quiet ice
#

So under maven use scope = provided where it makes sense and avoid api or implementation under gradle

quiet ice
torn shuttle
#

the documentation of what you're using should say it, and in doubt just don't shade it in

#

you'll get an error telling you the class is missing in case you guessed wrong

drowsy helm
#

As a rule of thumb, if it’s not in your plugins folder, and not in spigot runtime, shade it

delicate gust
#

do i just delete the <plugin></plugin> to remove?

#

i get an internal error in game if i do that ^

quiet ice
#

Use <scope>provided</scope>

delicate gust
#

i did but still

#

maybe mongodb requires shading?

young knoll
#

Yes

delicate gust
#

ohh

mellow snow
#
package it.mjicio.chunkutils;

import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.UUID;
import java.util.stream.Collectors;

public class ChunkUtils extends JavaPlugin implements Listener {

    private WorldGuardPlugin worldGuard;

    @Override
    public void onEnable() {
        // Verifica se WorldGuard è installato
        if (getServer().getPluginManager().getPlugin("WorldGuard") == null) {
            getLogger().warning("WorldGuard non trovato! Disabilito il plugin.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        // Ottieni il riferimento al plugin WorldGuard
        worldGuard = WorldGuardPlugin.inst();

        // Registra gli eventi
        getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void onRegionEnter(RegionEnterEvent event) {
        Player player = event.getPlayer();
        ProtectedRegion region = event.getRegion();

        // Controlla se il nome della regione contiene "plot"
        if (region.getId().toLowerCase().contains("plot")) {
            String owner = getOwnerOfRegion(region);

            // Invia il messaggio nella action bar
            sendActionBar(player, ChatColor.GREEN + "Sei entrato nel plot di " + owner);
        }
    }

RegionEnterEvent doesn't exist but Idk how to do this event in other ways.

delicate gust
#

is it okay that the plugin is that file size then? (with mongodb shaded in)

drowsy helm
#

In your plugin config

delicate gust
#

okay :D and another question, is the plugin file size really matter or?

drowsy helm
#

Imo not really

#

But depends who you ask tbh

#

Md would argue that it takes too much space on the spigot server tho

sterile leaf
#

and there is should be a option for minimizing it which is removes the classes which you didn't use

drowsy helm
sterile leaf
#

what's the proper way

young knoll
#

well there is the library loader

delicate gust
#

yes how would i like, instead of having to shade mongo 2 (or more) times, how can i do it 1 time for the next plugins i'll create?

drowsy helm
#

Using spigot library loader

delicate gust
#

is there a guide for it?

drowsy helm
#

Read the “libraries” appendix

sterile leaf
delicate gust
#

do i put the library in every plugin i will be making?

drowsy helm
#

Another reason not to use 1.8

#

So you put that library in your plugins.yml on every plugin that needs it then depend on it in a provided scope

#

So now your server will download the dependency ONCE for the whole server

#

Rather than having to shade the exact same dependency 5 times into 5 separate plugins

delicate gust
#

ohhh

#

got it

#

do i put it in depend in all of the plugins as well or just 1?

drowsy helm
#

All

#

Just dont shade it

delicate gust
#

i dont think i can not shade mongodb

drowsy helm
#

You can

#

The plugin.yml loads it into your servers runtime

#

The point of the library loader is to avoid shading jars

silent wave
#

im making a plugin who uses the clasic Archer Class from HCF but if the leather armour is dyed like green color it gives poison to the victim, but the code isnt working, can i ger help with this?

delicate gust
#

how would i get like this: com.squareup.okhttp3:okhttp:4.9.0

#

(thats from the guide)

drowsy helm
#

Groupid:artifactid:version

silent wave
#

?pastecode

drowsy helm
#

?paste

undone axleBOT
silent wave
delicate gust
#
      <dependency>
          <groupId>org.mongodb</groupId>
          <artifactId>mongodb-driver-sync</artifactId>
          <version>3.11.3</version>
          <scope>provided</scope>
      </dependency>
``` so that would be `org.mongodb:mongodb-driver-sync:3.11.3` ?
drowsy helm
silent wave
drowsy helm
#

Or your listener isnt registered

silent wave
drowsy helm
#

If you figure out which if statement isnt being fulfilled, you find your issue

delicate gust
drowsy helm
#

You also have way too many nested if statements

silent wave
#

ok

drowsy helm
#

Look into early return pattern

#

Also called guard clauses

sleek estuary
#

2º arg is data or amount

#

minecraft api 1.8

pseudo hazel
#

no clue

#

I would guess amount

#

but 1.8 is ancient so who knows

drowsy helm
#

Damn these competitive hotdog eaters are insane

#

58 in 5 minutes

umbral ridge
#

christ

#

1.8

#

😿

worldly ingot
#

2nd argument is amount, yes

#

but really, yes, you can pull the 1.8 Javadocs from the Maven repo if you'd like, or compile them with BuildTools' --generate-docs arg

eternal night
#

choco supporting 1.8???

shadow night
#

he is a dev at hypixel

#

He knows the codebase of 1.8 better than mojang employees (maybe because they haven't worked with it for 10 years but who cares)

sand spire
eternal night
#

Dual personality choco

drowsy helm
#

I wonder how mych of hypixels api resembles spigot now

eternal night
#

I'd hope little to none KEKW

wet breach
sleek estuary
young knoll
sleek estuary
zealous osprey
eternal night
young knoll
#

No datapacks in 1.8

#

Stupid

sleek estuary
eternal night
subtle folio
#

Why can't I get an instance of my Core plugin from my QOL plugin? ```java
public final class Qol extends JavaPlugin {
private Core m_core;

@Override
public void onEnable() {
    // Plugin startup logic

    m_core = (Core) getServer().getPluginManager().getPlugin("Core");

    registerEvent(new HungerListener());
    registerEvent(new JoinListener(m_core.getMapService()));
}

this is my code, but I get this error[14:39:48 ERROR]: Error occurred while enabling Qol v1.0.0 (Is it up to date?)
java.lang.ClassCastException: class world.ntdi.core.Core cannot be cast to class world.ntdi.core.Core (world.ntdi.core.Core is in unnamed module of loader 'Core-1.0.0.jar' @58a9a581; world.ntdi.core.Core is in unnamed module of loader 'Qol-1.0.0.jar' @cbd2947)
at Qol-1.0.0.jar/world.ntdi.qol.Qol.onEnable(Qol.java:16) ~[Qol-1.0.0.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:288)```

sleek estuary
subtle folio
#

I added it to main depend

sleek estuary
#

idk then

subtle folio
#

oopsies

#

provided when

remote swallow
#

Kekw

#

Gradle 💪

subtle folio
#

love git

topaz kestrel
#

hi. I want to create a stats system based on mode and stats. so, I created a map, but now I don't have any ideas how to put and load it from the database. for this I'm using ORM Lite.

@DatabaseField
private HashMap<ModeType, HashMap<StatType, Long>> playerStatsMap;```
subtle folio
#

In ormlite you can't use these advanced data types like hashmaps, you have to use ForeignCollections

#

everything is made out of tables

topaz kestrel
#

I've read the ORM lite docs. they have something like SERIALIZABLE. however, it doesn't load directly

subtle folio
#

well yes you can serialize a class

#

But your data looks very, complex, you may want to consider a nosql approah?

topaz kestrel
#

what do you mean?

subtle folio
#

Well you're storing a hashmap, that has a hashmap as the value, This could very well either be simplified two ways, with json/nosql or by making it a record with three fields that are enums and longs

#

then storing the records in a foreign collection will be much simpler

topaz kestrel
subtle folio
sleek estuary
#

I COPIED THE BUKKIT API AND NO WORKSSSSSSSSSS

subtle folio
#

wouldn't a table for each player that has all its values and stats be perfectly fine?

chrome beacon
#

Load the stats when a player joins and unload them on quit

rare cave
#

hi does anyone know about thirdparty yggdrasil?

chrome beacon
#

Piracy is not supported here

rare cave
#

not privacy

topaz kestrel
subtle folio
#

just 1 table, with 100 rows

sleek estuary
#

if the server crashes

#

say hi rollback

topaz kestrel
subtle folio
rare cave
subtle folio
#

Let me show you an example of what one of my plugin does

#

@topaz kestrel This is how I store all my player's talents or wtv

#

just a bunch of simple booleans

sleek estuary
#

NOBODY KNOWS HOW TO SOLVE THE PROBLEM?

subtle folio
#

this can be integers, or anything else you want

rare cave
sleek estuary
topaz kestrel
chrome beacon
rare cave
chrome beacon
#

You can still send the packet?

sleek estuary
#

NOBODY KNOWS HOW TO SOLVE THE PROBLEM?

subtle folio
rare cave
#

if i dont do some workaround with the auth sys then the heckers might be able to bypass it by opening 2 clients. anticheat challenges will be done on the vanilla one

chrome beacon
#

?

#

I don't see why two clients would break anything

#

All you need to do is grab the network connection that the client has and send a packet through it

rare cave
#

they can still code a mod to mock anticheat's behavior

sand spire
#

Is it possible (and safe) to switch to the main thread without the 0-1 tick delay BukkitSchedule#runTask gives. If it is, how?

chrome beacon
blazing ocean
sleek estuary
chrome beacon
blazing ocean
#

damn bro updated

#

congrats

chrome beacon
#

It will be quite unreliable

sleek estuary
#

BUT IT'S THE SAME SHIT

slender elbow
#

bro chill the fuck out

sleek estuary
#

chill?t

sand spire
sleek estuary
#

the api is a shit

#

fds

#

po ikrkl

#

gringo fdpta

#

mamame as bolas

#

i love you gringo ❤️

eternal night
#

NODDERS sane reaction

slender elbow
#

what happened to being nice

#

also i'm not a gringo lmao

sleek estuary
chrome beacon
blazing ocean
#

yea

eternal night
#

A benefit to the community for sure NODDERS

frosty geyser
#

Hi I was just wondering what would be the best way to prevent players from breaking a specific structure for a minigame I'm making, while still allowing them to break/place blocks that they have placed.

sleek estuary
#

fds

eternal night
eternal night
chrome beacon
eternal night
#

Yeaa

chrome beacon
#

You can do a combination of the two if you want uwu

frosty geyser
#

fair

#

What might be the best way to track the blocks belonging to the structure? Right now I have it looping through the loaded chunks on a seperate thread (so the main thread doesn't get tied up) and added the blocks to an ArrayList which when someone tries to break it will check the list and allow/prevent depending on the location. Only issue is trying to get all blocks in a short period of time (so people can't break one right away and keep it) and if any entities spawns during the check it gives an async error since it's on another thread.

chrome beacon
#

"The best way" depends on the exact use case and structure

sand spire
#

Can't you use the blockbreakevent and check if the location of the block is in the list? Why do you have to loop through the loaded chunks

chrome beacon
#

Also looping the world blocks sounds terribly inefficient

frosty geyser
#

Currently getting the existing blocks of the structure is the main issue

sand spire
frosty geyser
#

I currently have it that when the map loads it checks all the blocks in the map and saves them to a list, throughout the game they can break/place any block a player had placed, just not the ones the map spawned with

#

having it like this allows me to do multiple random maps with it being automatically detected on protected blocks, the only issue is getting the structure's blocks in a quick manner to prevent wait times

alpine cairn
#

It seems like 1.21 broke a lot of plugins and datapacks

sand spire
#

but you said random maps so the second solution probably won't work

frosty geyser
#

I guess the best method would be to just track the blocks the player had placed and add it to a list, and when they break a block, if it's not in the list, to not break it

#

as Olivo mentioned the two ways

grim hound
#

Is there an entity teleport packet?

frosty geyser
#

What makes the HashSet better for performance than a ArrayList?

#

also I am already using a HashSet, thought I did an ArrayList lol

ivory sleet
#

HashSet on average uses the same amount of operations regardless of object

frosty geyser
#

when might a HashSet be a better choice?

ivory sleet
#

arraylist has to resize and shift its backing array a lot more internally depending on what u’re doing

frosty geyser
#

ah

ivory sleet
#

For small stuff

#

It doesn’t matter too much

#

Also arraylist is ordered by index (not to be confused with sorted)

#

hashset is not

#

And no duplicates if u didnt troll ur hashCode() and equals() implementation

frosty geyser
#

good to know

#

tyty

ivory sleet
#

But yea basically the hashset takes the hashcode from a given element, and finds the canonical remainder in modulo of the length of the backing array,
index = hash % arr.length
and this operation is constant nicely enough

#

(Obv you get collisions, but eh, its too occasional to care too much about)

echo basalt
#

I'm a good boy and make my hashcode return a random int between 1 and 1 billion

chilly hearth
#

to modify the chat we have to use an event ?

remote swallow
#

im bad boy and return the added hashcode of all the stored objects

echo basalt
ivory sleet
#

That too

echo basalt
#

The hashmap does pick buckets like that though

#

It also expands sometimes

sterile flicker
twin vector
#

Well well well
Could not connect to a default or fallback server. Incorrectly configured address/port/firewall? io.netty.channel.ConnectTimeoutException

remote swallow
#

use the spigot mapping

sterile flicker
remote swallow
#

on that site it has multiple different names for the cl ass

quaint mantle
#

How can I check is the block is the player at is a block of a custom recipe?

remote swallow
#

AbstractDragonPhaseInstance is the mojangh mapping as shown before it

#

if you look down it has spigot which would be AbstractDragonController

astral pilot
#

where can I get bukkit source code

river oracle
undone axleBOT
turbid flame
#

Is it possible to gather input from command block?

magic schooner
astral pilot
twin vector
magic schooner
quaint mantle
#

Its posible to save data with PDC to a block?

#

like a concrete block

eternal oxide
#

no

#

only blocks with TileEntities have a PDC

#

you have to store in the chunk for normal blocks

#

?blockpdc

undone axleBOT
inner mulch
undone axleBOT
inner mulch
#

Oh wait

#

I didnt read the history

glacial raven
#

Hey, is there a common reason why BukkitRunnables would generate NoClassDefFoundErrors at runtime only sometimes?

inner mulch
#

No

glacial raven
#

worth a shot...

eternal oxide
#

The most common is updating yoru jar with the server still running

glacial raven
#

I thought of that, but I restart the server everytime I make an update. It works for hours sometimes without issue, but occasionally (like 1% of the time) it'll crash and give me that error

eternal oxide
#

restart or reload?

chrome beacon
#

Send the entire error

#

?paste

undone axleBOT
glacial raven
#

i'm waiting for it to happen again so I can send it

chrome beacon
#

Could just look in the server logs

glacial raven
#

If it looks weird, I used a try/catch statement, but I still print the stacktrace

eternal oxide
#

No way to tell from that

quaint mantle
eternal oxide
glacial raven
#

Ya i know sorry, i'm working on it

#

But it's the same error I believe

eternal oxide
#

Yeah, stop replacing teh jar live

#

when you replace teh jar with the server running and call reload it really messes up the class loader.

#

you end up with old and new classes referenced

glacial raven
#

I understand how that would cause the error, once in a blue moon I must've forgotten to restart the server after making a change (I output the jar directly into the plugins folder)

#

I heard there's a way to make an update folder? I wasn't sure if that would help though

nova notch
#

shut down server, build and replace jar, restart, contemplate life for ~10 seconds, spam join

#

easiest way

glacial raven
#

that's what I do

#

I never use reload

nova notch
#

idk mine won't even let me replace the jar if the server is running

#

maybe a gradle thing?

#

idk how it works on maven

glacial raven
#

me neither tbh, I followed guides, and the guide used maven

#

I now know, I do not like maven

nova notch
#

then like you said just make sure the server isn't running when you're changing shit

glacial raven
#

alright thanks!
btw, I heard something about making an update folder and compiling the jar there? does that automatically work or do I need to make my own script to make that work?

eternal oxide
#

yes update folder works

glacial raven
#

great, thanks again!

eternal oxide
#

many plugins are written so bad they corrupt on a reload

shadow night
#

I personally reset my plugins on disable

eternal oxide
#

static references and class paths

#

releasing static reference is not easy for a reload

#

or better said, easy to mess up

shadow night
#

Does it throw away all registered services? (The interface)

grim hound
rose frigate
#

there is a PlayerInventory but is there maybe a PlayerHand

remote swallow
#

no

#

the hand is just a slot

inner mulch
#

Player#getItemInHand

remote swallow
#

thats deprecated

slender elbow
#

PlayerInventory#getItemInMainHand/OffHand

remote swallow
#

^^

rose frigate
sterile flicker
#
fun toNMS(c: CustomPhase): AbstractDragonController {
        return object : AbstractDragonController(this) {
            override fun getControllerPhase(): DragonControllerPhase<out IDragonController?> {
                try {
                    val create: Method = DragonControllerPhase::class.java.getDeclaredMethod("a")
                    create.setAccessible(true)
                    return create.invoke(null, this.javaClass, c.getKey().key) as DragonControllerPhase<out IDragonController?>
                } catch (ignored: java.lang.Exception) {
                }
                return DragonControllerPhase.HOVER
            }

            override fun d() {
                c.start()
            }

            override fun e() {
                c.stop()
            }

            override fun a(): Boolean {
                return c.isSitting
            }

            override fun b() {
                c.clientTick()
            }

            override fun c() {
                c.serverTick()
            }

            override fun g(): Vec3D {
                return Vec3D(-509.0, 9.0, 1173.0)
            }

            override fun f(): Float {
                return c.flyingSpeed
            }
        }
    }
    fun setCustomPhase(c: CustomPhase) {
        val nmsPhase = toNMS(c)
        try {
            DragonControllerManager(this).setControllerPhase(nmsPhase.controllerPhase)
        } catch (ignored: IndexOutOfBoundsException) {
        }
    }
    fun spawn(): Entity {
        val entity: Entity = this.bukkitEntity
        val craftDragon: EntityEnderDragon = this
        health = 80.0f
        yaw = -90.0f
        MobWars.entities[bukkitEntity.entityId] = bukkitEntity
        setCustomPhase(CustomPhase(entity as EnderDragon, NamespacedKey(MobWars.instance, "dragon")))``` what else should I do to finally get the dragon to fly to the right coordinates?
turbid lodge
#

Hello, I want a code for no damage item in hand and armour player.

worthy yarrow
turbid lodge
#
package me.m3zof.hybloodpvp.System;

import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerItemDamageEvent;
import org.bukkit.inventory.ItemStack;


public class ItemDamageListener implements Listener {
    @EventHandler
    public void onPlayerItemDamage(PlayerItemDamageEvent event) {
        ItemStack item = event.getItem();
        if (item != null && item.getType() != Material.AIR) {
            // Check if the item is in the player's hand or armor
            if (isInPlayerHandOrArmor(event.getPlayer().getInventory(), item)) {
                event.setCancelled(true);
            }
        }
    }

    private boolean isInPlayerHandOrArmor(org.bukkit.inventory.PlayerInventory inventory, ItemStack item) {
        // Check main hand (1.9 and later) or hand (1.8.9)
        if (inventory.getItemInHand().equals(item)) {
            return true;
        }
        // Check armor slots
        for (ItemStack armorItem : inventory.getArmorContents()) {
            if (armorItem != null && armorItem.equals(item)) {
                return true;
            }
        }
        return false;
    }
}```
remote swallow
#

why not just give it the unbreakable tag

turbid lodge
#

by meta?

worthy yarrow
#

what version btw?

remote swallow
#

yes

worthy yarrow
#

spigot

remote swallow
remote swallow
#

1.8.9 doesnt exist as a spigot version

turbid lodge
#

1.8.8*

worthy yarrow
#

I mean

#

can I ask why?

remote swallow
#

because 1.8.9 is a client only version