#help-development

1 messages Β· Page 996 of 1

tender shard
#

or this

#

pavian?

#

idk whats it in german

valid burrow
#

damn

tender shard
#

anyway, thats a baboon

valid burrow
#

Pavian yeah

elder dune
#

Thats not working still doing the same thing but not its not saying Itemstack can not be null

vast ledge
#

Send Error

elder dune
#
Caused by: java.lang.IllegalArgumentException: ItemStack cannot be null
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:143) ~[guava-32.1.2-jre.jar:?]
    at org.bukkit.craftbukkit.v1_20_R3.inventory.CraftInventory.addItem(CraftInventory.java:299) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4053-Spigot-e9ec548-98b6c1a]
    at me.helix.atlasgrave.Listener.Listeners.ChestSpawn(Listeners.java:74) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.20.4-R0.1-SNAPSHOT.jar:?]```
vast ledge
#

Check in your listeneres for the ChestSpawn one on line 74

#

Check what that line of code is

elder dune
#

it is
getInventory().addItem(new ItemStack[]{p.getInventory().getItem()

vast ledge
#

You're trying to add an item that is null to the player inventory

worldly ingot
#

Why are you doing it the complicated way though PandaThink

broken nacelle
#

im scared about this code

#

😰

vast ledge
#

What code?

vast ledge
#

what th ecuck

#

the fuck**

#

why are you creating in array

#

or whatever you call that

#

just addItem(new ItemStack(Material))

broken nacelle
#

then save in a array

vast ledge
#

What does the death have to do with this?

broken nacelle
#

get this array and put in the inventory

vast ledge
#

Why would you need to?

#

You can just add an item like a normal human??

elder dune
#

Can i just state my code was working fine till i wanted to make it so if the player had more than 27 items in their invin it would spwan a double chest with all their item in it

vast ledge
#

Just cus it works doesnt mean its good?

worldly ingot
#
ItemStack[] items = player.getInventory().getContents();
Block chestBlock = // ... the chest block
chestBlock.setType(Material.CHEST);
Chest chest = (Chest) chestBlock.getState();

Collection<ItemStack> remaining = chest.getInventory().addItem(items).values();
if (!remaining.isEmpty()) {
    Block secondChestBlock = // ... the second chest block
    secondChestBlock.setType(Material.CHEST);
    Chest secondChest = (Chest) secondChestBlock.getState();
    secondChest.getInventory().addItem(remaining.toArray(ItemStack::new));
}
#

That should work fine

#

It doesn't take into account the rotation or names of the chests or anything, whatever, you can probably figure that out just fine. But that's all you need

elder dune
#

Not saying its good im not an expert never said that once

vast ledge
spiral escarp
#

Does anyone know a good way to parse placeholders to a String? ie. {gamemode} -> Creative

worldly ingot
#

You can either do it the lazy way, or you can do it the fun way

#

I guess we can throw in a mixed way lol

#

Either String#replace(), RegEx, or parsing char by char and rebuilding the string

vast ledge
tardy mist
vast ledge
#

Which results in a abominations like this

worldly ingot
#

Lazy, mixed, fun, in that order

young knoll
#

What’s the fast way

vast ledge
#

neither

worldly ingot
#

Depends

vast ledge
#

Become the CPU

worldly ingot
#

Probably char by char reconstruction would be the fastest, especially if you have more than one placeholder in the string

#

Guess it depends on how fast RegEx is though. I'd imagine if you're precompiling your pattern, it's probably relatively quick

vast ledge
#

would that really be faster then just using #replace()?

#

English

worldly ingot
#

I mean think about it. Every time you're calling replace, it's filtering through the string each time

chrome beacon
#

^^

worldly ingot
#

So in the snippet above, you're filtering through that string 4 times when really you could do it just once

young knoll
#

I currently do regex

chrome beacon
#

^^ I would also do a regex

young knoll
#

Probably gonna switch to rebuilding char by char tho

worldly ingot
#

Nah I think the RegEx is fine

#

Probably micro-optimizing at that point

#

Especially if they're just simple placeholders, it's probably not going to hurt you at all

young knoll
#

Well sometimes it happens quite frequently

worldly ingot
#

Something as simple as this would work fine {(?<placeholder>[\w_]+)}

#

I think RegEx is fast enough. Again, microoptimizing. You'd have to do benchmarking to really tell which one is faster under frequent use

young knoll
#

Fair

#

Now if only Map.of was less ugly

spiral escarp
worldly ingot
#

Just a bit of a strange version to be sitting on. 21 is LTS so you're better off there I think

#

1.20.5 requires it anyways

spiral escarp
#

fair point. I haven't touched any of this stuff for a while. I'm trying to get back into it

#

I'm now on 21.0.3

vast ledge
#

Me out here on 1.8

worldly ingot
#

That'll do just fine PES_ThumbsUp

spiral escarp
vast ledge
#

If you want a fast solution, you should probably use regex, like @worldly ingot recommened

vast ledge
#

Then i have a custom String, imma get trashed on, cus it aint pretty or optimized,

#

The replace, takes a placeholder, and an Object, that the placeholder is replaced with

#

it also has #translate() for translating color codes

spiral escarp
#

Alrighty, I'll give this a try! thank you

vast ledge
spiral escarp
#

I saw this somewhere would this work?

                .forEach(ent -> rawMessage.replace(FORMATTER.apply(ent.getKey()), ent.getValue()))```
Where tags is a Map<String, String>, rawMessage is the message to translate and FORMATTER is `s -> "%" + s + "%"`;
#

I just dont know how to save the result of the function

vast ledge
#

That... seems a bit overcomplicated?

spiral escarp
#

it probably is but I'm complicated

vast ledge
#

Do you have a solid placeholder you want to replace?

spiral escarp
#

wdym by solid?

vast ledge
#

like %player_name%

spiral escarp
#

well for instance I have %gamemode% and I want it to return the players gamemode but String.replace() just looks ugly to me

#

although I'll prob just use it tbh

vast ledge
#

I mean you can use regex if you want to?

spiral escarp
#

Regex has always scared me 😭

#

prob because im dumb when it comes to this stuff

sterile axle
#

regex ez

#

you need to just sit down and read about them for like 30 minutes and you'll realize

analog mantle
#

Intellij doesn't recognize any bukkit libraries?

#

I'm 99% sure it's because of this line in build.gradle.
compileOnly 'org.spigotmc:spigot-api:1.20.4-R0.1-20240222.090456-86'
I don't wanna update to 1.20.6

civic sluice
civic sluice
young knoll
#

Never seen someone not just use -SNAPSHOT

vast ledge
#

Neither have i

#

He an Innovator

analog mantle
#

ATT is what I like to say

vast ledge
#

What does that stand for πŸ™ƒ

analog mantle
#

Appeal to tradition

vast ledge
#

I c

analog mantle
#

I can't remember why I used that specific release

civic sluice
vast ledge
analog mantle
#

I remember now, I couldn't download the spigot api sources so I moved to this

civic sluice
analog mantle
#

That just didn't work

civic sluice
#

It works now?

analog mantle
#

yea

civic sluice
#

perfect

short pilot
#

What is the best way to implement a notification for entering/exiting faction territory?

#

On a player move event, i'd like to check if they have entered or exited a chunk belongining to a faction but im not sure how to keep track of the "before" and "after"

#

like going from "Faction A" to "Faction B"

pseudo hazel
#

doesnt the player move event have a from and to?

short pilot
#

im not quite too sure, was not aware of that if so

drifting ice
#

first time making a spigot/bukkit plugin, for some reason IntelliJ IDEA is not detecting the bukkit library, how do i add that so my code can run?

valid burrow
drifting ice
valid burrow
#

well generally speaking there is 2 ways of making your IDE acsess the library

valid burrow
drifting ice
#

i tried to download maven but the tutorials i found didnt explain how to actually get it

#

i have the maven zip file and stuff

valid burrow
#

you can do it all in intellij

drifting ice
#

ah alright

#

any videos you know of where i can get help with that?

#

or if you know how to build the script maybe you could give me an example

valid burrow
#

sure but i can also just run you through it if you want

drifting ice
#

yes that would be helpful

#

im trying to make a 1.20.4 spigot plugin

valid burrow
#

mhm

#

okay first

#

close the project

drifting ice
#

alright i closed it

valid burrow
#

and click plugins in the start menu

drifting ice
#

one second

valid burrow
#

yh

drifting ice
#

this software is new to me, how do i exit the project?

#

oh wait i got it

valid burrow
#

1 sec

drifting ice
#

okay im on plugins

valid burrow
#

ah alright

#

search for "minecraft development"

drifting ice
#

done

valid burrow
#

make sure to select market place

drifting ice
#

Restart?

valid burrow
#

yes

drifting ice
#

alright

#

whats next ?

valid burrow
#

create a new project and choose "minecraft" on the left

drifting ice
#

damn thats very different then what i did last time lol

#

bukkit spigot 1.20.4

valid burrow
#

what ever you want yh

#

set your stuff

#

name

#

package name

drifting ice
#

alr alr

valid burrow
#

and when youre done click create

drifting ice
#

build system maven

#

?

valid burrow
#

yes

#

you can also use gradle although i recommend maven especially for beginners

drifting ice
#

alr alr

#

what is Artiifcat ID?

#

artifact

valid burrow
#

what the compiled jar will be nammed

#

group id should be something like me.jabstatic btw

drifting ice
#

yessir

valid burrow
#

or if you have a domain use that

drifting ice
#

i got it set

valid burrow
#

either works

#

alright

#

click cfreate

#

create*

drifting ice
#

got it

#

i see a folder and some icons

valid burrow
#

let it load

drifting ice
#

its done

valid burrow
#

it takes a few seconds

#

alr

#

open the folders

drifting ice
#

alright

valid burrow
#

it shouldve created your main class and a pom.xml

#

it should if all went well already set the propper maven imports

#

but just to make sure we can check

drifting ice
#

i do not see the main class

#

what is it called?

valid burrow
#

show me a screenshot

drifting ice
#

is it <name>.iml

#

ight

#

cant send it here, can we talk in dms?

valid burrow
#

sure

#

?paste

undone axleBOT
sour mountain
#

im making a player-tracking compass plugin but it doesn't work in the nether because the compass just spins aruond randomly, anyone know a way to bypass this happening?

native nexus
#

iirc coordinates work differently in the nether so you may have to create an algorithm that converts world space into nether space. I could be wrong

floral drum
#

x and z / 8

acoustic shuttle
#

Anyone know how I would go about canceling/hiding/deleting the sweep particles a sword does when a player attacks with a sword? (I still need the particles so I don't want to do anything that will make them totally invisible, I just want to disable the ones when a player attacks with a sword)

shut canopy
#

Wher should I purchase my domain from? Top recommedations appreciated

echo basalt
#

I get mine from porkbun but I'm pretty sure namecheap has better dns

meager sage
#

How can I prevent an item from moving when dropped? Or just prevent it from falling into a hopper?

acoustic shuttle
torn shuttle
#

hm

#

I might have a minecraft first, not sure

buoyant viper
#

mine craf

torn shuttle
#

has anyone else done 100% ai support for their plugins before? I just got mine to work, it's actually pretty decent

#

it can generate valid yml files to create content in my plugins, debug, answer questions, it's pretty good

torn shuttle
#

would actually be pretty fun to have a channel like in spigot, potentially

#

though setting it up would probably be rather challenging

icy beacon
#

How did you approach this?

torn shuttle
short pilot
#

what does the palyer move event provide ?

#

player*

torn shuttle
#

2 hours of nodejs programming, 3 hours of fixing my ide, 5 weeks of writing a wiki in a markdown format I knew the ai would like

#

also I nailed it it loves markdown

icy beacon
#

What ai did you train?

quaint mantle
#

Help I have a problem, I want to execute commands on my paper server to my bungee server, I did it but it only works if a player is connected, any solution so that it does not depend on that??

torn shuttle
#

it's going pretty well

#

I'm using google gemini 1.5 pro, preview

solid zinc
#

Haha

icy beacon
#

Is it paid?

torn shuttle
#

not right now

icy beacon
#

Gotcha

#

That's really cool, nice job!

#

I'll think of integrating this a bit later

torn shuttle
#

would be fun for spigot to have but man the amount of work to get it running would be tremendous

icy beacon
#

Yes. Looks tasty for a portfolio though haha

torn shuttle
#

eh sure I guess, I hire people I don't get hired

#

I'm just happy I got free 24/7 support that is honestly fairly serviceable

ionic thicket
#

Is there a way to add a pdc to an inventory? I was thinking about applying that pdc to every item in that inventory but hesitated because I thought it wouldn't be the most optimized way to do it.

buoyant viper
#

ull need to create a socket between the two that doesnt depend on a player

quaint mantle
buoyant viper
#

naur sorry im a lil stupid

quaint mantle
#

aa

valid burrow
#

whats the issue

quaint mantle
#

I understand, no one wants to help me and I'm already at around 10 pm

valid burrow
quaint mantle
#

for example /bungeecmd <command>

valid burrow
#

ah mhm

#

that can prove to be rather complicated

icy beacon
#

but with no player on the server

#

which complicates stuff further

quaint mantle
#

I mean I already have my plugins, my bungee and paper plugin

icy beacon
quaint mantle
#

It's just that the command that is sent to bungee only when a player is on that server works in paper.

icy beacon
#

also it looks really bad with dark mode turned on, you might want to have a custom background

quaint mantle
#

I offer 3 to 4 dollars for help

icy beacon
icy beacon
icy beacon
#

my audit is complete

valid burrow
#

i know all that

#

im still making it xd

icy beacon
#

:P

quaint mantle
#

can you help me?

icy beacon
valid burrow
quaint mantle
quaint mantle
# valid burrow crazy

Well I don't know, I'm going to try the socket thing, but can that be done in a bungee or paper plugin?

valid burrow
#

it has to

#

i cant think of another way

#

u need a bungee and a paper plugin

quaint mantle
#

It is obvious, in fact I already have the 2 that I mentioned that only the paper command works when a player is online

#

:^)

valid burrow
#

i have no idea what you are trying to ssy

quaint mantle
#

Well

valid burrow
#

well

icy beacon
ionic thicket
icy beacon
#

omg i just realized

#

spigot is a bucket but better

#

like significantly better

valid burrow
#

😭

icy beacon
#

is that why it's named spigot

shadow night
#

wow

#

took you long

icy beacon
#

explain paper then

shadow night
#

makes no sense

icy beacon
#

explain rust bitch

shadow night
#

but it used to be paperspigot

icy beacon
valid burrow
#

cause it only looks better on paper

icy beacon
#

lmaofafooaoao

#

that's good

#

what about purpur

eternal oxide
#

furry version

daring lark
icy beacon
#

that's a first

daring lark
#

rust goes brrrrr

icy beacon
#

i enjoy rust

icy beacon
#

next on the agenda is "sigma" probably

proper cosmos
#

What would be the best way to save List<Location> locations; into config?

eternal oxide
#

config.set("path", list)

#

just be certain you don;t attempt to access the config until all worlds are loaded (onEnable is good unless using other multi world plugins))

proper cosmos
#

or config.getList

eternal oxide
#

get list should be fine

quasi gulch
#

Does anyone know why these two images aren't next to each other when i paste the other image above them? It works without the other image but i dont know why. In the Spigot Plugin Description

eternal oxide
#

width

#

um

quasi gulch
#

But they work without the image above how do i need to change widht?

eternal oxide
#

yeah markdown

#

good luck

proper cosmos
#

something like that?

#

Or any easier way to do it

valid burrow
#

is it a list of objects you dont know?

proper cosmos
valid burrow
#

what type of object are they

proper cosmos
#

Location

valid burrow
#

then why List<?>

#

do List<Location>

#

lol

eternal oxide
#

his IDE likely offered that as it is what the API would return

valid burrow
#

mhm

proper cosmos
#

List<Location> locations = (List<Location>) customConfig.getList("beacons");

#

yep will do something like that

valid burrow
#

yea

#

that works

icy beacon
#

the ide would probably be bitching at you for an unsafe cast

outer tendon
#

wait, it will actually manage to cast that?

#

This actually has a lot to do with what Im trying to do

proper cosmos
outer tendon
#

Will it automatically return a list if it detects them as locations?

#

and what format should such a list be in?

proper cosmos
#

I mean it's deserializing it great

outer tendon
#

what format do you have them in?

proper cosmos
outer tendon
#

right, I mean in the config

proper cosmos
#
List<Location> locations = new ArrayList<>();

config.set("path", locations);```
#

oh

#
path:
- ==: org.bukkit.Location
  world: world
  x: 41.0
  y: 68.0
  z: 42.0
  pitch: 0.0
  yaw: 0.0```
outer tendon
#

ah okay

#

I guess if I do that itll make my code better

#

but

#

Ill have to check to make sure the world they specify is the same as the world specified elsewhere

#

and in all of the other locations

#

what does ==: denote in YAML?

proper cosmos
#

ye you could do serialization / deserialization yourself

outer tendon
#

yeah, my code is just a lot rn xD

#

nearly 100 lines just to read my locations so far

proper cosmos
outer tendon
#

yeah

eternal oxide
#

==: is an object serialization

outer tendon
#

ah okay

#

yeah I want people to be able to understand this is they use it. do you think it would make it less user-friendly if I used that abstraction?

eternal oxide
#

tells bukkit its package for deserializing

#

ConfigurationSerializable

outer tendon
#

Alright

#

it just doesn't seem as user-friendly as doing my own serialization

#

I guess I just need a second opinion on my code, because rn it looks quite sloppy

eternal oxide
#

many Bukkit objects are already serializable

outer tendon
#

ik they are. im talking about user-friendliness

eternal oxide
#

one key line extra is all

outer tendon
#

yeah, but I also need to ensure they use the same world as they have listed elsewhere

#

is it possible to leave out the world property?

proper cosmos
eternal oxide
#

yes

#

These are auto serialized Objects

tardy delta
#

would anyone still know what this does? 1.16_R3 code

eternal oxide
#

leaving out the world and its no longer a Location

outer tendon
#

hm alright

proper cosmos
outer tendon
#

then Ill just handle it myself

#

thank you :d.

tardy delta
#

can you remove players from tab?

eternal oxide
tardy delta
#

wrote this code 4 years ago

#

alr then

outer tendon
#

:D.*

tardy delta
#

gotta make an assignment for clean code in college and im gonna submit soms nms lol

outer tendon
#

lol

#

do it, you won't

proper cosmos
#

Is there something similar for Block, as there is ItemMeta#setCustomModelData()?

icy beacon
#

blocks do not support custom model data iirc

shadow night
#

yeah, they don't, atleast yet

proper cosmos
#

I mean they support

#

but cannot change their model

icy beacon
#

well that's the same as not supporting

shadow night
#

yeah

tardy delta
icy beacon
tardy delta
#

pastes.dev

icy beacon
#

do you code in pastes

rotund ravine
#

He does

remote swallow
#

Anyone got kotlin sql framework recommendations, not exposed ktorm or requery

outer tendon
remote swallow
#

Just not a fan

tardy delta
#

i dont

tardy delta
#

myes pasting code in libreoffice is fun

#

it even gives me syntax highlighting

blazing ocean
#

wiah

#

aoah

#

woah

#

i should try

tardy delta
#

only seems to work when i copy it from a jetbrains ide though

blazing ocean
#

woah

tardy delta
#

looking at my old code, damn i have a 250 lines long method that uses reflection to create an npc πŸ’€

blazing ocean
#

crazy

tardy delta
#

guess i hadnt heard about varhandles

blazing ocean
#

i don't use code for npcs

#

i use custom models

tardy delta
#

how are you gonna spawn them

blazing ocean
tardy delta
#

i myself am still on the old stuff

#

but damn

blazing ocean
#

nahhhh

tardy delta
#

no more nms for me from now on

blazing ocean
shadow night
ionic thicket
#

Is there a way to add a pdc to an inventory? I was thinking about applying that pdc to every item in that inventory but hesitated because I thought it wouldn't be the most optimized way to do it.

frail pilot
#

Probably not the inventory itself but its holder

tardy delta
#

you can add pdc to a player

#

or a tilestate, which probably is the holder of that inventory, like a chest

ionic thicket
#

Oh well, it doesn't really have a player; It's a shop menu GUI, not a normal player/chest inventory

tardy delta
#

i believe itemmeta also has pdc

tardy delta
#

apply it to the itemmeta of every item id say

ionic thicket
shadow night
#

if you use it to identify an inventory you can just use a hashmap with the inventory

ionic thicket
shadow night
#

There is no reason to add pdc to a thing that quite literally does not persist

ionic thicket
#

what do you mean, sorry?

shadow night
#

Hmm, what if you tried finding out yourself

ionic thicket
#

bruh

#

alright

#

I already had a solution, I was just looking for the most efficient

shadow night
#

A hashmap

outer tendon
#

lol those reactions xD

#

Do you guys hardcode the items for GUIs for things like shops?

blazing ocean
#

i have a data class which represents an item in a gui which has the item stack etc

#

and then i just pass in a list and draw it to the pane

outer tendon
#

where does the list come from?

blazing ocean
outer tendon
#

alright

#

that makes sense

blazing ocean
#

or enum entries ig

outer tendon
#

I suppose the only way to not hardcode it is to use a config or something, but that's probably unnecessary

#

I like your profile picture Xd

#

XD8

#

XD**

blazing ocean
#

if it's your server, no need to

outer tendon
#

yeah

slender elbow
#

that's probably unnecessary
laughs in Minecraft making everything a json

outer tendon
#

lol

outer tendon
blazing ocean
smoky anchor
#

(speaking of datapacks, is there currently any way to ship a datapack within the plugin jar?)

shadow night
#

If you host a webserver then ig yes?

smoky anchor
#

I was more looking for api way
Guess I gotta wait for that, it is pretty much inevitable would be my guess with how much of the game is data-driven now

slender elbow
shadow night
#

Ig you could just extract it into the world folder from your jar, right?

slender elbow
#

yeah but by the time the plugin is loaded it's too late for it to take effect

shadow night
#

We need early loaded plugins

#

By early loaded plugins I mean plugins, that are loaded at the earliest possible point allowing them to modify registries, load datapacks into worlds and all that shit

smoky anchor
#

πŸ™ md_5 πŸ™

tardy delta
#

i remember elgarl helping me through this lol

#

horrible code

icy beacon
proper cosmos
#

If I cancel PlayerPickupItemEvent & InventoryInteractEvent & InventoryClickEvent & InventoryDragEvent will player be able to actually obtain item?

eternal oxide
#

from amor stands, yes

#

or from other plugins

outer tendon
smoky anchor
#

look a message above ;)

outer tendon
#

Oh it's md_5?

smoky anchor
#

what

outer tendon
#

Oh, I thought you meant a message above the quoted message

#

not my message XD

#

I see

#

Thank you XD

smoky anchor
#

oh, fair :D

proper cosmos
outer tendon
#

Interesting that he popped in right after he was mentioned

#

alright, time for another commit

eternal oxide
#

Always lurking

outer tendon
#

xD

proper cosmos
eternal oxide
#

No, thats an abstract event

proper cosmos
#

oh

#

okey

peak depot
#

how can I get the inventory of a double chest and no only 1 side of it

eternal oxide
#

each side has its own inventory

peak depot
tardy delta
#

check what type is a supertype of DoubleChest

#

then figure out how to obtain one of those types

peak depot
#

found the problem doublechest is an InventoryHolder not an blockstate like chest

eternal oxide
#

So Block

#

however, you don;t even need the DoubleChest in yoru code as you created left and right yourself

#

just update teh state for each and get inventory

hollow vessel
#

Hi! How can I open doors using API? I must cancel PlayerInteractEvent and after X time open the doors, I tried using Openable interface and Door#setOpen both of this methods doesn't work.

#
Openable openable = (Openable) blockState.getBlockData();
openable.setOpen(true);
blockState.setBlockData(openable);
blockState.update();
#

I had tried this

drowsy helm
#

if its inside of the event handler you might ahve to add a 1 tick delay

worldly ingot
#

You don't need a BlockState#update() call

#

Also, yes, in a PIE, you might want to delay your setBlockData() call by a tick. It depends

proper cosmos
#

If I create ItemStack with Material.ENCHANTED_BOOK without actually enchanting it would it crash?

worldly ingot
#

No it just wouldn't have any enchantments :p

shadow night
#

minecraft doesn't crash for no reason

worldly ingot
#

I mean πŸ‘€

proper cosmos
worldly ingot
#

Yes

#

Just an empty one

proper cosmos
#

Great

young knoll
shadow night
hollow vessel
#

I have add 1 second delay and nothing has changed

#

oh, sorry It is working - my bad

#

thanks!

quasi gulch
#

In 1.20.6 the Particle ENCHANTMENT_TABLE was replaced with ENCHANT. I dont get any Error when using the plugin on a 1.20.6 Server. How do i know if an API change is gonna effect my Plugin

eternal night
#

old plugins are rewritten when loaded, generally renames like that should not break old stuff

quasi gulch
#

Ok thanks

chrome beacon
drifting nova
#

How would one have dynamic port allocation? Is there a field I can reflect into to modify the port b4 Spigot binds to it?

remote swallow
#

--port, --server-port or -p

drifting nova
remote swallow
#

the only other way would be passing incomming connections if you dont know the port

hazy parrot
#

Some kind of reverse proxy

#

But sounds like xy

icy beacon
#

^

#

?xy

undone axleBOT
grim ridge
#

someone help pelase

chrome beacon
#

Wrong channel

grim ridge
#

O

drifting nova
# hazy parrot But sounds like xy

The plugin "links" with its host proxy thru rabbit, and the proxy tells it what it should be in terms of both the actual gamemode on it and the port it should allocate to. The issue I have however, is that it appears the port isn't changeable on plugin onLoad, which is where the plugin gets the response back from the proxy

chrome beacon
drifting nova
slender elbow
#

why do you want this in a plugin :harold:

drifting nova
shadow night
slender elbow
#

like, you pretty much want to make a reverse proxy and just forward connections and payloads to the server

drifting nova
slender elbow
#

i don't see how it's overkill? you're just forwarding connections and not messing with the server state by managing it safely yourself, and it isn't like you care about the actual payloads either

#

"a whole reverse proxy" of this magnitude you can do in, like, one class with netty anyway

drifting nova
slender elbow
#

i mean, what i would do is use containers for basically all of this and keep all this management outside of the minecraft server, i don't know why you'd want to change the port at runtime, sounds like what you want to do is basically spin game servers on demand

drifting nova
#

Containers as you're describing means I'm going to need to do a little more env setup

slender elbow
#

containers are perfect for this πŸ˜„

#

yep, devops is pretty cool

#

imo it's very much worth the time investment

drifting nova
#

Sounds like a thing for tomorrow

#

for now I'ma sleep

#

thanks Spigottians

icy beacon
#

spigotaceans

wanton comet
#

quick question, is a spawner's spawn range capped? maybe at 5? Since I am incrementing the spawn range by 1 on a click in a menu, but it does not go past 5

I am doing CreatureSpawner # setSpawnRange()

chrome beacon
#

Show your code

wanton comet
#
this.rangeButton = new Button() {

            int spawnRange;

            @Override
            public void onClickedInMenu(Player player, Menu menu, ClickType clickType) {
                CreatureSpawner cs = (CreatureSpawner) player.getTargetBlock(null, 5).getState();
                spawnRange = cs.getSpawnRange();
                cs.setSpawnRange(spawnRange + 1);
                Common.tell(player, langRangeChanged.replace("{range}", String.valueOf(cs.getSpawnRange())));

                restartMenu(restartMenuRange);
            }

            @Override
            public ItemStack getItem() {
                return ItemCreator.of(CompMaterial.valueOf(materialRange)).name(nameRange).lore(loreRange).glow(glowRange).make();
            }
        };
orchid hinge
#

nice abstracting

chrome beacon
wanton comet
#

oh , cs.update(); right?

chrome beacon
#

yes

tardy delta
#

no builder with lambdas :(

wanton comet
#

that was the problem thanks

grave vale
#

hey, I saw that ItemMeta#hasLocalizedName is getting removed soon, is there any alternative to it?

chrome beacon
#

What did it even do

grave vale
#

you could set a localized name that you could use for different stuff

#

I use it to know what an item does in my menus

chrome beacon
#

well that sounds like a bad idea

#

Tag your items with pdc

#

?pdc

grave vale
#

That was what I was gonna go for since localized names are getting removed

glass sentinel
#

can someone help me obfuscate my plugin?

eternal oxide
#

no point to obfuscation, unless you are a Business protecting IP rights.

smoky anchor
#

(or trying to do nono things...)

drifting ice
#

do you think anyone here could take a look at this code and figure out why im getting an error?

glass sentinel
#

i have need to do it just to protect my code (to prevent reselling by guy i code it for) (i have licence keys)

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!

drifting ice
#

?paste

undone axleBOT
drifting ice
#

one second

icy beacon
#

that's right, use paste

drifting ice
#

Cannot resolve method 'getDelay' in 'BukkitTask'

icy beacon
#

what is wrong?

#

ah

drifting ice
#

Line 170

icy beacon
#

well that's correct

drifting ice
#

its supposed to be a cooldown thing

icy beacon
#

getDelay is not a thing for BukkitTask

#

i do not think that BukkitTasks hold any data on their delay/interval

#

it's probably the scheduler

drifting ice
#

any ideas on how to fix that? its supposed to have a 10 second cooldown whenever a player uses the custom item

icy beacon
#

but in fact there doesn't seem to be a way to fetch that data even from the scheduler

pseudo hazel
#

well you put in a delay when making the task right?

icy beacon
#

well instead of Map<UUID, BukkitTask> you could use a Map<UUID, Long>

pseudo hazel
#

so just save a reference to that

icy beacon
#

where the long would be the cooldown

drifting ice
#

so Map<UUID, #>

#

?

#

im sorry this is my first time trying to get a plugin to work

icy beacon
#

you can save a Long (or Integer) representing the amount of seconds left for a cooldown

#

and then you need to have a separate task that decreases every entry in the map by 1 every second

#

so that the value would be factual

drifting ice
#

thank you

#

now it says there are no errors

#

?paste

undone axleBOT
icy beacon
#

np

drifting ice
#

because it says there are some warnings but they arent errors

#

line 56: not annotated parameter overrides @NotNull parameter

icy beacon
#

assert iceMeta != null;
tbh it's been a very very long time since i've seen anybody use assert. for good measure, instead do
if (iceMeta == null) return;

chrome beacon
#

Don't detect items by their name

icy beacon
#

^

#

use pdc

icy beacon
drifting ice
icy beacon
#

i'd also recommend to split listeners, commands and the main class into separate classes and not one huge monolithic class

icy beacon
#

look up "single responsibility principle"

icy beacon
#

and some other lines

#

you've got some asserts

shadow night
drifting ice
#

i fixed the firework version of assert

drifting ice
icy beacon
drifting ice
#

okay

shadow night
drifting ice
icy beacon
#
    private Entity getTargetPlayer(Player player) {
        for (Entity entity : player.getNearbyEntities(10, 10, 10)) {
            if (entity instanceof Player && player.hasLineOfSight(entity)) {
                return entity;
            }
        }
        return null;
    }

i don't think this will work as you intend. it might, but there's also a method called World#rayTraceEntities which will probably suit you better

icy beacon
#

if even

drifting ice
#

btw im editing the code in IntellJ IDEA

#

how do i package the code into a .jar for my server?

icy beacon
icy beacon
#

maven and gradle are the two most prominent ones

shadow night
#

maven package

drifting ice
#

im using maven

icy beacon
#

do you have a pom.xml file or a build.gradle.kts

#

ok then do what raydan says

shadow night
drifting ice
#

i have the pom.xml

#

alright

icy beacon
drifting ice
young knoll
icy beacon
remote swallow
drifting ice
icy beacon
#

if you're using intellij there should be a maven icon on your right bar

#

click there and find a console icon on the newly opened tab

drifting ice
#

i clicked the maven and i see some folders

icy beacon
#

one sec i'm booting up intellij

drifting ice
#

lifecycle, plugins, run configs, dependencies, repositories

#

thx so much for help guys

icy beacon
drifting ice
icy beacon
drifting ice
#

its an m for me

shadow night
icy beacon
# icy beacon

click on this console icon and execute mvn package

shadow night
icy beacon
icy beacon
icy beacon
drifting ice
#

i double clicked the package in lifecycle

icy beacon
#

with a zankyou no terror background

#

the plugin should be building now

drifting ice
#

how do i share a SS?

#

it built

icy beacon
#

?img

undone axleBOT
#

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

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

drifting ice
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

drifting ice
#

forums username?

icy beacon
drifting ice
#

okay lemme go login

icy beacon
drifting ice
#

!verify jabtastic

undone axleBOT
#

A private message has been sent to your SpigotMC.org account for verification!

drifting ice
icy beacon
#

i went to walmart

drifting ice
#

._.

#

nice

icy beacon
#

the one without original- is what you're looking for

drifting ice
#

which one is the executable for server?

#

ah thank you

#

yall are the best 😭

#

<3

shadow night
icy beacon
#

spigot community - the only minecraft-related community with no known pedoes as of may 9th 2024

#

you are always welcome here

drifting ice
#

:D

#

spigot has always been the best choice for my server fr

#

im gonna test to see if my plugin works

#

would be insane if it does first try

icy beacon
#

we are developers, we can't have shit working first try

#

but good luck

#

i'm gonna go now cyall

drifting ice
#

cya

#

hold up

#

lemme send the logs rq

#

?paste

undone axleBOT
drifting ice
eternal night
#

register your commands in your plugin.yml (absolutely blind call)

remote swallow
#

holy shit

frosty geyser
#

Hi, I was wondering if you can silence a dispatchCommand (for example Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "give %player% minecraft:dirt 1");) to not send a message to the console of CONSOLE issued server command: /give %player% minecraft:dirt 1 on 1.20.4 (Note that it would be executing commands from other plugins).

More Understandable Version: Is there a way to make a separate console or something to dispatch the commands so it doesn't fill up the main console log (since multiple commands will be executed and spam the main console).

Any help would be amazing.

remote swallow
#

heres someone using spigot asking for help in spigot

eternal oxide
drifting ice
eternal night
eternal oxide
#

probably

#

blows up and hides error

eternal night
#

Well IJ suggests it as a fix

eternal oxide
#

yeah 😦

frosty geyser
eternal night
#

just not smart KEKW

shadow night
drifting ice
#

Objects.requireNonNull(getCommand("giveitems")).setExecutor(this);

eternal night
eternal night
#

lets goo, I was right

eternal oxide
drifting ice
#

oh what the fuck

#

i literally put the plugin.yml in

#

it didnt save any of it

remote swallow
#

make sure your modifying the one in src/main/resources

drifting ice
#

i did, mustve forgot to save it idk

remote swallow
eternal oxide
#

and delete teh requiresNonNull

#

all it does is make it hard to see your errors

frosty geyser
drifting ice
eternal night
#

nothing

drifting ice
#

or no

#

alright

eternal night
#

just getCommand("").setExecutor

eternal oxide
#

nothing. Tell your IDE to kick rocks

remote swallow
drifting ice
#

okay once im done patching spigot.yml i will erase that line

#

so can i just add :

commands:
giveitems:
description: Gives the player all custom items.
usage: /giveitems
permission: giveitems.command

#

to the bottom of spigot.yml?

eternal night
#

no that goes in your plugin.yml

drifting ice
#

sorry thats what i meant

#

plugin.yml yes

eternal night
#

then yea

drifting ice
#

alright

#

i removed the line that required non null and added the command

eternal oxide
#

don;t remove the whole line

#

just teh annoying Objects.requireNonNull( part

drifting ice
#

oh okay

#

will the line still work if i just remove objects.requirenonnull

eternal night
#

Yes

remote swallow
#

yeah

drifting ice
#

this is what it said when i deleted it

chrome beacon
#

One too many )

eternal oxide
#

too many ))

drifting ice
#

thanks

#

i didnt see the extra thing

icy beacon
#

you can install an intellij plugin Rainbow Brackets to help you better visualize all the brackets you open and close

eternal oxide
#

Objects.requireNonNull has its uses, but not here. You want it to break and give you the proper error

shadow night
#

It has uses?!?!

eternal oxide
#

some, not many

drifting ice
#

you guys are right lol

shadow night
#

Like?

icy beacon
drifting ice
#

thats dumb that it was suggesting something bad

#

alright i will be back sometime later to test it again

icy beacon
#

the ide does not know that you want getCommand to fail if something's wrong with the plugin

#

all it sees is that getCommand can be null and you're calling a method on something that can be null

eternal oxide
#

I use Eclipse and it doesn't care πŸ™‚

quaint mantle
#

getCommand()?.setExecutor()

river oracle
#

or you can just turn off the shitty IJ warnings

eternal oxide
#

hiss

icy beacon
#

dat's kotlin

river oracle
#

it has some really stupid ones

icy beacon
#

or use some command framework

ivory sleet
#

pr getCommand() to be annotated with @UnknownNullability when??

quaint mantle
#

Never πŸ—Ώ

shadow night
quaint mantle
river oracle
icy beacon
#

true\

#

use rust

#

no nulls

quaint mantle
ivory sleet
shadow night
#

I should make a pr to the mc dev ij plugin to remove all nullability warnings from getCommand add a warning when getCommand is called on a command not in the plugin.yml

river oracle
#

the amount of times I've run in an NPE from not null checking is around 0

quaint mantle
#

BukkitCommand and Reflection gang

icy beacon
river oracle
icy beacon
#

BaseCommand gang

shadow night
ivory sleet
icy beacon
shadow night
#

fabric, forge, planning to see how architectury does shit

icy beacon
#

fair

ivory sleet
river oracle
#

your brigadier implementation is not open source

#

so Lame no one cares 😑

icy beacon
#

because i still haven't gotten around to writing my own command framework

ivory sleet
#

Acf, is too annotationishy

icy beacon
ivory sleet
#

lol

icy beacon
ivory sleet
#

ah, so you enjoy @JvmStatic?

icy beacon
#

no that's cbt

#

the wrong form of ejaculate

ivory sleet
#

Lol

shadow night
icy beacon
#

you got it

ivory sleet
#

and how about LoMbOOk + KotlIin?

river oracle
#

is that possible?

quaint mantle
civic sluice
#

Lombok πŸ‘Ώ

icy beacon
#

@Data in kotlin πŸ’€
@NotNull in kotlin ☠️

river oracle
#

actually its @NonNull for lombok πŸ€“

icy beacon
#

oh i wasn't talking about lombok in this case

#

you didn't read my mind successfully

#

skill issue

eternal oxide
#

or... not enough neurons firing to read? πŸ™‚

ivory sleet
quaint mantle
#

Most pointless annotation in java?

ivory sleet
#

in lombok*

#

not sure but I assume it provides similar semantics to what kotlin has

#

on compile time at least

#

probably looks a bit goofy after that

icy beacon
#

if you use @Data, @ExtensionMethod, @NotNull, @Nullable, @UtilityClass, val, then just move to kotlin, like what are you waiting for

eternal night
#

The only useful annotation lombok has produced is @Delegate

#

change my mind

eternal oxide
#

I liked @Getter and Setter when I used it

#

but I did only use it for one project

ivory sleet
#

:D

shadow night
#

What's a SuperBuilder

remote swallow
pseudo hazel
#

where is the @NoBugsPlease when you need it

remote swallow
#

explain @SuperBuilder

slender elbow
#

builder from krypton

tardy delta
#

builder with super class fields support

#

for whatever reason

ivory sleet
#

krypton 😭

drifting ice
#

hey guys, i ran the server and something good happened

#

no errors or warnings in console

#

and the /giveitems coammand works

#

or at least its a real command

#

ill have to test if the items actually work

ivory sleet
#

nice

drifting ice
#

i just need to log an alt on later to test the weapons

dawn flower
#

[20:22:47 WARN]: Saving oversized chunk [24, -16] (2112065 bytes} to external file .\world\entities\c.24.-16.mcc uhh

#

should i be worrying (it lags the server)

blazing ocean
dawn flower
#

mb

drifting ice
#

thanks to everyone who helped me learn how to build a maven plugin yall are the best

eternal oxide
dawn flower
#

it just started doing it and its lagging badly

eternal oxide
#

whats in the chunk?

dawn flower
#

just mobs

eternal oxide
#

ok, whats in teh chunk that is not in others?

slender elbow
#

3 million pufferfish

dawn flower
#

can i stop that in the future with coding, maybe limit entities

worthy yarrow
eternal oxide
#

You or a plugin must be doing something in that chunk for it oversize

dawn flower
#

i know its not me

eternal oxide
#

2112065 whats that 2mb?

dawn flower
#

thats like 21mb

#

nvm

#

dawg

mellow prairie
#

how to enable golden apples on combatlogX

dawn flower
#

its lagging the heck out of the server (i restarted)

eternal oxide
#

if the chunk is not important, delete it

dawn flower
#

its the most important chunk in the server

eternal oxide
#

then find which plugin is messing with its entities/PDC

river oracle
#

even better just use a profiler like spark

dawn flower
#

i only got like 2 text displays and afew mobs

river oracle
#

download spark

#

and profile

worthy yarrow
#

I think we've come to the conclusion that it's likely not your plugin

dawn flower
#

4 * 9 mobs to be exact

#

it might be

#

idk

dawn flower
worthy yarrow
#

Turn that idk into a positive I know exactly what the problem is with spark :p

dawn flower
#

what does spark even do

#

looks like a server doctor to me

worthy yarrow
#

It's a profiler, essentially locates issues within the server based on it's process's

dawn flower
#

so a server doctor

worthy yarrow
#

yeah, and you're the nurse

#

It diagnoses, you fix it

dawn flower
#

what do i do tho

worthy yarrow
#

idk how to use spark, I've never used it before

dawn flower
#

6.06 tps 😭

#

not even hypickle gets tps this low

worthy yarrow
#

Spark is gonna help you find what's causing that tps

dawn flower
#

im profiling rn

worthy yarrow
#

Beyond that, I have no clue how to use it lol

dawn flower
#

ok why the heck does spark use the most cpu

worthy yarrow
#

If I had to guess, it takes all that in order to hunt down the issue

dawn flower
#

still dont understand

river oracle
#

leave it running for 10 or so minutes

dawn flower
#

ok

river oracle
#

or until the server crashes

dawn flower
#

it prob wont

river oracle
#

whatever comes first

dawn flower
#

the profiler is the spark report?

#

im guessing there shouldnt be this much text displays

river oracle
#

what the fuck

#

in one chunk

#

how did you even manage that πŸ‘€

dawn flower
#

idfk

#

i use axiom so i think it fucked up

river oracle
#

yeah I think its probably the 167,426 text displays

slender elbow
#

xd

dawn flower
#

im respawning it everytime text displays get removed from the world so i think thats why

#

cuz it gets removed when u unload the chunk

worthy yarrow
#

Crazy how I never figured 4x9 was 167,426

dawn flower
#

can i make text displays invulnerable to stuff like /kill all without that

slender elbow
river oracle
slender elbow
worthy yarrow
#

I never would have thought

dawn flower
slender elbow
#

yeah well.... yeah

worthy yarrow
dawn flower
#

is there a better way

stoic parrot
worthy yarrow
#

Imagine going to school for an extra 10 years just to tell people what is wrong

#

Basically a therapist for the physical body

river oracle
worthy yarrow
river oracle
#

your nurses must get payed like crazy

worthy yarrow
#

They do, and so do doctors

river oracle
river oracle
#

I've been to the hospital a fair share of times... I... that's not how that works

worthy yarrow
#

Idk what to tell you then, because I've never in my life had a doctor do anything but tell me what's wrong

#

And then the nurse comes in and give me the pills

river oracle
#

if you've never been in the hospital for anything other than pills yeah ig that's kinda how that works

#

but like... some people go to the hospital because they're on deaths door