#help-development

1 messages Β· Page 201 of 1

chrome beacon
#

Read about how setFormat works

#

For the same reason you should use getters and setters. It keeps things clean, structured, protects the internals of the code and helps with future compatibility

#

Also having a static plugin instance isn't ideal either

#

use di

#

?di

undone axleBOT
ivory sleet
#

You write code defensively to protect you from yourself

mighty pier
#

why is you write code defensively to protect you from yourself

ivory sleet
#

Because it reduces error proneness caused by oneself

#

And potentially others also

mighty pier
#

makes sendse

#

if i do that then all my methods are static

ivory sleet
#

Wat

mighty pier
#

if i do the thing

ivory sleet
#

Utility classes are special

mighty pier
#

so not in utility classes

ivory sleet
#

They do not preserve or encourage abstraction

mighty pier
#

what is your called ab straction

ivory sleet
#

Thus they’re really low level

#

Abstraction as in being able to hide away things

royal vale
#

They're very harmfull

mighty pier
#

no

#

years ago

#

pls stop

ivory sleet
#

Well certainly not the best choice of design

#

Anyway

#

Utility classes are always stateless and (hopefully pure) thus no instances should be derived from those classes

mighty pier
#

uh

#

oh

#

meow

ivory sleet
#

Embed fail x)

glad prawn
#

Xd

mighty pier
#

WTF

#

cringe

glad prawn
#

Fail x2

mighty pier
#

epic embed fail e

glad prawn
#

Another and deleted xD

iron glade
#

dude forgot how to paste

mighty pier
royal vale
iron glade
mighty pier
#

an yone wanna play csgo

#

i onlyt

#

i only accept debit

iron glade
#

#general

scarlet rapids
#

when i build my projekt with gradle, where does the .jar come out?

scarlet rapids
#

but there is no build directory

chrome beacon
#

Sounds like you didn't build it?

scarlet rapids
#

i did

chrome beacon
#

Or you've specified another output directory

#

How did you build your project

scarlet rapids
#

i wanted to decompile plotsquared 6.3.0

chrome beacon
#

You mean compile

scarlet rapids
#

yes sry

chrome beacon
#

If you aren't a developer you should buy the plugin

tired cedar
#

Do I need to do anything special to make EssentialsX economy work with Vault

chrome beacon
#

No

tired cedar
#

for the life of me, it will not link to my plugin

chrome beacon
#

hm?

tired cedar
#

no no I'm developing a plugin

#

other vault plugins are working with essentialsX

chrome beacon
#

Make sure you're soft depending or depending on Vault

tired cedar
#

but mine fails to hook to the essentials economy

#

I have

chrome beacon
#

Send the code you're using

#

?paste

undone axleBOT
tired cedar
#

all of it?

chrome beacon
#

The more the better

sacred mountain
#

how should i put this into code? My knowledge of java's math stuff isn't great

#

i can't find most stuff in java's Math package

sacred mountain
icy beacon
#

too late, i did

sacred mountain
#

projectile motion with some extra velocities

#

particle collision

icy beacon
#

oh my god

ivory sleet
#

Math.cos Math.tan Math.sqrt etc

sacred mountain
#

yeah

kind hatch
sacred mountain
#

but is there a certain way i should parenthesis it

icy beacon
#

well do it part by part

#

you'll just place parentheses while doing it

#

i mean you should know order of operations for this

ivory sleet
#

and like secant is just 1/cos

tired cedar
#

bidmas moment

ivory sleet
#

iirc

icy beacon
sacred mountain
#

yeah it's just i'm wondering what java interprets this kind of order as

2 * 3 / 4

#

simplified obviously

ivory sleet
#

left to right is standard

sacred mountain
#

right ok that works

#

πŸ‘

kind hatch
#

Order of operation takes priority though.

next plume
cursive loom
#

Hello I want to remove 3 line from a lore, but it doesn't work I can add line but I can't remove line, I have 0 error and when i broadcast my lore the lore is removed but the item keep the line.

sacred mountain
icy beacon
#

java coding for military

#

do you hear yourself

#

xD

sacred mountain
#

yeah i'm making a minecraft plugin for russia

#

nothing special

icy beacon
#

yeah relatable

#

i have my phone language set to russian

sacred mountain
#

should soon have the basic projectile motion class done

#

time for angular momentum and collisions 🫠

icy beacon
#

:p

next plume
kind hatch
icy beacon
#

so it should be component then

#

because paper loves components

cursive loom
#

Yep I using paper

icy beacon
chrome beacon
#

and it makes sense

cursive loom
#

Idk why it works with adding and it doesn't work with remove

tired cedar
#

olivio did you have any ideas for my issue

chrome beacon
#

It looks fine

kind hatch
next plume
icy beacon
#

wtf

#

yay replacing PreEnchantItemEvent offers with reflection works!!!!!!!!

molten hearth
#

oracle on their way to fine the company 9,999,999,999,99.99$ after seeing this message

tired cedar
#

my compsci teacher used to work with the MOD and she had to code in COBOL

icy beacon
#
try {
  Field offersField = ev.getClass().getDeclaredField("offers");
  offersField.setAccessible(true);
  offersField.set(ev, offers);
} catch (Exception e) {
  e.printStackTrace();
}
``` im so happy
next plume
#

I was not on those jobs, so I can't speak for their choice of programming language.

icy beacon
#

i mean

tired cedar
icy beacon
#

as much as i love java

#

i'd love to learn kotlin

jolly gust
#

How do I create an itemstack collection?

icy beacon
#

Collection<ItemStack>

jolly gust
#

Collection<ItemStack> items = ;

chrome beacon
#

List<ItemStack> items = new ArrayList<>();

next plume
icy beacon
#

?learnjava

undone axleBOT
jolly gust
jolly gust
#

I need to compare this collection with another

jolly gust
tired cedar
icy beacon
#

if you don't know how to create a collection you should not be coding plugins just yet

tired cedar
#

I don't know if I know Java

#

I know C# and it's been like nearly 100% the same so far

#

but yeah you should probably look into it

icy beacon
#

i've tried C# and their naming conventions pissed me the fuck off and i quit

chrome beacon
icy beacon
#

i made a simple unity game and stopped there

icy beacon
chrome beacon
#

C# naming conventions are pain

jolly gust
#

Variable 'items' might not have been initialized

chrome beacon
#

?learnjava

undone axleBOT
icy beacon
#

because it's not initialized

chrome beacon
#

Please

jolly gust
tired cedar
#

the naming conventions are very elegant once you make peace with them

icy beacon
#

i bet he's gonna say that we are useless

icy beacon
undone axleBOT
icy beacon
#

?learnjava

undone axleBOT
icy beacon
#

?learnjava

undone axleBOT
icy beacon
#

PLEASE

chrome beacon
#

No

#

Don't spam

icy beacon
#

no more

chrome beacon
#

?main

chrome beacon
#

?conventions

chrome beacon
#

?di Also something you might need to learn if you've only worked with Unity before

undone axleBOT
tired cedar
#

No no I've never really used Unity

#

I've played with it but I'm mainly from a backend server background

#

I know Main is bad it's just a test plugin

chrome beacon
#

Most people that I've seen here that have used C# only have Unity experience... which for obvious reasons is quite lacking

woven tide
#

hey guys how do I check like the others PersistentDataContainer?

chrome beacon
#

Unity does a lot for you

icy beacon
tired cedar
#

nah nah I wish I had some time with Unity

#

but no I'm used to pure C#

chrome beacon
#

Then you should be fine

#

at least with the basics

woven tide
chrome beacon
#

Some more complex stuff is different

tired cedar
#

so far it's been nearly exactly the same

#

the setup was the most different

#

eclipse was so annoying so I'm using IntelliJ now

#

great decision

chrome beacon
#

Jetbrains has IDEs for many languages

#

including C#

tired cedar
#

I am very much used to Visual Studio and VS Code

chrome beacon
#

Visual Studio is painfully slow

#

at least on my machine

tired cedar
#

I know you can use VS Code for plugins, but the setup seemed even more awkward

#

Visual Studio is very bulky

#

Visual Studio Code is meant to be more lightweight but it runs behind Electron

#

so it's actually a webapp in disguise, not native

chrome beacon
#

Yeah

#

Discord isn't native either

tired cedar
#

but it does feel smoother than visual studio tbf

#

yeah it's also using electron

chrome beacon
#

Yeah and I believe they're 2000 commits out of date

#

Which is why you can find some fun bugs in discord

tired cedar
#

I see electron as something necessary

#

but it is a compromise

#

it's never as fast as metal code

#

plus chromium is so bloated

#

anyway

#

the problem is
RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);

#

returns null

chrome beacon
#

Yeah that's a bit odd

kind hatch
#

Do you have an economy plugin installed on your server?

tired cedar
#

I do

kind hatch
#

That being?

tired cedar
#

I've got EssentialsX installed

chrome beacon
#

The logs look fine

#

Plugin.yml too

tired cedar
#

not sure if I need to enable anything in the config for essentials

#

but I couldn't find anything

chrome beacon
#

It's automatic

tired cedar
#

I've tried with one other economy plugin and it didn't work

#

"ultimate_economy"

kind hatch
#

Ok, then verify your Vault version. I don't know why, but some Vault.jar instances out there don't work properly. Maybe they are outdated, maybe they are something else entirely, just make sure that you have the latest one from the spigot website.

tired cedar
#

good idea

echo basalt
#

make sure you're running vault on your server

#

really important

chrome beacon
#

It's up to date already

tired cedar
#

vault is very much running

chrome beacon
#

and it's installed

echo basalt
#

and is it a dependency?

chrome beacon
#

Yes

tired cedar
#

yeah vault is the latest version

echo basalt
#

well I'm out of ideas

#

only thing on my mind rn is hunger

tired cedar
#

do i maybe enable something in vault?

#

here is the pom.xml sorry i forgot to include it

chrome beacon
#

Let me setup a test project

tired cedar
#

Thank you for all this by the way

chrome beacon
#

... This is taking quite long

#

Windows Defender decided to take 90% of my CPU

tired cedar
#

It always uses too much memory for me for some reason

#

it's good to have though

#

does a good enough job

chrome beacon
#

I just copy pasted your code

#

It loads fine

#

hm the only difference is your dependency being an array instead of a list

#

but it should be fine

tired cedar
#

Someone did point that out

#

even when swapped, it's the same

whole sail
#

Does spigotmc have an API for when publishing and updating a resource?

chrome beacon
#

Try that

tired cedar
#

Okay hold on

whole sail
#

Pls.

chrome beacon
#

No

#

It doesn't as far as I'm aware

whole sail
#

Oof

#

Is there any type of API for resources?

tired cedar
chrome beacon
#

Could you DM me your jar

tired cedar
#

sure thing

halcyon mica
#

How do I mark a certain position as ender-eye findable?

halcyon mica
#

That is not what I mean

#

I need to mark a position as a POI for the vanilla entity to lock on to

#

Not make it move towards a specific point

#

So that when thrown, it will automaticially move towards it

hasty prawn
#

What? "Not make it move towards a point, automatically move towards it"? What is "it" if it's not a location?

echo basalt
#

my man

#

you gotta code in the logic yourself

#

ain't no way you're rewriting nms

halcyon mica
#

The minecraft world literally has collection of map features for things to query

#

Like the eye of ender

echo basalt
#

This ties into the NMS generator

halcyon mica
#

Are you telling me bukkit has no way to add POIs to that collection?

echo basalt
#

Yeah no

halcyon mica
#

Of course it doesn't

echo basalt
#

Bukkit is just an abstraction of NMS

sacred mountain
halcyon mica
#

Map Features are a pretty important thing to abstract I'd argue

#

But whatever

echo basalt
#

It wasn't designed to let you do whatever the fuck you want

#

It abstracts the interactable parts, make your own worldgenerator with dynamic structures if you want

#

or... just do what nms does

#

and listen to the throw event

#

and set a target location

#

it will... move to the target location

hasty prawn
#

Yeah idk what is wrong with that approach lol

#

Seems by far the easiest way to do it PeepoShrug

echo basalt
#

Or do one better, get the nearest structure, get the nearest location

#

and approach the closest one

halcyon mica
#

There is no ender eye throw event, and the vanilla item will refuse to even spawn the entity when no stronghold feature is present

echo basalt
#

PlayerInteractEvent, ProjectileThrowEvent

hasty prawn
#

And you can spawn the entity yourself ^

halcyon mica
#

Ah yes, let me just replace the entire logic of the ender eye, so much easier than to just allow the user to add a POI to a collection in the world

hasty prawn
#

You're not remaking the logic... if they right click with an ender eye... spawn the eye... settargetlocation... done.

echo basalt
#

You can...

#

use the paper api

halcyon mica
#

Gluing that on top of vanilla behaviour will cause two eyes to spawn

echo basalt
#

StructuresLocateEvent

#

and set the result

halcyon mica
#

Thank you, that is all I wanted

next plume
#

Somewhere around 1.12, someone wrote a plugin where you could list the targets of ender eyes.

halcyon mica
#

Yeah, listing them is easy

#

There is just no way for you to add any

next plume
#

And the eyes would go to the nearest one

halcyon mica
#

Adding some is easy enough in reflection though

tardy delta
#

my eyes

#

using this and final πŸ’€

#

use variables pls

echo basalt
#

maybe because you're lowering the loop condition inside the loop?

echo basalt
#

you could

tardy delta
#

no need to check if the iterables size > 0 before looping

naive bolt
#

how do i catch out of bounds error for like args[2] do i just check args.length?
i keep getting Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2

#
                   if(args.length >= 3) {
                        if(args[2].equals("-silent")) sound = false;
                    }
zealous osprey
#

ye, ig

naive bolt
#

even with that if i only give 2 args in command i get out of bounds error

#

eventhough i check length

zealous osprey
#

send all of the cmd code please

naive bolt
#
if (sender instanceof Player player) {


                int delay;
                int blocksPer;
                boolean sound = true;

                System.out.println(args);
                System.out.println(args[2]);
                try {
                    delay = Integer.parseInt(args[0]);
                    blocksPer = Integer.parseInt(args[1]);
                    if(args.length >= 3) {
                        if(args[2].equals("-silent")) sound = false;
                    }
                } catch (NumberFormatException e) {
                    player.sendMessage("Looks like one of your arguments is not a number!");
                    return false;
                }

                player.sendMessage(Chat.colorMessage("&bPasting..."));

                if (CopyBuild.clipBoard.get(player.getUniqueId()) == null) {
                    player.sendMessage(Chat.colorMessage("&cYou need to copy something first!"));
                    return true;
                }

                CopyBuild.clipBoard.get(player.getUniqueId()).buildSlowly(delay, blocksPer, player.getLocation(), player,sound);

                return true;
            }
zealous osprey
#

System.out.println(args[2]); that's why

naive bolt
#

ha what an idiot i am

zealous osprey
#

cause you are asking for index 2 before you did your check

#

also System.out.println(args); won't work as you intend. Use Arrays.toString

naive bolt
#

Its not my code 🌞

#

how do i get material from location.getblock

hasty prawn
#

getType

distant rivet
#

hellloooo, i recently created a custom worldgen plugin using chunkGenerator (very simple) and all it does is generate a chunk as full grass blocks on the negative x side of the world, and sandstone on the positive x (as well as making every biome type forest).

i was doing this in hopes of moving the server world over to my single player saves file but i unfortunately realized the generation is handled real-time and doesn’t get saved locally within the world file

i was wondering if i could get help in figuring out how to get a similar world generator to work on a single player world. i think it’s possible with a datapack so i want to keep it vanilla

warm token
#

Does event.blockList() in EntityExplodeEvent contains block not actually exploded

distant rivet
warm token
zealous osprey
warm token
warm token
#

@zealous osprey

zealous osprey
#

Ok ig

warm token
#

I need to get the blocks of the TNT since I need their locations

quasi flint
#

Get through the lsit

#

And Check which Block Is a tnt

zealous osprey
#

the tnt blocks are not in the list

quasi flint
#

Heh

warm token
quasi flint
#

I suppose you could Check in a 5x5 Radius or so around the TNT Block

#

And Check from there

warm token
dawn dawn
#

remove client boss bar

quasi flint
#

Its a solution atleast

warm token
quasi flint
#

Yes, i know its Not the Most Performant Thing Out there

#

Slow af

#

But works prob

zealous osprey
# quasi flint I suppose you could Check in a 5x5 Radius or so around the TNT Block

is the event called before or after exploding?
An alternative would just be to check the EntityBlockFormEvent, gets called when the tnt block turns into an entity, but not exclusively.
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/block/EntityBlockFormEvent.html#EntityBlockFormEvent(org.bukkit.entity.Entity, org.bukkit.block.Block, org.bukkit.block.BlockState)

warm token
#

Actually this problem could be get solved by using ExplosionPrimedEvent since I need to get the location of the src block of the location

warm token
#

The problem while doing this is I need to get the location of the source TNT block

warm token
#

I need to get an accurate location, but even flooring the location I get the location of the entity, so the TNTPrimed wich is not equal to the src TNT block location

zealous osprey
#

With the EntityBlockFormEvent you can get the block from which the entity formed, I believe. Therefore you'd get the precise location.
You'd also get the entity if you'd want to remove it. Or you could just cancel the event

warm token
#

Okay thanks I'll give a try

sacred mountain
#

hello again

mighty pier
#

what that mean

warm token
zealous osprey
#

Don't you want the block?

warm token
#

Since TNTPrimed is an entity, I should check if the material of the orginal block is TNT, and then if the new material is air, isn't it?

zealous osprey
#

why not just take the block and then check its type?

warm token
zealous osprey
vast raven
zealous osprey
#

Ahhhh shiiit

vast raven
zealous osprey
#

Yeah thx

#

Sorry chaps

vast raven
mighty pier
#

yes

#

restrarting

#

com puter

vast raven
sacred mountain
#

i'm doing some quadratic stuff, is there an easy way to create a method that will calculate and output as many results as there are?
A simple example would be a parabola where there would be multiple answers for e.g.
x when y = -2 in the equation y=-x^2

remote swallow
vast raven
#

Or maybe you are already hosting something on that IP

vast raven
sacred mountain
#

i might just try use some modified formulae nvm

zealous osprey
sacred mountain
#

nah i think imma just run it twice negative and positive

#

doesn't really matter idc about performance

distant rivet
#

can anyone help me with a world generation problem

hazy parrot
#

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

distant rivet
#

, i recently created a custom worldgen plugin using chunkGenerator (very simple) and all it does is generate a chunk as full grass blocks on the negative x side of the world, and sandstone on the positive x (as well as making every biome type forest).

i was doing this in hopes of moving the server world over to my single player saves file but i unfortunately realized the generation is handled real-time and doesn’t get saved locally within the world file

i was wondering if i could get help in figuring out how to get a similar world generator to work on a single player world. i think it’s possible with a datapack so i want to keep it vanilla

mental sorrel
#

Heya guys, any method to go from InventoryOpenEvent, all the way back to the Chest object of the MineCartWithChest?

zealous osprey
#

isn't that the inventoryholder?

mental sorrel
#

that returns a entity, not a chest object.

#

Found the StorageMinecart class, which i can cast it to,

serene sigil
#

how do u check if the player has something in their 2x2 crafting grid?

#

can u check it just with a Player

pastel juniper
#

I tried to set up my plugin at remapped mojang mapping but I get this

mental sorrel
#

@pastel juniper I get that until rebuild/restart

#

but only when i added the right repo

chrome beacon
tranquil viper
#

I meet the requirements of premium resources but I'm unable to post them. Anyone have any idea why that may be?

#

8 week old account βœ…
80 messages (forum posts) + 20 positive ratings βœ…
3 free resources βœ…

echo basalt
#

do you have 2FA on?

tranquil viper
#

Yup

#

Turned it on like 20-30 mins ago

#

Maybe I should wait a bit?

echo basalt
#

yeah

pastel juniper
chrome beacon
#

Looks fine have you reloaded the project have editing the pom

pastel juniper
#

thanks

noble lantern
# serene sigil ?

Listen to inventory click event and log the slot number as i dont remember the slot numbers for it and the numbers on the spigot site lie

From there you can just Inventory#getItem(thatSlotNumberYouLogged)

And make sure that player inventory clicked is player ivnentory type ofc

serene sigil
#

and is there a way to not do it with inv click?

noble lantern
#

well your only doing inv click to find out what the 4 slot numbers are

#

you can remove it after

#

i just dont remember those 4 slots slot #'s

#

someone else here might; or else i would of said the numbers instead of that πŸ˜›

#

Are you trying to make a crafting recipe? Only time you rly wanna do this is if ur making a recipe where items in slots need some type of NBT data (Or some type of custom inventory?)

serene sigil
#

well the thing is and i just found this out, that the playerinv and the crafting slot are 2 separate invs

noble lantern
serene sigil
#

the crafting slot is .InventoryType.CRAFTING

noble lantern
#

theyre the same

#

thats the player inventory; sometimes it shows up as CRAFTING

#

cause theyre crafting; but if you use player.getInventory() and use the specific slot youll get the crafting inventory slot from theyre invent

serene sigil
#

alr so its 1-4?

noble lantern
#

well thats what i was saying earlier

#

is that the numbers there tend to lie

#

so you might wanna use inv click event to double check the item ids

#

the IDs there havent been updated in a while

#

last time i used them they were ohhh so wrong

#

but in theory if those numbers were right; yes you would just use the numbers listed there

#

last time i used it tho 0-3 was the armor slots iirc

#

and 4 was offhand or 4 was slot #1 it was super fuckin weird

#

thats why i jut use inv click event to get the slots i need for the inventory; i just remove the event when im done or comment it out

serene sigil
#

no

#

inv slots 1-4 dont execute

#

lol actually inv slot 1 is the place the dragon egg is rn

noble lantern
#

yeah makes sense since 1 = 0 in java lists

#

1.19?

#

They miiight of changed it in that version; but in the past i know those slots are accesible via player.getInventory()

serene sigil
#

so what slot is crafting in 1.19?

hybrid spoke
#

?bing

undone axleBOT
hybrid spoke
#

oh i binged too early

#

use rawslots

noble lantern
#

you binged so early that shit turned to a bong

#

xD

serene sigil
noble lantern
#

I think those slots are pre 1.13

serene sigil
#

i tried getItem(1) and it was hotbar

noble lantern
#

maybe

#

like said the spigot page for em hasnt been updated in years

serene sigil
#

crafting is not playerinventory

hybrid spoke
regal lake
#

Just use the inventoryclickevent and print out the clicked slot index..

noble lantern
#

tried saying that earlier kek

#

bruh

hybrid spoke
noble lantern
#

legit said that like 4 times (not what you said cipher)

#

i give up lmao

regal lake
#

πŸ˜‚

hybrid spoke
#

then help me burchard

noble lantern
#

sup?

#

im bored anyways making pointless parsers

hybrid spoke
#

pos2 is inside the cube

#

why tf is it going to the right

noble lantern
#

uh code?

#

or am i blind

hybrid spoke
#

more of a fun question but i think the pathfinder is confused

noble lantern
#

ohh its for pathfinding

#

hmm

#

is this like

hybrid spoke
#

yeah working on a fallback

noble lantern
#

the spiders 2.0 mod pathfinding?

#

looks like wall climbing lol

#

thats what it looks like to me xD

#

if you are doing that it just l know the issue

serene sigil
noble lantern
#

blocks that underneath it that arent air/were part of the path are geting marked as invalid

hybrid spoke
#

i mean yeah, the point is to fallback to the already found path when the target cant be found anymore

#

or is at least not accessable

noble lantern
noble lantern
#

or right

#

depends on perspective ig xD

hybrid spoke
#

yeah thats the part that doesnt makes sense yet

#

he probably looks further for the point and then fails

#

and it looks for it to the right but then realises that its not reachable

#

my guess is that it forms a bubble around the target and then fails at the max iterations

#

oh yeah thats it

noble lantern
#

you cant just use the list of previous nodes to backtrack? Or are they not accesible once pathfinding at this point

hybrid spoke
#

thanks

hybrid spoke
#

or can i

#

hm

noble lantern
#

you could make a error listener of some sort

serene sigil
noble lantern
#
@FunctionalInterface
public interface ErrorListener {
    void run(Level errorLevel, String... additionalInfo);
}
hybrid spoke
noble lantern
#

in that way

#

basically each iteration that fails run() is called

#

its janky but its simple what im doing

#

you can transform it to be more advanced and logical

hybrid spoke
#

that wont work

noble lantern
serene sigil
#

ikr

kind hatch
hybrid spoke
#

it fails at solid blocks. i would have to check if it passes the target location. but even if, i cant handle that since it could be some sort of labyrinth

serene sigil
kind hatch
#

That adds up.

hybrid spoke
#

which is the 1. index

serene sigil
#

not in the crafting slot

serene sigil
#

sometimes its 1 and sometimes its sth else

noble lantern
#

did you log the rawSlot on inv click?

#

to see what those 4 slots are? If so what were they

serene sigil
#

IM LOOSING MY MIND

#

lol

kind hatch
#

Chill.

#

Think about it for a second.

remote swallow
#

so use rawSlot on the if statement?

serene sigil
#

this i used

kind hatch
#

Inventory slot numbers are 1-54. Arrays are 0-based. (Meaning they start at 0)
So if you want slot 1 of the inventory, you need to get inventoryContents[0].

hybrid spoke
#

@noble lantern we should discuss more often

noble lantern
#

but starting on a new plugin so im here again xD

hybrid spoke
#

same, minecraft dev got boring

noble lantern
#

ive decided to make an actually good CE plugin

hybrid spoke
#

CE?

noble lantern
#

custom enchants

serene sigil
hybrid spoke
#

oh ew another of these

noble lantern
#

itll be different trust

#

gonna take a long time tho

kind hatch
noble lantern
#

im gonna tie support in for every plugin i can imagine

hybrid spoke
#

pathetic dankfingers

noble lantern
#

working on MMOItems rn (One the almost every CE plugin rarely ever supports properly)

hybrid spoke
#

make an enchantment on boots which can pathfind

noble lantern
#

hmm

#

make me a class that make it easy to move armor stands

#

and i will make it as a troll function

#

walkTo(location)

#

wait

#

can boots be right clicked onto entities?

#

imagine some boots you right click on a zombie and it make it locate the nearest stronghold or some shit lmao

#

btw as that pathfinding class i made ever helpful?

hybrid spoke
#

well i never actually used it and was more for a private project

#

maybe for entities we can make a pathfinder which only leads into the right direction instead of finding the whole path

#

and bind it to a PatheticEntityWrapper

noble lantern
#

i mean you can do that by default

#

just use the vanilla /locate code, then offset that location by a random of 250 block on x/y then use getHighestYAt(x, z) and pathfind to that location

#

for strongholds at least

#

and boom general area pathfinding

#

only issue is youll need to make the NPC chunkload if it isnt already ofc, like a player does

hybrid spoke
#

yeah but i mean for general pathfinding for entities

noble lantern
#

ah so just for any location i see

hybrid spoke
#

exactly

noble lantern
#

eg instead of going to that cactus go 5 blocks left of it

#

yeah that would be more tricky

hybrid spoke
#

yeah like "go forward, go forward, go forward AHH STOP WALL GO LEFT"

noble lantern
#

someone should make a pathfinding written in loliasm

echo basalt
noble lantern
#

or whatever tf that lang is

echo basalt
#

most of my code nowadays is just pure enterprise communication stuff

#

and a tiny gui to render the data

hybrid spoke
#

right now i only code for minecraft to test stuff that came randomly into my head

#

f.e. a 50x100 armorstand knight

noble lantern
#

a what

#

picture?

hybrid spoke
hybrid spoke
echo basalt
#

I think I use my IDE more to help people in this channel than I do for actual work

noble lantern
#

truue

echo basalt
#

like I just push some commits that just have a dangling StandingAndWallItem tossed in

#

because I just type the class name, middle click and solve issues

hybrid spoke
noble lantern
#

ngl i was wondering if i was the only one who did that

#

man yall grinding that

hybrid spoke
#

what was the thread called we had in here for your npc plugin @noble lantern

#

oh got it

noble lantern
#

i think it was leeroy jenkins iirc

hybrid spoke
#

actually just "Pathfinder" but its empty for me

#

do you still have the old timings you reported? could be useful for the spigot page

noble lantern
#

timings get deleted after 30 days sadly

#

i do

#

have a video now that i remember

hybrid spoke
#

that can help, thanks :)

golden turret
#

wait, but I am op with /op

#

also, I am in creative mode but it is saying survival

#

nvm

quaint mantle
#

Step 2. Add the token to $HOME/.m2/settings.xml as the username

#

im confused

#

jitpack

#

but where would that be

hazy parrot
#

your m2 folder lol

#

depends if you are on linux/windows

quaint mantle
#

oh i see

hazy parrot
#

C:\Users\user

quaint mantle
#

C:\Users\Users

sterile token
#

I have been watching a neither List<T> nor ArrayList<T> have a toString() method

#

Its really amazing because that fucks me a lot because i cannot save those things directly thru ConfigurationSerializable

#

😑

eternal oxide
#

you don't need toString() to implement ConfigurationSerializable

sterile token
#

Some told me that seriable bases on the toString() method from the external objects you are using

#

And its seems true, because im trying to save a List<UUID> and its not being saved

eternal oxide
#

because UUID does not implement ConfigurationSerializable

sterile token
#

So the best solution is?

eternal oxide
#

Bukkit serialization will fall back to toString() if it fails all other attempts to serialize

sterile token
#

Its not being saved

#

I dont know why

eternal oxide
#

why do you need a generic implementation?

sterile token
eternal oxide
#

List<T>

sterile token
#

I just to need to serialize/deserialize a list of uuid

#

But for some reason the list not getting serialized

eternal oxide
#

then don;t use List<T> use List<UUID>

sterile token
#

No no

#

I meant you haven understand

sterile token
#

That is what i was trying to said

eternal oxide
#

then serialize/deserialize the List in the deserialize method

sterile token
#

Im being serious

eternal oxide
#

So am I

sterile token
#

I dont understand what you mean

eternal oxide
#

Clearly

sterile token
#

I sent code because we are talking about diff things

eternal oxide
#

any object which implemetns ConfigurationsSerializable must implement a deserialize and constructor method

eternal oxide
#

so make your Region a class which implements Configurationserializable

sterile token
eternal oxide
#

you can;t just cast a List to List<UUID>

sterile token
#

I know how to use configuration serializable but im forgetting smth or smth is not coded correcly

sterile token
#

πŸ˜‚

eternal oxide
#

and I said you manually serialize/deserialize in the constructor/serialze method

#

Which is not casting to List<UUID>

sterile token
#

As far as i know they are auto deserialized

#

And same with serialize

eternal oxide
#

any object which can not auto serialize/deserialize you have to do manually

sterile token
#

No no wait let me see something im having a nightmare

#

1m please

echo basalt
#

this is why I'd rather just use json

sterile token
#

I need to finish this as fast as i can

echo basalt
#

new Gson(region, new JsonWriter(new FileWriter(file));

#

for storage

#

type deal

#

much simpler

sterile token
#

And what about for getting values?

#

I need a Map<String, Object> values?

echo basalt
#

Region object = new Gson().fromJson(new JsonReader(new FileReader(file)), Region.class);

#

not that hard

sterile token
#

Hmn but i dont have 1 region

#

πŸ˜‚

echo basalt
#

then store a fuckin array

#

you can... just serialize entire lists

sterile token
echo basalt
#

with typetokens

echo basalt
#

there are tons of tutorials out there

sterile token
#

I mean my intetion was to use ConfiguratioNSerializable no smth else

worldly ingot
#

You should implement one of a deserialize method or constructor, and you need a serialize method (which is provided by the interface)

sterile token
worldly ingot
#

Yeah I was just correcting either a misunderstanding of what's required, or a typo

sterile token
#

I just used the command to see the region info right

#

And its not adding me

#

🀑 🀑 🀑 🀑 🀑

#

Choco

#

@cho co

#

@Cho co

#

@ Choco

distant rivet
remote swallow
#

what about notepad

distant rivet
#

what about google docs

remote swallow
#

what about books and quills in game

quaint mantle
sterile token
remote swallow
#

could still code in it

thorny marsh
#

If I want to get the distance from two different locations using location.distance, is the value in block length?

crude crystal
#

Can you use mixins with plugins or is that a Sponge only mechanic?

quaint mantle
crude crystal
#

Okay, thanks!

quaint mantle
#

Np

#
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "mission.boxpvpcore.Boxpvpcore.getCommand(String)" is null``` where did i go wrong ???
#

did i wrongly register my commands or some crap

desert loom
#

check if the command is in your plugin.yml

quaint mantle
#

it is?

#
  /gmc:
    aliases: /gamemodecreative
    permission: boxpvp.gmc.staff
  /gms:
    aliases: /gamemodesurvival
    permission: boxpvp.gms.staff
#

should i add more

#

ohh

desert loom
#

remove the /

quaint mantle
#

ah

#

do i need a desciprition

desert loom
#

pretty sure everything is optional

quaint mantle
#

ah ok

worldly ingot
#

Everything is optional for commands, yeah

#

Still advised you give it a description and permission though

quaint mantle
#

ok :D

#

still not working

worldly ingot
#

Useful for /help and tab completion respectively

quaint mantle
#

i removed the /

#
java.lang.NullPointerException: Cannot invoke ```
#

i mean its probably

#
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (label.equalsIgnoreCase("gmc")) {
            if (sender instanceof Player) {
                Player player = (Player) sender;
                if (args.length == 0) {
                    player.setGameMode(GameMode.CREATIVE);
                    player.sendMessage(ChatColor.BLUE + "(BOX CORE)" + ChatColor.RED + "Your Gamemode has been set to Creative");
                    return true;
                }
            } else {
                sender.sendMessage("Failed to execute command please try again");
                return false;
            }
        }
        if (label.equalsIgnoreCase("gms")) {
            if (sender instanceof Player) {
                Player player = (Player) sender;
                if (args.length == 0) {
                    player.setGameMode(GameMode.SURVIVAL);
                    player.sendMessage(ChatColor.BLUE + "(BOX CORE)" + ChatColor.RED + "Your Gamemode has been set to Creative");
                    return true;
                }
            } else {
                sender.sendMessage("Failed to execute command please try again");
                return false;
            }
        }
        return false;
    }```
#

this cuasing the issue

#

because ive never used

#

if (label.equalsIgnoreCase before

#

so i might have messed something up there

fresh timber
#

How can I, in an InventoryClickEvent, check if the player clicked the 8th slot in their inventory not like a chest opened or smthin

quaint mantle
#

Anyone know how to add gradients to scoreboard?

distant rivet
#

hellloooo, i recently created a custom worldgen plugin using chunkGenerator (very simple) and all it does is generate a chunk as full grass blocks on the negative x side of the world, and sandstone on the positive x (as well as making every biome type forest).

i was doing this in hopes of moving the server world over to my single player saves file but i unfortunately realized the generation is handled real-time and doesn’t get saved locally within the world file

i was wondering if i could get help in figuring out how to get a similar world generator to work on a single player world. i think it’s possible with a datapack so i want to keep it vanilla

https://imgur.com/MBstcaW for an example of what i’m trying to accomplish

languid flare
#

How can I set prefix in TabList and above the head?
For above the head, I used

p.setDisplayName(ChatColor.RED + "[ADMIN] " + p.getName());
p.setCustomName(ChatColor.RED + "[ADMIN] " + p.getName());```
But it did not work
quaint mantle
#

Gotta use nms for it im pretty sure

hazy parrot
#

Can you show maven file

#

And also how are you building jar

hazy parrot
#

How

#

Can you try to clean package

#

Also cb 1.5.2 wtf

tender shard
#

using craftbukkit is already bad. using 1.5.2 is even worse.

that's even worse than my game's weird lua code

noble lantern
#

what the

#

1.5

tender shard
#

still newer than LeGuernic who used 1.4.6

quaint mantle
#

@glad prawn hey

#

you did πŸ’€ on code ive never even did beforee

#

can you tell me where i went wrong plz

worldly ingot
#

Man I miss Lua sadge

quaint mantle
#

I dont KBBQ_peepoSleepCouch

#

Its alright ig

tender shard
#

I hated it the first 2 hours, now I love it lol

#
oldPrint = print
print = function(text)
  oldPrint("Printing: " .. text)
end
quaint mantle
#

The roblox version of lua is weird

tender shard
#

what error? sorry I only just joined this conversation lol

#

imgur doesnt work for me

#

idk why it always throws this error lol

quaint mantle
#

No class error

#

Was it compiled right?

tender shard
#

thanks

#

are you using maven?

#

if so, paste your pom.xml

#

?paste

undone axleBOT
solemn frigate
#

Alr

tender shard
#

you need to add the maven shade plugin

#

1 sec

#

check the second part ("how to shade dependencies")

solemn frigate
#

alr

tender shard
#

and then you just do mvn package and then it should work

#

(usually you should also relocate the lettuce-core thing, but that's not important)

solemn frigate
#

do i replace β€œpackage” with anything?

tender shard
#

you mean in the "mvn package" command?

solemn frigate
#

No, i mean in the shade plugin thing

tender shard
#

no, it has to be "package"

solemn frigate
#

ok

tender shard
#

do not replace it with anything else

#

the <phase>package part means that the shade plugin will run everytime you run "mvn package", so it will add the needed classes everytime you "package" your .jar file (which is e.g. after "compile" and before "deploy")

solemn frigate
#

it worked tysm

tender shard
#

np

fierce whale
#

is there any way to set defalut permission and give it to user when player join?

jagged monolith
#

Use a permissions plugin like Luckperms and then just set permissions to the default group

jagged monolith
fierce whale
#

Okay Thanks! πŸ™‚

quasi patrol
#

How does one translate color codes to a ChatColor variable type and not a string? It is just color codes and not other text.

chrome beacon
#

You don't need to translate color codes when using the ChatColor enum

#

It's only for replacing & with Β§ in legacy color codes

quasi patrol
#

πŸ€¦β€β™‚οΈ

lime moat
#

It's very weird

chrome beacon
#

Did you join and leave

#

Actually you're just listening to the join event twice

lime moat
jagged monolith
lime moat
#

Do I just need a new class?

remote swallow
#

look at the code

#

public void onLeave(PlayerJoinEvent event) {

jagged monolith
#

^ That should be onLeave(PlayerQuitEvent event)

remote swallow
#

^^

lime moat
#

OH

#

Thank you so much! πŸ˜…

#

Not entirely sure why :P

jagged monolith
#

?paste

undone axleBOT
lime moat
#

Sure!

jagged monolith
#

Use that

lime moat
jagged monolith
#

Show the full class

lime moat
#

This is everything in the file.

jagged monolith
#
            } catch (Exception exception) {
                e.sendMessage(ChatColor.translateAlternateColorCodes('&', chat_message.replaceAll("<player>", player.getName()).replaceAll("<prefix>", lowestPrefix).replaceAll("<message>", PlainTextComponentSerializer.plainText().serialize(message))));
            }
#

That's the bit the error is referencing

#

It doesn't like your replaceAll

lime moat
#

Interesting

#

I'll see why the catch is even happening, one second

#

Same error with the catch removed.

jagged monolith
#

Post the error again

lime moat
jagged monolith
#

Yeah, it doesn't like the replaceAll.

lime moat
#

Hm, is there an alternative I can use?

jagged monolith
#

Not the prettiest or probs the best way, but I used:

    configFormat = configFormat.replace("%", "%%");
    configFormat = configFormat.replace("%%prefix%%", playerUtil.getPrefix());
    configFormat = configFormat.replace("%%suffix%%", playerUtil.getSuffix());
    configFormat = configFormat.replace("%%displayname%%", playerUtil.getNameColour() + "%1$s");
    configFormat = configFormat.replace("%%message%%", "%2$s");
lime moat
#

I'll try it out haha

#

How do I send the newly generated message?

jagged monolith
#

The last configFormat from my example would be the message. Obviously adjust it to your code.

basically do something like chat_message = chat_message.replace(<player>, player.getName()) etc..

#

Then do chat_message = chat_message.replace()... etc..

remote swallow
#

iirc you can stack .replace's

jagged monolith
#

You can, I just did it that way as I was debugging stuff and didn't change it back

#

It works 🀷

#

Eitherway, it should like replace better than replaceall

quaint mantle
#

actually took way less time then i thought

quaint mantle
#

Hey GUYS how can I detect event when player break block by jump?

pallid oxide
#

u mean farmland?

#

EntityChangeBlockEvent or PlayerInteractEvent/entityinteractevent
second one probably

fierce whale
#

I developed MailAPI plugin used in dialog and quests plugin.
But, I don't know how to use MailAPI's method in dialog quest system.
I tried to use project structure libraries to load plugin. But I still can't use method. 😦
Is there any way to load and use other plugin's method?

river oracle
#

Just use maven and mark it as provided

fierce whale
#

maven..?

#

like spigot api?

river oracle
#

Oh god

fierce whale
#

I'm so noob ..:(

river oracle
#

I'd help explain dependency managers but I'm in bed sorry

remote swallow
river oracle
#

You should learn about maven though

fierce whale
#

I know maven but

#

Idk how to load my plugin in maven...

river oracle
#

Do your plugins use maven like they have a pom.xml

remote swallow
#

add it as a dependency is the best guess

fierce whale
#

So I should make my dependency?

river oracle
jagged monolith
#

Do you have a build.gradle or a pom.xml file in your plugin

river oracle
#

Make sure you do mvn install in the other project though otherwise it won't be in your m2

fierce whale
#

Yeah

#

umm...

river oracle
#

Basically mvn install allows you to use that code elsewhere and depend on it through a maven dependency

#

So you'd go in your MailAPI project and build it with mvn install

fierce whale
#

yes I did it

#

So i get jar file

river oracle
#

You don't need the jar

#

Ignore that

fierce whale
#

..?

remote swallow
#

you add it as a dependency in the place you want to use it

river oracle
#

Now you can go into your depending project and add the dependency

#

Like you would spigot but with the MailAPI artifacrId version etc instead

fierce whale
#

Ahha...

#

Okay let me try. thx πŸ™‚

remote swallow
#

it wont need a repository just the dependency

fierce whale
#

I wanna send image but I cant 😦

remote swallow
#

?img

undone axleBOT
remote swallow
#

?paste if its code or pom

undone axleBOT
fierce whale
#

ahha zzzz

#
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>me.rukon0621.mailapi</groupId>
    <artifactId>MailAPI</artifactId>
    <version>1.0-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <outputDirectory>C:\Users\admin\Desktop\Servers\PluginPaperServer\plugins</outputDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.18.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
    </properties>

</project>
#

So in dependencies

#

I have to add my MailAPI dependency

#

that's right?

remote swallow
#

yep

fierce whale
#

okay okay i got it

#

but...

#

There is some serious problem

#

I dont know how to add custom dependecy... sry.. πŸ˜…

remote swallow
#
    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.18.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>your.group.id</groupId>
            <artifactId>artifact-id</artifactId>
            <version>version</version>
        </dependency>
    </dependencies>
fierce whale
#

okay

#

Thanks

#

Thanks very much

#

sir

river oracle
#

This looks cursed on mobile

remote swallow
#

most things are

fierce whale
#

I'm so plugin noob
and not good at english... sry πŸ˜…

river oracle
#

What English isn't your first language

fierce whale
#

I'm korean...haha

river oracle
#

Wouldn't have guessed be more confident

fierce whale
#

anyway thanks! πŸ™‚

wispy crystal
#

Any bungee devs available? I’m looking to develop a bungee server for oculus/vrchat

remote swallow
#

?services

undone axleBOT
stoic vigil
#

is there a way to get and set persistentdata to an inventory (Bukkit.createInventory())?

quaint mantle
#

Woah, its @remote swallow

#

So cool

fierce whale
#

Other API made by other developer is work well. but I loaded My API plugin, It doesn't work.
is making API not same as making plugin..?

This is my API main class.

public class main extends JavaPlugin {
    public static final String pfix = "&7[ &9Mail&3BOX &7] &e";
    public static final String mailBoxGuiName = "&7[ &cμš°νŽΈν•¨ &7]";

    @Override
    public void onEnable() {

        //Generate Basic data file.
        getDataFolder().mkdir();
        File file = new File(getDataFolder(), "data");
        file.mkdir();

        //Commands
        new mailBoxCommand(this);
        new mailBoxOperatorCommand(this);

        //Events
        new onJoin(this);
        new inventoryEvent(this);
    }

    @Override
    public void onDisable() {

    }
}
remote swallow
#

commands are registered getServer().getPluginCommand("mycommand").setExecutor(new ClassName(this));

fierce whale
#

constructor of command class is that

jagged monolith
#

They technically aren't the same. API relies on a plugin. The API is something another plugin uses to interact with that plugin

remote swallow
jagged monolith
fierce whale
#

umm..

#

ahha

#

I made MailAPI plugin

#

and I wanna use method and object in API plugin in other plugin

#

is there any fancy way to do that?

mighty pier
#

how do i get the player from the AsyncPlayerPreLoginEvent?

jagged monolith
#

getUniqueId()

#

or getName()

#

Depending if you need the UUID or Name

mighty pier
#

oh right

#

player not made yet

mighty pier
#

it just errored a lot

fierce whale
#

I loaded my plugin to libraries. but I can't use the method of that.
is there any solution for that?

fierce whale
#

yes i'm using maven now

#

I asked this several times but I couldn't get obvious solution

low temple
#

all ur imports should go through maven

fierce whale
#

umm..

#
<dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.18.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>me.rukon0621.mailapi</groupId>
            <artifactId>MailAPI</artifactId>
            <version>1.0.0</version>
        </dependency>

I did like this but It doesn't work 😦

#

It said Cannot resolve me.rukon0621.mailapi:MailAPI:1.0.0

fierce whale
mighty pier
#

Connection c = DriverManager.getConnection("jdbc:sqlite:" + dataFolder); it sets the connection to null

low temple
remote swallow
#

its built to maven local so that should work

fierce whale
#

Oh thanks I gonna read that

low temple
#

Yeah idk i remember having this issue a while back but cant remember how i fixed it

fierce whale
#

umm

#

but

#

I wanna send image here

low temple
#

if you have a module file u might need to add it to there too

fierce whale
#

but I can't do that

low temple
#

dm to me ill repost it

fierce whale
#

thanks πŸ™‚

#

first I'll read that document

low temple
#

ok

fierce whale
#

thank you πŸ™‚

low temple
mighty pier
#

make it not null

low temple
mighty pier
#

yes

#

i dont know how to do the string

#

getConenction(String)

#

i found the issue

#

so

#

You need the SQLite JBDC library. Google it. Put it in /lib folder.

#

i have never heard of the /lib folder

#

i have to put the library in it

vocal cloud
#

I usually just shadow it into my jar instead of using the lib folder lol