#help-development

1 messages · Page 627 of 1

rare sedge
#

The more I read what little there is on JIRA, the more convinced I am that I'm correct and this should be working

rare sedge
#

It seems @lone jacinth is the SME on this, curious what they think.

bleak hemlock
#

Transferring NBT via "/data" deleting/skipping information?

grave lagoon
#

prevent pdc item from being put in container

lone jacinth
rare sedge
atomic swift
#

why would i get this java.io.IOException: Permission denied while using this backupFile.createNewFile();

rare sedge
#

Does the JVM have permission to write?

vast ledge
#

If you have no permission

#

in the working directory

atomic swift
#

houw would i get permission

vast ledge
#

idk

rare sedge
#

Sounds like a super solid opportunity to learn about filesystem permissions

vast ledge
#

Permissions

wet breach
#

So if said user doesnt have perms for the directory in question then the jvm wont either.

atomic swift
#

liek the panel user or the process that the jvm is on

#

were using bloom as our host

wet breach
#

Dont know them and dont use panels as this is one of the reasons of many

#

All i can tell you is that whatever user launched the java process that is the perme the java process has

atomic swift
#

but wouldnt the jvm need permission to let plugins save configs?

wet breach
#

Sure, doesnt change that the jvm inherits the perms of the user

grizzled oasis
#

Hi something wrong is with this code, it doesn't take the deepslate biome any tries I had, it didn't work any advice?
https://paste.md-5.net/dibazawubo.cs

another thing someone knows a mod for displaying blocks by the given coordinate a sort of "xray" but i need to provide my coordinate

rare sedge
grizzled oasis
#

i can't it autodetecs

rare sedge
#

Well, I’m looking at this code and frankly I don’t understand what you’re trying to do here

grizzled oasis
rare sedge
#

Where is this blocks array coming from?

grizzled oasis
#

the problem is always in my math about the loop on y not taking negatives

rare sedge
#

Also, you’re assuming the bottom of the chunk is at 0. It isn’t, use the methods to get the top and bottom of the chunks.

grizzled oasis
#

and so deep state is not calculated

quaint mantle
#

Why does PrepareAnvilEvent get fired 3 times?? lmao

rare sedge
#

public Block containBlock(Chunk chunk) {
    for (int x = 0; x < 16; x++) {
        for (int y = chunk.getWorld().getMinHeight(); y < chunk.getWorld().getMaxHeight(); y++) {
            for (int z = 0; z < 16; z++) {
                if (blocks.contains(chunk.getBlock(x,y,z).getType())) {
                    return chunk.getBlock(x, y, z);
                }
            }
        }
    }
    return null;
}
rare sedge
#

Horizontal slices are going to be mostly homogeneous

lone jacinth
#

@rare sedge It's a bug, will make a PR to fix it.

pure dagger
#

.

smoky anchor
#

What do you mean by "store"
As in save the teams to disk ?

pure dagger
#

in code, i mean i need to make these teams but i dont know how, in some hashmap or what

cerulean igloo
#

So this is where all the coders end up.

It has been a long time since I have taught myself Java, is there a simple minecraft plugin project I could make to try and start learning again?

warm mica
icy beacon
#

it might be out of bounds

zealous osprey
#

Your strings array might be null?

icy beacon
#

if strings only has 1 element, strings[1] must throw ArrayIndexOutOfBounds or smth

pseudo hazel
#

whats in string

icy beacon
#

it's not null

pseudo hazel
#

just print the whole thing

icy beacon
#

it's just not a thing

#

show the array in question

#

yeah

smoky anchor
#

so yes

icy beacon
#

i'm saying exactly that

#

how did you manage to make it null

pseudo hazel
#

well string[1] gives an exception

icy beacon
#

it must throw out of bounds

pseudo hazel
#

it should be a crash

#

print the whole array

smoky anchor
#

sout Arrays.toString(array)

icy beacon
#
String[] strings = new String[] { "option1" };
String a = strings[0]; // option1
String b = strings[1]; // ArrayIndexOutOfBoundsException
pseudo hazel
#

or the chad way "" + strings

smoky anchor
pseudo hazel
#

checking if string[1] is not a thing

#

thats not how arrays work

icy beacon
#

no. it's not null, it doesn't even exist

#

it must throw aioobe

pseudo hazel
#

no since the + just calls .toString or whatever

icy beacon
#

tell us what you are trying to do

#

this seems like

#

?xy

undone axleBOT
pseudo hazel
#

check the length of the array

icy beacon
#

if (strings.length == 2)

pseudo hazel
#

and fucking print the array

pseudo hazel
icy beacon
pseudo hazel
#

maybe

#

im using 17

smoky anchor
#

should not be the case

pseudo hazel
#

or im misremembering

icy beacon
#

welp just use whatever's most convenient for you

pseudo hazel
#

im not at my pc

icy beacon
pseudo hazel
#

yes perhaps

smoky anchor
#

Must have been a list

#

since I doubt the toString would change between versions

pseudo hazel
#

yes sure im not dying on this hill xD

smoky anchor
#

lol :D

humble lynx
#

I'm creating an 'editor' mode for a plugin I'm making. Is it bad practice that I'm using PDC to check if the player is in editor mode to prevent them from altering any inventories? (Such as hotbar, dropping items, transferring to other inventories, etc).

terse pumice
#

How does one make a plugin work on both 1.16 and 1.18, I am aware that java compile versions are different so how would I go about compiling it in a way that suits both in one jar?

pseudo hazel
terse pumice
quaint mantle
humble lynx
#

isn't inventoryholder in this case the player?

#

or do you mean if it was a GUI i could store it in there also

terse pumice
humble lynx
#

actually would be pretty handy to store it in the GUI

quaint mantle
pseudo hazel
smoky anchor
#

the older java no ?
Since you can load jars from old java on new java but you can't load new java jars on old java.

pseudo hazel
#

oh I thought you need the newer version to run the game on 1.18

smoky anchor
#

yes, but if you want the plugin to run on older versions as well, you need to compile it on that older java version

#

But I am not sure about this one, I don't support older versions or multiple

tacit wing
#

Hey, I want to create Bungeecord plugins again, where can I find the best docs ?

inner mulch
#

Is there a way to detect the correct inventory for an inventoryclickevent, without event.getview.gettitle.equals...

smoky anchor
#

yes

inner mulch
#

which one?

smoky anchor
inner mulch
#

ok

cerulean igloo
livid dove
pseudo hazel
#

yeah same, though heavily altered because I wanted more features

prisma sedge
#
        Random random = new Random();
        World world = center.getWorld();
        Material material = world.getBlockAt(center).getType();
        FallingBlock fallingBlock = world.spawnFallingBlock(center, new MaterialData(material));

        double velocityX = (random.nextDouble() - 0.5) * 0.5;
        double velocityY = random.nextDouble() * 0.5 + 0.5;
        double velocityZ = (random.nextDouble() - 0.5) * 0.5;

        fallingBlock.setVelocity(new Vector(velocityX, velocityY, velocityZ));
    }``` anybody able to help me out with this? Not sure why it isn't working
smoky anchor
#

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

prisma sedge
#

no stack trace

#

nothing.

#

there wasn't anything to explain

smoky anchor
#

new MaterialData()
Seems fishy

somber scarab
#

im so close to publishing my first plugin

smoky anchor
somber scarab
#

@noble lantern

#

@wet breach

prisma sedge
noble lantern
#

whats up

somber scarab
#

look at me ma

#

im doin it

noble lantern
#

What plugin?

somber scarab
#

Floor is Lava

#

remember?

terse pumice
somber scarab
#

all good. When you see how awesome it is you wont forget it

smoky anchor
#

you can't "delete" messages from chat
Just send a bunch of empty lines before your actual message

fast merlin
#

not just printed lines but actually deletes from chat

smoky anchor
#

well, if you achieve that, show me
I am really curious
Might be something I do not know about.

terse pumice
#

likewise ^^

hazy siren
#

Hey so uhh, weird question but I only have Java knowledge outside of Spigot and I don't want to learn the Spigot API, so I was going to make a Skript to Java converter, it would bundle the scripts in and remove the unnecessary event listeners (and I might use SQL instead of RAM to improve variable performance) to improve performance, and I was wondering if I'd be able to sell my resource on Spigot if I did that.

smoky anchor
fast merlin
prisma sedge
hazy siren
#

why not?

prisma sedge
#

well multiple reasons honestly

#

I can imagine upkeep would be Impossible

hazy siren
#

it would

prisma sedge
#

uh, let me think of another reason

hazy siren
#

basically it would go into the Skript SRC and remove unnecessary event listeners and that means it wouldn't be using a custom SRC but rather another thing, and therefore also improve performance

#

and it would bundle the script in

prisma sedge
#

I mean yeah that would help, but you also have to consider the fact that skript is just too high level

#

It would be damn near compiling human speech into byte code

#

let alone skript addons

smoky anchor
#

wait so...
you want to convert skript "code" to java code
and also you want to remove event listeners ?
That's like 95% of plugin development
Anyways, you would still need to know the spigot API to know what to call when skript says "if player has item"

#

unless I am not understanding

hazy siren
#

yeah but I'd research that

#

I don't wanna research it every time

#

or remember

prisma sedge
#

Oh also, that already exists

#

I mean believe it or not, some insane human being did it

hazy siren
#

Byteskript?

#

that compiles to jvm but not mc plugins

prisma sedge
#

nah they're multiple

pseudo hazel
#

you would need to use the spigot api to do like most of that so your point is kinda invalid

prisma sedge
hazy siren
#

yeah but what im saying is that i'd research them once, but i dont wanna bother researching like 999 times

pseudo hazel
#

well thats why you have a brain that can hopefully retain information

hazy siren
smoky anchor
#

I find it kinda funny how your actual question was ignored

hazy siren
#

i mean true

prisma sedge
hazy siren
#

this is kinda turning into a debate

prisma sedge
#

I've used it on paper a lot

hazy siren
#

no

#

paper

pseudo hazel
#

and looking up stuff is like half the job anyways

hazy siren
#

is a fork

#

of spigot

prisma sedge
#

Oh yeah, forgot about that

#

Oh yeah paper is making themselfs a fork of bukkit instead

hazy siren
#

why

#

nooooo

prisma sedge
#

I'm imagining for performance

hazy siren
#

my spigot plugins :c

#

or rather the ones i bought

pseudo hazel
#

since when are they doing that

prisma sedge
#

A staff member said that in their discord

#

Not sure when they started

hazy siren
smoky anchor
#

wait that would mean no more ppl coming here with paper related issues

hazy siren
#

true

#

ive seen so many forum posts

#

just about paper

prisma sedge
#

and paper being even faster

hazy siren
#

true

prisma sedge
#

all is well

pseudo hazel
hazy siren
#

i cant

#

i use a bunch of them

#

like

#

all teh time

#

because when i wanna do diff things

#

i use different ones

#

like for example if theres a library thats only on one

#

i can use that one

smoky anchor
#

paper is awful
they "fix" vanilla "bugs" with no option to enable them again
fucking TNT duping, which is still intentionally enabled was "fixed" by them.
Thank you for coming to my rant

hazy siren
#

wait what

#

tnt duping

#

doesnt exist

pseudo hazel
#

epic rant

hazy siren
#

on paper?

pseudo hazel
#

not on paper

hazy siren
#

bruhhhh

pseudo hazel
#

cuz they patched it

prisma sedge
hazy siren
#

bruhhhhhhhhhh

smoky anchor
hazy siren
#

can samwan pwease answer my owiginaw question

prisma sedge
#

even if it's a VERY little amount

prisma sedge
smoky anchor
hazy siren
#

idk

pseudo hazel
#

you can

hazy siren
#

I feel like Spigot might like ban me or something

smoky anchor
#

for what

pseudo hazel
#

why

prisma sedge
hazy siren
#

idk

prisma sedge
#

should

#

that's a nasty thing to do

hazy siren
#

how is it nasty

smoky anchor
#

like.. read the terms and whatever

hazy siren
prisma sedge
#

Bro converting skript to a .jar file is horrendous

grim ice
#

a bug is a bug

#

so them removing it is justified

#

just make a creeper and sand farm lmao

hazy siren
#

actually BUD (block update detection) switches arent bugs anymore

#

if you didnt know

#

but anyway we're going off topic

#

I'm going to make it

grim ice
#

so tnt duping isnt a bug? nah

hazy siren
#

should i share it

#

or keep it private

prisma sedge
#
        Random random = new Random();
        World world = center.getWorld();
        Material material = world.getBlockAt(center).getType();

        FallingBlock fallingBlock = world.spawnFallingBlock(center, material.createBlockData());

        double velocityX = (random.nextDouble() - 0.5) * 0.5;
        double velocityY = random.nextDouble() * 0.5 + 0.5;
        double velocityZ = (random.nextDouble() - 0.5) * 0.5;

        fallingBlock.setVelocity(new Vector(velocityX, velocityY, velocityZ));
    }``` Also this still doesn't work. I thought that you were right but I guess not
pseudo hazel
#

no you keep it to yourself forever

grim ice
#

share what

hazy siren
#

cuz if I share it I think everyone will optimize it but it would also pose problems

grim ice
#

share what??

hazy siren
#

skript to java converter

pseudo hazel
#

I mean

smoky anchor
grim ice
#

do it

pseudo hazel
#

first just make it

hazy siren
#

ive been planning to make it for like yaers

grim ice
#

actually dont

pseudo hazel
#

then make it

grim ice
#

its gonna be annoying

prisma sedge
smoky anchor
#

are you calling it on the correct coordinates ?

#

also, doesn't Location have getBlock or something ?

prisma sedge
#

It would throw an exception if it was

#
        World world = startBlock.getWorld();
        Vector direction = endBlock.toVector().subtract(startBlock.toVector());
        int points = 50; // Number of points to create the line

        new BukkitRunnable() {
            int currentPoint = 0;

            @Override
            public void run() {
                if (currentPoint >= points) {
                    startBlock.getWorld().playSound(endBlock, Sound.BLOCK_GLASS_BREAK,1.0f, 1.0f);
                    throwBlockUpwards(endBlock);
                    this.cancel();
                    return;
                }

                Vector pointVector = startBlock.toVector().add(direction.clone().multiply(currentPoint / (double) points));
                Location pointLocation = new Location(world, pointVector.getX(), pointVector.getY(), pointVector.getZ());
                world.spawnParticle(Particle.CLOUD, pointLocation, 0, 0, 0, 0, 1);

                currentPoint++;
            }
        }.runTaskTimer(Main.getInstance(), 0L, 1L);``` I'm using it here
#

It's playing the sound at the locations

#

so the function is being ran, but none the less nothing is occuring

smoky anchor
#

ok, try to make like a temporary command or something and run the function on a block you know exists

prisma sedge
#

I did, it works like it draws lines towards blocks it's going to fling upwards

#

so it draws the line to the block, plays the sound at the block

#

but doesn't throw the block in the air

smoky anchor
#

Ye, test that method only

prisma sedge
#

Yeah I am

smoky anchor
prisma sedge
#

I've confirmed is is indeed something wrong with the function itself.

#

I just have no idea what it is

#

It could be something with the Y velocity since it's not moving?

smoky anchor
#

try to spawn the block 1 block higher and give it velocity of 0, 1, 0

#

might be solidifying before it gets the chance to move?

buoyant viper
#

provide higher performance servers at the cost of possibly not having the audience that could benefit the most (hardcore tech players) using it

tender shard
prisma sedge
buoyant viper
#

i had an issue w simple rail duping my friend was using on our SMP :v didnt actually look for a config to toggle it but.. switched back to spigot anyway for it

prisma sedge
buoyant viper
#

yes

#

im not saying Paper is bad software

#

like at all

prisma sedge
buoyant viper
#

just that the group that could potentially benefit the most by using it cant/wont use it BECAUSE of how it improves performance

tender shard
#

disabling duplication stuff isn't really improving performance

smoky anchor
prisma sedge
prisma sedge
#

it also works on water

#

which is interesting looking

smoky anchor
#

dafuq, water does not have a model for falling sand
I am like sure of this

buoyant viper
prisma sedge
#

it's kind of just water apearing all over the place

smoky anchor
#

can you post a picture

#

?img

undone axleBOT
tender shard
#

we also run spigot instead of paper for reasons like this

prisma sedge
#

Like it works on water, snow, and grass

#

but not blocks.

tender shard
eternal night
#

for hardcore players, that is a sensible default yes

prisma sedge
#
                if (!blockLocation.getBlock().isBuildable()) {
                    drawLineBetweenBlocks(center, blockLocation);
                }
            }``` Oh nevermind.
smoky anchor
eternal night
#

is this a sensible default for the normal vanilla server ? probs not

prisma sedge
#

with that masterfully made piece of code

#

It is possible.

eternal night
#

Given that you'd have to decide "what exploit to disable by default and which to not disable by default"

prisma sedge
#

if the block is and IS NOT buildable

#

then it works.

smoky anchor
#

i hate you

buoyant viper
#

honestly im okay with every "fix" being enabled by default, just let it all be toggleable to return vanilla functionality

smoky anchor
#

/s ofc

eternal night
#

I mean most should honestly

#

the only thing is sand that comes to mind

prisma sedge
#

that's my bad.

smoky anchor
prisma sedge
#

it's funny because I actually did, that code is running

#

I was running that code, and that code was causing this

#

It works beutifully now.

buoyant viper
#

interesting @eternal night

tender shard
buoyant viper
#

from the looks of that PR it doesnt seem bug-prone but i sorta want to see if it can get bugged thonk

eternal night
eternal night
#

if you find a bug, shoot it at me 😅

buoyant viper
#

will as soon as i figure out how to actually get a dev env for paper

#

reading Contribution wiki page rn

tender shard
eternal night
#
git clone git@github.com:papermc/paper.git
cd paper
./gradlew applyPatches
./gradlew runDev
#

there

buoyant viper
tender shard
#

well it's in unsupported settings, hence I guess it's unsupported, hence not considered an actual usable setting

eternal night
tender shard
#

why is it called unsupported-settings? is it supported to disable it, or not

eternal night
#

because we don't support you if enabling that option does not fix it for you

buoyant viper
eternal night
#

ah xD

#

then yea, just applyPatches

buoyant viper
#

apply patches will generate a decompiled env right?

eternal night
#

yea

buoyant viper
#

pog

livid dove
#

I have always wondered why paper and spigot haven't done the funni tango and spent the 20 billions years it'd take to resolve all the emergency conflicts and just. Yknow, merged lol

#

*merge conflicts

buoyant viper
#

different priorities

#

and also Paper is basically what u just described

#

Spigot + Paper patches = Paper

livid dove
buoyant viper
#

well Spigot was on github

#

until the

#

?dmca

undone axleBOT
eternal night
#

who the fuck would have two projects with different goals on the same github project but on different branches

livid dove
#

I just hate mom and dad fighting 😭

eternal night
#

you'd still have to fix merge conflicts then kekw

buoyant viper
#

xdd

livid dove
eternal night
#

I mean

buoyant viper
#

Papers priority is performance and fixing exploits

#

Spigots priority is performance and maintaining the Bukkit API

eternal night
#

Given how extreme some of papers changes are, and what downsides come wwith those, spigot just isn't the place for it

livid dove
#

Now I have to ask what does that even mean? Maintaining the bukkit api.

I.e. surely paper does that too or else it erm... wouldn't work lol

buoyant viper
#

i do, however, pride myself in making Paper undo a patch on their side, for one API method.

eternal night
#

kekw which patch was that

buoyant viper
#

like setMaxPlayers in Server

eternal night
#

or did you just push that to spigot

buoyant viper
#

LOL

eternal night
#

lmao

buoyant viper
#

i pushed it to Spigot yeah

#

along with setMotd

eternal night
#

noice

buoyant viper
#

and then Paper clapped back with setMotd(Component)

eternal night
#

Yea, i mean it is a dagnerous game for us to maintain compat

buoyant viper
#

ill have to wait for Choco to do setMotd(BaseComponent)

eternal night
#

infinite components

buoyant viper
#

xddd

#

yeah and then paper will @Deprecate setMotd(BaseComponent) DogJA

eternal night
#

at least all the spigot stuff is tucked away into the Spigot types

#

I mean, we deperecate all of bungee chat

#

I think wwe have an automated tool for that kekw

buoyant viper
#

double edged sword, if some lunatic ran pure CraftBukkit

#

also papers applyPatches just full froze my PC for a solid second sadkek

livid dove
#

Lmao
See this is what I mean. We say different priorities but like, to this day I struggle to see the big things that armt just fundamentally better on one or the other. Just seems like if you pineapple pen'd them and got em to set up a good communication ethic, would be amazing all around

buoyant viper
#

the Spigot CLA also scares people away from contributing to the upstream

#

@ Raziel

livid dove
#

Lmao

eternal night
#

also like, I don't think the paper team agrees with the spigot backwards compatibility policy etc

livid dove
#

E.g I know it's a meme at this point but inventory.getHolder(boolean) is god tier 🙏

eternal night
#

which is the reason they are working towards the soft spoon

buoyant viper
#

to be fair neither do some spigot people here and would like to see breaking changes some day

#

xd

eternal night
#

Yea I mean

#

we all would want to

#

and I am hyped about the "breaking" enum -> reg change

buoyant viper
#

true

livid dove
#

Oh?

#

I've not heard of this

buoyant viper
#

u ever seen the Material class?

livid dove
#

....

livid dove
quiet ice
#

Bukkit 3.0 basically

buoyant viper
eternal night
shadow night
livid dove
#

That shit haunts my sleep

buoyant viper
quiet ice
shadow night
#

Oh right

#

Thats why anything below 1.13 is considered legacy

livid dove
#

So... wtf is even up with the material class...

buoyant viper
#

anything before latest is legacy

#

smh

livid dove
#

Like ... why

buoyant viper
#

it probably made sense when it was created

#

(probably)

quiet ice
#

You cannot add your own materials even if you really wanted to

livid dove
eternal night
#

it is xD

buoyant viper
#

it all trickles down the chain, theres a reason we call them "Mojank"

quiet ice
livid dove
#

This is legit a case and point of why if we ever invent time travel we need to find the bukkit devs and fire Robert c Martins entire book collection straight at their heads at maxh 11.2

#

Mach 11.2

shadow night
quiet ice
#

Modded drama is really something

shadow night
#

Quilt?

#

oh no, what did I just

quiet ice
#

Also (neo-)forge, fabric and anything else

livid dove
#

Ngl our team got offered $300 dollars to do a mod quote and I legit vetod that shit

#

Was not worth

shadow night
#

Ah right, forge

#

That guys name was Lex, right?

quiet ice
#

Yup

shadow night
#

The guy who banned people for mentioning fabric or mixins

livid dove
#

Lmaooo

quiet ice
#

Still clinging to forge

quiet ice
buoyant viper
#

ah, nvm, paper does account for if certain parameters would be null

livid dove
#

I never got that really. It's why I love the spigot discord as we xan say talk about paper n shit and everyone, even mods, are chill.

We are all playing funny block game. And if anything talking about alternative mod clients etc is a good thing as that's how new ideas happen

eternal night
shadow night
#

Modded is drama

buoyant viper
#

thought that maybe it couldve caused calls to PlayerInteractEvent willy nilly

shadow night
livid dove
#

Aye I am stupid idea man

#

I need a cape

buoyant viper
#

arent we all stupid idea people

livid dove
#

Made of bin bags

shadow night
quiet ice
#

Meanwhile me: Transforming random plugins via the bukkit unsafe

livid dove
#

Especially raydan 👀

quiet ice
#

Slimefun, please add a proper API.

buoyant viper
#

now transform them via agents peepoCoolSunglasses

shadow night
#

Especially me, doing the greatest shit solutions for no reason

livid dove
#

Lmao.
You'll never beat core protects spicy 1000 line lookup command 👀

#

I remember seeing it for the first time and being like "erm... how?" 🤣

smoky anchor
#

how about you share with the class ?

livid dove
#

Share a class? I'm not github

#

Lol

#

Give me one sec

smoky anchor
livid dove
buoyant viper
#

true

shadow night
livid dove
buoyant viper
#

gotta run -javaagent smh

quiet ice
#

Oh fuck, it is no longer a draft

buoyant viper
#

this looks.. backwards? time to actually spin up paper to see what the config comment says

smoky anchor
livid dove
quiet ice
#

Oh I do that often

livid dove
#

1100 lines worth geol? xD

quiet ice
#

Well every once in a while

smoky anchor
#

oh god the nesting

buoyant viper
#

ive done anonymous inner classes, never full on classes

livid dove
#

Im tempted to start doing "Plugin jams" like we discussdd last month.

"Remake this class in less than 200 lines with the same functionality" would be first on the list lmao

#

The winner gets to put a PR into CO with a smile on their face lol

buoyant viper
quiet ice
#

As in Triples or custom pair classes are usually classes within methods

eternal night
#

usually parrots don't dismount un sneak

buoyant viper
#

lol

eternal night
#

ah xD

#

nice

quiet ice
eternal night
#

I mean, cool kids just use fastutil

smoky anchor
#

Fair point I guess ?
Never knew that could be an issue

eternal night
#

given they have pair combinations for like

#

anything and their mother

quiet ice
#

For millions of ops a second it is noticeable

smoky anchor
#

I mean I get that primitives are a special case and could be slower,
No idea if objects have that problem tho

quiet ice
#

Objects themselves are fine

#

Checkcasts get jitted most likely

quaint mantle
smoky anchor
quiet ice
#

But autoboxing is not jitted

quiet ice
#

But autoboxing is not compiled properly

#

Hence the object alloc is done anyways, GC must do its job anyways and we see a performance impact

buoyant viper
#

oo paper event, interesting

eternal night
#

Yea that one is pretty nice

#

for those client side NPCs

grim ice
#

why the fuck

#

is forge named neoforged now

quiet ice
#

Fork

smoky anchor
grim ice
quiet ice
#

Yes. Lex was really a pain to work with. So the maintainers just nuked him from the equation

quiet ice
wet breach
silent steeple
#

is there a way the get a list from a JsonObject (com.google.gson.JsonObject;)

there is no Object.get().getAsStringLIst()

twilit roost
#

how should I make resource automatically update?

like when I rename some variable to it automatically renaming the old name into the new etc..?

Im currently trying to make my own changelog and slowly go through it and do every step it says was changed

any other better thoughts on how to do this?

desert tinsel
#

so Im using a dependency for embeded sqlite database:

<dependency>
            <groupId>org.xerial</groupId>
            <artifactId>sqlite-jdbc</artifactId>
            <version>3.39.3.0</version>
            <scope>provided</scope>
        </dependency>```

and when I enable the server on a 1.8.9 server, I get this error: No suitable driver found for jdbc:sqlite:plugins/DeathMatch/database.db, but when I enable this plugin on a newer version like 1.18 I dont get the error and all is fine, why? This is the code: 
```java
public static void connect() {
        connection = null;
        try {
            File file = new File("plugins/DeathMatch/database.db");
            if (!file.exists())
                file.createNewFile();
            String url = "jdbc:sqlite:" + file.getPath();
            connection = DriverManager.getConnection(url);
            System.out.println("Baza de date creata");
            statement = connection.createStatement();
        } catch (SQLException |java.io.IOException e) {
            System.out.println("EROARE");
            e.printStackTrace();
        }
    }```.
quiet ice
silent steeple
#

i got it

#

thanks

#

i got anotherr question

#
public Hypebox(JsonObject object) {
        new Hypebox(object.get("name").getAsString(),
                (List<String>) object.get("lore"),
                object.get("item").getAsString(),
                (List<ItemStack>) object.get("rewards"));
    }

java.lang.ClassCastException: com.google.gson.JsonPrimitive cannot be cast to java.util.List

#

how do i make a list

#

(the other hypebox) Hypebox(String name, List<String> lore, String item, List<ItemStack> rewards)

quiet ice
#

I never used gson tbh

#

Always used org.json:json

silent steeple
#

hm ight

quiet ice
#

You probably have a .getAsArray method somewhere

silent steeple
#

nope..

#

maybe a json array can be casted to a list

quiet ice
#

no

silent steeple
#

Inconvertible types; cannot cast 'com.google.gson.JsonArray' to 'java.util.List<java.lang.String>

#

nope

quiet ice
#

But jsonArray can be converted to a list easily

silent steeple
#

how

quiet ice
#

.asList?

silent steeple
#

where

quiet ice
spare hazel
#

i need to get worldguard as a dependecy but it says:

com.sk89q:worldguard:pom:7.0 failed to transfer from http://0.0.0.0/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of maven-default-http-blocker has elapsed or updates are forced. Original error: Could not transfer artifact com.sk89q:worldguard:pom:7.0 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [sk89q-repo (http://maven.sk89q.com/repo/, default, releases+snapshots)]

Since Maven 3.8.1 http repositories are blocked.

Possible solutions:
- Check that Maven pom files do not contain http repository http://maven.sk89q.com/repo/
- Add a mirror(s) for http://maven.sk89q.com/repo/ that allows http url in the Maven settings.xml
- Downgrade Maven to version 3.8.1 or earlier in settings
silent steeple
#

oh

eternal oxide
#

you are trying to use http not https

quiet ice
#

I exists since 2.10

#

You need to use enginejub anyways

#

Sk89q repo is deprecated

silent steeple
#

thx

spare hazel
#

how can i add the enginehub repo?

silent steeple
#

Inconvertible types; cannot cast 'java.util.List<com.google.gson.JsonElement>' to 'java.util.List<java.lang.String>'

#

cant cast it either

wet breach
#

so for older versions you would need to shade sqlite into your plugin

remote swallow
#

JsonElement to object to getAsString

silent steeple
#

how

remote swallow
#

Check the methods

silent steeple
#

yeah

#

i need a List

#

not a String

smoky anchor
#

stream the list, map it to string with element.getAsString
at the end convert to string list

hazy parrot
#

sqlite will handle that

twilit roost
#
InputStream resourceStream = Otto.class.getResourceAsStream(name);
        if (resourceStream == null){
            Logger.warn("-=:> Didn't update resource because it's stream was null! " + name);
            return false;
        }

this always returns null
even tho I know the path is correct and all

any ideas why?

hazy parrot
#

from where and show your project structure

twilit roost
hazy parrot
#

and also variable name

twilit roost
#

im always getting null
otherwise it wouldn't always log that message

dry hazel
#

prefix the path with /

twilit roost
#

it works fine in saving method without that prefix tho

hazy parrot
#

you can also just use JavaPlugin#saveResource, it will automatically save to your plugin folder

twilit roost
#

well here I need to get the contents of the resource so I can update it or sum stuff

#

imma try to prefix it tho

#

probably worked? :D
got configuration error so it got pass that resource stream

#

thx :D

buoyant viper
#

he he...

(part of a check of LivingEntity's)

tender shard
#

LivingEntity is a weird name anyway

#

all entities are "alive" somehow

buoyant viper
#

Paintings are an entity

#

paintings are not alive

smoky anchor
#

Is the distinction not having AI ?

buoyant viper
#

do armor stands have AI?

smoky anchor
#

I doubt it

buoyant viper
#

maybe the distinction is if it has an inventory or not

flint coyote
#

giant doesn't have AI anymore but is still a living entity

tender shard
buoyant viper
#

since iirc armor stands need an inv to display equipment

#

i dont think non-living have inventory

#

but idr

smoky anchor
buoyant viper
#

petition to PR to spigot to add (back) zombie AI to Giants

smoky anchor
#

sounds more like Paper thing, they like to change gameplay

buoyant viper
#

xd

flint coyote
#

it won't change gameplay since giants don't spawn naturally

buoyant viper
#

petition to PR Giants to spawn in those big open plains at night

#

with low spawn chance ofc

#

unless Evil_Rondo

eternal oxide
#

giant collisions was annoying

#

so hard to hit them

buoyant viper
#

was?

flint coyote
#

All zombies become giants at full moon if they are non obstructed

buoyant viper
#

if zombie hit by lighting, gigantify it

eternal oxide
#

I like the idea of all becoming giants at full moon

buoyant viper
#

hmm

fast merlin
#

when building spigot is there any way i can change the name that the jar saves as? for instance right now it is [INFO] Spigot 1.8.8-R0.1-SNAPSHOT ......................... SUCCESS [ 23.933 s] but i would like to change 1.8.8-R0.1-SNAPSHOT to something different

buoyant viper
#

not yet nah

tender shard
#

--final-name

buoyant viper
#

not a flag yet isnt it

tender shard
#

it is

fast merlin
#

i mean when i run mvn clean install

#

is that how id do it

tender shard
#

just use --final-name outdated-server.jar and there you got your 1.8.8

tender shard
buoyant viper
tender shard
#

that definitely has this flag

kind hatch
#

It hasn't been PR'd yet.

tender shard
#

why not

buoyant viper
#

tht version isnt official yet DogJA

fast merlin
#

i mean i rebuild patches after im done editing and then mvn clean install and i have my jar... so how would i change the name it builds as

bitter rune
#

Hey spigot development. I'm currently messing with saving information. It's great I got it saving in a folder with the UUID, issue is I'm having issues getting that information out of the folder upon relog, and restart. I can see the value in the file going up so it's saving correctly I just can't pull the value from it

kind hatch
tender shard
buoyant viper
#

its official, just not supported

tender shard
#

it's dead and everyone who uses it should feel bad

fast merlin
#

dont some of the biggest servers still use it

#

i mean most people play hypixel on 1.8.9

#

alot better performance

tender shard
#

ofc a game with less features needs less cpu

#

windows xp also ran on 500mhz pentium 2

fast merlin
#

i mean why do i care about bees and swimming mechanics when i want to pvp

#

my server is kitpvp

#

so 1.8 works

buoyant viper
#

OldCombatMechanics ezpz

bitter rune
#

Not always the case, because higher versions of programs learn how to optimize better over time but yeah

tender shard
#

isnt pvp on 1.8 simply "who can spam click the fastest"

fast merlin
#

not exactly

tender shard
#

while in 1.9+ you gotta time your attacks etc

fast merlin
#

i mean theres alot to it

tender shard
#

carlos recently updated to 1.20.1.

be like carlos

flint coyote
bitter rune
#

For old pvp there's always bedrock. I personally would love bedrock if the mob spawns weren't bad and you could customize realm servers a little more

flint coyote
#

will probably crash if we all open it at once lmao

tender shard
#

It probably already dies when there‘s more than 7 actual visitors per minute

#

Took 10 seconds to load for me

bitter rune
#

I'm scared to click on it

flint coyote
eternal oxide
#

most home hosted websites can be taken down by 3-4 people holding F5 when visiting their page

flint coyote
#

2650+ hours of uptime though

tender shard
#

Thats less than 4 months though

silent steeple
#

4.77mhz

#

LOL

flint coyote
#

they built it in march

tender shard
flint coyote
#

it even got 56kb of free ram

silent steeple
#

1.7 user 💪🏿

tender shard
#

My fridge probably got a better cpu than this webserver lol

flint coyote
#

time to run a webserver on my old tamagotchi

silent steeple
#

can you run a webserver on a nintendo 3ds

tender shard
silent steeple
tender shard
#

Then go for it

silent steeple
#

nah im good on that 😭

bitter rune
#

You'll need to homebrew it, but it should be possible afterwards

silent steeple
#

It already is

grizzled flame
#

or just gutter it like a fish and remove the original electronics and put a 10$ qt py esp32-s2 in it and pretend it's a nintendos 3ds since it says so on the casing

astral horizon
#

can i check the boat before it hits the certain wall (*block)?

remote swallow
desert tinsel
twilit roost
#
java.lang.ClassCastException: class java.lang.String cannot be cast to class net.md_5.bungee.config.Configuration (java.lang.String is in module java.base of loader 'bootstrap'; net.md_5.bungee.config.Configuration is in unnamed module of loader 'app')
    at net.md_5.bungee.config.Configuration.getSection(Configuration.java:136)

any ideas why it thinks im casting?

hazy parrot
twilit roost
silent steeple
#

is base64 itemstack serialization standard

quiet ice
#

Myesn't

#

It generally will work but it can fail if you change versions

silent steeple
#

well we out here 🤷🏿‍♂️

silent steeple
quiet ice
#

The best was to serialize itemstacks would be through paper API as that uses DFU (Data fixer upper) but that is not part of bukkit API

silent steeple
#

nah we dont fw paper

#

i only fw CarbonSpigot

#

my beloved

quiet ice
#

Lemme guess - that is a paper fork

silent steeple
#

no

#

spigot fork

quiet ice
#

No, it's a paper fork.
Though given that it uses the antiquitated "PaperSpigot" name I'd not use it under any circumstance

carmine mica
#

smh, what is CarbonSpigot

silent steeple
#

what is the paperspigot groupId

quiet ice
#

Paid paper fork no 206

remote swallow
quiet ice
#

Paperspigot is dead

vast ledge
#

Java is beautiful i love it

quiet ice
silent steeple
onyx fjord
quiet ice
#

What I'm saying it's called PaperMC for a while now

remote swallow
#

papers package now is io.paper.papermc, it used to be something destroystokyo

onyx fjord
#

same thing

#

its still a fork of spigot

remote swallow
quiet ice
#

PaperSpigot is the name of VERY old paper releases

onyx fjord
#

LOL

#

u must join our discord

#

hell yea

quiet ice
#

Back before paper was really worth using

silent steeple
#

lol

quiet ice
#

Probably the same thing

carmine mica
#

is vSpigot a thing too, or just a typo

remote swallow
#

aper used to use com.destroystokyo.paper

onyx fjord
#

mfs use the whole alphabet

quiet ice
#

Any XSpigot forks are in 90% of cases a paper fork

#

Or in regex speak: any [a-zA-Z]+[Ss]pigot forks

onyx fjord
#

i dont speak regex

#

i speak glob

silent steeple
#

ValorSpigot

onyx fjord
#

no google results

silent steeple
#

fork of mspigot

eternal night
#

We do love publishing mojang owned code

vast ledge
#

Yea

#

isnt it lovely

carmine mica
#

Some of those “features” on carbonspigot are really stretching it…

#

Configurable tps command? Like great stuff

silent steeple
carmine mica
#

I’m not talking about the bigger ones, but it looks like they were just trying to put as much on the list as possible

silent steeple
#

yeah competition

carmine mica
#

Several of those I wouldn’t really consider “fork features” as a plugin could easily do the same

silent steeple
#

wtf is a
ASM Based Event-Bus replacement for Bukkit (2x Faster)

#

whats ASM

eternal night
#

|| purpur ? /s ||

silent steeple
#

assembly?

onyx fjord
silent steeple
#

join ze ziscord

eternal night
#

ASM based event bus, you mean paper's ? xD

carmine mica
#

Yeah

quiet ice
silent steeple
#

so assembly

onyx fjord
#

y would it need to be asm based

eternal night
quiet ice
eternal night
#

bytecode is assembly honestly

hybrid spoke
eternal night
#

its magic

carmine mica
silent steeple
quiet ice
#

ASM at least in java space is a library that operates with java bytecode.
Java bytecode is different to normal assembly in that it is far more human-readable (it isn't machine code) and is stack-based instead of register-based

eternal night
silent steeple
#

any good JNI guides

quiet ice
silent steeple
#

why

quiet ice
#

We live in a world where JNI is to be eradicated

silent steeple
#

i enjoy JNI

quiet ice
#

Use FFI instead

silent steeple
#

ok but

quiet ice
#

Or just don't work with low-level stuff

silent steeple
#

it doesnt support java 8

quiet ice
#

There is 0 reason to use Java 8 my man.
Java 21 is the future and anyone disagreeing will get removed.

eternal night
#

removed

silent steeple
#

java 21 is gonna ruin java for the better 😭

eternal night
silent steeple
#

what is java without public static void main

eternal night
#

the syntactic sugar is the least exciting bit in that release

silent steeple
#

whats exciting

#

then

carmine mica
#

the ordered collections stuff I think is really handy

carmine mica
#

the destructuring stuff is in too right? after a zillion previews

eternal night
#

I mean, record patterns and the related JEPs all left preview

#

yea

#

pattern matching is gonna be great

silent steeple
#

its actually crazy java got better

ivory sleet
#

Structured concurrency still in preview 😭

eternal night
#

valhalla when ?

quiet ice
#

Well at least FFI/Project panama is out

silent steeple
#

noooooo not Unnamed classes 😭

quiet ice
eternal night
quiet ice
#

But I mean valhalla is going to absolutely stun all java bytecode fuckery for some time

eternal night
#

True that

#

but the speed

#

and the efficiency

dull goblet
#

Is it safe to use vault rn? Plugin page says 1.17 max but some people in comments say it works.

quiet ice
#

Let's just hope mojang doesn't use it anytime soon though.
Spigot would be in deep trouble if that is the case

eternal night
#

vault is pretty much feature complete

#

and does not need updating

quiet ice
eternal night
#

you can use it

dull goblet
#

Okay thank you!

maiden thicket
#

vault only uses basic non breaking api i think thats why its still compatibel

quiet ice
#

Well Folia still manages to break it

#

But in that case just use my fork

maiden thicket
#

damn

sturdy zealot
#

what is a nice way to detect if a player is in a cave?

maiden thicket
#

i havent touched folia yet

eternal night
#

I mean, folia breaks everything kekw

quiet ice
#

Well it is the update detection logic that is a tiny bit incompatible with folia - but it still causes it to fail to start

eternal night
#

that is why you gotta add the flag to your plugin.yml

#

lol

maiden thicket
#

folia is out to get me

#

@eternal night i forget, is paper making a custom server software from scratch or has plan to?

#

to move away from mojang code

eternal night
#

no

maiden thicket
#

damn

eternal night
#

those projects seem pretty damned to fail

#

at least from the looks of it

maiden thicket
#

true

#

compatibility would die

silent steeple
#

common java W

vast ledge
#

xD

silent steeple
#

whats the event for when a player right clicks an item

#

player interact event?

vast ledge
#

yes

#

Action.RIGHT_CLICK

icy beacon
#

why can this be occurring?
Caused by: java.sql.SQLException: No value specified for parameter 1
debug:

[19:18:45 INFO]: Query:
      UPDATE kitpvp_abilities
      SET cooldownseconds = ?
      WHERE uuid = ? AND abilityid = ?;

[19:18:45 INFO]: Param1: 60
[19:18:45 INFO]: Param2: 3aca9dd9-313c-3d02-8034-872cbf00b219
[19:18:45 INFO]: Param3: lovely

so the params are there and conform to the query, but i'm still getting the exception

#

i can post the full exception but it's not too relevant prob

vast ledge
eternal night
#

I mean, provide code

dull goblet
#

I'm trying to access essentialsX API, but i'm not sure what the repository should be. I am using maven.
https://mvnrepository.com/artifact/net.essentialsx/EssentialsX/2.20.0

I already have this as dependency:

<!-- https://mvnrepository.com/artifact/net.essentialsx/EssentialsX -->
<dependency>
    <groupId>net.essentialsx</groupId>
    <artifactId>EssentialsX</artifactId>
    <version>2.20.0</version>
</dependency>
silent steeple
#

shout out to the .stream() method, my favourite type of method

icy beacon
onyx fjord
#

oh this one https://repo.essentialsx.net/releases/

icy beacon
#

let me see if this will work after removal

silent steeple
#

anyone got a command framework with annotations

#

please put me on 🙏🏿

eternal night
#

cloud ?

onyx fjord
eternal night
#

it should

#

that way you can wake up each day

silent steeple
eternal night
#

and think to yourself, will mojang DMCA my repo

#

or not

onyx fjord
eternal night
#

maybe its gone, maybe it isn't

silent steeple
eternal night
#

doesn't matter

onyx fjord
#

who is different

silent steeple
#

they disregarded the dmca with "No"

onyx fjord
#

???

eternal night
#

they are not different enough to not be considered copyrighted

onyx fjord
#

its on github

#

github doesnt ignore dmca

quaint mantle
#

I have added a custom sound (a song) to a resourcepack, and I want to play it so every player hears it. I had thought on putting this line inside a for loop:
player.playSound(player, "custom:playerjoin", SoundCategory.VOICE, 1f, 1f);
however, when the sound provided is a string, the method doesn't seem to allow me to pass a player as the first argument

silent steeple
eternal night
#

I see

#

honestly, No seems like a generally good answer for that project kekw

silent steeple
#

yeah

dull goblet
# onyx fjord oh this one `https://repo.essentialsx.net/releases/`

I added that one but i suddenly get this when i try to package:
Unsupported class file major version 60, haven't had that before.

<repository>
    <id>net.essentialsx</id>
    <url>https://repo.essentialsx.net/releases/</url>
</repository>
<dependency>
    <groupId>net.essentialsx</groupId>
    <artifactId>EssentialsX</artifactId>
    <version>2.20.0</version>
</dependency>
onyx fjord
#

ok ill contact mojang and ask them what they think

eternal night
#

would be kinda funny honestly

onyx fjord
#

jk im not their employee

eternal night
#

could open a support ticket idk

onyx fjord
#

they ignored me ima ignore them

silent steeple
#

they will be like we have already asked them multiple times but they have sent bomb threats back to us

#

nothing we can do about it

onyx fjord
#

ze reply

silent steeple
#

archive

#

d

remote swallow
#

read the craftbukkit dmca

silent steeple
#

wolverness is weird

eternal night
remote swallow
silent steeple
#

yeah but those people got removed they didnt reply with bomb threats

remote swallow
eternal night
#

idk man, bomb threats from a dude that maintains 1.8 forks don't seem really scary

remote swallow
#

eaglercraft be like

icy beacon
#

if someone is so insane to maintain 1.8

#

they are insane enough to fulfill their threats

remote swallow
#

eaglercraft is currently benig took down it seems

eternal night
remote swallow
#

cant wait for minecraft to submit a dmca to google and have all eaglercraft search results removed

icy beacon
#

having spent years maintaining something with such a shitty api, they've sworn to destroy their hq many times

silent steeple
#

@remote swallow

remote swallow
#

doubt it would be very hard to get it took down

#

"Hi mojang, link"

sterile breach
#

Hello, what is the better? bukkitrunable or Scheduler?

silent steeple
#

so many people use nachospigot

#

for years

#

and its not been dmca

remote swallow
#

or they just dont give a shit about 1.8

silent steeple
#

yet

#

yessir

eternal night
#

I mean understandable

#

who in their right mind gives a shit about 1.8

buoyant viper
#

use what u please

icy beacon
tender shard
grim ice
#

well

#

not necessarily

icy beacon
#

it also starts up fast

#

the only upside

grim ice
#

1.20 is way more extensive than 1.8

icy beacon
#

yeah and its api is not dogshit

grim ice
#

people who play on potato pcs

#

may not like 1.20

#

personally i didnt have trouble working with 1.8

silent steeple
grim ice
#

doesnt mean i like it though

icy beacon
grim ice
#

might just be me

#

but mostly its self explanatory

icy beacon
#

not really pleasant to be working with something and not being able to even know whether something is nullable

grim ice
#

test it 🤷🏻‍♂️

icy beacon
#

bruh

icy beacon
#

"if my code was hard to write it should be hard to read, no docs for you"

silent steeple
#

how do i check how many chars/words in my whole project

icy beacon
#

of course i can nullcheck everything

#

it's stupid and unnecessary though

#

just lemme know what is and what isnt nullable and under what conditions

grim ice
#

most languages like csharp

#

have null safety

icy beacon
#

i use kotlin and it has null safety

grim ice
#

then?

icy beacon
#

are you saying that the fact, that 1.8 api doesn't state nullability, is a design flaw of java???

grim ice
#

well, in a perfect world, you'd love your programming language to tell you if something is non existent...

icy beacon
#

well it can't read the minds of an api

sterile breach
grim ice
icy beacon
#
public abstract String getName();

tell me if this is nullable

#

exactly, it is

#

but what if it isn't, and it just lacks an annotation or docs

#

see the difference:

public abstract String getName();
// invokation
if (x.getName() == null) return;
x.getName()...
@NonNull
public abstract String getName();
// invokation
x.getName()..
#

if there's no @nonnull i'm just gonna assume it's nullable in 95% of the cases

grim ice
#

well

#

in csharp

icy beacon
#

or well for kotlin
x.getName()?... which is much more convenient but still not convenient if i need to pass a strictly non-null value

grim ice
#

you have Nullable<> or ? for short

#

so technically

#

it is somewhat of a design flaw

icy beacon
#

lack of docs is a language design flaw

#

got it

#

mb

grim ice
#

okay that is not what i said

#

💀

icy beacon
#

see this snippet

#

this could be simplified to the first 2 lines if i knew whether damager & entity are null or not

#

i do assume they aren't

#

but what if they fucking are

grim ice
#

well..

#

you already checked if damager is instanceof player

#

so the nullcheck is not necessary at all

icy beacon
#

ah right, kotlin does allow for this, however i'd easily argue that most of the spigot community uses java

#

including the api itself 😭

grim ice
#

it aint kotlin that does this

#

its java

#

🤦🏻