#help-development

1 messages ยท Page 2108 of 1

summer scroll
#

There is #setInvulnerable method.

sharp flare
#

cancel the entity damage event

#

if I recall it right, armorstands are entities

#

once placed

ebon coral
#

A tick is 50 milliseconds correct?

#

I can't do math rn

summer scroll
ebon coral
#

Thank god I can do math

#

Appreciate it

knotty gale
#

how do I add an item to the players inventory?

knotty gale
#

nah i already figured it out

#

that inventory stuff on bukkit is confusing me

chrome beacon
#

How so?

knotty gale
#

I dont understand that most times when you try to do ItemStack events. I cant figure out how to make it so it ads an item to the world or player

#

I had to go through tons of expirements on how to figure it out

chrome beacon
#

Javadoc tells you all you need

rough drift
#

does Entity#leaveVehicle() trigger EntityDismountEvent?

chrome beacon
#

Probably

granite burrow
#

Hey so im having a bit of an issue with crafting, I have this crafting recipe, and I have all the custom items in my inventory however it still shows up as red, even the iron bars. Any thoughts?

lean gull
#

does anyone know how coreprotect saves data? it logs pretty much anything that any player does and the server doesn't explode somehow

sharp flare
#

Pretty sure it uses database?

lean gull
#

i'm not smart enough to read and understand advanced code

hybrid spoke
#

its nothing special
cache -> go async -> push to database

sharp flare
void shale
#

when learning about canceling right click block action when rightclicking my custom item in hand i learned that it always prefers block action when righclicking(such as door open) over right click item action(such as eating), but if you sneak it prefers your item instead and eats food even when looking at item like doors. I shall definitely try to implement my item right click action the same way too to be in par with vanilla

#

just thought to share this finding, maybe everyone already knows it and i am just a food but ๐Ÿ˜„

granite burrow
golden turret
#

they said it is a spigot bug

steel swan
#

question , to detect if a player breaks a wheat seed, is the block just a wheat_seed
(like that if (blockType == WHEAT))
or is the wheat seed just the item?

golden turret
#

.

rain grove
#

Hello, I have a question, how could I do so that when I enter a specific chunk, a message would come out only once? It's that every time the character moves through the chunk, the message appears. Thanks

golden turret
#

.

#

@granite burrow

earnest forum
#

when they move inside the chunk and their value is false, it means that they're just moving into the chunk for the first time

#

you can send the message then

#

or even just a list of players

rain grove
rain grove
earnest forum
#

yes at the end I put just a list

#

realised my mistake

earnest forum
#

on the move event

#

if they move into your chunk

#

check if they are inside the list

#

if not - then they've entered the chunk for the first time

#

you can send your message and then add them to that list

#

if they move and they aren't in your chunk, but inside the list

#

remove them

sharp flare
#

does a wither potion exist

rain grove
quiet ice
#

Generally I myself Just Store the Last chunk a Player stood in - If it changes send the Message otherwise not

earnest forum
quiet ice
#

I swear that with every Month that Passes discord needs more and more Network capacity. Seems that my 16 kb/s connection doesn't suffice for discord at all anymore

#

Just took a meager 6 minutes to send that message ๐Ÿ˜ซ

rain grove
gritty basin
#

Anyone know money making plugins like jobs and guishops?

#

that works with vault

rain grove
#

and what is the method to know the spawn and not that they do not spawn in that chunk?

#

oh its okay,
How can I get the chunk where the mobs spawn?

#

Thanks!

sacred mountain
#

Hw would i code a placeholderapi extension that will use another plugin's placeholder, but if it returns null it will return a blank string

#

basically the plugin has a placeholder that gives nullpointerexceptions if the player does nt have a suffix. Can i make an extension with my own placeholder that either returns "" if the plugin placeholder returns null?

#

idk if i explained that well

little panther
#

hey, I am just getting "ERROR null" on the commands ive created and im not able to figure out why. Where can i send my code to get help with it?

sacred mountain
#

usefull stacktrace

#

error null

little panther
#

I am very new to coding so that does not tell me much, im sorry ๐Ÿ˜„

fading lake
#

copy paste what console says

tardy delta
#

Paste the error message

#

Ah got ninjad

fading lake
#

๐Ÿฅท

little panther
hybrid spoke
# little panther https://pastebin.com/XV77PNs2

25.04 11:46:39 [Server] INFO Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1 25.04 11:46:39 [Server] INFO at com.cradlenetwork.CradleHeaddrops.Commands.SoulHunterCommands.onCommand(SoulHunterCommands.java:55) ~[CradleHeaddrops.jar:?]

little panther
#

im guessing it comes from me trying to use args.lenght

#

ive used args.lenght to check if there isn't any further args and i dont know if thats the right way to do it or if ive just used the wrong numbers

hybrid spoke
#

show us the code

little panther
#

the main

hybrid spoke
little panther
#

do you mean that the else-statement on row 91 should be an if(args.lenght == 1) ?

hybrid spoke
#

you instantly try to get the args at index 1 and 2 if the sender have the required perms

little panther
#

ah okay, makes sense. Im guessing i add so it has to be a lenght of 3 there?

#

if i understand it correctly

little panther
kind hatch
#

You can cancel the event.

midnight shore
#

?paste

undone axleBOT
midnight shore
#

wait

hybrid spoke
keen anchor
#

Does anyone know how can I change player base strength? with minecraft commands

echo basalt
#

we're developers, not datapack engineers

#

but overall look into /attribute

little panther
echo basalt
#

how hard is it?

#

also you're using static for itemstacks

grand perch
#

is this the api help or..?

topaz cape
#

yes

grand perch
#

cool

#

im here to ask

hybrid spoke
#

?ask then

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!

midnight shore
hybrid spoke
# midnight shore https://paste.md-5.net/zifehinifo.sql what is this?
Caused by: java.lang.NullPointerException: Cannot invoke "com.mojang.datafixers.util.Either.left()" because "either" is null
        at net.minecraft.server.level.PlayerChunkMap.lambda$2(PlayerChunkMap.java:312) ~[spigot-1.17.jar:3170-Spigot-a483d2c-ec116f6]
        at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642) ~[?:?]
        ... 14 more
#

an NPE

midnight shore
#

yeah i know that

#

but i don't know why is this happening

grand perch
#

i have a inventory it has some items but im wondering if the ending item is 36 or 35
i assume its 35 bcs i started with 0

midnight shore
#

when i start the server it does that

lapis widget
#

35

grand perch
#

alr thx

marsh burrow
#

Hey fellas, I know this aint much about spigot/minecraft, but I swear this is for a spigot plugin im making, would anyone know of a way to check if a servers socket connection went down? Cause I can check on the clients side if the server went down, that part works just fine, but on the server side I cant check if the client disconnected. Im using sockets, any ideas on what I can do?

echo basalt
#

connect to any ip and see if it works

void shale
#

how do I capture block right click events like door open, button press, etc?

echo basalt
#

just ping google or something

marsh burrow
echo basalt
#

200 clients can connect to 1 server

#

but the server might not know what client to connect to

marsh burrow
#

the client can detect when the socket closes, but not vise versa

hybrid spoke
#

well, depends on what read is used

marsh burrow
void shale
void shale
void shale
tardy delta
marsh burrow
marsh burrow
void shale
#
@EventHandler
    public void onPlayerUse(final PlayerInteractEvent event) {
        if (event.getPlayer().isOp() && event.getAction().isLeftClick() && event.getPlayer().getInventory().getItemInMainHand().getType().equals(Material.PAPER)) {
            TeleportScroll.makeScroll(event.getPlayer().getInventory().getItemInMainHand());
        } else if (event.getAction().isRightClick()) {
            if (event.getPlayer().getInventory().getItemInMainHand().getType().equals(Material.PAPER)) {
                TeleportScroll.useScroll(event.getPlayer());
                event.setCancelled(true);
            } else if (event.getPlayer().isOp() && event.getPlayer().getInventory().getItemInMainHand().getType().equals(Material.STICK)) {
                App.config.set("spawn.world", event.getPlayer().getWorld().getName());
                App.config.set("spawn.x", event.getPlayer().getLocation().getX());
                App.config.set("spawn.y", event.getPlayer().getLocation().getY());
                App.config.set("spawn.z", event.getPlayer().getLocation().getZ());
                App.config.set("spawn.yaw", event.getPlayer().getLocation().getYaw());
                App.config.set("spawn.pitch", event.getPlayer().getLocation().getPitch());
                event.getPlayer().showTitle(Title.title(Component.text(""), Component.text("New world spawn set!")));
                App.plugin.saveConfig();
            }
        }
    }

Can someone explain me how if i click some block that has interaction event it calls not just useScroll but also makeScroll if I only right click?

#

I am confussion

rough drift
#

As the server wont be able to process packets then

#

Just try with available()

#

AAlso playerdisconnectevent is a thing

void shale
#

like if I interact with something in game it calls the code that i specify that only runs on leftClick

#

this is too confussing

little panther
# echo basalt you're trying to add a null ItemStack to an inventory

Sorry for late reply. I understand so far that the itemstack im loading is null and i know that is not possible. So im not supposed to have the itemstack as static. I get errors if i dont have it as static. I'm sorry if i dont totally understand, I'm kinda new to coding

echo basalt
#

well I'm telling you it's the error

#

"not possible" is simply not an option

hybrid spoke
little panther
echo basalt
#

I only mentioned static as it's somewhat bad practice to abuse it

#

It's meant for constant values and such, not really for accessibility

#

one thing you might be doing is loading the static items after the command

little panther
echo basalt
#

well I haven't had a look at the class where you hold the item

little panther
#

should i send it?

echo basalt
#

idk you tell me

little panther
echo basalt
little panther
echo basalt
#

read it carefully

#

I'm surprised your IDE isn't giving you a warning

little panther
#

ive justed the right spellings, the only thing i can think of is that i use ItemMeta istead of like BookMeta, but couldnt find anything that was setBookMeta

echo basalt
#

second line

#

not the first

little panther
#

wrong order?

eternal oxide
#

you set meta on item, then wipe out item

little panther
#

im guessing that should fix it

echo basalt
#

try it

little panther
#

will do

charred blaze
#

when i set gravity to false on dropped item it starts flying and then stops

#

lel

marsh burrow
echo basalt
charred blaze
#

how?

echo basalt
#

I had this issue with client-side items. It's a client prediction

#

Item#setVelocity

charred blaze
#

i tried

#

.setvelocity(0)

#

but

#

0 isnt option

#

so im asking

#

how

echo basalt
#

well setVelocity takes a vector

eternal oxide
#

new Vector

charred blaze
#

h o w

#

example code

echo basalt
#

๐Ÿฅฃ

#

think of a vector as a 3d point

#

which indicates relative movement to something

#

in case of velocities, that movement is measured in blocks per second

#

You can also convert locations to vectors, which will be relative to 0

#

Here's a very basic example of a vector

charred blaze
#

YESSSSSSSSSS

#

:D

echo basalt
#
Vector upVelocity = new Vector(0, 10, 0);

LivingEntity entity = ...;
entity.setVelocity(upVelocity);
charred blaze
#

this will stop

#

from

#

flying?

echo basalt
#

in this case, the entity will have its velocity set to a very high Y level

eternal oxide
#

setVelocity(new Vector())

echo basalt
#

meaning it will fly up

eternal oxide
#

make sure you are using teh Bukkit Vector

charred blaze
#

tried dis

#

some are not flying

#

some flying

echo basalt
#

try delaying it by a tick

charred blaze
#

i have

#

another

#

question

#

how to prevent

#

lot of items

#

from

#

stacking

#

itself

echo basalt
#

ItemMergeEvent

charred blaze
eternal oxide
#

you can have more than one word per line

charred blaze
echo basalt
little panther
#

it did not fix it sadly

charred blaze
echo basalt
#

sadge

charred blaze
#

i m

#

makin

#

plugin

#

veri gud idea

hasty prawn
#

Or is that just the angle

echo basalt
#

because I did damage predictions

#

and yeah angle

hasty prawn
#

Ahh

#

Really cool effect though

echo basalt
#

ppretty sure the velocity check matched the grass plant

small current
#

0xFF0000 is an integer
if i do Integer.valueOf("0xFF0000");

will it return int 0xFF0000 ?

echo basalt
#

basic raytrace that accounts for gravity

echo basalt
#

not sure if that's a thing in java 8

#

but you need to say what base(8, 10, 16) it is on

small current
#

a base 16 right?

echo basalt
#

yea

small current
#

thanks

charred blaze
#

im

#

trying

#

to

#

make

#

plugin

#

like dis

#

rotating

#

diamonds

echo basalt
#

ah

#

armorstands then

#

might work better

charred blaze
#

i need

#

method

#

to

#

make that

grand perch
#

how to import yml file

eternal oxide
grand perch
#

alr

#

thx

sinful tundra
#

can I put a limit on how much xp a furnace can store? I'm trying to limit the cactus farm xp glitch for my server
destroys the economy in my server

worldly ingot
sinful tundra
#

Yeah I just found it in the spigot API xDDD

cedar hamlet
#

Hey all, I'm making a plugin with intelliJ, and I'm wondering if i can directly update the .jar file in the plugins folder instead of stopping the server, going to the target folder, copying the jar, pasting it in the plugins folder after deleting the old one, and starting the server

sinful tundra
#

Once you made the artifact you can direct the intellij to go a custom output folder, in my case I did it to my own test server
File -> Project Settings -> Artifacts and you'll have this one

maiden thicket
sinful tundra
eternal night
#

not the block but its state

sinful tundra
#

A way to get it through it's state?

cedar hamlet
sinful tundra
#

Project Structure, my bad

cedar hamlet
#

Ok

sinful tundra
#

You can add a new one clicking the plus and just ok

cedar hamlet
#

Which one do i choose

#

jar?

sinful tundra
#

plus->Jar->From Modules....->Ok

cedar hamlet
#

oh ok

sinful tundra
#

Yeah, then you can change the output folder

#

To build you go to build->Arctifacts->Build

eternal night
#

isn't that for building with intellij ??

sinful tundra
#

Ye

eternal night
#

who in their right mind uses intellij build

sinful tundra
#

:/

#

It works and if nothing's broken there's no point in fixing it man

eternal night
#

Well they are already using maven

#

why not just stick to a proper build tool

sinful tundra
#

How can I use it if that's the case?

eternal night
#

the maven jar plugin has a configurable option to change the output location

#

I would suggest putting this in its own profile

#

to not always run it

#

but that is the gist of it

cedar hamlet
#

Well, Scream's method works for me

#

thank you

eternal night
#

Yea but that stuff only works if you configured it with intellij

#

like

cedar hamlet
#

which is what I'm using

eternal night
#

any other IDE will fail (if you plan to host this on github)

cedar hamlet
#

Ah, well, I don't, but thank you for the heads up

eternal night
#

tracking this in git also requires you to actively push the intellij configuration fiels for it

#

then there is the disadvantage of just ignoring other maven build configuration (e.g. shade)

#

but eeek, if ya wanna use intellij building, I guess go ahead ๐Ÿ˜…

little panther
#

Hey, i have a problem with that my command does not show up in the tab-completion ingame. Do anyone know why?

shadow gazelle
#

You need to "register" tab completion separately

shadow gazelle
#

I think the event is onTabComplete

supple elk
#

anyone know why this isn't working?

#

As far as I can see the only character I have which isn't in the possible characters is a backslash

#

but then how am I meant to create a world in a specific place?

#

cause any path will always have a backslah

eternal night
#

you don't

#

worlds live in the world container

#

which is by default the root folder of the server

quaint mantle
eternal night
#

you can however, provide your own name to the world creator

#

tho, obviously this depends on your FS

supple elk
#

FS?

#

file system?

eternal night
#

as any normal human would run their production on a linux machine, you'd need to use / there

onyx fjord
#

windows is dum

#

when it comes to technical stuff

#

\ is reserved for char escaping

supple elk
#

I see

onyx fjord
#

good to at least have wsl

supple elk
#

so can I not create a world anywhere except in the root folder?

eternal night
#

well, you can supply a name and a namespaced key

#

iirc the name is used for folder resolution

little panther
shadow gazelle
#

In a few of my projects, but I'm not at home to look at them

supple elk
supple elk
#

how does that let me create a a world in new directory

eternal night
#

I mean, eh

#

the WorldCreator class has a constructor that takes both the name and a namespaced key

shadow gazelle
eternal night
supple elk
little panther
#

(the one that is false has nothing with any command to do)

eternal night
#

I mean it is more related to what permissions you defined on the command definition in the plugin.yml

little panther
#

ah, but like, im able to execute the command on the server. I just dont get it as a suggestion in any way

eternal night
#

are you running java 17 ?

supple elk
supple elk
eternal night
#

oh

#

sorry I was on paper ๐Ÿ˜…

supple elk
#

;-;

eternal night
#

well rip you

supple elk
#

so no way I can create worlds in a place which isn't the root dir??

#

how am I meant to organise worlds >_>

#

Having all the worlds for all minigame in the root dir is stupid

eternal night
#

well just run in linux :5head:

supple elk
#

-_-

#

I can't just suddenly turn my windows laptop into a linux device

eternal night
#

WSL ๐Ÿ™‚

tardy delta
#

vm

#

dualboot

supple elk
#

There's surely a way around it which doesn't involve that

eternal night
#

reflection

#

into the WorldCreator class

supple elk
#

and edit it?

eternal night
#

basically create it with a non-blackslash name

#

and then edit the name afterwards

supple elk
#

won't it then create the world in the wrong place?

eternal night
#

(and then also hope that the creation logic actually does allow subfolders)

#

huh ?

supple elk
#

if i enter the name without backslashes

eternal night
#

Well don't create the world before you edit it

supple elk
#

ah right

#

I see

eternal night
#

And then the server just creates the folder "a\b" instead of a and then b

#

lol

supple elk
#

yeah

eternal night
#

might happen

#

you'll find out

supple elk
#

won't the name test be during the createWorld function tho?

#

I'll test it now

#

yeah I can create a WorldCreator with a name w/ backslashes

#

so editing the name using reflection before running the createWorld() function won't help

eternal night
#

wat ?

#

oh

#

right I am, once again, looking at paper

#

mb

#

well rip you

supple elk
#

lol

#

Can I extend the world creator then override?

eternal night
#

๐Ÿค” maybe ? lol

#

but idk what that would get you

#

unless you do some very very ugly shenanigans with the name getter

supple elk
#

ok well uh

#

extending the WorldCreator won't help

opal juniper
#

lol

supple elk
#

Anyone got any ideas?

maiden briar
#

What is the best way to save objects like Location and ItemStack to a MySQL database?

tardy delta
#

for a location, save the world name, x y z yaw and pitch

#

itemstacks are difficult

kind hatch
#

Maybe store the string representation for how it serializes in yaml?

maiden briar
mortal hare
#

man i hate this feeling when u know you can finish that project

#

but at the same time, you're burned out because of it

maiden briar
#

BukkitObjectOutputStream

little panther
eternal night
#

If you can I believe Java 18 fixed that

mortal hare
#

how to fcking fix this

#

so annoying

#

i can't run test server

#

properly because of this

#

it hangs for like 5 mins

#

before the initialization starts

tardy delta
#

thats a long startup script

little panther
rough drift
#

smaller than my-

tardy delta
#

than what?

rough drift
#

its a joke

#

you get it

tardy delta
#

๐ŸŽƒ

little panther
supple elk
#

Anyway to save a world in a sub folder??

quiet ice
#

Yeh, I am big dum dum

little panther
supple elk
#

@eternal night found the answer

#

using forward slashes

#

instead of back slashes

#

I think you suggested that but I think that was in relation to Linux

tardy delta
#

or just File.separator if you want to be able to use it on linux and windows

supple elk
#

not quite

#

I was using FIle.separator

supple elk
#

but Bukkit.createWorld() was kicking up a fit

#

cause it only takes forward slashes

#

and not back slashed which is the file separator on windows

#

so I now have to replace the file separator with a forward slash when passing it to the world creator

#

but it gets even more complicated because if the file separator is a backslash then I have to add 4 backslashes

#

Anyway I can limit the CPU% my server uses?

#

Every time I launch it is maxes out my CPU

tardy delta
#

give it a little less ram

supple elk
#

giving it less RAM will make it use less CPU?

#

๐Ÿค”

ivory sleet
#

no not inherently

supple elk
#

pretty sure it's on default allocation anyway, so 1GB I think?

opal juniper
#

something like that

supple elk
#

actually looks like 2gb

tardy delta
#

smh just came to the conclusion that you cant really change it much

small lynx
#

?mysql

#

how i learn to code with mysql

tardy delta
#

look at some tutorial on youtube

native falcon
tardy delta
#

thats just syntax

glossy venture
#
.component(EventItemBehaviourComponent::new,
        (item, ibc) -> ibc.adapter()
            // define a behaviour handler for our item
            .behaviour(ItemInteraction.class, interaction ->
                    interaction.getEvent().getPlayer().sendMessage(interaction.getState().toString()))
)
``` should probably introduce an alias for this
tardy delta
#

whas that?

glossy venture
#

for adding behaviour to custom items

#

all that does is send the item state in chat

#

when a player uses it

#

wanted to use mixins to call the events

#

but its not possible i think

#

so now im just forwarding bukkit events through my own event bus

tardy delta
#

crazy stuff

glossy venture
#

which is abstracted away by the behaviour component lmao

tardy delta
glossy venture
#

overcomplicated]

tardy delta
#

for me yes

glossy venture
#

nah but i could have users do everything manually

#

like register listeners

#

and get the item state from the nbt tag

#

and shit

#

but i dont want that

restive tangle
#

This guy is very impressive

glossy venture
#

one character

#

also k is easier to type than z

#

z is all the way on the bottom left

#

its hard bruh

opal juniper
#

yeah but clazz is more standardised lol

glossy venture
#

idc

#

im not going around changing the like 50 variables and fields

#

for some stupid standard

#

also i ahvent commited the new changes yet

#

so you wont be able to find the code i sent

opal juniper
#

hmm, this kinda just seems like a big ol wrapper around bukkit

#

abstracting abstraction

glossy venture
#

i wanted to do mixins

#

for calling events

#

but i couldnt

#

also it has custom crafting api which is fast

#

and epic

#

yes

quiet ice
opal juniper
#

thing is with mixins is that u are in the shit with regards to nms

#

injecting into nms code ig

glossy venture
#

or any method

#

really

quiet ice
#

So not as in spongepowered mixins?

glossy venture
#

yes that

#

but i dont think you can use them with bukkit

chrome beacon
#

You can

glossy venture
#

oh

#

?

opal juniper
#

yeah u can

quiet ice
#

You can with ignite or other 3rd party applications

glossy venture
#

yeah but id like to stay away from 3rd party applications

#

i use one additional dependency which is zl-zip or something because i couldnt get zipping to work

quiet ice
#

Well you can just code it yourself, it's just a couple of dozen classes

#

How can you not get zipping to work? It's pretty easy

glossy venture
#

idk it didnt

#

lol

#

winrar was opening it fine

quiet ice
#

Sure, it's a bit complicated at first but pretty easy after that

glossy venture
#

but minecraft wasnt loading the resource pack

quiet ice
#

Oh that issue

glossy venture
#

i worded it incorrectly

glossy venture
quiet ice
glossy venture
#

thanks

#

hope bukkit will add mixin support lol

quiet ice
#

As far as I know, you can redefine classes at runtime, so it might also be possible to do it without some kind of bootstrap

#

Mixin is nice and all, but I prefer raw ASM

glossy venture
#

i mean i could use that too

#

as i only want to invoke methods

#

could just insert some INVOKE myMethod somewhere

#

doesnt paper generate method executors

#

because i have asm in my project

#

through paperweight

tender shard
#

I have a Stream<Byte>. Does anyone know an easier to convert it to a byte[] than this?

byte[] array = Arrays.stream(string).mapToInt(Byte::parseByte).collect(ByteArrayOutputStream::new, new ObjIntConsumer<ByteArrayOutputStream>() {
                    @Override
                    public void accept(ByteArrayOutputStream byteArrayOutputStream, int value) {
                        byteArrayOutputStream.write((byte) value);
                    }
                }, new BiConsumer<ByteArrayOutputStream, ByteArrayOutputStream>() {
                    @Override
                    public void accept(ByteArrayOutputStream byteArrayOutputStream, ByteArrayOutputStream byteArrayOutputStream2) {
                        byteArrayOutputStream.write(byteArrayOutputStream2.toByteArray(), 0, byteArrayOutputStream2.size());
                    }
                }).toByteArray();

(Yes obv I could turn the anon classes to lambdas, that's not what I mean with "easier")

quiet ice
glossy venture
#

so theres some kind of asm going on

#

at least defining classes

#

but thats not hard

#

you can do that with a simple classloader

tardy delta
#

collect and and call toarray

#

?

crisp steeple
#

yea

quiet ice
#

if it wasn't for streams I probably might have a performant and semi-elegant solution but otherwise I'd say that this may just as well be good enough

#

Though you might just as well be able to work with a single ByteArrayOutputStream and use an iterator at the end of the stream

midnight shore
#

Hello i was wondering if its possible to get a piece of code from a list of string. For example

strings:

  • p.sendMessage("hello");
  • p.setVelocity(new Vector(0,10,0);
  • p.sendMessage("Fly to the moon!);
tardy delta
#

p has to be coming from somewhere

#

:p

crisp steeple
#

that would be pretty complicated and probably involve java agents

tardy delta
#

im thinking of skript now

midnight shore
#

it was just a thing i was wondering

#

ty

quiet ice
#

You could look at recaf and see how it does it

#

But that would require a JDK and worst of all a library that is prone to break

grim ice
#

or am i missing smth

#

as that sounds too simple

quiet ice
#
byte[] array  = new byte[string.size()];
for (int i = 0; i < array.length; i++) {
    array[i] = Byte.parseByte(string.get(i));
}
#

Much, much nicer solution if string is a List<String> that doesn't use Streams however

tender shard
#

I need byte[] and not Byte[]

quiet ice
#

God damn generics

#

Oh right

#

Eh, you get the idea

crisp steeple
tardy delta
#

isnt there someting as Byte::byteValue?

#

or (byte) blablabla::intValue

grim ice
#

if u have apache lib

#

just

quiet ice
#

Byte.parseByte

grim ice
#

byte[] bytes = ArrayUtils.toPrimitive(byteArray);

quiet ice
#

Oh god, you don't have to do everything with streams do you

tardy delta
#

map it lol

grim ice
crisp steeple
quiet ice
#

yes, but from time to time horribly inefficent

lone lintel
#

Hey, does anyone know of a tutorial on how to make custom recipe plugins/inventory & chest GUI plugins? I'm new to plugin development but have about 4 months Java experience.

smoky oak
#

is there an event that encompasses every possible Material change of a block? Or is it completely impossible to find out if a block has been replaced without a physics update?

quiet ice
#

Most stream-based solutions rely on ByteArrayOutputStream or an ArrayList

tardy delta
#

i like the way rust implemented their iterators (basically streams) it just compiles to the same code as regular for loops

quiet ice
#

Which means that you will have an oversized array in the end and then clone it

#

Plus for list-based solutions it will internally be represented as Byte[], not byte[]

tender shard
tender shard
tender shard
quiet ice
#

So yes, it might work

tender shard
#

no

#

it won't work

quiet ice
#

However it would require that java is smart enough to automatically unbox the bytes

tender shard
#

I'll just use ArrayUtils ๐Ÿ™‚

quiet ice
#

Supplier<byte[]> is actually valid

tardy delta
#

looks meh

quiet ice
#

Also fun fact: @Nullable byte[] will not compile if you have any reasonably good IDE

lone lintel
quiet ice
#

The proper way would be byte @Nullable [] which looks cursed AF but that is java

quiet ice
#

Doing it by hand is generally not advisable because there is a rather unignorable chance of you introducing exploits due to not having carefully tested it enough

crisp steeple
lone lintel
quaint mantle
#

libs

quiet ice
#

Yep those are open source and work kinda like bukkit

#

If you use maven or gradle it isn't much of a stretch to change your code to use them

lone lintel
#

What are some basic practice "plugins" to make before I start trying to get into developing my own stuff?

granite burrow
tender shard
#
java.lang.NumberFormatException: Value out of range. Value:"11000010" Radix:2
    at java.lang.Byte.parseByte(Byte.java:151)
    at

erm wtf, why? that's definitely not outside of the allowed range

lone lintel
#

Or is it better to just jump straight in

tender shard
#

that's because it's signed

quiet ice
#

You may want to parse an unsigned byte

#

there is a method for that but I think you know that

tender shard
#

hm

lone lintel
#

8 bit signed max value is 127

#

pretty sure

#

minimum would be -128

tender shard
#

but it makes no sense

#

I am literally converting a byte to a string

#

then convert it back and now it's out of range

#

lol

quiet ice
#

That is because your toString method probably is unsigned

tender shard
#
case BYTE_ARRAY: {
                StringBuilder result = new StringBuilder();
                for (byte b : string.getBytes(StandardCharsets.UTF_8)) {
                    result.append(String.format("%8s", Integer.toBinaryString(b /*& 0xFF*/)).replace(' ','0'));
                }
                return result.toString();
            }

I tried it both with the & 0xFF and without

quaint mantle
#

why

quiet ice
#

yeah, toBinaryString is unsigned

tender shard
feral socket
#

uint8_t

supple elk
#

I want to unload a world as soon as it loads

#

to generate the world file

#

do I need to do it like this?

#

or can I just immediately call Bukkit.unloadWorld() after creating the world

feral socket
#

the latter, most likely

supple elk
#

k so I don't need to register a listener

#

I guess I'll just have to test

feral socket
#

why would you?

#

a world is a world

supple elk
feral socket
#

it already has

supple elk
#

yeah but the server takes time to create the files and actually build the world

feral socket
#

and it's all done synchronously

supple elk
#

oh right

#

I assumed world building would be an async thing

#

since it's an I/O operation

feral socket
#

if only

supple elk
#

that's inefficient >_>

grim ice
#

io != async

#

sometimes it needs to be sync

supple elk
#

I assumed it would be async cause building a world is gonna take a while so would make sense to do async so other server operations wouldn't have to wait on it's completion

#

but yeah just do it synchronous does load in the world files

grim ice
#

when only a portion of it is loaded

#

and he breaks a block for example

#

what will happen to the broken block?

supple elk
#

Well presumably if you tried to teleport somebody into a world which hasn't finished loading then it would throw an error

grim ice
#

minecraft doesnt work like that

#

its a one world

#

in vanilla

supple elk
#

yes but this is Bukkit where you can make multiple worlds >_>

#

there is even an onWorldEvent

#

so you could detect when a world had finished loading

grim ice
#

Bukkit is still minecraft

#

and there must be other reasons as well

supple elk
#

presumably

grim ice
#

just cant get one off the top of my head rn

crisp steeple
#

you could make the world create async if you want

#

if youโ€™re concerned about performance

supple elk
#

oh?

#

yeah I mean it would be good

#

cause I'll be loading / unloading worlds a lot

#

making minigames and a world is created every time a minigame starts

crisp steeple
#

just generate is async and add a callback for when it finishes

supple elk
#

so if I'm running it all on one server that would be rough if everying froze every time a server loads

supple elk
#

There isn't any reason I can't load it asyn or smmin?

#

I'm gonna have to look up how to do async as I've never done it before

grim ice
#

it definitely will break stuff

#

as far as i remember

#

the last time i saw someone building a world in bukkit forums

chrome beacon
#

If you're making a minigame server you can work with Minestom :)

crisp steeple
supple elk
#

oh cool you've done before

crisp steeple
#

yea

supple elk
#

you got code I could look at?

crisp steeple
#

uh

#

not public no

supple elk
#

which I could take inspiration from

#

kk

crisp steeple
#

i just use a bukkit runnable for all the creation

supple elk
#

mk

crisp steeple
#

and then execute a callback for when it finishes

#

prettty much just wrap your current code in a runnable

supple elk
#

๐Ÿ‘

grim ice
#

youre gonna do the creation manually?

#

with nms?

supple elk
#

could use Futures?

#

I feel like this would be an appropriate time to use them

tardy delta
#

i used completable futures for it

supple elk
#

I'm not very experienced with Futures, I've got an idea of how they work but seeing an implementation if you've got one would be helpful

tardy delta
supple elk
#

ty

grim ice
#

i wouldnt do what ur doing

#

but u do u

tardy delta
#

im planning on recoding it

grim ice
#

not u

#

the async world loading and gen thing

supple elk
#

why not?

grim ice
#

minecraft just aint like dat

supple elk
#

doesn't seem particularly convincing >_>

grim ice
#

try it out then

crisp steeple
grim ice
#

its gonna run sync

crisp steeple
#

not if you run it asynchronousโ€ฆ

eternal night
#

createWorld(WorldCreator) def isnโ€™t Thread safe Iirc ๐Ÿค”

grim ice
#

lol

#

thats why people have to do it manually with nms

#

and its such a pain to do

#

i wouldnt bother trying

crisp steeple
#

didnโ€™t do it with nms either

rapid vigil
#

Hello, is there an event for when a totem is activated for the player?

crude estuary
#

EntityResurrectEvent

#

then Check if Entity is a Player

rapid vigil
#

Ah thanks, let me try it

#

Does that event only run when the totem is activated?

crude estuary
#

it Runs when the Entity gets Resurrected

#

and the Totem Resurrects Entities on Activated

#

so i Think yes

rapid vigil
#

Ah it worked, thank you so much

sterile token
#

How to compare ItemStack on 1.12

feral socket
#

idk read the docs

ivory sleet
sterile token
feral socket
#

then what the hell are you comparing

sterile token
#

I just kno the display name and lore

ivory sleet
#

sounds hard to compare it if you dont have it

#

then compare those two things?

#

Objects.equals(lore1,lore2) and same goes for the name, altho you might wanna use equalsIgnoreCase depending on how strict you want to be

sterile token
#

Oh ok, because i was getting NPE when doing:

ItemHandler#getItem(display)

#

And i checked the event display name and its was not null

dusk flicker
#

Whats ItemHandler?

sterile token
#

My class that contains the Set<ItemStack> and the ItemStack getItem()

feral socket
#

i love checking item equality through name and lore

#

that's my favorite practice

sterile token
#

Oh lol

#

Can u help me?

feral socket
#

yeah

#

stop doing that

ivory sleet
#

lol

sterile token
#

hat?

#

I cannot do anything else

feral socket
#

yes, hat

#

๐Ÿงข

dusk flicker
#

love sarcasm

feral socket
#

when you're 10 years old nothing is sarcasm

sterile token
#

ARE u help or not

feral socket
#

no, i am sergei

spring minnow
#

is there a way to set a nbt to a block that isn't a TileState block such as a chest?

feral socket
#

learn to read

ivory sleet
#

but no there's no way otherwise

spring minnow
#

yeah

#

i know

#

i have to set a nbt to a block that isn't a tileState

ivory sleet
#

Ig you could use the pdc chunks provide

spring minnow
#

my english is bad

ivory sleet
#

no worries

feral socket
spring minnow
ivory sleet
#

(derives PersistentDataHolder)

civic apex
#

Im getting this Cannot invoke "org.bukkit.block.BlockFace.getOppositeFace()" because "this.mainFace" is null exception when constructing a new BlockIterator but Im not able to identify exactly when its going to be thrown

#

at org.bukkit.util.BlockIterator.<init>(BlockIterator.java:139) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]

spring minnow
#

yeah but how can i use Chunk class to add nbt to a single block?

#

should i like set a persistant data that contains block location and then add the data i need?

ivory sleet
#

I mean just map the block relatively and then of course you'd have to check for BlockBreakEvent

#

ye

spring minnow
#

ok

#

thanks

civic apex
crisp steeple
#

hi

waxen plinth
#

thanks @feral socket

waxen plinth
spring minnow
#

oh

#

i'll check it out

fleet pier
#

anyone knowing a java chat filter api

#

or json chat filter api

#

๐Ÿค”

ivory sleet
#

I mean regex to some extent

sand vector
#

is there a way of checking if an item is of type tool?

ivory sleet
#

got mineable <tool>

tardy delta
#

most of the useful stuff isnt in there :(

sand vector
#

yeah nothing there that is of use. I guess i could create an if statement with all the tools in it

tardy delta
#

or an enumset with all the tool materials in

sand vector
#

Yeah I can do that. seems better than a long if statement

ivory sleet
#

use a normal hash set

tardy delta
#

material still is an enum >_<

ivory sleet
#

(subject to change) in the conceivable future, enum registries are gonna be substituted

tardy delta
#

what does that mean

ivory sleet
#

they wont be enums

#

Material wont extend Enum<Material>

tardy delta
#

aight

#

gn :D

ivory sleet
#

sleep sight :#

patent horizon
#

would anyone know how i could embed a clickable link into chat using kyori minimessage?

#

oh wait this is spigot

#

sry

river oracle
#

anyone on here familiar with lamp at all

#

trying to set up my command, but keep getting dispatch errors because of null references when registering dependencies
https://paste.md-5.net/bijocimeye.coffeescript
[18:14:23] [Server thread/WARN]: java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.file.FileConfiguration.getInt(String)" because "this.config" is null

#

?paste

undone axleBOT
manic delta
#

guys why when i type a % in PlayerChatEvent it literally breaks everything?

#

I mean the event.setFormat()

noble lantern
#

iirc

manic delta
#

What is it

noble lantern
#

e.setFormat("%s %s", playerName, playerMessage);

manic delta
#

a

#

Mmm

#

Okay i will try later

#

Thank u

manic delta
#

And I have to put the format I want in the first argument right?

noble lantern
#

yes

#

so like

manic delta
#

Like

e.setFormat("&c%s ยป &f%s", playerName, playerMessage);
noble lantern
#

e.setFormat("%s >> %s", playerName, playerMessage);

would be Burchard37 >> Hey!

manic delta
#

O okay

noble lantern
#

olaaaay

manic delta
#

๐Ÿ˜ฟ

#

Thank u

#

I thought it was something from the placeholderapi

noble lantern
#

nah its just how setFormat of that event works

manic delta
#

ok thanks u

worldly ingot
#

Yeah only the latter arguments aren't needed, they're automatic

#

You're just setting the format is all

#

First %s is the display name, second %s is the message

noble lantern
errant narwhal
#

hi

#

i need help

dusk flicker
#

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

quaint mantle
#

BoundingBox for a minigame arenaโ€™s region, is it a good idea to use it?

nova prism
#

u could use world borders

noble lantern
#

Does anyone understand github-pages by chance?

I'm trying to build a website from my directories /docs folder here: https://github.com/Burchard36/BurchAPI/tree/main/docs

And i have this for my pages configuration for the project in the image below:

The issue is, when visiting that website, i just get redirected to to a page that is the Home of my wiki page: https://burchard36.github.io/BurchAPI/ Would anyone know why this is or am i doing this all wrong? Or is it just a caching issue as i just did upload this

#

okay nvm

#

caching issue

#

just loaded now, nvm

grand perch
#

how do i set a yaml thin like

shop:
  Blocks:
    grass: 18
  Pvp:
    Sword: 19
  potions:
    etc
#

using config.set

kind hatch
#

What are you trying to achieve here?
Change one of the values? Add another section to the list? Remove a section?

grand perch
#

no im trying to make the file with the default configurations

kind hatch
#

Like, writing it to disk when the plugin loads? Or?

grand perch
#

nvm

#

also how do i read the file

kind hatch
#

Well if that is your config.yml, you can just use JavaPlugin#getConfig(). Otherwise, you will need to create an instance of FileConfiguration and instantiate it with YamlConfiguration#loadConfiguration()

grand perch
#

Static method 'getConfig()' in 'com.aspectx.fixmc.fixmcshopgui.FixmcShopGui' cannot override instance method 'getConfig()' in 'org.bukkit.plugin.java.JavaPlugin'

#

i tried removing static but this shows up Non-static method 'getConfig()' cannot be referenced from a static context

kind hatch
#

Well... yea that makes sense. What's your code look like? Because you shouldn't need to use static for most things.

grand perch
#
    public FileConfiguration getConfig() {
        return shopConfig;
    }
    FileConfiguration config;
    public static Inventory inv;

    public categoryGui(String Category) {
        inv = Bukkit.createInventory(this, 54, Category + "Shop");
        init(Category);
        config = FixmcShopGui.getConfig();
    }
kind hatch
#

Well you're trying to call a method from the class FixmcShopGui that isn't static. Ideally that should be an instance of that class, not the class itself.

grand perch
#

so your saying FixmcShopGui fixmc = new FixmcShopGui()?

kind hatch
#

That's one way, but I don't think it'll work as your main class is actually a Singleton. So instead, you'd want to use dependency injection. It's really easy. You just pass an instance of whatever class you need, in this case, your main class, in the constructor of whatever class needs access to it.

grand perch
#

alr

ornate patio
#

is it possible to make a horse run over to another horse and attack it?

#

(is it possible to control a mob's AI to run to a specific location)

#

(and is it possible to make a passive mob attack another mob "genuinely", without having the server cause damage and push the entity back)

waxen plinth
#

not with the spigot api

#

you'd need nms for that

grand perch
#

org.bukkit.command.CommandException: Cannot execute command 'shop' in plugin FixmcShopGui v0.1 - plugin is disabled.

#
[04:11:41 ERROR]: null
org.bukkit.command.CommandException: Cannot execute command 'shop' in plugin FixmcShopGui v0.1 - plugin is disabled.

:/

ornate patio
grand perch
#

anyone else got this error?

ornate patio
#

what is nms lol

grand perch
#

net.minecraft.server

crisp steeple
#

net.moose.socks

kind hatch
#

nice.mu.stache

earnest forum
#

why's your plugin disabled

grand perch
#

idk

#

how do i enable it

earnest forum
#

are you disabling it anywhere in your plugin manually?

kind hatch
#

Your console should tell you why.

earnest forum
#

look at your console

#

scroll up to before the server started up

#

where it's enabling all the plugins

#

you should see some type of error related to your plugin

grand perch
#
[04:23:58 ERROR]: Error occurred while enabling FixmcShopGui v0.1 (Is it up to date?)
java.lang.IllegalArgumentException: The embedded resource 'shop.yml' cannot be found in plugins/ShopGui-0.1.jar
kind hatch
#

Well, that's one issue, but I don't think that would disable the plugin. Would it?
What are you using to compile your jar?

grand perch
#

i assume it cant find shop.yml

kind hatch
#

Maven, Gradle, manually?

grand perch
#

i think its maven im not very sure

kind hatch
#

Well do you have a pom.xml anywhere in your project?

grand perch
#

yes in the root folder

kind hatch
#

Do you have the <resources> section in your <build> section?

#

If not, add this in your build section.

<resources>
  <resource>
    <directory>src/main/resources</directory>
    <filtering>true</filtering>
  </resource>
</resources>
grand perch
#

yes

#

it does

kind hatch
#

Alright, what about the <plugins> section. What do you have in there?

grand perch
#

in the plugins component theres 2 plugin and a resource

#

no nvm the resource is outside the plugins

#
<plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
kind hatch
#

Well, you probably don't need the shade plugin unless you are including other classes/libraries that you have to be present in your jar.

#

The compile plugin should be enough.

grand perch
#

wat

#

so i remove the bottom one?

kind hatch
#

Remove the shade plugin yes.

grand perch
#

alr

kind hatch
#

Also, how are you compiling your jar? Are you using the commands or using the default build button?

grand perch
#

yes

kind hatch
#

Then you might want to set a <defaultGoal> flag in your build section.

#
<defaultGoal>clean package</defaultGoal>
#

At the very top of the section

grand perch
#

what does that do

kind hatch
#

It changes the behavior of the build button to follow those commands instead of the default.

grand perch
#

ok

#

so how do i fix the error

[04:37:47 ERROR]: Error occurred while enabling FixmcShopGui v0.1 (Is it up to date?)
java.lang.IllegalArgumentException: The embedded resource 'shop.yml' cannot be found in plugins/ShopGui-0.1.jar
noble lantern
#

in /resources you don't have a shop.yml file there

kind hatch
#

Recompile your jar and see if that file now exists within.

noble lantern
#

oh wait ongoing convo nvm ignore me

kind hatch
#

That could be it too.

grand perch
#

how to fix

noble lantern
#

I assume you are using saveResource

You need a file named whatever you called it in saveResource in this folder here

grand perch
#

ooo ic

#
[04:48:57 ERROR]: Error occurred while enabling FixmcShopGui v0.1 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.file.FileConfiguration.load(java.io.File)" because "com.aspectx.fixmc.fixmcshopgui.FixmcShopGui.shopConfig" is null
    at com.aspectx.fixmc.fixmcshopgui.FixmcShopGui.createCustomConfig(FixmcShopGui.java:44) ~[ShopGui-0.1.jar:?]
    at com.aspectx.fixmc.fixmcshopgui.FixmcShopGui.onEnable(FixmcShopGui.java:24) ~[ShopGui-0.1.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.17.1.jar:git-Paper-408]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.17.1.jar:git-Paper-408]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.17.1.jar:git-Paper-408]
    at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:561) ~[patched_1.17.1.jar:git-Paper-408]
    at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:475) ~[patched_1.17.1.jar:git-Paper-408]
    at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:733) ~[patched_1.17.1.jar:git-Paper-408]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:317) ~[patched_1.17.1.jar:git-Paper-408]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1220) ~[patched_1.17.1.jar:git-Paper-408]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-408]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
kind hatch
#

Where did you load shopConfig?

grand perch
#
FixmcShopGui fixmcShopGui = new FixmcShopGui();
    FileConfiguration config = fixmcShopGui.getConfig();
kind hatch
#

That's now how that works. Since you aren't working in the config.yml, you have to do things manually.

// Get the YAML file you want to work with.
File shopFile = new File("<path to shop file>")

// Load the file into FileConfiguration so you can use all of those sweet sweet internal methods.
FileConfiguration shopConfig = YamlConfiguration.loadConfiguration(shopFile);

// Get what you need from that file.
int value = shopConfig.getInteger("path.to.your.integer");

You'll probably want to keep that instance accessible for ease of use, but that's how you are supposed to work with other YAML files that aren't the built in config.yml.

NOTE: You could use this method to override the #getConfig() functionality, but it's not necessary unless you want full control over all files.

grand perch
#

ok

#

also how do i make the path point to a folder with the shop.yml

#

๐Ÿ˜„ it works

noble lantern
#

How would I make the classes in red accessible to the classes in dark blue but at the same time not accessible by anything outside of the command package (Eg the teal)

I'm wanting to do this to prevent end-users from initializing something that they shouldn't do/have access to, the exceptions here are just an example

Would i have to move packages around, or is there a way to do this with my current package scheme

I saw multiple different things online, but not any real clear solutions besides making some type of Factory for these classes, or just said its not really possible

torn shuttle
#

do you know what the definition of insanity is? It's doing the same thing over and over again and getting different results

torn shuttle
#

it's pretty easy and essentially made for this

#

you'd have to move the classes to be in the same package or in a package above the blue ones

lavish hemlock
#

protected isn't applicable for (top-level) classes.

#

It does have the same effect with the addition of allowing access by subclasses of a type.

torn shuttle
#

I guess it sort of depends on what exactly about those classes needs to be isolated

lavish hemlock
#

Also

#

Those look like exceptions

#

...why would you reduce access to exceptions?

#

Like, if they're part of the API then you should allow consumers of the API to catch them.

noble lantern
lavish hemlock
#

If you don't want them to be catchable, you should define that as part of docs/extend from Error, which effectively says "Do not catch."

#

Oh I see.

#

Yeah I missed that, nevermind.

torn shuttle
#

oc exceptions donut steel

noble lantern
hybrid spoke
#

reflections youknow

noble lantern
#

For the Exceptions, I just didn't want anyone to throw new types of those exceptions

Managed to do it by making a public Factory class, with protected methods and making the CommandInjector extend the Factory class

torn shuttle
#

I would like to imagine that you're somehow selling access to throwing those exceptions by doing paid api calls at $0.05 a call

noble lantern
#

i managed to resolve most other issues managing protected

Eg i didnt want anyone else using the Api interface, made it package private

And for ApiSettings i made its constructor protected

noble lantern
#

adding that now

#

everytime you initialize a class for the Api, 5 cents per initialization

torn shuttle
#

just find a way to host these calls remotely then make sure you charge every time they call it through account balance or something

hybrid spoke
#

and then donate 50% of it to spigot so you dont get banned

torn shuttle
#

or even better find a way to link it to one of those phone hotlines that can charge you extra cash

noble lantern
#

LMAO

hybrid spoke
#

instead of docs

torn shuttle
#

that way anyone with a phone can call the exception and you can collect

noble lantern
#

i spent a lot of time on javadocs today, guess ill convert it to paid access

torn shuttle
#

and you can literally call a phone number to get the exception too which is a plus

hybrid spoke
#

yes just literally call the exception

noble lantern
hybrid spoke
#

imagine an api call

#

being a real phone call

torn shuttle
#

800-cal-exp

#

800-api-cal