#help-development

1 messages · Page 746 of 1

boreal sparrow
#

it think it's just intellij dying

onyx fjord
#

what do u need an array for

boreal sparrow
#

oh my bad

#

techincally I don't need an array but I have everything else (like saving) already set up to use an array

#

so i thought it would be easy to just load one

young knoll
#

If you are on an old version int[]::new won’t work

boreal sparrow
#

int::new (in intellij) causes

 Required type:
IntFunction
<java.lang.Object[]>
Provided:
<method reference>

reason: no instance(s) of type variable(s) T exist so that T[] conforms to int[]
young knoll
#

You’d need new int[0]

boreal sparrow
young knoll
#

Blah it’s probably wrapper annoyance

boreal sparrow
#

ok ill try it

young knoll
#

Try .stream().mapToInt(Integer::intValue).toArray()

valid burrow
#

how can i check an offline players permisson

#

cause when i checked on the spigot forum it said hasPermisson should work

#

but it doesnt

young knoll
#

Yeah offline player isn't permissable

#

You can use the vault api for it

valid burrow
#

i have 8 database tables in this plugin already might at this point just add another one

#

thx though

primal ermine
#

Hey. It seems that after 1.20.2 something has changed with GameProfile? I'm receiving Profile name must not be null error now when trying to create custom skull from base64 value.

https://hastebin.skyra.pw/iluzeremeh.pgsql

young knoll
#

Oh geez

#

Use the api plz

#

?customhead

#

?heads

#

Dangit

#

Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...

icy beacon
#

This is not a Spigot-related question but I think somebody could help me. I'm quite new to webdev and I want to create this fixed footer, but the problem that I have is that the content gets under the footer. I want to set the margin-top of the footer to be equal to its height, because the height should depend on the content of the footer, but that does not seem possible?

<div class="content">
    Lorem placeholder
</div>
<div class="flex ch-footer bg-black w-full fixed bottom-0">
    <span class="text-white">ABC</span>
</div>
primal ermine
#

Just add margin-bottom to the content

#

margin-top on fixed footer wouldn't do anything

icy beacon
#

Oh that makes more sense yeah, but wouldn't it still need to depend on the height of the footer? Because if I set a concrete margin-bottom to content and the footer happens to become really large, it'll break again

primal ermine
#

If you're using fixed footer, most likely it will be cases when content hides behind it. Either don't use fixed, or use JS to calc footer height and apply margin to content automaticly

icy beacon
peak depot
#

is there a way to fetch the name of a player from uuid with bungeecord?

#

yeah but they removed it

#

ok yeah that work thanks

restive mango
#

Is there a pre-made system (like chatstream) to create a menu in the chat with buttons? I just want to display a list of file names with forward and back buttons to scroll through the list…

boreal sparrow
#

Can you play a specific cave sound to players?

young knoll
#

You can play any sound in the game afaik

#

With player.playSound

boreal sparrow
#

yea but it only includes cave_ambiance

#

the specific ambiance seems randomly selected

young knoll
#

hmm

#

I think there is actually a seed for sound packets

#

That we don't expose

boreal sparrow
#

hm

#

is it maybe possible to send a custom packet or something

young knoll
#

yeah

#

You can sand a packet manually with NMS

#

Or something like protocol lib

odd lark
#

Hi, do you know how we display a message in the chat with an image on the left and the text on the right of the image, I see that often but I can't find anything on the internet (it's a bit mmorpg style)

sick edge
#

I cant modify Advancements right?

thin iris
#

this is spigot

young knoll
#

You can with a datapack

#

Or a bunch of NMS stuff

upper hazel
#

how can I check if the player's inventory is open "naturally" or through a command?

young knoll
#

You can't

upper hazel
#

dem

young knoll
#

There's no InventoryOpenEvent fired for the players inventory

upper hazel
young knoll
#

Ah

#

Generally custom menus have a null inventory holder

#

Or a custom one if they are abusing the holder system

upper hazel
#

hmm, that's a risky plan

#

but

#

i not have choice

#

or create whiteList and add name

#

Inventory

upper hazel
#

but how i undestand i not can do this

young knoll
#

That's basically what the holder is

upper hazel
#

i mean check type

eternal night
#

I mean you technically can implement a custom inventory holder for your plugin

#

be assured tho, all of spigot maintainer team will look at you in disgust and sadness

upper hazel
#

lol

young knoll
eternal night
#

sometimes you gotta do terrible things

#

(or just throw the inv instance in a map/set)

young knoll
#

(or the view)

upper hazel
#

i think i just use inventoryName for whiteList

sick edge
young knoll
#

Because getHolder is slow

eternal night
#

because you may not implement API types

young knoll
#

And it was never meant for this

eternal night
#

getHolder is meh if you take the snapshot

sick edge
#

I saw it on a spigot forum post and it seemed simple

eternal night
#

Well, thing is, on spigot getHolder yields a snapshot of the holder

sick edge
#

😔

eternal night
#

if you call it on a chest with a shit load of items, all of them are cloned into the snapshot

#

which can be a lot for a lot of players clicking

sick edge
#

ok fair point

young knoll
#

We really need to clarify that you shouldn't make custom holders via the api

eternal night
#

I mean, this becomes a lot faster with getHolder(false) on paper but like

#

you can literally just keep a reference to the inventory somewhere

young knoll
#

You wanna upstream that?

eternal night
#

not my patch

eternal night
#

you should still not implement it

#

¯_(ツ)_/¯

young knoll
#

Yeah we should APIStatus.Internal it or something

eternal night
#

I wonder if there is a somewhat sensible way to implement PersistentDataHolder on Inventories

young knoll
#

I mean you could

#

But it's not persistent

sick edge
young knoll
#

Fully doable just kinda weird

#

Since it implies some kind of persitance, but inventories aren't persistent

eternal night
#

Well

#

you could implement it somewhat on inventories I guess

#

Entity inventories could go into the entity NBT

sick edge
#

So how do you guys do it? Do you check the name of the inventory or what?

eternal night
#

block entity ones into the block entity

eternal night
#

and well, createInventory ones are persistent until the object is removed

#

which is the same for all PDHs

young knoll
#

Time for just a DataHolder class

eternal night
#

sponge time

young knoll
#

It's like PersistantDataHolder just without the persistant

remote swallow
#

sounds like my brain

pseudo hazel
#

I check the inventory object

#

keep track of your created inventories

young knoll
#

^

#

I use the view, but yeah same idea

eternal night
#

^ same

#

also makes data storage easy af

#

just use it as a key for a map

#

and gg

young knoll
#

yay maps

sick edge
#

What is the view again? If I have a different Inv for each Team for example its 4 different views?

tranquil dome
#

The bukkit logger does not log fine, finer and finest. Is there a way to turn this on?

young knoll
#

View is created when Player#openInventory is run

sick edge
#

What about a custom inventory type? Or is that also bad xD

mortal hare
#

what's the difference in bukkit command api between label and command name?

young knoll
#

label is what they used to run it

#

Could be an alias if those are availible

mortal hare
young knoll
#

Command name is always the base name

remote swallow
#

my internet is dying

mortal hare
#

but what about inside Command class

#

there's setLabel()

upper hazel
young knoll
#

Might work

remote swallow
young knoll
#

Idk if inventories all have good hashcodes

#

Plus hashcodes can always conflict

mortal hare
#

from what i understand .getLabel() can either return fallback command name (plugin:commandname) or just plain (commandname) if there were no conflicts

#

basically getLabel() returns the command name which was registered properly

#

either commandname or plugin:commandname if there were conflicts

#

god i love paperweight

#

you just open source code straight from ide and look at it

#

but what is the point of this variable lol

#

why cant you just do return true at the back

eternal night
#

presumably it was set a while ago

#

and the set was removed

#

that is usually how you end up getting these things 😂

mortal hare
remote swallow
#

lynx seems like the kind of person to know a lot of java related pickup lines

eternal night
#

I have 0 game

remote swallow
#

just becauseyou dont have anyone doesnt mean you dont know java related pickup lines

upper hazel
#

this lie information???

#

InventoryType

#

lol

remote swallow
#

that looks correct to me

#

9 hotbar, 27 inv, 4 armor and 1 offhand

upper hazel
#

i mean

#

you not can get this TYPE

#

this client inventory no?

mortal hare
#

yes, but it can still detect it as a player inventory type

#

in inventoryclickevent, thus why it exists

upper hazel
#

but how lol

#

oh wait

#

inventoryClikck detect playerInventory?

mortal hare
#

you cant open player inventory but you can manipulate it

#

should detect it afaik

#

how would the server would know in that case where items are in the player inventory are if client doesnt send any packets related to clicking the player inventory

undone axleBOT
upper hazel
#

what will be if i creative this inventoryType and add holder

#

i can monipulate with armor player?

mortal hare
#

creative?

#

or do you meant create?

upper hazel
#

create

mortal hare
#

you cant create player inventory

#

it would probably default to chest one

#

too bad bukkit api doesnt have compile time some kind of constraint of not building code for these types of situations

#

bukkit api is very old, thus some inconsistencies exist

#

nah, craftbukkit is updated daily

#

that's not bad

#

overall design of an api is outdated

remote swallow
#

i would love for a large scale api rewrite but it would be way too much work to retain compat for everything

mortal hare
#

but if someone would replace something in bukkit api, there would be screaming monsters like: FIX YOUR PLUGIN, DO NOT WERK ON 1.20, 1 STAR YOU'RE THE WORST

#

bukkit api is basically in windows situation

#

cant update properly due to backwards compatibility

young knoll
#

What's up with entities?

mortal hare
#

he probably mentioned entities because of pathfinding

#

imo the worst parts of the bukkit api are command api and configuration api

#

although configuration api did got some fresh coat of paint recently (by finally allowing comments on yaml configuration files to exist)

young knoll
#

What's wrong with the spawning system

#

If only that was being worked on

#

:p

#

Not our fault that outdated api is... outdated

ivory sleet
young knoll
#

You can always do a feature request

ivory sleet
#

Myea

eternal valve
#

how to disabled minecraft vanilla loot tables ?

#

with datapack

vital minnow
#

Hello I would like to use MongoDB in my plugin and I have already read the forum post about it but unfortunately it still does not work https://www.spigotmc.org/wiki/using-mongodb/

I use Maven

<dependency>
       <groupId>org.mongodb</groupId>
       <artifactId>mongodb-driver-sync</artifactId>
       <version>4.11.0</version>
       <scope>compile</scope>
   </dependency>

       <dependency>
           <groupId>org.mongodb</groupId>
           <artifactId>mongodb-driver-core</artifactId>
           <version>4.11.0</version>
           <scope>compile</scope>
       </dependency>

Connection

private void Connection(){
        MongoClient mongoClient = MongoClients.create("mongodb://user:passwort@147.189.175.136:27017/?authMechanism=DEFAULT&authSource=db");
        MongoDatabase database = mongoClient.getDatabase("playtime");
        MongoCollection<Document> col = database.getCollection("data");
        System.out.print(col.countDocuments());
    }

Error
https://pastebin.com/vcwHv7gj

I have in the libraries folder the
mongodb-driver-sync-4.11.0.jar
mongodb-driver-core-4.11.0.jar
and still it does not work
I have also tried

I also added the drivers to my project

Translated with www.DeepL.com/Translator (free version)

orchid trout
#

?paper

#

?whereami

vital minnow
orchid trout
#

oh

vital minnow
#

and how

#

i cant finde the maven compile settings

#

IntelliJ IDEA

#

Run -> Edit configuration open this WIndows

upper hazel
#

oh demm so many inventoryHolder impl

mortal hare
#

i wonder what's the average size of a plugin on spigotmc

#

why so bloated?

#

shading?

remote swallow
#

yeah

#

most plugins actual content is under a megabyte usually

vital minnow
#

I can not find the command for it online

mortal hare
#

its crazy to think that we have terabytes of data storage rn, but for a code we max out at 1GB at worst

vital minnow
#

Do you mean Build -> Build Artifacts -> Build?

paper viper
#

The graphics take a lot

remote swallow
#

the big green play button next to selected run config

mortal hare
remote swallow
#

sussers

#

dead domain moment

upper hazel
#

why ChiseledBookshelf - has inventoryHolder?

vital minnow
#

ok i have start it

remote swallow
#

so you would want to see the content

upper hazel
#

lol wha

#

i can add book

#

lol

remote swallow
#

yeah

#

it has 6 slots

#

can hold any form of book

upper hazel
#

i play minecraft 7 years wth bruh

mortal hare
mortal hare
#

12 years

upper hazel
#

lool

remote swallow
#

my obs setup still works

#

was kinda expecting that to be broke by now

upper hazel
remote swallow
#

1.20 feature

mortal hare
vital minnow
#

but it still does not work

remote swallow
#

probably not id guess

quaint mantle
#

hi whats the gradle (kts) depenticy to include nms / bukkit

remote swallow
#

for mojmaps there isnt one

mortal hare
#

why NOT

remote swallow
#

for obsfucated just run buildtools and change spigot-api to spigot

mortal hare
#

i've spent 2x more books

#

and cant access 30 lvl lol

remote swallow
#

lvl 60 enchants when

#

82 minutes

quaint mantle
mortal hare
remote swallow
vital minnow
#

yes

quaint mantle
#

it's not found

remote swallow
#

you havent ran buildtools then

#

?bt

undone axleBOT
upper hazel
#

how i can check all material instensof InventoryHolder

#

ItemStack

#

create block?

valid burrow
#

i just saw you can also check if a user has a permisson using lp anyone know how it works im too stupid

quaint mantle
#

how do i get the goalselector of a existing entity zombie.getHandle().?

remote swallow
valid burrow
#

?

remote swallow
#

probably

valid burrow
#

arlight th

remote swallow
#

you probably wanna use getNodes(NodeType<T> type)

#

to only get permissions

sterile token
#

Epic testing i realize that == is not correct for inventores. I did it with equals and there no problem they are found correctly

lilac dagger
#

it is merely a problem in older minecraft versions

sterile token
#

Okay that mkes sense know

mortal hare
#

umm i found documentation or bukkit api implementation bug

remote swallow
#

report it on jira or check for already existing bugs

mortal hare
#

according to documentation if there was a conflict between two commands which were registered within the same plugin (2 commands with the same name), it should be /foo:foo:mycommand and for another one /foo:mycommand

#

in reality its only one which gets prepended

remote swallow
#

?mappings

undone axleBOT
quaint mantle
#

i tried entity.getHandle().PathfinderGoalSelector but No matching non-static field: EntityZombie#PathfinderGoalSelector

remote swallow
#

so use the link the bot just sent you

chrome beacon
#

I believe it's just getGoalSelector

#

I really hope you aren't in an obfuscated environment because that would be a pain to work with

#

?nms

quaint mantle
#

but i'm just trying to find to the field name

vast raven
#

https://paste.md-5.net/acabikuqow.css

This is inside a protocollib asynch MAP_CHUNK packet listener. In theory it should prevent the loading of a tile entity and it works. My question is how to modify it, to let only close tile entites load

chrome beacon
#

If you just want to see the obfuscated name then use the link that Ebic sent

remote swallow
#

Zombie extends Monster and Monster extends PathfinderMob

river oracle
#

I wish that mappings site showed all extensions and implementations of interfaces and classes

remote swallow
#

yeah

river oracle
#

that'd be cool as hell i can see how that'd be a lot of work though

remote swallow
#

would be nice

#

just make javadocs with mappings

chrome beacon
#

It's a field in Mob

river oracle
#

parchmant kinda adds javadocs but no site for that

#

I wish parchment did have a site that'd be cool

chrome beacon
#

Now why are you working in an unmapped environment

restive mango
#

anyone know

chrome beacon
#

Just use mappings?

river oracle
river oracle
#

(I'm staying away from the web) thank you very much

river oracle
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

hardy cairn
#

hi can anyone help me ? i want to add a custom texture for my items in my plugin can someone help?

#

please

chrome beacon
#

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

#

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!

quiet ice
peak depot
# restive mango Is there a pre-made system (like chatstream) to create a menu in the chat with b...
    @EventHandler
    public void onChat(net.md_5.bungee.api.event.ChatEvent event) {
        ProxiedPlayer player = (ProxiedPlayer) event.getSender();
        if (!module.getBanManager().isMuted(player.getUniqueId())) return;
        event.setCancelled(true);
        player.sendMessage("§cDu wurdest aus dem Chat gebannt. §cGrund: §e" + module.getBanManager().translateReason(module.getBanManager().banReason(player.getUniqueId(), false)));
        player.sendMessage("§aVerbliebene Zeit: " + formatTime(module.getBanManager().getRemainingTime(player.getUniqueId(), false)));
    }
``` why does it kick me when I remove the mute for: Received chat packet with missing or invalid signature.
sterile token
#

Please for.long code use paste md5

undone axleBOT
glacial narwhal
#

I looked up on google everybody seems to do it like that

smoky oak
#

qq, whenever i start IntelliJ up these days i get a low memory warning, but my memory's like 16 GB free?

#

it cant possibly need that much

#

no like

#

i have 32 GB, and my system is using maybe 8 idle

sterile token
#

Mines directly doesnt open i dont assign 32gb

smoky oak
#

how do you assign memory to programms directly then?

sterile token
#

Ij config

#

I'm the files

#

Yeah there

smoky oak
#

brah its less than 1 GB on both

sterile token
smoky oak
#

wasnt here for that

sterile token
#

Lmaooo

#

How does that shit Even Open

smoky oak
#

actually

#

do i put in there 1000 or 1024 per GB

sterile token
#

Me having a r 7 5800x and 128gb, doesnt open if i don't assign 32gb to it

smoky oak
#

i always forget

#

I'd like to set GB exact

sterile token
#

So 6G

smoky oak
#

that'd do it

sterile token
#

If want megas 1024M = 1G

smoky oak
#

1g 8g should be fine

sterile token
#

What?

smoky oak
#

for xms and xmx

sterile token
#

I just put

32G 32G

smoky oak
#

yea that aint gonna be possible on me

sterile token
#

Yeah You can adjunto it

#

Please give coding ideas

#

Idk what to code tho

smoky oak
#

i dont get ideas for coding

#

i only get ideas for fanfiction

#

(dont look me up)

sterile token
#

Haha, actually coding a platform independent library

smoky oak
#

ah

#

i think i know why its throwing oom errors

#

i thought it caches it -.-

sterile token
#

Males sense jajaja

#

It doesnt catch it

#

That happen Even me with 32G assigned to IJ

#

Just don't Open it

#

Ir doesnt crash anymore @last temple ?

smoky oak
#

ah

#

right

#

i had that open cuz i wanted to look at the methods in it

sterile token
#

Lol mine still and i assigned 32G but same shit

smoky oak
#

LOL the error changed from a red ! to a yellow !

#

less severe error i guess bruh

gritty juniper
#

Where is the best place to learn java?

sterile token
#

Ryzen 7 5800x

sterile token
gritty juniper
sterile token
undone axleBOT
gritty juniper
sterile token
#

Those are the one which spiot recommend

gritty juniper
#

Ty

sterile token
#

Because in videos You don't learn that the truth, You just use what he tells and nothing else. Is like cooy pasting

gritty juniper
#

True

#

Thank you sir

sterile token
#

No problem just feel free yo ask

#

Maybe there are easier info i Will have to look at it

#

I find them i Will make you know. Emjoy learning and most important rule, programming learning is progresive

#

You won't learn from day
To night

crimson scarab
#

what is the particle limit

sterile token
crimson scarab
#

ive been messing around with spawning particles

peak depot
#
    @EventHandler
    public void onChat(net.md_5.bungee.api.event.ChatEvent event) {
        ProxiedPlayer player = (ProxiedPlayer) event.getSender();
        if (!module.getBanManager().isMuted(player.getUniqueId())) return;
        event.setCancelled(true);
        player.sendMessage("§cDu wurdest aus dem Chat gebannt. §cGrund: §e" + module.getBanManager().translateReason(module.getBanManager().banReason(player.getUniqueId(), false)));
        player.sendMessage("§aVerbliebene Zeit: " + formatTime(module.getBanManager().getRemainingTime(player.getUniqueId(), false)));
    }
``` why does it kick me when I remove the mute for: Received chat packet with missing or invalid signature.
crimson scarab
#

when i get past a certain amount they flicker

sterile token
#

Oh okay

sterile token
#

Have u try asking GPT he most of the time he know the solution

rotund ravine
#

Sadly altered messages etc are not signed so you gotta turn off the ensurage thingy

peak depot
#

where?

rotund ravine
#

server.properties

peak depot
#

it is allready off

sterile token
#

No other solution sorry

peak depot
#

so i basicly can not filter messages?

sterile token
#

What yo doing?

#

a chat filtre

peak depot
#

yes and check if hes allready muted

sterile token
#

that what i understand by filter messqges

#

But why vía packets?

peak depot
#

not via packets its bungeecord

sterile token
#

Doesnt have a chat event

peak depot
sterile token
#

Get the text component, them the text

crimson scarab
#

is there a faster way to spawn particles than with the bukkit api

sterile token
#

And apply regex

hardy cairn
#

yo is there anyway i can set some custom keybinds for some events in my code?

#

like X,Z keybinds and stuff

hardy cairn
#

ok

icy beacon
hardy cairn
#

ah damn...

sterile token
#

server doesnt know what client keybind runs

hardy cairn
#

ok

icy beacon
#

You can listen to keybinds that actually do something, e.g. you can detect pressed F when a player changes their main-hand to off-hand, etc

#

But it's not like you can "listen" to keybinds specifically

#

You can only deduce

sterile token
#

You can't even listen to WASD that totally shity

icy beacon
#

And you can't know for sure if the key is F

hardy cairn
#

dayum

icy beacon
#

Because keybinds are customizable

quaint mantle
#

is plugin.getPluginMeta().getVersion() still a thing ? i cant seem to be able to use it

orchid trout
#

like f could be flight toggle key

hardy cairn
#

is there is some api which can help me maybe

sterile token
icy beacon
hardy cairn
#

ok thanks for helping

sterile token
#

It's imposible bro

icy beacon
#

Only mods can do that, not pluigins

quaint mantle
icy beacon
#

Np

hardy cairn
#

ok got it

#

thanks ZBLL and VERANO123

icy beacon
#

Np

#

Happy coding

sterile token
#

maybe a mod which transmit what he press vía plugin messaging channel yo server

icy beacon
#

Hmmmmmm

#

That sounds very hacky

#

But perhaps

sterile token
#

Yeah just a wa je can do it

icy beacon
#

And that'd require the player to install the mod

hardy cairn
#

uh its ok i will do something else

icy beacon
#

Which is not always convenient

sterile token
icy beacon
#

The idea is actually a good one, especially considering that there's no much room for imagination here haha

sterile token
#

Zbl

#

Do You have xp with abstracting?

#

I'm coding a platform indepent api plugin

#

And i need to learn the best way to abstracta the things between spigot and proxies

#

I mens anyone know about ir could help there

#

Conclure say it

#

I lalresdy seen yo 😂

scenic onyx
#

How does "PacketEventsAPI" work?? I didn't understand how to record an event

crimson scarab
#

hey i need a math experts help

#

how can i rotate something around its self like 360 degrees

#

like this

hardy cairn
#

ayo how can i add stylish font in my plugin anyone got an idea?

#

i want to add like stylish font on my item lore anyone know how?

sterile token
#

And why i was told to use the == so? Its creappy haha

hardy cairn
#

yo VERANO123 ya know how can i add stylish font to my item lore??

#

it would be a huge help🙏

slate tinsel
#

When I use:

saveDefaultConfig();
System.out.println(getConfig().getBoolean("item-settings.bow.inv-slot"));

So instead the data is loaded from my code's config.yml instead of the one in the plugin folder when you use the plugin.

hardy cairn
#

uh sorry but i dont think i can help you

sterile token
#

You can use a simple class i have done for that

#

Do you want to give a try?

slate tinsel
sterile token
#

It will also handle file loading if they are whitin a folder, you just create an ins

#

inhetitation

#

no? I use it with no overflow exception. It works perfect i would say

crimson scarab
#

i sumon this with particles

#

your code rotates through the y axis

hazy parrot
#

Assuming you are saving your instance, not making new inventory every time

smoky oak
#

uh where new?

zealous osprey
#

¯_(ツ)_/¯

valid burrow
#

since this is deprecated what should i use nowadays

glacial narwhal
valid burrow
#

i know

#

but

#

usally its not a good idea

#

and since its depricated i assumed theres a better way now

glacial narwhal
remote swallow
#

addEntry

valid burrow
#

add entry wants a string

#

so playname?

remote swallow
#

no clue

#

prob name or uuid

valid burrow
#

ill look it up

tall dragon
#

its name

valid burrow
#

arlgiht thx

glacial narwhal
remote swallow
#

no

#

use getName

#

display name may not match the actual name

glacial narwhal
valid burrow
glacial narwhal
#

a

restive mango
#

nah i figured it out

#

there isn't a premade system which is rough

#

so i just made text buttons that sent the same command but changing a param to change your position in the list

#

i mean rough that it has to grab a new list every time but it's not actually a big deal since there'll be only <1000 entries

scenic onyx
#

how i can adjust it?

smoky oak
#

Inventory has contains but not count? Is there something I'm overlooking?

lost matrix
smoky oak
#

no like

#

amount of items of material

#

i can only test exact, not query the count

lost matrix
#

That sounds like a pretty specific method. You can get all ItemStacks of a Material and sum their amount.

smoky oak
#

ye im doing that right now

#

im just confused why it aint default

lost matrix
odd lark
lost matrix
smoky oak
odd lark
lost matrix
odd lark
#

thanks

lost matrix
smoky oak
#

first

#

idc how long writing it takes

lost matrix
# smoky oak idc how long writing it takes

Writing it was quite quick

    Inventory inventory = ...;
    Material stone = Material.STONE;
    int amount = inventory.all(stone).values().stream().map(ItemStack::getAmount).reduce(0, Integer::sum);
smoky oak
#

that wasnt the point and u know it lol

lost matrix
#

🙂

#

Performance wise it really doesnt matter

smoky oak
#

i just think that inventory.all must have overhead

#

eh fair

lost matrix
#

It creates a map and puts all items in there. Its a tiny overhead compared to just iterating the content yourself.

smoky oak
#

i see

lost matrix
#

But do what suits you best. Maybe even make a util method

smoky oak
#

i am writing util methods, but not cuz i want stuff granular but cuz different things operate on a set of materials, or single material

#

annoying that events dont have a @After annotation

#

to run code after the event itself concludes

#

im doing Runnable.RunTaskLater(0)

#

hm this is weird. I coudl've sworn inventory had a remove(material, count) returns HashMap<? extends ItemStack> method but i cant find it

#

@lost matrix any idea? U seem to know inventory

glad prawn
#

removeItem

smoky oak
#

no i am fairly sure theres a method with the signature above

#

not with ItemStack

icy beacon
#

Your signature is invalid anyways because HashMap takes two generic arguments, not one

smoky oak
#

Hash set then

#

like i couldve sworn i saw a remove(material int) method

icy beacon
#

And (Material, int) is basically (ItemStack)

smoky oak
#

im pretty sure i cant tell that method to remove an itemstack with more than 64 items

#

doesnt itemStack auto-cap itself to the limit values?

#

wtf is this constructor lol

glad prawn
#

like clone

smoky oak
#

like this is confusing

#

the only other set of constructors is deprecated

#

how r u supposed to make itemstacks

lost matrix
icy beacon
#

This isn't probably the right place to ask, but I bet somebody here would know webdev. How would I implement such a structure with html? I've sorta managed to do the navbar & footer, but the content goes under the footer with my current approach:

(uses Tailwind CSS)
<div class="container block">
    <!-- Navbar -->
    <section>
        <nav id="ch-navbar" class="block bg-primary w-1/6 h-screen"> <!-- snip --> </nav>
    </section>

    <!-- Content -->
    <section class="content w-auto h-auto"> <!-- snip --> </section>

    <!-- Footer -->
    <section>
        <div id="ch-footer" class="flex w-full absolute bottom-0"> <!-- snip --> </div>
    </section>
</div>
smoky oak
#

wym 'Materials' btw, there's no method returning itemStack in material i can see

opal juniper
#

new ItemStack(Material.STONE)

#

for example

smoky oak
#

deprecated

#

what is so difficult to understand about me saying 'it calls deprecated methods'

icy beacon
smoky oak
#

uuuuurgh please just read the code in the screenshot
ItemStack(Material) calls ItemStack(Material, count) calls deprecated ItemStack(Material, count, damage)

#

this and the clone constructor are the only constructors i can see

#

well, theres a protected constructor for an empty itemstack but i dont think i can make use of that

#

hm

#

when are itemStacks culled to their maximum sizes?

scenic onyx
#

because dont go?

kindred sentinel
#

How to add achievments to minecraft?

#

So plugins can't add achievments?

#

Like this

remote swallow
#

datapacks can add achievements

#

id guess plugins can too

kindred sentinel
#

yeah this i know

#

that datapacks can add achievements

slender elbow
#

I mean there's UnsafeValues#loadAdvancement

#

but you still need the same json as you would with a datapack anyway

bronze crystal
young knoll
#

The java package your plugin is using

#

ie me.jishuna.myplugin

lilac dagger
#

com.eviperz.projectname

remote swallow
#

xyz.epicebic.plugin

smoky oak
#

i just use github

remote swallow
#

smh

river oracle
#

sh.miles.plugin

#

cuz my domain

lilac dagger
#

wait, for github io, is it io.github.prefix.project name or prefix.io.github.projectname

remote swallow
#

brigadier nerds, is <something> required or is [<something>] requires param

#

i feel like 1st is required, 2nd is optional

bronze crystal
#

Ty guys but I get this error: Unsupported class file major version 60

bronze crystal
#
<relocations>
  <relocation>
    <pattern>org.bstats</pattern>
    <shadedPattern>at.evipez.craftingtableplus</shadedPattern>
  </relocation>
</relocations>
``` if I remove this block the error disappers
lilac dagger
lilac dagger
remote swallow
#

is the error in server conosle or ide

bronze crystal
#

ide

remote swallow
#

is that the full error? not max supported is xyz

#

wait

#

update ur maven shade plugin

#

latest is 3.5.1

bronze crystal
#

lol it works

#

thank you

#

weird

tranquil dome
#

Does anyone know how I can define my own logging format? I have tried making my own Logger and adding a new ConsoleHandler to it with a custom formatter and disabling parent handlers, but this did not log any messages. If I enabled parent handlers, it would print out messages but only with the parent's formatter. I gave up on this approach and tried to send messages by using System.out.print and Bukkit.getCommandSender().sendMessage(), but this resulted with duplicate timestamps and levels (see image).

smoky oak
#

alright what the fuck intellij

remote swallow
#

average ij moment

#

reload maven/gradle

smoky oak
#

did

remote swallow
#

if it doesnt work invalidate caches

smoky oak
#

wheres that?

young shell
#

Yeah IntelliJ likes to get drunk

young shell
smoky oak
#

that did it thanks yall

#

correction

#

it no longer displays errors

#

my javadoc's gone

remote swallow
#

redownload sources and javadocs

smoky oak
#

ah it works

#

apparantly it takes a while to load weird

remote swallow
#

thats probably it indexing

smoky oak
#

print out the class of the loggers, throw out the bukkit/spigot logger, register your own

tranquil dome
smoky oak
#

?

#

lmc that

#

brb

tranquil dome
#

This is what I used to do in the constructor of my logger. I would make a new handler, set its level to ALL and make my own formatter. Then add the handler to the logger and set useParentHandlers to false.

    init {
        val handler = ConsoleHandler()
        handler.level = Level.ALL
        handler.formatter = object: Formatter() {
            override fun format(record: LogRecord?): String {
                val time = SimpleDateFormat("hh:mm:ss").format(Date())
                val level = when (record!!.level) {
                    Level.SEVERE -> " ERROR"
                    Level.WARNING -> " WARN"
                    Level.INFO -> " INFO"
                    Level.CONFIG -> " CONFIG"
                    Level.FINE -> " DEBUG"
                    Level.FINER -> " DEBUG+"
                    Level.FINEST -> " DEBUG++"
                    else -> ""
                }
                val color = when (record.level) {
                    Level.SEVERE -> "\u001B[31m" // Red
                    Level.WARNING -> "\u001B[33m" // Yellow/Orange
                    Level.CONFIG -> "\u001B[34m" // Blue
                    Level.FINE, Level.FINER, Level.FINEST -> "\u001B[36m" // Cyan
                    else -> "\u001B[0m" // Default
                }

                return "$color[$time$level] $name${record.message}\u001B[0m"
            }
        }

        addHandler(handler)
        level = Level.INFO // Default to INFO level logging.
        useParentHandlers = false
    }
smoky oak
#

bruh the default listener aint in logger

tranquil dome
#

Why I'm doing this is because Bukkit's logger is at the INFO level, and turning it up will log unwanted messages.

smoky oak
#

wtf

#

hm

#

what you might be able to do is to just add a handler that only logs >info messages

#

but i dont see a simple way to get rid of the default bukkit logger right now

zealous scroll
#

What would be the best way to check if a line defined by a start and an end vector intersects with a BoundingBox? I can't use the BoundingBox#overlaps method because that creates another box with the start and end vectors as corners and not a line

tranquil dome
#

So that logger is probably defined inside the spigot jar and not accessible by the api?

smoky oak
#

i... honestly have no idea. I just made a custom logger to provide specific information if Exception.printStackTrace is called

smoky oak
hazy parrot
#

Cant you just get root logger and set it's level?

smoky oak
#

see screenshot, dont think so

smoky oak
tranquil dome
# hazy parrot Cant you just get root logger and set it's level?

I could set the level of the plugin logger, but it would log method invocations as well which I do not want. Code:

        val handler = ConsoleHandler()
        handler.level = Level.ALL
        logger.addHandler(handler)
        logger.level = Level.ALL
        logger.severe("It should print this")
        logger.warning("It should print this")
        logger.info("It should print this")
        logger.config("It should print this")
        logger.fine("It should print this")
        logger.finer("It should print this")
        logger.finest("It should print this")
#

Nor did it change the level in the original time stamp. All other levels default to WARN

smoky oak
#

r u not supposed to manually log that

tranquil dome
#

I don't want to use the plugin logger anyway. I just want to print my own debug messages to the console with a blue color. The problem is that the prefix will always say INFO and be white (like shown in the screenshot a couple messages back). I want this to be consistent with warnings and errors from the bukkit logger.

#

But it seems that would be impossible

smoky oak
#

I'm about 95% sure you can just log whatever u want

sterile breach
#

Hello, i have a question if i don't use @eventhandler encore my event methode. The event méthode will be called or not ?

tall dragon
#

no it will indeed not be called

tranquil dome
smoky oak
#

?

#

look at exceptions

#

theyre logged once with and once without prefix

sterile breach
tranquil dome
#

What method do you use to log?

scenic onyx
#

Hi, i do:
PacketEvents.getAPI().getEventManager().registerListener(new dev.scienziato1pazzo.it.infiniteanticheat.checks.event.PacketEvent());
PacketEvents.getAPI().getEventManager().registerListener(new dev.scienziato1pazzo.it.infiniteanticheat.player.events.PlayerJoinEvent());
PacketEvents.getAPI().getEventManager().registerListener(new dev.scienziato1pazzo.it.infiniteanticheat.player.events.PlayerLeftEvent());
but it dont go and dont give error

smoky oak
tranquil dome
#

How could I find that?

smoky oak
#

good luck man lol
i looked a bit through it, potentially thorugh Handler?

tranquil dome
#

Ah I'll try messing around with that then. If it won't work, I'll just have to live with the INFO prefix. Thank you.

smoky oak
#

actually @tranquil dome just try this: grab the System.out stream and use messages on that

#

I've also tried to look through LP but its too big for me to quickly find anything

#

potentially Bukkit.getServer().getConsoleSender()

scenic onyx
#

?paste

undone axleBOT
tranquil dome
#

You mean System.out.println()?

#

Both that and sendMessage() use the format with the prefix I mentioned earlier

smoky oak
#

hm

#

now i want to figure this out

tranquil dome
#

I've got something new

#

But no idea if this is helpful

#

Still uses the prefix

smoky oak
#

have you checked what your val printStream is?

tranquil dome
#

ignore naming

tranquil dome
#

so i've got the parent highest in hierarchy and it's not the format highest in hierarchy

#

Suffix or prefix? Also I tried printing to sout but it still has the prefix

smoky oak
#

consoleSender.RawMessage still prints the infno thing

#

hm

#

theres a thread that's an instance of TerminalConsoleWriterThread containing a OutputStream

#

theres a chance if you can somehow grab that you can write raw text to console

#

oh ffs

tranquil dome
smoky oak
#

in which dependency is craftbukkit.util

#

its not in the remapped one

#

interesting, if i flush System.out and append TEST and flush again, this is the result

#

and println produces this

#

that would only work local

#

for a plugin this isnt ideal

#

itd only work for 1 plugin at a time

#

no, he wants to get rid of the prefix

eternal night
smoky oak
#

im a bit confused how system.out still adds that

tranquil dome
#

Just for one plugin though

#

Not get rid of the prefix for all plugins

smoky oak
#

huh this is weird

#

System.out in spigot is apparantly a log4j iostream

#

apparantly its overwrittein in DedicatedServer

tranquil dome
#

With this, how would I log? Still with sout?

#

And if the logger has the same name as the one defined in the xml file, it will override?

ivory sleet
smoky oak
#

who changes system.out bleh

#

I think whats required here is to create a printstream

ivory sleet
#

It has to be done at some point when it comes to logging/managing the std in and out

smoky oak
#

i see

#

any idea how to get the base console output stream

#

ah that wouldnt actually write to the logs would it

#

uuuurgh

eternal night
#

cursed

smoky oak
#

bleh internet says to just cache System.out

ivory sleet
#

Myeah

smoky oak
#

can we intercept system.out before DedicatedServer overwrites it

ivory sleet
#

Probably not, but I mean, what exactly are you trying to do

#

Sounds like an xy problem

smoky oak
#

not have the [SERVER] stuff in front of console output

eternal night
#

I mean, that is logger stuff tho

ivory sleet
#

Cant you just add a loghandler or whatever its called

smoky oak
#

apparantly not

tranquil dome
#

Remove the timestamp here for example

smoky oak
#

Bukkit.getLoggers is empty

#

for SOME reason

#

the default logger isnt there

remote swallow
#

epic reload fail

smoky oak
#

logp aint doing it either

#

it still appends it

#

yea wrong window sue me

#

bleh anything involving the word 'prefix' spits out vault/pex/Lp results

tribal nebula
#

wath is the best language to code one plugin?

smoky oak
#

java, servers tend to not run .exe files :kekw:

remote swallow
#

if you know java fully java or kotlin, if not java

smoky oak
#

thats an empty line for me

#

oh wait

#

this gave me an idea tho

#

man the intellij debugger is stupid

#

VK_DOWN gives me the last input but VK_UP doesnt restore what i typed

#

also grabbing the logger as described there aint helping urgh

#

bah im out of ideas

#

oh?

#

i wrote to the System.console().out stream and there was no message at all

#

thats already false

#

wait

#

oh u mean something else

valid burrow
#

anyone know a good npc api?

remote swallow
#

citzens

smoky oak
#

so apparantly System.console is completely ignored by minecraft, somehow

valid burrow
remote swallow
#

no

valid burrow
valid burrow
smoky oak
#

System.console().writer().out.write("String") doesnt show up in the console

worldly ingot
#

Well, Citizens 2 is premium, but you can get free builds via their Jenkins

worldly ingot
#

If you can pay for it, you probably should

smoky oak
#

me losing my mind

valid burrow
#

why not just System.out.println("") what is writer supposed to be for

valid burrow
lilac dagger
#

yes

smoky oak
#

see this chat for the last half an hour

valid burrow
#

well uh

#

i can tell you for certain that it does not normally get ignored

#

i use it all the time for debugging

smoky oak
#

i know its possible

#

exception.print does not have that prefix after all

#

BRUH

#

WHAT THE HELL IS THIS

#

I'm done

#

im so done

valid burrow
#

xD

wet breach
#

you can change the output by supplying a different settings file

smoky oak
#

well i know that

#

but i want to make it possible for more than one plugin at once

#

though...

#

maybe

wet breach
#

supplying a different settings file would change it globally

smoky oak
#

can we manipulate exceptions to not print their stack trace when they're thrown

worldly ingot
wet breach
#

its not easy to do it on a per-plugin basis to begin with

smoky oak
#

its something about the throw keyword that does it

#

it still shows up in the logs but doesnt have the prefix

wet breach
smoky oak
#

hmmmmm

wet breach
#

there is two ways you could do it

#

you can set the uncaught exception handler of the thread

#

Thread.currentThread().setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler CaughtIt)

#
public class SomeException  extends Exception  {
    public synchronized Throwable fillInStackTrace()  { return this; }
}
#

this should remove the stack trace and only leave the message if there is one

#

caveat of the thread one, is that you would need to set it for every thread, not just the main thread lol

smoky oak
#

I'm having a much more elemental issue, manually throwing an exception doesnt compile, it demands i make a try/catch around it

worldly ingot
#

cringe

wet breach
smoky oak
#

yea well

sick edge
# young knoll yay maps

@young knoll and what is your custom inventory? Just a class that contains an Inventory and more?

wet breach
#

then just surround the code with a try and catch 😛

#

throw the exception before the catch, catch said excecption in the catch

#

and do whatever

smoky oak
#

oh wait

#

std.err

#

brb

echo basalt
#

consumer list

#

ehh

#

I have an AttachableConsumer class you can attach actions to

smoky oak
#

GODDAMMIT

#

seriously how do exceptions work

remote swallow
#

idk

#

ask the exception

wet breach
#

well depends on the exception

#

you have Exceptions and RuntimeExceptions

smoky oak
#

no i mean

#

why dont exceptiosn have the prefix

#

system,err has

wet breach
#

becaues its two different api's

smoky oak
#

interesting

#

so it is required to be RuntimeException?

wet breach
#

those are generally your more severe ones

#

IE nullpointer for example is a runtimeexception

#

where as FileNotFound is an Exception only

#

one is more severe then the other

smoky oak
#

and also the only one without a prefix

wet breach
#

you can create a class that extends RunTimeException

#

and create your own exceptions of those kind

smoky oak
#

yea this leaves one problem tho

#

to get rid of that path and replace it with something else

wet breach
#

you can do that when you create your custom exception by overriding stuff

smoky oak
#

?

#

how so

#

the only variable i see is the text after the path

wet breach
#

might need to use suppression?

#

Otherwise its going to be down to intercepting output

#

which is not overly difficult, but the output isn't controlled by MC

#

its controlled by JANSI lib

#

JLine

smoky oak
#

hm

#

i have 1 other idea then ill do urs

wet breach
#

you could also just set the log level too for it

#

just set it to warning if you just want it to warn

#

or if you want it globally may have to introduce your own logger

smoky oak
#

bleh this is irritating

#

i traded one prefix for another

grand flint
#

Am I meant to have this many external libraries?

remote swallow
#

ye

#

transitive deps

wet breach
smoky oak
#

to... have custom output?

grand flint
#

What about this?

wet breach
#

Ah ok, yeah might have to look into using a custom logger

#

and hook it into the server

#

other then changing the settings file for Log4J

smoky oak
#

wouldnt that still f me cuz both system.out and system.err are somehow only returning an intermediary print stream?

#

like

#

the exception system.err adds the class name to itself

wet breach
#

not entirely sure, I haven't really messed with the log4j settings, but as far as I know it can do a lot in terms of tailoring the output. The only downside of it is that only one settings file may be registered for the entire application

smoky oak
#

well yea, I'm trying to find a way to not have to do that

#

that way more than one plugin can use custom output

#

'use me and nothing else' is not good design philosophy

wet breach
#

Well, its used because most people don't even know how to interpret the problems to begin with and its not usually ideal to hide away the details

smoky oak
#

its not specifically about exceptions

#

its just that i noticed that throws results in a non-mc prefix

#

but apparantly that has its own damn prefix

grand flint
smoky oak
#

bleh i give

#

ill come back to this later

wet breach
#

probably wise

tranquil dome
#

I appreciate you taking the time to look into this and I'm sorry for no longer being able to really add onto this.

smoky oak
#

nah spigot is just stupid

#

like seriously

tranquil dome
#

If you come to a solution, could you ping me in the message?

smoky oak
#

who changes the DEFAULT OUTPUT streams

#

sure

tranquil dome
#

thank you

smoky oak
#

hm though that gives me one idea. If spigot overrides them, why can't we override them, and just pass it back to spigot if it doesnt have a specific identificator prefix string

#

ill look into that later ig

wet breach
#

because it isn't spigot overriding them

smoky oak
#

?

#

isnt that what it's doing in System.setOut in DedicatedServer# ~150 ?

wet breach
#

You have Log4J for the logging output

#

and then you have Jline for the console

smoky oak
#

whats the difference?

wet breach
#

I mean I suppose you could redirect the Out to somewhere else, but its not Spigot directly doing anything beyond setting where output should go, otherwise it goes into the abyss

#

So you have Log4J for the logging of anything, and then everything is directed to Jline, which is the console, and then JANSI is part of JLine which gives you the colors and the sorts

#

but spigot isn't dictating what these things should or should not be doing

smoky oak
#

wait

#

is it Log4J adding those prefixes then?

wet breach
#

probably

#

but its a pain to deal with because as I said, you can't register more then one settings file

#

and that file applies globally

#

the setOut if I recall should be setting output to Jline

smoky oak
#

at this point I'm tempted to just eat the JANSI code and make my own console urgh

wet breach
#

logger is registered differently

#

you probably could register your own logger

smoky oak
#

ive worked a bit with those, but nothing with console output

#

ill look into it later

young knoll
#

My brain is failing to make an sql schema

I have dungeons, floors, and rooms.

One dungeon can have many floors, and one floor can have many rooms. A room can belong to multiple floors and a floor can belong to multiple dungeons

I need a dungeon table, a floor table, and a room table.

Then I also want a table to connect dungeon <-> floor and a table to connect floor <-> room

Do I have this right

wet breach
#

you would need to use foreign keys for this

#

so you can associate what goes with where

smoky oak
#

sounds like you should cut out at least part of that. WYM a room can be in multiple floors? Are you making your dungeon out of preset rooms?
I think what you need is a table ROOMID -> ROOM, a table Dungeon -> Floors and a table Floor-> rooms. Depends which information you need, mostly, but having a floor belong to multiple dungeons would require extra information

young knoll
#

Yes it makes a dungeon out of preset rooms

smoky oak
#

what about the floors?

#

like

young knoll
#

The floors are basically templates to build a floor, and a template can be reused by multiple dungeons

smoky oak
#

ah

#

ye then youre probs fine with a list of floors per dungeon and a list of rooms per floor

#

i thought you meant individual floors having connections to multiple dungeons

young knoll
#

Yeah I guess floor template is a better name

short pilot
#

what's a good way to implement an invites system for a factions plugin? Store the invites per faction mapping to a player or something?

wet breach
#

Well, the question is, what are you needing to accomplish with the DB

grand flint
#

Can I use java 19 with gradle?

wet breach
#

what data does it need to hold?

sick edge
#

Should I just use null as InventoryHolders for my custom inventories?
Btw I modified my customInventories now your lib is a great reference @young knoll

remote swallow
wet breach
#

or is it just holding the template info for each?

grand flint
remote swallow
grand flint
#

Ah, where would I upgrade that? I just built it using minecraft development plugin

remote swallow
#

java 19 needs 7.6

remote swallow
#

https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip would become https\://services.gradle.org/distributions/gradle-7.6-bin.zip

smoky oak
#

s what i did for a vault plugin

sick edge
#

😉

remote swallow
#

dont use the holder api to determin if its ur inv

smoky oak
#

ur code is weird then

remote swallow
sick edge
grand flint
#

I only got this in the wrapper file

smoky oak
#

mate

#

i write working code, not good one

remote swallow
sick edge
grand flint
#

And in that is

remote swallow
#

are you in your project

grand flint
remote swallow
#

open the gradle folder

#

3 down

grand flint
#

oh

#

Got it

#

Thank you very much ❤️